stripe 13.6.0.pre.beta.1 → 14.0.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 (556) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +699 -1457
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +29 -0
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_requestor.rb +2 -0
  7. data/lib/stripe/api_version.rb +1 -1
  8. data/lib/stripe/errors.rb +0 -7
  9. data/lib/stripe/object_types.rb +0 -26
  10. data/lib/stripe/resources/account.rb +83 -614
  11. data/lib/stripe/resources/account_session.rb +1 -247
  12. data/lib/stripe/resources/apple_pay_domain.rb +0 -9
  13. data/lib/stripe/resources/application_fee.rb +1 -10
  14. data/lib/stripe/resources/balance.rb +0 -9
  15. data/lib/stripe/resources/balance_transaction.rb +2 -11
  16. data/lib/stripe/resources/bank_account.rb +1 -1
  17. data/lib/stripe/resources/billing/alert.rb +0 -9
  18. data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -48
  19. data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -9
  20. data/lib/stripe/resources/billing/credit_grant.rb +4 -13
  21. data/lib/stripe/resources/billing/meter.rb +1 -10
  22. data/lib/stripe/resources/billing_portal/configuration.rb +0 -9
  23. data/lib/stripe/resources/card.rb +2 -4
  24. data/lib/stripe/resources/charge.rb +35 -1457
  25. data/lib/stripe/resources/checkout/session.rb +100 -293
  26. data/lib/stripe/resources/climate/order.rb +0 -9
  27. data/lib/stripe/resources/climate/product.rb +0 -9
  28. data/lib/stripe/resources/climate/supplier.rb +0 -9
  29. data/lib/stripe/resources/confirmation_token.rb +74 -156
  30. data/lib/stripe/resources/country_spec.rb +0 -9
  31. data/lib/stripe/resources/coupon.rb +0 -9
  32. data/lib/stripe/resources/credit_note.rb +14 -35
  33. data/lib/stripe/resources/credit_note_line_item.rb +14 -12
  34. data/lib/stripe/resources/customer.rb +12 -28
  35. data/lib/stripe/resources/customer_balance_transaction.rb +3 -1
  36. data/lib/stripe/resources/dispute.rb +0 -9
  37. data/lib/stripe/resources/entitlements/active_entitlement.rb +0 -9
  38. data/lib/stripe/resources/entitlements/feature.rb +0 -9
  39. data/lib/stripe/resources/event.rb +0 -40
  40. data/lib/stripe/resources/exchange_rate.rb +0 -9
  41. data/lib/stripe/resources/file.rb +0 -9
  42. data/lib/stripe/resources/file_link.rb +0 -9
  43. data/lib/stripe/resources/financial_connections/account.rb +0 -23
  44. data/lib/stripe/resources/financial_connections/session.rb +1 -65
  45. data/lib/stripe/resources/financial_connections/transaction.rb +0 -9
  46. data/lib/stripe/resources/forwarding/request.rb +0 -9
  47. data/lib/stripe/resources/identity/verification_report.rb +0 -9
  48. data/lib/stripe/resources/identity/verification_session.rb +0 -9
  49. data/lib/stripe/resources/invoice.rb +225 -5120
  50. data/lib/stripe/resources/invoice_item.rb +65 -110
  51. data/lib/stripe/resources/invoice_line_item.rb +106 -89
  52. data/lib/stripe/resources/invoice_payment.rb +53 -4
  53. data/lib/stripe/resources/invoice_rendering_template.rb +0 -12
  54. data/lib/stripe/resources/issuing/authorization.rb +0 -9
  55. data/lib/stripe/resources/issuing/card.rb +0 -9
  56. data/lib/stripe/resources/issuing/cardholder.rb +1 -11
  57. data/lib/stripe/resources/issuing/dispute.rb +0 -9
  58. data/lib/stripe/resources/issuing/personalization_design.rb +0 -9
  59. data/lib/stripe/resources/issuing/physical_bundle.rb +0 -9
  60. data/lib/stripe/resources/issuing/token.rb +0 -9
  61. data/lib/stripe/resources/issuing/transaction.rb +0 -15
  62. data/lib/stripe/resources/line_item.rb +0 -28
  63. data/lib/stripe/resources/mandate.rb +6 -33
  64. data/lib/stripe/resources/payment_intent.rb +642 -4975
  65. data/lib/stripe/resources/payment_link.rb +84 -15
  66. data/lib/stripe/resources/payment_method.rb +74 -187
  67. data/lib/stripe/resources/payment_method_configuration.rb +87 -214
  68. data/lib/stripe/resources/payment_method_domain.rb +9 -18
  69. data/lib/stripe/resources/payout.rb +0 -9
  70. data/lib/stripe/resources/person.rb +9 -9
  71. data/lib/stripe/resources/plan.rb +0 -15
  72. data/lib/stripe/resources/price.rb +2 -47
  73. data/lib/stripe/resources/product.rb +0 -68
  74. data/lib/stripe/resources/promotion_code.rb +0 -9
  75. data/lib/stripe/resources/quote.rb +8 -2037
  76. data/lib/stripe/resources/radar/early_fraud_warning.rb +0 -9
  77. data/lib/stripe/resources/radar/value_list.rb +0 -9
  78. data/lib/stripe/resources/radar/value_list_item.rb +0 -9
  79. data/lib/stripe/resources/refund.rb +13 -18
  80. data/lib/stripe/resources/reporting/report_run.rb +0 -9
  81. data/lib/stripe/resources/reporting/report_type.rb +0 -9
  82. data/lib/stripe/resources/review.rb +2 -11
  83. data/lib/stripe/resources/setup_attempt.rb +11 -16
  84. data/lib/stripe/resources/setup_intent.rb +158 -540
  85. data/lib/stripe/resources/shipping_rate.rb +0 -9
  86. data/lib/stripe/resources/sigma/scheduled_query_run.rb +0 -9
  87. data/lib/stripe/resources/source.rb +0 -41
  88. data/lib/stripe/resources/subscription.rb +14 -385
  89. data/lib/stripe/resources/subscription_item.rb +9 -134
  90. data/lib/stripe/resources/subscription_schedule.rb +14 -1135
  91. data/lib/stripe/resources/tax/calculation.rb +0 -9
  92. data/lib/stripe/resources/tax/registration.rb +1 -10
  93. data/lib/stripe/resources/tax/settings.rb +0 -9
  94. data/lib/stripe/resources/tax/transaction.rb +0 -9
  95. data/lib/stripe/resources/tax_code.rb +0 -9
  96. data/lib/stripe/resources/tax_id.rb +0 -9
  97. data/lib/stripe/resources/tax_rate.rb +0 -9
  98. data/lib/stripe/resources/terminal/configuration.rb +214 -14
  99. data/lib/stripe/resources/terminal/location.rb +0 -9
  100. data/lib/stripe/resources/terminal/reader.rb +0 -408
  101. data/lib/stripe/resources/test_helpers/test_clock.rb +0 -9
  102. data/lib/stripe/resources/token.rb +1 -10
  103. data/lib/stripe/resources/topup.rb +0 -9
  104. data/lib/stripe/resources/transfer.rb +0 -9
  105. data/lib/stripe/resources/treasury/credit_reversal.rb +0 -9
  106. data/lib/stripe/resources/treasury/debit_reversal.rb +0 -9
  107. data/lib/stripe/resources/treasury/financial_account.rb +4 -32
  108. data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
  109. data/lib/stripe/resources/treasury/inbound_transfer.rb +0 -9
  110. data/lib/stripe/resources/treasury/outbound_payment.rb +0 -9
  111. data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -46
  112. data/lib/stripe/resources/treasury/received_credit.rb +1 -47
  113. data/lib/stripe/resources/treasury/received_debit.rb +1 -49
  114. data/lib/stripe/resources/treasury/transaction.rb +0 -9
  115. data/lib/stripe/resources/treasury/transaction_entry.rb +0 -9
  116. data/lib/stripe/resources/v2/event.rb +1 -0
  117. data/lib/stripe/resources/v2/event_destination.rb +1 -0
  118. data/lib/stripe/resources/webhook_endpoint.rb +0 -9
  119. data/lib/stripe/resources.rb +0 -25
  120. data/lib/stripe/services/account_external_account_service.rb +1 -1
  121. data/lib/stripe/services/account_service.rb +68 -509
  122. data/lib/stripe/services/account_session_service.rb +1 -217
  123. data/lib/stripe/services/balance_transaction_service.rb +1 -1
  124. data/lib/stripe/services/billing/credit_balance_summary_service.rb +2 -2
  125. data/lib/stripe/services/billing/credit_grant_service.rb +2 -2
  126. data/lib/stripe/services/billing/meter_service.rb +1 -1
  127. data/lib/stripe/services/charge_service.rb +1 -1335
  128. data/lib/stripe/services/checkout/session_service.rb +60 -168
  129. data/lib/stripe/services/credit_note_preview_lines_service.rb +0 -4
  130. data/lib/stripe/services/credit_note_service.rb +0 -8
  131. data/lib/stripe/services/customer_service.rb +0 -16
  132. data/lib/stripe/services/financial_connections/account_service.rb +1 -3
  133. data/lib/stripe/services/financial_connections/session_service.rb +1 -30
  134. data/lib/stripe/services/financial_connections_service.rb +1 -2
  135. data/lib/stripe/services/invoice_item_service.rb +34 -88
  136. data/lib/stripe/services/invoice_line_item_service.rb +25 -41
  137. data/lib/stripe/services/invoice_payment_service.rb +33 -5
  138. data/lib/stripe/services/invoice_service.rb +210 -3147
  139. data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
  140. data/lib/stripe/services/issuing/transaction_service.rb +0 -4
  141. data/lib/stripe/services/issuing_service.rb +1 -5
  142. data/lib/stripe/services/payment_intent_service.rb +568 -4513
  143. data/lib/stripe/services/payment_link_service.rb +59 -6
  144. data/lib/stripe/services/payment_method_configuration_service.rb +62 -146
  145. data/lib/stripe/services/payment_method_domain_service.rb +6 -6
  146. data/lib/stripe/services/payment_method_service.rb +49 -119
  147. data/lib/stripe/services/plan_service.rb +0 -4
  148. data/lib/stripe/services/price_service.rb +2 -25
  149. data/lib/stripe/services/product_service.rb +0 -38
  150. data/lib/stripe/services/quote_service.rb +9 -1716
  151. data/lib/stripe/services/setup_intent_service.rb +158 -492
  152. data/lib/stripe/services/subscription_item_service.rb +5 -111
  153. data/lib/stripe/services/subscription_schedule_service.rb +14 -1005
  154. data/lib/stripe/services/subscription_service.rb +13 -323
  155. data/lib/stripe/services/tax/registration_service.rb +1 -1
  156. data/lib/stripe/services/tax_service.rb +1 -3
  157. data/lib/stripe/services/terminal/configuration_service.rb +170 -4
  158. data/lib/stripe/services/terminal/reader_service.rb +0 -177
  159. data/lib/stripe/services/terminal_service.rb +1 -2
  160. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +49 -87
  161. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +0 -43
  162. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
  163. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
  164. data/lib/stripe/services/token_service.rb +1 -1
  165. data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
  166. data/lib/stripe/services/treasury/financial_account_service.rb +3 -17
  167. data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
  168. data/lib/stripe/services/v1_services.rb +2 -8
  169. data/lib/stripe/services/v2/core/event_destination_service.rb +1 -4
  170. data/lib/stripe/services/v2/core/event_service.rb +1 -4
  171. data/lib/stripe/services.rb +0 -27
  172. data/lib/stripe/stripe_client.rb +1 -0
  173. data/lib/stripe/stripe_configuration.rb +1 -3
  174. data/lib/stripe/util.rb +1 -7
  175. data/lib/stripe/version.rb +1 -1
  176. data/lib/stripe.rb +0 -45
  177. data/rbi/stripe/resources/account.rbi +1131 -1479
  178. data/rbi/stripe/resources/account_link.rbi +9 -9
  179. data/rbi/stripe/resources/account_session.rbi +118 -367
  180. data/rbi/stripe/resources/apple_pay_domain.rbi +8 -15
  181. data/rbi/stripe/resources/application_fee.rbi +15 -20
  182. data/rbi/stripe/resources/apps/secret.rbi +20 -20
  183. data/rbi/stripe/resources/balance.rbi +0 -7
  184. data/rbi/stripe/resources/balance_transaction.rbi +19 -24
  185. data/rbi/stripe/resources/bank_account.rbi +1 -1
  186. data/rbi/stripe/resources/billing/alert.rbi +23 -28
  187. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -53
  188. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +6 -13
  189. data/rbi/stripe/resources/billing/credit_grant.rbi +30 -37
  190. data/rbi/stripe/resources/billing/meter.rbi +19 -26
  191. data/rbi/stripe/resources/billing/meter_event.rbi +4 -4
  192. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +5 -5
  193. data/rbi/stripe/resources/billing_portal/configuration.rbi +86 -81
  194. data/rbi/stripe/resources/billing_portal/session.rbi +31 -27
  195. data/rbi/stripe/resources/card.rbi +2 -5
  196. data/rbi/stripe/resources/charge.rbi +136 -1576
  197. data/rbi/stripe/resources/checkout/session.rbi +631 -748
  198. data/rbi/stripe/resources/climate/order.rbi +20 -25
  199. data/rbi/stripe/resources/climate/product.rbi +5 -12
  200. data/rbi/stripe/resources/climate/supplier.rbi +5 -12
  201. data/rbi/stripe/resources/confirmation_token.rbi +274 -268
  202. data/rbi/stripe/resources/country_spec.rbi +5 -12
  203. data/rbi/stripe/resources/coupon.rbi +34 -39
  204. data/rbi/stripe/resources/credit_note.rbi +134 -146
  205. data/rbi/stripe/resources/credit_note_line_item.rbi +20 -18
  206. data/rbi/stripe/resources/customer.rbi +172 -164
  207. data/rbi/stripe/resources/customer_balance_transaction.rbi +4 -1
  208. data/rbi/stripe/resources/customer_session.rbi +19 -15
  209. data/rbi/stripe/resources/dispute.rbi +92 -95
  210. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +5 -12
  211. data/rbi/stripe/resources/entitlements/feature.rbi +15 -22
  212. data/rbi/stripe/resources/ephemeral_key.rbi +2 -2
  213. data/rbi/stripe/resources/event.rbi +16 -60
  214. data/rbi/stripe/resources/exchange_rate.rbi +5 -12
  215. data/rbi/stripe/resources/file.rbi +20 -25
  216. data/rbi/stripe/resources/file_link.rbi +23 -28
  217. data/rbi/stripe/resources/financial_connections/account.rbi +25 -44
  218. data/rbi/stripe/resources/financial_connections/session.rbi +12 -75
  219. data/rbi/stripe/resources/financial_connections/transaction.rbi +16 -19
  220. data/rbi/stripe/resources/forwarding/request.rbi +21 -24
  221. data/rbi/stripe/resources/identity/verification_report.rbi +18 -21
  222. data/rbi/stripe/resources/identity/verification_session.rbi +60 -61
  223. data/rbi/stripe/resources/invoice.rbi +723 -5918
  224. data/rbi/stripe/resources/invoice_item.rbi +138 -177
  225. data/rbi/stripe/resources/invoice_line_item.rbi +199 -264
  226. data/rbi/stripe/resources/invoice_payment.rbi +51 -7
  227. data/rbi/stripe/resources/invoice_rendering_template.rbi +10 -20
  228. data/rbi/stripe/resources/issuing/authorization.rbi +216 -199
  229. data/rbi/stripe/resources/issuing/card.rbi +104 -101
  230. data/rbi/stripe/resources/issuing/cardholder.rbi +120 -108
  231. data/rbi/stripe/resources/issuing/dispute.rbi +164 -151
  232. data/rbi/stripe/resources/issuing/personalization_design.rbi +61 -56
  233. data/rbi/stripe/resources/issuing/physical_bundle.rbi +7 -14
  234. data/rbi/stripe/resources/issuing/token.rbi +16 -21
  235. data/rbi/stripe/resources/issuing/transaction.rbi +180 -176
  236. data/rbi/stripe/resources/line_item.rbi +0 -36
  237. data/rbi/stripe/resources/mandate.rbi +8 -40
  238. data/rbi/stripe/resources/payment_intent.rbi +2252 -6482
  239. data/rbi/stripe/resources/payment_link.rbi +346 -211
  240. data/rbi/stripe/resources/payment_method.rbi +226 -330
  241. data/rbi/stripe/resources/payment_method_configuration.rbi +602 -685
  242. data/rbi/stripe/resources/payment_method_domain.rbi +26 -31
  243. data/rbi/stripe/resources/payout.rbi +43 -42
  244. data/rbi/stripe/resources/person.rbi +9 -9
  245. data/rbi/stripe/resources/plan.rbi +51 -63
  246. data/rbi/stripe/resources/price.rbi +114 -151
  247. data/rbi/stripe/resources/product.rbi +90 -152
  248. data/rbi/stripe/resources/promotion_code.rbi +42 -47
  249. data/rbi/stripe/resources/quote.rbi +168 -2231
  250. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +17 -20
  251. data/rbi/stripe/resources/radar/value_list.rbi +24 -29
  252. data/rbi/stripe/resources/radar/value_list_item.rbi +18 -21
  253. data/rbi/stripe/resources/refund.rbi +52 -51
  254. data/rbi/stripe/resources/reporting/report_run.rbi +27 -30
  255. data/rbi/stripe/resources/reporting/report_type.rbi +2 -9
  256. data/rbi/stripe/resources/review.rbi +17 -22
  257. data/rbi/stripe/resources/setup_attempt.rbi +25 -32
  258. data/rbi/stripe/resources/setup_intent.rbi +900 -1102
  259. data/rbi/stripe/resources/shipping_rate.rbi +41 -46
  260. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +5 -12
  261. data/rbi/stripe/resources/source.rbi +132 -179
  262. data/rbi/stripe/resources/subscription.rbi +363 -707
  263. data/rbi/stripe/resources/subscription_item.rbi +69 -177
  264. data/rbi/stripe/resources/subscription_schedule.rbi +289 -1447
  265. data/rbi/stripe/resources/tax/calculation.rbi +43 -48
  266. data/rbi/stripe/resources/tax/registration.rbi +217 -170
  267. data/rbi/stripe/resources/tax/settings.rbi +14 -21
  268. data/rbi/stripe/resources/tax/transaction.rbi +20 -25
  269. data/rbi/stripe/resources/tax_code.rbi +5 -12
  270. data/rbi/stripe/resources/tax_id.rbi +15 -22
  271. data/rbi/stripe/resources/tax_rate.rbi +34 -39
  272. data/rbi/stripe/resources/terminal/configuration.rbi +457 -212
  273. data/rbi/stripe/resources/terminal/connection_token.rbi +3 -3
  274. data/rbi/stripe/resources/terminal/location.rbi +28 -35
  275. data/rbi/stripe/resources/terminal/reader.rbi +71 -441
  276. data/rbi/stripe/resources/test_helpers/test_clock.rbi +12 -17
  277. data/rbi/stripe/resources/token.rbi +288 -263
  278. data/rbi/stripe/resources/topup.rbi +35 -38
  279. data/rbi/stripe/resources/transfer.rbi +27 -32
  280. data/rbi/stripe/resources/treasury/credit_reversal.rbi +10 -17
  281. data/rbi/stripe/resources/treasury/debit_reversal.rbi +11 -18
  282. data/rbi/stripe/resources/treasury/financial_account.rbi +125 -130
  283. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -3
  284. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +22 -29
  285. data/rbi/stripe/resources/treasury/outbound_payment.rbi +82 -79
  286. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +44 -86
  287. data/rbi/stripe/resources/treasury/received_credit.rbi +18 -64
  288. data/rbi/stripe/resources/treasury/received_debit.rbi +17 -66
  289. data/rbi/stripe/resources/treasury/transaction.rbi +27 -28
  290. data/rbi/stripe/resources/treasury/transaction_entry.rbi +25 -26
  291. data/rbi/stripe/resources/v2/amount.rbi +1 -1
  292. data/rbi/stripe/resources/v2/event.rbi +1 -0
  293. data/rbi/stripe/resources/v2/event_destination.rbi +1 -0
  294. data/rbi/stripe/resources/webhook_endpoint.rbi +18 -25
  295. data/rbi/stripe/services/account_capability_service.rbi +7 -7
  296. data/rbi/stripe/services/account_external_account_service.rbi +52 -52
  297. data/rbi/stripe/services/account_link_service.rbi +9 -9
  298. data/rbi/stripe/services/account_login_link_service.rbi +2 -2
  299. data/rbi/stripe/services/account_person_service.rbi +221 -201
  300. data/rbi/stripe/services/account_service.rbi +1221 -1345
  301. data/rbi/stripe/services/account_session_service.rbi +115 -346
  302. data/rbi/stripe/services/apple_pay_domain_service.rbi +10 -10
  303. data/rbi/stripe/services/application_fee_refund_service.rbi +16 -14
  304. data/rbi/stripe/services/application_fee_service.rbi +18 -14
  305. data/rbi/stripe/services/apps/secret_service.rbi +20 -20
  306. data/rbi/stripe/services/balance_service.rbi +2 -2
  307. data/rbi/stripe/services/balance_transaction_service.rbi +22 -18
  308. data/rbi/stripe/services/billing/alert_service.rbi +23 -23
  309. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +10 -10
  310. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +8 -8
  311. data/rbi/stripe/services/billing/credit_grant_service.rbi +32 -30
  312. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +7 -5
  313. data/rbi/stripe/services/billing/meter_event_service.rbi +4 -4
  314. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +6 -6
  315. data/rbi/stripe/services/billing/meter_service.rbi +21 -21
  316. data/rbi/stripe/services/billing_portal/configuration_service.rbi +90 -76
  317. data/rbi/stripe/services/billing_portal/session_service.rbi +29 -27
  318. data/rbi/stripe/services/charge_service.rbi +96 -1464
  319. data/rbi/stripe/services/checkout/session_line_item_service.rbi +5 -5
  320. data/rbi/stripe/services/checkout/session_service.rbi +555 -591
  321. data/rbi/stripe/services/climate/order_service.rbi +22 -20
  322. data/rbi/stripe/services/climate/product_service.rbi +7 -7
  323. data/rbi/stripe/services/climate/supplier_service.rbi +7 -7
  324. data/rbi/stripe/services/confirmation_token_service.rbi +2 -2
  325. data/rbi/stripe/services/country_spec_service.rbi +7 -7
  326. data/rbi/stripe/services/coupon_service.rbi +40 -34
  327. data/rbi/stripe/services/credit_note_line_item_service.rbi +5 -5
  328. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +35 -35
  329. data/rbi/stripe/services/credit_note_service.rbi +81 -85
  330. data/rbi/stripe/services/customer_balance_transaction_service.rbi +15 -15
  331. data/rbi/stripe/services/customer_cash_balance_service.rbi +7 -7
  332. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +7 -7
  333. data/rbi/stripe/services/customer_funding_instructions_service.rbi +5 -5
  334. data/rbi/stripe/services/customer_payment_method_service.rbi +9 -9
  335. data/rbi/stripe/services/customer_payment_source_service.rbi +48 -44
  336. data/rbi/stripe/services/customer_service.rbi +143 -139
  337. data/rbi/stripe/services/customer_session_service.rbi +21 -15
  338. data/rbi/stripe/services/customer_tax_id_service.rbi +9 -9
  339. data/rbi/stripe/services/dispute_service.rbi +92 -90
  340. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +7 -7
  341. data/rbi/stripe/services/entitlements/feature_service.rbi +17 -17
  342. data/rbi/stripe/services/ephemeral_key_service.rbi +8 -8
  343. data/rbi/stripe/services/event_service.rbi +18 -16
  344. data/rbi/stripe/services/exchange_rate_service.rbi +7 -7
  345. data/rbi/stripe/services/file_link_service.rbi +25 -23
  346. data/rbi/stripe/services/file_service.rbi +22 -20
  347. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +5 -5
  348. data/rbi/stripe/services/financial_connections/account_service.rbi +22 -21
  349. data/rbi/stripe/services/financial_connections/session_service.rbi +16 -39
  350. data/rbi/stripe/services/financial_connections/transaction_service.rbi +16 -14
  351. data/rbi/stripe/services/financial_connections_service.rbi +0 -1
  352. data/rbi/stripe/services/forwarding/request_service.rbi +21 -19
  353. data/rbi/stripe/services/identity/verification_report_service.rbi +18 -16
  354. data/rbi/stripe/services/identity/verification_session_service.rbi +62 -56
  355. data/rbi/stripe/services/invoice_item_service.rbi +99 -155
  356. data/rbi/stripe/services/invoice_line_item_service.rbi +71 -82
  357. data/rbi/stripe/services/invoice_payment_service.rbi +39 -12
  358. data/rbi/stripe/services/invoice_rendering_template_service.rbi +13 -13
  359. data/rbi/stripe/services/invoice_service.rbi +679 -3799
  360. data/rbi/stripe/services/issuing/authorization_service.rbi +32 -26
  361. data/rbi/stripe/services/issuing/card_service.rbi +102 -86
  362. data/rbi/stripe/services/issuing/cardholder_service.rbi +122 -103
  363. data/rbi/stripe/services/issuing/dispute_service.rbi +152 -146
  364. data/rbi/stripe/services/issuing/personalization_design_service.rbi +52 -42
  365. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +9 -9
  366. data/rbi/stripe/services/issuing/token_service.rbi +20 -16
  367. data/rbi/stripe/services/issuing/transaction_service.rbi +25 -23
  368. data/rbi/stripe/services/issuing_service.rbi +0 -3
  369. data/rbi/stripe/services/mandate_service.rbi +2 -2
  370. data/rbi/stripe/services/payment_intent_service.rbi +2312 -6081
  371. data/rbi/stripe/services/payment_link_line_item_service.rbi +5 -5
  372. data/rbi/stripe/services/payment_link_service.rbi +303 -201
  373. data/rbi/stripe/services/payment_method_configuration_service.rbi +616 -620
  374. data/rbi/stripe/services/payment_method_domain_service.rbi +25 -23
  375. data/rbi/stripe/services/payment_method_service.rbi +192 -249
  376. data/rbi/stripe/services/payout_service.rbi +45 -37
  377. data/rbi/stripe/services/plan_service.rbi +53 -55
  378. data/rbi/stripe/services/price_service.rbi +124 -129
  379. data/rbi/stripe/services/product_feature_service.rbi +9 -9
  380. data/rbi/stripe/services/product_service.rbi +94 -122
  381. data/rbi/stripe/services/promotion_code_service.rbi +46 -42
  382. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +5 -5
  383. data/rbi/stripe/services/quote_line_item_service.rbi +5 -5
  384. data/rbi/stripe/services/quote_service.rbi +159 -1863
  385. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +17 -15
  386. data/rbi/stripe/services/radar/value_list_item_service.rbi +20 -16
  387. data/rbi/stripe/services/radar/value_list_service.rbi +28 -24
  388. data/rbi/stripe/services/refund_service.rbi +37 -33
  389. data/rbi/stripe/services/reporting/report_run_service.rbi +29 -25
  390. data/rbi/stripe/services/reporting/report_type_service.rbi +4 -4
  391. data/rbi/stripe/services/review_service.rbi +17 -15
  392. data/rbi/stripe/services/setup_attempt_service.rbi +13 -11
  393. data/rbi/stripe/services/setup_intent_service.rbi +1028 -1062
  394. data/rbi/stripe/services/shipping_rate_service.rbi +47 -41
  395. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +7 -7
  396. data/rbi/stripe/services/source_service.rbi +149 -133
  397. data/rbi/stripe/services/source_transaction_service.rbi +5 -5
  398. data/rbi/stripe/services/subscription_item_service.rbi +61 -159
  399. data/rbi/stripe/services/subscription_schedule_service.rbi +289 -1305
  400. data/rbi/stripe/services/subscription_service.rbi +366 -640
  401. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +5 -5
  402. data/rbi/stripe/services/tax/calculation_service.rbi +40 -38
  403. data/rbi/stripe/services/tax/registration_service.rbi +337 -165
  404. data/rbi/stripe/services/tax/settings_service.rbi +16 -16
  405. data/rbi/stripe/services/tax/transaction_line_item_service.rbi +5 -5
  406. data/rbi/stripe/services/tax/transaction_service.rbi +19 -15
  407. data/rbi/stripe/services/tax_code_service.rbi +7 -7
  408. data/rbi/stripe/services/tax_id_service.rbi +17 -17
  409. data/rbi/stripe/services/tax_rate_service.rbi +36 -34
  410. data/rbi/stripe/services/tax_service.rbi +0 -2
  411. data/rbi/stripe/services/terminal/configuration_service.rbi +464 -204
  412. data/rbi/stripe/services/terminal/connection_token_service.rbi +3 -3
  413. data/rbi/stripe/services/terminal/location_service.rbi +30 -30
  414. data/rbi/stripe/services/terminal/reader_service.rbi +57 -226
  415. data/rbi/stripe/services/terminal_service.rbi +0 -1
  416. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +157 -198
  417. data/rbi/stripe/services/test_helpers/customer_service.rbi +3 -3
  418. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +180 -168
  419. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +10 -10
  420. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +11 -9
  421. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +151 -145
  422. data/rbi/stripe/services/test_helpers/refund_service.rbi +2 -2
  423. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +10 -39
  424. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +14 -12
  425. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +9 -9
  426. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +20 -18
  427. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +20 -18
  428. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +11 -38
  429. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +11 -38
  430. data/rbi/stripe/services/token_service.rbi +292 -258
  431. data/rbi/stripe/services/topup_service.rbi +37 -33
  432. data/rbi/stripe/services/transfer_reversal_service.rbi +18 -16
  433. data/rbi/stripe/services/transfer_service.rbi +29 -27
  434. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +12 -12
  435. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +13 -13
  436. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +23 -26
  437. data/rbi/stripe/services/treasury/financial_account_service.rbi +92 -96
  438. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +15 -15
  439. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +60 -56
  440. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +24 -49
  441. data/rbi/stripe/services/treasury/received_credit_service.rbi +11 -9
  442. data/rbi/stripe/services/treasury/received_debit_service.rbi +8 -8
  443. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +25 -21
  444. data/rbi/stripe/services/treasury/transaction_service.rbi +31 -23
  445. data/rbi/stripe/services/v1_services.rbi +1 -7
  446. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +3 -3
  447. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +3 -3
  448. data/rbi/stripe/services/v2/core/event_destination_service.rbi +21 -24
  449. data/rbi/stripe/services/v2/core/event_service.rbi +3 -6
  450. data/rbi/stripe/services/webhook_endpoint_service.rbi +20 -20
  451. metadata +4 -109
  452. data/lib/stripe/request_signing_authenticator.rb +0 -79
  453. data/lib/stripe/resources/account_notice.rb +0 -132
  454. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  455. data/lib/stripe/resources/capital/financing_offer.rb +0 -188
  456. data/lib/stripe/resources/capital/financing_summary.rb +0 -64
  457. data/lib/stripe/resources/capital/financing_transaction.rb +0 -123
  458. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
  459. data/lib/stripe/resources/financial_connections/institution.rb +0 -99
  460. data/lib/stripe/resources/gift_cards/card.rb +0 -217
  461. data/lib/stripe/resources/gift_cards/transaction.rb +0 -281
  462. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -611
  463. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -84
  464. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -95
  465. data/lib/stripe/resources/issuing/settlement.rb +0 -49
  466. data/lib/stripe/resources/margin.rb +0 -124
  467. data/lib/stripe/resources/order.rb +0 -2868
  468. data/lib/stripe/resources/payment_attempt_record.rb +0 -184
  469. data/lib/stripe/resources/payment_record.rb +0 -715
  470. data/lib/stripe/resources/quote_line.rb +0 -274
  471. data/lib/stripe/resources/quote_preview_invoice.rb +0 -652
  472. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -362
  473. data/lib/stripe/resources/tax/association.rb +0 -89
  474. data/lib/stripe/resources/tax/form.rb +0 -220
  475. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -40
  476. data/lib/stripe/resources/usage_record.rb +0 -30
  477. data/lib/stripe/resources/usage_record_summary.rb +0 -33
  478. data/lib/stripe/services/account_notice_service.rb +0 -101
  479. data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
  480. data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
  481. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
  482. data/lib/stripe/services/capital_service.rb +0 -15
  483. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +0 -37
  484. data/lib/stripe/services/financial_connections/institution_service.rb +0 -57
  485. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  486. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  487. data/lib/stripe/services/gift_cards_service.rb +0 -14
  488. data/lib/stripe/services/invoice_upcoming_lines_service.rb +0 -1881
  489. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
  490. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
  491. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
  492. data/lib/stripe/services/margin_service.rb +0 -119
  493. data/lib/stripe/services/order_line_item_service.rb +0 -35
  494. data/lib/stripe/services/order_service.rb +0 -2268
  495. data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
  496. data/lib/stripe/services/payment_record_service.rb +0 -542
  497. data/lib/stripe/services/quote_line_service.rb +0 -35
  498. data/lib/stripe/services/quote_preview_invoice_service.rb +0 -35
  499. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
  500. data/lib/stripe/services/subscription_item_usage_record_service.rb +0 -41
  501. data/lib/stripe/services/subscription_item_usage_record_summary_service.rb +0 -37
  502. data/lib/stripe/services/tax/association_service.rb +0 -31
  503. data/lib/stripe/services/tax/form_service.rb +0 -100
  504. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
  505. data/rbi/stripe/resources/account_notice.rbi +0 -139
  506. data/rbi/stripe/resources/billing/meter_error_report.rbi +0 -71
  507. data/rbi/stripe/resources/capital/financing_offer.rbi +0 -190
  508. data/rbi/stripe/resources/capital/financing_summary.rbi +0 -74
  509. data/rbi/stripe/resources/capital/financing_transaction.rbi +0 -130
  510. data/rbi/stripe/resources/financial_connections/account_inferred_balance.rbi +0 -27
  511. data/rbi/stripe/resources/financial_connections/institution.rbi +0 -99
  512. data/rbi/stripe/resources/gift_cards/card.rbi +0 -206
  513. data/rbi/stripe/resources/gift_cards/transaction.rbi +0 -257
  514. data/rbi/stripe/resources/issuing/credit_underwriting_record.rbi +0 -622
  515. data/rbi/stripe/resources/issuing/dispute_settlement_detail.rbi +0 -83
  516. data/rbi/stripe/resources/issuing/fraud_liability_debit.rbi +0 -90
  517. data/rbi/stripe/resources/issuing/settlement.rbi +0 -62
  518. data/rbi/stripe/resources/margin.rbi +0 -127
  519. data/rbi/stripe/resources/order.rbi +0 -3036
  520. data/rbi/stripe/resources/payment_attempt_record.rbi +0 -215
  521. data/rbi/stripe/resources/payment_record.rbi +0 -722
  522. data/rbi/stripe/resources/quote_line.rbi +0 -350
  523. data/rbi/stripe/resources/quote_preview_invoice.rbi +0 -850
  524. data/rbi/stripe/resources/quote_preview_subscription_schedule.rbi +0 -474
  525. data/rbi/stripe/resources/tax/association.rbi +0 -94
  526. data/rbi/stripe/resources/tax/form.rbi +0 -224
  527. data/rbi/stripe/resources/terminal/reader_collected_data.rbi +0 -41
  528. data/rbi/stripe/resources/usage_record.rbi +0 -32
  529. data/rbi/stripe/resources/usage_record_summary.rbi +0 -38
  530. data/rbi/stripe/services/account_notice_service.rbi +0 -90
  531. data/rbi/stripe/services/capital/financing_offer_service.rbi +0 -95
  532. data/rbi/stripe/services/capital/financing_summary_service.rbi +0 -22
  533. data/rbi/stripe/services/capital/financing_transaction_service.rbi +0 -68
  534. data/rbi/stripe/services/capital_service.rbi +0 -11
  535. data/rbi/stripe/services/financial_connections/account_inferred_balance_service.rbi +0 -33
  536. data/rbi/stripe/services/financial_connections/institution_service.rbi +0 -46
  537. data/rbi/stripe/services/gift_cards/card_service.rbi +0 -142
  538. data/rbi/stripe/services/gift_cards/transaction_service.rbi +0 -174
  539. data/rbi/stripe/services/gift_cards_service.rbi +0 -10
  540. data/rbi/stripe/services/invoice_upcoming_lines_service.rbi +0 -2023
  541. data/rbi/stripe/services/issuing/credit_underwriting_record_service.rbi +0 -498
  542. data/rbi/stripe/services/issuing/dispute_settlement_detail_service.rbi +0 -55
  543. data/rbi/stripe/services/issuing/fraud_liability_debit_service.rbi +0 -73
  544. data/rbi/stripe/services/margin_service.rbi +0 -104
  545. data/rbi/stripe/services/order_line_item_service.rbi +0 -31
  546. data/rbi/stripe/services/order_service.rbi +0 -2320
  547. data/rbi/stripe/services/payment_attempt_record_service.rbi +0 -36
  548. data/rbi/stripe/services/payment_record_service.rbi +0 -521
  549. data/rbi/stripe/services/quote_line_service.rbi +0 -31
  550. data/rbi/stripe/services/quote_preview_invoice_service.rbi +0 -31
  551. data/rbi/stripe/services/quote_preview_subscription_schedule_service.rbi +0 -31
  552. data/rbi/stripe/services/subscription_item_usage_record_service.rbi +0 -37
  553. data/rbi/stripe/services/subscription_item_usage_record_summary_service.rbi +0 -33
  554. data/rbi/stripe/services/tax/association_service.rbi +0 -25
  555. data/rbi/stripe/services/tax/form_service.rbi +0 -85
  556. data/rbi/stripe/services/terminal/reader_collected_data_service.rbi +0 -22
