stripe 15.2.0.pre.beta.1 → 15.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (648) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +718 -1556
  3. data/CONTRIBUTING.md +25 -0
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +10 -7
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_requestor.rb +0 -28
  8. data/lib/stripe/api_version.rb +1 -1
  9. data/lib/stripe/errors.rb +0 -54
  10. data/lib/stripe/event_types.rb +0 -89
  11. data/lib/stripe/object_types.rb +0 -52
  12. data/lib/stripe/resources/account.rb +32 -657
  13. data/lib/stripe/resources/account_session.rb +59 -253
  14. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  15. data/lib/stripe/resources/balance.rb +42 -0
  16. data/lib/stripe/resources/balance_transaction.rb +2 -0
  17. data/lib/stripe/resources/bank_account.rb +2 -2
  18. data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -2
  19. data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -4
  20. data/lib/stripe/resources/billing/credit_grant.rb +0 -10
  21. data/lib/stripe/resources/billing_portal/session.rb +1 -7
  22. data/lib/stripe/resources/capability.rb +1 -1
  23. data/lib/stripe/resources/card.rb +0 -2
  24. data/lib/stripe/resources/cash_balance.rb +0 -2
  25. data/lib/stripe/resources/charge.rb +13 -1475
  26. data/lib/stripe/resources/checkout/session.rb +21 -333
  27. data/lib/stripe/resources/confirmation_token.rb +33 -263
  28. data/lib/stripe/resources/country_spec.rb +1 -1
  29. data/lib/stripe/resources/coupon.rb +2 -32
  30. data/lib/stripe/resources/credit_note.rb +10 -17
  31. data/lib/stripe/resources/credit_note_line_item.rb +0 -9
  32. data/lib/stripe/resources/customer.rb +2 -6
  33. data/lib/stripe/resources/customer_balance_transaction.rb +0 -2
  34. data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -2
  35. data/lib/stripe/resources/customer_session.rb +4 -9
  36. data/lib/stripe/resources/discount.rb +0 -2
  37. data/lib/stripe/resources/dispute.rb +2 -2
  38. data/lib/stripe/resources/event.rb +1 -32
  39. data/lib/stripe/resources/file.rb +1 -1
  40. data/lib/stripe/resources/financial_connections/account.rb +1 -20
  41. data/lib/stripe/resources/financial_connections/session.rb +2 -62
  42. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  43. data/lib/stripe/resources/identity/verification_session.rb +17 -21
  44. data/lib/stripe/resources/invoice.rb +79 -1106
  45. data/lib/stripe/resources/invoice_item.rb +4 -81
  46. data/lib/stripe/resources/invoice_line_item.rb +2 -56
  47. data/lib/stripe/resources/invoice_payment.rb +62 -4
  48. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  49. data/lib/stripe/resources/issuing/card.rb +1 -1
  50. data/lib/stripe/resources/issuing/cardholder.rb +1 -2
  51. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  52. data/lib/stripe/resources/issuing/transaction.rb +0 -6
  53. data/lib/stripe/resources/line_item.rb +0 -37
  54. data/lib/stripe/resources/mandate.rb +0 -24
  55. data/lib/stripe/resources/payment_intent.rb +1912 -6840
  56. data/lib/stripe/resources/payment_method.rb +47 -301
  57. data/lib/stripe/resources/payment_method_configuration.rb +112 -112
  58. data/lib/stripe/resources/payment_method_domain.rb +2 -2
  59. data/lib/stripe/resources/payout.rb +4 -10
  60. data/lib/stripe/resources/person.rb +2 -2
  61. data/lib/stripe/resources/plan.rb +2 -3
  62. data/lib/stripe/resources/price.rb +1 -31
  63. data/lib/stripe/resources/product.rb +1 -61
  64. data/lib/stripe/resources/promotion_code.rb +0 -10
  65. data/lib/stripe/resources/quote.rb +6 -2046
  66. data/lib/stripe/resources/radar/value_list.rb +1 -2
  67. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  68. data/lib/stripe/resources/refund.rb +6 -10
  69. data/lib/stripe/resources/reversal.rb +1 -1
  70. data/lib/stripe/resources/review.rb +1 -1
  71. data/lib/stripe/resources/setup_attempt.rb +0 -21
  72. data/lib/stripe/resources/setup_intent.rb +120 -877
  73. data/lib/stripe/resources/source.rb +1 -30
  74. data/lib/stripe/resources/subscription.rb +97 -326
  75. data/lib/stripe/resources/subscription_item.rb +32 -80
  76. data/lib/stripe/resources/subscription_schedule.rb +127 -1015
  77. data/lib/stripe/resources/tax/calculation.rb +4 -0
  78. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  79. data/lib/stripe/resources/tax/registration.rb +1 -1
  80. data/lib/stripe/resources/tax_id.rb +3 -14
  81. data/lib/stripe/resources/tax_rate.rb +2 -2
  82. data/lib/stripe/resources/terminal/configuration.rb +1 -2
  83. data/lib/stripe/resources/terminal/location.rb +2 -3
  84. data/lib/stripe/resources/terminal/reader.rb +8 -142
  85. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  86. data/lib/stripe/resources/token.rb +2 -2
  87. data/lib/stripe/resources/transfer.rb +1 -7
  88. data/lib/stripe/resources/treasury/financial_account.rb +3 -22
  89. data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
  90. data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -37
  91. data/lib/stripe/resources/treasury/received_credit.rb +1 -38
  92. data/lib/stripe/resources/treasury/received_debit.rb +1 -40
  93. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  94. data/lib/stripe/resources.rb +0 -99
  95. data/lib/stripe/services/account_external_account_service.rb +2 -3
  96. data/lib/stripe/services/account_login_link_service.rb +1 -1
  97. data/lib/stripe/services/account_person_service.rb +1 -2
  98. data/lib/stripe/services/account_service.rb +23 -559
  99. data/lib/stripe/services/account_session_service.rb +29 -229
  100. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  101. data/lib/stripe/services/balance_service.rb +1 -1
  102. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -4
  103. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +0 -4
  104. data/lib/stripe/services/billing/credit_grant_service.rb +0 -8
  105. data/lib/stripe/services/billing_portal/session_service.rb +0 -4
  106. data/lib/stripe/services/charge_service.rb +4 -1354
  107. data/lib/stripe/services/checkout/session_service.rb +13 -250
  108. data/lib/stripe/services/coupon_service.rb +2 -19
  109. data/lib/stripe/services/credit_note_service.rb +7 -12
  110. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  111. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  112. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  113. data/lib/stripe/services/customer_service.rb +3 -5
  114. data/lib/stripe/services/customer_session_service.rb +1 -4
  115. data/lib/stripe/services/customer_tax_id_service.rb +1 -2
  116. data/lib/stripe/services/dispute_service.rb +1 -1
  117. data/lib/stripe/services/file_service.rb +1 -1
  118. data/lib/stripe/services/financial_connections/account_service.rb +2 -7
  119. data/lib/stripe/services/financial_connections/session_service.rb +2 -34
  120. data/lib/stripe/services/financial_connections_service.rb +1 -2
  121. data/lib/stripe/services/identity/verification_session_service.rb +5 -13
  122. data/lib/stripe/services/invoice_item_service.rb +3 -76
  123. data/lib/stripe/services/invoice_line_item_service.rb +1 -33
  124. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  125. data/lib/stripe/services/invoice_service.rb +74 -1049
  126. data/lib/stripe/services/issuing/authorization_service.rb +4 -4
  127. data/lib/stripe/services/issuing/card_service.rb +1 -1
  128. data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
  129. data/lib/stripe/services/issuing/dispute_service.rb +2 -2
  130. data/lib/stripe/services/issuing/transaction_service.rb +0 -4
  131. data/lib/stripe/services/issuing_service.rb +1 -5
  132. data/lib/stripe/services/payment_intent_service.rb +439 -4928
  133. data/lib/stripe/services/payment_method_configuration_service.rb +82 -82
  134. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  135. data/lib/stripe/services/payment_method_service.rb +44 -226
  136. data/lib/stripe/services/payout_service.rb +2 -6
  137. data/lib/stripe/services/plan_service.rb +2 -3
  138. data/lib/stripe/services/price_service.rb +2 -21
  139. data/lib/stripe/services/product_feature_service.rb +1 -2
  140. data/lib/stripe/services/product_service.rb +2 -41
  141. data/lib/stripe/services/promotion_code_service.rb +1 -9
  142. data/lib/stripe/services/quote_service.rb +7 -1730
  143. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  144. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  145. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  146. data/lib/stripe/services/setup_intent_service.rb +119 -836
  147. data/lib/stripe/services/source_service.rb +1 -1
  148. data/lib/stripe/services/subscription_item_service.rb +27 -73
  149. data/lib/stripe/services/subscription_schedule_service.rb +101 -916
  150. data/lib/stripe/services/subscription_service.rb +85 -282
  151. data/lib/stripe/services/tax/calculation_service.rb +4 -0
  152. data/lib/stripe/services/tax/registration_service.rb +1 -1
  153. data/lib/stripe/services/tax_id_service.rb +3 -10
  154. data/lib/stripe/services/tax_service.rb +1 -3
  155. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  156. data/lib/stripe/services/terminal/location_service.rb +2 -3
  157. data/lib/stripe/services/terminal/reader_service.rb +5 -81
  158. data/lib/stripe/services/terminal_service.rb +1 -2
  159. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +33 -190
  160. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  161. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
  162. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
  163. data/lib/stripe/services/token_service.rb +1 -1
  164. data/lib/stripe/services/transfer_service.rb +1 -5
  165. data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
  166. data/lib/stripe/services/treasury/financial_account_service.rb +2 -16
  167. data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
  168. data/lib/stripe/services/v1_services.rb +2 -12
  169. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  170. data/lib/stripe/services/v2/core/event_destination_service.rb +4 -10
  171. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  172. data/lib/stripe/services/v2/core_service.rb +1 -4
  173. data/lib/stripe/services/v2_services.rb +2 -4
  174. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  175. data/lib/stripe/services.rb +1 -54
  176. data/lib/stripe/stripe_configuration.rb +1 -3
  177. data/lib/stripe/stripe_object.rb +1 -1
  178. data/lib/stripe/util.rb +1 -7
  179. data/lib/stripe/version.rb +1 -1
  180. data/lib/stripe.rb +0 -53
  181. data/rbi/stripe/resources/account.rbi +4926 -0
  182. data/rbi/stripe/resources/account_link.rbi +74 -0
  183. data/rbi/stripe/resources/account_session.rbi +1013 -0
  184. data/rbi/stripe/resources/apple_pay_domain.rbi +88 -0
  185. data/rbi/stripe/resources/application.rbi +20 -0
  186. data/rbi/stripe/resources/application_fee.rbi +118 -0
  187. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  188. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  189. data/rbi/stripe/resources/balance.rbi +235 -0
  190. data/rbi/stripe/resources/balance_transaction.rbi +147 -0
  191. data/rbi/stripe/resources/bank_account.rbi +127 -0
  192. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  193. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  194. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  195. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  196. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  197. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  198. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  199. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  200. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  201. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  202. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  203. data/rbi/stripe/resources/capability.rbi +125 -0
  204. data/rbi/stripe/resources/card.rbi +125 -0
  205. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  206. data/rbi/stripe/resources/charge.rbi +2069 -0
  207. data/rbi/stripe/resources/checkout/session.rbi +4004 -0
  208. data/rbi/stripe/resources/climate/order.rbi +245 -0
  209. data/rbi/stripe/resources/climate/product.rbi +75 -0
  210. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  211. data/rbi/stripe/resources/confirmation_token.rbi +1807 -0
  212. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  213. data/rbi/stripe/resources/country_spec.rbi +85 -0
  214. data/rbi/stripe/resources/coupon.rbi +250 -0
  215. data/rbi/stripe/resources/credit_note.rbi +752 -0
  216. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  217. data/rbi/stripe/resources/customer.rbi +1005 -0
  218. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  219. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  220. data/rbi/stripe/resources/customer_session.rbi +200 -0
  221. data/rbi/stripe/resources/discount.rbi +53 -0
  222. data/rbi/stripe/resources/dispute.rbi +761 -0
  223. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  224. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  225. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  226. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  227. data/rbi/stripe/resources/event.rbi +149 -0
  228. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  229. data/rbi/stripe/resources/file.rbi +143 -0
  230. data/rbi/stripe/resources/file_link.rbi +141 -0
  231. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  232. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  233. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  234. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  235. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  236. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  237. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  238. data/rbi/stripe/resources/identity/verification_report.rbi +360 -0
  239. data/rbi/stripe/resources/identity/verification_session.rbi +526 -0
  240. data/rbi/stripe/resources/invoice.rbi +3812 -0
  241. data/rbi/stripe/resources/invoice_item.rbi +473 -0
  242. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  243. data/rbi/stripe/resources/invoice_payment.rbi +121 -0
  244. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  245. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  246. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  247. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  248. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  249. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  250. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  251. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  252. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  253. data/rbi/stripe/resources/line_item.rbi +72 -0
  254. data/rbi/stripe/resources/login_link.rbi +19 -0
  255. data/rbi/stripe/resources/mandate.rbi +187 -0
  256. data/rbi/stripe/resources/payment_intent.rbi +9647 -0
  257. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  258. data/rbi/stripe/resources/payment_method.rbi +1761 -0
  259. data/rbi/stripe/resources/payment_method_configuration.rbi +3550 -0
  260. data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
  261. data/rbi/stripe/resources/payout.rbi +300 -0
  262. data/rbi/stripe/resources/person.rbi +401 -0
  263. data/rbi/stripe/resources/plan.rbi +371 -0
  264. data/rbi/stripe/resources/price.rbi +694 -0
  265. data/rbi/stripe/resources/product.rbi +555 -0
  266. data/rbi/stripe/resources/product_feature.rbi +26 -0
  267. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  268. data/rbi/stripe/resources/quote.rbi +1126 -0
  269. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  270. data/rbi/stripe/resources/radar/value_list.rbi +168 -0
  271. data/rbi/stripe/resources/radar/value_list_item.rbi +129 -0
  272. data/rbi/stripe/resources/refund.rbi +523 -0
  273. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  274. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  275. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  276. data/rbi/stripe/resources/reversal.rbi +51 -0
  277. data/rbi/stripe/resources/review.rbi +154 -0
  278. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  279. data/rbi/stripe/resources/setup_intent.rbi +3655 -0
  280. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  281. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  282. data/rbi/stripe/resources/source.rbi +1496 -0
  283. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  284. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  285. data/rbi/stripe/resources/subscription.rbi +2027 -0
  286. data/rbi/stripe/resources/subscription_item.rbi +404 -0
  287. data/rbi/stripe/resources/subscription_schedule.rbi +1623 -0
  288. data/rbi/stripe/resources/tax/calculation.rbi +478 -0
  289. data/rbi/stripe/resources/tax/calculation_line_item.rbi +91 -0
  290. data/rbi/stripe/resources/tax/registration.rbi +2713 -0
  291. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  292. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  293. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  294. data/rbi/stripe/resources/tax_code.rbi +44 -0
  295. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  296. data/rbi/stripe/resources/tax_id.rbi +165 -0
  297. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  298. data/rbi/stripe/resources/terminal/configuration.rbi +1386 -0
  299. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  300. data/rbi/stripe/resources/terminal/location.rbi +222 -0
  301. data/rbi/stripe/resources/terminal/reader.rbi +847 -0
  302. data/rbi/stripe/resources/test_helpers/test_clock.rbi +132 -0
  303. data/rbi/stripe/resources/token.rbi +1283 -0
  304. data/rbi/stripe/resources/topup.rbi +222 -0
  305. data/rbi/stripe/resources/transfer.rbi +199 -0
  306. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  307. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  308. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  309. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  310. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  311. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  312. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  313. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  314. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  315. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  316. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  317. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  318. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  319. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  320. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  321. data/rbi/stripe/resources/v2/event.rbi +48 -0
  322. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  323. data/rbi/stripe/resources/webhook_endpoint.rbi +168 -0
  324. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  325. data/{lib/stripe/services/external_account_service.rb → rbi/stripe/services/account_external_account_service.rbi} +124 -138
  326. data/rbi/stripe/services/account_link_service.rbi +58 -0
  327. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  328. data/rbi/stripe/services/account_person_service.rbi +1011 -0
  329. data/rbi/stripe/services/account_service.rbi +4213 -0
  330. data/rbi/stripe/services/account_session_service.rbi +646 -0
  331. data/rbi/stripe/services/apple_pay_domain_service.rbi +76 -0
  332. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  333. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  334. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  335. data/rbi/stripe/services/apps_service.rbi +9 -0
  336. data/rbi/stripe/services/balance_service.rbi +21 -0
  337. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  338. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  339. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  340. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  341. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  342. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  343. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  344. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  345. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  346. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  347. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  348. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  349. data/rbi/stripe/services/billing_service.rbi +15 -0
  350. data/rbi/stripe/services/charge_service.rbi +448 -0
  351. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  352. data/rbi/stripe/services/checkout/session_service.rbi +2614 -0
  353. data/rbi/stripe/services/checkout_service.rbi +9 -0
  354. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  355. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  356. data/{lib/stripe/services/financial_connections/institution_service.rb → rbi/stripe/services/climate/supplier_service.rbi} +25 -36
  357. data/rbi/stripe/services/climate_service.rbi +11 -0
  358. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  359. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  360. data/rbi/stripe/services/coupon_service.rbi +194 -0
  361. data/{lib/stripe/services/quote_preview_invoice_service.rb → rbi/stripe/services/credit_note_line_item_service.rbi} +16 -20
  362. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  363. data/rbi/stripe/services/credit_note_service.rbi +415 -0
  364. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  365. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  366. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  367. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  368. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  369. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  370. data/rbi/stripe/services/customer_service.rbi +647 -0
  371. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  372. data/rbi/stripe/services/customer_tax_id_service.rbi +70 -0
  373. data/rbi/stripe/services/dispute_service.rbi +424 -0
  374. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  375. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  376. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  377. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  378. data/rbi/stripe/services/event_service.rbi +83 -0
  379. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  380. data/rbi/stripe/services/file_link_service.rbi +124 -0
  381. data/rbi/stripe/services/file_service.rbi +116 -0
  382. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  383. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  384. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  385. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  386. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  387. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  388. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  389. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  390. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  391. data/rbi/stripe/services/identity_service.rbi +10 -0
  392. data/rbi/stripe/services/invoice_item_service.rbi +366 -0
  393. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  394. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  395. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  396. data/rbi/stripe/services/invoice_service.rbi +2981 -0
  397. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  398. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  399. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  400. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  401. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  402. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  403. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  404. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  405. data/rbi/stripe/services/issuing_service.rbi +16 -0
  406. data/rbi/stripe/services/mandate_service.rbi +20 -0
  407. data/rbi/stripe/services/payment_intent_service.rbi +7659 -0
  408. data/{lib/stripe/services/payment_intent_amount_details_line_item_service.rb → rbi/stripe/services/payment_link_line_item_service.rbi} +16 -20
  409. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  410. data/rbi/stripe/services/payment_method_configuration_service.rbi +2487 -0
  411. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  412. data/rbi/stripe/services/payment_method_service.rbi +776 -0
  413. data/rbi/stripe/services/payout_service.rbi +205 -0
  414. data/rbi/stripe/services/plan_service.rbi +282 -0
  415. data/rbi/stripe/services/price_service.rbi +546 -0
  416. data/rbi/stripe/services/product_feature_service.rbi +67 -0
  417. data/rbi/stripe/services/product_service.rbi +477 -0
  418. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  419. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  420. data/{lib/stripe/services/order_line_item_service.rb → rbi/stripe/services/quote_line_item_service.rbi} +16 -20
  421. data/rbi/stripe/services/quote_service.rbi +686 -0
  422. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  423. data/rbi/stripe/services/radar/value_list_item_service.rbi +109 -0
  424. data/rbi/stripe/services/radar/value_list_service.rbi +141 -0
  425. data/rbi/stripe/services/radar_service.rbi +11 -0
  426. data/rbi/stripe/services/refund_service.rbi +185 -0
  427. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  428. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  429. data/rbi/stripe/services/reporting_service.rbi +10 -0
  430. data/rbi/stripe/services/review_service.rbi +84 -0
  431. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  432. data/rbi/stripe/services/setup_intent_service.rbi +3391 -0
  433. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  434. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  435. data/rbi/stripe/services/sigma_service.rbi +9 -0
  436. data/rbi/stripe/services/source_service.rbi +663 -0
  437. data/{lib/stripe/services/quote_line_service.rb → rbi/stripe/services/source_transaction_service.rbi} +16 -20
  438. data/rbi/stripe/services/subscription_item_service.rbi +350 -0
  439. data/rbi/stripe/services/subscription_schedule_service.rbi +1290 -0
  440. data/rbi/stripe/services/subscription_service.rbi +1648 -0
  441. data/{lib/stripe/services/financial_connections/account_inferred_balance_service.rb → rbi/stripe/services/tax/calculation_line_item_service.rbi} +17 -21
  442. data/rbi/stripe/services/tax/calculation_service.rbi +234 -0
  443. data/rbi/stripe/services/tax/registration_service.rbi +1845 -0
  444. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  445. data/{lib/stripe/services/privacy/redaction_job_validation_error_service.rb → rbi/stripe/services/tax/transaction_line_item_service.rbi} +17 -21
  446. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  447. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  448. data/rbi/stripe/services/tax_id_service.rbi +110 -0
  449. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  450. data/rbi/stripe/services/tax_service.rbi +12 -0
  451. data/rbi/stripe/services/terminal/configuration_service.rbi +1118 -0
  452. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  453. data/rbi/stripe/services/terminal/location_service.rbi +182 -0
  454. data/rbi/stripe/services/terminal/reader_service.rbi +455 -0
  455. data/rbi/stripe/services/terminal_service.rbi +12 -0
  456. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +739 -0
  457. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  458. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  459. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  460. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  461. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  462. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  463. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  464. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +93 -0
  465. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  466. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +90 -0
  467. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  468. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  469. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  470. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  471. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  472. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  473. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  474. data/rbi/stripe/services/token_service.rbi +1257 -0
  475. data/rbi/stripe/services/topup_service.rbi +176 -0
  476. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  477. data/rbi/stripe/services/transfer_service.rbi +152 -0
  478. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  479. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  480. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  481. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  482. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  483. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  484. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  485. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  486. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  487. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  488. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  489. data/rbi/stripe/services/treasury_service.rbi +18 -0
  490. data/rbi/stripe/services/v1_services.rbi +77 -0
  491. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  492. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  493. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +18 -0
  494. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  495. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  496. data/rbi/stripe/services/v2/core/event_destination_service.rbi +192 -0
  497. data/rbi/stripe/services/v2/core/event_service.rbi +36 -0
  498. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  499. data/rbi/stripe/services/v2_services.rbi +10 -0
  500. data/rbi/stripe/services/webhook_endpoint_service.rbi +129 -0
  501. data/stripe.gemspec +1 -4
  502. metadata +326 -158
  503. data/lib/stripe/events/v2_core_account_closed_event.rb +0 -21
  504. data/lib/stripe/events/v2_core_account_created_event.rb +0 -21
  505. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +0 -23
  506. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +0 -21
  507. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +0 -23
  508. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +0 -21
  509. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +0 -23
  510. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +0 -21
  511. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +0 -21
  512. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +0 -21
  513. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +0 -21
  514. data/lib/stripe/events/v2_core_account_link_completed_event.rb +0 -13
  515. data/lib/stripe/events/v2_core_account_person_created_event.rb +0 -23
  516. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +0 -23
  517. data/lib/stripe/events/v2_core_account_person_updated_event.rb +0 -23
  518. data/lib/stripe/events/v2_core_account_updated_event.rb +0 -21
  519. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +0 -21
  520. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +0 -21
  521. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +0 -21
  522. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +0 -21
  523. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +0 -21
  524. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +0 -23
  525. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +0 -21
  526. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +0 -21
  527. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +0 -21
  528. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +0 -21
  529. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +0 -21
  530. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +0 -21
  531. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +0 -21
  532. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +0 -21
  533. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +0 -21
  534. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +0 -21
  535. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +0 -21
  536. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +0 -21
  537. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +0 -21
  538. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +0 -21
  539. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +0 -21
  540. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +0 -21
  541. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +0 -21
  542. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +0 -23
  543. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +0 -21
  544. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +0 -21
  545. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +0 -21
  546. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +0 -21
  547. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +0 -21
  548. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +0 -21
  549. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +0 -21
  550. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +0 -21
  551. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +0 -21
  552. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +0 -21
  553. data/lib/stripe/resources/account_notice.rb +0 -123
  554. data/lib/stripe/resources/balance_settings.rb +0 -105
  555. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  556. data/lib/stripe/resources/capital/financing_offer.rb +0 -179
  557. data/lib/stripe/resources/capital/financing_summary.rb +0 -55
  558. data/lib/stripe/resources/capital/financing_transaction.rb +0 -114
  559. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
  560. data/lib/stripe/resources/financial_connections/institution.rb +0 -90
  561. data/lib/stripe/resources/fx_quote.rb +0 -184
  562. data/lib/stripe/resources/gift_cards/card.rb +0 -208
  563. data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
  564. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -602
  565. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -82
  566. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -86
  567. data/lib/stripe/resources/issuing/settlement.rb +0 -53
  568. data/lib/stripe/resources/margin.rb +0 -115
  569. data/lib/stripe/resources/order.rb +0 -2859
  570. data/lib/stripe/resources/payment_attempt_record.rb +0 -1078
  571. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +0 -65
  572. data/lib/stripe/resources/payment_record.rb +0 -1607
  573. data/lib/stripe/resources/privacy/redaction_job.rb +0 -275
  574. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +0 -25
  575. data/lib/stripe/resources/quote_line.rb +0 -274
  576. data/lib/stripe/resources/quote_preview_invoice.rb +0 -663
  577. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -339
  578. data/lib/stripe/resources/tax/association.rb +0 -89
  579. data/lib/stripe/resources/tax/form.rb +0 -211
  580. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -31
  581. data/lib/stripe/resources/v2/core/account.rb +0 -1746
  582. data/lib/stripe/resources/v2/core/account_link.rb +0 -56
  583. data/lib/stripe/resources/v2/core/person.rb +0 -276
  584. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +0 -74
  585. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +0 -39
  586. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +0 -20
  587. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +0 -22
  588. data/lib/stripe/resources/v2/money_management/adjustment.rb +0 -51
  589. data/lib/stripe/resources/v2/money_management/financial_account.rb +0 -58
  590. data/lib/stripe/resources/v2/money_management/financial_address.rb +0 -68
  591. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +0 -94
  592. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +0 -129
  593. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +0 -82
  594. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +0 -45
  595. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +0 -117
  596. data/lib/stripe/resources/v2/money_management/payout_method.rb +0 -75
  597. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +0 -49
  598. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -136
  599. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -108
  600. data/lib/stripe/resources/v2/money_management/transaction.rb +0 -78
  601. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +0 -68
  602. data/lib/stripe/services/account_notice_service.rb +0 -101
  603. data/lib/stripe/services/balance_settings_service.rb +0 -96
  604. data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
  605. data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
  606. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
  607. data/lib/stripe/services/capital_service.rb +0 -15
  608. data/lib/stripe/services/fx_quote_service.rb +0 -123
  609. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  610. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  611. data/lib/stripe/services/gift_cards_service.rb +0 -14
  612. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
  613. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
  614. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
  615. data/lib/stripe/services/margin_service.rb +0 -119
  616. data/lib/stripe/services/order_service.rb +0 -2268
  617. data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
  618. data/lib/stripe/services/payment_record_service.rb +0 -542
  619. data/lib/stripe/services/privacy/redaction_job_service.rb +0 -231
  620. data/lib/stripe/services/privacy_service.rb +0 -13
  621. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
  622. data/lib/stripe/services/tax/association_service.rb +0 -31
  623. data/lib/stripe/services/tax/form_service.rb +0 -100
  624. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
  625. data/lib/stripe/services/v2/core/account_link_service.rb +0 -76
  626. data/lib/stripe/services/v2/core/account_service.rb +0 -4138
  627. data/lib/stripe/services/v2/core/accounts/person_service.rb +0 -1048
  628. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -135
  629. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +0 -109
  630. data/lib/stripe/services/v2/core/vault_service.rb +0 -18
  631. data/lib/stripe/services/v2/money_management/adjustment_service.rb +0 -75
  632. data/lib/stripe/services/v2/money_management/financial_account_service.rb +0 -44
  633. data/lib/stripe/services/v2/money_management/financial_address_service.rb +0 -81
  634. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +0 -126
  635. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +0 -96
  636. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +0 -202
  637. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +0 -237
  638. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +0 -174
  639. data/lib/stripe/services/v2/money_management/payout_method_service.rb +0 -95
  640. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +0 -32
  641. data/lib/stripe/services/v2/money_management/received_credit_service.rb +0 -71
  642. data/lib/stripe/services/v2/money_management/received_debit_service.rb +0 -44
  643. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +0 -70
  644. data/lib/stripe/services/v2/money_management/transaction_service.rb +0 -74
  645. data/lib/stripe/services/v2/money_management_service.rb +0 -31
  646. data/lib/stripe/services/v2/test_helper_service.rb +0 -15
  647. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +0 -50
  648. data/rbi/stripe.rbi +0 -191867
