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,2981 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ # typed: true
5
+ module Stripe
6
+ class InvoiceService < StripeService
7
+ attr_reader :line_items
8
+ class DeleteParams < Stripe::RequestParams; end
9
+ class RetrieveParams < Stripe::RequestParams
10
+ # Specifies which fields in the response should be expanded.
11
+ sig { returns(T.nilable(T::Array[String])) }
12
+ attr_accessor :expand
13
+ sig { params(expand: T.nilable(T::Array[String])).void }
14
+ def initialize(expand: nil); end
15
+ end
16
+ class UpdateParams < Stripe::RequestParams
17
+ class AutomaticTax < Stripe::RequestParams
18
+ class Liability < Stripe::RequestParams
19
+ # The connected account being referenced when `type` is `account`.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_accessor :account
22
+ # Type of the account referenced in the request.
23
+ sig { returns(String) }
24
+ attr_accessor :type
25
+ sig { params(account: T.nilable(String), type: String).void }
26
+ def initialize(account: nil, type: nil); end
27
+ end
28
+ # 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.
29
+ sig { returns(T::Boolean) }
30
+ attr_accessor :enabled
31
+ # 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.
32
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateParams::AutomaticTax::Liability)) }
33
+ attr_accessor :liability
34
+ sig {
35
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::InvoiceService::UpdateParams::AutomaticTax::Liability)).void
36
+ }
37
+ def initialize(enabled: nil, liability: nil); end
38
+ end
39
+ class CustomField < Stripe::RequestParams
40
+ # The name of the custom field. This may be up to 40 characters.
41
+ sig { returns(String) }
42
+ attr_accessor :name
43
+ # The value of the custom field. This may be up to 140 characters.
44
+ sig { returns(String) }
45
+ attr_accessor :value
46
+ sig { params(name: String, value: String).void }
47
+ def initialize(name: nil, value: nil); end
48
+ end
49
+ class Discount < Stripe::RequestParams
50
+ # ID of the coupon to create a new discount for.
51
+ sig { returns(T.nilable(String)) }
52
+ attr_accessor :coupon
53
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
54
+ sig { returns(T.nilable(String)) }
55
+ attr_accessor :discount
56
+ # ID of the promotion code to create a new discount for.
57
+ sig { returns(T.nilable(String)) }
58
+ attr_accessor :promotion_code
59
+ sig {
60
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
61
+ }
62
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
63
+ end
64
+ class Issuer < Stripe::RequestParams
65
+ # The connected account being referenced when `type` is `account`.
66
+ sig { returns(T.nilable(String)) }
67
+ attr_accessor :account
68
+ # Type of the account referenced in the request.
69
+ sig { returns(String) }
70
+ attr_accessor :type
71
+ sig { params(account: T.nilable(String), type: String).void }
72
+ def initialize(account: nil, type: nil); end
73
+ end
74
+ class PaymentSettings < Stripe::RequestParams
75
+ class PaymentMethodOptions < Stripe::RequestParams
76
+ class AcssDebit < Stripe::RequestParams
77
+ class MandateOptions < Stripe::RequestParams
78
+ # Transaction type of the mandate.
79
+ sig { returns(T.nilable(String)) }
80
+ attr_accessor :transaction_type
81
+ sig { params(transaction_type: T.nilable(String)).void }
82
+ def initialize(transaction_type: nil); end
83
+ end
84
+ # Additional fields for Mandate creation
85
+ sig {
86
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
87
+ }
88
+ attr_accessor :mandate_options
89
+ # Verification method for the intent
90
+ sig { returns(T.nilable(String)) }
91
+ attr_accessor :verification_method
92
+ sig {
93
+ params(mandate_options: T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
94
+ }
95
+ def initialize(mandate_options: nil, verification_method: nil); end
96
+ end
97
+ class Bancontact < Stripe::RequestParams
98
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
99
+ sig { returns(T.nilable(String)) }
100
+ attr_accessor :preferred_language
101
+ sig { params(preferred_language: T.nilable(String)).void }
102
+ def initialize(preferred_language: nil); end
103
+ end
104
+ class Card < Stripe::RequestParams
105
+ class Installments < Stripe::RequestParams
106
+ class Plan < Stripe::RequestParams
107
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
108
+ sig { returns(T.nilable(Integer)) }
109
+ attr_accessor :count
110
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
111
+ # One of `month`.
112
+ sig { returns(T.nilable(String)) }
113
+ attr_accessor :interval
114
+ # Type of installment plan, one of `fixed_count`.
115
+ sig { returns(String) }
116
+ attr_accessor :type
117
+ sig {
118
+ params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void
119
+ }
120
+ def initialize(count: nil, interval: nil, type: nil); end
121
+ end
122
+ # Setting to true enables installments for this invoice.
123
+ # Setting to false will prevent any selected plan from applying to a payment.
124
+ sig { returns(T.nilable(T::Boolean)) }
125
+ attr_accessor :enabled
126
+ # The selected installment plan to use for this invoice.
127
+ sig {
128
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan))))
129
+ }
130
+ attr_accessor :plan
131
+ sig {
132
+ params(enabled: T.nilable(T::Boolean), plan: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan)))).void
133
+ }
134
+ def initialize(enabled: nil, plan: nil); end
135
+ end
136
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
137
+ #
138
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
139
+ sig {
140
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments))
141
+ }
142
+ attr_accessor :installments
143
+ # 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.
144
+ sig { returns(T.nilable(String)) }
145
+ attr_accessor :request_three_d_secure
146
+ sig {
147
+ params(installments: T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments), request_three_d_secure: T.nilable(String)).void
148
+ }
149
+ def initialize(installments: nil, request_three_d_secure: nil); end
150
+ end
151
+ class CustomerBalance < Stripe::RequestParams
152
+ class BankTransfer < Stripe::RequestParams
153
+ class EuBankTransfer < Stripe::RequestParams
154
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
155
+ sig { returns(String) }
156
+ attr_accessor :country
157
+ sig { params(country: String).void }
158
+ def initialize(country: nil); end
159
+ end
160
+ # Configuration for eu_bank_transfer funding type.
161
+ sig {
162
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
163
+ }
164
+ attr_accessor :eu_bank_transfer
165
+ # 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`.
166
+ sig { returns(T.nilable(String)) }
167
+ attr_accessor :type
168
+ sig {
169
+ params(eu_bank_transfer: T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
170
+ }
171
+ def initialize(eu_bank_transfer: nil, type: nil); end
172
+ end
173
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
174
+ sig {
175
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
176
+ }
177
+ attr_accessor :bank_transfer
178
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
179
+ sig { returns(T.nilable(String)) }
180
+ attr_accessor :funding_type
181
+ sig {
182
+ params(bank_transfer: T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
183
+ }
184
+ def initialize(bank_transfer: nil, funding_type: nil); end
185
+ end
186
+ class Konbini < Stripe::RequestParams; end
187
+ class SepaDebit < Stripe::RequestParams; end
188
+ class UsBankAccount < Stripe::RequestParams
189
+ class FinancialConnections < Stripe::RequestParams
190
+ class Filters < Stripe::RequestParams
191
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
192
+ sig { returns(T.nilable(T::Array[String])) }
193
+ attr_accessor :account_subcategories
194
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
195
+ def initialize(account_subcategories: nil); end
196
+ end
197
+ # Provide filters for the linked accounts that the customer can select for the payment method.
198
+ sig {
199
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
200
+ }
201
+ attr_accessor :filters
202
+ # 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`.
203
+ sig { returns(T.nilable(T::Array[String])) }
204
+ attr_accessor :permissions
205
+ # List of data features that you would like to retrieve upon account creation.
206
+ sig { returns(T.nilable(T::Array[String])) }
207
+ attr_accessor :prefetch
208
+ sig {
209
+ params(filters: T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
210
+ }
211
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
212
+ end
213
+ # Additional fields for Financial Connections Session creation
214
+ sig {
215
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
216
+ }
217
+ attr_accessor :financial_connections
218
+ # Verification method for the intent
219
+ sig { returns(T.nilable(String)) }
220
+ attr_accessor :verification_method
221
+ sig {
222
+ params(financial_connections: T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
223
+ }
224
+ def initialize(financial_connections: nil, verification_method: nil); end
225
+ end
226
+ # 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.
227
+ sig {
228
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
229
+ }
230
+ attr_accessor :acss_debit
231
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
232
+ sig {
233
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
234
+ }
235
+ attr_accessor :bancontact
236
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
237
+ sig {
238
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))))
239
+ }
240
+ attr_accessor :card
241
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
242
+ sig {
243
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
244
+ }
245
+ attr_accessor :customer_balance
246
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
247
+ sig {
248
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
249
+ }
250
+ attr_accessor :konbini
251
+ # 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.
252
+ sig {
253
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
254
+ }
255
+ attr_accessor :sepa_debit
256
+ # 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.
257
+ sig {
258
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
259
+ }
260
+ attr_accessor :us_bank_account
261
+ sig {
262
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
263
+ }
264
+ def initialize(
265
+ acss_debit: nil,
266
+ bancontact: nil,
267
+ card: nil,
268
+ customer_balance: nil,
269
+ konbini: nil,
270
+ sepa_debit: nil,
271
+ us_bank_account: nil
272
+ ); end
273
+ end
274
+ # 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.
275
+ sig { returns(T.nilable(T.nilable(String))) }
276
+ attr_accessor :default_mandate
277
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
278
+ sig {
279
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions))
280
+ }
281
+ attr_accessor :payment_method_options
282
+ # 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
283
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
284
+ attr_accessor :payment_method_types
285
+ sig {
286
+ params(default_mandate: T.nilable(T.nilable(String)), payment_method_options: T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
287
+ }
288
+ def initialize(
289
+ default_mandate: nil,
290
+ payment_method_options: nil,
291
+ payment_method_types: nil
292
+ ); end
293
+ end
294
+ class Rendering < Stripe::RequestParams
295
+ class Pdf < Stripe::RequestParams
296
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
297
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
298
+ # Japanese locale and `letter` for customers with other locales.
299
+ sig { returns(T.nilable(String)) }
300
+ attr_accessor :page_size
301
+ sig { params(page_size: T.nilable(String)).void }
302
+ def initialize(page_size: nil); end
303
+ end
304
+ # 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.
305
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
306
+ attr_accessor :amount_tax_display
307
+ # Invoice pdf rendering options
308
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateParams::Rendering::Pdf)) }
309
+ attr_accessor :pdf
310
+ # ID of the invoice rendering template to use for this invoice.
311
+ sig { returns(T.nilable(String)) }
312
+ attr_accessor :template
313
+ # The specific version of invoice rendering template to use for this invoice.
314
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
315
+ attr_accessor :template_version
316
+ sig {
317
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), pdf: T.nilable(::Stripe::InvoiceService::UpdateParams::Rendering::Pdf), template: T.nilable(String), template_version: T.nilable(T.nilable(T.any(String, Integer)))).void
318
+ }
319
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil); end
320
+ end
321
+ class ShippingCost < Stripe::RequestParams
322
+ class ShippingRateData < Stripe::RequestParams
323
+ class DeliveryEstimate < Stripe::RequestParams
324
+ class Maximum < Stripe::RequestParams
325
+ # A unit of time.
326
+ sig { returns(String) }
327
+ attr_accessor :unit
328
+ # Must be greater than 0.
329
+ sig { returns(Integer) }
330
+ attr_accessor :value
331
+ sig { params(unit: String, value: Integer).void }
332
+ def initialize(unit: nil, value: nil); end
333
+ end
334
+ class Minimum < Stripe::RequestParams
335
+ # A unit of time.
336
+ sig { returns(String) }
337
+ attr_accessor :unit
338
+ # Must be greater than 0.
339
+ sig { returns(Integer) }
340
+ attr_accessor :value
341
+ sig { params(unit: String, value: Integer).void }
342
+ def initialize(unit: nil, value: nil); end
343
+ end
344
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
345
+ sig {
346
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum))
347
+ }
348
+ attr_accessor :maximum
349
+ # The lower bound of the estimated range. If empty, represents no lower bound.
350
+ sig {
351
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum))
352
+ }
353
+ attr_accessor :minimum
354
+ sig {
355
+ params(maximum: T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum), minimum: T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum)).void
356
+ }
357
+ def initialize(maximum: nil, minimum: nil); end
358
+ end
359
+ class FixedAmount < Stripe::RequestParams
360
+ class CurrencyOptions < Stripe::RequestParams
361
+ # A non-negative integer in cents representing how much to charge.
362
+ sig { returns(Integer) }
363
+ attr_accessor :amount
364
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
365
+ sig { returns(T.nilable(String)) }
366
+ attr_accessor :tax_behavior
367
+ sig { params(amount: Integer, tax_behavior: T.nilable(String)).void }
368
+ def initialize(amount: nil, tax_behavior: nil); end
369
+ end
370
+ # A non-negative integer in cents representing how much to charge.
371
+ sig { returns(Integer) }
372
+ attr_accessor :amount
373
+ # 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).
374
+ sig { returns(String) }
375
+ attr_accessor :currency
376
+ # 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).
377
+ sig {
378
+ returns(T.nilable(T::Hash[String, ::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions]))
379
+ }
380
+ attr_accessor :currency_options
381
+ sig {
382
+ params(amount: Integer, currency: String, currency_options: T.nilable(T::Hash[String, ::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions])).void
383
+ }
384
+ def initialize(amount: nil, currency: nil, currency_options: nil); end
385
+ end
386
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
387
+ sig {
388
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate))
389
+ }
390
+ attr_accessor :delivery_estimate
391
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
392
+ sig { returns(String) }
393
+ attr_accessor :display_name
394
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
395
+ sig {
396
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::FixedAmount))
397
+ }
398
+ attr_accessor :fixed_amount
399
+ # 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`.
400
+ sig { returns(T.nilable(T::Hash[String, String])) }
401
+ attr_accessor :metadata
402
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
403
+ sig { returns(T.nilable(String)) }
404
+ attr_accessor :tax_behavior
405
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
406
+ sig { returns(T.nilable(String)) }
407
+ attr_accessor :tax_code
408
+ # The type of calculation to use on the shipping rate.
409
+ sig { returns(T.nilable(String)) }
410
+ attr_accessor :type
411
+ sig {
412
+ params(delivery_estimate: T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate), display_name: String, fixed_amount: T.nilable(::Stripe::InvoiceService::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
413
+ }
414
+ def initialize(
415
+ delivery_estimate: nil,
416
+ display_name: nil,
417
+ fixed_amount: nil,
418
+ metadata: nil,
419
+ tax_behavior: nil,
420
+ tax_code: nil,
421
+ type: nil
422
+ ); end
423
+ end
424
+ # The ID of the shipping rate to use for this order.
425
+ sig { returns(T.nilable(String)) }
426
+ attr_accessor :shipping_rate
427
+ # Parameters to create a new ad-hoc shipping rate for this order.
428
+ sig {
429
+ returns(T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData))
430
+ }
431
+ attr_accessor :shipping_rate_data
432
+ sig {
433
+ params(shipping_rate: T.nilable(String), shipping_rate_data: T.nilable(::Stripe::InvoiceService::UpdateParams::ShippingCost::ShippingRateData)).void
434
+ }
435
+ def initialize(shipping_rate: nil, shipping_rate_data: nil); end
436
+ end
437
+ class ShippingDetails < Stripe::RequestParams
438
+ class Address < Stripe::RequestParams
439
+ # City, district, suburb, town, or village.
440
+ sig { returns(T.nilable(String)) }
441
+ attr_accessor :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_accessor :country
445
+ # Address line 1 (e.g., street, PO Box, or company name).
446
+ sig { returns(T.nilable(String)) }
447
+ attr_accessor :line1
448
+ # Address line 2 (e.g., apartment, suite, unit, or building).
449
+ sig { returns(T.nilable(String)) }
450
+ attr_accessor :line2
451
+ # ZIP or postal code.
452
+ sig { returns(T.nilable(String)) }
453
+ attr_accessor :postal_code
454
+ # State, county, province, or region.
455
+ sig { returns(T.nilable(String)) }
456
+ attr_accessor :state
457
+ sig {
458
+ 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
459
+ }
460
+ def initialize(
461
+ city: nil,
462
+ country: nil,
463
+ line1: nil,
464
+ line2: nil,
465
+ postal_code: nil,
466
+ state: nil
467
+ ); end
468
+ end
469
+ # Shipping address
470
+ sig { returns(::Stripe::InvoiceService::UpdateParams::ShippingDetails::Address) }
471
+ attr_accessor :address
472
+ # Recipient name.
473
+ sig { returns(String) }
474
+ attr_accessor :name
475
+ # Recipient phone (including extension)
476
+ sig { returns(T.nilable(T.nilable(String))) }
477
+ attr_accessor :phone
478
+ sig {
479
+ params(address: ::Stripe::InvoiceService::UpdateParams::ShippingDetails::Address, name: String, phone: T.nilable(T.nilable(String))).void
480
+ }
481
+ def initialize(address: nil, name: nil, phone: nil); end
482
+ end
483
+ class TransferData < Stripe::RequestParams
484
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
485
+ sig { returns(T.nilable(Integer)) }
486
+ attr_accessor :amount
487
+ # ID of an existing, connected Stripe account.
488
+ sig { returns(String) }
489
+ attr_accessor :destination
490
+ sig { params(amount: T.nilable(Integer), destination: String).void }
491
+ def initialize(amount: nil, destination: nil); end
492
+ end
493
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
494
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
495
+ attr_accessor :account_tax_ids
496
+ # 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).
497
+ sig { returns(T.nilable(Integer)) }
498
+ attr_accessor :application_fee_amount
499
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
500
+ sig { returns(T.nilable(T::Boolean)) }
501
+ attr_accessor :auto_advance
502
+ # Settings for automatic tax lookup for this invoice.
503
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateParams::AutomaticTax)) }
504
+ attr_accessor :automatic_tax
505
+ # 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.
506
+ sig { returns(T.nilable(Integer)) }
507
+ attr_accessor :automatically_finalizes_at
508
+ # Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices.
509
+ sig { returns(T.nilable(String)) }
510
+ attr_accessor :collection_method
511
+ # 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.
512
+ sig {
513
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::UpdateParams::CustomField]))))
514
+ }
515
+ attr_accessor :custom_fields
516
+ # 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.
517
+ sig { returns(T.nilable(Integer)) }
518
+ attr_accessor :days_until_due
519
+ # 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.
520
+ sig { returns(T.nilable(String)) }
521
+ attr_accessor :default_payment_method
522
+ # 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.
523
+ sig { returns(T.nilable(T.nilable(String))) }
524
+ attr_accessor :default_source
525
+ # 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.
526
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
527
+ attr_accessor :default_tax_rates
528
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
529
+ sig { returns(T.nilable(String)) }
530
+ attr_accessor :description
531
+ # The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
532
+ sig {
533
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::UpdateParams::Discount]))))
534
+ }
535
+ attr_accessor :discounts
536
+ # 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.
537
+ sig { returns(T.nilable(Integer)) }
538
+ attr_accessor :due_date
539
+ # 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.
540
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
541
+ attr_accessor :effective_at
542
+ # Specifies which fields in the response should be expanded.
543
+ sig { returns(T.nilable(T::Array[String])) }
544
+ attr_accessor :expand
545
+ # Footer to be displayed on the invoice.
546
+ sig { returns(T.nilable(String)) }
547
+ attr_accessor :footer
548
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
549
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateParams::Issuer)) }
550
+ attr_accessor :issuer
551
+ # 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`.
552
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
553
+ attr_accessor :metadata
554
+ # 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.
555
+ sig { returns(T.nilable(T.nilable(String))) }
556
+ attr_accessor :number
557
+ # 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.
558
+ sig { returns(T.nilable(T.nilable(String))) }
559
+ attr_accessor :on_behalf_of
560
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
561
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateParams::PaymentSettings)) }
562
+ attr_accessor :payment_settings
563
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
564
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateParams::Rendering)) }
565
+ attr_accessor :rendering
566
+ # Settings for the cost of shipping for this invoice.
567
+ sig {
568
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::ShippingCost))))
569
+ }
570
+ attr_accessor :shipping_cost
571
+ # 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.
572
+ sig {
573
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::ShippingDetails))))
574
+ }
575
+ attr_accessor :shipping_details
576
+ # 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`.
577
+ sig { returns(T.nilable(String)) }
578
+ attr_accessor :statement_descriptor
579
+ # 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.
580
+ sig {
581
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::TransferData))))
582
+ }
583
+ attr_accessor :transfer_data
584
+ sig {
585
+ 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::InvoiceService::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::InvoiceService::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::InvoiceService::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::InvoiceService::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::InvoiceService::UpdateParams::PaymentSettings), rendering: T.nilable(::Stripe::InvoiceService::UpdateParams::Rendering), shipping_cost: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::ShippingCost))), shipping_details: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::ShippingDetails))), statement_descriptor: T.nilable(String), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::UpdateParams::TransferData)))).void
586
+ }
587
+ def initialize(
588
+ account_tax_ids: nil,
589
+ application_fee_amount: nil,
590
+ auto_advance: nil,
591
+ automatic_tax: nil,
592
+ automatically_finalizes_at: nil,
593
+ collection_method: nil,
594
+ custom_fields: nil,
595
+ days_until_due: nil,
596
+ default_payment_method: nil,
597
+ default_source: nil,
598
+ default_tax_rates: nil,
599
+ description: nil,
600
+ discounts: nil,
601
+ due_date: nil,
602
+ effective_at: nil,
603
+ expand: nil,
604
+ footer: nil,
605
+ issuer: nil,
606
+ metadata: nil,
607
+ number: nil,
608
+ on_behalf_of: nil,
609
+ payment_settings: nil,
610
+ rendering: nil,
611
+ shipping_cost: nil,
612
+ shipping_details: nil,
613
+ statement_descriptor: nil,
614
+ transfer_data: nil
615
+ ); end
616
+ end
617
+ class ListParams < Stripe::RequestParams
618
+ class Created < Stripe::RequestParams
619
+ # Minimum value to filter by (exclusive)
620
+ sig { returns(T.nilable(Integer)) }
621
+ attr_accessor :gt
622
+ # Minimum value to filter by (inclusive)
623
+ sig { returns(T.nilable(Integer)) }
624
+ attr_accessor :gte
625
+ # Maximum value to filter by (exclusive)
626
+ sig { returns(T.nilable(Integer)) }
627
+ attr_accessor :lt
628
+ # Maximum value to filter by (inclusive)
629
+ sig { returns(T.nilable(Integer)) }
630
+ attr_accessor :lte
631
+ sig {
632
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
633
+ }
634
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
635
+ end
636
+ class DueDate < Stripe::RequestParams
637
+ # Minimum value to filter by (exclusive)
638
+ sig { returns(T.nilable(Integer)) }
639
+ attr_accessor :gt
640
+ # Minimum value to filter by (inclusive)
641
+ sig { returns(T.nilable(Integer)) }
642
+ attr_accessor :gte
643
+ # Maximum value to filter by (exclusive)
644
+ sig { returns(T.nilable(Integer)) }
645
+ attr_accessor :lt
646
+ # Maximum value to filter by (inclusive)
647
+ sig { returns(T.nilable(Integer)) }
648
+ attr_accessor :lte
649
+ sig {
650
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
651
+ }
652
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
653
+ end
654
+ # The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`.
655
+ sig { returns(T.nilable(String)) }
656
+ attr_accessor :collection_method
657
+ # Only return invoices that were created during the given date interval.
658
+ sig { returns(T.nilable(T.any(::Stripe::InvoiceService::ListParams::Created, Integer))) }
659
+ attr_accessor :created
660
+ # Only return invoices for the customer specified by this customer ID.
661
+ sig { returns(T.nilable(String)) }
662
+ attr_accessor :customer
663
+ # Attribute for param field due_date
664
+ sig { returns(T.nilable(T.any(::Stripe::InvoiceService::ListParams::DueDate, Integer))) }
665
+ attr_accessor :due_date
666
+ # 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.
667
+ sig { returns(T.nilable(String)) }
668
+ attr_accessor :ending_before
669
+ # Specifies which fields in the response should be expanded.
670
+ sig { returns(T.nilable(T::Array[String])) }
671
+ attr_accessor :expand
672
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
673
+ sig { returns(T.nilable(Integer)) }
674
+ attr_accessor :limit
675
+ # 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.
676
+ sig { returns(T.nilable(String)) }
677
+ attr_accessor :starting_after
678
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
679
+ sig { returns(T.nilable(String)) }
680
+ attr_accessor :status
681
+ # Only return invoices for the subscription specified by this subscription ID.
682
+ sig { returns(T.nilable(String)) }
683
+ attr_accessor :subscription
684
+ sig {
685
+ params(collection_method: T.nilable(String), created: T.nilable(T.any(::Stripe::InvoiceService::ListParams::Created, Integer)), customer: T.nilable(String), due_date: T.nilable(T.any(::Stripe::InvoiceService::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
686
+ }
687
+ def initialize(
688
+ collection_method: nil,
689
+ created: nil,
690
+ customer: nil,
691
+ due_date: nil,
692
+ ending_before: nil,
693
+ expand: nil,
694
+ limit: nil,
695
+ starting_after: nil,
696
+ status: nil,
697
+ subscription: nil
698
+ ); end
699
+ end
700
+ class CreateParams < Stripe::RequestParams
701
+ class AutomaticTax < Stripe::RequestParams
702
+ class Liability < Stripe::RequestParams
703
+ # The connected account being referenced when `type` is `account`.
704
+ sig { returns(T.nilable(String)) }
705
+ attr_accessor :account
706
+ # Type of the account referenced in the request.
707
+ sig { returns(String) }
708
+ attr_accessor :type
709
+ sig { params(account: T.nilable(String), type: String).void }
710
+ def initialize(account: nil, type: nil); end
711
+ end
712
+ # 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.
713
+ sig { returns(T::Boolean) }
714
+ attr_accessor :enabled
715
+ # 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.
716
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::AutomaticTax::Liability)) }
717
+ attr_accessor :liability
718
+ sig {
719
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::InvoiceService::CreateParams::AutomaticTax::Liability)).void
720
+ }
721
+ def initialize(enabled: nil, liability: nil); end
722
+ end
723
+ class CustomField < Stripe::RequestParams
724
+ # The name of the custom field. This may be up to 40 characters.
725
+ sig { returns(String) }
726
+ attr_accessor :name
727
+ # The value of the custom field. This may be up to 140 characters.
728
+ sig { returns(String) }
729
+ attr_accessor :value
730
+ sig { params(name: String, value: String).void }
731
+ def initialize(name: nil, value: nil); end
732
+ end
733
+ class Discount < Stripe::RequestParams
734
+ # ID of the coupon to create a new discount for.
735
+ sig { returns(T.nilable(String)) }
736
+ attr_accessor :coupon
737
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
738
+ sig { returns(T.nilable(String)) }
739
+ attr_accessor :discount
740
+ # ID of the promotion code to create a new discount for.
741
+ sig { returns(T.nilable(String)) }
742
+ attr_accessor :promotion_code
743
+ sig {
744
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
745
+ }
746
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
747
+ end
748
+ class FromInvoice < Stripe::RequestParams
749
+ # The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted
750
+ sig { returns(String) }
751
+ attr_accessor :action
752
+ # The `id` of the invoice that will be cloned.
753
+ sig { returns(String) }
754
+ attr_accessor :invoice
755
+ sig { params(action: String, invoice: String).void }
756
+ def initialize(action: nil, invoice: nil); end
757
+ end
758
+ class Issuer < Stripe::RequestParams
759
+ # The connected account being referenced when `type` is `account`.
760
+ sig { returns(T.nilable(String)) }
761
+ attr_accessor :account
762
+ # Type of the account referenced in the request.
763
+ sig { returns(String) }
764
+ attr_accessor :type
765
+ sig { params(account: T.nilable(String), type: String).void }
766
+ def initialize(account: nil, type: nil); end
767
+ end
768
+ class PaymentSettings < Stripe::RequestParams
769
+ class PaymentMethodOptions < Stripe::RequestParams
770
+ class AcssDebit < Stripe::RequestParams
771
+ class MandateOptions < Stripe::RequestParams
772
+ # Transaction type of the mandate.
773
+ sig { returns(T.nilable(String)) }
774
+ attr_accessor :transaction_type
775
+ sig { params(transaction_type: T.nilable(String)).void }
776
+ def initialize(transaction_type: nil); end
777
+ end
778
+ # Additional fields for Mandate creation
779
+ sig {
780
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
781
+ }
782
+ attr_accessor :mandate_options
783
+ # Verification method for the intent
784
+ sig { returns(T.nilable(String)) }
785
+ attr_accessor :verification_method
786
+ sig {
787
+ params(mandate_options: T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
788
+ }
789
+ def initialize(mandate_options: nil, verification_method: nil); end
790
+ end
791
+ class Bancontact < Stripe::RequestParams
792
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
793
+ sig { returns(T.nilable(String)) }
794
+ attr_accessor :preferred_language
795
+ sig { params(preferred_language: T.nilable(String)).void }
796
+ def initialize(preferred_language: nil); end
797
+ end
798
+ class Card < Stripe::RequestParams
799
+ class Installments < Stripe::RequestParams
800
+ class Plan < Stripe::RequestParams
801
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
802
+ sig { returns(T.nilable(Integer)) }
803
+ attr_accessor :count
804
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
805
+ # One of `month`.
806
+ sig { returns(T.nilable(String)) }
807
+ attr_accessor :interval
808
+ # Type of installment plan, one of `fixed_count`.
809
+ sig { returns(String) }
810
+ attr_accessor :type
811
+ sig {
812
+ params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void
813
+ }
814
+ def initialize(count: nil, interval: nil, type: nil); end
815
+ end
816
+ # Setting to true enables installments for this invoice.
817
+ # Setting to false will prevent any selected plan from applying to a payment.
818
+ sig { returns(T.nilable(T::Boolean)) }
819
+ attr_accessor :enabled
820
+ # The selected installment plan to use for this invoice.
821
+ sig {
822
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan))))
823
+ }
824
+ attr_accessor :plan
825
+ sig {
826
+ params(enabled: T.nilable(T::Boolean), plan: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan)))).void
827
+ }
828
+ def initialize(enabled: nil, plan: nil); end
829
+ end
830
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
831
+ #
832
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
833
+ sig {
834
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments))
835
+ }
836
+ attr_accessor :installments
837
+ # 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.
838
+ sig { returns(T.nilable(String)) }
839
+ attr_accessor :request_three_d_secure
840
+ sig {
841
+ params(installments: T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments), request_three_d_secure: T.nilable(String)).void
842
+ }
843
+ def initialize(installments: nil, request_three_d_secure: nil); end
844
+ end
845
+ class CustomerBalance < Stripe::RequestParams
846
+ class BankTransfer < Stripe::RequestParams
847
+ class EuBankTransfer < Stripe::RequestParams
848
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
849
+ sig { returns(String) }
850
+ attr_accessor :country
851
+ sig { params(country: String).void }
852
+ def initialize(country: nil); end
853
+ end
854
+ # Configuration for eu_bank_transfer funding type.
855
+ sig {
856
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
857
+ }
858
+ attr_accessor :eu_bank_transfer
859
+ # 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`.
860
+ sig { returns(T.nilable(String)) }
861
+ attr_accessor :type
862
+ sig {
863
+ params(eu_bank_transfer: T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
864
+ }
865
+ def initialize(eu_bank_transfer: nil, type: nil); end
866
+ end
867
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
868
+ sig {
869
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
870
+ }
871
+ attr_accessor :bank_transfer
872
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
873
+ sig { returns(T.nilable(String)) }
874
+ attr_accessor :funding_type
875
+ sig {
876
+ params(bank_transfer: T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
877
+ }
878
+ def initialize(bank_transfer: nil, funding_type: nil); end
879
+ end
880
+ class Konbini < Stripe::RequestParams; end
881
+ class SepaDebit < Stripe::RequestParams; end
882
+ class UsBankAccount < Stripe::RequestParams
883
+ class FinancialConnections < Stripe::RequestParams
884
+ class Filters < Stripe::RequestParams
885
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
886
+ sig { returns(T.nilable(T::Array[String])) }
887
+ attr_accessor :account_subcategories
888
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
889
+ def initialize(account_subcategories: nil); end
890
+ end
891
+ # Provide filters for the linked accounts that the customer can select for the payment method.
892
+ sig {
893
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
894
+ }
895
+ attr_accessor :filters
896
+ # 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`.
897
+ sig { returns(T.nilable(T::Array[String])) }
898
+ attr_accessor :permissions
899
+ # List of data features that you would like to retrieve upon account creation.
900
+ sig { returns(T.nilable(T::Array[String])) }
901
+ attr_accessor :prefetch
902
+ sig {
903
+ params(filters: T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
904
+ }
905
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
906
+ end
907
+ # Additional fields for Financial Connections Session creation
908
+ sig {
909
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
910
+ }
911
+ attr_accessor :financial_connections
912
+ # Verification method for the intent
913
+ sig { returns(T.nilable(String)) }
914
+ attr_accessor :verification_method
915
+ sig {
916
+ params(financial_connections: T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
917
+ }
918
+ def initialize(financial_connections: nil, verification_method: nil); end
919
+ end
920
+ # 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.
921
+ sig {
922
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
923
+ }
924
+ attr_accessor :acss_debit
925
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
926
+ sig {
927
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
928
+ }
929
+ attr_accessor :bancontact
930
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
931
+ sig {
932
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Card))))
933
+ }
934
+ attr_accessor :card
935
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
936
+ sig {
937
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
938
+ }
939
+ attr_accessor :customer_balance
940
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
941
+ sig {
942
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
943
+ }
944
+ attr_accessor :konbini
945
+ # 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.
946
+ sig {
947
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
948
+ }
949
+ attr_accessor :sepa_debit
950
+ # 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.
951
+ sig {
952
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
953
+ }
954
+ attr_accessor :us_bank_account
955
+ sig {
956
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
957
+ }
958
+ def initialize(
959
+ acss_debit: nil,
960
+ bancontact: nil,
961
+ card: nil,
962
+ customer_balance: nil,
963
+ konbini: nil,
964
+ sepa_debit: nil,
965
+ us_bank_account: nil
966
+ ); end
967
+ end
968
+ # 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.
969
+ sig { returns(T.nilable(T.nilable(String))) }
970
+ attr_accessor :default_mandate
971
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
972
+ sig {
973
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions))
974
+ }
975
+ attr_accessor :payment_method_options
976
+ # 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
977
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
978
+ attr_accessor :payment_method_types
979
+ sig {
980
+ params(default_mandate: T.nilable(T.nilable(String)), payment_method_options: T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
981
+ }
982
+ def initialize(
983
+ default_mandate: nil,
984
+ payment_method_options: nil,
985
+ payment_method_types: nil
986
+ ); end
987
+ end
988
+ class Rendering < Stripe::RequestParams
989
+ class Pdf < Stripe::RequestParams
990
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
991
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
992
+ # Japanese locale and `letter` for customers with other locales.
993
+ sig { returns(T.nilable(String)) }
994
+ attr_accessor :page_size
995
+ sig { params(page_size: T.nilable(String)).void }
996
+ def initialize(page_size: nil); end
997
+ end
998
+ # 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.
999
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
1000
+ attr_accessor :amount_tax_display
1001
+ # Invoice pdf rendering options
1002
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::Rendering::Pdf)) }
1003
+ attr_accessor :pdf
1004
+ # ID of the invoice rendering template to use for this invoice.
1005
+ sig { returns(T.nilable(String)) }
1006
+ attr_accessor :template
1007
+ # The specific version of invoice rendering template to use for this invoice.
1008
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
1009
+ attr_accessor :template_version
1010
+ sig {
1011
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), pdf: T.nilable(::Stripe::InvoiceService::CreateParams::Rendering::Pdf), template: T.nilable(String), template_version: T.nilable(T.nilable(T.any(String, Integer)))).void
1012
+ }
1013
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil); end
1014
+ end
1015
+ class ShippingCost < Stripe::RequestParams
1016
+ class ShippingRateData < Stripe::RequestParams
1017
+ class DeliveryEstimate < Stripe::RequestParams
1018
+ class Maximum < Stripe::RequestParams
1019
+ # A unit of time.
1020
+ sig { returns(String) }
1021
+ attr_accessor :unit
1022
+ # Must be greater than 0.
1023
+ sig { returns(Integer) }
1024
+ attr_accessor :value
1025
+ sig { params(unit: String, value: Integer).void }
1026
+ def initialize(unit: nil, value: nil); end
1027
+ end
1028
+ class Minimum < Stripe::RequestParams
1029
+ # A unit of time.
1030
+ sig { returns(String) }
1031
+ attr_accessor :unit
1032
+ # Must be greater than 0.
1033
+ sig { returns(Integer) }
1034
+ attr_accessor :value
1035
+ sig { params(unit: String, value: Integer).void }
1036
+ def initialize(unit: nil, value: nil); end
1037
+ end
1038
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
1039
+ sig {
1040
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum))
1041
+ }
1042
+ attr_accessor :maximum
1043
+ # The lower bound of the estimated range. If empty, represents no lower bound.
1044
+ sig {
1045
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum))
1046
+ }
1047
+ attr_accessor :minimum
1048
+ sig {
1049
+ params(maximum: T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum), minimum: T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum)).void
1050
+ }
1051
+ def initialize(maximum: nil, minimum: nil); end
1052
+ end
1053
+ class FixedAmount < Stripe::RequestParams
1054
+ class CurrencyOptions < Stripe::RequestParams
1055
+ # A non-negative integer in cents representing how much to charge.
1056
+ sig { returns(Integer) }
1057
+ attr_accessor :amount
1058
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1059
+ sig { returns(T.nilable(String)) }
1060
+ attr_accessor :tax_behavior
1061
+ sig { params(amount: Integer, tax_behavior: T.nilable(String)).void }
1062
+ def initialize(amount: nil, tax_behavior: nil); end
1063
+ end
1064
+ # A non-negative integer in cents representing how much to charge.
1065
+ sig { returns(Integer) }
1066
+ attr_accessor :amount
1067
+ # 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).
1068
+ sig { returns(String) }
1069
+ attr_accessor :currency
1070
+ # 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).
1071
+ sig {
1072
+ returns(T.nilable(T::Hash[String, ::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions]))
1073
+ }
1074
+ attr_accessor :currency_options
1075
+ sig {
1076
+ params(amount: Integer, currency: String, currency_options: T.nilable(T::Hash[String, ::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions])).void
1077
+ }
1078
+ def initialize(amount: nil, currency: nil, currency_options: nil); end
1079
+ end
1080
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1081
+ sig {
1082
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate))
1083
+ }
1084
+ attr_accessor :delivery_estimate
1085
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1086
+ sig { returns(String) }
1087
+ attr_accessor :display_name
1088
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1089
+ sig {
1090
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::FixedAmount))
1091
+ }
1092
+ attr_accessor :fixed_amount
1093
+ # 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`.
1094
+ sig { returns(T.nilable(T::Hash[String, String])) }
1095
+ attr_accessor :metadata
1096
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1097
+ sig { returns(T.nilable(String)) }
1098
+ attr_accessor :tax_behavior
1099
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1100
+ sig { returns(T.nilable(String)) }
1101
+ attr_accessor :tax_code
1102
+ # The type of calculation to use on the shipping rate.
1103
+ sig { returns(T.nilable(String)) }
1104
+ attr_accessor :type
1105
+ sig {
1106
+ params(delivery_estimate: T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate), display_name: String, fixed_amount: T.nilable(::Stripe::InvoiceService::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
1107
+ }
1108
+ def initialize(
1109
+ delivery_estimate: nil,
1110
+ display_name: nil,
1111
+ fixed_amount: nil,
1112
+ metadata: nil,
1113
+ tax_behavior: nil,
1114
+ tax_code: nil,
1115
+ type: nil
1116
+ ); end
1117
+ end
1118
+ # The ID of the shipping rate to use for this order.
1119
+ sig { returns(T.nilable(String)) }
1120
+ attr_accessor :shipping_rate
1121
+ # Parameters to create a new ad-hoc shipping rate for this order.
1122
+ sig {
1123
+ returns(T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData))
1124
+ }
1125
+ attr_accessor :shipping_rate_data
1126
+ sig {
1127
+ params(shipping_rate: T.nilable(String), shipping_rate_data: T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost::ShippingRateData)).void
1128
+ }
1129
+ def initialize(shipping_rate: nil, shipping_rate_data: nil); end
1130
+ end
1131
+ class ShippingDetails < Stripe::RequestParams
1132
+ class Address < Stripe::RequestParams
1133
+ # City, district, suburb, town, or village.
1134
+ sig { returns(T.nilable(String)) }
1135
+ attr_accessor :city
1136
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1137
+ sig { returns(T.nilable(String)) }
1138
+ attr_accessor :country
1139
+ # Address line 1 (e.g., street, PO Box, or company name).
1140
+ sig { returns(T.nilable(String)) }
1141
+ attr_accessor :line1
1142
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1143
+ sig { returns(T.nilable(String)) }
1144
+ attr_accessor :line2
1145
+ # ZIP or postal code.
1146
+ sig { returns(T.nilable(String)) }
1147
+ attr_accessor :postal_code
1148
+ # State, county, province, or region.
1149
+ sig { returns(T.nilable(String)) }
1150
+ attr_accessor :state
1151
+ sig {
1152
+ 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
1153
+ }
1154
+ def initialize(
1155
+ city: nil,
1156
+ country: nil,
1157
+ line1: nil,
1158
+ line2: nil,
1159
+ postal_code: nil,
1160
+ state: nil
1161
+ ); end
1162
+ end
1163
+ # Shipping address
1164
+ sig { returns(::Stripe::InvoiceService::CreateParams::ShippingDetails::Address) }
1165
+ attr_accessor :address
1166
+ # Recipient name.
1167
+ sig { returns(String) }
1168
+ attr_accessor :name
1169
+ # Recipient phone (including extension)
1170
+ sig { returns(T.nilable(T.nilable(String))) }
1171
+ attr_accessor :phone
1172
+ sig {
1173
+ params(address: ::Stripe::InvoiceService::CreateParams::ShippingDetails::Address, name: String, phone: T.nilable(T.nilable(String))).void
1174
+ }
1175
+ def initialize(address: nil, name: nil, phone: nil); end
1176
+ end
1177
+ class TransferData < Stripe::RequestParams
1178
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
1179
+ sig { returns(T.nilable(Integer)) }
1180
+ attr_accessor :amount
1181
+ # ID of an existing, connected Stripe account.
1182
+ sig { returns(String) }
1183
+ attr_accessor :destination
1184
+ sig { params(amount: T.nilable(Integer), destination: String).void }
1185
+ def initialize(amount: nil, destination: nil); end
1186
+ end
1187
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1188
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1189
+ attr_accessor :account_tax_ids
1190
+ # 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).
1191
+ sig { returns(T.nilable(Integer)) }
1192
+ attr_accessor :application_fee_amount
1193
+ # 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.
1194
+ sig { returns(T.nilable(T::Boolean)) }
1195
+ attr_accessor :auto_advance
1196
+ # Settings for automatic tax lookup for this invoice.
1197
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::AutomaticTax)) }
1198
+ attr_accessor :automatic_tax
1199
+ # 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.
1200
+ sig { returns(T.nilable(Integer)) }
1201
+ attr_accessor :automatically_finalizes_at
1202
+ # 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`.
1203
+ sig { returns(T.nilable(String)) }
1204
+ attr_accessor :collection_method
1205
+ # The currency to create this invoice in. Defaults to that of `customer` if not specified.
1206
+ sig { returns(T.nilable(String)) }
1207
+ attr_accessor :currency
1208
+ # A list of up to 4 custom fields to be displayed on the invoice.
1209
+ sig {
1210
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreateParams::CustomField]))))
1211
+ }
1212
+ attr_accessor :custom_fields
1213
+ # The ID of the customer who will be billed.
1214
+ sig { returns(T.nilable(String)) }
1215
+ attr_accessor :customer
1216
+ # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1217
+ sig { returns(T.nilable(Integer)) }
1218
+ attr_accessor :days_until_due
1219
+ # 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.
1220
+ sig { returns(T.nilable(String)) }
1221
+ attr_accessor :default_payment_method
1222
+ # 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.
1223
+ sig { returns(T.nilable(String)) }
1224
+ attr_accessor :default_source
1225
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
1226
+ sig { returns(T.nilable(T::Array[String])) }
1227
+ attr_accessor :default_tax_rates
1228
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
1229
+ sig { returns(T.nilable(String)) }
1230
+ attr_accessor :description
1231
+ # 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.
1232
+ sig {
1233
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreateParams::Discount]))))
1234
+ }
1235
+ attr_accessor :discounts
1236
+ # The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`.
1237
+ sig { returns(T.nilable(Integer)) }
1238
+ attr_accessor :due_date
1239
+ # 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.
1240
+ sig { returns(T.nilable(Integer)) }
1241
+ attr_accessor :effective_at
1242
+ # Specifies which fields in the response should be expanded.
1243
+ sig { returns(T.nilable(T::Array[String])) }
1244
+ attr_accessor :expand
1245
+ # Footer to be displayed on the invoice.
1246
+ sig { returns(T.nilable(String)) }
1247
+ attr_accessor :footer
1248
+ # 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.
1249
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::FromInvoice)) }
1250
+ attr_accessor :from_invoice
1251
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1252
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::Issuer)) }
1253
+ attr_accessor :issuer
1254
+ # 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`.
1255
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1256
+ attr_accessor :metadata
1257
+ # 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.
1258
+ sig { returns(T.nilable(String)) }
1259
+ attr_accessor :number
1260
+ # 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.
1261
+ sig { returns(T.nilable(String)) }
1262
+ attr_accessor :on_behalf_of
1263
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
1264
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::PaymentSettings)) }
1265
+ attr_accessor :payment_settings
1266
+ # How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted.
1267
+ sig { returns(T.nilable(String)) }
1268
+ attr_accessor :pending_invoice_items_behavior
1269
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
1270
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::Rendering)) }
1271
+ attr_accessor :rendering
1272
+ # Settings for the cost of shipping for this invoice.
1273
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost)) }
1274
+ attr_accessor :shipping_cost
1275
+ # 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.
1276
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::ShippingDetails)) }
1277
+ attr_accessor :shipping_details
1278
+ # 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`.
1279
+ sig { returns(T.nilable(String)) }
1280
+ attr_accessor :statement_descriptor
1281
+ # 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.
1282
+ sig { returns(T.nilable(String)) }
1283
+ attr_accessor :subscription
1284
+ # 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.
1285
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreateParams::TransferData)) }
1286
+ attr_accessor :transfer_data
1287
+ sig {
1288
+ 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::InvoiceService::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::InvoiceService::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::InvoiceService::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::InvoiceService::CreateParams::FromInvoice), issuer: T.nilable(::Stripe::InvoiceService::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::InvoiceService::CreateParams::PaymentSettings), pending_invoice_items_behavior: T.nilable(String), rendering: T.nilable(::Stripe::InvoiceService::CreateParams::Rendering), shipping_cost: T.nilable(::Stripe::InvoiceService::CreateParams::ShippingCost), shipping_details: T.nilable(::Stripe::InvoiceService::CreateParams::ShippingDetails), statement_descriptor: T.nilable(String), subscription: T.nilable(String), transfer_data: T.nilable(::Stripe::InvoiceService::CreateParams::TransferData)).void
1289
+ }
1290
+ def initialize(
1291
+ account_tax_ids: nil,
1292
+ application_fee_amount: nil,
1293
+ auto_advance: nil,
1294
+ automatic_tax: nil,
1295
+ automatically_finalizes_at: nil,
1296
+ collection_method: nil,
1297
+ currency: nil,
1298
+ custom_fields: nil,
1299
+ customer: nil,
1300
+ days_until_due: nil,
1301
+ default_payment_method: nil,
1302
+ default_source: nil,
1303
+ default_tax_rates: nil,
1304
+ description: nil,
1305
+ discounts: nil,
1306
+ due_date: nil,
1307
+ effective_at: nil,
1308
+ expand: nil,
1309
+ footer: nil,
1310
+ from_invoice: nil,
1311
+ issuer: nil,
1312
+ metadata: nil,
1313
+ number: nil,
1314
+ on_behalf_of: nil,
1315
+ payment_settings: nil,
1316
+ pending_invoice_items_behavior: nil,
1317
+ rendering: nil,
1318
+ shipping_cost: nil,
1319
+ shipping_details: nil,
1320
+ statement_descriptor: nil,
1321
+ subscription: nil,
1322
+ transfer_data: nil
1323
+ ); end
1324
+ end
1325
+ class SearchParams < Stripe::RequestParams
1326
+ # Specifies which fields in the response should be expanded.
1327
+ sig { returns(T.nilable(T::Array[String])) }
1328
+ attr_accessor :expand
1329
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1330
+ sig { returns(T.nilable(Integer)) }
1331
+ attr_accessor :limit
1332
+ # 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.
1333
+ sig { returns(T.nilable(String)) }
1334
+ attr_accessor :page
1335
+ # 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).
1336
+ sig { returns(String) }
1337
+ attr_accessor :query
1338
+ sig {
1339
+ params(expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), page: T.nilable(String), query: String).void
1340
+ }
1341
+ def initialize(expand: nil, limit: nil, page: nil, query: nil); end
1342
+ end
1343
+ class AddLinesParams < Stripe::RequestParams
1344
+ class Line < Stripe::RequestParams
1345
+ class Discount < Stripe::RequestParams
1346
+ # ID of the coupon to create a new discount for.
1347
+ sig { returns(T.nilable(String)) }
1348
+ attr_accessor :coupon
1349
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1350
+ sig { returns(T.nilable(String)) }
1351
+ attr_accessor :discount
1352
+ # ID of the promotion code to create a new discount for.
1353
+ sig { returns(T.nilable(String)) }
1354
+ attr_accessor :promotion_code
1355
+ sig {
1356
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1357
+ }
1358
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1359
+ end
1360
+ class Period < Stripe::RequestParams
1361
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
1362
+ sig { returns(Integer) }
1363
+ attr_accessor :end
1364
+ # The start of the period. This value is inclusive.
1365
+ sig { returns(Integer) }
1366
+ attr_accessor :start
1367
+ sig { params(end_: Integer, start: Integer).void }
1368
+ def initialize(end_: nil, start: nil); end
1369
+ end
1370
+ class PriceData < Stripe::RequestParams
1371
+ class ProductData < Stripe::RequestParams
1372
+ # 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.
1373
+ sig { returns(T.nilable(String)) }
1374
+ attr_accessor :description
1375
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
1376
+ sig { returns(T.nilable(T::Array[String])) }
1377
+ attr_accessor :images
1378
+ # 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`.
1379
+ sig { returns(T.nilable(T::Hash[String, String])) }
1380
+ attr_accessor :metadata
1381
+ # The product's name, meant to be displayable to the customer.
1382
+ sig { returns(String) }
1383
+ attr_accessor :name
1384
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
1385
+ sig { returns(T.nilable(String)) }
1386
+ attr_accessor :tax_code
1387
+ sig {
1388
+ 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
1389
+ }
1390
+ def initialize(
1391
+ description: nil,
1392
+ images: nil,
1393
+ metadata: nil,
1394
+ name: nil,
1395
+ tax_code: nil
1396
+ ); end
1397
+ end
1398
+ # 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).
1399
+ sig { returns(String) }
1400
+ attr_accessor :currency
1401
+ # 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.
1402
+ sig { returns(T.nilable(String)) }
1403
+ attr_accessor :product
1404
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
1405
+ sig {
1406
+ returns(T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::PriceData::ProductData))
1407
+ }
1408
+ attr_accessor :product_data
1409
+ # 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.
1410
+ sig { returns(T.nilable(String)) }
1411
+ attr_accessor :tax_behavior
1412
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
1413
+ sig { returns(T.nilable(Integer)) }
1414
+ attr_accessor :unit_amount
1415
+ # 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.
1416
+ sig { returns(T.nilable(String)) }
1417
+ attr_accessor :unit_amount_decimal
1418
+ sig {
1419
+ params(currency: String, product: T.nilable(String), product_data: T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::PriceData::ProductData), tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1420
+ }
1421
+ def initialize(
1422
+ currency: nil,
1423
+ product: nil,
1424
+ product_data: nil,
1425
+ tax_behavior: nil,
1426
+ unit_amount: nil,
1427
+ unit_amount_decimal: nil
1428
+ ); end
1429
+ end
1430
+ class Pricing < Stripe::RequestParams
1431
+ # The ID of the price object.
1432
+ sig { returns(T.nilable(String)) }
1433
+ attr_accessor :price
1434
+ sig { params(price: T.nilable(String)).void }
1435
+ def initialize(price: nil); end
1436
+ end
1437
+ class TaxAmount < Stripe::RequestParams
1438
+ class TaxRateData < Stripe::RequestParams
1439
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1440
+ sig { returns(T.nilable(String)) }
1441
+ attr_accessor :country
1442
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
1443
+ sig { returns(T.nilable(String)) }
1444
+ attr_accessor :description
1445
+ # The display name of the tax rate, which will be shown to users.
1446
+ sig { returns(String) }
1447
+ attr_accessor :display_name
1448
+ # This specifies if the tax rate is inclusive or exclusive.
1449
+ sig { returns(T::Boolean) }
1450
+ attr_accessor :inclusive
1451
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
1452
+ sig { returns(T.nilable(String)) }
1453
+ attr_accessor :jurisdiction
1454
+ # The level of the jurisdiction that imposes this tax rate.
1455
+ sig { returns(T.nilable(String)) }
1456
+ attr_accessor :jurisdiction_level
1457
+ # 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.
1458
+ sig { returns(Float) }
1459
+ attr_accessor :percentage
1460
+ # [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.
1461
+ sig { returns(T.nilable(String)) }
1462
+ attr_accessor :state
1463
+ # The high-level tax type, such as `vat` or `sales_tax`.
1464
+ sig { returns(T.nilable(String)) }
1465
+ attr_accessor :tax_type
1466
+ sig {
1467
+ 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
1468
+ }
1469
+ def initialize(
1470
+ country: nil,
1471
+ description: nil,
1472
+ display_name: nil,
1473
+ inclusive: nil,
1474
+ jurisdiction: nil,
1475
+ jurisdiction_level: nil,
1476
+ percentage: nil,
1477
+ state: nil,
1478
+ tax_type: nil
1479
+ ); end
1480
+ end
1481
+ # The amount, in cents (or local equivalent), of the tax.
1482
+ sig { returns(Integer) }
1483
+ attr_accessor :amount
1484
+ # Data to find or create a TaxRate object.
1485
+ #
1486
+ # 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.
1487
+ sig { returns(::Stripe::InvoiceService::AddLinesParams::Line::TaxAmount::TaxRateData) }
1488
+ attr_accessor :tax_rate_data
1489
+ # The reasoning behind this tax, for example, if the product is tax exempt.
1490
+ sig { returns(T.nilable(String)) }
1491
+ attr_accessor :taxability_reason
1492
+ # The amount on which tax is calculated, in cents (or local equivalent).
1493
+ sig { returns(Integer) }
1494
+ attr_accessor :taxable_amount
1495
+ sig {
1496
+ params(amount: Integer, tax_rate_data: ::Stripe::InvoiceService::AddLinesParams::Line::TaxAmount::TaxRateData, taxability_reason: T.nilable(String), taxable_amount: Integer).void
1497
+ }
1498
+ def initialize(
1499
+ amount: nil,
1500
+ tax_rate_data: nil,
1501
+ taxability_reason: nil,
1502
+ taxable_amount: nil
1503
+ ); end
1504
+ end
1505
+ # 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.
1506
+ sig { returns(T.nilable(Integer)) }
1507
+ attr_accessor :amount
1508
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
1509
+ sig { returns(T.nilable(String)) }
1510
+ attr_accessor :description
1511
+ # 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.
1512
+ sig { returns(T.nilable(T::Boolean)) }
1513
+ attr_accessor :discountable
1514
+ # 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.
1515
+ sig {
1516
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::AddLinesParams::Line::Discount]))))
1517
+ }
1518
+ attr_accessor :discounts
1519
+ # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1520
+ sig { returns(T.nilable(String)) }
1521
+ attr_accessor :invoice_item
1522
+ # 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`.
1523
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1524
+ attr_accessor :metadata
1525
+ # 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.
1526
+ sig { returns(T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::Period)) }
1527
+ attr_accessor :period
1528
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1529
+ sig { returns(T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::PriceData)) }
1530
+ attr_accessor :price_data
1531
+ # The pricing information for the invoice item.
1532
+ sig { returns(T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::Pricing)) }
1533
+ attr_accessor :pricing
1534
+ # Non-negative integer. The quantity of units for the line item.
1535
+ sig { returns(T.nilable(Integer)) }
1536
+ attr_accessor :quantity
1537
+ # 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.
1538
+ sig {
1539
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::AddLinesParams::Line::TaxAmount]))))
1540
+ }
1541
+ attr_accessor :tax_amounts
1542
+ # 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.
1543
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1544
+ attr_accessor :tax_rates
1545
+ sig {
1546
+ 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::InvoiceService::AddLinesParams::Line::Discount]))), invoice_item: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::Period), price_data: T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::PriceData), pricing: T.nilable(::Stripe::InvoiceService::AddLinesParams::Line::Pricing), quantity: T.nilable(Integer), tax_amounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::AddLinesParams::Line::TaxAmount]))), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1547
+ }
1548
+ def initialize(
1549
+ amount: nil,
1550
+ description: nil,
1551
+ discountable: nil,
1552
+ discounts: nil,
1553
+ invoice_item: nil,
1554
+ metadata: nil,
1555
+ period: nil,
1556
+ price_data: nil,
1557
+ pricing: nil,
1558
+ quantity: nil,
1559
+ tax_amounts: nil,
1560
+ tax_rates: nil
1561
+ ); end
1562
+ end
1563
+ # Specifies which fields in the response should be expanded.
1564
+ sig { returns(T.nilable(T::Array[String])) }
1565
+ attr_accessor :expand
1566
+ # 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`.
1567
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1568
+ attr_accessor :invoice_metadata
1569
+ # The line items to add.
1570
+ sig { returns(T::Array[::Stripe::InvoiceService::AddLinesParams::Line]) }
1571
+ attr_accessor :lines
1572
+ sig {
1573
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::InvoiceService::AddLinesParams::Line]).void
1574
+ }
1575
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
1576
+ end
1577
+ class AttachPaymentParams < Stripe::RequestParams
1578
+ # Specifies which fields in the response should be expanded.
1579
+ sig { returns(T.nilable(T::Array[String])) }
1580
+ attr_accessor :expand
1581
+ # The ID of the PaymentIntent to attach to the invoice.
1582
+ sig { returns(T.nilable(String)) }
1583
+ attr_accessor :payment_intent
1584
+ sig { params(expand: T.nilable(T::Array[String]), payment_intent: T.nilable(String)).void }
1585
+ def initialize(expand: nil, payment_intent: nil); end
1586
+ end
1587
+ class FinalizeInvoiceParams < Stripe::RequestParams
1588
+ # 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.
1589
+ sig { returns(T.nilable(T::Boolean)) }
1590
+ attr_accessor :auto_advance
1591
+ # Specifies which fields in the response should be expanded.
1592
+ sig { returns(T.nilable(T::Array[String])) }
1593
+ attr_accessor :expand
1594
+ sig { params(auto_advance: T.nilable(T::Boolean), expand: T.nilable(T::Array[String])).void }
1595
+ def initialize(auto_advance: nil, expand: nil); end
1596
+ end
1597
+ class MarkUncollectibleParams < Stripe::RequestParams
1598
+ # Specifies which fields in the response should be expanded.
1599
+ sig { returns(T.nilable(T::Array[String])) }
1600
+ attr_accessor :expand
1601
+ sig { params(expand: T.nilable(T::Array[String])).void }
1602
+ def initialize(expand: nil); end
1603
+ end
1604
+ class PayParams < Stripe::RequestParams
1605
+ # Specifies which fields in the response should be expanded.
1606
+ sig { returns(T.nilable(T::Array[String])) }
1607
+ attr_accessor :expand
1608
+ # 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.
1609
+ #
1610
+ # 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`.
1611
+ sig { returns(T.nilable(T::Boolean)) }
1612
+ attr_accessor :forgive
1613
+ # 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.
1614
+ sig { returns(T.nilable(T.nilable(String))) }
1615
+ attr_accessor :mandate
1616
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).
1617
+ sig { returns(T.nilable(T::Boolean)) }
1618
+ attr_accessor :off_session
1619
+ # Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`.
1620
+ sig { returns(T.nilable(T::Boolean)) }
1621
+ attr_accessor :paid_out_of_band
1622
+ # A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.
1623
+ sig { returns(T.nilable(String)) }
1624
+ attr_accessor :payment_method
1625
+ # 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.
1626
+ sig { returns(T.nilable(String)) }
1627
+ attr_accessor :source
1628
+ sig {
1629
+ 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
1630
+ }
1631
+ def initialize(
1632
+ expand: nil,
1633
+ forgive: nil,
1634
+ mandate: nil,
1635
+ off_session: nil,
1636
+ paid_out_of_band: nil,
1637
+ payment_method: nil,
1638
+ source: nil
1639
+ ); end
1640
+ end
1641
+ class RemoveLinesParams < Stripe::RequestParams
1642
+ class Line < Stripe::RequestParams
1643
+ # Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice.
1644
+ sig { returns(String) }
1645
+ attr_accessor :behavior
1646
+ # ID of an existing line item to remove from this invoice.
1647
+ sig { returns(String) }
1648
+ attr_accessor :id
1649
+ sig { params(behavior: String, id: String).void }
1650
+ def initialize(behavior: nil, id: nil); end
1651
+ end
1652
+ # Specifies which fields in the response should be expanded.
1653
+ sig { returns(T.nilable(T::Array[String])) }
1654
+ attr_accessor :expand
1655
+ # 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`.
1656
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1657
+ attr_accessor :invoice_metadata
1658
+ # The line items to remove.
1659
+ sig { returns(T::Array[::Stripe::InvoiceService::RemoveLinesParams::Line]) }
1660
+ attr_accessor :lines
1661
+ sig {
1662
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::InvoiceService::RemoveLinesParams::Line]).void
1663
+ }
1664
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
1665
+ end
1666
+ class SendInvoiceParams < Stripe::RequestParams
1667
+ # Specifies which fields in the response should be expanded.
1668
+ sig { returns(T.nilable(T::Array[String])) }
1669
+ attr_accessor :expand
1670
+ sig { params(expand: T.nilable(T::Array[String])).void }
1671
+ def initialize(expand: nil); end
1672
+ end
1673
+ class UpdateLinesParams < Stripe::RequestParams
1674
+ class Line < Stripe::RequestParams
1675
+ class Discount < Stripe::RequestParams
1676
+ # ID of the coupon to create a new discount for.
1677
+ sig { returns(T.nilable(String)) }
1678
+ attr_accessor :coupon
1679
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1680
+ sig { returns(T.nilable(String)) }
1681
+ attr_accessor :discount
1682
+ # ID of the promotion code to create a new discount for.
1683
+ sig { returns(T.nilable(String)) }
1684
+ attr_accessor :promotion_code
1685
+ sig {
1686
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1687
+ }
1688
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1689
+ end
1690
+ class Period < Stripe::RequestParams
1691
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
1692
+ sig { returns(Integer) }
1693
+ attr_accessor :end
1694
+ # The start of the period. This value is inclusive.
1695
+ sig { returns(Integer) }
1696
+ attr_accessor :start
1697
+ sig { params(end_: Integer, start: Integer).void }
1698
+ def initialize(end_: nil, start: nil); end
1699
+ end
1700
+ class PriceData < Stripe::RequestParams
1701
+ class ProductData < Stripe::RequestParams
1702
+ # 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.
1703
+ sig { returns(T.nilable(String)) }
1704
+ attr_accessor :description
1705
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
1706
+ sig { returns(T.nilable(T::Array[String])) }
1707
+ attr_accessor :images
1708
+ # 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`.
1709
+ sig { returns(T.nilable(T::Hash[String, String])) }
1710
+ attr_accessor :metadata
1711
+ # The product's name, meant to be displayable to the customer.
1712
+ sig { returns(String) }
1713
+ attr_accessor :name
1714
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
1715
+ sig { returns(T.nilable(String)) }
1716
+ attr_accessor :tax_code
1717
+ sig {
1718
+ 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
1719
+ }
1720
+ def initialize(
1721
+ description: nil,
1722
+ images: nil,
1723
+ metadata: nil,
1724
+ name: nil,
1725
+ tax_code: nil
1726
+ ); end
1727
+ end
1728
+ # 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).
1729
+ sig { returns(String) }
1730
+ attr_accessor :currency
1731
+ # 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.
1732
+ sig { returns(T.nilable(String)) }
1733
+ attr_accessor :product
1734
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
1735
+ sig {
1736
+ returns(T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::PriceData::ProductData))
1737
+ }
1738
+ attr_accessor :product_data
1739
+ # 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.
1740
+ sig { returns(T.nilable(String)) }
1741
+ attr_accessor :tax_behavior
1742
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
1743
+ sig { returns(T.nilable(Integer)) }
1744
+ attr_accessor :unit_amount
1745
+ # 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.
1746
+ sig { returns(T.nilable(String)) }
1747
+ attr_accessor :unit_amount_decimal
1748
+ sig {
1749
+ params(currency: String, product: T.nilable(String), product_data: T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::PriceData::ProductData), tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1750
+ }
1751
+ def initialize(
1752
+ currency: nil,
1753
+ product: nil,
1754
+ product_data: nil,
1755
+ tax_behavior: nil,
1756
+ unit_amount: nil,
1757
+ unit_amount_decimal: nil
1758
+ ); end
1759
+ end
1760
+ class Pricing < Stripe::RequestParams
1761
+ # The ID of the price object.
1762
+ sig { returns(T.nilable(String)) }
1763
+ attr_accessor :price
1764
+ sig { params(price: T.nilable(String)).void }
1765
+ def initialize(price: nil); end
1766
+ end
1767
+ class TaxAmount < Stripe::RequestParams
1768
+ class TaxRateData < Stripe::RequestParams
1769
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1770
+ sig { returns(T.nilable(String)) }
1771
+ attr_accessor :country
1772
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
1773
+ sig { returns(T.nilable(String)) }
1774
+ attr_accessor :description
1775
+ # The display name of the tax rate, which will be shown to users.
1776
+ sig { returns(String) }
1777
+ attr_accessor :display_name
1778
+ # This specifies if the tax rate is inclusive or exclusive.
1779
+ sig { returns(T::Boolean) }
1780
+ attr_accessor :inclusive
1781
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
1782
+ sig { returns(T.nilable(String)) }
1783
+ attr_accessor :jurisdiction
1784
+ # The level of the jurisdiction that imposes this tax rate.
1785
+ sig { returns(T.nilable(String)) }
1786
+ attr_accessor :jurisdiction_level
1787
+ # 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.
1788
+ sig { returns(Float) }
1789
+ attr_accessor :percentage
1790
+ # [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.
1791
+ sig { returns(T.nilable(String)) }
1792
+ attr_accessor :state
1793
+ # The high-level tax type, such as `vat` or `sales_tax`.
1794
+ sig { returns(T.nilable(String)) }
1795
+ attr_accessor :tax_type
1796
+ sig {
1797
+ 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
1798
+ }
1799
+ def initialize(
1800
+ country: nil,
1801
+ description: nil,
1802
+ display_name: nil,
1803
+ inclusive: nil,
1804
+ jurisdiction: nil,
1805
+ jurisdiction_level: nil,
1806
+ percentage: nil,
1807
+ state: nil,
1808
+ tax_type: nil
1809
+ ); end
1810
+ end
1811
+ # The amount, in cents (or local equivalent), of the tax.
1812
+ sig { returns(Integer) }
1813
+ attr_accessor :amount
1814
+ # Data to find or create a TaxRate object.
1815
+ #
1816
+ # 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.
1817
+ sig { returns(::Stripe::InvoiceService::UpdateLinesParams::Line::TaxAmount::TaxRateData) }
1818
+ attr_accessor :tax_rate_data
1819
+ # The reasoning behind this tax, for example, if the product is tax exempt.
1820
+ sig { returns(T.nilable(String)) }
1821
+ attr_accessor :taxability_reason
1822
+ # The amount on which tax is calculated, in cents (or local equivalent).
1823
+ sig { returns(Integer) }
1824
+ attr_accessor :taxable_amount
1825
+ sig {
1826
+ params(amount: Integer, tax_rate_data: ::Stripe::InvoiceService::UpdateLinesParams::Line::TaxAmount::TaxRateData, taxability_reason: T.nilable(String), taxable_amount: Integer).void
1827
+ }
1828
+ def initialize(
1829
+ amount: nil,
1830
+ tax_rate_data: nil,
1831
+ taxability_reason: nil,
1832
+ taxable_amount: nil
1833
+ ); end
1834
+ end
1835
+ # 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.
1836
+ sig { returns(T.nilable(Integer)) }
1837
+ attr_accessor :amount
1838
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
1839
+ sig { returns(T.nilable(String)) }
1840
+ attr_accessor :description
1841
+ # 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.
1842
+ sig { returns(T.nilable(T::Boolean)) }
1843
+ attr_accessor :discountable
1844
+ # 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.
1845
+ sig {
1846
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::UpdateLinesParams::Line::Discount]))))
1847
+ }
1848
+ attr_accessor :discounts
1849
+ # ID of an existing line item on the invoice.
1850
+ sig { returns(String) }
1851
+ attr_accessor :id
1852
+ # 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.
1853
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1854
+ attr_accessor :metadata
1855
+ # 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.
1856
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::Period)) }
1857
+ attr_accessor :period
1858
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1859
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::PriceData)) }
1860
+ attr_accessor :price_data
1861
+ # The pricing information for the invoice item.
1862
+ sig { returns(T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::Pricing)) }
1863
+ attr_accessor :pricing
1864
+ # Non-negative integer. The quantity of units for the line item.
1865
+ sig { returns(T.nilable(Integer)) }
1866
+ attr_accessor :quantity
1867
+ # 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.
1868
+ sig {
1869
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::UpdateLinesParams::Line::TaxAmount]))))
1870
+ }
1871
+ attr_accessor :tax_amounts
1872
+ # 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.
1873
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1874
+ attr_accessor :tax_rates
1875
+ sig {
1876
+ 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::InvoiceService::UpdateLinesParams::Line::Discount]))), id: String, metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::Period), price_data: T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::PriceData), pricing: T.nilable(::Stripe::InvoiceService::UpdateLinesParams::Line::Pricing), quantity: T.nilable(Integer), tax_amounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::UpdateLinesParams::Line::TaxAmount]))), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1877
+ }
1878
+ def initialize(
1879
+ amount: nil,
1880
+ description: nil,
1881
+ discountable: nil,
1882
+ discounts: nil,
1883
+ id: nil,
1884
+ metadata: nil,
1885
+ period: nil,
1886
+ price_data: nil,
1887
+ pricing: nil,
1888
+ quantity: nil,
1889
+ tax_amounts: nil,
1890
+ tax_rates: nil
1891
+ ); end
1892
+ end
1893
+ # Specifies which fields in the response should be expanded.
1894
+ sig { returns(T.nilable(T::Array[String])) }
1895
+ attr_accessor :expand
1896
+ # 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.
1897
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1898
+ attr_accessor :invoice_metadata
1899
+ # The line items to update.
1900
+ sig { returns(T::Array[::Stripe::InvoiceService::UpdateLinesParams::Line]) }
1901
+ attr_accessor :lines
1902
+ sig {
1903
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::InvoiceService::UpdateLinesParams::Line]).void
1904
+ }
1905
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
1906
+ end
1907
+ class VoidInvoiceParams < Stripe::RequestParams
1908
+ # Specifies which fields in the response should be expanded.
1909
+ sig { returns(T.nilable(T::Array[String])) }
1910
+ attr_accessor :expand
1911
+ sig { params(expand: T.nilable(T::Array[String])).void }
1912
+ def initialize(expand: nil); end
1913
+ end
1914
+ class CreatePreviewParams < Stripe::RequestParams
1915
+ class AutomaticTax < Stripe::RequestParams
1916
+ class Liability < Stripe::RequestParams
1917
+ # The connected account being referenced when `type` is `account`.
1918
+ sig { returns(T.nilable(String)) }
1919
+ attr_accessor :account
1920
+ # Type of the account referenced in the request.
1921
+ sig { returns(String) }
1922
+ attr_accessor :type
1923
+ sig { params(account: T.nilable(String), type: String).void }
1924
+ def initialize(account: nil, type: nil); end
1925
+ end
1926
+ # 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.
1927
+ sig { returns(T::Boolean) }
1928
+ attr_accessor :enabled
1929
+ # 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.
1930
+ sig {
1931
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::AutomaticTax::Liability))
1932
+ }
1933
+ attr_accessor :liability
1934
+ sig {
1935
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::AutomaticTax::Liability)).void
1936
+ }
1937
+ def initialize(enabled: nil, liability: nil); end
1938
+ end
1939
+ class CustomerDetails < Stripe::RequestParams
1940
+ class Address < Stripe::RequestParams
1941
+ # City, district, suburb, town, or village.
1942
+ sig { returns(T.nilable(String)) }
1943
+ attr_accessor :city
1944
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1945
+ sig { returns(T.nilable(String)) }
1946
+ attr_accessor :country
1947
+ # Address line 1 (e.g., street, PO Box, or company name).
1948
+ sig { returns(T.nilable(String)) }
1949
+ attr_accessor :line1
1950
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1951
+ sig { returns(T.nilable(String)) }
1952
+ attr_accessor :line2
1953
+ # ZIP or postal code.
1954
+ sig { returns(T.nilable(String)) }
1955
+ attr_accessor :postal_code
1956
+ # State, county, province, or region.
1957
+ sig { returns(T.nilable(String)) }
1958
+ attr_accessor :state
1959
+ sig {
1960
+ 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
1961
+ }
1962
+ def initialize(
1963
+ city: nil,
1964
+ country: nil,
1965
+ line1: nil,
1966
+ line2: nil,
1967
+ postal_code: nil,
1968
+ state: nil
1969
+ ); end
1970
+ end
1971
+ class Shipping < Stripe::RequestParams
1972
+ class Address < Stripe::RequestParams
1973
+ # City, district, suburb, town, or village.
1974
+ sig { returns(T.nilable(String)) }
1975
+ attr_accessor :city
1976
+ # 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)).
1977
+ sig { returns(T.nilable(String)) }
1978
+ attr_accessor :country
1979
+ # Address line 1 (e.g., street, PO Box, or company name).
1980
+ sig { returns(T.nilable(String)) }
1981
+ attr_accessor :line1
1982
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1983
+ sig { returns(T.nilable(String)) }
1984
+ attr_accessor :line2
1985
+ # ZIP or postal code.
1986
+ sig { returns(T.nilable(String)) }
1987
+ attr_accessor :postal_code
1988
+ # State, county, province, or region.
1989
+ sig { returns(T.nilable(String)) }
1990
+ attr_accessor :state
1991
+ sig {
1992
+ 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
1993
+ }
1994
+ def initialize(
1995
+ city: nil,
1996
+ country: nil,
1997
+ line1: nil,
1998
+ line2: nil,
1999
+ postal_code: nil,
2000
+ state: nil
2001
+ ); end
2002
+ end
2003
+ # Customer shipping address.
2004
+ sig {
2005
+ returns(::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Shipping::Address)
2006
+ }
2007
+ attr_accessor :address
2008
+ # Customer name.
2009
+ sig { returns(String) }
2010
+ attr_accessor :name
2011
+ # Customer phone (including extension).
2012
+ sig { returns(T.nilable(String)) }
2013
+ attr_accessor :phone
2014
+ sig {
2015
+ params(address: ::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Shipping::Address, name: String, phone: T.nilable(String)).void
2016
+ }
2017
+ def initialize(address: nil, name: nil, phone: nil); end
2018
+ end
2019
+ class Tax < Stripe::RequestParams
2020
+ # 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.
2021
+ sig { returns(T.nilable(T.nilable(String))) }
2022
+ attr_accessor :ip_address
2023
+ sig { params(ip_address: T.nilable(T.nilable(String))).void }
2024
+ def initialize(ip_address: nil); end
2025
+ end
2026
+ class TaxId < Stripe::RequestParams
2027
+ # 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`
2028
+ sig { returns(String) }
2029
+ attr_accessor :type
2030
+ # Value of the tax ID.
2031
+ sig { returns(String) }
2032
+ attr_accessor :value
2033
+ sig { params(type: String, value: String).void }
2034
+ def initialize(type: nil, value: nil); end
2035
+ end
2036
+ # The customer's address.
2037
+ sig {
2038
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Address))))
2039
+ }
2040
+ attr_accessor :address
2041
+ # The customer's shipping information. Appears on invoices emailed to this customer.
2042
+ sig {
2043
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Shipping))))
2044
+ }
2045
+ attr_accessor :shipping
2046
+ # Tax details about the customer.
2047
+ sig {
2048
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Tax))
2049
+ }
2050
+ attr_accessor :tax
2051
+ # The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
2052
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
2053
+ attr_accessor :tax_exempt
2054
+ # The customer's tax IDs.
2055
+ sig {
2056
+ returns(T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::TaxId]))
2057
+ }
2058
+ attr_accessor :tax_ids
2059
+ sig {
2060
+ params(address: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Address))), shipping: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Shipping))), tax: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::Tax), tax_exempt: T.nilable(T.nilable(T.any(String, String))), tax_ids: T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails::TaxId])).void
2061
+ }
2062
+ def initialize(address: nil, shipping: nil, tax: nil, tax_exempt: nil, tax_ids: nil); end
2063
+ end
2064
+ class Discount < Stripe::RequestParams
2065
+ # ID of the coupon to create a new discount for.
2066
+ sig { returns(T.nilable(String)) }
2067
+ attr_accessor :coupon
2068
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2069
+ sig { returns(T.nilable(String)) }
2070
+ attr_accessor :discount
2071
+ # ID of the promotion code to create a new discount for.
2072
+ sig { returns(T.nilable(String)) }
2073
+ attr_accessor :promotion_code
2074
+ sig {
2075
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2076
+ }
2077
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2078
+ end
2079
+ class InvoiceItem < Stripe::RequestParams
2080
+ class Discount < Stripe::RequestParams
2081
+ # ID of the coupon to create a new discount for.
2082
+ sig { returns(T.nilable(String)) }
2083
+ attr_accessor :coupon
2084
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2085
+ sig { returns(T.nilable(String)) }
2086
+ attr_accessor :discount
2087
+ # ID of the promotion code to create a new discount for.
2088
+ sig { returns(T.nilable(String)) }
2089
+ attr_accessor :promotion_code
2090
+ sig {
2091
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2092
+ }
2093
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2094
+ end
2095
+ class Period < Stripe::RequestParams
2096
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2097
+ sig { returns(Integer) }
2098
+ attr_accessor :end
2099
+ # The start of the period. This value is inclusive.
2100
+ sig { returns(Integer) }
2101
+ attr_accessor :start
2102
+ sig { params(end_: Integer, start: Integer).void }
2103
+ def initialize(end_: nil, start: nil); end
2104
+ end
2105
+ class PriceData < Stripe::RequestParams
2106
+ # 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).
2107
+ sig { returns(String) }
2108
+ attr_accessor :currency
2109
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2110
+ sig { returns(String) }
2111
+ attr_accessor :product
2112
+ # 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.
2113
+ sig { returns(T.nilable(String)) }
2114
+ attr_accessor :tax_behavior
2115
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2116
+ sig { returns(T.nilable(Integer)) }
2117
+ attr_accessor :unit_amount
2118
+ # 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.
2119
+ sig { returns(T.nilable(String)) }
2120
+ attr_accessor :unit_amount_decimal
2121
+ sig {
2122
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2123
+ }
2124
+ def initialize(
2125
+ currency: nil,
2126
+ product: nil,
2127
+ tax_behavior: nil,
2128
+ unit_amount: nil,
2129
+ unit_amount_decimal: nil
2130
+ ); end
2131
+ end
2132
+ # The integer amount in cents (or local equivalent) of previewed invoice item.
2133
+ sig { returns(T.nilable(Integer)) }
2134
+ attr_accessor :amount
2135
+ # 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.
2136
+ sig { returns(T.nilable(String)) }
2137
+ attr_accessor :currency
2138
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2139
+ sig { returns(T.nilable(String)) }
2140
+ attr_accessor :description
2141
+ # Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
2142
+ sig { returns(T.nilable(T::Boolean)) }
2143
+ attr_accessor :discountable
2144
+ # The coupons to redeem into discounts for the invoice item in the preview.
2145
+ sig {
2146
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreatePreviewParams::InvoiceItem::Discount]))))
2147
+ }
2148
+ attr_accessor :discounts
2149
+ # 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.
2150
+ sig { returns(T.nilable(String)) }
2151
+ attr_accessor :invoiceitem
2152
+ # 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`.
2153
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2154
+ attr_accessor :metadata
2155
+ # 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.
2156
+ sig {
2157
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::InvoiceItem::Period))
2158
+ }
2159
+ attr_accessor :period
2160
+ # The ID of the price object. One of `price` or `price_data` is required.
2161
+ sig { returns(T.nilable(String)) }
2162
+ attr_accessor :price
2163
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2164
+ sig {
2165
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::InvoiceItem::PriceData))
2166
+ }
2167
+ attr_accessor :price_data
2168
+ # Non-negative integer. The quantity of units for the invoice item.
2169
+ sig { returns(T.nilable(Integer)) }
2170
+ attr_accessor :quantity
2171
+ # 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.
2172
+ sig { returns(T.nilable(String)) }
2173
+ attr_accessor :tax_behavior
2174
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2175
+ sig { returns(T.nilable(T.nilable(String))) }
2176
+ attr_accessor :tax_code
2177
+ # The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
2178
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2179
+ attr_accessor :tax_rates
2180
+ # 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.
2181
+ sig { returns(T.nilable(Integer)) }
2182
+ attr_accessor :unit_amount
2183
+ # 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.
2184
+ sig { returns(T.nilable(String)) }
2185
+ attr_accessor :unit_amount_decimal
2186
+ sig {
2187
+ 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::InvoiceService::CreatePreviewParams::InvoiceItem::Discount]))), invoiceitem: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::InvoiceItem::Period), price: T.nilable(String), price_data: T.nilable(::Stripe::InvoiceService::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
2188
+ }
2189
+ def initialize(
2190
+ amount: nil,
2191
+ currency: nil,
2192
+ description: nil,
2193
+ discountable: nil,
2194
+ discounts: nil,
2195
+ invoiceitem: nil,
2196
+ metadata: nil,
2197
+ period: nil,
2198
+ price: nil,
2199
+ price_data: nil,
2200
+ quantity: nil,
2201
+ tax_behavior: nil,
2202
+ tax_code: nil,
2203
+ tax_rates: nil,
2204
+ unit_amount: nil,
2205
+ unit_amount_decimal: nil
2206
+ ); end
2207
+ end
2208
+ class Issuer < Stripe::RequestParams
2209
+ # The connected account being referenced when `type` is `account`.
2210
+ sig { returns(T.nilable(String)) }
2211
+ attr_accessor :account
2212
+ # Type of the account referenced in the request.
2213
+ sig { returns(String) }
2214
+ attr_accessor :type
2215
+ sig { params(account: T.nilable(String), type: String).void }
2216
+ def initialize(account: nil, type: nil); end
2217
+ end
2218
+ class ScheduleDetails < Stripe::RequestParams
2219
+ class Phase < Stripe::RequestParams
2220
+ class AddInvoiceItem < Stripe::RequestParams
2221
+ class Discount < Stripe::RequestParams
2222
+ # ID of the coupon to create a new discount for.
2223
+ sig { returns(T.nilable(String)) }
2224
+ attr_accessor :coupon
2225
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2226
+ sig { returns(T.nilable(String)) }
2227
+ attr_accessor :discount
2228
+ # ID of the promotion code to create a new discount for.
2229
+ sig { returns(T.nilable(String)) }
2230
+ attr_accessor :promotion_code
2231
+ sig {
2232
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2233
+ }
2234
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2235
+ end
2236
+ class PriceData < Stripe::RequestParams
2237
+ # 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).
2238
+ sig { returns(String) }
2239
+ attr_accessor :currency
2240
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2241
+ sig { returns(String) }
2242
+ attr_accessor :product
2243
+ # 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.
2244
+ sig { returns(T.nilable(String)) }
2245
+ attr_accessor :tax_behavior
2246
+ # 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.
2247
+ sig { returns(T.nilable(Integer)) }
2248
+ attr_accessor :unit_amount
2249
+ # 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.
2250
+ sig { returns(T.nilable(String)) }
2251
+ attr_accessor :unit_amount_decimal
2252
+ sig {
2253
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2254
+ }
2255
+ def initialize(
2256
+ currency: nil,
2257
+ product: nil,
2258
+ tax_behavior: nil,
2259
+ unit_amount: nil,
2260
+ unit_amount_decimal: nil
2261
+ ); end
2262
+ end
2263
+ # The coupons to redeem into discounts for the item.
2264
+ sig {
2265
+ returns(T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::Discount]))
2266
+ }
2267
+ attr_accessor :discounts
2268
+ # The ID of the price object. One of `price` or `price_data` is required.
2269
+ sig { returns(T.nilable(String)) }
2270
+ attr_accessor :price
2271
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2272
+ sig {
2273
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::PriceData))
2274
+ }
2275
+ attr_accessor :price_data
2276
+ # Quantity for this item. Defaults to 1.
2277
+ sig { returns(T.nilable(Integer)) }
2278
+ attr_accessor :quantity
2279
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
2280
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2281
+ attr_accessor :tax_rates
2282
+ sig {
2283
+ params(discounts: T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
2284
+ }
2285
+ def initialize(
2286
+ discounts: nil,
2287
+ price: nil,
2288
+ price_data: nil,
2289
+ quantity: nil,
2290
+ tax_rates: nil
2291
+ ); end
2292
+ end
2293
+ class AutomaticTax < Stripe::RequestParams
2294
+ class Liability < Stripe::RequestParams
2295
+ # The connected account being referenced when `type` is `account`.
2296
+ sig { returns(T.nilable(String)) }
2297
+ attr_accessor :account
2298
+ # Type of the account referenced in the request.
2299
+ sig { returns(String) }
2300
+ attr_accessor :type
2301
+ sig { params(account: T.nilable(String), type: String).void }
2302
+ def initialize(account: nil, type: nil); end
2303
+ end
2304
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
2305
+ sig { returns(T::Boolean) }
2306
+ attr_accessor :enabled
2307
+ # 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.
2308
+ sig {
2309
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax::Liability))
2310
+ }
2311
+ attr_accessor :liability
2312
+ sig {
2313
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax::Liability)).void
2314
+ }
2315
+ def initialize(enabled: nil, liability: nil); end
2316
+ end
2317
+ class BillingThresholds < Stripe::RequestParams
2318
+ # Monetary threshold that triggers the subscription to advance to a new billing period
2319
+ sig { returns(T.nilable(Integer)) }
2320
+ attr_accessor :amount_gte
2321
+ # 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.
2322
+ sig { returns(T.nilable(T::Boolean)) }
2323
+ attr_accessor :reset_billing_cycle_anchor
2324
+ sig {
2325
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
2326
+ }
2327
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
2328
+ end
2329
+ class Discount < Stripe::RequestParams
2330
+ # ID of the coupon to create a new discount for.
2331
+ sig { returns(T.nilable(String)) }
2332
+ attr_accessor :coupon
2333
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2334
+ sig { returns(T.nilable(String)) }
2335
+ attr_accessor :discount
2336
+ # ID of the promotion code to create a new discount for.
2337
+ sig { returns(T.nilable(String)) }
2338
+ attr_accessor :promotion_code
2339
+ sig {
2340
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2341
+ }
2342
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2343
+ end
2344
+ class InvoiceSettings < Stripe::RequestParams
2345
+ class Issuer < Stripe::RequestParams
2346
+ # The connected account being referenced when `type` is `account`.
2347
+ sig { returns(T.nilable(String)) }
2348
+ attr_accessor :account
2349
+ # Type of the account referenced in the request.
2350
+ sig { returns(String) }
2351
+ attr_accessor :type
2352
+ sig { params(account: T.nilable(String), type: String).void }
2353
+ def initialize(account: nil, type: nil); end
2354
+ end
2355
+ # 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.
2356
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2357
+ attr_accessor :account_tax_ids
2358
+ # 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`.
2359
+ sig { returns(T.nilable(Integer)) }
2360
+ attr_accessor :days_until_due
2361
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2362
+ sig {
2363
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings::Issuer))
2364
+ }
2365
+ attr_accessor :issuer
2366
+ sig {
2367
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), days_until_due: T.nilable(Integer), issuer: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings::Issuer)).void
2368
+ }
2369
+ def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
2370
+ end
2371
+ class Item < Stripe::RequestParams
2372
+ class BillingThresholds < Stripe::RequestParams
2373
+ # 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))
2374
+ sig { returns(Integer) }
2375
+ attr_accessor :usage_gte
2376
+ sig { params(usage_gte: Integer).void }
2377
+ def initialize(usage_gte: nil); end
2378
+ end
2379
+ class Discount < Stripe::RequestParams
2380
+ # ID of the coupon to create a new discount for.
2381
+ sig { returns(T.nilable(String)) }
2382
+ attr_accessor :coupon
2383
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2384
+ sig { returns(T.nilable(String)) }
2385
+ attr_accessor :discount
2386
+ # ID of the promotion code to create a new discount for.
2387
+ sig { returns(T.nilable(String)) }
2388
+ attr_accessor :promotion_code
2389
+ sig {
2390
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2391
+ }
2392
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2393
+ end
2394
+ class PriceData < Stripe::RequestParams
2395
+ class Recurring < Stripe::RequestParams
2396
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2397
+ sig { returns(String) }
2398
+ attr_accessor :interval
2399
+ # 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).
2400
+ sig { returns(T.nilable(Integer)) }
2401
+ attr_accessor :interval_count
2402
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
2403
+ def initialize(interval: nil, interval_count: nil); end
2404
+ end
2405
+ # 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).
2406
+ sig { returns(String) }
2407
+ attr_accessor :currency
2408
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2409
+ sig { returns(String) }
2410
+ attr_accessor :product
2411
+ # The recurring components of a price such as `interval` and `interval_count`.
2412
+ sig {
2413
+ returns(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData::Recurring)
2414
+ }
2415
+ attr_accessor :recurring
2416
+ # 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.
2417
+ sig { returns(T.nilable(String)) }
2418
+ attr_accessor :tax_behavior
2419
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2420
+ sig { returns(T.nilable(Integer)) }
2421
+ attr_accessor :unit_amount
2422
+ # 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.
2423
+ sig { returns(T.nilable(String)) }
2424
+ attr_accessor :unit_amount_decimal
2425
+ sig {
2426
+ params(currency: String, product: String, recurring: ::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2427
+ }
2428
+ def initialize(
2429
+ currency: nil,
2430
+ product: nil,
2431
+ recurring: nil,
2432
+ tax_behavior: nil,
2433
+ unit_amount: nil,
2434
+ unit_amount_decimal: nil
2435
+ ); end
2436
+ end
2437
+ # 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.
2438
+ sig {
2439
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item::BillingThresholds))))
2440
+ }
2441
+ attr_accessor :billing_thresholds
2442
+ # The coupons to redeem into discounts for the subscription item.
2443
+ sig {
2444
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item::Discount]))))
2445
+ }
2446
+ attr_accessor :discounts
2447
+ # 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`.
2448
+ sig { returns(T.nilable(T::Hash[String, String])) }
2449
+ attr_accessor :metadata
2450
+ # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
2451
+ sig { returns(T.nilable(String)) }
2452
+ attr_accessor :plan
2453
+ # The ID of the price object.
2454
+ sig { returns(T.nilable(String)) }
2455
+ attr_accessor :price
2456
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2457
+ sig {
2458
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData))
2459
+ }
2460
+ attr_accessor :price_data
2461
+ # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
2462
+ sig { returns(T.nilable(Integer)) }
2463
+ attr_accessor :quantity
2464
+ # 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.
2465
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2466
+ attr_accessor :tax_rates
2467
+ sig {
2468
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::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::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
2469
+ }
2470
+ def initialize(
2471
+ billing_thresholds: nil,
2472
+ discounts: nil,
2473
+ metadata: nil,
2474
+ plan: nil,
2475
+ price: nil,
2476
+ price_data: nil,
2477
+ quantity: nil,
2478
+ tax_rates: nil
2479
+ ); end
2480
+ end
2481
+ class TransferData < Stripe::RequestParams
2482
+ # 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.
2483
+ sig { returns(T.nilable(Float)) }
2484
+ attr_accessor :amount_percent
2485
+ # ID of an existing, connected Stripe account.
2486
+ sig { returns(String) }
2487
+ attr_accessor :destination
2488
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
2489
+ def initialize(amount_percent: nil, destination: nil); end
2490
+ end
2491
+ # 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.
2492
+ sig {
2493
+ returns(T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem]))
2494
+ }
2495
+ attr_accessor :add_invoice_items
2496
+ # 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).
2497
+ sig { returns(T.nilable(Float)) }
2498
+ attr_accessor :application_fee_percent
2499
+ # Automatic tax settings for this phase.
2500
+ sig {
2501
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax))
2502
+ }
2503
+ attr_accessor :automatic_tax
2504
+ # 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).
2505
+ sig { returns(T.nilable(String)) }
2506
+ attr_accessor :billing_cycle_anchor
2507
+ # 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.
2508
+ sig {
2509
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::BillingThresholds))))
2510
+ }
2511
+ attr_accessor :billing_thresholds
2512
+ # 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.
2513
+ sig { returns(T.nilable(String)) }
2514
+ attr_accessor :collection_method
2515
+ # 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).
2516
+ sig { returns(T.nilable(String)) }
2517
+ attr_accessor :currency
2518
+ # 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.
2519
+ sig { returns(T.nilable(String)) }
2520
+ attr_accessor :default_payment_method
2521
+ # 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.
2522
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2523
+ attr_accessor :default_tax_rates
2524
+ # 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.
2525
+ sig { returns(T.nilable(T.nilable(String))) }
2526
+ attr_accessor :description
2527
+ # 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.
2528
+ sig {
2529
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Discount]))))
2530
+ }
2531
+ attr_accessor :discounts
2532
+ # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
2533
+ sig { returns(T.nilable(T.any(Integer, String))) }
2534
+ attr_accessor :end_date
2535
+ # All invoices will be billed using the specified settings.
2536
+ sig {
2537
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings))
2538
+ }
2539
+ attr_accessor :invoice_settings
2540
+ # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
2541
+ sig {
2542
+ returns(T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Item])
2543
+ }
2544
+ attr_accessor :items
2545
+ # 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.
2546
+ sig { returns(T.nilable(Integer)) }
2547
+ attr_accessor :iterations
2548
+ # 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`.
2549
+ sig { returns(T.nilable(T::Hash[String, String])) }
2550
+ attr_accessor :metadata
2551
+ # The account on behalf of which to charge, for each of the associated subscription's invoices.
2552
+ sig { returns(T.nilable(String)) }
2553
+ attr_accessor :on_behalf_of
2554
+ # 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.
2555
+ sig { returns(T.nilable(String)) }
2556
+ attr_accessor :proration_behavior
2557
+ # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
2558
+ sig { returns(T.nilable(T.any(Integer, String))) }
2559
+ attr_accessor :start_date
2560
+ # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
2561
+ sig {
2562
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::TransferData))
2563
+ }
2564
+ attr_accessor :transfer_data
2565
+ # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2566
+ sig { returns(T.nilable(T::Boolean)) }
2567
+ attr_accessor :trial
2568
+ # 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`
2569
+ sig { returns(T.nilable(T.any(Integer, String))) }
2570
+ attr_accessor :trial_end
2571
+ sig {
2572
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::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::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::Discount]))), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings), items: T::Array[::Stripe::InvoiceService::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::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
2573
+ }
2574
+ def initialize(
2575
+ add_invoice_items: nil,
2576
+ application_fee_percent: nil,
2577
+ automatic_tax: nil,
2578
+ billing_cycle_anchor: nil,
2579
+ billing_thresholds: nil,
2580
+ collection_method: nil,
2581
+ currency: nil,
2582
+ default_payment_method: nil,
2583
+ default_tax_rates: nil,
2584
+ description: nil,
2585
+ discounts: nil,
2586
+ end_date: nil,
2587
+ invoice_settings: nil,
2588
+ items: nil,
2589
+ iterations: nil,
2590
+ metadata: nil,
2591
+ on_behalf_of: nil,
2592
+ proration_behavior: nil,
2593
+ start_date: nil,
2594
+ transfer_data: nil,
2595
+ trial: nil,
2596
+ trial_end: nil
2597
+ ); end
2598
+ end
2599
+ # 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.
2600
+ sig { returns(T.nilable(String)) }
2601
+ attr_accessor :end_behavior
2602
+ # 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.
2603
+ sig {
2604
+ returns(T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase]))
2605
+ }
2606
+ attr_accessor :phases
2607
+ # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2608
+ sig { returns(T.nilable(String)) }
2609
+ attr_accessor :proration_behavior
2610
+ sig {
2611
+ params(end_behavior: T.nilable(String), phases: T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails::Phase]), proration_behavior: T.nilable(String)).void
2612
+ }
2613
+ def initialize(end_behavior: nil, phases: nil, proration_behavior: nil); end
2614
+ end
2615
+ class SubscriptionDetails < Stripe::RequestParams
2616
+ class Item < Stripe::RequestParams
2617
+ class BillingThresholds < Stripe::RequestParams
2618
+ # 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))
2619
+ sig { returns(Integer) }
2620
+ attr_accessor :usage_gte
2621
+ sig { params(usage_gte: Integer).void }
2622
+ def initialize(usage_gte: nil); end
2623
+ end
2624
+ class Discount < Stripe::RequestParams
2625
+ # ID of the coupon to create a new discount for.
2626
+ sig { returns(T.nilable(String)) }
2627
+ attr_accessor :coupon
2628
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2629
+ sig { returns(T.nilable(String)) }
2630
+ attr_accessor :discount
2631
+ # ID of the promotion code to create a new discount for.
2632
+ sig { returns(T.nilable(String)) }
2633
+ attr_accessor :promotion_code
2634
+ sig {
2635
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2636
+ }
2637
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2638
+ end
2639
+ class PriceData < Stripe::RequestParams
2640
+ class Recurring < Stripe::RequestParams
2641
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2642
+ sig { returns(String) }
2643
+ attr_accessor :interval
2644
+ # 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).
2645
+ sig { returns(T.nilable(Integer)) }
2646
+ attr_accessor :interval_count
2647
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
2648
+ def initialize(interval: nil, interval_count: nil); end
2649
+ end
2650
+ # 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).
2651
+ sig { returns(String) }
2652
+ attr_accessor :currency
2653
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2654
+ sig { returns(String) }
2655
+ attr_accessor :product
2656
+ # The recurring components of a price such as `interval` and `interval_count`.
2657
+ sig {
2658
+ returns(::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails::Item::PriceData::Recurring)
2659
+ }
2660
+ attr_accessor :recurring
2661
+ # 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.
2662
+ sig { returns(T.nilable(String)) }
2663
+ attr_accessor :tax_behavior
2664
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2665
+ sig { returns(T.nilable(Integer)) }
2666
+ attr_accessor :unit_amount
2667
+ # 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.
2668
+ sig { returns(T.nilable(String)) }
2669
+ attr_accessor :unit_amount_decimal
2670
+ sig {
2671
+ params(currency: String, product: String, recurring: ::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2672
+ }
2673
+ def initialize(
2674
+ currency: nil,
2675
+ product: nil,
2676
+ recurring: nil,
2677
+ tax_behavior: nil,
2678
+ unit_amount: nil,
2679
+ unit_amount_decimal: nil
2680
+ ); end
2681
+ end
2682
+ # 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.
2683
+ sig {
2684
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails::Item::BillingThresholds))))
2685
+ }
2686
+ attr_accessor :billing_thresholds
2687
+ # 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.
2688
+ sig { returns(T.nilable(T::Boolean)) }
2689
+ attr_accessor :clear_usage
2690
+ # A flag that, if set to `true`, will delete the specified item.
2691
+ sig { returns(T.nilable(T::Boolean)) }
2692
+ attr_accessor :deleted
2693
+ # The coupons to redeem into discounts for the subscription item.
2694
+ sig {
2695
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails::Item::Discount]))))
2696
+ }
2697
+ attr_accessor :discounts
2698
+ # Subscription item to update.
2699
+ sig { returns(T.nilable(String)) }
2700
+ attr_accessor :id
2701
+ # 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`.
2702
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2703
+ attr_accessor :metadata
2704
+ # Plan ID for this item, as a string.
2705
+ sig { returns(T.nilable(String)) }
2706
+ attr_accessor :plan
2707
+ # 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.
2708
+ sig { returns(T.nilable(String)) }
2709
+ attr_accessor :price
2710
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2711
+ sig {
2712
+ returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails::Item::PriceData))
2713
+ }
2714
+ attr_accessor :price_data
2715
+ # Quantity for this item.
2716
+ sig { returns(T.nilable(Integer)) }
2717
+ attr_accessor :quantity
2718
+ # 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.
2719
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2720
+ attr_accessor :tax_rates
2721
+ sig {
2722
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::InvoiceService::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::InvoiceService::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::InvoiceService::CreatePreviewParams::SubscriptionDetails::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
2723
+ }
2724
+ def initialize(
2725
+ billing_thresholds: nil,
2726
+ clear_usage: nil,
2727
+ deleted: nil,
2728
+ discounts: nil,
2729
+ id: nil,
2730
+ metadata: nil,
2731
+ plan: nil,
2732
+ price: nil,
2733
+ price_data: nil,
2734
+ quantity: nil,
2735
+ tax_rates: nil
2736
+ ); end
2737
+ end
2738
+ # 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`.
2739
+ sig { returns(T.nilable(T.any(String, Integer))) }
2740
+ attr_accessor :billing_cycle_anchor
2741
+ # 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.
2742
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
2743
+ attr_accessor :cancel_at
2744
+ # 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.
2745
+ sig { returns(T.nilable(T::Boolean)) }
2746
+ attr_accessor :cancel_at_period_end
2747
+ # This simulates the subscription being canceled or expired immediately.
2748
+ sig { returns(T.nilable(T::Boolean)) }
2749
+ attr_accessor :cancel_now
2750
+ # 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.
2751
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2752
+ attr_accessor :default_tax_rates
2753
+ # A list of up to 20 subscription items, each with an attached price.
2754
+ sig {
2755
+ returns(T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails::Item]))
2756
+ }
2757
+ attr_accessor :items
2758
+ # 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`.
2759
+ sig { returns(T.nilable(String)) }
2760
+ attr_accessor :proration_behavior
2761
+ # 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'.
2762
+ sig { returns(T.nilable(Integer)) }
2763
+ attr_accessor :proration_date
2764
+ # For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
2765
+ sig { returns(T.nilable(String)) }
2766
+ attr_accessor :resume_at
2767
+ # Date a subscription is intended to start (can be future or past).
2768
+ sig { returns(T.nilable(Integer)) }
2769
+ attr_accessor :start_date
2770
+ # 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.
2771
+ sig { returns(T.nilable(T.any(String, Integer))) }
2772
+ attr_accessor :trial_end
2773
+ sig {
2774
+ 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::InvoiceService::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
2775
+ }
2776
+ def initialize(
2777
+ billing_cycle_anchor: nil,
2778
+ cancel_at: nil,
2779
+ cancel_at_period_end: nil,
2780
+ cancel_now: nil,
2781
+ default_tax_rates: nil,
2782
+ items: nil,
2783
+ proration_behavior: nil,
2784
+ proration_date: nil,
2785
+ resume_at: nil,
2786
+ start_date: nil,
2787
+ trial_end: nil
2788
+ ); end
2789
+ end
2790
+ # Settings for automatic tax lookup for this invoice preview.
2791
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::AutomaticTax)) }
2792
+ attr_accessor :automatic_tax
2793
+ # The currency to preview this invoice in. Defaults to that of `customer` if not specified.
2794
+ sig { returns(T.nilable(String)) }
2795
+ attr_accessor :currency
2796
+ # 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.
2797
+ sig { returns(T.nilable(String)) }
2798
+ attr_accessor :customer
2799
+ # 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.
2800
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails)) }
2801
+ attr_accessor :customer_details
2802
+ # 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.
2803
+ sig {
2804
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreatePreviewParams::Discount]))))
2805
+ }
2806
+ attr_accessor :discounts
2807
+ # Specifies which fields in the response should be expanded.
2808
+ sig { returns(T.nilable(T::Array[String])) }
2809
+ attr_accessor :expand
2810
+ # List of invoice items to add or update in the upcoming invoice preview (up to 250).
2811
+ sig {
2812
+ returns(T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::InvoiceItem]))
2813
+ }
2814
+ attr_accessor :invoice_items
2815
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2816
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::Issuer)) }
2817
+ attr_accessor :issuer
2818
+ # 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.
2819
+ sig { returns(T.nilable(T.nilable(String))) }
2820
+ attr_accessor :on_behalf_of
2821
+ # Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
2822
+ sig { returns(T.nilable(String)) }
2823
+ attr_accessor :preview_mode
2824
+ # The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
2825
+ sig { returns(T.nilable(String)) }
2826
+ attr_accessor :schedule
2827
+ # The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
2828
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails)) }
2829
+ attr_accessor :schedule_details
2830
+ # 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.
2831
+ sig { returns(T.nilable(String)) }
2832
+ attr_accessor :subscription
2833
+ # The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
2834
+ sig { returns(T.nilable(::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails)) }
2835
+ attr_accessor :subscription_details
2836
+ sig {
2837
+ params(automatic_tax: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::AutomaticTax), currency: T.nilable(String), customer: T.nilable(String), customer_details: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::CustomerDetails), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::InvoiceService::CreatePreviewParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_items: T.nilable(T::Array[::Stripe::InvoiceService::CreatePreviewParams::InvoiceItem]), issuer: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::Issuer), on_behalf_of: T.nilable(T.nilable(String)), preview_mode: T.nilable(String), schedule: T.nilable(String), schedule_details: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::ScheduleDetails), subscription: T.nilable(String), subscription_details: T.nilable(::Stripe::InvoiceService::CreatePreviewParams::SubscriptionDetails)).void
2838
+ }
2839
+ def initialize(
2840
+ automatic_tax: nil,
2841
+ currency: nil,
2842
+ customer: nil,
2843
+ customer_details: nil,
2844
+ discounts: nil,
2845
+ expand: nil,
2846
+ invoice_items: nil,
2847
+ issuer: nil,
2848
+ on_behalf_of: nil,
2849
+ preview_mode: nil,
2850
+ schedule: nil,
2851
+ schedule_details: nil,
2852
+ subscription: nil,
2853
+ subscription_details: nil
2854
+ ); end
2855
+ end
2856
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
2857
+ sig {
2858
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::AddLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2859
+ }
2860
+ def add_lines(invoice, params = {}, opts = {}); end
2861
+
2862
+ # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
2863
+ #
2864
+ # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
2865
+ # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
2866
+ # invoice's status becomes paid.
2867
+ #
2868
+ # If the PaymentIntent's status is already succeeded when it's attached, it's
2869
+ # credited to the invoice immediately.
2870
+ #
2871
+ # See: [Partial payments](https://docs.stripe.com/docs/invoicing/partial-payments) to learn more.
2872
+ sig {
2873
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::AttachPaymentParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2874
+ }
2875
+ def attach_payment(invoice, params = {}, opts = {}); end
2876
+
2877
+ # 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.
2878
+ sig {
2879
+ params(params: T.any(::Stripe::InvoiceService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2880
+ }
2881
+ def create(params = {}, opts = {}); end
2882
+
2883
+ # 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.
2884
+ #
2885
+ # 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.
2886
+ #
2887
+ # 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.
2888
+ #
2889
+ # 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.
2890
+ #
2891
+ # 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)
2892
+ sig {
2893
+ params(params: T.any(::Stripe::InvoiceService::CreatePreviewParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2894
+ }
2895
+ def create_preview(params = {}, opts = {}); end
2896
+
2897
+ # 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).
2898
+ sig {
2899
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::DeleteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2900
+ }
2901
+ def delete(invoice, params = {}, opts = {}); end
2902
+
2903
+ # 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.
2904
+ sig {
2905
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::FinalizeInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2906
+ }
2907
+ def finalize_invoice(invoice, params = {}, opts = {}); end
2908
+
2909
+ # 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.
2910
+ sig {
2911
+ params(params: T.any(::Stripe::InvoiceService::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
2912
+ }
2913
+ def list(params = {}, opts = {}); end
2914
+
2915
+ # Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
2916
+ sig {
2917
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::MarkUncollectibleParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2918
+ }
2919
+ def mark_uncollectible(invoice, params = {}, opts = {}); end
2920
+
2921
+ # 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.
2922
+ sig {
2923
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::PayParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2924
+ }
2925
+ def pay(invoice, params = {}, opts = {}); end
2926
+
2927
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
2928
+ sig {
2929
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::RemoveLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2930
+ }
2931
+ def remove_lines(invoice, params = {}, opts = {}); end
2932
+
2933
+ # Retrieves the invoice with the given ID.
2934
+ sig {
2935
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2936
+ }
2937
+ def retrieve(invoice, params = {}, opts = {}); end
2938
+
2939
+ # Search for invoices you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language).
2940
+ # Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
2941
+ # conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
2942
+ # to an hour behind during outages. Search functionality is not available to merchants in India.
2943
+ sig {
2944
+ params(params: T.any(::Stripe::InvoiceService::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SearchResultObject)
2945
+ }
2946
+ def search(params = {}, opts = {}); end
2947
+
2948
+ # 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.
2949
+ #
2950
+ # Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
2951
+ sig {
2952
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::SendInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2953
+ }
2954
+ def send_invoice(invoice, params = {}, opts = {}); end
2955
+
2956
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized),
2957
+ # monetary values, as well as collection_method, become uneditable.
2958
+ #
2959
+ # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
2960
+ # sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass
2961
+ # auto_advance=false.
2962
+ sig {
2963
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2964
+ }
2965
+ def update(invoice, params = {}, opts = {}); end
2966
+
2967
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
2968
+ sig {
2969
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::UpdateLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2970
+ }
2971
+ def update_lines(invoice, params = {}, opts = {}); end
2972
+
2973
+ # 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.
2974
+ #
2975
+ # 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.
2976
+ sig {
2977
+ params(invoice: String, params: T.any(::Stripe::InvoiceService::VoidInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
2978
+ }
2979
+ def void_invoice(invoice, params = {}, opts = {}); end
2980
+ end
2981
+ end