@@ -35,14 +35,6 @@ module Stripe
35
35
  sig { returns(T.nilable(Liability)) }
36
36
  attr_reader :liability
37
37
  end
38
- class BillingThresholds < Stripe::StripeObject
39
- # Monetary threshold that triggers the subscription to create an invoice
40
- sig { returns(T.nilable(Integer)) }
41
- attr_reader :amount_gte
42
- # 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. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
43
- sig { returns(T.nilable(T::Boolean)) }
44
- attr_reader :reset_billing_cycle_anchor
45
- end
46
38
  class InvoiceSettings < Stripe::StripeObject
47
39
  class Issuer < Stripe::StripeObject
48
40
  # The connected account being referenced when `type` is `account`.
@@ -79,9 +71,6 @@ module Stripe
79
71
  # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
80
72
  sig { returns(String) }
81
73
  attr_reader :billing_cycle_anchor
82
- # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
83
- sig { returns(T.nilable(BillingThresholds)) }
84
- attr_reader :billing_thresholds
85
74
  # 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`.
86
75
  sig { returns(T.nilable(String)) }
87
76
  attr_reader :collection_method
@@ -101,45 +90,15 @@ module Stripe
101
90
  sig { returns(T.nilable(TransferData)) }
102
91
  attr_reader :transfer_data