@@ -0,0 +1,3812 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ # typed: true
5
+ module Stripe
6
+ # Invoices are statements of amounts owed by a customer, and are either
7
+ # generated one-off, or generated periodically from a subscription.
8
+ #
9
+ # They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments
10
+ # that may be caused by subscription upgrades/downgrades (if necessary).
11
+ #
12
+ # If your invoice is configured to be billed through automatic charges,
13
+ # Stripe automatically finalizes your invoice and attempts payment. Note
14
+ # that finalizing the invoice,
15
+ # [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does
16
+ # not happen immediately as the invoice is created. Stripe waits
17
+ # until one hour after the last webhook was successfully sent (or the last
18
+ # webhook timed out after failing). If you (and the platforms you may have
19
+ # connected to) have no webhooks configured, Stripe waits one hour after
20
+ # creation to finalize the invoice.
21
+ #
22
+ # If your invoice is configured to be billed by sending an email, then based on your
23
+ # [email settings](https://dashboard.stripe.com/account/billing/automatic),
24
+ # Stripe will email the invoice to your customer and await payment. These
25
+ # emails can contain a link to a hosted page to pay the invoice.
26
+ #
27
+ # Stripe applies any customer credit on the account before determining the
28
+ # amount due for the invoice (i.e., the amount that will be actually
29
+ # charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge
30
+ # per currency](https://docs.stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the
31
+ # invoice is automatically marked paid, and we add the amount due to the
32
+ # customer's credit balance which is applied to the next invoice.
33
+ #
34
+ # More details on the customer's credit balance are
35
+ # [here](https://stripe.com/docs/billing/customer/balance).
36
+ #
37
+ # Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending)
38
+ class Invoice < APIResource
39
+ class AutomaticTax < Stripe::StripeObject
40
+ class Liability < Stripe::StripeObject
41
+ # The connected account being referenced when `type` is `account`.
42
+ sig { returns(T.any(String, Stripe::Account)) }
43
+ attr_reader :account
44
+ # Type of the account referenced.
45
+ sig { returns(String) }
46
+ attr_reader :type
47
+ end
48
+ # If Stripe disabled automatic tax, this enum describes why.
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :disabled_reason
51
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
52
+ sig { returns(T::Boolean) }
53
+ attr_reader :enabled
54
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
55
+ sig { returns(T.nilable(Liability)) }
56
+ attr_reader :liability
57
+ # The tax provider powering automatic tax.
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :provider
60
+ # The status of the most recent automated tax calculation for this invoice.
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :status
63
+ end
64
+ class ConfirmationSecret < Stripe::StripeObject
65
+ # The client_secret of the payment that Stripe creates for the invoice after finalization.
66
+ sig { returns(String) }
67
+ attr_reader :client_secret
68
+ # The type of client_secret. Currently this is always payment_intent, referencing the default payment_intent that Stripe creates during invoice finalization
69
+ sig { returns(String) }
70
+ attr_reader :type
71
+ end
72
+ class CustomField < Stripe::StripeObject
73
+ # The name of the custom field.
74
+ sig { returns(String) }
75
+ attr_reader :name
76
+ # The value of the custom field.
77
+ sig { returns(String) }
78
+ attr_reader :value
79
+ end
80
+ class CustomerAddress < Stripe::StripeObject
81
+ # City, district, suburb, town, or village.
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :city
84
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
85
+ sig { returns(T.nilable(String)) }
86
+ attr_reader :country
87
+ # Address line 1 (e.g., street, PO Box, or company name).
88
+ sig { returns(T.nilable(String)) }
89
+ attr_reader :line1
90
+ # Address line 2 (e.g., apartment, suite, unit, or building).
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :line2
93
+ # ZIP or postal code.
94
+ sig { returns(T.nilable(String)) }
95
+ attr_reader :postal_code
96
+ # State, county, province, or region.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_reader :state
99
+ end
100
+ class CustomerShipping < Stripe::StripeObject
101
+ class Address < Stripe::StripeObject
102
+ # City, district, suburb, town, or village.
103
+ sig { returns(T.nilable(String)) }
104
+ attr_reader :city
105
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
106
+ sig { returns(T.nilable(String)) }
107
+ attr_reader :country
108
+ # Address line 1 (e.g., street, PO Box, or company name).
109
+ sig { returns(T.nilable(String)) }
110
+ attr_reader :line1
111
+ # Address line 2 (e.g., apartment, suite, unit, or building).
112
+ sig { returns(T.nilable(String)) }
113
+ attr_reader :line2
114
+ # ZIP or postal code.
115
+ sig { returns(T.nilable(String)) }
116
+ attr_reader :postal_code
117
+ # State, county, province, or region.
118
+ sig { returns(T.nilable(String)) }
119
+ attr_reader :state
120
+ end
121
+ # Attribute for field address
122
+ sig { returns(Address) }
123
+ attr_reader :address
124
+ # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
125
+ sig { returns(T.nilable(String)) }
126
+ attr_reader :carrier
127
+ # Recipient name.
128
+ sig { returns(String) }
129
+ attr_reader :name
130
+ # Recipient phone (including extension).
131
+ sig { returns(T.nilable(String)) }
132
+ attr_reader :phone
133
+ # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
134
+ sig { returns(T.nilable(String)) }
135
+ attr_reader :tracking_number
136
+ end
137
+ class CustomerTaxId < Stripe::StripeObject
138
+ # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown`
139
+ sig { returns(String) }
140
+ attr_reader :type
141
+ # The value of the tax ID.
142
+ sig { returns(T.nilable(String)) }
143
+ attr_reader :value
144
+ end
145
+ class FromInvoice < Stripe::StripeObject
146
+ # The relation between this invoice and the cloned invoice
147
+ sig { returns(String) }
148
+ attr_reader :action
149
+ # The invoice that was cloned.
150
+ sig { returns(T.any(String, Stripe::Invoice)) }
151
+ attr_reader :invoice
152
+ end
153
+ class Issuer < Stripe::StripeObject
154
+ # The connected account being referenced when `type` is `account`.
155
+ sig { returns(T.any(String, Stripe::Account)) }
156
+ attr_reader :account
157
+ # Type of the account referenced.
158
+ sig { returns(String) }
159
+ attr_reader :type
160
+ end
161
+ class LastFinalizationError < Stripe::StripeObject
162
+ # For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one.
163
+ sig { returns(String) }
164
+ attr_reader :advice_code
165
+ # For card errors, the ID of the failed charge.
166
+ sig { returns(String) }
167
+ attr_reader :charge
168
+ # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
169
+ sig { returns(String) }
170
+ attr_reader :code
171
+ # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
172
+ sig { returns(String) }
173
+ attr_reader :decline_code
174
+ # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
175
+ sig { returns(String) }
176
+ attr_reader :doc_url
177
+ # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
178
+ sig { returns(String) }
179
+ attr_reader :message
180
+ # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
181
+ sig { returns(String) }
182
+ attr_reader :network_advice_code
183
+ # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed.
184
+ sig { returns(String) }
185
+ attr_reader :network_decline_code
186
+ # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
187
+ sig { returns(String) }
188
+ attr_reader :param
189
+ # A PaymentIntent guides you through the process of collecting a payment from your customer.
190
+ # We recommend that you create exactly one PaymentIntent for each order or
191
+ # customer session in your system. You can reference the PaymentIntent later to
192
+ # see the history of payment attempts for a particular session.
193
+ #
194
+ # A PaymentIntent transitions through
195
+ # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses)
196
+ # throughout its lifetime as it interfaces with Stripe.js to perform
197
+ # authentication flows and ultimately creates at most one successful charge.
198
+ #
199
+ # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents)
200
+ sig { returns(Stripe::PaymentIntent) }
201
+ attr_reader :payment_intent
202
+ # PaymentMethod objects represent your customer's payment instruments.
203
+ # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
204
+ # Customer objects to store instrument details for future payments.
205
+ #
206
+ # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
207
+ sig { returns(Stripe::PaymentMethod) }
208
+ attr_reader :payment_method
209
+ # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
210
+ sig { returns(String) }
211
+ attr_reader :payment_method_type
212
+ # A URL to the request log entry in your dashboard.
213
+ sig { returns(String) }
214
+ attr_reader :request_log_url
215
+ # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
216
+ # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
217
+ # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.
218
+ #
219
+ # Create a SetupIntent when you're ready to collect your customer's payment credentials.
220
+ # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
221
+ # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides
222
+ # you through the setup process.
223
+ #
224
+ # Successful SetupIntents result in payment credentials that are optimized for future payments.
225
+ # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
226
+ # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection
227
+ # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).
228
+ # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
229
+ # it automatically attaches the resulting payment method to that Customer after successful setup.
230
+ # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
231
+ # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.
232
+ #
233
+ # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.
234
+ #
235
+ # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
236
+ sig { returns(Stripe::SetupIntent) }
237
+ attr_reader :setup_intent
238
+ # Attribute for field source
239
+ sig { returns(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)) }
240
+ attr_reader :source
241
+ # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
242
+ sig { returns(String) }
243
+ attr_reader :type
244
+ end
245
+ class Parent < Stripe::StripeObject
246
+ class QuoteDetails < Stripe::StripeObject
247
+ # The quote that generated this invoice
248
+ sig { returns(String) }
249
+ attr_reader :quote
250
+ end
251
+ class SubscriptionDetails < Stripe::StripeObject
252
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization.
253
+ # *Note: This attribute is populated only for invoices created on or after June 29, 2023.*
254
+ sig { returns(T.nilable(T::Hash[String, String])) }
255
+ attr_reader :metadata
256
+ # The subscription that generated this invoice
257
+ sig { returns(T.any(String, Stripe::Subscription)) }
258
+ attr_reader :subscription
259
+ # Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
260
+ sig { returns(Integer) }
261
+ attr_reader :subscription_proration_date
262
+ end
263
+ # Details about the quote that generated this invoice
264
+ sig { returns(T.nilable(QuoteDetails)) }
265
+ attr_reader :quote_details
266
+ # Details about the subscription that generated this invoice
267
+ sig { returns(T.nilable(SubscriptionDetails)) }
268
+ attr_reader :subscription_details
269
+ # The type of parent that generated this invoice
270
+ sig { returns(String) }
271
+ attr_reader :type
272
+ end
273
+ class PaymentSettings < Stripe::StripeObject
274
+ class PaymentMethodOptions < Stripe::StripeObject
275
+ class AcssDebit < Stripe::StripeObject
276
+ class MandateOptions < Stripe::StripeObject
277
+ # Transaction type of the mandate.
278
+ sig { returns(T.nilable(String)) }
279
+ attr_reader :transaction_type
280
+ end
281
+ # Attribute for field mandate_options
282
+ sig { returns(MandateOptions) }
283
+ attr_reader :mandate_options
284
+ # Bank account verification method.
285
+ sig { returns(String) }
286
+ attr_reader :verification_method
287
+ end
288
+ class Bancontact < Stripe::StripeObject
289
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
290
+ sig { returns(String) }
291
+ attr_reader :preferred_language
292
+ end
293
+ class Card < Stripe::StripeObject
294
+ class Installments < Stripe::StripeObject
295
+ # Whether Installments are enabled for this Invoice.
296
+ sig { returns(T.nilable(T::Boolean)) }
297
+ attr_reader :enabled
298
+ end
299
+ # Attribute for field installments
300
+ sig { returns(Installments) }
301
+ attr_reader :installments
302
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
303
+ sig { returns(T.nilable(String)) }
304
+ attr_reader :request_three_d_secure
305
+ end
306
+ class CustomerBalance < Stripe::StripeObject
307
+ class BankTransfer < Stripe::StripeObject
308
+ class EuBankTransfer < Stripe::StripeObject
309
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
310
+ sig { returns(String) }
311
+ attr_reader :country
312
+ end
313
+ # Attribute for field eu_bank_transfer
314
+ sig { returns(EuBankTransfer) }
315
+ attr_reader :eu_bank_transfer
316
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
317
+ sig { returns(T.nilable(String)) }
318
+ attr_reader :type
319
+ end
320
+ # Attribute for field bank_transfer
321
+ sig { returns(BankTransfer) }
322
+ attr_reader :bank_transfer
323
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
324
+ sig { returns(T.nilable(String)) }
325
+ attr_reader :funding_type
326
+ end
327
+ class Konbini < Stripe::StripeObject; end
328
+ class SepaDebit < Stripe::StripeObject; end
329
+ class UsBankAccount < Stripe::StripeObject
330
+ class FinancialConnections < Stripe::StripeObject
331
+ class Filters < Stripe::StripeObject
332
+ # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
333
+ sig { returns(T::Array[String]) }
334
+ attr_reader :account_subcategories
335
+ end
336
+ # Attribute for field filters
337
+ sig { returns(Filters) }
338
+ attr_reader :filters
339
+ # The list of permissions to request. The `payment_method` permission must be included.
340
+ sig { returns(T::Array[String]) }
341
+ attr_reader :permissions
342
+ # Data features requested to be retrieved upon account creation.
343
+ sig { returns(T.nilable(T::Array[String])) }
344
+ attr_reader :prefetch
345
+ end
346
+ # Attribute for field financial_connections
347
+ sig { returns(FinancialConnections) }
348
+ attr_reader :financial_connections
349
+ # Bank account verification method.
350
+ sig { returns(String) }
351
+ attr_reader :verification_method
352
+ end
353
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
354
+ sig { returns(T.nilable(AcssDebit)) }
355
+ attr_reader :acss_debit
356
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
357
+ sig { returns(T.nilable(Bancontact)) }
358
+ attr_reader :bancontact
359
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
360
+ sig { returns(T.nilable(Card)) }
361
+ attr_reader :card
362
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
363
+ sig { returns(T.nilable(CustomerBalance)) }
364
+ attr_reader :customer_balance
365
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
366
+ sig { returns(T.nilable(Konbini)) }
367
+ attr_reader :konbini
368
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
369
+ sig { returns(T.nilable(SepaDebit)) }
370
+ attr_reader :sepa_debit
371
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
372
+ sig { returns(T.nilable(UsBankAccount)) }
373
+ attr_reader :us_bank_account
374
+ end
375
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
376
+ sig { returns(T.nilable(String)) }
377
+ attr_reader :default_mandate
378
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
379
+ sig { returns(T.nilable(PaymentMethodOptions)) }
380
+ attr_reader :payment_method_options
381
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
382
+ sig { returns(T.nilable(T::Array[String])) }
383
+ attr_reader :payment_method_types
384
+ end
385
+ class Rendering < Stripe::StripeObject
386
+ class Pdf < Stripe::StripeObject
387
+ # Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale.
388
+ sig { returns(T.nilable(String)) }
389
+ attr_reader :page_size
390
+ end
391
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
392
+ sig { returns(T.nilable(String)) }
393
+ attr_reader :amount_tax_display
394
+ # Invoice pdf rendering options
395
+ sig { returns(T.nilable(Pdf)) }
396
+ attr_reader :pdf
397
+ # ID of the rendering template that the invoice is formatted by.
398
+ sig { returns(T.nilable(String)) }
399
+ attr_reader :template
400
+ # Version of the rendering template that the invoice is using.
401
+ sig { returns(T.nilable(Integer)) }
402
+ attr_reader :template_version
403
+ end
404
+ class ShippingCost < Stripe::StripeObject
405
+ class Tax < Stripe::StripeObject
406
+ # Amount of tax applied for this rate.
407
+ sig { returns(Integer) }
408
+ attr_reader :amount
409
+ # Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
410
+ #
411
+ # Related guide: [Tax rates](/billing/taxes/tax-rates)
412
+ sig { returns(Stripe::TaxRate) }
413
+ attr_reader :rate
414
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
415
+ sig { returns(T.nilable(String)) }
416
+ attr_reader :taxability_reason
417
+ # The amount on which tax is calculated, in cents (or local equivalent).
418
+ sig { returns(T.nilable(Integer)) }
419
+ attr_reader :taxable_amount
420
+ end
421
+ # Total shipping cost before any taxes are applied.
422
+ sig { returns(Integer) }
423
+ attr_reader :amount_subtotal
424
+ # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0.
425
+ sig { returns(Integer) }
426
+ attr_reader :amount_tax
427
+ # Total shipping cost after taxes are applied.
428
+ sig { returns(Integer) }
429
+ attr_reader :amount_total
430
+ # The ID of the ShippingRate for this invoice.
431
+ sig { returns(T.nilable(T.any(String, Stripe::ShippingRate))) }
432
+ attr_reader :shipping_rate
433
+ # The taxes applied to the shipping rate.
434
+ sig { returns(T::Array[Tax]) }
435
+ attr_reader :taxes
436
+ end
437
+ class ShippingDetails < Stripe::StripeObject
438
+ class Address < Stripe::StripeObject
439
+ # City, district, suburb, town, or village.
440
+ sig { returns(T.nilable(String)) }
441
+ attr_reader :city
442
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
443
+ sig { returns(T.nilable(String)) }
444
+ attr_reader :country
445
+ # Address line 1 (e.g., street, PO Box, or company name).
446
+ sig { returns(T.nilable(String)) }
447
+ attr_reader :line1
448
+ # Address line 2 (e.g., apartment, suite, unit, or building).
449
+ sig { returns(T.nilable(String)) }
450
+ attr_reader :line2
451
+ # ZIP or postal code.
452
+ sig { returns(T.nilable(String)) }
453
+ attr_reader :postal_code
454
+ # State, county, province, or region.
455
+ sig { returns(T.nilable(String)) }
456
+ attr_reader :state
457
+ end
458
+ # Attribute for field address
459
+ sig { returns(Address) }
460
+ attr_reader :address
461
+ # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
462
+ sig { returns(T.nilable(String)) }
463
+ attr_reader :carrier
464
+ # Recipient name.
465
+ sig { returns(String) }
466
+ attr_reader :name
467
+ # Recipient phone (including extension).
468
+ sig { returns(T.nilable(String)) }
469
+ attr_reader :phone
470
+ # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
471
+ sig { returns(T.nilable(String)) }
472
+ attr_reader :tracking_number
473
+ end
474
+ class StatusTransitions < Stripe::StripeObject
475
+ # The time that the invoice draft was finalized.
476
+ sig { returns(T.nilable(Integer)) }
477
+ attr_reader :finalized_at
478
+ # The time that the invoice was marked uncollectible.
479
+ sig { returns(T.nilable(Integer)) }
480
+ attr_reader :marked_uncollectible_at
481
+ # The time that the invoice was paid.
482
+ sig { returns(T.nilable(Integer)) }
483
+ attr_reader :paid_at
484
+ # The time that the invoice was voided.
485
+ sig { returns(T.nilable(Integer)) }
486
+ attr_reader :voided_at
487
+ end
488
+ class ThresholdReason < Stripe::StripeObject
489
+ class ItemReason < Stripe::StripeObject
490
+ # The IDs of the line items that triggered the threshold invoice.
491
+ sig { returns(T::Array[String]) }
492
+ attr_reader :line_item_ids
493
+ # The quantity threshold boundary that applied to the given line item.
494
+ sig { returns(Integer) }
495
+ attr_reader :usage_gte
496
+ end
497
+ # The total invoice amount threshold boundary if it triggered the threshold invoice.
498
+ sig { returns(T.nilable(Integer)) }
499
+ attr_reader :amount_gte
500
+ # Indicates which line items triggered a threshold invoice.
501
+ sig { returns(T::Array[ItemReason]) }
502
+ attr_reader :item_reasons
503
+ end
504
+ class TotalDiscountAmount < Stripe::StripeObject
505
+ # The amount, in cents (or local equivalent), of the discount.
506
+ sig { returns(Integer) }
507
+ attr_reader :amount
508
+ # The discount that was applied to get this discount amount.
509
+ sig { returns(T.any(String, Stripe::Discount)) }
510
+ attr_reader :discount
511
+ end
512
+ class TotalPretaxCreditAmount < Stripe::StripeObject
513
+ # The amount, in cents (or local equivalent), of the pretax credit amount.
514
+ sig { returns(Integer) }
515
+ attr_reader :amount
516
+ # The credit balance transaction that was applied to get this pretax credit amount.
517
+ sig { returns(T.nilable(T.any(String, Stripe::Billing::CreditBalanceTransaction))) }
518
+ attr_reader :credit_balance_transaction
519
+ # The discount that was applied to get this pretax credit amount.
520
+ sig { returns(T.any(String, Stripe::Discount)) }
521
+ attr_reader :discount
522
+ # Type of the pretax credit amount referenced.
523
+ sig { returns(String) }
524
+ attr_reader :type
525
+ end
526
+ class TotalTax < Stripe::StripeObject
527
+ class TaxRateDetails < Stripe::StripeObject
528
+ # Attribute for field tax_rate
529
+ sig { returns(String) }
530
+ attr_reader :tax_rate
531
+ end
532
+ # The amount of the tax, in cents (or local equivalent).
533
+ sig { returns(Integer) }
534
+ attr_reader :amount
535
+ # Whether this tax is inclusive or exclusive.
536
+ sig { returns(String) }
537
+ attr_reader :tax_behavior
538
+ # Additional details about the tax rate. Only present when `type` is `tax_rate_details`.
539
+ sig { returns(T.nilable(TaxRateDetails)) }
540
+ attr_reader :tax_rate_details
541
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
542
+ sig { returns(String) }
543
+ attr_reader :taxability_reason
544
+ # The amount on which tax is calculated, in cents (or local equivalent).
545
+ sig { returns(T.nilable(Integer)) }
546
+ attr_reader :taxable_amount
547
+ # The type of tax information.
548
+ sig { returns(String) }
549
+ attr_reader :type
550
+ end
551
+ # The country of the business associated with this invoice, most often the business creating the invoice.
552
+ sig { returns(T.nilable(String)) }
553
+ attr_reader :account_country
554
+ # The public name of the business associated with this invoice, most often the business creating the invoice.
555
+ sig { returns(T.nilable(String)) }
556
+ attr_reader :account_name
557
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
558
+ sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) }
559
+ attr_reader :account_tax_ids
560
+ # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.
561
+ sig { returns(Integer) }
562
+ attr_reader :amount_due
563
+ # Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.
564
+ sig { returns(Integer) }
565
+ attr_reader :amount_overpaid
566
+ # The amount, in cents (or local equivalent), that was paid.
567
+ sig { returns(Integer) }
568
+ attr_reader :amount_paid
569
+ # The difference between amount_due and amount_paid, in cents (or local equivalent).
570
+ sig { returns(Integer) }
571
+ attr_reader :amount_remaining
572
+ # This is the sum of all the shipping amounts.
573
+ sig { returns(Integer) }
574
+ attr_reader :amount_shipping
575
+ # ID of the Connect Application that created the invoice.
576
+ sig { returns(T.nilable(T.any(String, Stripe::Application))) }
577
+ attr_reader :application
578
+ # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
579
+ sig { returns(Integer) }
580
+ attr_reader :attempt_count
581
+ # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.
582
+ sig { returns(T::Boolean) }
583
+ attr_reader :attempted
584
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
585
+ sig { returns(T::Boolean) }
586
+ attr_reader :auto_advance
587
+ # Attribute for field automatic_tax
588
+ sig { returns(AutomaticTax) }
589
+ attr_reader :automatic_tax
590
+ # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized.
591
+ sig { returns(T.nilable(Integer)) }
592
+ attr_reader :automatically_finalizes_at
593
+ # Indicates the reason why the invoice was created.
594
+ #
595
+ # * `manual`: Unrelated to a subscription, for example, created via the invoice editor.
596
+ # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.
597
+ # * `subscription_create`: A new subscription was created.
598
+ # * `subscription_cycle`: A subscription advanced into a new period.
599
+ # * `subscription_threshold`: A subscription reached a billing threshold.
600
+ # * `subscription_update`: A subscription was updated.
601
+ # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.
602
+ sig { returns(T.nilable(String)) }
603
+ attr_reader :billing_reason
604
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
605
+ sig { returns(String) }
606
+ attr_reader :collection_method
607
+ # The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization.
608
+ sig { returns(T.nilable(ConfirmationSecret)) }
609
+ attr_reader :confirmation_secret
610
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
611
+ sig { returns(Integer) }
612
+ attr_reader :created
613
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
614
+ sig { returns(String) }
615
+ attr_reader :currency
616
+ # Custom fields displayed on the invoice.
617
+ sig { returns(T.nilable(T::Array[CustomField])) }
618
+ attr_reader :custom_fields
619
+ # The ID of the customer who will be billed.
620
+ sig { returns(T.nilable(T.any(String, Stripe::Customer))) }
621
+ attr_reader :customer
622
+ # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.
623
+ sig { returns(T.nilable(CustomerAddress)) }
624
+ attr_reader :customer_address
625
+ # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
626
+ sig { returns(T.nilable(String)) }
627
+ attr_reader :customer_email
628
+ # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.
629
+ sig { returns(T.nilable(String)) }
630
+ attr_reader :customer_name
631
+ # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.
632
+ sig { returns(T.nilable(String)) }
633
+ attr_reader :customer_phone
634
+ # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated.
635
+ sig { returns(T.nilable(CustomerShipping)) }
636
+ attr_reader :customer_shipping
637
+ # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.
638
+ sig { returns(T.nilable(String)) }
639
+ attr_reader :customer_tax_exempt
640
+ # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
641
+ sig { returns(T.nilable(T::Array[CustomerTaxId])) }
642
+ attr_reader :customer_tax_ids
643
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
644
+ sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) }
645
+ attr_reader :default_payment_method
646
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
647
+ sig {
648
+ returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source))))
649
+ }
650
+ attr_reader :default_source
651
+ # The tax rates applied to this invoice, if any.
652
+ sig { returns(T::Array[Stripe::TaxRate]) }
653
+ attr_reader :default_tax_rates
654
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
655
+ sig { returns(T.nilable(String)) }
656
+ attr_reader :description
657
+ # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
658
+ sig { returns(T::Array[T.any(String, Stripe::Discount)]) }
659
+ attr_reader :discounts
660
+ # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
661
+ sig { returns(T.nilable(Integer)) }
662
+ attr_reader :due_date
663
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
664
+ sig { returns(T.nilable(Integer)) }
665
+ attr_reader :effective_at
666
+ # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
667
+ sig { returns(T.nilable(Integer)) }
668
+ attr_reader :ending_balance
669
+ # Footer displayed on the invoice.
670
+ sig { returns(T.nilable(String)) }
671
+ attr_reader :footer
672
+ # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
673
+ sig { returns(T.nilable(FromInvoice)) }
674
+ attr_reader :from_invoice
675
+ # The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
676
+ sig { returns(T.nilable(String)) }
677
+ attr_reader :hosted_invoice_url
678
+ # Unique identifier for the object. For preview invoices created using the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint, this id will be prefixed with `upcoming_in`.
679
+ sig { returns(String) }
680
+ attr_reader :id
681
+ # The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
682
+ sig { returns(T.nilable(String)) }
683
+ attr_reader :invoice_pdf
684
+ # Attribute for field issuer
685
+ sig { returns(Issuer) }
686
+ attr_reader :issuer
687
+ # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
688
+ sig { returns(T.nilable(LastFinalizationError)) }
689
+ attr_reader :last_finalization_error
690
+ # The ID of the most recent non-draft revision of this invoice
691
+ sig { returns(T.nilable(T.any(String, Stripe::Invoice))) }
692
+ attr_reader :latest_revision
693
+ # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
694
+ sig { returns(Stripe::ListObject) }
695
+ attr_reader :lines
696
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
697
+ sig { returns(T::Boolean) }
698
+ attr_reader :livemode
699
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
700
+ sig { returns(T.nilable(T::Hash[String, String])) }
701
+ attr_reader :metadata
702
+ # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.
703
+ sig { returns(T.nilable(Integer)) }
704
+ attr_reader :next_payment_attempt
705
+ # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
706
+ sig { returns(T.nilable(String)) }
707
+ attr_reader :number
708
+ # String representing the object's type. Objects of the same type share the same value.
709
+ sig { returns(String) }
710
+ attr_reader :object
711
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
712
+ sig { returns(T.nilable(T.any(String, Stripe::Account))) }
713
+ attr_reader :on_behalf_of
714
+ # The parent that generated this invoice
715
+ sig { returns(T.nilable(Parent)) }
716
+ attr_reader :parent
717
+ # Attribute for field payment_settings
718
+ sig { returns(PaymentSettings) }
719
+ attr_reader :payment_settings
720
+ # Payments for this invoice
721
+ sig { returns(Stripe::ListObject) }
722
+ attr_reader :payments
723
+ # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
724
+ sig { returns(Integer) }
725
+ attr_reader :period_end
726
+ # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
727
+ sig { returns(Integer) }
728
+ attr_reader :period_start
729
+ # Total amount of all post-payment credit notes issued for this invoice.
730
+ sig { returns(Integer) }
731
+ attr_reader :post_payment_credit_notes_amount
732
+ # Total amount of all pre-payment credit notes issued for this invoice.
733
+ sig { returns(Integer) }
734
+ attr_reader :pre_payment_credit_notes_amount
735
+ # This is the transaction number that appears on email receipts sent for this invoice.
736
+ sig { returns(T.nilable(String)) }
737
+ attr_reader :receipt_number
738
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
739
+ sig { returns(T.nilable(Rendering)) }
740
+ attr_reader :rendering
741
+ # The details of the cost of shipping, including the ShippingRate applied on the invoice.
742
+ sig { returns(T.nilable(ShippingCost)) }
743
+ attr_reader :shipping_cost
744
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
745
+ sig { returns(T.nilable(ShippingDetails)) }
746
+ attr_reader :shipping_details
747
+ # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
748
+ sig { returns(Integer) }
749
+ attr_reader :starting_balance
750
+ # Extra information about an invoice for the customer's credit card statement.
751
+ sig { returns(T.nilable(String)) }
752
+ attr_reader :statement_descriptor
753
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
754
+ sig { returns(T.nilable(String)) }
755
+ attr_reader :status
756
+ # Attribute for field status_transitions
757
+ sig { returns(StatusTransitions) }
758
+ attr_reader :status_transitions
759
+ # Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
760
+ sig { returns(Integer) }
761
+ attr_reader :subtotal
762
+ # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
763
+ sig { returns(T.nilable(Integer)) }
764
+ attr_reader :subtotal_excluding_tax
765
+ # ID of the test clock this invoice belongs to.
766
+ sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) }
767
+ attr_reader :test_clock
768
+ # Attribute for field threshold_reason
769
+ sig { returns(ThresholdReason) }
770
+ attr_reader :threshold_reason
771
+ # Total after discounts and taxes.
772
+ sig { returns(Integer) }
773
+ attr_reader :total
774
+ # The aggregate amounts calculated per discount across all line items.
775
+ sig { returns(T.nilable(T::Array[TotalDiscountAmount])) }
776
+ attr_reader :total_discount_amounts
777
+ # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
778
+ sig { returns(T.nilable(Integer)) }
779
+ attr_reader :total_excluding_tax
780
+ # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
781
+ sig { returns(T.nilable(T::Array[TotalPretaxCreditAmount])) }
782
+ attr_reader :total_pretax_credit_amounts
783
+ # The aggregate tax information of all line items.
784
+ sig { returns(T.nilable(T::Array[TotalTax])) }
785
+ attr_reader :total_taxes
786
+ # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
787
+ sig { returns(T.nilable(Integer)) }
788
+ attr_reader :webhooks_delivered_at
789
+ # Always true for a deleted object
790
+ sig { returns(T::Boolean) }
791
+ attr_reader :deleted
792
+ class DeleteParams < Stripe::RequestParams; end
793
+ class UpdateParams < Stripe::RequestParams
794
+ class AutomaticTax < Stripe::RequestParams
795
+ class Liability < Stripe::RequestParams
796
+ # The connected account being referenced when `type` is `account`.
797
+ sig { returns(T.nilable(String)) }
798
+ attr_accessor :account
799
+ # Type of the account referenced in the request.
800
+ sig { returns(String) }
801
+ attr_accessor :type
802
+ sig { params(account: T.nilable(String), type: String).void }
803
+ def initialize(account: nil, type: nil); end
804
+ end
805
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
806
+ sig { returns(T::Boolean) }
807
+ attr_accessor :enabled
808
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
809
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax::Liability)) }
810
+ attr_accessor :liability
811
+ sig {
812
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax::Liability)).void
813
+ }
814
+ def initialize(enabled: nil, liability: nil); end
815
+ end
816
+ class CustomField < Stripe::RequestParams
817
+ # The name of the custom field. This may be up to 40 characters.
818
+ sig { returns(String) }
819
+ attr_accessor :name
820
+ # The value of the custom field. This may be up to 140 characters.
821
+ sig { returns(String) }
822
+ attr_accessor :value
823
+ sig { params(name: String, value: String).void }
824
+ def initialize(name: nil, value: nil); end
825
+ end
826
+ class Discount < Stripe::RequestParams
827
+ # ID of the coupon to create a new discount for.
828
+ sig { returns(T.nilable(String)) }
829
+ attr_accessor :coupon
830
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
831
+ sig { returns(T.nilable(String)) }
832
+ attr_accessor :discount
833
+ # ID of the promotion code to create a new discount for.
834
+ sig { returns(T.nilable(String)) }
835
+ attr_accessor :promotion_code
836
+ sig {
837
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
838
+ }
839
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
840
+ end
841
+ class Issuer < Stripe::RequestParams
842
+ # The connected account being referenced when `type` is `account`.
843
+ sig { returns(T.nilable(String)) }
844
+ attr_accessor :account
845
+ # Type of the account referenced in the request.
846
+ sig { returns(String) }
847
+ attr_accessor :type
848
+ sig { params(account: T.nilable(String), type: String).void }
849
+ def initialize(account: nil, type: nil); end
850
+ end
851
+ class PaymentSettings < Stripe::RequestParams
852
+ class PaymentMethodOptions < Stripe::RequestParams
853
+ class AcssDebit < Stripe::RequestParams
854
+ class MandateOptions < Stripe::RequestParams
855
+ # Transaction type of the mandate.
856
+ sig { returns(T.nilable(String)) }
857
+ attr_accessor :transaction_type
858
+ sig { params(transaction_type: T.nilable(String)).void }
859
+ def initialize(transaction_type: nil); end
860
+ end
861
+ # Additional fields for Mandate creation
862
+ sig {
863
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
864
+ }
865
+ attr_accessor :mandate_options
866
+ # Verification method for the intent
867
+ sig { returns(T.nilable(String)) }
868
+ attr_accessor :verification_method
869
+ sig {
870
+ params(mandate_options: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
871
+ }
872
+ def initialize(mandate_options: nil, verification_method: nil); end
873
+ end
874
+ class Bancontact < Stripe::RequestParams
875
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
876
+ sig { returns(T.nilable(String)) }
877
+ attr_accessor :preferred_language
878
+ sig { params(preferred_language: T.nilable(String)).void }
879
+ def initialize(preferred_language: nil); end
880
+ end
881
+ class Card < Stripe::RequestParams
882
+ class Installments < Stripe::RequestParams
883
+ class Plan < Stripe::RequestParams
884
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
885
+ sig { returns(T.nilable(Integer)) }
886
+ attr_accessor :count
887
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
888
+ # One of `month`.
889
+ sig { returns(T.nilable(String)) }
890
+ attr_accessor :interval
891
+ # Type of installment plan, one of `fixed_count`.
892
+ sig { returns(String) }
893
+ attr_accessor :type
894
+ sig {
895
+ params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void
896
+ }
897
+ def initialize(count: nil, interval: nil, type: nil); end
898
+ end
899
+ # Setting to true enables installments for this invoice.
900
+ # Setting to false will prevent any selected plan from applying to a payment.
901
+ sig { returns(T.nilable(T::Boolean)) }
902
+ attr_accessor :enabled
903
+ # The selected installment plan to use for this invoice.
904
+ sig {
905
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan))))
906
+ }
907
+ attr_accessor :plan
908
+ sig {
909
+ params(enabled: T.nilable(T::Boolean), plan: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan)))).void
910
+ }
911
+ def initialize(enabled: nil, plan: nil); end
912
+ end
913
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
914
+ #
915
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
916
+ sig {
917
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments))
918
+ }
919
+ attr_accessor :installments
920
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
921
+ sig { returns(T.nilable(String)) }
922
+ attr_accessor :request_three_d_secure
923
+ sig {
924
+ params(installments: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments), request_three_d_secure: T.nilable(String)).void
925
+ }
926
+ def initialize(installments: nil, request_three_d_secure: nil); end
927
+ end
928
+ class CustomerBalance < Stripe::RequestParams
929
+ class BankTransfer < Stripe::RequestParams
930
+ class EuBankTransfer < Stripe::RequestParams
931
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
932
+ sig { returns(String) }
933
+ attr_accessor :country
934
+ sig { params(country: String).void }
935
+ def initialize(country: nil); end
936
+ end
937
+ # Configuration for eu_bank_transfer funding type.
938
+ sig {
939
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
940
+ }
941
+ attr_accessor :eu_bank_transfer
942
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
943
+ sig { returns(T.nilable(String)) }
944
+ attr_accessor :type
945
+ sig {
946
+ params(eu_bank_transfer: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
947
+ }
948
+ def initialize(eu_bank_transfer: nil, type: nil); end
949
+ end
950
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
951
+ sig {
952
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
953
+ }
954
+ attr_accessor :bank_transfer
955
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
956
+ sig { returns(T.nilable(String)) }
957
+ attr_accessor :funding_type
958
+ sig {
959
+ params(bank_transfer: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
960
+ }
961
+ def initialize(bank_transfer: nil, funding_type: nil); end
962
+ end
963
+ class Konbini < Stripe::RequestParams; end
964
+ class SepaDebit < Stripe::RequestParams; end
965
+ class UsBankAccount < Stripe::RequestParams
966
+ class FinancialConnections < Stripe::RequestParams
967
+ class Filters < Stripe::RequestParams
968
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
969
+ sig { returns(T.nilable(T::Array[String])) }
970
+ attr_accessor :account_subcategories
971
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
972
+ def initialize(account_subcategories: nil); end
973
+ end
974
+ # Provide filters for the linked accounts that the customer can select for the payment method.
975
+ sig {
976
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
977
+ }
978
+ attr_accessor :filters
979
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
980
+ sig { returns(T.nilable(T::Array[String])) }
981
+ attr_accessor :permissions
982
+ # List of data features that you would like to retrieve upon account creation.
983
+ sig { returns(T.nilable(T::Array[String])) }
984
+ attr_accessor :prefetch
985
+ sig {
986
+ params(filters: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
987
+ }
988
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
989
+ end
990
+ # Additional fields for Financial Connections Session creation
991
+ sig {
992
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
993
+ }
994
+ attr_accessor :financial_connections
995
+ # Verification method for the intent
996
+ sig { returns(T.nilable(String)) }
997
+ attr_accessor :verification_method
998
+ sig {
999
+ params(financial_connections: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
1000
+ }
1001
+ def initialize(financial_connections: nil, verification_method: nil); end
1002
+ end
1003
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1004
+ sig {
1005
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
1006
+ }
1007
+ attr_accessor :acss_debit
1008
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1009
+ sig {
1010
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
1011
+ }
1012
+ attr_accessor :bancontact
1013
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1014
+ sig {
1015
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))))
1016
+ }
1017
+ attr_accessor :card
1018
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1019
+ sig {
1020
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
1021
+ }
1022
+ attr_accessor :customer_balance
1023
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1024
+ sig {
1025
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
1026
+ }
1027
+ attr_accessor :konbini
1028
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1029
+ sig {
1030
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
1031
+ }
1032
+ attr_accessor :sepa_debit
1033
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1034
+ sig {
1035
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
1036
+ }
1037
+ attr_accessor :us_bank_account
1038
+ sig {
1039
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
1040
+ }
1041
+ def initialize(
1042
+ acss_debit: nil,
1043
+ bancontact: nil,
1044
+ card: nil,
1045
+ customer_balance: nil,
1046
+ konbini: nil,
1047
+ sepa_debit: nil,
1048
+ us_bank_account: nil
1049
+ ); end
1050
+ end
1051
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1052
+ sig { returns(T.nilable(T.nilable(String))) }
1053
+ attr_accessor :default_mandate
1054
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
1055
+ sig {
1056
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions))
1057
+ }
1058
+ attr_accessor :payment_method_options
1059
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
1060
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1061
+ attr_accessor :payment_method_types
1062
+ sig {
1063
+ params(default_mandate: T.nilable(T.nilable(String)), payment_method_options: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1064
+ }
1065
+ def initialize(
1066
+ default_mandate: nil,
1067
+ payment_method_options: nil,
1068
+ payment_method_types: nil
1069
+ ); end
1070
+ end
1071
+ class Rendering < Stripe::RequestParams
1072
+ class Pdf < Stripe::RequestParams
1073
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
1074
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
1075
+ # Japanese locale and `letter` for customers with other locales.
1076
+ sig { returns(T.nilable(String)) }
1077
+ attr_accessor :page_size
1078
+ sig { params(page_size: T.nilable(String)).void }
1079
+ def initialize(page_size: nil); end
1080
+ end
1081
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
1082
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
1083
+ attr_accessor :amount_tax_display
1084
+ # Invoice pdf rendering options
1085
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::Rendering::Pdf)) }
1086
+ attr_accessor :pdf
1087
+ # ID of the invoice rendering template to use for this invoice.
1088
+ sig { returns(T.nilable(String)) }
1089
+ attr_accessor :template
1090
+ # The specific version of invoice rendering template to use for this invoice.
1091
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
1092
+ attr_accessor :template_version
1093
+ sig {
1094
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), pdf: T.nilable(::Stripe::Invoice::UpdateParams::Rendering::Pdf), template: T.nilable(String), template_version: T.nilable(T.nilable(T.any(String, Integer)))).void
1095
+ }
1096
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil); end
1097
+ end
1098
+ class ShippingCost < Stripe::RequestParams
1099
+ class ShippingRateData < Stripe::RequestParams
1100
+ class DeliveryEstimate < Stripe::RequestParams
1101
+ class Maximum < Stripe::RequestParams
1102
+ # A unit of time.
1103
+ sig { returns(String) }
1104
+ attr_accessor :unit
1105
+ # Must be greater than 0.
1106
+ sig { returns(Integer) }
1107
+ attr_accessor :value
1108
+ sig { params(unit: String, value: Integer).void }
1109
+ def initialize(unit: nil, value: nil); end
1110
+ end
1111
+ class Minimum < Stripe::RequestParams
1112
+ # A unit of time.
1113
+ sig { returns(String) }
1114
+ attr_accessor :unit
1115
+ # Must be greater than 0.
1116
+ sig { returns(Integer) }
1117
+ attr_accessor :value
1118
+ sig { params(unit: String, value: Integer).void }
1119
+ def initialize(unit: nil, value: nil); end
1120
+ end
1121
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
1122
+ sig {
1123
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum))
1124
+ }
1125
+ attr_accessor :maximum
1126
+ # The lower bound of the estimated range. If empty, represents no lower bound.
1127
+ sig {
1128
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum))
1129
+ }
1130
+ attr_accessor :minimum
1131
+ sig {
1132
+ params(maximum: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum), minimum: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum)).void
1133
+ }
1134
+ def initialize(maximum: nil, minimum: nil); end
1135
+ end
1136
+ class FixedAmount < Stripe::RequestParams
1137
+ class CurrencyOptions < Stripe::RequestParams
1138
+ # A non-negative integer in cents representing how much to charge.
1139
+ sig { returns(Integer) }
1140
+ attr_accessor :amount
1141
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1142
+ sig { returns(T.nilable(String)) }
1143
+ attr_accessor :tax_behavior
1144
+ sig { params(amount: Integer, tax_behavior: T.nilable(String)).void }
1145
+ def initialize(amount: nil, tax_behavior: nil); end
1146
+ end
1147
+ # A non-negative integer in cents representing how much to charge.
1148
+ sig { returns(Integer) }
1149
+ attr_accessor :amount
1150
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
1151
+ sig { returns(String) }
1152
+ attr_accessor :currency
1153
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
1154
+ sig {
1155
+ returns(T.nilable(T::Hash[String, ::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions]))
1156
+ }
1157
+ attr_accessor :currency_options
1158
+ sig {
1159
+ params(amount: Integer, currency: String, currency_options: T.nilable(T::Hash[String, ::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions])).void
1160
+ }
1161
+ def initialize(amount: nil, currency: nil, currency_options: nil); end
1162
+ end
1163
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1164
+ sig {
1165
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate))
1166
+ }
1167
+ attr_accessor :delivery_estimate
1168
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1169
+ sig { returns(String) }
1170
+ attr_accessor :display_name
1171
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1172
+ sig {
1173
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount))
1174
+ }
1175
+ attr_accessor :fixed_amount
1176
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1177
+ sig { returns(T.nilable(T::Hash[String, String])) }
1178
+ attr_accessor :metadata
1179
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1180
+ sig { returns(T.nilable(String)) }
1181
+ attr_accessor :tax_behavior
1182
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1183
+ sig { returns(T.nilable(String)) }
1184
+ attr_accessor :tax_code
1185
+ # The type of calculation to use on the shipping rate.
1186
+ sig { returns(T.nilable(String)) }
1187
+ attr_accessor :type
1188
+ sig {
1189
+ params(delivery_estimate: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate), display_name: String, fixed_amount: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount), metadata: T.nilable(T::Hash[String, String]), tax_behavior: T.nilable(String), tax_code: T.nilable(String), type: T.nilable(String)).void
1190
+ }
1191
+ def initialize(
1192
+ delivery_estimate: nil,
1193
+ display_name: nil,
1194
+ fixed_amount: nil,
1195
+ metadata: nil,
1196
+ tax_behavior: nil,
1197
+ tax_code: nil,
1198
+ type: nil
1199
+ ); end
1200
+ end
1201
+ # The ID of the shipping rate to use for this order.
1202
+ sig { returns(T.nilable(String)) }
1203
+ attr_accessor :shipping_rate
1204
+ # Parameters to create a new ad-hoc shipping rate for this order.
1205
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData)) }
1206
+ attr_accessor :shipping_rate_data
1207
+ sig {
1208
+ params(shipping_rate: T.nilable(String), shipping_rate_data: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData)).void
1209
+ }
1210
+ def initialize(shipping_rate: nil, shipping_rate_data: nil); end
1211
+ end
1212
+ class ShippingDetails < Stripe::RequestParams
1213
+ class Address < Stripe::RequestParams
1214
+ # City, district, suburb, town, or village.
1215
+ sig { returns(T.nilable(String)) }
1216
+ attr_accessor :city
1217
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1218
+ sig { returns(T.nilable(String)) }
1219
+ attr_accessor :country
1220
+ # Address line 1 (e.g., street, PO Box, or company name).
1221
+ sig { returns(T.nilable(String)) }
1222
+ attr_accessor :line1
1223
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1224
+ sig { returns(T.nilable(String)) }
1225
+ attr_accessor :line2
1226
+ # ZIP or postal code.
1227
+ sig { returns(T.nilable(String)) }
1228
+ attr_accessor :postal_code
1229
+ # State, county, province, or region.
1230
+ sig { returns(T.nilable(String)) }
1231
+ attr_accessor :state
1232
+ sig {
1233
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
1234
+ }
1235
+ def initialize(
1236
+ city: nil,
1237
+ country: nil,
1238
+ line1: nil,
1239
+ line2: nil,
1240
+ postal_code: nil,
1241
+ state: nil
1242
+ ); end
1243
+ end
1244
+ # Shipping address
1245
+ sig { returns(::Stripe::Invoice::UpdateParams::ShippingDetails::Address) }
1246
+ attr_accessor :address
1247
+ # Recipient name.
1248
+ sig { returns(String) }
1249
+ attr_accessor :name
1250
+ # Recipient phone (including extension)
1251
+ sig { returns(T.nilable(T.nilable(String))) }
1252
+ attr_accessor :phone
1253
+ sig {
1254
+ params(address: ::Stripe::Invoice::UpdateParams::ShippingDetails::Address, name: String, phone: T.nilable(T.nilable(String))).void
1255
+ }
1256
+ def initialize(address: nil, name: nil, phone: nil); end
1257
+ end
1258
+ class TransferData < Stripe::RequestParams
1259
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
1260
+ sig { returns(T.nilable(Integer)) }
1261
+ attr_accessor :amount
1262
+ # ID of an existing, connected Stripe account.
1263
+ sig { returns(String) }
1264
+ attr_accessor :destination
1265
+ sig { params(amount: T.nilable(Integer), destination: String).void }
1266
+ def initialize(amount: nil, destination: nil); end
1267
+ end
1268
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1269
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1270
+ attr_accessor :account_tax_ids
1271
+ # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1272
+ sig { returns(T.nilable(Integer)) }
1273
+ attr_accessor :application_fee_amount
1274
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
1275
+ sig { returns(T.nilable(T::Boolean)) }
1276
+ attr_accessor :auto_advance
1277
+ # Settings for automatic tax lookup for this invoice.
1278
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax)) }
1279
+ attr_accessor :automatic_tax
1280
+ # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false.
1281
+ sig { returns(T.nilable(Integer)) }
1282
+ attr_accessor :automatically_finalizes_at
1283
+ # Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices.
1284
+ sig { returns(T.nilable(String)) }
1285
+ attr_accessor :collection_method
1286
+ # A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
1287
+ sig {
1288
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::CustomField]))))
1289
+ }
1290
+ attr_accessor :custom_fields
1291
+ # The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
1292
+ sig { returns(T.nilable(Integer)) }
1293
+ attr_accessor :days_until_due
1294
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
1295
+ sig { returns(T.nilable(String)) }
1296
+ attr_accessor :default_payment_method
1297
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
1298
+ sig { returns(T.nilable(T.nilable(String))) }
1299
+ attr_accessor :default_source
1300
+ # The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates.
1301
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1302
+ attr_accessor :default_tax_rates
1303
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
1304
+ sig { returns(T.nilable(String)) }
1305
+ attr_accessor :description
1306
+ # The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
1307
+ sig {
1308
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::Discount]))))
1309
+ }
1310
+ attr_accessor :discounts
1311
+ # The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
1312
+ sig { returns(T.nilable(Integer)) }
1313
+ attr_accessor :due_date
1314
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
1315
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
1316
+ attr_accessor :effective_at
1317
+ # Specifies which fields in the response should be expanded.
1318
+ sig { returns(T.nilable(T::Array[String])) }
1319
+ attr_accessor :expand
1320
+ # Footer to be displayed on the invoice.
1321
+ sig { returns(T.nilable(String)) }
1322
+ attr_accessor :footer
1323
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1324
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::Issuer)) }
1325
+ attr_accessor :issuer
1326
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1327
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1328
+ attr_accessor :metadata
1329
+ # Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.
1330
+ sig { returns(T.nilable(T.nilable(String))) }
1331
+ attr_accessor :number
1332
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
1333
+ sig { returns(T.nilable(T.nilable(String))) }
1334
+ attr_accessor :on_behalf_of
1335
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
1336
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings)) }
1337
+ attr_accessor :payment_settings
1338
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
1339
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::Rendering)) }
1340
+ attr_accessor :rendering
1341
+ # Settings for the cost of shipping for this invoice.
1342
+ sig {
1343
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingCost))))
1344
+ }
1345
+ attr_accessor :shipping_cost
1346
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
1347
+ sig {
1348
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingDetails))))
1349
+ }
1350
+ attr_accessor :shipping_details
1351
+ # Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
1352
+ sig { returns(T.nilable(String)) }
1353
+ attr_accessor :statement_descriptor
1354
+ # If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value.
1355
+ sig {
1356
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::TransferData))))
1357
+ }
1358
+ attr_accessor :transfer_data
1359
+ sig {
1360
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), application_fee_amount: T.nilable(Integer), auto_advance: T.nilable(T::Boolean), automatic_tax: T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax), automatically_finalizes_at: T.nilable(Integer), collection_method: T.nilable(String), custom_fields: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::CustomField]))), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(T.nilable(String)), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(String), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::Discount]))), due_date: T.nilable(Integer), effective_at: T.nilable(T.nilable(T.any(String, Integer))), expand: T.nilable(T::Array[String]), footer: T.nilable(String), issuer: T.nilable(::Stripe::Invoice::UpdateParams::Issuer), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), number: T.nilable(T.nilable(String)), on_behalf_of: T.nilable(T.nilable(String)), payment_settings: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings), rendering: T.nilable(::Stripe::Invoice::UpdateParams::Rendering), shipping_cost: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingCost))), shipping_details: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingDetails))), statement_descriptor: T.nilable(String), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::TransferData)))).void
1361
+ }
1362
+ def initialize(
1363
+ account_tax_ids: nil,
1364
+ application_fee_amount: nil,
1365
+ auto_advance: nil,
1366
+ automatic_tax: nil,
1367
+ automatically_finalizes_at: nil,
1368
+ collection_method: nil,
1369
+ custom_fields: nil,
1370
+ days_until_due: nil,
1371
+ default_payment_method: nil,
1372
+ default_source: nil,
1373
+ default_tax_rates: nil,
1374
+ description: nil,
1375
+ discounts: nil,
1376
+ due_date: nil,
1377
+ effective_at: nil,
1378
+ expand: nil,
1379
+ footer: nil,
1380
+ issuer: nil,
1381
+ metadata: nil,
1382
+ number: nil,
1383
+ on_behalf_of: nil,
1384
+ payment_settings: nil,
1385
+ rendering: nil,
1386
+ shipping_cost: nil,
1387
+ shipping_details: nil,
1388
+ statement_descriptor: nil,
1389
+ transfer_data: nil
1390
+ ); end
1391
+ end
1392
+ class ListParams < Stripe::RequestParams
1393
+ class Created < Stripe::RequestParams
1394
+ # Minimum value to filter by (exclusive)
1395
+ sig { returns(T.nilable(Integer)) }
1396
+ attr_accessor :gt
1397
+ # Minimum value to filter by (inclusive)
1398
+ sig { returns(T.nilable(Integer)) }
1399
+ attr_accessor :gte
1400
+ # Maximum value to filter by (exclusive)
1401
+ sig { returns(T.nilable(Integer)) }
1402
+ attr_accessor :lt
1403
+ # Maximum value to filter by (inclusive)
1404
+ sig { returns(T.nilable(Integer)) }
1405
+ attr_accessor :lte
1406
+ sig {
1407
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
1408
+ }
1409
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
1410
+ end
1411
+ class DueDate < Stripe::RequestParams
1412
+ # Minimum value to filter by (exclusive)
1413
+ sig { returns(T.nilable(Integer)) }
1414
+ attr_accessor :gt
1415
+ # Minimum value to filter by (inclusive)
1416
+ sig { returns(T.nilable(Integer)) }
1417
+ attr_accessor :gte
1418
+ # Maximum value to filter by (exclusive)
1419
+ sig { returns(T.nilable(Integer)) }
1420
+ attr_accessor :lt
1421
+ # Maximum value to filter by (inclusive)
1422
+ sig { returns(T.nilable(Integer)) }
1423
+ attr_accessor :lte
1424
+ sig {
1425
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
1426
+ }
1427
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
1428
+ end
1429
+ # The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`.
1430
+ sig { returns(T.nilable(String)) }
1431
+ attr_accessor :collection_method
1432
+ # Only return invoices that were created during the given date interval.
1433
+ sig { returns(T.nilable(T.any(::Stripe::Invoice::ListParams::Created, Integer))) }
1434
+ attr_accessor :created
1435
+ # Only return invoices for the customer specified by this customer ID.
1436
+ sig { returns(T.nilable(String)) }
1437
+ attr_accessor :customer
1438
+ # Attribute for param field due_date
1439
+ sig { returns(T.nilable(T.any(::Stripe::Invoice::ListParams::DueDate, Integer))) }
1440
+ attr_accessor :due_date
1441
+ # A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
1442
+ sig { returns(T.nilable(String)) }
1443
+ attr_accessor :ending_before
1444
+ # Specifies which fields in the response should be expanded.
1445
+ sig { returns(T.nilable(T::Array[String])) }
1446
+ attr_accessor :expand
1447
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1448
+ sig { returns(T.nilable(Integer)) }
1449
+ attr_accessor :limit
1450
+ # A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
1451
+ sig { returns(T.nilable(String)) }
1452
+ attr_accessor :starting_after
1453
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
1454
+ sig { returns(T.nilable(String)) }
1455
+ attr_accessor :status
1456
+ # Only return invoices for the subscription specified by this subscription ID.
1457
+ sig { returns(T.nilable(String)) }
1458
+ attr_accessor :subscription
1459
+ sig {
1460
+ params(collection_method: T.nilable(String), created: T.nilable(T.any(::Stripe::Invoice::ListParams::Created, Integer)), customer: T.nilable(String), due_date: T.nilable(T.any(::Stripe::Invoice::ListParams::DueDate, Integer)), ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), starting_after: T.nilable(String), status: T.nilable(String), subscription: T.nilable(String)).void
1461
+ }
1462
+ def initialize(
1463
+ collection_method: nil,
1464
+ created: nil,
1465
+ customer: nil,
1466
+ due_date: nil,
1467
+ ending_before: nil,
1468
+ expand: nil,
1469
+ limit: nil,
1470
+ starting_after: nil,
1471
+ status: nil,
1472
+ subscription: nil
1473
+ ); end
1474
+ end
1475
+ class CreateParams < Stripe::RequestParams
1476
+ class AutomaticTax < Stripe::RequestParams
1477
+ class Liability < Stripe::RequestParams
1478
+ # The connected account being referenced when `type` is `account`.
1479
+ sig { returns(T.nilable(String)) }
1480
+ attr_accessor :account
1481
+ # Type of the account referenced in the request.
1482
+ sig { returns(String) }
1483
+ attr_accessor :type
1484
+ sig { params(account: T.nilable(String), type: String).void }
1485
+ def initialize(account: nil, type: nil); end
1486
+ end
1487
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
1488
+ sig { returns(T::Boolean) }
1489
+ attr_accessor :enabled
1490
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
1491
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax::Liability)) }
1492
+ attr_accessor :liability
1493
+ sig {
1494
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax::Liability)).void
1495
+ }
1496
+ def initialize(enabled: nil, liability: nil); end
1497
+ end
1498
+ class CustomField < Stripe::RequestParams
1499
+ # The name of the custom field. This may be up to 40 characters.
1500
+ sig { returns(String) }
1501
+ attr_accessor :name
1502
+ # The value of the custom field. This may be up to 140 characters.
1503
+ sig { returns(String) }
1504
+ attr_accessor :value
1505
+ sig { params(name: String, value: String).void }
1506
+ def initialize(name: nil, value: nil); end
1507
+ end
1508
+ class Discount < Stripe::RequestParams
1509
+ # ID of the coupon to create a new discount for.
1510
+ sig { returns(T.nilable(String)) }
1511
+ attr_accessor :coupon
1512
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1513
+ sig { returns(T.nilable(String)) }
1514
+ attr_accessor :discount
1515
+ # ID of the promotion code to create a new discount for.
1516
+ sig { returns(T.nilable(String)) }
1517
+ attr_accessor :promotion_code
1518
+ sig {
1519
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1520
+ }
1521
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1522
+ end
1523
+ class FromInvoice < Stripe::RequestParams
1524
+ # The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted
1525
+ sig { returns(String) }
1526
+ attr_accessor :action
1527
+ # The `id` of the invoice that will be cloned.
1528
+ sig { returns(String) }
1529
+ attr_accessor :invoice
1530
+ sig { params(action: String, invoice: String).void }
1531
+ def initialize(action: nil, invoice: nil); end
1532
+ end
1533
+ class Issuer < Stripe::RequestParams
1534
+ # The connected account being referenced when `type` is `account`.
1535
+ sig { returns(T.nilable(String)) }
1536
+ attr_accessor :account
1537
+ # Type of the account referenced in the request.
1538
+ sig { returns(String) }
1539
+ attr_accessor :type
1540
+ sig { params(account: T.nilable(String), type: String).void }
1541
+ def initialize(account: nil, type: nil); end
1542
+ end
1543
+ class PaymentSettings < Stripe::RequestParams
1544
+ class PaymentMethodOptions < Stripe::RequestParams
1545
+ class AcssDebit < Stripe::RequestParams
1546
+ class MandateOptions < Stripe::RequestParams
1547
+ # Transaction type of the mandate.
1548
+ sig { returns(T.nilable(String)) }
1549
+ attr_accessor :transaction_type
1550
+ sig { params(transaction_type: T.nilable(String)).void }
1551
+ def initialize(transaction_type: nil); end
1552
+ end
1553
+ # Additional fields for Mandate creation
1554
+ sig {
1555
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
1556
+ }
1557
+ attr_accessor :mandate_options
1558
+ # Verification method for the intent
1559
+ sig { returns(T.nilable(String)) }
1560
+ attr_accessor :verification_method
1561
+ sig {
1562
+ params(mandate_options: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
1563
+ }
1564
+ def initialize(mandate_options: nil, verification_method: nil); end
1565
+ end
1566
+ class Bancontact < Stripe::RequestParams
1567
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
1568
+ sig { returns(T.nilable(String)) }
1569
+ attr_accessor :preferred_language
1570
+ sig { params(preferred_language: T.nilable(String)).void }
1571
+ def initialize(preferred_language: nil); end
1572
+ end
1573
+ class Card < Stripe::RequestParams
1574
+ class Installments < Stripe::RequestParams
1575
+ class Plan < Stripe::RequestParams
1576
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
1577
+ sig { returns(T.nilable(Integer)) }
1578
+ attr_accessor :count
1579
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
1580
+ # One of `month`.
1581
+ sig { returns(T.nilable(String)) }
1582
+ attr_accessor :interval
1583
+ # Type of installment plan, one of `fixed_count`.
1584
+ sig { returns(String) }
1585
+ attr_accessor :type
1586
+ sig {
1587
+ params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void
1588
+ }
1589
+ def initialize(count: nil, interval: nil, type: nil); end
1590
+ end
1591
+ # Setting to true enables installments for this invoice.
1592
+ # Setting to false will prevent any selected plan from applying to a payment.
1593
+ sig { returns(T.nilable(T::Boolean)) }
1594
+ attr_accessor :enabled
1595
+ # The selected installment plan to use for this invoice.
1596
+ sig {
1597
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan))))
1598
+ }
1599
+ attr_accessor :plan
1600
+ sig {
1601
+ params(enabled: T.nilable(T::Boolean), plan: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan)))).void
1602
+ }
1603
+ def initialize(enabled: nil, plan: nil); end
1604
+ end
1605
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
1606
+ #
1607
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
1608
+ sig {
1609
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments))
1610
+ }
1611
+ attr_accessor :installments
1612
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
1613
+ sig { returns(T.nilable(String)) }
1614
+ attr_accessor :request_three_d_secure
1615
+ sig {
1616
+ params(installments: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments), request_three_d_secure: T.nilable(String)).void
1617
+ }
1618
+ def initialize(installments: nil, request_three_d_secure: nil); end
1619
+ end
1620
+ class CustomerBalance < Stripe::RequestParams
1621
+ class BankTransfer < Stripe::RequestParams
1622
+ class EuBankTransfer < Stripe::RequestParams
1623
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1624
+ sig { returns(String) }
1625
+ attr_accessor :country
1626
+ sig { params(country: String).void }
1627
+ def initialize(country: nil); end
1628
+ end
1629
+ # Configuration for eu_bank_transfer funding type.
1630
+ sig {
1631
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
1632
+ }
1633
+ attr_accessor :eu_bank_transfer
1634
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
1635
+ sig { returns(T.nilable(String)) }
1636
+ attr_accessor :type
1637
+ sig {
1638
+ params(eu_bank_transfer: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
1639
+ }
1640
+ def initialize(eu_bank_transfer: nil, type: nil); end
1641
+ end
1642
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1643
+ sig {
1644
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
1645
+ }
1646
+ attr_accessor :bank_transfer
1647
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
1648
+ sig { returns(T.nilable(String)) }
1649
+ attr_accessor :funding_type
1650
+ sig {
1651
+ params(bank_transfer: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
1652
+ }
1653
+ def initialize(bank_transfer: nil, funding_type: nil); end
1654
+ end
1655
+ class Konbini < Stripe::RequestParams; end
1656
+ class SepaDebit < Stripe::RequestParams; end
1657
+ class UsBankAccount < Stripe::RequestParams
1658
+ class FinancialConnections < Stripe::RequestParams
1659
+ class Filters < Stripe::RequestParams
1660
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1661
+ sig { returns(T.nilable(T::Array[String])) }
1662
+ attr_accessor :account_subcategories
1663
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
1664
+ def initialize(account_subcategories: nil); end
1665
+ end
1666
+ # Provide filters for the linked accounts that the customer can select for the payment method.
1667
+ sig {
1668
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
1669
+ }
1670
+ attr_accessor :filters
1671
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
1672
+ sig { returns(T.nilable(T::Array[String])) }
1673
+ attr_accessor :permissions
1674
+ # List of data features that you would like to retrieve upon account creation.
1675
+ sig { returns(T.nilable(T::Array[String])) }
1676
+ attr_accessor :prefetch
1677
+ sig {
1678
+ params(filters: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
1679
+ }
1680
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
1681
+ end
1682
+ # Additional fields for Financial Connections Session creation
1683
+ sig {
1684
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
1685
+ }
1686
+ attr_accessor :financial_connections
1687
+ # Verification method for the intent
1688
+ sig { returns(T.nilable(String)) }
1689
+ attr_accessor :verification_method
1690
+ sig {
1691
+ params(financial_connections: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
1692
+ }
1693
+ def initialize(financial_connections: nil, verification_method: nil); end
1694
+ end
1695
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1696
+ sig {
1697
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
1698
+ }
1699
+ attr_accessor :acss_debit
1700
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1701
+ sig {
1702
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
1703
+ }
1704
+ attr_accessor :bancontact
1705
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1706
+ sig {
1707
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card))))
1708
+ }
1709
+ attr_accessor :card
1710
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1711
+ sig {
1712
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
1713
+ }
1714
+ attr_accessor :customer_balance
1715
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1716
+ sig {
1717
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
1718
+ }
1719
+ attr_accessor :konbini
1720
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1721
+ sig {
1722
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
1723
+ }
1724
+ attr_accessor :sepa_debit
1725
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1726
+ sig {
1727
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
1728
+ }
1729
+ attr_accessor :us_bank_account
1730
+ sig {
1731
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
1732
+ }
1733
+ def initialize(
1734
+ acss_debit: nil,
1735
+ bancontact: nil,
1736
+ card: nil,
1737
+ customer_balance: nil,
1738
+ konbini: nil,
1739
+ sepa_debit: nil,
1740
+ us_bank_account: nil
1741
+ ); end
1742
+ end
1743
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1744
+ sig { returns(T.nilable(T.nilable(String))) }
1745
+ attr_accessor :default_mandate
1746
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
1747
+ sig {
1748
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions))
1749
+ }
1750
+ attr_accessor :payment_method_options
1751
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
1752
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1753
+ attr_accessor :payment_method_types
1754
+ sig {
1755
+ params(default_mandate: T.nilable(T.nilable(String)), payment_method_options: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1756
+ }
1757
+ def initialize(
1758
+ default_mandate: nil,
1759
+ payment_method_options: nil,
1760
+ payment_method_types: nil
1761
+ ); end
1762
+ end
1763
+ class Rendering < Stripe::RequestParams
1764
+ class Pdf < Stripe::RequestParams
1765
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
1766
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
1767
+ # Japanese locale and `letter` for customers with other locales.
1768
+ sig { returns(T.nilable(String)) }
1769
+ attr_accessor :page_size
1770
+ sig { params(page_size: T.nilable(String)).void }
1771
+ def initialize(page_size: nil); end
1772
+ end
1773
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
1774
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
1775
+ attr_accessor :amount_tax_display
1776
+ # Invoice pdf rendering options
1777
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::Rendering::Pdf)) }
1778
+ attr_accessor :pdf
1779
+ # ID of the invoice rendering template to use for this invoice.
1780
+ sig { returns(T.nilable(String)) }
1781
+ attr_accessor :template
1782
+ # The specific version of invoice rendering template to use for this invoice.
1783
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
1784
+ attr_accessor :template_version
1785
+ sig {
1786
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), pdf: T.nilable(::Stripe::Invoice::CreateParams::Rendering::Pdf), template: T.nilable(String), template_version: T.nilable(T.nilable(T.any(String, Integer)))).void
1787
+ }
1788
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil); end
1789
+ end
1790
+ class ShippingCost < Stripe::RequestParams
1791
+ class ShippingRateData < Stripe::RequestParams
1792
+ class DeliveryEstimate < Stripe::RequestParams
1793
+ class Maximum < Stripe::RequestParams
1794
+ # A unit of time.
1795
+ sig { returns(String) }
1796
+ attr_accessor :unit
1797
+ # Must be greater than 0.
1798
+ sig { returns(Integer) }
1799
+ attr_accessor :value
1800
+ sig { params(unit: String, value: Integer).void }
1801
+ def initialize(unit: nil, value: nil); end
1802
+ end
1803
+ class Minimum < Stripe::RequestParams
1804
+ # A unit of time.
1805
+ sig { returns(String) }
1806
+ attr_accessor :unit
1807
+ # Must be greater than 0.
1808
+ sig { returns(Integer) }
1809
+ attr_accessor :value
1810
+ sig { params(unit: String, value: Integer).void }
1811
+ def initialize(unit: nil, value: nil); end
1812
+ end
1813
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
1814
+ sig {
1815
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum))
1816
+ }
1817
+ attr_accessor :maximum
1818
+ # The lower bound of the estimated range. If empty, represents no lower bound.
1819
+ sig {
1820
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum))
1821
+ }
1822
+ attr_accessor :minimum
1823
+ sig {
1824
+ params(maximum: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum), minimum: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum)).void
1825
+ }
1826
+ def initialize(maximum: nil, minimum: nil); end
1827
+ end
1828
+ class FixedAmount < Stripe::RequestParams
1829
+ class CurrencyOptions < Stripe::RequestParams
1830
+ # A non-negative integer in cents representing how much to charge.
1831
+ sig { returns(Integer) }
1832
+ attr_accessor :amount
1833
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1834
+ sig { returns(T.nilable(String)) }
1835
+ attr_accessor :tax_behavior
1836
+ sig { params(amount: Integer, tax_behavior: T.nilable(String)).void }
1837
+ def initialize(amount: nil, tax_behavior: nil); end
1838
+ end
1839
+ # A non-negative integer in cents representing how much to charge.
1840
+ sig { returns(Integer) }
1841
+ attr_accessor :amount
1842
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
1843
+ sig { returns(String) }
1844
+ attr_accessor :currency
1845
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
1846
+ sig {
1847
+ returns(T.nilable(T::Hash[String, ::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions]))
1848
+ }
1849
+ attr_accessor :currency_options
1850
+ sig {
1851
+ params(amount: Integer, currency: String, currency_options: T.nilable(T::Hash[String, ::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions])).void
1852
+ }
1853
+ def initialize(amount: nil, currency: nil, currency_options: nil); end
1854
+ end
1855
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1856
+ sig {
1857
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate))
1858
+ }
1859
+ attr_accessor :delivery_estimate
1860
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1861
+ sig { returns(String) }
1862
+ attr_accessor :display_name
1863
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1864
+ sig {
1865
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount))
1866
+ }
1867
+ attr_accessor :fixed_amount
1868
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1869
+ sig { returns(T.nilable(T::Hash[String, String])) }
1870
+ attr_accessor :metadata
1871
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1872
+ sig { returns(T.nilable(String)) }
1873
+ attr_accessor :tax_behavior
1874
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1875
+ sig { returns(T.nilable(String)) }
1876
+ attr_accessor :tax_code
1877
+ # The type of calculation to use on the shipping rate.
1878
+ sig { returns(T.nilable(String)) }
1879
+ attr_accessor :type
1880
+ sig {
1881
+ params(delivery_estimate: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate), display_name: String, fixed_amount: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount), metadata: T.nilable(T::Hash[String, String]), tax_behavior: T.nilable(String), tax_code: T.nilable(String), type: T.nilable(String)).void
1882
+ }
1883
+ def initialize(
1884
+ delivery_estimate: nil,
1885
+ display_name: nil,
1886
+ fixed_amount: nil,
1887
+ metadata: nil,
1888
+ tax_behavior: nil,
1889
+ tax_code: nil,
1890
+ type: nil
1891
+ ); end
1892
+ end
1893
+ # The ID of the shipping rate to use for this order.
1894
+ sig { returns(T.nilable(String)) }
1895
+ attr_accessor :shipping_rate
1896
+ # Parameters to create a new ad-hoc shipping rate for this order.
1897
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData)) }
1898
+ attr_accessor :shipping_rate_data
1899
+ sig {
1900
+ params(shipping_rate: T.nilable(String), shipping_rate_data: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData)).void
1901
+ }
1902
+ def initialize(shipping_rate: nil, shipping_rate_data: nil); end
1903
+ end
1904
+ class ShippingDetails < Stripe::RequestParams
1905
+ class Address < Stripe::RequestParams
1906
+ # City, district, suburb, town, or village.
1907
+ sig { returns(T.nilable(String)) }
1908
+ attr_accessor :city
1909
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1910
+ sig { returns(T.nilable(String)) }
1911
+ attr_accessor :country
1912
+ # Address line 1 (e.g., street, PO Box, or company name).
1913
+ sig { returns(T.nilable(String)) }
1914
+ attr_accessor :line1
1915
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1916
+ sig { returns(T.nilable(String)) }
1917
+ attr_accessor :line2
1918
+ # ZIP or postal code.
1919
+ sig { returns(T.nilable(String)) }
1920
+ attr_accessor :postal_code
1921
+ # State, county, province, or region.
1922
+ sig { returns(T.nilable(String)) }
1923
+ attr_accessor :state
1924
+ sig {
1925
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
1926
+ }
1927
+ def initialize(
1928
+ city: nil,
1929
+ country: nil,
1930
+ line1: nil,
1931
+ line2: nil,
1932
+ postal_code: nil,
1933
+ state: nil
1934
+ ); end
1935
+ end
1936
+ # Shipping address
1937
+ sig { returns(::Stripe::Invoice::CreateParams::ShippingDetails::Address) }
1938
+ attr_accessor :address
1939
+ # Recipient name.
1940
+ sig { returns(String) }
1941
+ attr_accessor :name
1942
+ # Recipient phone (including extension)
1943
+ sig { returns(T.nilable(T.nilable(String))) }
1944
+ attr_accessor :phone
1945
+ sig {
1946
+ params(address: ::Stripe::Invoice::CreateParams::ShippingDetails::Address, name: String, phone: T.nilable(T.nilable(String))).void
1947
+ }
1948
+ def initialize(address: nil, name: nil, phone: nil); end
1949
+ end
1950
+ class TransferData < Stripe::RequestParams
1951
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
1952
+ sig { returns(T.nilable(Integer)) }
1953
+ attr_accessor :amount
1954
+ # ID of an existing, connected Stripe account.
1955
+ sig { returns(String) }
1956
+ attr_accessor :destination
1957
+ sig { params(amount: T.nilable(Integer), destination: String).void }
1958
+ def initialize(amount: nil, destination: nil); end
1959
+ end
1960
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1961
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1962
+ attr_accessor :account_tax_ids
1963
+ # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1964
+ sig { returns(T.nilable(Integer)) }
1965
+ attr_accessor :application_fee_amount
1966
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1967
+ sig { returns(T.nilable(T::Boolean)) }
1968
+ attr_accessor :auto_advance
1969
+ # Settings for automatic tax lookup for this invoice.
1970
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax)) }
1971
+ attr_accessor :automatic_tax
1972
+ # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state.
1973
+ sig { returns(T.nilable(Integer)) }
1974
+ attr_accessor :automatically_finalizes_at
1975
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`.
1976
+ sig { returns(T.nilable(String)) }
1977
+ attr_accessor :collection_method
1978
+ # The currency to create this invoice in. Defaults to that of `customer` if not specified.
1979
+ sig { returns(T.nilable(String)) }
1980
+ attr_accessor :currency
1981
+ # A list of up to 4 custom fields to be displayed on the invoice.
1982
+ sig {
1983
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::CustomField]))))
1984
+ }
1985
+ attr_accessor :custom_fields
1986
+ # The ID of the customer who will be billed.
1987
+ sig { returns(T.nilable(String)) }
1988
+ attr_accessor :customer
1989
+ # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1990
+ sig { returns(T.nilable(Integer)) }
1991
+ attr_accessor :days_until_due
1992
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
1993
+ sig { returns(T.nilable(String)) }
1994
+ attr_accessor :default_payment_method
1995
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
1996
+ sig { returns(T.nilable(String)) }
1997
+ attr_accessor :default_source
1998
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
1999
+ sig { returns(T.nilable(T::Array[String])) }
2000
+ attr_accessor :default_tax_rates
2001
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
2002
+ sig { returns(T.nilable(String)) }
2003
+ attr_accessor :description
2004
+ # The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts.
2005
+ sig {
2006
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::Discount]))))
2007
+ }
2008
+ attr_accessor :discounts
2009
+ # The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`.
2010
+ sig { returns(T.nilable(Integer)) }
2011
+ attr_accessor :due_date
2012
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
2013
+ sig { returns(T.nilable(Integer)) }
2014
+ attr_accessor :effective_at
2015
+ # Specifies which fields in the response should be expanded.
2016
+ sig { returns(T.nilable(T::Array[String])) }
2017
+ attr_accessor :expand
2018
+ # Footer to be displayed on the invoice.
2019
+ sig { returns(T.nilable(String)) }
2020
+ attr_accessor :footer
2021
+ # Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
2022
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::FromInvoice)) }
2023
+ attr_accessor :from_invoice
2024
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2025
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::Issuer)) }
2026
+ attr_accessor :issuer
2027
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2028
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2029
+ attr_accessor :metadata
2030
+ # Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.
2031
+ sig { returns(T.nilable(String)) }
2032
+ attr_accessor :number
2033
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
2034
+ sig { returns(T.nilable(String)) }
2035
+ attr_accessor :on_behalf_of
2036
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
2037
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings)) }
2038
+ attr_accessor :payment_settings
2039
+ # How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted.
2040
+ sig { returns(T.nilable(String)) }
2041
+ attr_accessor :pending_invoice_items_behavior
2042
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
2043
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::Rendering)) }
2044
+ attr_accessor :rendering
2045
+ # Settings for the cost of shipping for this invoice.
2046
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost)) }
2047
+ attr_accessor :shipping_cost
2048
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
2049
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingDetails)) }
2050
+ attr_accessor :shipping_details
2051
+ # Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
2052
+ sig { returns(T.nilable(String)) }
2053
+ attr_accessor :statement_descriptor
2054
+ # The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected.
2055
+ sig { returns(T.nilable(String)) }
2056
+ attr_accessor :subscription
2057
+ # If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge.
2058
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::TransferData)) }
2059
+ attr_accessor :transfer_data
2060
+ sig {
2061
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), application_fee_amount: T.nilable(Integer), auto_advance: T.nilable(T::Boolean), automatic_tax: T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax), automatically_finalizes_at: T.nilable(Integer), collection_method: T.nilable(String), currency: T.nilable(String), custom_fields: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::CustomField]))), customer: T.nilable(String), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(String), default_tax_rates: T.nilable(T::Array[String]), description: T.nilable(String), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::Discount]))), due_date: T.nilable(Integer), effective_at: T.nilable(Integer), expand: T.nilable(T::Array[String]), footer: T.nilable(String), from_invoice: T.nilable(::Stripe::Invoice::CreateParams::FromInvoice), issuer: T.nilable(::Stripe::Invoice::CreateParams::Issuer), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), number: T.nilable(String), on_behalf_of: T.nilable(String), payment_settings: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings), pending_invoice_items_behavior: T.nilable(String), rendering: T.nilable(::Stripe::Invoice::CreateParams::Rendering), shipping_cost: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost), shipping_details: T.nilable(::Stripe::Invoice::CreateParams::ShippingDetails), statement_descriptor: T.nilable(String), subscription: T.nilable(String), transfer_data: T.nilable(::Stripe::Invoice::CreateParams::TransferData)).void
2062
+ }
2063
+ def initialize(
2064
+ account_tax_ids: nil,
2065
+ application_fee_amount: nil,
2066
+ auto_advance: nil,
2067
+ automatic_tax: nil,
2068
+ automatically_finalizes_at: nil,
2069
+ collection_method: nil,
2070
+ currency: nil,
2071
+ custom_fields: nil,
2072
+ customer: nil,
2073
+ days_until_due: nil,
2074
+ default_payment_method: nil,
2075
+ default_source: nil,
2076
+ default_tax_rates: nil,
2077
+ description: nil,
2078
+ discounts: nil,
2079
+ due_date: nil,
2080
+ effective_at: nil,
2081
+ expand: nil,
2082
+ footer: nil,
2083
+ from_invoice: nil,
2084
+ issuer: nil,
2085
+ metadata: nil,
2086
+ number: nil,
2087
+ on_behalf_of: nil,
2088
+ payment_settings: nil,
2089
+ pending_invoice_items_behavior: nil,
2090
+ rendering: nil,
2091
+ shipping_cost: nil,
2092
+ shipping_details: nil,
2093
+ statement_descriptor: nil,
2094
+ subscription: nil,
2095
+ transfer_data: nil
2096
+ ); end
2097
+ end
2098
+ class SearchParams < Stripe::RequestParams
2099
+ # Specifies which fields in the response should be expanded.
2100
+ sig { returns(T.nilable(T::Array[String])) }
2101
+ attr_accessor :expand
2102
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
2103
+ sig { returns(T.nilable(Integer)) }
2104
+ attr_accessor :limit
2105
+ # A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
2106
+ sig { returns(T.nilable(String)) }
2107
+ attr_accessor :page
2108
+ # The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices).
2109
+ sig { returns(String) }
2110
+ attr_accessor :query
2111
+ sig {
2112
+ params(expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), page: T.nilable(String), query: String).void
2113
+ }
2114
+ def initialize(expand: nil, limit: nil, page: nil, query: nil); end
2115
+ end
2116
+ class AddLinesParams < Stripe::RequestParams
2117
+ class Line < Stripe::RequestParams
2118
+ class Discount < Stripe::RequestParams
2119
+ # ID of the coupon to create a new discount for.
2120
+ sig { returns(T.nilable(String)) }
2121
+ attr_accessor :coupon
2122
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2123
+ sig { returns(T.nilable(String)) }
2124
+ attr_accessor :discount
2125
+ # ID of the promotion code to create a new discount for.
2126
+ sig { returns(T.nilable(String)) }
2127
+ attr_accessor :promotion_code
2128
+ sig {
2129
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2130
+ }
2131
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2132
+ end
2133
+ class Period < Stripe::RequestParams
2134
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2135
+ sig { returns(Integer) }
2136
+ attr_accessor :end
2137
+ # The start of the period. This value is inclusive.
2138
+ sig { returns(Integer) }
2139
+ attr_accessor :start
2140
+ sig { params(end_: Integer, start: Integer).void }
2141
+ def initialize(end_: nil, start: nil); end
2142
+ end
2143
+ class PriceData < Stripe::RequestParams
2144
+ class ProductData < Stripe::RequestParams
2145
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
2146
+ sig { returns(T.nilable(String)) }
2147
+ attr_accessor :description
2148
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
2149
+ sig { returns(T.nilable(T::Array[String])) }
2150
+ attr_accessor :images
2151
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2152
+ sig { returns(T.nilable(T::Hash[String, String])) }
2153
+ attr_accessor :metadata
2154
+ # The product's name, meant to be displayable to the customer.
2155
+ sig { returns(String) }
2156
+ attr_accessor :name
2157
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2158
+ sig { returns(T.nilable(String)) }
2159
+ attr_accessor :tax_code
2160
+ sig {
2161
+ params(description: T.nilable(String), images: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), name: String, tax_code: T.nilable(String)).void
2162
+ }
2163
+ def initialize(
2164
+ description: nil,
2165
+ images: nil,
2166
+ metadata: nil,
2167
+ name: nil,
2168
+ tax_code: nil
2169
+ ); end
2170
+ end
2171
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2172
+ sig { returns(String) }
2173
+ attr_accessor :currency
2174
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
2175
+ sig { returns(T.nilable(String)) }
2176
+ attr_accessor :product
2177
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
2178
+ sig {
2179
+ returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData::ProductData))
2180
+ }
2181
+ attr_accessor :product_data
2182
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2183
+ sig { returns(T.nilable(String)) }
2184
+ attr_accessor :tax_behavior
2185
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
2186
+ sig { returns(T.nilable(Integer)) }
2187
+ attr_accessor :unit_amount
2188
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2189
+ sig { returns(T.nilable(String)) }
2190
+ attr_accessor :unit_amount_decimal
2191
+ sig {
2192
+ params(currency: String, product: T.nilable(String), product_data: T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData::ProductData), tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2193
+ }
2194
+ def initialize(
2195
+ currency: nil,
2196
+ product: nil,
2197
+ product_data: nil,
2198
+ tax_behavior: nil,
2199
+ unit_amount: nil,
2200
+ unit_amount_decimal: nil
2201
+ ); end
2202
+ end
2203
+ class Pricing < Stripe::RequestParams
2204
+ # The ID of the price object.
2205
+ sig { returns(T.nilable(String)) }
2206
+ attr_accessor :price
2207
+ sig { params(price: T.nilable(String)).void }
2208
+ def initialize(price: nil); end
2209
+ end
2210
+ class TaxAmount < Stripe::RequestParams
2211
+ class TaxRateData < Stripe::RequestParams
2212
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2213
+ sig { returns(T.nilable(String)) }
2214
+ attr_accessor :country
2215
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
2216
+ sig { returns(T.nilable(String)) }
2217
+ attr_accessor :description
2218
+ # The display name of the tax rate, which will be shown to users.
2219
+ sig { returns(String) }
2220
+ attr_accessor :display_name
2221
+ # This specifies if the tax rate is inclusive or exclusive.
2222
+ sig { returns(T::Boolean) }
2223
+ attr_accessor :inclusive
2224
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
2225
+ sig { returns(T.nilable(String)) }
2226
+ attr_accessor :jurisdiction
2227
+ # The level of the jurisdiction that imposes this tax rate.
2228
+ sig { returns(T.nilable(String)) }
2229
+ attr_accessor :jurisdiction_level
2230
+ # The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
2231
+ sig { returns(Float) }
2232
+ attr_accessor :percentage
2233
+ # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
2234
+ sig { returns(T.nilable(String)) }
2235
+ attr_accessor :state
2236
+ # The high-level tax type, such as `vat` or `sales_tax`.
2237
+ sig { returns(T.nilable(String)) }
2238
+ attr_accessor :tax_type
2239
+ sig {
2240
+ params(country: T.nilable(String), description: T.nilable(String), display_name: String, inclusive: T::Boolean, jurisdiction: T.nilable(String), jurisdiction_level: T.nilable(String), percentage: Float, state: T.nilable(String), tax_type: T.nilable(String)).void
2241
+ }
2242
+ def initialize(
2243
+ country: nil,
2244
+ description: nil,
2245
+ display_name: nil,
2246
+ inclusive: nil,
2247
+ jurisdiction: nil,
2248
+ jurisdiction_level: nil,
2249
+ percentage: nil,
2250
+ state: nil,
2251
+ tax_type: nil
2252
+ ); end
2253
+ end
2254
+ # The amount, in cents (or local equivalent), of the tax.
2255
+ sig { returns(Integer) }
2256
+ attr_accessor :amount
2257
+ # Data to find or create a TaxRate object.
2258
+ #
2259
+ # Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
2260
+ sig { returns(::Stripe::Invoice::AddLinesParams::Line::TaxAmount::TaxRateData) }
2261
+ attr_accessor :tax_rate_data
2262
+ # The reasoning behind this tax, for example, if the product is tax exempt.
2263
+ sig { returns(T.nilable(String)) }
2264
+ attr_accessor :taxability_reason
2265
+ # The amount on which tax is calculated, in cents (or local equivalent).
2266
+ sig { returns(Integer) }
2267
+ attr_accessor :taxable_amount
2268
+ sig {
2269
+ params(amount: Integer, tax_rate_data: ::Stripe::Invoice::AddLinesParams::Line::TaxAmount::TaxRateData, taxability_reason: T.nilable(String), taxable_amount: Integer).void
2270
+ }
2271
+ def initialize(
2272
+ amount: nil,
2273
+ tax_rate_data: nil,
2274
+ taxability_reason: nil,
2275
+ taxable_amount: nil
2276
+ ); end
2277
+ end
2278
+ # The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
2279
+ sig { returns(T.nilable(Integer)) }
2280
+ attr_accessor :amount
2281
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2282
+ sig { returns(T.nilable(String)) }
2283
+ attr_accessor :description
2284
+ # Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
2285
+ sig { returns(T.nilable(T::Boolean)) }
2286
+ attr_accessor :discountable
2287
+ # The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
2288
+ sig {
2289
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::Discount]))))
2290
+ }
2291
+ attr_accessor :discounts
2292
+ # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
2293
+ sig { returns(T.nilable(String)) }
2294
+ attr_accessor :invoice_item
2295
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2296
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2297
+ attr_accessor :metadata
2298
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
2299
+ sig { returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::Period)) }
2300
+ attr_accessor :period
2301
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2302
+ sig { returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData)) }
2303
+ attr_accessor :price_data
2304
+ # The pricing information for the invoice item.
2305
+ sig { returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::Pricing)) }
2306
+ attr_accessor :pricing
2307
+ # Non-negative integer. The quantity of units for the line item.
2308
+ sig { returns(T.nilable(Integer)) }
2309
+ attr_accessor :quantity
2310
+ # A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
2311
+ sig {
2312
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::TaxAmount]))))
2313
+ }
2314
+ attr_accessor :tax_amounts
2315
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
2316
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2317
+ attr_accessor :tax_rates
2318
+ sig {
2319
+ params(amount: T.nilable(Integer), description: T.nilable(String), discountable: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::Discount]))), invoice_item: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::Invoice::AddLinesParams::Line::Period), price_data: T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData), pricing: T.nilable(::Stripe::Invoice::AddLinesParams::Line::Pricing), quantity: T.nilable(Integer), tax_amounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::TaxAmount]))), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
2320
+ }
2321
+ def initialize(
2322
+ amount: nil,
2323
+ description: nil,
2324
+ discountable: nil,
2325
+ discounts: nil,
2326
+ invoice_item: nil,
2327
+ metadata: nil,
2328
+ period: nil,
2329
+ price_data: nil,
2330
+ pricing: nil,
2331
+ quantity: nil,
2332
+ tax_amounts: nil,
2333
+ tax_rates: nil
2334
+ ); end
2335
+ end
2336
+ # Specifies which fields in the response should be expanded.
2337
+ sig { returns(T.nilable(T::Array[String])) }
2338
+ attr_accessor :expand
2339
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2340
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2341
+ attr_accessor :invoice_metadata
2342
+ # The line items to add.
2343
+ sig { returns(T::Array[::Stripe::Invoice::AddLinesParams::Line]) }
2344
+ attr_accessor :lines
2345
+ sig {
2346
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::Invoice::AddLinesParams::Line]).void
2347
+ }
2348
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
2349
+ end
2350
+ class AttachPaymentParams < Stripe::RequestParams
2351
+ # Specifies which fields in the response should be expanded.
2352
+ sig { returns(T.nilable(T::Array[String])) }
2353
+ attr_accessor :expand
2354
+ # The ID of the PaymentIntent to attach to the invoice.
2355
+ sig { returns(T.nilable(String)) }
2356
+ attr_accessor :payment_intent
2357
+ sig { params(expand: T.nilable(T::Array[String]), payment_intent: T.nilable(String)).void }
2358
+ def initialize(expand: nil, payment_intent: nil); end
2359
+ end
2360
+ class FinalizeInvoiceParams < Stripe::RequestParams
2361
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
2362
+ sig { returns(T.nilable(T::Boolean)) }
2363
+ attr_accessor :auto_advance
2364
+ # Specifies which fields in the response should be expanded.
2365
+ sig { returns(T.nilable(T::Array[String])) }
2366
+ attr_accessor :expand
2367
+ sig { params(auto_advance: T.nilable(T::Boolean), expand: T.nilable(T::Array[String])).void }
2368
+ def initialize(auto_advance: nil, expand: nil); end
2369
+ end
2370
+ class MarkUncollectibleParams < Stripe::RequestParams
2371
+ # Specifies which fields in the response should be expanded.
2372
+ sig { returns(T.nilable(T::Array[String])) }
2373
+ attr_accessor :expand
2374
+ sig { params(expand: T.nilable(T::Array[String])).void }
2375
+ def initialize(expand: nil); end
2376
+ end
2377
+ class PayParams < Stripe::RequestParams
2378
+ # Specifies which fields in the response should be expanded.
2379
+ sig { returns(T.nilable(T::Array[String])) }
2380
+ attr_accessor :expand
2381
+ # In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due.
2382
+ #
2383
+ # Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`.
2384
+ sig { returns(T.nilable(T::Boolean)) }
2385
+ attr_accessor :forgive
2386
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set.
2387
+ sig { returns(T.nilable(T.nilable(String))) }
2388
+ attr_accessor :mandate
2389
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).
2390
+ sig { returns(T.nilable(T::Boolean)) }
2391
+ attr_accessor :off_session
2392
+ # Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`.
2393
+ sig { returns(T.nilable(T::Boolean)) }
2394
+ attr_accessor :paid_out_of_band
2395
+ # A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.
2396
+ sig { returns(T.nilable(String)) }
2397
+ attr_accessor :payment_method
2398
+ # A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid.
2399
+ sig { returns(T.nilable(String)) }
2400
+ attr_accessor :source
2401
+ sig {
2402
+ params(expand: T.nilable(T::Array[String]), forgive: T.nilable(T::Boolean), mandate: T.nilable(T.nilable(String)), off_session: T.nilable(T::Boolean), paid_out_of_band: T.nilable(T::Boolean), payment_method: T.nilable(String), source: T.nilable(String)).void
2403
+ }
2404
+ def initialize(
2405
+ expand: nil,
2406
+ forgive: nil,
2407
+ mandate: nil,
2408
+ off_session: nil,
2409
+ paid_out_of_band: nil,
2410
+ payment_method: nil,
2411
+ source: nil
2412
+ ); end
2413
+ end
2414
+ class RemoveLinesParams < Stripe::RequestParams
2415
+ class Line < Stripe::RequestParams
2416
+ # Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice.
2417
+ sig { returns(String) }
2418
+ attr_accessor :behavior
2419
+ # ID of an existing line item to remove from this invoice.
2420
+ sig { returns(String) }
2421
+ attr_accessor :id
2422
+ sig { params(behavior: String, id: String).void }
2423
+ def initialize(behavior: nil, id: nil); end
2424
+ end
2425
+ # Specifies which fields in the response should be expanded.
2426
+ sig { returns(T.nilable(T::Array[String])) }
2427
+ attr_accessor :expand
2428
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2429
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2430
+ attr_accessor :invoice_metadata
2431
+ # The line items to remove.
2432
+ sig { returns(T::Array[::Stripe::Invoice::RemoveLinesParams::Line]) }
2433
+ attr_accessor :lines
2434
+ sig {
2435
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::Invoice::RemoveLinesParams::Line]).void
2436
+ }
2437
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
2438
+ end
2439
+ class SendInvoiceParams < Stripe::RequestParams
2440
+ # Specifies which fields in the response should be expanded.
2441
+ sig { returns(T.nilable(T::Array[String])) }
2442
+ attr_accessor :expand
2443
+ sig { params(expand: T.nilable(T::Array[String])).void }
2444
+ def initialize(expand: nil); end
2445
+ end
2446
+ class UpdateLinesParams < Stripe::RequestParams
2447
+ class Line < Stripe::RequestParams
2448
+ class Discount < Stripe::RequestParams
2449
+ # ID of the coupon to create a new discount for.
2450
+ sig { returns(T.nilable(String)) }
2451
+ attr_accessor :coupon
2452
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2453
+ sig { returns(T.nilable(String)) }
2454
+ attr_accessor :discount
2455
+ # ID of the promotion code to create a new discount for.
2456
+ sig { returns(T.nilable(String)) }
2457
+ attr_accessor :promotion_code
2458
+ sig {
2459
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2460
+ }
2461
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2462
+ end
2463
+ class Period < Stripe::RequestParams
2464
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2465
+ sig { returns(Integer) }
2466
+ attr_accessor :end
2467
+ # The start of the period. This value is inclusive.
2468
+ sig { returns(Integer) }
2469
+ attr_accessor :start
2470
+ sig { params(end_: Integer, start: Integer).void }
2471
+ def initialize(end_: nil, start: nil); end
2472
+ end
2473
+ class PriceData < Stripe::RequestParams
2474
+ class ProductData < Stripe::RequestParams
2475
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
2476
+ sig { returns(T.nilable(String)) }
2477
+ attr_accessor :description
2478
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
2479
+ sig { returns(T.nilable(T::Array[String])) }
2480
+ attr_accessor :images
2481
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2482
+ sig { returns(T.nilable(T::Hash[String, String])) }
2483
+ attr_accessor :metadata
2484
+ # The product's name, meant to be displayable to the customer.
2485
+ sig { returns(String) }
2486
+ attr_accessor :name
2487
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2488
+ sig { returns(T.nilable(String)) }
2489
+ attr_accessor :tax_code
2490
+ sig {
2491
+ params(description: T.nilable(String), images: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), name: String, tax_code: T.nilable(String)).void
2492
+ }
2493
+ def initialize(
2494
+ description: nil,
2495
+ images: nil,
2496
+ metadata: nil,
2497
+ name: nil,
2498
+ tax_code: nil
2499
+ ); end
2500
+ end
2501
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2502
+ sig { returns(String) }
2503
+ attr_accessor :currency
2504
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
2505
+ sig { returns(T.nilable(String)) }
2506
+ attr_accessor :product
2507
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
2508
+ sig {
2509
+ returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData::ProductData))
2510
+ }
2511
+ attr_accessor :product_data
2512
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2513
+ sig { returns(T.nilable(String)) }
2514
+ attr_accessor :tax_behavior
2515
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
2516
+ sig { returns(T.nilable(Integer)) }
2517
+ attr_accessor :unit_amount
2518
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2519
+ sig { returns(T.nilable(String)) }
2520
+ attr_accessor :unit_amount_decimal
2521
+ sig {
2522
+ params(currency: String, product: T.nilable(String), product_data: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData::ProductData), tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2523
+ }
2524
+ def initialize(
2525
+ currency: nil,
2526
+ product: nil,
2527
+ product_data: nil,
2528
+ tax_behavior: nil,
2529
+ unit_amount: nil,
2530
+ unit_amount_decimal: nil
2531
+ ); end
2532
+ end
2533
+ class Pricing < Stripe::RequestParams
2534
+ # The ID of the price object.
2535
+ sig { returns(T.nilable(String)) }
2536
+ attr_accessor :price
2537
+ sig { params(price: T.nilable(String)).void }
2538
+ def initialize(price: nil); end
2539
+ end
2540
+ class TaxAmount < Stripe::RequestParams
2541
+ class TaxRateData < Stripe::RequestParams
2542
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2543
+ sig { returns(T.nilable(String)) }
2544
+ attr_accessor :country
2545
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
2546
+ sig { returns(T.nilable(String)) }
2547
+ attr_accessor :description
2548
+ # The display name of the tax rate, which will be shown to users.
2549
+ sig { returns(String) }
2550
+ attr_accessor :display_name
2551
+ # This specifies if the tax rate is inclusive or exclusive.
2552
+ sig { returns(T::Boolean) }
2553
+ attr_accessor :inclusive
2554
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
2555
+ sig { returns(T.nilable(String)) }
2556
+ attr_accessor :jurisdiction
2557
+ # The level of the jurisdiction that imposes this tax rate.
2558
+ sig { returns(T.nilable(String)) }
2559
+ attr_accessor :jurisdiction_level
2560
+ # The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
2561
+ sig { returns(Float) }
2562
+ attr_accessor :percentage
2563
+ # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
2564
+ sig { returns(T.nilable(String)) }
2565
+ attr_accessor :state
2566
+ # The high-level tax type, such as `vat` or `sales_tax`.
2567
+ sig { returns(T.nilable(String)) }
2568
+ attr_accessor :tax_type
2569
+ sig {
2570
+ params(country: T.nilable(String), description: T.nilable(String), display_name: String, inclusive: T::Boolean, jurisdiction: T.nilable(String), jurisdiction_level: T.nilable(String), percentage: Float, state: T.nilable(String), tax_type: T.nilable(String)).void
2571
+ }
2572
+ def initialize(
2573
+ country: nil,
2574
+ description: nil,
2575
+ display_name: nil,
2576
+ inclusive: nil,
2577
+ jurisdiction: nil,
2578
+ jurisdiction_level: nil,
2579
+ percentage: nil,
2580
+ state: nil,
2581
+ tax_type: nil
2582
+ ); end
2583
+ end
2584
+ # The amount, in cents (or local equivalent), of the tax.
2585
+ sig { returns(Integer) }
2586
+ attr_accessor :amount
2587
+ # Data to find or create a TaxRate object.
2588
+ #
2589
+ # Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
2590
+ sig { returns(::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount::TaxRateData) }
2591
+ attr_accessor :tax_rate_data
2592
+ # The reasoning behind this tax, for example, if the product is tax exempt.
2593
+ sig { returns(T.nilable(String)) }
2594
+ attr_accessor :taxability_reason
2595
+ # The amount on which tax is calculated, in cents (or local equivalent).
2596
+ sig { returns(Integer) }
2597
+ attr_accessor :taxable_amount
2598
+ sig {
2599
+ params(amount: Integer, tax_rate_data: ::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount::TaxRateData, taxability_reason: T.nilable(String), taxable_amount: Integer).void
2600
+ }
2601
+ def initialize(
2602
+ amount: nil,
2603
+ tax_rate_data: nil,
2604
+ taxability_reason: nil,
2605
+ taxable_amount: nil
2606
+ ); end
2607
+ end
2608
+ # The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
2609
+ sig { returns(T.nilable(Integer)) }
2610
+ attr_accessor :amount
2611
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2612
+ sig { returns(T.nilable(String)) }
2613
+ attr_accessor :description
2614
+ # Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
2615
+ sig { returns(T.nilable(T::Boolean)) }
2616
+ attr_accessor :discountable
2617
+ # The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
2618
+ sig {
2619
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::Discount]))))
2620
+ }
2621
+ attr_accessor :discounts
2622
+ # ID of an existing line item on the invoice.
2623
+ sig { returns(String) }
2624
+ attr_accessor :id
2625
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
2626
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2627
+ attr_accessor :metadata
2628
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
2629
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Period)) }
2630
+ attr_accessor :period
2631
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2632
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData)) }
2633
+ attr_accessor :price_data
2634
+ # The pricing information for the invoice item.
2635
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Pricing)) }
2636
+ attr_accessor :pricing
2637
+ # Non-negative integer. The quantity of units for the line item.
2638
+ sig { returns(T.nilable(Integer)) }
2639
+ attr_accessor :quantity
2640
+ # A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
2641
+ sig {
2642
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount]))))
2643
+ }
2644
+ attr_accessor :tax_amounts
2645
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
2646
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2647
+ attr_accessor :tax_rates
2648
+ sig {
2649
+ params(amount: T.nilable(Integer), description: T.nilable(String), discountable: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::Discount]))), id: String, metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Period), price_data: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData), pricing: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Pricing), quantity: T.nilable(Integer), tax_amounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount]))), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
2650
+ }
2651
+ def initialize(
2652
+ amount: nil,
2653
+ description: nil,
2654
+ discountable: nil,
2655
+ discounts: nil,
2656
+ id: nil,
2657
+ metadata: nil,
2658
+ period: nil,
2659
+ price_data: nil,
2660
+ pricing: nil,
2661
+ quantity: nil,
2662
+ tax_amounts: nil,
2663
+ tax_rates: nil
2664
+ ); end
2665
+ end
2666
+ # Specifies which fields in the response should be expanded.
2667
+ sig { returns(T.nilable(T::Array[String])) }
2668
+ attr_accessor :expand
2669
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
2670
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2671
+ attr_accessor :invoice_metadata
2672
+ # The line items to update.
2673
+ sig { returns(T::Array[::Stripe::Invoice::UpdateLinesParams::Line]) }
2674
+ attr_accessor :lines
2675
+ sig {
2676
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::Invoice::UpdateLinesParams::Line]).void
2677
+ }
2678
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
2679
+ end
2680
+ class VoidInvoiceParams < Stripe::RequestParams
2681
+ # Specifies which fields in the response should be expanded.
2682
+ sig { returns(T.nilable(T::Array[String])) }
2683
+ attr_accessor :expand
2684
+ sig { params(expand: T.nilable(T::Array[String])).void }
2685
+ def initialize(expand: nil); end
2686
+ end
2687
+ class CreatePreviewParams < Stripe::RequestParams
2688
+ class AutomaticTax < Stripe::RequestParams
2689
+ class Liability < Stripe::RequestParams
2690
+ # The connected account being referenced when `type` is `account`.
2691
+ sig { returns(T.nilable(String)) }
2692
+ attr_accessor :account
2693
+ # Type of the account referenced in the request.
2694
+ sig { returns(String) }
2695
+ attr_accessor :type
2696
+ sig { params(account: T.nilable(String), type: String).void }
2697
+ def initialize(account: nil, type: nil); end
2698
+ end
2699
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
2700
+ sig { returns(T::Boolean) }
2701
+ attr_accessor :enabled
2702
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
2703
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax::Liability)) }
2704
+ attr_accessor :liability
2705
+ sig {
2706
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax::Liability)).void
2707
+ }
2708
+ def initialize(enabled: nil, liability: nil); end
2709
+ end
2710
+ class CustomerDetails < Stripe::RequestParams
2711
+ class Address < Stripe::RequestParams
2712
+ # City, district, suburb, town, or village.
2713
+ sig { returns(T.nilable(String)) }
2714
+ attr_accessor :city
2715
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2716
+ sig { returns(T.nilable(String)) }
2717
+ attr_accessor :country
2718
+ # Address line 1 (e.g., street, PO Box, or company name).
2719
+ sig { returns(T.nilable(String)) }
2720
+ attr_accessor :line1
2721
+ # Address line 2 (e.g., apartment, suite, unit, or building).
2722
+ sig { returns(T.nilable(String)) }
2723
+ attr_accessor :line2
2724
+ # ZIP or postal code.
2725
+ sig { returns(T.nilable(String)) }
2726
+ attr_accessor :postal_code
2727
+ # State, county, province, or region.
2728
+ sig { returns(T.nilable(String)) }
2729
+ attr_accessor :state
2730
+ sig {
2731
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
2732
+ }
2733
+ def initialize(
2734
+ city: nil,
2735
+ country: nil,
2736
+ line1: nil,
2737
+ line2: nil,
2738
+ postal_code: nil,
2739
+ state: nil
2740
+ ); end
2741
+ end
2742
+ class Shipping < Stripe::RequestParams
2743
+ class Address < Stripe::RequestParams
2744
+ # City, district, suburb, town, or village.
2745
+ sig { returns(T.nilable(String)) }
2746
+ attr_accessor :city
2747
+ # A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2748
+ sig { returns(T.nilable(String)) }
2749
+ attr_accessor :country
2750
+ # Address line 1 (e.g., street, PO Box, or company name).
2751
+ sig { returns(T.nilable(String)) }
2752
+ attr_accessor :line1
2753
+ # Address line 2 (e.g., apartment, suite, unit, or building).
2754
+ sig { returns(T.nilable(String)) }
2755
+ attr_accessor :line2
2756
+ # ZIP or postal code.
2757
+ sig { returns(T.nilable(String)) }
2758
+ attr_accessor :postal_code
2759
+ # State, county, province, or region.
2760
+ sig { returns(T.nilable(String)) }
2761
+ attr_accessor :state
2762
+ sig {
2763
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
2764
+ }
2765
+ def initialize(
2766
+ city: nil,
2767
+ country: nil,
2768
+ line1: nil,
2769
+ line2: nil,
2770
+ postal_code: nil,
2771
+ state: nil
2772
+ ); end
2773
+ end
2774
+ # Customer shipping address.
2775
+ sig {
2776
+ returns(::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping::Address)
2777
+ }
2778
+ attr_accessor :address
2779
+ # Customer name.
2780
+ sig { returns(String) }
2781
+ attr_accessor :name
2782
+ # Customer phone (including extension).
2783
+ sig { returns(T.nilable(String)) }
2784
+ attr_accessor :phone
2785
+ sig {
2786
+ params(address: ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping::Address, name: String, phone: T.nilable(String)).void
2787
+ }
2788
+ def initialize(address: nil, name: nil, phone: nil); end
2789
+ end
2790
+ class Tax < Stripe::RequestParams
2791
+ # A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
2792
+ sig { returns(T.nilable(T.nilable(String))) }
2793
+ attr_accessor :ip_address
2794
+ sig { params(ip_address: T.nilable(T.nilable(String))).void }
2795
+ def initialize(ip_address: nil); end
2796
+ end
2797
+ class TaxId < Stripe::RequestParams
2798
+ # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
2799
+ sig { returns(String) }
2800
+ attr_accessor :type
2801
+ # Value of the tax ID.
2802
+ sig { returns(String) }
2803
+ attr_accessor :value
2804
+ sig { params(type: String, value: String).void }
2805
+ def initialize(type: nil, value: nil); end
2806
+ end
2807
+ # The customer's address.
2808
+ sig {
2809
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Address))))
2810
+ }
2811
+ attr_accessor :address
2812
+ # The customer's shipping information. Appears on invoices emailed to this customer.
2813
+ sig {
2814
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping))))
2815
+ }
2816
+ attr_accessor :shipping
2817
+ # Tax details about the customer.
2818
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Tax)) }
2819
+ attr_accessor :tax
2820
+ # The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
2821
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
2822
+ attr_accessor :tax_exempt
2823
+ # The customer's tax IDs.
2824
+ sig {
2825
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::CustomerDetails::TaxId]))
2826
+ }
2827
+ attr_accessor :tax_ids
2828
+ sig {
2829
+ params(address: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Address))), shipping: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping))), tax: T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Tax), tax_exempt: T.nilable(T.nilable(T.any(String, String))), tax_ids: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::CustomerDetails::TaxId])).void
2830
+ }
2831
+ def initialize(address: nil, shipping: nil, tax: nil, tax_exempt: nil, tax_ids: nil); end
2832
+ end
2833
+ class Discount < Stripe::RequestParams
2834
+ # ID of the coupon to create a new discount for.
2835
+ sig { returns(T.nilable(String)) }
2836
+ attr_accessor :coupon
2837
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2838
+ sig { returns(T.nilable(String)) }
2839
+ attr_accessor :discount
2840
+ # ID of the promotion code to create a new discount for.
2841
+ sig { returns(T.nilable(String)) }
2842
+ attr_accessor :promotion_code
2843
+ sig {
2844
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2845
+ }
2846
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2847
+ end
2848
+ class InvoiceItem < Stripe::RequestParams
2849
+ class Discount < Stripe::RequestParams
2850
+ # ID of the coupon to create a new discount for.
2851
+ sig { returns(T.nilable(String)) }
2852
+ attr_accessor :coupon
2853
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2854
+ sig { returns(T.nilable(String)) }
2855
+ attr_accessor :discount
2856
+ # ID of the promotion code to create a new discount for.
2857
+ sig { returns(T.nilable(String)) }
2858
+ attr_accessor :promotion_code
2859
+ sig {
2860
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2861
+ }
2862
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2863
+ end
2864
+ class Period < Stripe::RequestParams
2865
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2866
+ sig { returns(Integer) }
2867
+ attr_accessor :end
2868
+ # The start of the period. This value is inclusive.
2869
+ sig { returns(Integer) }
2870
+ attr_accessor :start
2871
+ sig { params(end_: Integer, start: Integer).void }
2872
+ def initialize(end_: nil, start: nil); end
2873
+ end
2874
+ class PriceData < Stripe::RequestParams
2875
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2876
+ sig { returns(String) }
2877
+ attr_accessor :currency
2878
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2879
+ sig { returns(String) }
2880
+ attr_accessor :product
2881
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2882
+ sig { returns(T.nilable(String)) }
2883
+ attr_accessor :tax_behavior
2884
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2885
+ sig { returns(T.nilable(Integer)) }
2886
+ attr_accessor :unit_amount
2887
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2888
+ sig { returns(T.nilable(String)) }
2889
+ attr_accessor :unit_amount_decimal
2890
+ sig {
2891
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2892
+ }
2893
+ def initialize(
2894
+ currency: nil,
2895
+ product: nil,
2896
+ tax_behavior: nil,
2897
+ unit_amount: nil,
2898
+ unit_amount_decimal: nil
2899
+ ); end
2900
+ end
2901
+ # The integer amount in cents (or local equivalent) of previewed invoice item.
2902
+ sig { returns(T.nilable(Integer)) }
2903
+ attr_accessor :amount
2904
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.
2905
+ sig { returns(T.nilable(String)) }
2906
+ attr_accessor :currency
2907
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2908
+ sig { returns(T.nilable(String)) }
2909
+ attr_accessor :description
2910
+ # Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
2911
+ sig { returns(T.nilable(T::Boolean)) }
2912
+ attr_accessor :discountable
2913
+ # The coupons to redeem into discounts for the invoice item in the preview.
2914
+ sig {
2915
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Discount]))))
2916
+ }
2917
+ attr_accessor :discounts
2918
+ # The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
2919
+ sig { returns(T.nilable(String)) }
2920
+ attr_accessor :invoiceitem
2921
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2922
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2923
+ attr_accessor :metadata
2924
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
2925
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Period)) }
2926
+ attr_accessor :period
2927
+ # The ID of the price object. One of `price` or `price_data` is required.
2928
+ sig { returns(T.nilable(String)) }
2929
+ attr_accessor :price
2930
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2931
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::PriceData)) }
2932
+ attr_accessor :price_data
2933
+ # Non-negative integer. The quantity of units for the invoice item.
2934
+ sig { returns(T.nilable(Integer)) }
2935
+ attr_accessor :quantity
2936
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2937
+ sig { returns(T.nilable(String)) }
2938
+ attr_accessor :tax_behavior
2939
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2940
+ sig { returns(T.nilable(T.nilable(String))) }
2941
+ attr_accessor :tax_code
2942
+ # The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
2943
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2944
+ attr_accessor :tax_rates
2945
+ # The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
2946
+ sig { returns(T.nilable(Integer)) }
2947
+ attr_accessor :unit_amount
2948
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2949
+ sig { returns(T.nilable(String)) }
2950
+ attr_accessor :unit_amount_decimal
2951
+ sig {
2952
+ params(amount: T.nilable(Integer), currency: T.nilable(String), description: T.nilable(String), discountable: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Discount]))), invoiceitem: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Period), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::PriceData), quantity: T.nilable(Integer), tax_behavior: T.nilable(String), tax_code: T.nilable(T.nilable(String)), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2953
+ }
2954
+ def initialize(
2955
+ amount: nil,
2956
+ currency: nil,
2957
+ description: nil,
2958
+ discountable: nil,
2959
+ discounts: nil,
2960
+ invoiceitem: nil,
2961
+ metadata: nil,
2962
+ period: nil,
2963
+ price: nil,
2964
+ price_data: nil,
2965
+ quantity: nil,
2966
+ tax_behavior: nil,
2967
+ tax_code: nil,
2968
+ tax_rates: nil,
2969
+ unit_amount: nil,
2970
+ unit_amount_decimal: nil
2971
+ ); end
2972
+ end
2973
+ class Issuer < Stripe::RequestParams
2974
+ # The connected account being referenced when `type` is `account`.
2975
+ sig { returns(T.nilable(String)) }
2976
+ attr_accessor :account
2977
+ # Type of the account referenced in the request.
2978
+ sig { returns(String) }
2979
+ attr_accessor :type
2980
+ sig { params(account: T.nilable(String), type: String).void }
2981
+ def initialize(account: nil, type: nil); end
2982
+ end
2983
+ class ScheduleDetails < Stripe::RequestParams
2984
+ class Phase < Stripe::RequestParams
2985
+ class AddInvoiceItem < Stripe::RequestParams
2986
+ class Discount < Stripe::RequestParams
2987
+ # ID of the coupon to create a new discount for.
2988
+ sig { returns(T.nilable(String)) }
2989
+ attr_accessor :coupon
2990
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2991
+ sig { returns(T.nilable(String)) }
2992
+ attr_accessor :discount
2993
+ # ID of the promotion code to create a new discount for.
2994
+ sig { returns(T.nilable(String)) }
2995
+ attr_accessor :promotion_code
2996
+ sig {
2997
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2998
+ }
2999
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3000
+ end
3001
+ class PriceData < Stripe::RequestParams
3002
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
3003
+ sig { returns(String) }
3004
+ attr_accessor :currency
3005
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
3006
+ sig { returns(String) }
3007
+ attr_accessor :product
3008
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
3009
+ sig { returns(T.nilable(String)) }
3010
+ attr_accessor :tax_behavior
3011
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
3012
+ sig { returns(T.nilable(Integer)) }
3013
+ attr_accessor :unit_amount
3014
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
3015
+ sig { returns(T.nilable(String)) }
3016
+ attr_accessor :unit_amount_decimal
3017
+ sig {
3018
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
3019
+ }
3020
+ def initialize(
3021
+ currency: nil,
3022
+ product: nil,
3023
+ tax_behavior: nil,
3024
+ unit_amount: nil,
3025
+ unit_amount_decimal: nil
3026
+ ); end
3027
+ end
3028
+ # The coupons to redeem into discounts for the item.
3029
+ sig {
3030
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::Discount]))
3031
+ }
3032
+ attr_accessor :discounts
3033
+ # The ID of the price object. One of `price` or `price_data` is required.
3034
+ sig { returns(T.nilable(String)) }
3035
+ attr_accessor :price
3036
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
3037
+ sig {
3038
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::PriceData))
3039
+ }
3040
+ attr_accessor :price_data
3041
+ # Quantity for this item. Defaults to 1.
3042
+ sig { returns(T.nilable(Integer)) }
3043
+ attr_accessor :quantity
3044
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
3045
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3046
+ attr_accessor :tax_rates
3047
+ sig {
3048
+ params(discounts: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
3049
+ }
3050
+ def initialize(
3051
+ discounts: nil,
3052
+ price: nil,
3053
+ price_data: nil,
3054
+ quantity: nil,
3055
+ tax_rates: nil
3056
+ ); end
3057
+ end
3058
+ class AutomaticTax < Stripe::RequestParams
3059
+ class Liability < Stripe::RequestParams
3060
+ # The connected account being referenced when `type` is `account`.
3061
+ sig { returns(T.nilable(String)) }
3062
+ attr_accessor :account
3063
+ # Type of the account referenced in the request.
3064
+ sig { returns(String) }
3065
+ attr_accessor :type
3066
+ sig { params(account: T.nilable(String), type: String).void }
3067
+ def initialize(account: nil, type: nil); end
3068
+ end
3069
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
3070
+ sig { returns(T::Boolean) }
3071
+ attr_accessor :enabled
3072
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
3073
+ sig {
3074
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax::Liability))
3075
+ }
3076
+ attr_accessor :liability
3077
+ sig {
3078
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax::Liability)).void
3079
+ }
3080
+ def initialize(enabled: nil, liability: nil); end
3081
+ end
3082
+ class BillingThresholds < Stripe::RequestParams
3083
+ # Monetary threshold that triggers the subscription to advance to a new billing period
3084
+ sig { returns(T.nilable(Integer)) }
3085
+ attr_accessor :amount_gte
3086
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
3087
+ sig { returns(T.nilable(T::Boolean)) }
3088
+ attr_accessor :reset_billing_cycle_anchor
3089
+ sig {
3090
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
3091
+ }
3092
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
3093
+ end
3094
+ class Discount < Stripe::RequestParams
3095
+ # ID of the coupon to create a new discount for.
3096
+ sig { returns(T.nilable(String)) }
3097
+ attr_accessor :coupon
3098
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3099
+ sig { returns(T.nilable(String)) }
3100
+ attr_accessor :discount
3101
+ # ID of the promotion code to create a new discount for.
3102
+ sig { returns(T.nilable(String)) }
3103
+ attr_accessor :promotion_code
3104
+ sig {
3105
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
3106
+ }
3107
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3108
+ end
3109
+ class InvoiceSettings < Stripe::RequestParams
3110
+ class Issuer < Stripe::RequestParams
3111
+ # The connected account being referenced when `type` is `account`.
3112
+ sig { returns(T.nilable(String)) }
3113
+ attr_accessor :account
3114
+ # Type of the account referenced in the request.
3115
+ sig { returns(String) }
3116
+ attr_accessor :type
3117
+ sig { params(account: T.nilable(String), type: String).void }
3118
+ def initialize(account: nil, type: nil); end
3119
+ end
3120
+ # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
3121
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3122
+ attr_accessor :account_tax_ids
3123
+ # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
3124
+ sig { returns(T.nilable(Integer)) }
3125
+ attr_accessor :days_until_due
3126
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
3127
+ sig {
3128
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings::Issuer))
3129
+ }
3130
+ attr_accessor :issuer
3131
+ sig {
3132
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), days_until_due: T.nilable(Integer), issuer: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings::Issuer)).void
3133
+ }
3134
+ def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
3135
+ end
3136
+ class Item < Stripe::RequestParams
3137
+ class BillingThresholds < Stripe::RequestParams
3138
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
3139
+ sig { returns(Integer) }
3140
+ attr_accessor :usage_gte
3141
+ sig { params(usage_gte: Integer).void }
3142
+ def initialize(usage_gte: nil); end
3143
+ end
3144
+ class Discount < Stripe::RequestParams
3145
+ # ID of the coupon to create a new discount for.
3146
+ sig { returns(T.nilable(String)) }
3147
+ attr_accessor :coupon
3148
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3149
+ sig { returns(T.nilable(String)) }
3150
+ attr_accessor :discount
3151
+ # ID of the promotion code to create a new discount for.
3152
+ sig { returns(T.nilable(String)) }
3153
+ attr_accessor :promotion_code
3154
+ sig {
3155
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
3156
+ }
3157
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3158
+ end
3159
+ class PriceData < Stripe::RequestParams
3160
+ class Recurring < Stripe::RequestParams
3161
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
3162
+ sig { returns(String) }
3163
+ attr_accessor :interval
3164
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
3165
+ sig { returns(T.nilable(Integer)) }
3166
+ attr_accessor :interval_count
3167
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
3168
+ def initialize(interval: nil, interval_count: nil); end
3169
+ end
3170
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
3171
+ sig { returns(String) }
3172
+ attr_accessor :currency
3173
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
3174
+ sig { returns(String) }
3175
+ attr_accessor :product
3176
+ # The recurring components of a price such as `interval` and `interval_count`.
3177
+ sig {
3178
+ returns(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData::Recurring)
3179
+ }
3180
+ attr_accessor :recurring
3181
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
3182
+ sig { returns(T.nilable(String)) }
3183
+ attr_accessor :tax_behavior
3184
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
3185
+ sig { returns(T.nilable(Integer)) }
3186
+ attr_accessor :unit_amount
3187
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
3188
+ sig { returns(T.nilable(String)) }
3189
+ attr_accessor :unit_amount_decimal
3190
+ sig {
3191
+ params(currency: String, product: String, recurring: ::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
3192
+ }
3193
+ def initialize(
3194
+ currency: nil,
3195
+ product: nil,
3196
+ recurring: nil,
3197
+ tax_behavior: nil,
3198
+ unit_amount: nil,
3199
+ unit_amount_decimal: nil
3200
+ ); end
3201
+ end
3202
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
3203
+ sig {
3204
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::BillingThresholds))))
3205
+ }
3206
+ attr_accessor :billing_thresholds
3207
+ # The coupons to redeem into discounts for the subscription item.
3208
+ sig {
3209
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::Discount]))))
3210
+ }
3211
+ attr_accessor :discounts
3212
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
3213
+ sig { returns(T.nilable(T::Hash[String, String])) }
3214
+ attr_accessor :metadata
3215
+ # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
3216
+ sig { returns(T.nilable(String)) }
3217
+ attr_accessor :plan
3218
+ # The ID of the price object.
3219
+ sig { returns(T.nilable(String)) }
3220
+ attr_accessor :price
3221
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
3222
+ sig {
3223
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData))
3224
+ }
3225
+ attr_accessor :price_data
3226
+ # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
3227
+ sig { returns(T.nilable(Integer)) }
3228
+ attr_accessor :quantity
3229
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
3230
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3231
+ attr_accessor :tax_rates
3232
+ sig {
3233
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
3234
+ }
3235
+ def initialize(
3236
+ billing_thresholds: nil,
3237
+ discounts: nil,
3238
+ metadata: nil,
3239
+ plan: nil,
3240
+ price: nil,
3241
+ price_data: nil,
3242
+ quantity: nil,
3243
+ tax_rates: nil
3244
+ ); end
3245
+ end
3246
+ class TransferData < Stripe::RequestParams
3247
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
3248
+ sig { returns(T.nilable(Float)) }
3249
+ attr_accessor :amount_percent
3250
+ # ID of an existing, connected Stripe account.
3251
+ sig { returns(String) }
3252
+ attr_accessor :destination
3253
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
3254
+ def initialize(amount_percent: nil, destination: nil); end
3255
+ end
3256
+ # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
3257
+ sig {
3258
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem]))
3259
+ }
3260
+ attr_accessor :add_invoice_items
3261
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
3262
+ sig { returns(T.nilable(Float)) }
3263
+ attr_accessor :application_fee_percent
3264
+ # Automatic tax settings for this phase.
3265
+ sig {
3266
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax))
3267
+ }
3268
+ attr_accessor :automatic_tax
3269
+ # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
3270
+ sig { returns(T.nilable(String)) }
3271
+ attr_accessor :billing_cycle_anchor
3272
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
3273
+ sig {
3274
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::BillingThresholds))))
3275
+ }
3276
+ attr_accessor :billing_thresholds
3277
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
3278
+ sig { returns(T.nilable(String)) }
3279
+ attr_accessor :collection_method
3280
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
3281
+ sig { returns(T.nilable(String)) }
3282
+ attr_accessor :currency
3283
+ # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
3284
+ sig { returns(T.nilable(String)) }
3285
+ attr_accessor :default_payment_method
3286
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
3287
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3288
+ attr_accessor :default_tax_rates
3289
+ # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
3290
+ sig { returns(T.nilable(T.nilable(String))) }
3291
+ attr_accessor :description
3292
+ # The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
3293
+ sig {
3294
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Discount]))))
3295
+ }
3296
+ attr_accessor :discounts
3297
+ # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
3298
+ sig { returns(T.nilable(T.any(Integer, String))) }
3299
+ attr_accessor :end_date
3300
+ # All invoices will be billed using the specified settings.
3301
+ sig {
3302
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings))
3303
+ }
3304
+ attr_accessor :invoice_settings
3305
+ # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
3306
+ sig {
3307
+ returns(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item])
3308
+ }
3309
+ attr_accessor :items
3310
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
3311
+ sig { returns(T.nilable(Integer)) }
3312
+ attr_accessor :iterations
3313
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
3314
+ sig { returns(T.nilable(T::Hash[String, String])) }
3315
+ attr_accessor :metadata
3316
+ # The account on behalf of which to charge, for each of the associated subscription's invoices.
3317
+ sig { returns(T.nilable(String)) }
3318
+ attr_accessor :on_behalf_of
3319
+ # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
3320
+ sig { returns(T.nilable(String)) }
3321
+ attr_accessor :proration_behavior
3322
+ # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
3323
+ sig { returns(T.nilable(T.any(Integer, String))) }
3324
+ attr_accessor :start_date
3325
+ # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
3326
+ sig {
3327
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::TransferData))
3328
+ }
3329
+ attr_accessor :transfer_data
3330
+ # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
3331
+ sig { returns(T.nilable(T::Boolean)) }
3332
+ attr_accessor :trial
3333
+ # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
3334
+ sig { returns(T.nilable(T.any(Integer, String))) }
3335
+ attr_accessor :trial_end
3336
+ sig {
3337
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::BillingThresholds))), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Discount]))), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings), items: T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), start_date: T.nilable(T.any(Integer, String)), transfer_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
3338
+ }
3339
+ def initialize(
3340
+ add_invoice_items: nil,
3341
+ application_fee_percent: nil,
3342
+ automatic_tax: nil,
3343
+ billing_cycle_anchor: nil,
3344
+ billing_thresholds: nil,
3345
+ collection_method: nil,
3346
+ currency: nil,
3347
+ default_payment_method: nil,
3348
+ default_tax_rates: nil,
3349
+ description: nil,
3350
+ discounts: nil,
3351
+ end_date: nil,
3352
+ invoice_settings: nil,
3353
+ items: nil,
3354
+ iterations: nil,
3355
+ metadata: nil,
3356
+ on_behalf_of: nil,
3357
+ proration_behavior: nil,
3358
+ start_date: nil,
3359
+ transfer_data: nil,
3360
+ trial: nil,
3361
+ trial_end: nil
3362
+ ); end
3363
+ end
3364
+ # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
3365
+ sig { returns(T.nilable(String)) }
3366
+ attr_accessor :end_behavior
3367
+ # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
3368
+ sig {
3369
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase]))
3370
+ }
3371
+ attr_accessor :phases
3372
+ # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
3373
+ sig { returns(T.nilable(String)) }
3374
+ attr_accessor :proration_behavior
3375
+ sig {
3376
+ params(end_behavior: T.nilable(String), phases: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase]), proration_behavior: T.nilable(String)).void
3377
+ }
3378
+ def initialize(end_behavior: nil, phases: nil, proration_behavior: nil); end
3379
+ end
3380
+ class SubscriptionDetails < Stripe::RequestParams
3381
+ class Item < Stripe::RequestParams
3382
+ class BillingThresholds < Stripe::RequestParams
3383
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
3384
+ sig { returns(Integer) }
3385
+ attr_accessor :usage_gte
3386
+ sig { params(usage_gte: Integer).void }
3387
+ def initialize(usage_gte: nil); end
3388
+ end
3389
+ class Discount < Stripe::RequestParams
3390
+ # ID of the coupon to create a new discount for.
3391
+ sig { returns(T.nilable(String)) }
3392
+ attr_accessor :coupon
3393
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3394
+ sig { returns(T.nilable(String)) }
3395
+ attr_accessor :discount
3396
+ # ID of the promotion code to create a new discount for.
3397
+ sig { returns(T.nilable(String)) }
3398
+ attr_accessor :promotion_code
3399
+ sig {
3400
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
3401
+ }
3402
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3403
+ end
3404
+ class PriceData < Stripe::RequestParams
3405
+ class Recurring < Stripe::RequestParams
3406
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
3407
+ sig { returns(String) }
3408
+ attr_accessor :interval
3409
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
3410
+ sig { returns(T.nilable(Integer)) }
3411
+ attr_accessor :interval_count
3412
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
3413
+ def initialize(interval: nil, interval_count: nil); end
3414
+ end
3415
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
3416
+ sig { returns(String) }
3417
+ attr_accessor :currency
3418
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
3419
+ sig { returns(String) }
3420
+ attr_accessor :product
3421
+ # The recurring components of a price such as `interval` and `interval_count`.
3422
+ sig {
3423
+ returns(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData::Recurring)
3424
+ }
3425
+ attr_accessor :recurring
3426
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
3427
+ sig { returns(T.nilable(String)) }
3428
+ attr_accessor :tax_behavior
3429
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
3430
+ sig { returns(T.nilable(Integer)) }
3431
+ attr_accessor :unit_amount
3432
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
3433
+ sig { returns(T.nilable(String)) }
3434
+ attr_accessor :unit_amount_decimal
3435
+ sig {
3436
+ params(currency: String, product: String, recurring: ::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
3437
+ }
3438
+ def initialize(
3439
+ currency: nil,
3440
+ product: nil,
3441
+ recurring: nil,
3442
+ tax_behavior: nil,
3443
+ unit_amount: nil,
3444
+ unit_amount_decimal: nil
3445
+ ); end
3446
+ end
3447
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
3448
+ sig {
3449
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::BillingThresholds))))
3450
+ }
3451
+ attr_accessor :billing_thresholds
3452
+ # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
3453
+ sig { returns(T.nilable(T::Boolean)) }
3454
+ attr_accessor :clear_usage
3455
+ # A flag that, if set to `true`, will delete the specified item.
3456
+ sig { returns(T.nilable(T::Boolean)) }
3457
+ attr_accessor :deleted
3458
+ # The coupons to redeem into discounts for the subscription item.
3459
+ sig {
3460
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::Discount]))))
3461
+ }
3462
+ attr_accessor :discounts
3463
+ # Subscription item to update.
3464
+ sig { returns(T.nilable(String)) }
3465
+ attr_accessor :id
3466
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
3467
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
3468
+ attr_accessor :metadata
3469
+ # Plan ID for this item, as a string.
3470
+ sig { returns(T.nilable(String)) }
3471
+ attr_accessor :plan
3472
+ # The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
3473
+ sig { returns(T.nilable(String)) }
3474
+ attr_accessor :price
3475
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
3476
+ sig {
3477
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData))
3478
+ }
3479
+ attr_accessor :price_data
3480
+ # Quantity for this item.
3481
+ sig { returns(T.nilable(Integer)) }
3482
+ attr_accessor :quantity
3483
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
3484
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3485
+ attr_accessor :tax_rates
3486
+ sig {
3487
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::BillingThresholds))), clear_usage: T.nilable(T::Boolean), deleted: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::Discount]))), id: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
3488
+ }
3489
+ def initialize(
3490
+ billing_thresholds: nil,
3491
+ clear_usage: nil,
3492
+ deleted: nil,
3493
+ discounts: nil,
3494
+ id: nil,
3495
+ metadata: nil,
3496
+ plan: nil,
3497
+ price: nil,
3498
+ price_data: nil,
3499
+ quantity: nil,
3500
+ tax_rates: nil
3501
+ ); end
3502
+ end
3503
+ # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
3504
+ sig { returns(T.nilable(T.any(String, Integer))) }
3505
+ attr_accessor :billing_cycle_anchor
3506
+ # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
3507
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
3508
+ attr_accessor :cancel_at
3509
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
3510
+ sig { returns(T.nilable(T::Boolean)) }
3511
+ attr_accessor :cancel_at_period_end
3512
+ # This simulates the subscription being canceled or expired immediately.
3513
+ sig { returns(T.nilable(T::Boolean)) }
3514
+ attr_accessor :cancel_now
3515
+ # If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.
3516
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3517
+ attr_accessor :default_tax_rates
3518
+ # A list of up to 20 subscription items, each with an attached price.
3519
+ sig {
3520
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item]))
3521
+ }
3522
+ attr_accessor :items
3523
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
3524
+ sig { returns(T.nilable(String)) }
3525
+ attr_accessor :proration_behavior
3526
+ # If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
3527
+ sig { returns(T.nilable(Integer)) }
3528
+ attr_accessor :proration_date
3529
+ # For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
3530
+ sig { returns(T.nilable(String)) }
3531
+ attr_accessor :resume_at
3532
+ # Date a subscription is intended to start (can be future or past).
3533
+ sig { returns(T.nilable(Integer)) }
3534
+ attr_accessor :start_date
3535
+ # If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required.
3536
+ sig { returns(T.nilable(T.any(String, Integer))) }
3537
+ attr_accessor :trial_end
3538
+ sig {
3539
+ params(billing_cycle_anchor: T.nilable(T.any(String, Integer)), cancel_at: T.nilable(T.nilable(T.any(String, Integer))), cancel_at_period_end: T.nilable(T::Boolean), cancel_now: T.nilable(T::Boolean), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item]), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), resume_at: T.nilable(String), start_date: T.nilable(Integer), trial_end: T.nilable(T.any(String, Integer))).void
3540
+ }
3541
+ def initialize(
3542
+ billing_cycle_anchor: nil,
3543
+ cancel_at: nil,
3544
+ cancel_at_period_end: nil,
3545
+ cancel_now: nil,
3546
+ default_tax_rates: nil,
3547
+ items: nil,
3548
+ proration_behavior: nil,
3549
+ proration_date: nil,
3550
+ resume_at: nil,
3551
+ start_date: nil,
3552
+ trial_end: nil
3553
+ ); end
3554
+ end
3555
+ # Settings for automatic tax lookup for this invoice preview.
3556
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax)) }
3557
+ attr_accessor :automatic_tax
3558
+ # The currency to preview this invoice in. Defaults to that of `customer` if not specified.
3559
+ sig { returns(T.nilable(String)) }
3560
+ attr_accessor :currency
3561
+ # The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3562
+ sig { returns(T.nilable(String)) }
3563
+ attr_accessor :customer
3564
+ # Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3565
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails)) }
3566
+ attr_accessor :customer_details
3567
+ # The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
3568
+ sig {
3569
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::Discount]))))
3570
+ }
3571
+ attr_accessor :discounts
3572
+ # Specifies which fields in the response should be expanded.
3573
+ sig { returns(T.nilable(T::Array[String])) }
3574
+ attr_accessor :expand
3575
+ # List of invoice items to add or update in the upcoming invoice preview (up to 250).
3576
+ sig { returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem])) }
3577
+ attr_accessor :invoice_items
3578
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
3579
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::Issuer)) }
3580
+ attr_accessor :issuer
3581
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
3582
+ sig { returns(T.nilable(T.nilable(String))) }
3583
+ attr_accessor :on_behalf_of
3584
+ # Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
3585
+ sig { returns(T.nilable(String)) }
3586
+ attr_accessor :preview_mode
3587
+ # The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
3588
+ sig { returns(T.nilable(String)) }
3589
+ attr_accessor :schedule
3590
+ # The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
3591
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails)) }
3592
+ attr_accessor :schedule_details
3593
+ # The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
3594
+ sig { returns(T.nilable(String)) }
3595
+ attr_accessor :subscription
3596
+ # The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
3597
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails)) }
3598
+ attr_accessor :subscription_details
3599
+ sig {
3600
+ params(automatic_tax: T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax), currency: T.nilable(String), customer: T.nilable(String), customer_details: T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem]), issuer: T.nilable(::Stripe::Invoice::CreatePreviewParams::Issuer), on_behalf_of: T.nilable(T.nilable(String)), preview_mode: T.nilable(String), schedule: T.nilable(String), schedule_details: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails), subscription: T.nilable(String), subscription_details: T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails)).void
3601
+ }
3602
+ def initialize(
3603
+ automatic_tax: nil,
3604
+ currency: nil,
3605
+ customer: nil,
3606
+ customer_details: nil,
3607
+ discounts: nil,
3608
+ expand: nil,
3609
+ invoice_items: nil,
3610
+ issuer: nil,
3611
+ on_behalf_of: nil,
3612
+ preview_mode: nil,
3613
+ schedule: nil,
3614
+ schedule_details: nil,
3615
+ subscription: nil,
3616
+ subscription_details: nil
3617
+ ); end
3618
+ end
3619
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
3620
+ sig {
3621
+ params(params: T.any(::Stripe::Invoice::AddLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3622
+ }
3623
+ def add_lines(params = {}, opts = {}); end
3624
+
3625
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
3626
+ sig {
3627
+ params(invoice: String, params: T.any(::Stripe::Invoice::AddLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3628
+ }
3629
+ def self.add_lines(invoice, params = {}, opts = {}); end
3630
+
3631
+ # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
3632
+ #
3633
+ # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
3634
+ # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
3635
+ # invoice's status becomes paid.
3636
+ #
3637
+ # If the PaymentIntent's status is already succeeded when it's attached, it's
3638
+ # credited to the invoice immediately.
3639
+ #
3640
+ # See: [Partial payments](https://docs.stripe.com/docs/invoicing/partial-payments) to learn more.
3641
+ sig {
3642
+ params(params: T.any(::Stripe::Invoice::AttachPaymentParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3643
+ }
3644
+ def attach_payment(params = {}, opts = {}); end
3645
+
3646
+ # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
3647
+ #
3648
+ # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
3649
+ # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
3650
+ # invoice's status becomes paid.
3651
+ #
3652
+ # If the PaymentIntent's status is already succeeded when it's attached, it's
3653
+ # credited to the invoice immediately.
3654
+ #
3655
+ # See: [Partial payments](https://docs.stripe.com/docs/invoicing/partial-payments) to learn more.
3656
+ sig {
3657
+ params(invoice: String, params: T.any(::Stripe::Invoice::AttachPaymentParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3658
+ }
3659
+ def self.attach_payment(invoice, params = {}, opts = {}); end
3660
+
3661
+ # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://docs.stripe.com/api#finalize_invoice) the invoice to your customers.
3662
+ sig {
3663
+ params(params: T.any(::Stripe::Invoice::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3664
+ }
3665
+ def self.create(params = {}, opts = {}); end
3666
+
3667
+ # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
3668
+ #
3669
+ # You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update.
3670
+ #
3671
+ # The recommended way to get only the prorations being previewed on the invoice is to consider line items where parent.subscription_item_details.proration is true.
3672
+ #
3673
+ # Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
3674
+ #
3675
+ # Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
3676
+ sig {
3677
+ params(params: T.any(::Stripe::Invoice::CreatePreviewParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3678
+ }
3679
+ def self.create_preview(params = {}, opts = {}); end
3680
+
3681
+ # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice).
3682
+ sig {
3683
+ params(invoice: String, params: T.any(::Stripe::Invoice::DeleteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3684
+ }
3685
+ def self.delete(invoice, params = {}, opts = {}); end
3686
+
3687
+ # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice).
3688
+ sig {
3689
+ params(params: T.any(::Stripe::Invoice::DeleteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3690
+ }
3691
+ def delete(params = {}, opts = {}); end
3692
+
3693
+ # Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
3694
+ sig {
3695
+ params(params: T.any(::Stripe::Invoice::FinalizeInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3696
+ }
3697
+ def finalize_invoice(params = {}, opts = {}); end
3698
+
3699
+ # Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
3700
+ sig {
3701
+ params(invoice: String, params: T.any(::Stripe::Invoice::FinalizeInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3702
+ }
3703
+ def self.finalize_invoice(invoice, params = {}, opts = {}); end
3704
+
3705
+ # You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
3706
+ sig {
3707
+ params(params: T.any(::Stripe::Invoice::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
3708
+ }
3709
+ def self.list(params = {}, opts = {}); end
3710
+
3711
+ # Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
3712
+ sig {
3713
+ params(params: T.any(::Stripe::Invoice::MarkUncollectibleParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3714
+ }
3715
+ def mark_uncollectible(params = {}, opts = {}); end
3716
+
3717
+ # Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
3718
+ sig {
3719
+ params(invoice: String, params: T.any(::Stripe::Invoice::MarkUncollectibleParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3720
+ }
3721
+ def self.mark_uncollectible(invoice, params = {}, opts = {}); end
3722
+
3723
+ # Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
3724
+ sig {
3725
+ params(params: T.any(::Stripe::Invoice::PayParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3726
+ }
3727
+ def pay(params = {}, opts = {}); end
3728
+
3729
+ # Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
3730
+ sig {
3731
+ params(invoice: String, params: T.any(::Stripe::Invoice::PayParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3732
+ }
3733
+ def self.pay(invoice, params = {}, opts = {}); end
3734
+
3735
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
3736
+ sig {
3737
+ params(params: T.any(::Stripe::Invoice::RemoveLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3738
+ }
3739
+ def remove_lines(params = {}, opts = {}); end
3740
+
3741
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
3742
+ sig {
3743
+ params(invoice: String, params: T.any(::Stripe::Invoice::RemoveLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3744
+ }
3745
+ def self.remove_lines(invoice, params = {}, opts = {}); end
3746
+
3747
+ sig {
3748
+ params(params: T.any(::Stripe::Invoice::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SearchResultObject)
3749
+ }
3750
+ def self.search(params = {}, opts = {}); end
3751
+
3752
+ sig {
3753
+ params(params: T.any(::Stripe::Invoice::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped, blk: T.untyped).returns(Stripe::SearchResultObject)
3754
+ }
3755
+ def self.search_auto_paging_each(params = {}, opts = {}, &blk); end
3756
+
3757
+ # Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
3758
+ #
3759
+ # Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
3760
+ sig {
3761
+ params(params: T.any(::Stripe::Invoice::SendInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3762
+ }
3763
+ def send_invoice(params = {}, opts = {}); end
3764
+
3765
+ # Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
3766
+ #
3767
+ # Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
3768
+ sig {
3769
+ params(invoice: String, params: T.any(::Stripe::Invoice::SendInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3770
+ }
3771
+ def self.send_invoice(invoice, params = {}, opts = {}); end
3772
+
3773
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized),
3774
+ # monetary values, as well as collection_method, become uneditable.
3775
+ #
3776
+ # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
3777
+ # sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass
3778
+ # auto_advance=false.
3779
+ sig {
3780
+ params(invoice: String, params: T.any(::Stripe::Invoice::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3781
+ }
3782
+ def self.update(invoice, params = {}, opts = {}); end
3783
+
3784
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
3785
+ sig {
3786
+ params(params: T.any(::Stripe::Invoice::UpdateLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3787
+ }
3788
+ def update_lines(params = {}, opts = {}); end
3789
+
3790
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
3791
+ sig {
3792
+ params(invoice: String, params: T.any(::Stripe::Invoice::UpdateLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3793
+ }
3794
+ def self.update_lines(invoice, params = {}, opts = {}); end
3795
+
3796
+ # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
3797
+ #
3798
+ # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
3799
+ sig {
3800
+ params(params: T.any(::Stripe::Invoice::VoidInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3801
+ }
3802
+ def void_invoice(params = {}, opts = {}); end
3803
+
3804
+ # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
3805
+ #
3806
+ # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
3807
+ sig {
3808
+ params(invoice: String, params: T.any(::Stripe::Invoice::VoidInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3809
+ }
3810
+ def self.void_invoice(invoice, params = {}, opts = {}); end
3811
+ end
3812
+ end