103
92
  end
104
- class LastPriceMigrationError < Stripe::StripeObject
105
- class FailedTransition < Stripe::StripeObject
106
- # The original price to be migrated.
107
- sig { returns(String) }
108
- attr_reader :source_price
109
- # The intended resulting price of the migration.
110
- sig { returns(String) }
111
- attr_reader :target_price
112
- end
113
- # The time at which the price migration encountered an error.
114
- sig { returns(Integer) }
115
- attr_reader :errored_at
116
- # The involved price pairs in each failed transition.
117
- sig { returns(T::Array[FailedTransition]) }
118
- attr_reader :failed_transitions
119
- # The type of error encountered by the price migration.
120
- sig { returns(String) }
121
- attr_reader :type
122
- end
123
93
  class Phase < Stripe::StripeObject
124
94
  class AddInvoiceItem < Stripe::StripeObject
125
95
  class Discount < Stripe::StripeObject
126
- class DiscountEnd < Stripe::StripeObject
127
- # The discount end timestamp.
128
- sig { returns(T.nilable(Integer)) }
129
- attr_reader :timestamp
130
- # The discount end type.
131
- sig { returns(String) }
132
- attr_reader :type
133
- end
134
96
  # ID of the coupon to create a new discount for.
135
97
  sig { returns(T.nilable(T.any(String, Stripe::Coupon))) }
136
98
  attr_reader :coupon
137
99
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
138
100
  sig { returns(T.nilable(T.any(String, Stripe::Discount))) }
139
101
  attr_reader :discount
140
- # Details to determine how long the discount should be applied for.
141
- sig { returns(T.nilable(DiscountEnd)) }
142
- attr_reader :discount_end
143
102
  # ID of the promotion code to create a new discount for.
144
103
  sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) }
145
104
  attr_reader :promotion_code
@@ -176,32 +135,13 @@ module Stripe
176
135
  sig { returns(T.nilable(Liability)) }
177
136
  attr_reader :liability
178
137
  end
179
- class BillingThresholds < Stripe::StripeObject
180
- # Monetary threshold that triggers the subscription to create an invoice
181
- sig { returns(T.nilable(Integer)) }
182
- attr_reader :amount_gte
183
- # 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. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
184
- sig { returns(T.nilable(T::Boolean)) }
185
- attr_reader :reset_billing_cycle_anchor
186
- end
187
138
  class Discount < Stripe::StripeObject
188
- class DiscountEnd < Stripe::StripeObject
189
- # The discount end timestamp.
190
- sig { returns(T.nilable(Integer)) }
191
- attr_reader :timestamp
192
- # The discount end type.
193
- sig { returns(String) }
194
- attr_reader :type
195
- end
196
139
  # ID of the coupon to create a new discount for.
197
140
  sig { returns(T.nilable(T.any(String, Stripe::Coupon))) }
198
141
  attr_reader :coupon
199
142
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
200
143
  sig { returns(T.nilable(T.any(String, Stripe::Discount))) }
201
144
  attr_reader :discount
202
- # Details to determine how long the discount should be applied for.
203
- sig { returns(T.nilable(DiscountEnd)) }
204
- attr_reader :discount_end
205
145
  # ID of the promotion code to create a new discount for.
206
146
  sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) }
207
147
  attr_reader :promotion_code
@@ -226,44 +166,17 @@ module Stripe
226
166
  attr_reader :issuer
227
167
  end
228
168
  class Item < Stripe::StripeObject
229
- class BillingThresholds < Stripe::StripeObject
230
- # Usage threshold that triggers the subscription to create an invoice
231
- sig { returns(T.nilable(Integer)) }
232
- attr_reader :usage_gte
233
- end
234
169
  class Discount < Stripe::StripeObject
235
- class DiscountEnd < Stripe::StripeObject
236
- # The discount end timestamp.
237
- sig { returns(T.nilable(Integer)) }
238
- attr_reader :timestamp
239
- # The discount end type.
240
- sig { returns(String) }
241
- attr_reader :type
242
- end
243
170
  # ID of the coupon to create a new discount for.
244
171
  sig { returns(T.nilable(T.any(String, Stripe::Coupon))) }
245
172
  attr_reader :coupon
246
173
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
247
174
  sig { returns(T.nilable(T.any(String, Stripe::Discount))) }
248
175
  attr_reader :discount
249
- # Details to determine how long the discount should be applied for.
250
- sig { returns(T.nilable(DiscountEnd)) }
251
- attr_reader :discount_end
252
176
  # ID of the promotion code to create a new discount for.
253
177
  sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) }
254
178
  attr_reader :promotion_code
255
179
  end
256
- class Trial < Stripe::StripeObject
257
- # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.
258
- sig { returns(T.nilable(T::Array[String])) }
259
- attr_reader :converts_to
260
- # Determines the type of trial for this item.
261
- sig { returns(String) }
262
- attr_reader :type
263
- end
264
- # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
265
- sig { returns(T.nilable(BillingThresholds)) }
266
- attr_reader :billing_thresholds
267
180
  # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
268
181
  sig { returns(T::Array[Discount]) }
269
182
  attr_reader :discounts
@@ -282,14 +195,6 @@ module Stripe
282
195
  # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`.
283
196
  sig { returns(T.nilable(T::Array[Stripe::TaxRate])) }
284
197
  attr_reader :tax_rates
285
- # Options that configure the trial on the subscription item.
286
- sig { returns(T.nilable(Trial)) }
287
- attr_reader :trial
288
- end
289
- class PauseCollection < Stripe::StripeObject
290
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
291
- sig { returns(String) }
292
- attr_reader :behavior
293
198
  end
294
199
  class TransferData < Stripe::StripeObject
295
200
  # 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.
@@ -299,16 +204,6 @@ module Stripe
299
204
  sig { returns(T.any(String, Stripe::Account)) }
300
205
  attr_reader :destination
301
206
  end
302
- class TrialSettings < Stripe::StripeObject
303
- class EndBehavior < Stripe::StripeObject
304
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
305
- sig { returns(T.nilable(String)) }
306
- attr_reader :prorate_up_front
307
- end
308
- # Defines how the subscription should behave when a trial ends.
309
- sig { returns(T.nilable(EndBehavior)) }
310
- attr_reader :end_behavior
311
- end
312
207
  # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase.
313
208
  sig { returns(T::Array[AddInvoiceItem]) }
314
209
  attr_reader :add_invoice_items
@@ -321,15 +216,9 @@ module Stripe
321
216
  # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
322
217
  sig { returns(T.nilable(String)) }
323
218
  attr_reader :billing_cycle_anchor
324
- # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
325
- sig { returns(T.nilable(BillingThresholds)) }
326
- attr_reader :billing_thresholds
327
219
  # 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`.
328
220
  sig { returns(T.nilable(String)) }
329
221
  attr_reader :collection_method
330
- # ID of the coupon to use during this phase of the subscription schedule.
331
- sig { returns(T.nilable(T.any(String, Stripe::Coupon))) }
332
- attr_reader :coupon
333
222
  # 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).
334
223
  sig { returns(String) }
335
224
  attr_reader :currency
@@ -360,9 +249,6 @@ module Stripe
360
249
  # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
361
250
  sig { returns(T.nilable(T.any(String, Stripe::Account))) }
362
251
  attr_reader :on_behalf_of
363
- # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
364
- sig { returns(T.nilable(PauseCollection)) }
365
- attr_reader :pause_collection
366
252
  # If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`.
367
253
  sig { returns(String) }
368
254
  attr_reader :proration_behavior
@@ -372,36 +258,13 @@ module Stripe
372
258
  # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
373
259
  sig { returns(T.nilable(TransferData)) }
374
260
  attr_reader :transfer_data
375
- # Specify behavior of the trial when crossing schedule phase boundaries
376
- sig { returns(T.nilable(String)) }
377
- attr_reader :trial_continuation
378
261
  # When the trial ends within the phase.
379
262
  sig { returns(T.nilable(Integer)) }
380
263
  attr_reader :trial_end
381
- # Settings related to any trials on the subscription during this phase.
382
- sig { returns(T.nilable(TrialSettings)) }
383
- attr_reader :trial_settings
384
- end
385
- class Prebilling < Stripe::StripeObject
386
- # ID of the prebilling invoice.
387
- sig { returns(T.any(String, Stripe::Invoice)) }
388
- attr_reader :invoice
389
- # The end of the last period for which the invoice pre-bills.
390
- sig { returns(Integer) }
391
- attr_reader :period_end
392
- # The start of the first period for which the invoice pre-bills.
393
- sig { returns(Integer) }
394
- attr_reader :period_start
395
- # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
396
- sig { returns(String) }
397
- attr_reader :update_behavior
398
264
  end
399
265
  # ID of the Connect Application that created the schedule.
400
266
  sig { returns(T.nilable(T.any(String, Stripe::Application))) }
401
267
  attr_reader :application
402
- # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
403
- sig { returns(String) }
404
- attr_reader :billing_behavior
405
268
  # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
406
269
  sig { returns(T.nilable(Integer)) }
407
270
  attr_reader :canceled_at
@@ -426,9 +289,6 @@ module Stripe
426
289
  # Unique identifier for the object.
427
290
  sig { returns(String) }
428
291
  attr_reader :id
429
- # Details of the most recent price migration that failed for the subscription schedule.
430
- sig { returns(T.nilable(LastPriceMigrationError)) }
431
- attr_reader :last_price_migration_error
432
292
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
433
293
  sig { returns(T::Boolean) }
434
294
  attr_reader :livemode
@@ -441,9 +301,6 @@ module Stripe
441
301
  # Configuration for the subscription schedule's phases.
442
302
  sig { returns(T::Array[Phase]) }
443
303
  attr_reader :phases
444
- # Time period and invoice for a Subscription billed in advance.
445
- sig { returns(T.nilable(Prebilling)) }
446
- attr_reader :prebilling
447
304
  # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
448
305
  sig { returns(T.nilable(Integer)) }
449
306
  attr_reader :released_at
@@ -462,100 +319,116 @@ module Stripe
462
319
  class ListParams < Stripe::RequestParams
463
320
  class CanceledAt < Stripe::RequestParams
464
321
  # Minimum value to filter by (exclusive)
465
- sig { returns(Integer) }
322
+ sig { returns(T.nilable(Integer)) }
466
323
  attr_accessor :gt
467
324
  # Minimum value to filter by (inclusive)
468
- sig { returns(Integer) }
325
+ sig { returns(T.nilable(Integer)) }
469
326
  attr_accessor :gte
470
327
  # Maximum value to filter by (exclusive)
471
- sig { returns(Integer) }
328
+ sig { returns(T.nilable(Integer)) }
472
329
  attr_accessor :lt
473
330
  # Maximum value to filter by (inclusive)
474
- sig { returns(Integer) }
331
+ sig { returns(T.nilable(Integer)) }
475
332
  attr_accessor :lte
476
- sig { params(gt: Integer, gte: Integer, lt: Integer, lte: Integer).void }
333
+ sig {
334
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
335
+ }
477
336
  def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
478
337
  end
479
338
  class CompletedAt < Stripe::RequestParams
480
339
  # Minimum value to filter by (exclusive)
481
- sig { returns(Integer) }
340
+ sig { returns(T.nilable(Integer)) }
482
341
  attr_accessor :gt
483
342
  # Minimum value to filter by (inclusive)
484
- sig { returns(Integer) }
343
+ sig { returns(T.nilable(Integer)) }
485
344
  attr_accessor :gte
486
345
  # Maximum value to filter by (exclusive)
487
- sig { returns(Integer) }
346
+ sig { returns(T.nilable(Integer)) }
488
347
  attr_accessor :lt
489
348
  # Maximum value to filter by (inclusive)
490
- sig { returns(Integer) }
349
+ sig { returns(T.nilable(Integer)) }
491
350
  attr_accessor :lte
492
- sig { params(gt: Integer, gte: Integer, lt: Integer, lte: Integer).void }
351
+ sig {
352
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
353
+ }
493
354
  def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
494
355
  end
495
356
  class Created < Stripe::RequestParams
496
357
  # Minimum value to filter by (exclusive)
497
- sig { returns(Integer) }
358
+ sig { returns(T.nilable(Integer)) }
498
359
  attr_accessor :gt
499
360
  # Minimum value to filter by (inclusive)
500
- sig { returns(Integer) }
361
+ sig { returns(T.nilable(Integer)) }
501
362
  attr_accessor :gte
502
363
  # Maximum value to filter by (exclusive)
503
- sig { returns(Integer) }
364
+ sig { returns(T.nilable(Integer)) }
504
365
  attr_accessor :lt
505
366
  # Maximum value to filter by (inclusive)
506
- sig { returns(Integer) }
367
+ sig { returns(T.nilable(Integer)) }
507
368
  attr_accessor :lte
508
- sig { params(gt: Integer, gte: Integer, lt: Integer, lte: Integer).void }
369
+ sig {
370
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
371
+ }
509
372
  def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
510
373
  end
511
374
  class ReleasedAt < Stripe::RequestParams
512
375
  # Minimum value to filter by (exclusive)
513
- sig { returns(Integer) }
376
+ sig { returns(T.nilable(Integer)) }
514
377
  attr_accessor :gt
515
378
  # Minimum value to filter by (inclusive)
516
- sig { returns(Integer) }
379
+ sig { returns(T.nilable(Integer)) }
517
380
  attr_accessor :gte
518
381
  # Maximum value to filter by (exclusive)
519
- sig { returns(Integer) }
382
+ sig { returns(T.nilable(Integer)) }
520
383
  attr_accessor :lt
521
384
  # Maximum value to filter by (inclusive)
522
- sig { returns(Integer) }
385
+ sig { returns(T.nilable(Integer)) }
523
386
  attr_accessor :lte
524
- sig { params(gt: Integer, gte: Integer, lt: Integer, lte: Integer).void }
387
+ sig {
388
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
389
+ }
525
390
  def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
526
391
  end
527
392
  # Only return subscription schedules that were created canceled the given date interval.
528
- sig { returns(T.any(::Stripe::SubscriptionSchedule::ListParams::CanceledAt, Integer)) }
393
+ sig {
394
+ returns(T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::CanceledAt, Integer)))
395
+ }
529
396
  attr_accessor :canceled_at
530
397
  # Only return subscription schedules that completed during the given date interval.
531
- sig { returns(T.any(::Stripe::SubscriptionSchedule::ListParams::CompletedAt, Integer)) }
398
+ sig {
399
+ returns(T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::CompletedAt, Integer)))
400
+ }
532
401
  attr_accessor :completed_at
533
402
  # Only return subscription schedules that were created during the given date interval.
534
- sig { returns(T.any(::Stripe::SubscriptionSchedule::ListParams::Created, Integer)) }
403
+ sig {
404
+ returns(T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::Created, Integer)))
405
+ }
535
406
  attr_accessor :created
536
407
  # Only return subscription schedules for the given customer.
537
- sig { returns(String) }
408
+ sig { returns(T.nilable(String)) }
538
409
  attr_accessor :customer
539
410
  # 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.
540
- sig { returns(String) }
411
+ sig { returns(T.nilable(String)) }
541
412
  attr_accessor :ending_before
542
413
  # Specifies which fields in the response should be expanded.
543
- sig { returns(T::Array[String]) }
414
+ sig { returns(T.nilable(T::Array[String])) }
544
415
  attr_accessor :expand
545
416
  # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
546
- sig { returns(Integer) }
417
+ sig { returns(T.nilable(Integer)) }
547
418
  attr_accessor :limit
548
419
  # Only return subscription schedules that were released during the given date interval.
549
- sig { returns(T.any(::Stripe::SubscriptionSchedule::ListParams::ReleasedAt, Integer)) }
420
+ sig {
421
+ returns(T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::ReleasedAt, Integer)))
422
+ }
550
423
  attr_accessor :released_at
551
424
  # Only return subscription schedules that have not started yet.
552
- sig { returns(T::Boolean) }
425
+ sig { returns(T.nilable(T::Boolean)) }
553
426
  attr_accessor :scheduled
554
427
  # 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.
555
- sig { returns(String) }
428
+ sig { returns(T.nilable(String)) }
556
429
  attr_accessor :starting_after
557
430
  sig {
558
- params(canceled_at: T.any(::Stripe::SubscriptionSchedule::ListParams::CanceledAt, Integer), completed_at: T.any(::Stripe::SubscriptionSchedule::ListParams::CompletedAt, Integer), created: T.any(::Stripe::SubscriptionSchedule::ListParams::Created, Integer), customer: String, ending_before: String, expand: T::Array[String], limit: Integer, released_at: T.any(::Stripe::SubscriptionSchedule::ListParams::ReleasedAt, Integer), scheduled: T::Boolean, starting_after: String).void
431
+ params(canceled_at: T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::CanceledAt, Integer)), completed_at: T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::CompletedAt, Integer)), created: T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::Created, Integer)), customer: T.nilable(String), ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), released_at: T.nilable(T.any(::Stripe::SubscriptionSchedule::ListParams::ReleasedAt, Integer)), scheduled: T.nilable(T::Boolean), starting_after: T.nilable(String)).void
559
432
  }
560
433
  def initialize(
561
434
  canceled_at: nil,
@@ -575,12 +448,12 @@ module Stripe
575
448
  class AutomaticTax < Stripe::RequestParams
576
449
  class Liability < Stripe::RequestParams
577
450
  # The connected account being referenced when `type` is `account`.
578
- sig { returns(String) }
451
+ sig { returns(T.nilable(String)) }
579
452
  attr_accessor :account
580
453
  # Type of the account referenced in the request.
581
454
  sig { returns(String) }
582
455
  attr_accessor :type
583
- sig { params(account: String, type: String).void }
456
+ sig { params(account: T.nilable(String), type: String).void }
584
457
  def initialize(account: nil, type: nil); end
585
458
  end
586
459
  # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
@@ -588,105 +461,91 @@ module Stripe
588
461
  attr_accessor :enabled
589
462
  # 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.
590
463
  sig {
591
- returns(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax::Liability)
464
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax::Liability))
592
465
  }
593
466
  attr_accessor :liability
594
467
  sig {
595
- params(enabled: T::Boolean, liability: ::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax::Liability).void
468
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax::Liability)).void
596
469
  }
597
470
  def initialize(enabled: nil, liability: nil); end
598
471
  end
599
- class BillingThresholds < Stripe::RequestParams
600
- # Monetary threshold that triggers the subscription to advance to a new billing period
601
- sig { returns(Integer) }
602
- attr_accessor :amount_gte
603
- # 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.
604
- sig { returns(T::Boolean) }
605
- attr_accessor :reset_billing_cycle_anchor
606
- sig { params(amount_gte: Integer, reset_billing_cycle_anchor: T::Boolean).void }
607
- def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
608
- end
609
472
  class InvoiceSettings < Stripe::RequestParams
610
473
  class Issuer < Stripe::RequestParams
611
474
  # The connected account being referenced when `type` is `account`.
612
- sig { returns(String) }
475
+ sig { returns(T.nilable(String)) }
613
476
  attr_accessor :account
614
477
  # Type of the account referenced in the request.
615
478
  sig { returns(String) }
616
479
  attr_accessor :type
617
- sig { params(account: String, type: String).void }
480
+ sig { params(account: T.nilable(String), type: String).void }
618
481
  def initialize(account: nil, type: nil); end
619
482
  end
620
483
  # The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule.
621
- sig { returns(T.nilable(T::Array[String])) }
484
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
622
485
  attr_accessor :account_tax_ids
623
486
  # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`.
624
- sig { returns(Integer) }
487
+ sig { returns(T.nilable(Integer)) }
625
488
  attr_accessor :days_until_due
626
489
  # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
627
490
  sig {
628
- returns(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings::Issuer)
491
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings::Issuer))
629
492
  }
630
493
  attr_accessor :issuer
631
494
  sig {
632
- params(account_tax_ids: T.nilable(T::Array[String]), days_until_due: Integer, issuer: ::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings::Issuer).void
495
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), days_until_due: T.nilable(Integer), issuer: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings::Issuer)).void
633
496
  }
634
497
  def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
635
498
  end
636
499
  class TransferData < Stripe::RequestParams
637
500
  # 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.
638
- sig { returns(Float) }
501
+ sig { returns(T.nilable(Float)) }
639
502
  attr_accessor :amount_percent
640
503
  # ID of an existing, connected Stripe account.
641
504
  sig { returns(String) }
642
505
  attr_accessor :destination
643
- sig { params(amount_percent: Float, destination: String).void }
506
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
644
507
  def initialize(amount_percent: nil, destination: nil); end
645
508
  end
646
509
  # 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).
647
- sig { returns(Float) }
510
+ sig { returns(T.nilable(Float)) }
648
511
  attr_accessor :application_fee_percent
649
512
  # Default settings for automatic tax computation.
650
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax) }
513
+ sig {
514
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax))
515
+ }
651
516
  attr_accessor :automatic_tax
652
517
  # 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).
653
- sig { returns(String) }
518
+ sig { returns(T.nilable(String)) }
654
519
  attr_accessor :billing_cycle_anchor
655
- # 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.
656
- sig {
657
- returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::BillingThresholds))
658
- }
659
- attr_accessor :billing_thresholds
660
520
  # 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.
661
- sig { returns(String) }
521
+ sig { returns(T.nilable(String)) }
662
522
  attr_accessor :collection_method
663
523
  # 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.
664
- sig { returns(String) }
524
+ sig { returns(T.nilable(String)) }
665
525
  attr_accessor :default_payment_method
666
526
  # 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.
667
- sig { returns(T.nilable(String)) }
527
+ sig { returns(T.nilable(T.nilable(String))) }
668
528
  attr_accessor :description
669
529
  # All invoices will be billed using the specified settings.
670
530
  sig {
671
- returns(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings)
531
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings))
672
532
  }
673
533
  attr_accessor :invoice_settings
674
534
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
675
- sig { returns(T.nilable(String)) }
535
+ sig { returns(T.nilable(T.nilable(String))) }
676
536
  attr_accessor :on_behalf_of
677
537
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
678
538
  sig {
679
- returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::TransferData))
539
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::TransferData))))
680
540
  }
681
541
  attr_accessor :transfer_data
682
542
  sig {
683
- params(application_fee_percent: Float, automatic_tax: ::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax, billing_cycle_anchor: String, billing_thresholds: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::BillingThresholds), collection_method: String, default_payment_method: String, description: T.nilable(String), invoice_settings: ::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings, on_behalf_of: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::TransferData)).void
543
+ params(application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::AutomaticTax), billing_cycle_anchor: T.nilable(String), collection_method: T.nilable(String), default_payment_method: T.nilable(String), description: T.nilable(T.nilable(String)), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::InvoiceSettings), on_behalf_of: T.nilable(T.nilable(String)), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings::TransferData)))).void
684
544
  }
685
545
  def initialize(
686
546
  application_fee_percent: nil,
687
547
  automatic_tax: nil,
688
548
  billing_cycle_anchor: nil,
689
- billing_thresholds: nil,
690
549
  collection_method: nil,
691
550
  default_payment_method: nil,
692
551
  description: nil,
@@ -698,70 +557,38 @@ module Stripe
698
557
  class Phase < Stripe::RequestParams
699
558
  class AddInvoiceItem < Stripe::RequestParams
700
559
  class Discount < Stripe::RequestParams
701
- class DiscountEnd < Stripe::RequestParams
702
- class Duration < Stripe::RequestParams
703
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
704
- sig { returns(String) }
705
- attr_accessor :interval
706
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
707
- sig { returns(Integer) }
708
- attr_accessor :interval_count
709
- sig { params(interval: String, interval_count: Integer).void }
710
- def initialize(interval: nil, interval_count: nil); end
711
- end
712
- # Time span for the redeemed discount.
713
- sig {
714
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount::DiscountEnd::Duration)
715
- }
716
- attr_accessor :duration
717
- # A precise Unix timestamp for the discount to end. Must be in the future.
718
- sig { returns(Integer) }
719
- attr_accessor :timestamp
720
- # The type of calculation made to determine when the discount ends.
721
- sig { returns(String) }
722
- attr_accessor :type
723
- sig {
724
- params(duration: ::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
725
- }
726
- def initialize(duration: nil, timestamp: nil, type: nil); end
727
- end
728
560
  # ID of the coupon to create a new discount for.
729
- sig { returns(String) }
561
+ sig { returns(T.nilable(String)) }
730
562
  attr_accessor :coupon
731
563
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
732
- sig { returns(String) }
564
+ sig { returns(T.nilable(String)) }
733
565
  attr_accessor :discount
734
- # Details to determine how long the discount should be applied for.
735
- sig {
736
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount::DiscountEnd)
737
- }
738
- attr_accessor :discount_end
739
566
  # ID of the promotion code to create a new discount for.
740
- sig { returns(String) }
567
+ sig { returns(T.nilable(String)) }
741
568
  attr_accessor :promotion_code
742
569
  sig {
743
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount::DiscountEnd, promotion_code: String).void
570
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
744
571
  }
745
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil); end
572
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
746
573
  end
747
574
  class PriceData < Stripe::RequestParams
748
575
  # 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).
749
576
  sig { returns(String) }
750
577
  attr_accessor :currency
751
- # The ID of the product that this price will belong to.
578
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
752
579
  sig { returns(String) }
753
580
  attr_accessor :product
754
581
  # 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.
755
- sig { returns(String) }
582
+ sig { returns(T.nilable(String)) }
756
583
  attr_accessor :tax_behavior
757
584
  # 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.
758
- sig { returns(Integer) }
585
+ sig { returns(T.nilable(Integer)) }
759
586
  attr_accessor :unit_amount
760
587
  # 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.
761
- sig { returns(String) }
588
+ sig { returns(T.nilable(String)) }
762
589
  attr_accessor :unit_amount_decimal
763
590
  sig {
764
- params(currency: String, product: String, tax_behavior: String, unit_amount: Integer, unit_amount_decimal: String).void
591
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
765
592
  }
766
593
  def initialize(
767
594
  currency: nil,
@@ -773,25 +600,25 @@ module Stripe
773
600
  end
774
601
  # The coupons to redeem into discounts for the item.
775
602
  sig {
776
- returns(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount])
603
+ returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount]))
777
604
  }
778
605
  attr_accessor :discounts
779
606
  # The ID of the price object. One of `price` or `price_data` is required.
780
- sig { returns(String) }
607
+ sig { returns(T.nilable(String)) }
781
608
  attr_accessor :price
782
609
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
783
610
  sig {
784
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::PriceData)
611
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::PriceData))
785
612
  }
786
613
  attr_accessor :price_data
787
614
  # Quantity for this item. Defaults to 1.
788
- sig { returns(Integer) }
615
+ sig { returns(T.nilable(Integer)) }
789
616
  attr_accessor :quantity
790
617
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
791
- sig { returns(T.nilable(T::Array[String])) }
618
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
792
619
  attr_accessor :tax_rates
793
620
  sig {
794
- params(discounts: T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount], price: String, price_data: ::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::PriceData, quantity: Integer, tax_rates: T.nilable(T::Array[String])).void
621
+ params(discounts: T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
795
622
  }
796
623
  def initialize(
797
624
  discounts: nil,
@@ -804,12 +631,12 @@ module Stripe
804
631
  class AutomaticTax < Stripe::RequestParams
805
632
  class Liability < Stripe::RequestParams
806
633
  # The connected account being referenced when `type` is `account`.
807
- sig { returns(String) }
634
+ sig { returns(T.nilable(String)) }
808
635
  attr_accessor :account
809
636
  # Type of the account referenced in the request.
810
637
  sig { returns(String) }
811
638
  attr_accessor :type
812
- sig { params(account: String, type: String).void }
639
+ sig { params(account: T.nilable(String), type: String).void }
813
640
  def initialize(account: nil, type: nil); end
814
641
  end
815
642
  # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
@@ -817,152 +644,71 @@ module Stripe
817
644
  attr_accessor :enabled
818
645
  # 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.
819
646
  sig {
820
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax::Liability)
647
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax::Liability))
821
648
  }
822
649
  attr_accessor :liability
823
650
  sig {
824
- params(enabled: T::Boolean, liability: ::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax::Liability).void
651
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax::Liability)).void
825
652
  }
826
653
  def initialize(enabled: nil, liability: nil); end
827
654
  end
828
- class BillingThresholds < Stripe::RequestParams
829
- # Monetary threshold that triggers the subscription to advance to a new billing period
830
- sig { returns(Integer) }
831
- attr_accessor :amount_gte
832
- # 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.
833
- sig { returns(T::Boolean) }
834
- attr_accessor :reset_billing_cycle_anchor
835
- sig { params(amount_gte: Integer, reset_billing_cycle_anchor: T::Boolean).void }
836
- def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
837
- end
838
655
  class Discount < Stripe::RequestParams
839
- class DiscountEnd < Stripe::RequestParams
840
- class Duration < Stripe::RequestParams
841
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
842
- sig { returns(String) }
843
- attr_accessor :interval
844
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
845
- sig { returns(Integer) }
846
- attr_accessor :interval_count
847
- sig { params(interval: String, interval_count: Integer).void }
848
- def initialize(interval: nil, interval_count: nil); end
849
- end
850
- # Time span for the redeemed discount.
851
- sig {
852
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount::DiscountEnd::Duration)
853
- }
854
- attr_accessor :duration
855
- # A precise Unix timestamp for the discount to end. Must be in the future.
856
- sig { returns(Integer) }
857
- attr_accessor :timestamp
858
- # The type of calculation made to determine when the discount ends.
859
- sig { returns(String) }
860
- attr_accessor :type
861
- sig {
862
- params(duration: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
863
- }
864
- def initialize(duration: nil, timestamp: nil, type: nil); end
865
- end
866
656
  # ID of the coupon to create a new discount for.
867
- sig { returns(String) }
657
+ sig { returns(T.nilable(String)) }
868
658
  attr_accessor :coupon
869
659
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
870
- sig { returns(String) }
660
+ sig { returns(T.nilable(String)) }
871
661
  attr_accessor :discount
872
- # Details to determine how long the discount should be applied for.
873
- sig {
874
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount::DiscountEnd)
875
- }
876
- attr_accessor :discount_end
877
662
  # ID of the promotion code to create a new discount for.
878
- sig { returns(String) }
663
+ sig { returns(T.nilable(String)) }
879
664
  attr_accessor :promotion_code
880
665
  sig {
881
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount::DiscountEnd, promotion_code: String).void
666
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
882
667
  }
883
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil); end
668
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
884
669
  end
885
670
  class InvoiceSettings < Stripe::RequestParams
886
671
  class Issuer < Stripe::RequestParams
887
672
  # The connected account being referenced when `type` is `account`.
888
- sig { returns(String) }
673
+ sig { returns(T.nilable(String)) }
889
674
  attr_accessor :account
890
675
  # Type of the account referenced in the request.
891
676
  sig { returns(String) }
892
677
  attr_accessor :type
893
- sig { params(account: String, type: String).void }
678
+ sig { params(account: T.nilable(String), type: String).void }
894
679
  def initialize(account: nil, type: nil); end
895
680
  end
896
681
  # 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.
897
- sig { returns(T.nilable(T::Array[String])) }
682
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
898
683
  attr_accessor :account_tax_ids
899
684
  # 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`.
900
- sig { returns(Integer) }
685
+ sig { returns(T.nilable(Integer)) }
901
686
  attr_accessor :days_until_due
902
687
  # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
903
688
  sig {
904
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings::Issuer)
689
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings::Issuer))
905
690
  }
906
691
  attr_accessor :issuer
907
692
  sig {
908
- params(account_tax_ids: T.nilable(T::Array[String]), days_until_due: Integer, issuer: ::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings::Issuer).void
693
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), days_until_due: T.nilable(Integer), issuer: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings::Issuer)).void
909
694
  }
910
695
  def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
911
696
  end
912
697
  class Item < Stripe::RequestParams
913
- class BillingThresholds < Stripe::RequestParams
914
- # 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))
915
- sig { returns(Integer) }
916
- attr_accessor :usage_gte
917
- sig { params(usage_gte: Integer).void }
918
- def initialize(usage_gte: nil); end
919
- end
920
698
  class Discount < Stripe::RequestParams
921
- class DiscountEnd < Stripe::RequestParams
922
- class Duration < Stripe::RequestParams
923
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
924
- sig { returns(String) }
925
- attr_accessor :interval
926
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
927
- sig { returns(Integer) }
928
- attr_accessor :interval_count
929
- sig { params(interval: String, interval_count: Integer).void }
930
- def initialize(interval: nil, interval_count: nil); end
931
- end
932
- # Time span for the redeemed discount.
933
- sig {
934
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount::DiscountEnd::Duration)
935
- }
936
- attr_accessor :duration
937
- # A precise Unix timestamp for the discount to end. Must be in the future.
938
- sig { returns(Integer) }
939
- attr_accessor :timestamp
940
- # The type of calculation made to determine when the discount ends.
941
- sig { returns(String) }
942
- attr_accessor :type
943
- sig {
944
- params(duration: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
945
- }
946
- def initialize(duration: nil, timestamp: nil, type: nil); end
947
- end
948
699
  # ID of the coupon to create a new discount for.
949
- sig { returns(String) }
700
+ sig { returns(T.nilable(String)) }
950
701
  attr_accessor :coupon
951
702
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
952
- sig { returns(String) }
703
+ sig { returns(T.nilable(String)) }
953
704
  attr_accessor :discount
954
- # Details to determine how long the discount should be applied for.
955
- sig {
956
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount::DiscountEnd)
957
- }
958
- attr_accessor :discount_end
959
705
  # ID of the promotion code to create a new discount for.
960
- sig { returns(String) }
706
+ sig { returns(T.nilable(String)) }
961
707
  attr_accessor :promotion_code
962
708
  sig {
963
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount::DiscountEnd, promotion_code: String).void
709
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
964
710
  }
965
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil); end
711
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
966
712
  end
967
713
  class PriceData < Stripe::RequestParams
968
714
  class Recurring < Stripe::RequestParams
@@ -970,15 +716,15 @@ module Stripe
970
716
  sig { returns(String) }
971
717
  attr_accessor :interval
972
718
  # 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).
973
- sig { returns(Integer) }
719
+ sig { returns(T.nilable(Integer)) }
974
720
  attr_accessor :interval_count
975
- sig { params(interval: String, interval_count: Integer).void }
721
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
976
722
  def initialize(interval: nil, interval_count: nil); end
977
723
  end
978
724
  # 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).
979
725
  sig { returns(String) }
980
726
  attr_accessor :currency
981
- # The ID of the product that this price will belong to.
727
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
982
728
  sig { returns(String) }
983
729
  attr_accessor :product
984
730
  # The recurring components of a price such as `interval` and `interval_count`.
@@ -987,16 +733,16 @@ module Stripe
987
733
  }
988
734
  attr_accessor :recurring
989
735
  # 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.
990
- sig { returns(String) }
736
+ sig { returns(T.nilable(String)) }
991
737
  attr_accessor :tax_behavior
992
738
  # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
993
- sig { returns(Integer) }
739
+ sig { returns(T.nilable(Integer)) }
994
740
  attr_accessor :unit_amount
995
741
  # 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.
996
- sig { returns(String) }
742
+ sig { returns(T.nilable(String)) }
997
743
  attr_accessor :unit_amount_decimal
998
744
  sig {
999
- params(currency: String, product: String, recurring: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::PriceData::Recurring, tax_behavior: String, unit_amount: Integer, unit_amount_decimal: String).void
745
+ params(currency: String, product: String, recurring: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1000
746
  }
1001
747
  def initialize(
1002
748
  currency: nil,
@@ -1007,189 +753,133 @@ module Stripe
1007
753
  unit_amount_decimal: nil
1008
754
  ); end
1009
755
  end
1010
- class Trial < Stripe::RequestParams
1011
- # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
1012
- sig { returns(T::Array[String]) }
1013
- attr_accessor :converts_to
1014
- # Determines the type of trial for this item.
1015
- sig { returns(String) }
1016
- attr_accessor :type
1017
- sig { params(converts_to: T::Array[String], type: String).void }
1018
- def initialize(converts_to: nil, type: nil); end
1019
- end
1020
- # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
1021
- sig {
1022
- returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::BillingThresholds))
1023
- }
1024
- attr_accessor :billing_thresholds
1025
756
  # The coupons to redeem into discounts for the subscription item.
1026
757
  sig {
1027
- returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount]))
758
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount]))))
1028
759
  }
1029
760
  attr_accessor :discounts
1030
761
  # 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`.
1031
- sig { returns(T::Hash[String, String]) }
762
+ sig { returns(T.nilable(T::Hash[String, String])) }
1032
763
  attr_accessor :metadata
1033
764
  # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
1034
- sig { returns(String) }
765
+ sig { returns(T.nilable(String)) }
1035
766
  attr_accessor :plan
1036
767
  # The ID of the price object.
1037
- sig { returns(String) }
768
+ sig { returns(T.nilable(String)) }
1038
769
  attr_accessor :price
1039
770
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1040
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::PriceData) }
771
+ sig {
772
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::PriceData))
773
+ }
1041
774
  attr_accessor :price_data
1042
775
  # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
1043
- sig { returns(Integer) }
776
+ sig { returns(T.nilable(Integer)) }
1044
777
  attr_accessor :quantity
1045
778
  # 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.
1046
- sig { returns(T.nilable(T::Array[String])) }
779
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1047
780
  attr_accessor :tax_rates
1048
- # Options that configure the trial on the subscription item.
1049
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Trial) }
1050
- attr_accessor :trial
1051
781
  sig {
1052
- params(billing_thresholds: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::BillingThresholds), discounts: T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount]), metadata: T::Hash[String, String], plan: String, price: String, price_data: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::PriceData, quantity: Integer, tax_rates: T.nilable(T::Array[String]), trial: ::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Trial).void
782
+ params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1053
783
  }
1054
784
  def initialize(
1055
- billing_thresholds: nil,
1056
785
  discounts: nil,
1057
786
  metadata: nil,
1058
787
  plan: nil,
1059
788
  price: nil,
1060
789
  price_data: nil,
1061
790
  quantity: nil,
1062
- tax_rates: nil,
1063
- trial: nil
791
+ tax_rates: nil
1064
792
  ); end
1065
793
  end
1066
- class PauseCollection < Stripe::RequestParams
1067
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1068
- sig { returns(String) }
1069
- attr_accessor :behavior
1070
- sig { params(behavior: String).void }
1071
- def initialize(behavior: nil); end
1072
- end
1073
794
  class TransferData < Stripe::RequestParams
1074
795
  # 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.
1075
- sig { returns(Float) }
796
+ sig { returns(T.nilable(Float)) }
1076
797
  attr_accessor :amount_percent
1077
798
  # ID of an existing, connected Stripe account.
1078
799
  sig { returns(String) }
1079
800
  attr_accessor :destination
1080
- sig { params(amount_percent: Float, destination: String).void }
801
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
1081
802
  def initialize(amount_percent: nil, destination: nil); end
1082
803
  end
1083
- class TrialSettings < Stripe::RequestParams
1084
- class EndBehavior < Stripe::RequestParams
1085
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1086
- sig { returns(String) }
1087
- attr_accessor :prorate_up_front
1088
- sig { params(prorate_up_front: String).void }
1089
- def initialize(prorate_up_front: nil); end
1090
- end
1091
- # Defines how the subscription should behave when a trial ends.
1092
- sig {
1093
- returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::TrialSettings::EndBehavior)
1094
- }
1095
- attr_accessor :end_behavior
1096
- sig {
1097
- params(end_behavior: ::Stripe::SubscriptionSchedule::CreateParams::Phase::TrialSettings::EndBehavior).void
1098
- }
1099
- def initialize(end_behavior: nil); end
1100
- end
1101
804
  # 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.
1102
805
  sig {
1103
- returns(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem])
806
+ returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem]))
1104
807
  }
1105
808
  attr_accessor :add_invoice_items
1106
809
  # 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).
1107
- sig { returns(Float) }
810
+ sig { returns(T.nilable(Float)) }
1108
811
  attr_accessor :application_fee_percent
1109
812
  # Automatic tax settings for this phase.
1110
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax) }
813
+ sig {
814
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax))
815
+ }
1111
816
  attr_accessor :automatic_tax
1112
817
  # 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).
1113
- sig { returns(String) }
818
+ sig { returns(T.nilable(String)) }
1114
819
  attr_accessor :billing_cycle_anchor
1115
- # 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.
1116
- sig {
1117
- returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::BillingThresholds))
1118
- }
1119
- attr_accessor :billing_thresholds
1120
820
  # 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.
1121
- sig { returns(String) }
821
+ sig { returns(T.nilable(String)) }
1122
822
  attr_accessor :collection_method
1123
- # The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
1124
- sig { returns(String) }
1125
- attr_accessor :coupon
1126
823
  # 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).
1127
- sig { returns(String) }
824
+ sig { returns(T.nilable(String)) }
1128
825
  attr_accessor :currency
1129
826
  # 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.
1130
- sig { returns(String) }
827
+ sig { returns(T.nilable(String)) }
1131
828
  attr_accessor :default_payment_method
1132
829
  # 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.
1133
- sig { returns(T.nilable(T::Array[String])) }
830
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1134
831
  attr_accessor :default_tax_rates
1135
832
  # 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.
1136
- sig { returns(T.nilable(String)) }
833
+ sig { returns(T.nilable(T.nilable(String))) }
1137
834
  attr_accessor :description
1138
835
  # 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.
1139
836
  sig {
1140
- returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount]))
837
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount]))))
1141
838
  }
1142
839
  attr_accessor :discounts
1143
840
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
1144
- sig { returns(Integer) }
841
+ sig { returns(T.nilable(Integer)) }
1145
842
  attr_accessor :end_date
1146
843
  # All invoices will be billed using the specified settings.
1147
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings) }
844
+ sig {
845
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings))
846
+ }
1148
847
  attr_accessor :invoice_settings
1149
848
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
1150
849
  sig { returns(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item]) }
1151
850
  attr_accessor :items
1152
851
  # 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.
1153
- sig { returns(Integer) }
852
+ sig { returns(T.nilable(Integer)) }
1154
853
  attr_accessor :iterations
1155
854
  # 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`.
1156
- sig { returns(T::Hash[String, String]) }
855
+ sig { returns(T.nilable(T::Hash[String, String])) }
1157
856
  attr_accessor :metadata
1158
857
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1159
- sig { returns(String) }
858
+ sig { returns(T.nilable(String)) }
1160
859
  attr_accessor :on_behalf_of
1161
- # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
1162
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::PauseCollection) }
1163
- attr_accessor :pause_collection
1164
860
  # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. 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 of the current phase.
1165
- sig { returns(String) }
861
+ sig { returns(T.nilable(String)) }
1166
862
  attr_accessor :proration_behavior
1167
863
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
1168
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::TransferData) }
864
+ sig {
865
+ returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::TransferData))
866
+ }
1169
867
  attr_accessor :transfer_data
1170
868
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1171
- sig { returns(T::Boolean) }
869
+ sig { returns(T.nilable(T::Boolean)) }
1172
870
  attr_accessor :trial
1173
- # Specify trial behavior when crossing phase boundaries
1174
- sig { returns(String) }
1175
- attr_accessor :trial_continuation
1176
871
  # 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`
1177
- sig { returns(Integer) }
872
+ sig { returns(T.nilable(Integer)) }
1178
873
  attr_accessor :trial_end
1179
- # Settings related to subscription trials.
1180
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Phase::TrialSettings) }
1181
- attr_accessor :trial_settings
1182
874
  sig {
1183
- params(add_invoice_items: T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem], application_fee_percent: Float, automatic_tax: ::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax, billing_cycle_anchor: String, billing_thresholds: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::BillingThresholds), collection_method: String, coupon: String, currency: String, default_payment_method: String, default_tax_rates: T.nilable(T::Array[String]), description: T.nilable(String), discounts: T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount]), end_date: Integer, invoice_settings: ::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings, items: T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item], iterations: Integer, metadata: T::Hash[String, String], on_behalf_of: String, pause_collection: ::Stripe::SubscriptionSchedule::CreateParams::Phase::PauseCollection, proration_behavior: String, transfer_data: ::Stripe::SubscriptionSchedule::CreateParams::Phase::TransferData, trial: T::Boolean, trial_continuation: String, trial_end: Integer, trial_settings: ::Stripe::SubscriptionSchedule::CreateParams::Phase::TrialSettings).void
875
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), 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::SubscriptionSchedule::CreateParams::Phase::Discount]))), end_date: T.nilable(Integer), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(Integer)).void
1184
876
  }
1185
877
  def initialize(
1186
878
  add_invoice_items: nil,
1187
879
  application_fee_percent: nil,
1188
880
  automatic_tax: nil,
1189
881
  billing_cycle_anchor: nil,
1190
- billing_thresholds: nil,
1191
882
  collection_method: nil,
1192
- coupon: nil,
1193
883
  currency: nil,
1194
884
  default_payment_method: nil,
1195
885
  default_tax_rates: nil,
@@ -1201,60 +891,40 @@ module Stripe
1201
891
  iterations: nil,
1202
892
  metadata: nil,
1203
893
  on_behalf_of: nil,
1204
- pause_collection: nil,
1205
894
  proration_behavior: nil,
1206
895
  transfer_data: nil,
1207
896
  trial: nil,
1208
- trial_continuation: nil,
1209
- trial_end: nil,
1210
- trial_settings: nil
897
+ trial_end: nil
1211
898
  ); end
1212
899
  end
1213
- class Prebilling < Stripe::RequestParams
1214
- # This is used to determine the number of billing cycles to prebill.
1215
- sig { returns(Integer) }
1216
- attr_accessor :iterations
1217
- # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1218
- sig { returns(String) }
1219
- attr_accessor :update_behavior
1220
- sig { params(iterations: Integer, update_behavior: String).void }
1221
- def initialize(iterations: nil, update_behavior: nil); end
1222
- end
1223
- # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
1224
- sig { returns(String) }
1225
- attr_accessor :billing_behavior
1226
900
  # The identifier of the customer to create the subscription schedule for.
1227
- sig { returns(String) }
901
+ sig { returns(T.nilable(String)) }
1228
902
  attr_accessor :customer
1229
903
  # Object representing the subscription schedule's default settings.
1230
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings) }
904
+ sig { returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings)) }
1231
905
  attr_accessor :default_settings
1232
906
  # 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.
1233
- sig { returns(String) }
907
+ sig { returns(T.nilable(String)) }
1234
908
  attr_accessor :end_behavior
1235
909
  # Specifies which fields in the response should be expanded.
1236
- sig { returns(T::Array[String]) }
910
+ sig { returns(T.nilable(T::Array[String])) }
1237
911
  attr_accessor :expand
1238
912
  # Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls.
1239
- sig { returns(String) }
913
+ sig { returns(T.nilable(String)) }
1240
914
  attr_accessor :from_subscription
1241
915
  # 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`.
1242
- sig { returns(T.nilable(T::Hash[String, String])) }
916
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1243
917
  attr_accessor :metadata
1244
918
  # 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.
1245
- sig { returns(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase]) }
919
+ sig { returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase])) }
1246
920
  attr_accessor :phases
1247
- # If specified, the invoicing for the given billing cycle iterations will be processed now.
1248
- sig { returns(::Stripe::SubscriptionSchedule::CreateParams::Prebilling) }
1249
- attr_accessor :prebilling
1250
921
  # When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
1251
- sig { returns(T.any(Integer, String)) }
922
+ sig { returns(T.nilable(T.any(Integer, String))) }
1252
923
  attr_accessor :start_date
1253
924
  sig {
1254
- params(billing_behavior: String, customer: String, default_settings: ::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings, end_behavior: String, expand: T::Array[String], from_subscription: String, metadata: T.nilable(T::Hash[String, String]), phases: T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase], prebilling: ::Stripe::SubscriptionSchedule::CreateParams::Prebilling, start_date: T.any(Integer, String)).void
925
+ params(customer: T.nilable(String), default_settings: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::DefaultSettings), end_behavior: T.nilable(String), expand: T.nilable(T::Array[String]), from_subscription: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), phases: T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase]), start_date: T.nilable(T.any(Integer, String))).void
1255
926
  }
1256
927
  def initialize(
1257
- billing_behavior: nil,
1258
928
  customer: nil,
1259
929
  default_settings: nil,
1260
930
  end_behavior: nil,
@@ -1262,28 +932,20 @@ module Stripe
1262
932
  from_subscription: nil,
1263
933
  metadata: nil,
1264
934
  phases: nil,
1265
- prebilling: nil,
1266
935
  start_date: nil
1267
936
  ); end
1268
937
  end
1269
- class RetrieveParams < Stripe::RequestParams
1270
- # Specifies which fields in the response should be expanded.
1271
- sig { returns(T::Array[String]) }
1272
- attr_accessor :expand
1273
- sig { params(expand: T::Array[String]).void }
1274
- def initialize(expand: nil); end
1275
- end
1276
938
  class UpdateParams < Stripe::RequestParams
1277
939
  class DefaultSettings < Stripe::RequestParams
1278
940
  class AutomaticTax < Stripe::RequestParams
1279
941
  class Liability < Stripe::RequestParams
1280
942
  # The connected account being referenced when `type` is `account`.
1281
- sig { returns(String) }
943
+ sig { returns(T.nilable(String)) }
1282
944
  attr_accessor :account
1283
945
  # Type of the account referenced in the request.
1284
946
  sig { returns(String) }
1285
947
  attr_accessor :type
1286
- sig { params(account: String, type: String).void }
948
+ sig { params(account: T.nilable(String), type: String).void }
1287
949
  def initialize(account: nil, type: nil); end
1288
950
  end
1289
951
  # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
@@ -1291,105 +953,91 @@ module Stripe
1291
953
  attr_accessor :enabled
1292
954
  # 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.
1293
955
  sig {
1294
- returns(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax::Liability)
956
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax::Liability))
1295
957
  }
1296
958
  attr_accessor :liability
1297
959
  sig {
1298
- params(enabled: T::Boolean, liability: ::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax::Liability).void
960
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax::Liability)).void
1299
961
  }
1300
962
  def initialize(enabled: nil, liability: nil); end
1301
963
  end
1302
- class BillingThresholds < Stripe::RequestParams
1303
- # Monetary threshold that triggers the subscription to advance to a new billing period
1304
- sig { returns(Integer) }
1305
- attr_accessor :amount_gte
1306
- # 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.
1307
- sig { returns(T::Boolean) }
1308
- attr_accessor :reset_billing_cycle_anchor
1309
- sig { params(amount_gte: Integer, reset_billing_cycle_anchor: T::Boolean).void }
1310
- def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
1311
- end
1312
964
  class InvoiceSettings < Stripe::RequestParams
1313
965
  class Issuer < Stripe::RequestParams
1314
966
  # The connected account being referenced when `type` is `account`.
1315
- sig { returns(String) }
967
+ sig { returns(T.nilable(String)) }
1316
968
  attr_accessor :account
1317
969
  # Type of the account referenced in the request.
1318
970
  sig { returns(String) }
1319
971
  attr_accessor :type
1320
- sig { params(account: String, type: String).void }
972
+ sig { params(account: T.nilable(String), type: String).void }
1321
973
  def initialize(account: nil, type: nil); end
1322
974
  end
1323
975
  # The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule.
1324
- sig { returns(T.nilable(T::Array[String])) }
976
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1325
977
  attr_accessor :account_tax_ids
1326
978
  # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`.
1327
- sig { returns(Integer) }
979
+ sig { returns(T.nilable(Integer)) }
1328
980
  attr_accessor :days_until_due
1329
981
  # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1330
982
  sig {
1331
- returns(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings::Issuer)
983
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings::Issuer))
1332
984
  }
1333
985
  attr_accessor :issuer
1334
986
  sig {
1335
- params(account_tax_ids: T.nilable(T::Array[String]), days_until_due: Integer, issuer: ::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings::Issuer).void
987
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), days_until_due: T.nilable(Integer), issuer: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings::Issuer)).void
1336
988
  }
1337
989
  def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
1338
990
  end
1339
991
  class TransferData < Stripe::RequestParams
1340
992
  # 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.
1341
- sig { returns(Float) }
993
+ sig { returns(T.nilable(Float)) }
1342
994
  attr_accessor :amount_percent
1343
995
  # ID of an existing, connected Stripe account.
1344
996
  sig { returns(String) }
1345
997
  attr_accessor :destination
1346
- sig { params(amount_percent: Float, destination: String).void }
998
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
1347
999
  def initialize(amount_percent: nil, destination: nil); end
1348
1000
  end
1349
1001
  # 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).
1350
- sig { returns(Float) }
1002
+ sig { returns(T.nilable(Float)) }
1351
1003
  attr_accessor :application_fee_percent
1352
1004
  # Default settings for automatic tax computation.
1353
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax) }
1005
+ sig {
1006
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax))
1007
+ }
1354
1008
  attr_accessor :automatic_tax
1355
1009
  # 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).
1356
- sig { returns(String) }
1010
+ sig { returns(T.nilable(String)) }
1357
1011
  attr_accessor :billing_cycle_anchor
1358
- # 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.
1359
- sig {
1360
- returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::BillingThresholds))
1361
- }
1362
- attr_accessor :billing_thresholds
1363
1012
  # 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.
1364
- sig { returns(String) }
1013
+ sig { returns(T.nilable(String)) }
1365
1014
  attr_accessor :collection_method
1366
1015
  # 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.
1367
- sig { returns(String) }
1016
+ sig { returns(T.nilable(String)) }
1368
1017
  attr_accessor :default_payment_method
1369
1018
  # 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.
1370
- sig { returns(T.nilable(String)) }
1019
+ sig { returns(T.nilable(T.nilable(String))) }
1371
1020
  attr_accessor :description
1372
1021
  # All invoices will be billed using the specified settings.
1373
1022
  sig {
1374
- returns(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings)
1023
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings))
1375
1024
  }
1376
1025
  attr_accessor :invoice_settings
1377
1026
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1378
- sig { returns(T.nilable(String)) }
1027
+ sig { returns(T.nilable(T.nilable(String))) }
1379
1028
  attr_accessor :on_behalf_of
1380
1029
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
1381
1030
  sig {
1382
- returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::TransferData))
1031
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::TransferData))))
1383
1032
  }
1384
1033
  attr_accessor :transfer_data
1385
1034
  sig {
1386
- params(application_fee_percent: Float, automatic_tax: ::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax, billing_cycle_anchor: String, billing_thresholds: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::BillingThresholds), collection_method: String, default_payment_method: String, description: T.nilable(String), invoice_settings: ::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings, on_behalf_of: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::TransferData)).void
1035
+ params(application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::AutomaticTax), billing_cycle_anchor: T.nilable(String), collection_method: T.nilable(String), default_payment_method: T.nilable(String), description: T.nilable(T.nilable(String)), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::InvoiceSettings), on_behalf_of: T.nilable(T.nilable(String)), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings::TransferData)))).void
1387
1036
  }
1388
1037
  def initialize(
1389
1038
  application_fee_percent: nil,
1390
1039
  automatic_tax: nil,
1391
1040
  billing_cycle_anchor: nil,
1392
- billing_thresholds: nil,
1393
1041
  collection_method: nil,
1394
1042
  default_payment_method: nil,
1395
1043
  description: nil,
@@ -1401,70 +1049,38 @@ module Stripe
1401
1049
  class Phase < Stripe::RequestParams
1402
1050
  class AddInvoiceItem < Stripe::RequestParams
1403
1051
  class Discount < Stripe::RequestParams
1404
- class DiscountEnd < Stripe::RequestParams
1405
- class Duration < Stripe::RequestParams
1406
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1407
- sig { returns(String) }
1408
- attr_accessor :interval
1409
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1410
- sig { returns(Integer) }
1411
- attr_accessor :interval_count
1412
- sig { params(interval: String, interval_count: Integer).void }
1413
- def initialize(interval: nil, interval_count: nil); end
1414
- end
1415
- # Time span for the redeemed discount.
1416
- sig {
1417
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount::DiscountEnd::Duration)
1418
- }
1419
- attr_accessor :duration
1420
- # A precise Unix timestamp for the discount to end. Must be in the future.
1421
- sig { returns(Integer) }
1422
- attr_accessor :timestamp
1423
- # The type of calculation made to determine when the discount ends.
1424
- sig { returns(String) }
1425
- attr_accessor :type
1426
- sig {
1427
- params(duration: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
1428
- }
1429
- def initialize(duration: nil, timestamp: nil, type: nil); end
1430
- end
1431
1052
  # ID of the coupon to create a new discount for.
1432
- sig { returns(String) }
1053
+ sig { returns(T.nilable(String)) }
1433
1054
  attr_accessor :coupon
1434
1055
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1435
- sig { returns(String) }
1056
+ sig { returns(T.nilable(String)) }
1436
1057
  attr_accessor :discount
1437
- # Details to determine how long the discount should be applied for.
1438
- sig {
1439
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount::DiscountEnd)
1440
- }
1441
- attr_accessor :discount_end
1442
1058
  # ID of the promotion code to create a new discount for.
1443
- sig { returns(String) }
1059
+ sig { returns(T.nilable(String)) }
1444
1060
  attr_accessor :promotion_code
1445
1061
  sig {
1446
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount::DiscountEnd, promotion_code: String).void
1062
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1447
1063
  }
1448
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil); end
1064
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1449
1065
  end
1450
1066
  class PriceData < Stripe::RequestParams
1451
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).
1452
1068
  sig { returns(String) }
1453
1069
  attr_accessor :currency
1454
- # The ID of the product that this price will belong to.
1070
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
1455
1071
  sig { returns(String) }
1456
1072
  attr_accessor :product
1457
1073
  # 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.
1458
- sig { returns(String) }
1074
+ sig { returns(T.nilable(String)) }
1459
1075
  attr_accessor :tax_behavior
1460
1076
  # 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.
1461
- sig { returns(Integer) }
1077
+ sig { returns(T.nilable(Integer)) }
1462
1078
  attr_accessor :unit_amount
1463
1079
  # 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.
1464
- sig { returns(String) }
1080
+ sig { returns(T.nilable(String)) }
1465
1081
  attr_accessor :unit_amount_decimal
1466
1082
  sig {
1467
- params(currency: String, product: String, tax_behavior: String, unit_amount: Integer, unit_amount_decimal: String).void
1083
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1468
1084
  }
1469
1085
  def initialize(
1470
1086
  currency: nil,
@@ -1476,25 +1092,25 @@ module Stripe
1476
1092
  end
1477
1093
  # The coupons to redeem into discounts for the item.
1478
1094
  sig {
1479
- returns(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount])
1095
+ returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount]))
1480
1096
  }
1481
1097
  attr_accessor :discounts
1482
1098
  # The ID of the price object. One of `price` or `price_data` is required.
1483
- sig { returns(String) }
1099
+ sig { returns(T.nilable(String)) }
1484
1100
  attr_accessor :price
1485
1101
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1486
1102
  sig {
1487
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::PriceData)
1103
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::PriceData))
1488
1104
  }
1489
1105
  attr_accessor :price_data
1490
1106
  # Quantity for this item. Defaults to 1.
1491
- sig { returns(Integer) }
1107
+ sig { returns(T.nilable(Integer)) }
1492
1108
  attr_accessor :quantity
1493
1109
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
1494
- sig { returns(T.nilable(T::Array[String])) }
1110
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1495
1111
  attr_accessor :tax_rates
1496
1112
  sig {
1497
- params(discounts: T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount], price: String, price_data: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::PriceData, quantity: Integer, tax_rates: T.nilable(T::Array[String])).void
1113
+ params(discounts: T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1498
1114
  }
1499
1115
  def initialize(
1500
1116
  discounts: nil,
@@ -1507,12 +1123,12 @@ module Stripe
1507
1123
  class AutomaticTax < Stripe::RequestParams
1508
1124
  class Liability < Stripe::RequestParams
1509
1125
  # The connected account being referenced when `type` is `account`.
1510
- sig { returns(String) }
1126
+ sig { returns(T.nilable(String)) }
1511
1127
  attr_accessor :account
1512
1128
  # Type of the account referenced in the request.
1513
1129
  sig { returns(String) }
1514
1130
  attr_accessor :type
1515
- sig { params(account: String, type: String).void }
1131
+ sig { params(account: T.nilable(String), type: String).void }
1516
1132
  def initialize(account: nil, type: nil); end
1517
1133
  end
1518
1134
  # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
@@ -1520,152 +1136,71 @@ module Stripe
1520
1136
  attr_accessor :enabled
1521
1137
  # 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.
1522
1138
  sig {
1523
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax::Liability)
1139
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax::Liability))
1524
1140
  }
1525
1141
  attr_accessor :liability
1526
1142
  sig {
1527
- params(enabled: T::Boolean, liability: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax::Liability).void
1143
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax::Liability)).void
1528
1144
  }
1529
1145
  def initialize(enabled: nil, liability: nil); end
1530
1146
  end
1531
- class BillingThresholds < Stripe::RequestParams
1532
- # Monetary threshold that triggers the subscription to advance to a new billing period
1533
- sig { returns(Integer) }
1534
- attr_accessor :amount_gte
1535
- # 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.
1536
- sig { returns(T::Boolean) }
1537
- attr_accessor :reset_billing_cycle_anchor
1538
- sig { params(amount_gte: Integer, reset_billing_cycle_anchor: T::Boolean).void }
1539
- def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
1540
- end
1541
1147
  class Discount < Stripe::RequestParams
1542
- class DiscountEnd < Stripe::RequestParams
1543
- class Duration < Stripe::RequestParams
1544
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1545
- sig { returns(String) }
1546
- attr_accessor :interval
1547
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1548
- sig { returns(Integer) }
1549
- attr_accessor :interval_count
1550
- sig { params(interval: String, interval_count: Integer).void }
1551
- def initialize(interval: nil, interval_count: nil); end
1552
- end
1553
- # Time span for the redeemed discount.
1554
- sig {
1555
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount::DiscountEnd::Duration)
1556
- }
1557
- attr_accessor :duration
1558
- # A precise Unix timestamp for the discount to end. Must be in the future.
1559
- sig { returns(Integer) }
1560
- attr_accessor :timestamp
1561
- # The type of calculation made to determine when the discount ends.
1562
- sig { returns(String) }
1563
- attr_accessor :type
1564
- sig {
1565
- params(duration: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
1566
- }
1567
- def initialize(duration: nil, timestamp: nil, type: nil); end
1568
- end
1569
1148
  # ID of the coupon to create a new discount for.
1570
- sig { returns(String) }
1149
+ sig { returns(T.nilable(String)) }
1571
1150
  attr_accessor :coupon
1572
1151
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1573
- sig { returns(String) }
1152
+ sig { returns(T.nilable(String)) }
1574
1153
  attr_accessor :discount
1575
- # Details to determine how long the discount should be applied for.
1576
- sig {
1577
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount::DiscountEnd)
1578
- }
1579
- attr_accessor :discount_end
1580
1154
  # ID of the promotion code to create a new discount for.
1581
- sig { returns(String) }
1155
+ sig { returns(T.nilable(String)) }
1582
1156
  attr_accessor :promotion_code
1583
1157
  sig {
1584
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount::DiscountEnd, promotion_code: String).void
1158
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1585
1159
  }
1586
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil); end
1160
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1587
1161
  end
1588
1162
  class InvoiceSettings < Stripe::RequestParams
1589
1163
  class Issuer < Stripe::RequestParams
1590
1164
  # The connected account being referenced when `type` is `account`.
1591
- sig { returns(String) }
1165
+ sig { returns(T.nilable(String)) }
1592
1166
  attr_accessor :account
1593
1167
  # Type of the account referenced in the request.
1594
1168
  sig { returns(String) }
1595
1169
  attr_accessor :type
1596
- sig { params(account: String, type: String).void }
1170
+ sig { params(account: T.nilable(String), type: String).void }
1597
1171
  def initialize(account: nil, type: nil); end
1598
1172
  end
1599
1173
  # 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.
1600
- sig { returns(T.nilable(T::Array[String])) }
1174
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1601
1175
  attr_accessor :account_tax_ids
1602
1176
  # 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`.
1603
- sig { returns(Integer) }
1177
+ sig { returns(T.nilable(Integer)) }
1604
1178
  attr_accessor :days_until_due
1605
1179
  # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1606
1180
  sig {
1607
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings::Issuer)
1181
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings::Issuer))
1608
1182
  }
1609
1183
  attr_accessor :issuer
1610
1184
  sig {
1611
- params(account_tax_ids: T.nilable(T::Array[String]), days_until_due: Integer, issuer: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings::Issuer).void
1185
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), days_until_due: T.nilable(Integer), issuer: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings::Issuer)).void
1612
1186
  }
1613
1187
  def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
1614
1188
  end
1615
1189
  class Item < Stripe::RequestParams
1616
- class BillingThresholds < Stripe::RequestParams
1617
- # 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))
1618
- sig { returns(Integer) }
1619
- attr_accessor :usage_gte
1620
- sig { params(usage_gte: Integer).void }
1621
- def initialize(usage_gte: nil); end
1622
- end
1623
1190
  class Discount < Stripe::RequestParams
1624
- class DiscountEnd < Stripe::RequestParams
1625
- class Duration < Stripe::RequestParams
1626
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1627
- sig { returns(String) }
1628
- attr_accessor :interval
1629
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1630
- sig { returns(Integer) }
1631
- attr_accessor :interval_count
1632
- sig { params(interval: String, interval_count: Integer).void }
1633
- def initialize(interval: nil, interval_count: nil); end
1634
- end
1635
- # Time span for the redeemed discount.
1636
- sig {
1637
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount::DiscountEnd::Duration)
1638
- }
1639
- attr_accessor :duration
1640
- # A precise Unix timestamp for the discount to end. Must be in the future.
1641
- sig { returns(Integer) }
1642
- attr_accessor :timestamp
1643
- # The type of calculation made to determine when the discount ends.
1644
- sig { returns(String) }
1645
- attr_accessor :type
1646
- sig {
1647
- params(duration: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
1648
- }
1649
- def initialize(duration: nil, timestamp: nil, type: nil); end
1650
- end
1651
1191
  # ID of the coupon to create a new discount for.
1652
- sig { returns(String) }
1192
+ sig { returns(T.nilable(String)) }
1653
1193
  attr_accessor :coupon
1654
1194
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1655
- sig { returns(String) }
1195
+ sig { returns(T.nilable(String)) }
1656
1196
  attr_accessor :discount
1657
- # Details to determine how long the discount should be applied for.
1658
- sig {
1659
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount::DiscountEnd)
1660
- }
1661
- attr_accessor :discount_end
1662
1197
  # ID of the promotion code to create a new discount for.
1663
- sig { returns(String) }
1198
+ sig { returns(T.nilable(String)) }
1664
1199
  attr_accessor :promotion_code
1665
1200
  sig {
1666
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount::DiscountEnd, promotion_code: String).void
1201
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1667
1202
  }
1668
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil); end
1203
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1669
1204
  end
1670
1205
  class PriceData < Stripe::RequestParams
1671
1206
  class Recurring < Stripe::RequestParams
@@ -1673,15 +1208,15 @@ module Stripe
1673
1208
  sig { returns(String) }
1674
1209
  attr_accessor :interval
1675
1210
  # 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).
1676
- sig { returns(Integer) }
1211
+ sig { returns(T.nilable(Integer)) }
1677
1212
  attr_accessor :interval_count
1678
- sig { params(interval: String, interval_count: Integer).void }
1213
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1679
1214
  def initialize(interval: nil, interval_count: nil); end
1680
1215
  end
1681
1216
  # 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).
1682
1217
  sig { returns(String) }
1683
1218
  attr_accessor :currency
1684
- # The ID of the product that this price will belong to.
1219
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
1685
1220
  sig { returns(String) }
1686
1221
  attr_accessor :product
1687
1222
  # The recurring components of a price such as `interval` and `interval_count`.
@@ -1690,16 +1225,16 @@ module Stripe
1690
1225
  }
1691
1226
  attr_accessor :recurring
1692
1227
  # 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.
1693
- sig { returns(String) }
1228
+ sig { returns(T.nilable(String)) }
1694
1229
  attr_accessor :tax_behavior
1695
1230
  # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1696
- sig { returns(Integer) }
1231
+ sig { returns(T.nilable(Integer)) }
1697
1232
  attr_accessor :unit_amount
1698
1233
  # 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.
1699
- sig { returns(String) }
1234
+ sig { returns(T.nilable(String)) }
1700
1235
  attr_accessor :unit_amount_decimal
1701
1236
  sig {
1702
- params(currency: String, product: String, recurring: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::PriceData::Recurring, tax_behavior: String, unit_amount: Integer, unit_amount_decimal: String).void
1237
+ params(currency: String, product: String, recurring: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1703
1238
  }
1704
1239
  def initialize(
1705
1240
  currency: nil,
@@ -1710,192 +1245,136 @@ module Stripe
1710
1245
  unit_amount_decimal: nil
1711
1246
  ); end
1712
1247
  end
1713
- class Trial < Stripe::RequestParams
1714
- # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
1715
- sig { returns(T::Array[String]) }
1716
- attr_accessor :converts_to
1717
- # Determines the type of trial for this item.
1718
- sig { returns(String) }
1719
- attr_accessor :type
1720
- sig { params(converts_to: T::Array[String], type: String).void }
1721
- def initialize(converts_to: nil, type: nil); end
1722
- end
1723
- # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
1724
- sig {
1725
- returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::BillingThresholds))
1726
- }
1727
- attr_accessor :billing_thresholds
1728
1248
  # The coupons to redeem into discounts for the subscription item.
1729
1249
  sig {
1730
- returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount]))
1250
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount]))))
1731
1251
  }
1732
1252
  attr_accessor :discounts
1733
1253
  # 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`.
1734
- sig { returns(T::Hash[String, String]) }
1254
+ sig { returns(T.nilable(T::Hash[String, String])) }
1735
1255
  attr_accessor :metadata
1736
1256
  # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
1737
- sig { returns(String) }
1257
+ sig { returns(T.nilable(String)) }
1738
1258
  attr_accessor :plan
1739
1259
  # The ID of the price object.
1740
- sig { returns(String) }
1260
+ sig { returns(T.nilable(String)) }
1741
1261
  attr_accessor :price
1742
1262
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1743
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::PriceData) }
1263
+ sig {
1264
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::PriceData))
1265
+ }
1744
1266
  attr_accessor :price_data
1745
1267
  # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
1746
- sig { returns(Integer) }
1268
+ sig { returns(T.nilable(Integer)) }
1747
1269
  attr_accessor :quantity
1748
1270
  # 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.
1749
- sig { returns(T.nilable(T::Array[String])) }
1271
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1750
1272
  attr_accessor :tax_rates
1751
- # Options that configure the trial on the subscription item.
1752
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Trial) }
1753
- attr_accessor :trial
1754
1273
  sig {
1755
- params(billing_thresholds: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::BillingThresholds), discounts: T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount]), metadata: T::Hash[String, String], plan: String, price: String, price_data: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::PriceData, quantity: Integer, tax_rates: T.nilable(T::Array[String]), trial: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Trial).void
1274
+ params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1756
1275
  }
1757
1276
  def initialize(
1758
- billing_thresholds: nil,
1759
1277
  discounts: nil,
1760
1278
  metadata: nil,
1761
1279
  plan: nil,
1762
1280
  price: nil,
1763
1281
  price_data: nil,
1764
1282
  quantity: nil,
1765
- tax_rates: nil,
1766
- trial: nil
1283
+ tax_rates: nil
1767
1284
  ); end
1768
1285
  end
1769
- class PauseCollection < Stripe::RequestParams
1770
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1771
- sig { returns(String) }
1772
- attr_accessor :behavior
1773
- sig { params(behavior: String).void }
1774
- def initialize(behavior: nil); end
1775
- end
1776
1286
  class TransferData < Stripe::RequestParams
1777
1287
  # 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.
1778
- sig { returns(Float) }
1288
+ sig { returns(T.nilable(Float)) }
1779
1289
  attr_accessor :amount_percent
1780
1290
  # ID of an existing, connected Stripe account.
1781
1291
  sig { returns(String) }
1782
1292
  attr_accessor :destination
1783
- sig { params(amount_percent: Float, destination: String).void }
1293
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
1784
1294
  def initialize(amount_percent: nil, destination: nil); end
1785
1295
  end
1786
- class TrialSettings < Stripe::RequestParams
1787
- class EndBehavior < Stripe::RequestParams
1788
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1789
- sig { returns(String) }
1790
- attr_accessor :prorate_up_front
1791
- sig { params(prorate_up_front: String).void }
1792
- def initialize(prorate_up_front: nil); end
1793
- end
1794
- # Defines how the subscription should behave when a trial ends.
1795
- sig {
1796
- returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::TrialSettings::EndBehavior)
1797
- }
1798
- attr_accessor :end_behavior
1799
- sig {
1800
- params(end_behavior: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::TrialSettings::EndBehavior).void
1801
- }
1802
- def initialize(end_behavior: nil); end
1803
- end
1804
1296
  # 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.
1805
1297
  sig {
1806
- returns(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem])
1298
+ returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem]))
1807
1299
  }
1808
1300
  attr_accessor :add_invoice_items
1809
1301
  # 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).
1810
- sig { returns(Float) }
1302
+ sig { returns(T.nilable(Float)) }
1811
1303
  attr_accessor :application_fee_percent
1812
1304
  # Automatic tax settings for this phase.
1813
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax) }
1305
+ sig {
1306
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax))
1307
+ }
1814
1308
  attr_accessor :automatic_tax
1815
1309
  # 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).
1816
- sig { returns(String) }
1310
+ sig { returns(T.nilable(String)) }
1817
1311
  attr_accessor :billing_cycle_anchor
1818
- # 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.
1819
- sig {
1820
- returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::BillingThresholds))
1821
- }
1822
- attr_accessor :billing_thresholds
1823
1312
  # 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.
1824
- sig { returns(String) }
1313
+ sig { returns(T.nilable(String)) }
1825
1314
  attr_accessor :collection_method
1826
- # The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
1827
- sig { returns(String) }
1828
- attr_accessor :coupon
1829
1315
  # 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).
1830
- sig { returns(String) }
1316
+ sig { returns(T.nilable(String)) }
1831
1317
  attr_accessor :currency
1832
1318
  # 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.
1833
- sig { returns(String) }
1319
+ sig { returns(T.nilable(String)) }
1834
1320
  attr_accessor :default_payment_method
1835
1321
  # 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.
1836
- sig { returns(T.nilable(T::Array[String])) }
1322
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1837
1323
  attr_accessor :default_tax_rates
1838
1324
  # 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.
1839
- sig { returns(T.nilable(String)) }
1325
+ sig { returns(T.nilable(T.nilable(String))) }
1840
1326
  attr_accessor :description
1841
1327
  # 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.
1842
1328
  sig {
1843
- returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount]))
1329
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount]))))
1844
1330
  }
1845
1331
  attr_accessor :discounts
1846
1332
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
1847
- sig { returns(T.any(Integer, String)) }
1333
+ sig { returns(T.nilable(T.any(Integer, String))) }
1848
1334
  attr_accessor :end_date
1849
1335
  # All invoices will be billed using the specified settings.
1850
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings) }
1336
+ sig {
1337
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings))
1338
+ }
1851
1339
  attr_accessor :invoice_settings
1852
1340
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
1853
1341
  sig { returns(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item]) }
1854
1342
  attr_accessor :items
1855
1343
  # 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.
1856
- sig { returns(Integer) }
1344
+ sig { returns(T.nilable(Integer)) }
1857
1345
  attr_accessor :iterations
1858
1346
  # 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`.
1859
- sig { returns(T::Hash[String, String]) }
1347
+ sig { returns(T.nilable(T::Hash[String, String])) }
1860
1348
  attr_accessor :metadata
1861
1349
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1862
- sig { returns(String) }
1350
+ sig { returns(T.nilable(String)) }
1863
1351
  attr_accessor :on_behalf_of
1864
- # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
1865
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::PauseCollection) }
1866
- attr_accessor :pause_collection
1867
1352
  # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. 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 of the current phase.
1868
- sig { returns(String) }
1353
+ sig { returns(T.nilable(String)) }
1869
1354
  attr_accessor :proration_behavior
1870
1355
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
1871
- sig { returns(T.any(Integer, String)) }
1356
+ sig { returns(T.nilable(T.any(Integer, String))) }
1872
1357
  attr_accessor :start_date
1873
1358
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
1874
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::TransferData) }
1359
+ sig {
1360
+ returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::TransferData))
1361
+ }
1875
1362
  attr_accessor :transfer_data
1876
1363
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1877
- sig { returns(T::Boolean) }
1364
+ sig { returns(T.nilable(T::Boolean)) }
1878
1365
  attr_accessor :trial
1879
- # Specify trial behavior when crossing phase boundaries
1880
- sig { returns(String) }
1881
- attr_accessor :trial_continuation
1882
1366
  # 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`
1883
- sig { returns(T.any(Integer, String)) }
1367
+ sig { returns(T.nilable(T.any(Integer, String))) }
1884
1368
  attr_accessor :trial_end
1885
- # Settings related to subscription trials.
1886
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Phase::TrialSettings) }
1887
- attr_accessor :trial_settings
1888
1369
  sig {
1889
- params(add_invoice_items: T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem], application_fee_percent: Float, automatic_tax: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax, billing_cycle_anchor: String, billing_thresholds: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::BillingThresholds), collection_method: String, coupon: String, currency: String, default_payment_method: String, default_tax_rates: T.nilable(T::Array[String]), description: T.nilable(String), discounts: T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount]), end_date: T.any(Integer, String), invoice_settings: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings, items: T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item], iterations: Integer, metadata: T::Hash[String, String], on_behalf_of: String, pause_collection: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::PauseCollection, proration_behavior: String, start_date: T.any(Integer, String), transfer_data: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::TransferData, trial: T::Boolean, trial_continuation: String, trial_end: T.any(Integer, String), trial_settings: ::Stripe::SubscriptionSchedule::UpdateParams::Phase::TrialSettings).void
1370
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), 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::SubscriptionSchedule::UpdateParams::Phase::Discount]))), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionSchedule::UpdateParams::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::SubscriptionSchedule::UpdateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
1890
1371
  }
1891
1372
  def initialize(
1892
1373
  add_invoice_items: nil,
1893
1374
  application_fee_percent: nil,
1894
1375
  automatic_tax: nil,
1895
1376
  billing_cycle_anchor: nil,
1896
- billing_thresholds: nil,
1897
1377
  collection_method: nil,
1898
- coupon: nil,
1899
1378
  currency: nil,
1900
1379
  default_payment_method: nil,
1901
1380
  default_tax_rates: nil,
@@ -1907,707 +1386,70 @@ module Stripe
1907
1386
  iterations: nil,
1908
1387
  metadata: nil,
1909
1388
  on_behalf_of: nil,
1910
- pause_collection: nil,
1911
1389
  proration_behavior: nil,
1912
1390
  start_date: nil,
1913
1391
  transfer_data: nil,
1914
1392
  trial: nil,
1915
- trial_continuation: nil,
1916
- trial_end: nil,
1917
- trial_settings: nil
1393
+ trial_end: nil
1918
1394
  ); end
1919
1395
  end
1920
- class Prebilling < Stripe::RequestParams
1921
- # This is used to determine the number of billing cycles to prebill.
1922
- sig { returns(Integer) }
1923
- attr_accessor :iterations
1924
- # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1925
- sig { returns(String) }
1926
- attr_accessor :update_behavior
1927
- sig { params(iterations: Integer, update_behavior: String).void }
1928
- def initialize(iterations: nil, update_behavior: nil); end
1929
- end
1930
- # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
1931
- sig { returns(String) }
1932
- attr_accessor :billing_behavior
1933
1396
  # Object representing the subscription schedule's default settings.
1934
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings) }
1397
+ sig { returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings)) }
1935
1398
  attr_accessor :default_settings
1936
1399
  # 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.
1937
- sig { returns(String) }
1400
+ sig { returns(T.nilable(String)) }
1938
1401
  attr_accessor :end_behavior
1939
1402
  # Specifies which fields in the response should be expanded.
1940
- sig { returns(T::Array[String]) }
1403
+ sig { returns(T.nilable(T::Array[String])) }
1941
1404
  attr_accessor :expand
1942
1405
  # 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`.
1943
- sig { returns(T.nilable(T::Hash[String, String])) }
1406
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1944
1407
  attr_accessor :metadata
1945
1408
  # 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. Note that past phases can be omitted.
1946
- sig { returns(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase]) }
1409
+ sig { returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase])) }
1947
1410
  attr_accessor :phases
1948
- # If specified, the invoicing for the given billing cycle iterations will be processed now.
1949
- sig { returns(::Stripe::SubscriptionSchedule::UpdateParams::Prebilling) }
1950
- attr_accessor :prebilling
1951
1411
  # If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
1952
- sig { returns(String) }
1412
+ sig { returns(T.nilable(String)) }
1953
1413
  attr_accessor :proration_behavior
1954
1414
  sig {
1955
- params(billing_behavior: String, default_settings: ::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings, end_behavior: String, expand: T::Array[String], metadata: T.nilable(T::Hash[String, String]), phases: T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase], prebilling: ::Stripe::SubscriptionSchedule::UpdateParams::Prebilling, proration_behavior: String).void
1415
+ params(default_settings: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::DefaultSettings), end_behavior: T.nilable(String), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), phases: T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase]), proration_behavior: T.nilable(String)).void
1956
1416
  }
1957
1417
  def initialize(
1958
- billing_behavior: nil,
1959
1418
  default_settings: nil,
1960
1419
  end_behavior: nil,
1961
1420
  expand: nil,
1962
1421
  metadata: nil,
1963
1422
  phases: nil,
1964
- prebilling: nil,
1965
1423
  proration_behavior: nil
1966
1424
  ); end
1967
1425
  end
1968
- class AmendParams < Stripe::RequestParams
1969
- class Amendment < Stripe::RequestParams
1970
- class AmendmentEnd < Stripe::RequestParams
1971
- class DiscountEnd < Stripe::RequestParams
1972
- # The ID of a specific discount.
1973
- sig { returns(String) }
1974
- attr_accessor :discount
1975
- sig { params(discount: String).void }
1976
- def initialize(discount: nil); end
1977
- end
1978
- class Duration < Stripe::RequestParams
1979
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1980
- sig { returns(String) }
1981
- attr_accessor :interval
1982
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1983
- sig { returns(Integer) }
1984
- attr_accessor :interval_count
1985
- sig { params(interval: String, interval_count: Integer).void }
1986
- def initialize(interval: nil, interval_count: nil); end
1987
- end
1988
- # Use the `end` time of a given discount.
1989
- sig {
1990
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentEnd::DiscountEnd)
1991
- }
1992
- attr_accessor :discount_end
1993
- # Time span for the amendment starting from the `amendment_start`.
1994
- sig {
1995
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentEnd::Duration)
1996
- }
1997
- attr_accessor :duration
1998
- # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1999
- sig { returns(Integer) }
2000
- attr_accessor :timestamp
2001
- # Select one of three ways to pass the `amendment_end`.
2002
- sig { returns(String) }
2003
- attr_accessor :type
2004
- sig {
2005
- params(discount_end: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentEnd::DiscountEnd, duration: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentEnd::Duration, timestamp: Integer, type: String).void
2006
- }
2007
- def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil); end
2008
- end
2009
- class AmendmentStart < Stripe::RequestParams
2010
- class AmendmentEnd < Stripe::RequestParams
2011
- # The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
2012
- sig { returns(Integer) }
2013
- attr_accessor :index
2014
- sig { params(index: Integer).void }
2015
- def initialize(index: nil); end
2016
- end
2017
- class DiscountEnd < Stripe::RequestParams
2018
- # The ID of a specific discount.
2019
- sig { returns(String) }
2020
- attr_accessor :discount
2021
- sig { params(discount: String).void }
2022
- def initialize(discount: nil); end
2023
- end
2024
- # Details of another amendment in the same array, immediately after which this amendment should begin.
2025
- sig {
2026
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentStart::AmendmentEnd)
2027
- }
2028
- attr_accessor :amendment_end
2029
- # Use the `end` time of a given discount.
2030
- sig {
2031
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentStart::DiscountEnd)
2032
- }
2033
- attr_accessor :discount_end
2034
- # A precise Unix timestamp for the amendment to start.
2035
- sig { returns(Integer) }
2036
- attr_accessor :timestamp
2037
- # Select one of three ways to pass the `amendment_start`.
2038
- sig { returns(String) }
2039
- attr_accessor :type
2040
- sig {
2041
- params(amendment_end: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentStart::AmendmentEnd, discount_end: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentStart::DiscountEnd, timestamp: Integer, type: String).void
2042
- }
2043
- def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil); end
2044
- end
2045
- class DiscountAction < Stripe::RequestParams
2046
- class Add < Stripe::RequestParams
2047
- class DiscountEnd < Stripe::RequestParams
2048
- # The type of calculation made to determine when the discount ends.
2049
- sig { returns(String) }
2050
- attr_accessor :type
2051
- sig { params(type: String).void }
2052
- def initialize(type: nil); end
2053
- end
2054
- # The coupon code to redeem.
2055
- sig { returns(String) }
2056
- attr_accessor :coupon
2057
- # An ID of an existing discount for a coupon that was already redeemed.
2058
- sig { returns(String) }
2059
- attr_accessor :discount
2060
- # Details to determine how long the discount should be applied for.
2061
- sig {
2062
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Add::DiscountEnd)
2063
- }
2064
- attr_accessor :discount_end
2065
- # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
2066
- sig { returns(Integer) }
2067
- attr_accessor :index
2068
- # The promotion code to redeem.
2069
- sig { returns(String) }
2070
- attr_accessor :promotion_code
2071
- sig {
2072
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Add::DiscountEnd, index: Integer, promotion_code: String).void
2073
- }
2074
- def initialize(
2075
- coupon: nil,
2076
- discount: nil,
2077
- discount_end: nil,
2078
- index: nil,
2079
- promotion_code: nil
2080
- ); end
2081
- end
2082
- class Remove < Stripe::RequestParams
2083
- # The coupon code to remove from the `discounts` array.
2084
- sig { returns(String) }
2085
- attr_accessor :coupon
2086
- # The ID of a discount to remove from the `discounts` array.
2087
- sig { returns(String) }
2088
- attr_accessor :discount
2089
- # The ID of a promotion code to remove from the `discounts` array.
2090
- sig { returns(String) }
2091
- attr_accessor :promotion_code
2092
- sig { params(coupon: String, discount: String, promotion_code: String).void }
2093
- def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2094
- end
2095
- class Set < Stripe::RequestParams
2096
- # The coupon code to replace the `discounts` array with.
2097
- sig { returns(String) }
2098
- attr_accessor :coupon
2099
- # An ID of an existing discount to replace the `discounts` array with.
2100
- sig { returns(String) }
2101
- attr_accessor :discount
2102
- # An ID of an existing promotion code to replace the `discounts` array with.
2103
- sig { returns(String) }
2104
- attr_accessor :promotion_code
2105
- sig { params(coupon: String, discount: String, promotion_code: String).void }
2106
- def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2107
- end
2108
- # Details of the discount to add.
2109
- sig {
2110
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Add)
2111
- }
2112
- attr_accessor :add
2113
- # Details of the discount to remove.
2114
- sig {
2115
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Remove)
2116
- }
2117
- attr_accessor :remove
2118
- # Details of the discount to replace the existing discounts with.
2119
- sig {
2120
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Set)
2121
- }
2122
- attr_accessor :set
2123
- # Determines the type of discount action.
2124
- sig { returns(String) }
2125
- attr_accessor :type
2126
- sig {
2127
- params(add: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Add, remove: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Remove, set: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction::Set, type: String).void
2128
- }
2129
- def initialize(add: nil, remove: nil, set: nil, type: nil); end
2130
- end
2131
- class ItemAction < Stripe::RequestParams
2132
- class Add < Stripe::RequestParams
2133
- class Discount < Stripe::RequestParams
2134
- class DiscountEnd < Stripe::RequestParams
2135
- class Duration < Stripe::RequestParams
2136
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2137
- sig { returns(String) }
2138
- attr_accessor :interval
2139
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2140
- sig { returns(Integer) }
2141
- attr_accessor :interval_count
2142
- sig { params(interval: String, interval_count: Integer).void }
2143
- def initialize(interval: nil, interval_count: nil); end
2144
- end
2145
- # Time span for the redeemed discount.
2146
- sig {
2147
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Discount::DiscountEnd::Duration)
2148
- }
2149
- attr_accessor :duration
2150
- # A precise Unix timestamp for the discount to end. Must be in the future.
2151
- sig { returns(Integer) }
2152
- attr_accessor :timestamp
2153
- # The type of calculation made to determine when the discount ends.
2154
- sig { returns(String) }
2155
- attr_accessor :type
2156
- sig {
2157
- params(duration: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
2158
- }
2159
- def initialize(duration: nil, timestamp: nil, type: nil); end
2160
- end
2161
- # ID of the coupon to create a new discount for.
2162
- sig { returns(String) }
2163
- attr_accessor :coupon
2164
- # ID of an existing discount on the object (or one of its ancestors) to reuse.
2165
- sig { returns(String) }
2166
- attr_accessor :discount
2167
- # Details to determine how long the discount should be applied for.
2168
- sig {
2169
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Discount::DiscountEnd)
2170
- }
2171
- attr_accessor :discount_end
2172
- # ID of the promotion code to create a new discount for.
2173
- sig { returns(String) }
2174
- attr_accessor :promotion_code
2175
- sig {
2176
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Discount::DiscountEnd, promotion_code: String).void
2177
- }
2178
- def initialize(
2179
- coupon: nil,
2180
- discount: nil,
2181
- discount_end: nil,
2182
- promotion_code: nil
2183
- ); end
2184
- end
2185
- class Trial < Stripe::RequestParams
2186
- # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
2187
- sig { returns(T::Array[String]) }
2188
- attr_accessor :converts_to
2189
- # Determines the type of trial for this item.
2190
- sig { returns(String) }
2191
- attr_accessor :type
2192
- sig { params(converts_to: T::Array[String], type: String).void }
2193
- def initialize(converts_to: nil, type: nil); end
2194
- end
2195
- # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2196
- sig {
2197
- returns(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Discount])
2198
- }
2199
- attr_accessor :discounts
2200
- # 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`.
2201
- sig { returns(T::Hash[String, String]) }
2202
- attr_accessor :metadata
2203
- # The ID of the price object.
2204
- sig { returns(String) }
2205
- attr_accessor :price
2206
- # Quantity for this item.
2207
- sig { returns(Integer) }
2208
- attr_accessor :quantity
2209
- # The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
2210
- sig { returns(T::Array[String]) }
2211
- attr_accessor :tax_rates
2212
- # Options that configure the trial on the subscription item.
2213
- sig {
2214
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Trial)
2215
- }
2216
- attr_accessor :trial
2217
- sig {
2218
- params(discounts: T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Discount], metadata: T::Hash[String, String], price: String, quantity: Integer, tax_rates: T::Array[String], trial: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add::Trial).void
2219
- }
2220
- def initialize(
2221
- discounts: nil,
2222
- metadata: nil,
2223
- price: nil,
2224
- quantity: nil,
2225
- tax_rates: nil,
2226
- trial: nil
2227
- ); end
2228
- end
2229
- class Remove < Stripe::RequestParams
2230
- # ID of a price to remove.
2231
- sig { returns(String) }
2232
- attr_accessor :price
2233
- sig { params(price: String).void }
2234
- def initialize(price: nil); end
2235
- end
2236
- class Set < Stripe::RequestParams
2237
- class Discount < Stripe::RequestParams
2238
- class DiscountEnd < Stripe::RequestParams
2239
- class Duration < Stripe::RequestParams
2240
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2241
- sig { returns(String) }
2242
- attr_accessor :interval
2243
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2244
- sig { returns(Integer) }
2245
- attr_accessor :interval_count
2246
- sig { params(interval: String, interval_count: Integer).void }
2247
- def initialize(interval: nil, interval_count: nil); end
2248
- end
2249
- # Time span for the redeemed discount.
2250
- sig {
2251
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Discount::DiscountEnd::Duration)
2252
- }
2253
- attr_accessor :duration
2254
- # A precise Unix timestamp for the discount to end. Must be in the future.
2255
- sig { returns(Integer) }
2256
- attr_accessor :timestamp
2257
- # The type of calculation made to determine when the discount ends.
2258
- sig { returns(String) }
2259
- attr_accessor :type
2260
- sig {
2261
- params(duration: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
2262
- }
2263
- def initialize(duration: nil, timestamp: nil, type: nil); end
2264
- end
2265
- # ID of the coupon to create a new discount for.
2266
- sig { returns(String) }
2267
- attr_accessor :coupon
2268
- # ID of an existing discount on the object (or one of its ancestors) to reuse.
2269
- sig { returns(String) }
2270
- attr_accessor :discount
2271
- # Details to determine how long the discount should be applied for.
2272
- sig {
2273
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Discount::DiscountEnd)
2274
- }
2275
- attr_accessor :discount_end
2276
- # ID of the promotion code to create a new discount for.
2277
- sig { returns(String) }
2278
- attr_accessor :promotion_code
2279
- sig {
2280
- params(coupon: String, discount: String, discount_end: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Discount::DiscountEnd, promotion_code: String).void
2281
- }
2282
- def initialize(
2283
- coupon: nil,
2284
- discount: nil,
2285
- discount_end: nil,
2286
- promotion_code: nil
2287
- ); end
2288
- end
2289
- class Trial < Stripe::RequestParams
2290
- # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
2291
- sig { returns(T::Array[String]) }
2292
- attr_accessor :converts_to
2293
- # Determines the type of trial for this item.
2294
- sig { returns(String) }
2295
- attr_accessor :type
2296
- sig { params(converts_to: T::Array[String], type: String).void }
2297
- def initialize(converts_to: nil, type: nil); end
2298
- end
2299
- # If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
2300
- sig {
2301
- returns(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Discount])
2302
- }
2303
- attr_accessor :discounts
2304
- # If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
2305
- sig { returns(T::Hash[String, String]) }
2306
- attr_accessor :metadata
2307
- # The ID of the price object.
2308
- sig { returns(String) }
2309
- attr_accessor :price
2310
- # If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
2311
- sig { returns(Integer) }
2312
- attr_accessor :quantity
2313
- # If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
2314
- sig { returns(T::Array[String]) }
2315
- attr_accessor :tax_rates
2316
- # If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
2317
- sig {
2318
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Trial)
2319
- }
2320
- attr_accessor :trial
2321
- sig {
2322
- params(discounts: T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Discount], metadata: T::Hash[String, String], price: String, quantity: Integer, tax_rates: T::Array[String], trial: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set::Trial).void
2323
- }
2324
- def initialize(
2325
- discounts: nil,
2326
- metadata: nil,
2327
- price: nil,
2328
- quantity: nil,
2329
- tax_rates: nil,
2330
- trial: nil
2331
- ); end
2332
- end
2333
- # Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
2334
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add) }
2335
- attr_accessor :add
2336
- # Details of the subscription item to remove.
2337
- sig {
2338
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Remove)
2339
- }
2340
- attr_accessor :remove
2341
- # Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
2342
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set) }
2343
- attr_accessor :set
2344
- # Determines the type of item action.
2345
- sig { returns(String) }
2346
- attr_accessor :type
2347
- sig {
2348
- params(add: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Add, remove: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Remove, set: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction::Set, type: String).void
2349
- }
2350
- def initialize(add: nil, remove: nil, set: nil, type: nil); end
2351
- end
2352
- class MetadataAction < Stripe::RequestParams
2353
- # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2354
- sig { returns(T::Hash[String, String]) }
2355
- attr_accessor :add
2356
- # Keys to remove from schedule phase metadata.
2357
- sig { returns(T::Array[String]) }
2358
- attr_accessor :remove
2359
- # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2360
- sig { returns(T.nilable(T::Hash[String, String])) }
2361
- attr_accessor :set
2362
- # Select one of three ways to update phase-level `metadata` on subscription schedules.
2363
- sig { returns(String) }
2364
- attr_accessor :type
2365
- sig {
2366
- params(add: T::Hash[String, String], remove: T::Array[String], set: T.nilable(T::Hash[String, String]), type: String).void
2367
- }
2368
- def initialize(add: nil, remove: nil, set: nil, type: nil); end
2369
- end
2370
- class SetPauseCollection < Stripe::RequestParams
2371
- class Set < Stripe::RequestParams
2372
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2373
- sig { returns(String) }
2374
- attr_accessor :behavior
2375
- sig { params(behavior: String).void }
2376
- def initialize(behavior: nil); end
2377
- end
2378
- # Details of the pause_collection behavior to apply to the amendment.
2379
- sig {
2380
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::SetPauseCollection::Set)
2381
- }
2382
- attr_accessor :set
2383
- # Determines the type of the pause_collection amendment.
2384
- sig { returns(String) }
2385
- attr_accessor :type
2386
- sig {
2387
- params(set: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::SetPauseCollection::Set, type: String).void
2388
- }
2389
- def initialize(set: nil, type: nil); end
2390
- end
2391
- class TrialSettings < Stripe::RequestParams
2392
- class EndBehavior < Stripe::RequestParams
2393
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2394
- sig { returns(String) }
2395
- attr_accessor :prorate_up_front
2396
- sig { params(prorate_up_front: String).void }
2397
- def initialize(prorate_up_front: nil); end
2398
- end
2399
- # Defines how the subscription should behave when a trial ends.
2400
- sig {
2401
- returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::TrialSettings::EndBehavior)
2402
- }
2403
- attr_accessor :end_behavior
2404
- sig {
2405
- params(end_behavior: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::TrialSettings::EndBehavior).void
2406
- }
2407
- def initialize(end_behavior: nil); end
2408
- end
2409
- # Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
2410
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentEnd) }
2411
- attr_accessor :amendment_end
2412
- # Details to identify the earliest timestamp where the proposed change should take effect.
2413
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentStart) }
2414
- attr_accessor :amendment_start
2415
- # For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
2416
- sig { returns(String) }
2417
- attr_accessor :billing_cycle_anchor
2418
- # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2419
- sig {
2420
- returns(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction])
2421
- }
2422
- attr_accessor :discount_actions
2423
- # Changes to the subscription items during the amendment time span.
2424
- sig {
2425
- returns(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction])
2426
- }
2427
- attr_accessor :item_actions
2428
- # Instructions for how to modify phase metadata
2429
- sig {
2430
- returns(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::MetadataAction])
2431
- }
2432
- attr_accessor :metadata_actions
2433
- # Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
2434
- sig { returns(String) }
2435
- attr_accessor :proration_behavior
2436
- # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2437
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::SetPauseCollection) }
2438
- attr_accessor :set_pause_collection
2439
- # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2440
- sig { returns(String) }
2441
- attr_accessor :set_schedule_end
2442
- # Settings related to subscription trials.
2443
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Amendment::TrialSettings) }
2444
- attr_accessor :trial_settings
2445
- sig {
2446
- params(amendment_end: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentEnd, amendment_start: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::AmendmentStart, billing_cycle_anchor: String, discount_actions: T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::DiscountAction], item_actions: T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::ItemAction], metadata_actions: T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment::MetadataAction], proration_behavior: String, set_pause_collection: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::SetPauseCollection, set_schedule_end: String, trial_settings: ::Stripe::SubscriptionSchedule::AmendParams::Amendment::TrialSettings).void
2447
- }
2448
- def initialize(
2449
- amendment_end: nil,
2450
- amendment_start: nil,
2451
- billing_cycle_anchor: nil,
2452
- discount_actions: nil,
2453
- item_actions: nil,
2454
- metadata_actions: nil,
2455
- proration_behavior: nil,
2456
- set_pause_collection: nil,
2457
- set_schedule_end: nil,
2458
- trial_settings: nil
2459
- ); end
2460
- end
2461
- class Prebilling < Stripe::RequestParams
2462
- class BillFrom < Stripe::RequestParams
2463
- class AmendmentStart < Stripe::RequestParams
2464
- # The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments.
2465
- sig { returns(Integer) }
2466
- attr_accessor :index
2467
- sig { params(index: Integer).void }
2468
- def initialize(index: nil); end
2469
- end
2470
- # Start the prebilled period when a specified amendment begins.
2471
- sig {
2472
- returns(::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillFrom::AmendmentStart)
2473
- }
2474
- attr_accessor :amendment_start
2475
- # Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2476
- sig { returns(Integer) }
2477
- attr_accessor :timestamp
2478
- # Select one of several ways to pass the `bill_from` value.
2479
- sig { returns(String) }
2480
- attr_accessor :type
2481
- sig {
2482
- params(amendment_start: ::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillFrom::AmendmentStart, timestamp: Integer, type: String).void
2483
- }
2484
- def initialize(amendment_start: nil, timestamp: nil, type: nil); end
2485
- end
2486
- class BillUntil < Stripe::RequestParams
2487
- class AmendmentEnd < Stripe::RequestParams
2488
- # The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
2489
- sig { returns(Integer) }
2490
- attr_accessor :index
2491
- sig { params(index: Integer).void }
2492
- def initialize(index: nil); end
2493
- end
2494
- class Duration < Stripe::RequestParams
2495
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2496
- sig { returns(String) }
2497
- attr_accessor :interval
2498
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2499
- sig { returns(Integer) }
2500
- attr_accessor :interval_count
2501
- sig { params(interval: String, interval_count: Integer).void }
2502
- def initialize(interval: nil, interval_count: nil); end
2503
- end
2504
- # End the prebilled period when a specified amendment ends.
2505
- sig {
2506
- returns(::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillUntil::AmendmentEnd)
2507
- }
2508
- attr_accessor :amendment_end
2509
- # Time span for prebilling, starting from `bill_from`.
2510
- sig {
2511
- returns(::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillUntil::Duration)
2512
- }
2513
- attr_accessor :duration
2514
- # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2515
- sig { returns(Integer) }
2516
- attr_accessor :timestamp
2517
- # Select one of several ways to pass the `bill_until` value.
2518
- sig { returns(String) }
2519
- attr_accessor :type
2520
- sig {
2521
- params(amendment_end: ::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillUntil::AmendmentEnd, duration: ::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillUntil::Duration, timestamp: Integer, type: String).void
2522
- }
2523
- def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil); end
2524
- end
2525
- # The beginning of the prebilled time period. The default value is `now`.
2526
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillFrom) }
2527
- attr_accessor :bill_from
2528
- # The end of the prebilled time period.
2529
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillUntil) }
2530
- attr_accessor :bill_until
2531
- # When the prebilling invoice should be created. The default value is `now`.
2532
- sig { returns(String) }
2533
- attr_accessor :invoice_at
2534
- # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2535
- sig { returns(String) }
2536
- attr_accessor :update_behavior
2537
- sig {
2538
- params(bill_from: ::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillFrom, bill_until: ::Stripe::SubscriptionSchedule::AmendParams::Prebilling::BillUntil, invoice_at: String, update_behavior: String).void
2539
- }
2540
- def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil); end
2541
- end
2542
- class ScheduleSettings < Stripe::RequestParams
2543
- # Behavior of the subscription schedule and underlying subscription when it ends.
2544
- sig { returns(String) }
2545
- attr_accessor :end_behavior
2546
- sig { params(end_behavior: String).void }
2547
- def initialize(end_behavior: nil); end
2548
- end
2549
- # Changes to apply to the phases of the subscription schedule, in the order provided.
2550
- sig { returns(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment]) }
2551
- attr_accessor :amendments
2552
- # Specifies which fields in the response should be expanded.
2553
- sig { returns(T::Array[String]) }
2554
- attr_accessor :expand
2555
- # Provide any time periods to bill in advance.
2556
- sig { returns(T.nilable(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Prebilling])) }
2557
- attr_accessor :prebilling
2558
- # In cases where the amendment changes the currently active phase,
2559
- # specifies if and how to prorate at the time of the request.
2560
- sig { returns(String) }
2561
- attr_accessor :proration_behavior
2562
- # Changes to apply to the subscription schedule.
2563
- sig { returns(::Stripe::SubscriptionSchedule::AmendParams::ScheduleSettings) }
2564
- attr_accessor :schedule_settings
2565
- sig {
2566
- params(amendments: T::Array[::Stripe::SubscriptionSchedule::AmendParams::Amendment], expand: T::Array[String], prebilling: T.nilable(T::Array[::Stripe::SubscriptionSchedule::AmendParams::Prebilling]), proration_behavior: String, schedule_settings: ::Stripe::SubscriptionSchedule::AmendParams::ScheduleSettings).void
2567
- }
2568
- def initialize(
2569
- amendments: nil,
2570
- expand: nil,
2571
- prebilling: nil,
2572
- proration_behavior: nil,
2573
- schedule_settings: nil
2574
- ); end
2575
- end
2576
1426
  class CancelParams < Stripe::RequestParams
2577
1427
  # Specifies which fields in the response should be expanded.
2578
- sig { returns(T::Array[String]) }
1428
+ sig { returns(T.nilable(T::Array[String])) }
2579
1429
  attr_accessor :expand
2580
1430
  # If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`.
2581
- sig { returns(T::Boolean) }
1431
+ sig { returns(T.nilable(T::Boolean)) }
2582
1432
  attr_accessor :invoice_now
2583
1433
  # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
2584
- sig { returns(T::Boolean) }
1434
+ sig { returns(T.nilable(T::Boolean)) }
2585
1435
  attr_accessor :prorate
2586
- sig { params(expand: T::Array[String], invoice_now: T::Boolean, prorate: T::Boolean).void }
1436
+ sig {
1437
+ params(expand: T.nilable(T::Array[String]), invoice_now: T.nilable(T::Boolean), prorate: T.nilable(T::Boolean)).void
1438
+ }
2587
1439
  def initialize(expand: nil, invoice_now: nil, prorate: nil); end
2588
1440
  end
2589
1441
  class ReleaseParams < Stripe::RequestParams
2590
1442
  # Specifies which fields in the response should be expanded.
2591
- sig { returns(T::Array[String]) }
1443
+ sig { returns(T.nilable(T::Array[String])) }
2592
1444
  attr_accessor :expand
2593
1445
  # Keep any cancellation on the subscription that the schedule has set
2594
- sig { returns(T::Boolean) }
1446
+ sig { returns(T.nilable(T::Boolean)) }
2595
1447
  attr_accessor :preserve_cancel_date
2596
- sig { params(expand: T::Array[String], preserve_cancel_date: T::Boolean).void }
1448
+ sig {
1449
+ params(expand: T.nilable(T::Array[String]), preserve_cancel_date: T.nilable(T::Boolean)).void
1450
+ }
2597
1451
  def initialize(expand: nil, preserve_cancel_date: nil); end
2598
1452
  end
2599
- # Amends an existing subscription schedule.
2600
- sig {
2601
- params(params: T.any(::Stripe::SubscriptionSchedule::AmendParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SubscriptionSchedule)
2602
- }
2603
- def amend(params = {}, opts = {}); end
2604
-
2605
- # Amends an existing subscription schedule.
2606
- sig {
2607
- params(schedule: String, params: T.any(::Stripe::SubscriptionSchedule::AmendParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SubscriptionSchedule)
2608
- }
2609
- def self.amend(schedule, params = {}, opts = {}); end
2610
-
2611
1453
  # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
2612
1454
  sig {
2613
1455
  params(params: T.any(::Stripe::SubscriptionSchedule::CancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SubscriptionSchedule)