stripe 15.3.0 → 15.4.0.pre.beta.1

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 (589) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +1594 -667
  4. data/README.md +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_requestor.rb +28 -0
  7. data/lib/stripe/api_version.rb +1 -2
  8. data/lib/stripe/errors.rb +54 -0
  9. data/lib/stripe/event_types.rb +98 -0
  10. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  11. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  17. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  18. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  19. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  20. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  21. data/lib/stripe/events/v2_core_account_link_completed_event.rb +13 -0
  22. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  23. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  24. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  25. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  26. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  27. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  30. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  32. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  48. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  50. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  52. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  53. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  58. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  59. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  60. data/lib/stripe/events/v2_off_session_payment_requires_capture_event.rb +21 -0
  61. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  62. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +21 -0
  63. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  64. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  65. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  66. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  67. data/lib/stripe/object_types.rb +50 -0
  68. data/lib/stripe/resources/account.rb +653 -1
  69. data/lib/stripe/resources/account_notice.rb +123 -0
  70. data/lib/stripe/resources/account_session.rb +256 -1
  71. data/lib/stripe/resources/balance_settings.rb +105 -0
  72. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  73. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  74. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  75. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  76. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  77. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  78. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  79. data/lib/stripe/resources/card.rb +2 -0
  80. data/lib/stripe/resources/cash_balance.rb +2 -0
  81. data/lib/stripe/resources/charge.rb +1538 -0
  82. data/lib/stripe/resources/checkout/session.rb +326 -2
  83. data/lib/stripe/resources/confirmation_token.rb +170 -0
  84. data/lib/stripe/resources/coupon.rb +30 -1
  85. data/lib/stripe/resources/credit_note.rb +6 -0
  86. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  87. data/lib/stripe/resources/customer.rb +2 -0
  88. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  89. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  90. data/lib/stripe/resources/customer_session.rb +6 -1
  91. data/lib/stripe/resources/discount.rb +2 -0
  92. data/lib/stripe/resources/dispute.rb +2 -0
  93. data/lib/stripe/resources/event.rb +31 -0
  94. data/lib/stripe/resources/financial_connections/account.rb +22 -1
  95. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  96. data/lib/stripe/resources/financial_connections/institution.rb +92 -0
  97. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  98. data/lib/stripe/resources/fx_quote.rb +184 -0
  99. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  100. data/lib/stripe/resources/invoice.rb +1063 -16
  101. data/lib/stripe/resources/invoice_item.rb +78 -2
  102. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  103. data/lib/stripe/resources/invoice_payment.rb +2 -53
  104. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  105. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  106. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  107. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  108. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  109. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  110. data/lib/stripe/resources/line_item.rb +37 -0
  111. data/lib/stripe/resources/mandate.rb +24 -0
  112. data/lib/stripe/resources/margin.rb +115 -0
  113. data/lib/stripe/resources/order.rb +2958 -0
  114. data/lib/stripe/resources/payment_attempt_record.rb +1099 -0
  115. data/lib/stripe/resources/payment_intent.rb +8540 -3584
  116. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
  117. data/lib/stripe/resources/payment_method.rb +192 -1
  118. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  119. data/lib/stripe/resources/payment_record.rb +1628 -0
  120. data/lib/stripe/resources/payout.rb +6 -0
  121. data/lib/stripe/resources/price.rb +30 -0
  122. data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
  123. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
  124. data/lib/stripe/resources/promotion_code.rb +10 -0
  125. data/lib/stripe/resources/quote.rb +2038 -7
  126. data/lib/stripe/resources/quote_line.rb +274 -0
  127. data/lib/stripe/resources/quote_preview_invoice.rb +663 -0
  128. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +371 -0
  129. data/lib/stripe/resources/refund.rb +9 -0
  130. data/lib/stripe/resources/setup_attempt.rb +21 -0
  131. data/lib/stripe/resources/setup_intent.rb +578 -9
  132. data/lib/stripe/resources/source.rb +29 -0
  133. data/lib/stripe/resources/subscription.rb +288 -9
  134. data/lib/stripe/resources/subscription_item.rb +84 -3
  135. data/lib/stripe/resources/subscription_schedule.rb +1007 -10
  136. data/lib/stripe/resources/tax/association.rb +66 -0
  137. data/lib/stripe/resources/tax/form.rb +211 -0
  138. data/lib/stripe/resources/tax_id.rb +12 -2
  139. data/lib/stripe/resources/terminal/reader.rb +8 -0
  140. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  141. data/lib/stripe/resources/transfer.rb +6 -0
  142. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  143. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  144. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  145. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  146. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  147. data/lib/stripe/resources/v2/core/account.rb +1755 -0
  148. data/lib/stripe/resources/v2/core/account_link.rb +56 -0
  149. data/lib/stripe/resources/v2/core/person.rb +276 -0
  150. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  151. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  152. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  153. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  154. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  155. data/lib/stripe/resources/v2/money_management/financial_account.rb +58 -0
  156. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  157. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  158. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  159. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  160. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  161. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  162. data/lib/stripe/resources/v2/money_management/payout_method.rb +75 -0
  163. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  164. data/lib/stripe/resources/v2/money_management/received_credit.rb +122 -0
  165. data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
  166. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  167. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  168. data/lib/stripe/resources/v2/payments/off_session_payment.rb +72 -0
  169. data/lib/stripe/resources.rb +104 -0
  170. data/lib/stripe/services/account_notice_service.rb +101 -0
  171. data/lib/stripe/services/account_service.rb +562 -1
  172. data/lib/stripe/services/account_session_service.rb +226 -1
  173. data/lib/stripe/services/balance_settings_service.rb +96 -0
  174. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  175. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  176. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  177. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  178. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  179. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  180. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  181. data/lib/stripe/services/capital_service.rb +15 -0
  182. data/lib/stripe/services/charge_service.rb +1418 -0
  183. data/lib/stripe/services/checkout/session_service.rb +243 -2
  184. data/lib/stripe/services/coupon_service.rb +17 -1
  185. data/lib/stripe/services/credit_note_service.rb +4 -0
  186. data/lib/stripe/services/customer_session_service.rb +4 -1
  187. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  188. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  189. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  190. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  191. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  192. data/lib/stripe/services/financial_connections_service.rb +2 -1
  193. data/lib/stripe/services/fx_quote_service.rb +123 -0
  194. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  195. data/lib/stripe/services/invoice_item_service.rb +74 -2
  196. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  197. data/lib/stripe/services/invoice_service.rb +1014 -16
  198. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  199. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  200. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  201. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  202. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  203. data/lib/stripe/services/issuing_service.rb +5 -1
  204. data/lib/stripe/services/margin_service.rb +119 -0
  205. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  206. data/lib/stripe/services/order_service.rb +2388 -0
  207. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  208. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  209. data/lib/stripe/services/payment_intent_service.rb +4879 -391
  210. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  211. data/lib/stripe/services/payment_method_service.rb +120 -1
  212. data/lib/stripe/services/payment_record_service.rb +542 -0
  213. data/lib/stripe/services/payout_service.rb +4 -0
  214. data/lib/stripe/services/price_service.rb +19 -0
  215. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  216. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  217. data/lib/stripe/services/privacy_service.rb +13 -0
  218. data/lib/stripe/services/promotion_code_service.rb +8 -0
  219. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  220. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  221. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  222. data/lib/stripe/services/quote_service.rb +1723 -8
  223. data/lib/stripe/services/setup_intent_service.rb +538 -9
  224. data/lib/stripe/services/subscription_item_service.rb +75 -3
  225. data/lib/stripe/services/subscription_schedule_service.rb +911 -10
  226. data/lib/stripe/services/subscription_service.rb +249 -9
  227. data/lib/stripe/services/tax/association_service.rb +31 -0
  228. data/lib/stripe/services/tax/form_service.rb +100 -0
  229. data/lib/stripe/services/tax_id_service.rb +8 -2
  230. data/lib/stripe/services/tax_service.rb +3 -1
  231. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  232. data/lib/stripe/services/terminal_service.rb +2 -1
  233. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  234. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  235. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  236. data/lib/stripe/services/transfer_service.rb +4 -0
  237. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  238. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  239. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  240. data/lib/stripe/services/v1_services.rb +11 -2
  241. data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
  242. data/lib/stripe/services/v2/core/account_service.rb +4170 -0
  243. data/lib/stripe/services/v2/core/accounts/person_service.rb +1045 -0
  244. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +130 -0
  245. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  246. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  247. data/lib/stripe/services/v2/core_service.rb +4 -1
  248. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  249. data/lib/stripe/services/v2/money_management/financial_account_service.rb +43 -0
  250. data/lib/stripe/services/v2/money_management/financial_address_service.rb +82 -0
  251. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  252. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  253. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +199 -0
  254. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  255. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  256. data/lib/stripe/services/v2/money_management/payout_method_service.rb +90 -0
  257. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  258. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  259. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  260. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  261. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  262. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  263. data/lib/stripe/services/v2/payment_service.rb +15 -0
  264. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +137 -0
  265. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  266. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +49 -0
  267. data/lib/stripe/services/v2_services.rb +4 -1
  268. data/lib/stripe/services.rb +53 -1
  269. data/lib/stripe/stripe_configuration.rb +3 -1
  270. data/lib/stripe/stripe_object.rb +1 -1
  271. data/lib/stripe/util.rb +7 -1
  272. data/lib/stripe/version.rb +1 -1
  273. data/lib/stripe.rb +53 -0
  274. data/rbi/stripe.rbi +193855 -0
  275. data/stripe.gemspec +4 -1
  276. metadata +161 -324
  277. data/lib/stripe/services/invoice_payment_service.rb +0 -83
  278. data/rbi/stripe/resources/account.rbi +0 -4995
  279. data/rbi/stripe/resources/account_link.rbi +0 -74
  280. data/rbi/stripe/resources/account_session.rbi +0 -1013
  281. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  282. data/rbi/stripe/resources/application.rbi +0 -20
  283. data/rbi/stripe/resources/application_fee.rbi +0 -118
  284. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  285. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  286. data/rbi/stripe/resources/balance.rbi +0 -235
  287. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  288. data/rbi/stripe/resources/bank_account.rbi +0 -127
  289. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  290. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  291. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  292. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  293. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  294. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  295. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  296. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  297. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  298. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -645
  299. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  300. data/rbi/stripe/resources/capability.rbi +0 -125
  301. data/rbi/stripe/resources/card.rbi +0 -125
  302. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  303. data/rbi/stripe/resources/charge.rbi +0 -2086
  304. data/rbi/stripe/resources/checkout/session.rbi +0 -4060
  305. data/rbi/stripe/resources/climate/order.rbi +0 -245
  306. data/rbi/stripe/resources/climate/product.rbi +0 -75
  307. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  308. data/rbi/stripe/resources/confirmation_token.rbi +0 -1818
  309. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  310. data/rbi/stripe/resources/country_spec.rbi +0 -85
  311. data/rbi/stripe/resources/coupon.rbi +0 -250
  312. data/rbi/stripe/resources/credit_note.rbi +0 -752
  313. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  314. data/rbi/stripe/resources/customer.rbi +0 -1005
  315. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  316. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  317. data/rbi/stripe/resources/customer_session.rbi +0 -200
  318. data/rbi/stripe/resources/discount.rbi +0 -53
  319. data/rbi/stripe/resources/dispute.rbi +0 -761
  320. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  321. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  322. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  323. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  324. data/rbi/stripe/resources/event.rbi +0 -149
  325. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  326. data/rbi/stripe/resources/file.rbi +0 -143
  327. data/rbi/stripe/resources/file_link.rbi +0 -141
  328. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  329. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  330. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  331. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  332. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  333. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  334. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  335. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  336. data/rbi/stripe/resources/identity/verification_session.rbi +0 -564
  337. data/rbi/stripe/resources/invoice.rbi +0 -3842
  338. data/rbi/stripe/resources/invoice_item.rbi +0 -470
  339. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  340. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  341. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  342. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  343. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  344. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  345. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  346. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  347. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  348. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  349. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  350. data/rbi/stripe/resources/line_item.rbi +0 -72
  351. data/rbi/stripe/resources/login_link.rbi +0 -19
  352. data/rbi/stripe/resources/mandate.rbi +0 -191
  353. data/rbi/stripe/resources/payment_intent.rbi +0 -9987
  354. data/rbi/stripe/resources/payment_link.rbi +0 -1801
  355. data/rbi/stripe/resources/payment_method.rbi +0 -1770
  356. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  357. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  358. data/rbi/stripe/resources/payout.rbi +0 -300
  359. data/rbi/stripe/resources/person.rbi +0 -401
  360. data/rbi/stripe/resources/plan.rbi +0 -371
  361. data/rbi/stripe/resources/price.rbi +0 -694
  362. data/rbi/stripe/resources/product.rbi +0 -555
  363. data/rbi/stripe/resources/product_feature.rbi +0 -26
  364. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  365. data/rbi/stripe/resources/quote.rbi +0 -1145
  366. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  367. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  368. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  369. data/rbi/stripe/resources/refund.rbi +0 -523
  370. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  371. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  372. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  373. data/rbi/stripe/resources/reversal.rbi +0 -51
  374. data/rbi/stripe/resources/review.rbi +0 -154
  375. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  376. data/rbi/stripe/resources/setup_intent.rbi +0 -3978
  377. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  378. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  379. data/rbi/stripe/resources/source.rbi +0 -1496
  380. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  381. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  382. data/rbi/stripe/resources/subscription.rbi +0 -2080
  383. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  384. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1645
  385. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  386. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  387. data/rbi/stripe/resources/tax/registration.rbi +0 -2732
  388. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  389. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  390. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  391. data/rbi/stripe/resources/tax_code.rbi +0 -44
  392. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  393. data/rbi/stripe/resources/tax_id.rbi +0 -165
  394. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  395. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1387
  396. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  397. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  398. data/rbi/stripe/resources/terminal/reader.rbi +0 -994
  399. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  400. data/rbi/stripe/resources/token.rbi +0 -1283
  401. data/rbi/stripe/resources/topup.rbi +0 -222
  402. data/rbi/stripe/resources/transfer.rbi +0 -199
  403. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  404. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  405. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -869
  406. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  407. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  408. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  409. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  410. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  411. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  412. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  413. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  414. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  415. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  416. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  417. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  418. data/rbi/stripe/resources/v2/event.rbi +0 -48
  419. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  420. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  421. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  422. data/rbi/stripe/services/account_link_service.rbi +0 -58
  423. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  424. data/rbi/stripe/services/account_person_service.rbi +0 -1011
  425. data/rbi/stripe/services/account_service.rbi +0 -4281
  426. data/rbi/stripe/services/account_session_service.rbi +0 -646
  427. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  428. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  429. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  430. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  431. data/rbi/stripe/services/apps_service.rbi +0 -9
  432. data/rbi/stripe/services/balance_service.rbi +0 -21
  433. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  434. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  435. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  436. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  437. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  438. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  439. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  440. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  441. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  442. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -511
  443. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  444. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  445. data/rbi/stripe/services/billing_service.rbi +0 -15
  446. data/rbi/stripe/services/charge_service.rbi +0 -448
  447. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  448. data/rbi/stripe/services/checkout/session_service.rbi +0 -2670
  449. data/rbi/stripe/services/checkout_service.rbi +0 -9
  450. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  451. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  452. data/rbi/stripe/services/climate_service.rbi +0 -11
  453. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  454. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  455. data/rbi/stripe/services/coupon_service.rbi +0 -194
  456. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  457. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  458. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  459. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  460. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  461. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  462. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  463. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  464. data/rbi/stripe/services/customer_service.rbi +0 -647
  465. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  466. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  467. data/rbi/stripe/services/dispute_service.rbi +0 -424
  468. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  469. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  470. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  471. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  472. data/rbi/stripe/services/event_service.rbi +0 -83
  473. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  474. data/rbi/stripe/services/file_link_service.rbi +0 -124
  475. data/rbi/stripe/services/file_service.rbi +0 -116
  476. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  477. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  478. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  479. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  480. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  481. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  482. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  483. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  484. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -339
  485. data/rbi/stripe/services/identity_service.rbi +0 -10
  486. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  487. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  488. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  489. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  490. data/rbi/stripe/services/invoice_service.rbi +0 -3011
  491. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  492. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  493. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  494. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  495. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  496. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  497. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  498. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  499. data/rbi/stripe/services/issuing_service.rbi +0 -16
  500. data/rbi/stripe/services/mandate_service.rbi +0 -20
  501. data/rbi/stripe/services/payment_intent_service.rbi +0 -7989
  502. data/rbi/stripe/services/payment_link_service.rbi +0 -1352
  503. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  504. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  505. data/rbi/stripe/services/payment_method_service.rbi +0 -781
  506. data/rbi/stripe/services/payout_service.rbi +0 -205
  507. data/rbi/stripe/services/plan_service.rbi +0 -282
  508. data/rbi/stripe/services/price_service.rbi +0 -546
  509. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  510. data/rbi/stripe/services/product_service.rbi +0 -477
  511. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  512. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  513. data/rbi/stripe/services/quote_service.rbi +0 -699
  514. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  515. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  516. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  517. data/rbi/stripe/services/radar_service.rbi +0 -11
  518. data/rbi/stripe/services/refund_service.rbi +0 -185
  519. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  520. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  521. data/rbi/stripe/services/reporting_service.rbi +0 -10
  522. data/rbi/stripe/services/review_service.rbi +0 -84
  523. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  524. data/rbi/stripe/services/setup_intent_service.rbi +0 -3709
  525. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  526. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  527. data/rbi/stripe/services/sigma_service.rbi +0 -9
  528. data/rbi/stripe/services/source_service.rbi +0 -663
  529. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  530. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1301
  531. data/rbi/stripe/services/subscription_service.rbi +0 -1684
  532. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  533. data/rbi/stripe/services/tax/registration_service.rbi +0 -1858
  534. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  535. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  536. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  537. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  538. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  539. data/rbi/stripe/services/tax_service.rbi +0 -12
  540. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1118
  541. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  542. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  543. data/rbi/stripe/services/terminal/reader_service.rbi +0 -540
  544. data/rbi/stripe/services/terminal_service.rbi +0 -12
  545. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -746
  546. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  547. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  548. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  549. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  550. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  551. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  552. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  553. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -93
  554. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  555. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  556. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  557. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  558. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  559. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  560. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  561. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  562. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  563. data/rbi/stripe/services/token_service.rbi +0 -1257
  564. data/rbi/stripe/services/topup_service.rbi +0 -176
  565. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  566. data/rbi/stripe/services/transfer_service.rbi +0 -152
  567. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  568. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  569. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  570. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -566
  571. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  572. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  573. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  574. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  575. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  576. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  577. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  578. data/rbi/stripe/services/treasury_service.rbi +0 -18
  579. data/rbi/stripe/services/v1_services.rbi +0 -77
  580. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  581. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  582. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  583. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  584. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  585. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  586. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  587. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  588. data/rbi/stripe/services/v2_services.rbi +0 -10
  589. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -7,6 +7,7 @@ module Stripe
7
7
  class Quote < APIResource
8
8
  extend Stripe::APIOperations::Create
9
9
  extend Stripe::APIOperations::List
10
+ extend Stripe::APIOperations::NestedResource
10
11
  include Stripe::APIOperations::Save
11
12
 
12
13
  OBJECT_NAME = "quote"
@@ -14,6 +15,9 @@ module Stripe
14
15
  "quote"
15
16
  end
16
17
 
18
+ nested_resource_class_methods :preview_invoice, operations: %i[list]
19
+ nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
20
+
17
21
  class AutomaticTax < Stripe::StripeObject
18
22
  class Liability < Stripe::StripeObject
19
23
  # The connected account being referenced when `type` is `account`.
@@ -32,6 +36,21 @@ module Stripe
32
36
  end
33
37
 
34
38
  class Computed < Stripe::StripeObject
39
+ class LastReestimationDetails < Stripe::StripeObject
40
+ class Failed < Stripe::StripeObject
41
+ # The failure `code` is more granular than the `reason` provided and may correspond to a Stripe error code. For automation errors, this field is one of: `reverse_api_failure`, `reverse_api_deadline_exceeeded`, or `reverse_api_response_validation_error`, which are Stripe error codes and map to the error `message` field.
42
+ attr_reader :failure_code
43
+ # Information derived from the `failure_code` or a freeform message that explains the error as a human-readable English string. For example, "margin ID is not a valid ID".
44
+ attr_reader :message
45
+ # The reason the reestimation failed.
46
+ attr_reader :reason
47
+ end
48
+ # When `status` is `failed`, provides details about the quote reestimation failure.
49
+ attr_reader :failed
50
+ # Latest status of the reestimation.
51
+ attr_reader :status
52
+ end
53
+
35
54
  class Recurring < Stripe::StripeObject
36
55
  class TotalDetails < Stripe::StripeObject
37
56
  class Breakdown < Stripe::StripeObject
@@ -131,8 +150,12 @@ module Stripe
131
150
  # Attribute for field total_details
132
151
  attr_reader :total_details
133
152
  end
153
+ # Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation.
154
+ attr_reader :last_reestimation_details
134
155
  # The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices.
135
156
  attr_reader :recurring
157
+ # The time at which the quote's estimated schedules and upcoming invoices were generated.
158
+ attr_reader :updated_at
136
159
  # Attribute for field upfront
137
160
  attr_reader :upfront
138
161
  end
@@ -157,6 +180,68 @@ module Stripe
157
180
  attr_reader :issuer
158
181
  end
159
182
 
183
+ class StatusDetails < Stripe::StripeObject
184
+ class Canceled < Stripe::StripeObject
185
+ # The reason this quote was marked as canceled.
186
+ attr_reader :reason
187
+ # Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch.
188
+ attr_reader :transitioned_at
189
+ end
190
+
191
+ class Stale < Stripe::StripeObject
192
+ class LastReason < Stripe::StripeObject
193
+ class LinesInvalid < Stripe::StripeObject
194
+ # The timestamp at which the lines were marked as invalid.
195
+ attr_reader :invalid_at
196
+ # The list of lines that became invalid at the given timestamp.
197
+ attr_reader :lines
198
+ end
199
+
200
+ class SubscriptionChanged < Stripe::StripeObject
201
+ # The subscription's state before the quote was marked as stale.
202
+ attr_reader :previous_subscription
203
+ end
204
+
205
+ class SubscriptionScheduleChanged < Stripe::StripeObject
206
+ # The subscription schedule's state before the quote was marked as stale.
207
+ attr_reader :previous_subscription_schedule
208
+ end
209
+ # The ID of the line that is invalid if the stale reason type is `line_invalid`.
210
+ attr_reader :line_invalid
211
+ # The IDs of the lines that are invalid if the stale reason type is `lines_invalid`.
212
+ attr_reader :lines_invalid
213
+ # The user supplied mark stale reason.
214
+ attr_reader :marked_stale
215
+ # The ID of the subscription that was canceled.
216
+ attr_reader :subscription_canceled
217
+ # Attribute for field subscription_changed
218
+ attr_reader :subscription_changed
219
+ # The ID of the subscription that was expired.
220
+ attr_reader :subscription_expired
221
+ # The ID of the subscription schedule that was canceled.
222
+ attr_reader :subscription_schedule_canceled
223
+ # Attribute for field subscription_schedule_changed
224
+ attr_reader :subscription_schedule_changed
225
+ # The ID of the subscription schedule that was released.
226
+ attr_reader :subscription_schedule_released
227
+ # The reason the quote was marked as stale.
228
+ attr_reader :type
229
+ end
230
+ # Time at which the quote expires. Measured in seconds since the Unix epoch.
231
+ attr_reader :expires_at
232
+ # The most recent reason this quote was marked as stale.
233
+ attr_reader :last_reason
234
+ # Time at which the stale reason was updated. Measured in seconds since the Unix epoch.
235
+ attr_reader :last_updated_at
236
+ # Time at which the quote was marked as stale. Measured in seconds since the Unix epoch.
237
+ attr_reader :transitioned_at
238
+ end
239
+ # Attribute for field canceled
240
+ attr_reader :canceled
241
+ # Attribute for field stale
242
+ attr_reader :stale
243
+ end
244
+
160
245
  class StatusTransitions < Stripe::StripeObject
161
246
  # The time that the quote was accepted. Measured in seconds since Unix epoch.
162
247
  attr_reader :accepted_at
@@ -167,22 +252,171 @@ module Stripe
167
252
  end
168
253
 
169
254
  class SubscriptionData < Stripe::StripeObject
255
+ class BillOnAcceptance < Stripe::StripeObject
256
+ class BillFrom < Stripe::StripeObject
257
+ class LineStartsAt < Stripe::StripeObject
258
+ # Unique identifier for the object.
259
+ attr_reader :id
260
+ end
261
+ # The materialized time.
262
+ attr_reader :computed
263
+ # The timestamp the given line starts at.
264
+ attr_reader :line_starts_at
265
+ # A precise Unix timestamp.
266
+ attr_reader :timestamp
267
+ # The type of method to specify the `bill_from` time.
268
+ attr_reader :type
269
+ end
270
+
271
+ class BillUntil < Stripe::StripeObject
272
+ class Duration < Stripe::StripeObject
273
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
274
+ attr_reader :interval
275
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
276
+ attr_reader :interval_count
277
+ end
278
+
279
+ class LineEndsAt < Stripe::StripeObject
280
+ # Unique identifier for the object.
281
+ attr_reader :id
282
+ end
283
+ # The materialized time.
284
+ attr_reader :computed
285
+ # Time span for the quote line starting from the `starts_at` date.
286
+ attr_reader :duration
287
+ # The timestamp the given line ends at.
288
+ attr_reader :line_ends_at
289
+ # A precise Unix timestamp.
290
+ attr_reader :timestamp
291
+ # The type of method to specify the `bill_until` time.
292
+ attr_reader :type
293
+ end
294
+ # The start of the period to bill from when the Quote is accepted.
295
+ attr_reader :bill_from
296
+ # The end of the period to bill until when the Quote is accepted.
297
+ attr_reader :bill_until
298
+ end
299
+
170
300
  class BillingMode < Stripe::StripeObject
171
301
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
172
302
  attr_reader :type
173
303
  end
304
+
305
+ class Prebilling < Stripe::StripeObject
306
+ # Attribute for field iterations
307
+ attr_reader :iterations
308
+ end
309
+ # Describes the period to bill for upon accepting the quote.
310
+ attr_reader :bill_on_acceptance
311
+ # 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.
312
+ attr_reader :billing_behavior
313
+ # Whether the subscription will always start a new billing period when the quote is accepted.
314
+ attr_reader :billing_cycle_anchor
174
315
  # The billing mode of the quote.
175
316
  attr_reader :billing_mode
176
317
  # The subscription's 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.
177
318
  attr_reader :description
178
319
  # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch.
179
320
  attr_reader :effective_date
321
+ # Behavior of the subscription schedule and underlying subscription when it ends.
322
+ attr_reader :end_behavior
323
+ # The id of the subscription that will be updated when the quote is accepted.
324
+ attr_reader :from_subscription
180
325
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
181
326
  attr_reader :metadata
327
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
328
+ attr_reader :prebilling
329
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
330
+ attr_reader :proration_behavior
182
331
  # Integer representing the number of trial period days before the customer is charged for the first time.
183
332
  attr_reader :trial_period_days
184
333
  end
185
334
 
335
+ class SubscriptionDataOverride < Stripe::StripeObject
336
+ class AppliesTo < Stripe::StripeObject
337
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
338
+ attr_reader :new_reference
339
+ # The ID of the schedule the line applies to.
340
+ attr_reader :subscription_schedule
341
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
342
+ attr_reader :type
343
+ end
344
+
345
+ class BillOnAcceptance < Stripe::StripeObject
346
+ class BillFrom < Stripe::StripeObject
347
+ class LineStartsAt < Stripe::StripeObject
348
+ # Unique identifier for the object.
349
+ attr_reader :id
350
+ end
351
+ # The materialized time.
352
+ attr_reader :computed
353
+ # The timestamp the given line starts at.
354
+ attr_reader :line_starts_at
355
+ # A precise Unix timestamp.
356
+ attr_reader :timestamp
357
+ # The type of method to specify the `bill_from` time.
358
+ attr_reader :type
359
+ end
360
+
361
+ class BillUntil < Stripe::StripeObject
362
+ class Duration < Stripe::StripeObject
363
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
364
+ attr_reader :interval
365
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
366
+ attr_reader :interval_count
367
+ end
368
+
369
+ class LineEndsAt < Stripe::StripeObject
370
+ # Unique identifier for the object.
371
+ attr_reader :id
372
+ end
373
+ # The materialized time.
374
+ attr_reader :computed
375
+ # Time span for the quote line starting from the `starts_at` date.
376
+ attr_reader :duration
377
+ # The timestamp the given line ends at.
378
+ attr_reader :line_ends_at
379
+ # A precise Unix timestamp.
380
+ attr_reader :timestamp
381
+ # The type of method to specify the `bill_until` time.
382
+ attr_reader :type
383
+ end
384
+ # The start of the period to bill from when the Quote is accepted.
385
+ attr_reader :bill_from
386
+ # The end of the period to bill until when the Quote is accepted.
387
+ attr_reader :bill_until
388
+ end
389
+ # Attribute for field applies_to
390
+ attr_reader :applies_to
391
+ # Describes the period to bill for upon accepting the quote.
392
+ attr_reader :bill_on_acceptance
393
+ # 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.
394
+ attr_reader :billing_behavior
395
+ # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
396
+ attr_reader :customer
397
+ # The subscription's 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.
398
+ attr_reader :description
399
+ # Behavior of the subscription schedule and underlying subscription when it ends.
400
+ attr_reader :end_behavior
401
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
402
+ attr_reader :proration_behavior
403
+ end
404
+
405
+ class SubscriptionSchedule < Stripe::StripeObject
406
+ class AppliesTo < Stripe::StripeObject
407
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
408
+ attr_reader :new_reference
409
+ # The ID of the schedule the line applies to.
410
+ attr_reader :subscription_schedule
411
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
412
+ attr_reader :type
413
+ end
414
+ # Attribute for field applies_to
415
+ attr_reader :applies_to
416
+ # The subscription schedule that was created or updated from this quote.
417
+ attr_reader :subscription_schedule
418
+ end
419
+
186
420
  class TotalDetails < Stripe::StripeObject
187
421
  class Breakdown < Stripe::StripeObject
188
422
  class Discount < Stripe::StripeObject
@@ -234,10 +468,14 @@ module Stripe
234
468
  class ListParams < Stripe::RequestParams
235
469
  # The ID of the customer whose quotes will be retrieved.
236
470
  attr_accessor :customer
471
+ # The ID of the account whose quotes will be retrieved.
472
+ attr_accessor :customer_account
237
473
  # 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.
238
474
  attr_accessor :ending_before
239
475
  # Specifies which fields in the response should be expanded.
240
476
  attr_accessor :expand
477
+ # The subscription which the quote updates.
478
+ attr_accessor :from_subscription
241
479
  # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
242
480
  attr_accessor :limit
243
481
  # 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.
@@ -249,16 +487,20 @@ module Stripe
249
487
 
250
488
  def initialize(
251
489
  customer: nil,
490
+ customer_account: nil,
252
491
  ending_before: nil,
253
492
  expand: nil,
493
+ from_subscription: nil,
254
494
  limit: nil,
255
495
  starting_after: nil,
256
496
  status: nil,
257
497
  test_clock: nil
258
498
  )
259
499
  @customer = customer
500
+ @customer_account = customer_account
260
501
  @ending_before = ending_before
261
502
  @expand = expand
503
+ @from_subscription = from_subscription
262
504
  @limit = limit
263
505
  @starting_after = starting_after
264
506
  @status = status
@@ -291,16 +533,44 @@ module Stripe
291
533
  end
292
534
 
293
535
  class Discount < Stripe::RequestParams
536
+ class DiscountEnd < Stripe::RequestParams
537
+ class Duration < Stripe::RequestParams
538
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
539
+ attr_accessor :interval
540
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
541
+ attr_accessor :interval_count
542
+
543
+ def initialize(interval: nil, interval_count: nil)
544
+ @interval = interval
545
+ @interval_count = interval_count
546
+ end
547
+ end
548
+ # Time span for the redeemed discount.
549
+ attr_accessor :duration
550
+ # A precise Unix timestamp for the discount to end. Must be in the future.
551
+ attr_accessor :timestamp
552
+ # The type of calculation made to determine when the discount ends.
553
+ attr_accessor :type
554
+
555
+ def initialize(duration: nil, timestamp: nil, type: nil)
556
+ @duration = duration
557
+ @timestamp = timestamp
558
+ @type = type
559
+ end
560
+ end
294
561
  # ID of the coupon to create a new discount for.
295
562
  attr_accessor :coupon
296
563
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
297
564
  attr_accessor :discount
565
+ # Details to determine how long the discount should be applied for.
566
+ attr_accessor :discount_end
298
567
  # ID of the promotion code to create a new discount for.
299
568
  attr_accessor :promotion_code
300
569
 
301
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
570
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
302
571
  @coupon = coupon
303
572
  @discount = discount
573
+ @discount_end = discount_end
304
574
  @promotion_code = promotion_code
305
575
  end
306
576
  end
@@ -340,18 +610,522 @@ module Stripe
340
610
  end
341
611
  end
342
612
 
613
+ class Line < Stripe::RequestParams
614
+ class Action < Stripe::RequestParams
615
+ class AddDiscount < Stripe::RequestParams
616
+ class DiscountEnd < Stripe::RequestParams
617
+ # The type of calculation made to determine when the discount ends.
618
+ attr_accessor :type
619
+
620
+ def initialize(type: nil)
621
+ @type = type
622
+ end
623
+ end
624
+ # The coupon code to redeem.
625
+ attr_accessor :coupon
626
+ # An ID of an existing discount for a coupon that was already redeemed.
627
+ attr_accessor :discount
628
+ # Details to determine how long the discount should be applied for.
629
+ attr_accessor :discount_end
630
+ # 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.
631
+ attr_accessor :index
632
+ # The promotion code to redeem.
633
+ attr_accessor :promotion_code
634
+
635
+ def initialize(
636
+ coupon: nil,
637
+ discount: nil,
638
+ discount_end: nil,
639
+ index: nil,
640
+ promotion_code: nil
641
+ )
642
+ @coupon = coupon
643
+ @discount = discount
644
+ @discount_end = discount_end
645
+ @index = index
646
+ @promotion_code = promotion_code
647
+ end
648
+ end
649
+
650
+ class AddItem < Stripe::RequestParams
651
+ class Discount < Stripe::RequestParams
652
+ class DiscountEnd < Stripe::RequestParams
653
+ class Duration < Stripe::RequestParams
654
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
655
+ attr_accessor :interval
656
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
657
+ attr_accessor :interval_count
658
+
659
+ def initialize(interval: nil, interval_count: nil)
660
+ @interval = interval
661
+ @interval_count = interval_count
662
+ end
663
+ end
664
+ # Time span for the redeemed discount.
665
+ attr_accessor :duration
666
+ # A precise Unix timestamp for the discount to end. Must be in the future.
667
+ attr_accessor :timestamp
668
+ # The type of calculation made to determine when the discount ends.
669
+ attr_accessor :type
670
+
671
+ def initialize(duration: nil, timestamp: nil, type: nil)
672
+ @duration = duration
673
+ @timestamp = timestamp
674
+ @type = type
675
+ end
676
+ end
677
+ # ID of the coupon to create a new discount for.
678
+ attr_accessor :coupon
679
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
680
+ attr_accessor :discount
681
+ # Details to determine how long the discount should be applied for.
682
+ attr_accessor :discount_end
683
+ # ID of the promotion code to create a new discount for.
684
+ attr_accessor :promotion_code
685
+
686
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
687
+ @coupon = coupon
688
+ @discount = discount
689
+ @discount_end = discount_end
690
+ @promotion_code = promotion_code
691
+ end
692
+ end
693
+
694
+ class Trial < Stripe::RequestParams
695
+ # 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.
696
+ attr_accessor :converts_to
697
+ # Determines the type of trial for this item.
698
+ attr_accessor :type
699
+
700
+ def initialize(converts_to: nil, type: nil)
701
+ @converts_to = converts_to
702
+ @type = type
703
+ end
704
+ end
705
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
706
+ attr_accessor :discounts
707
+ # 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`.
708
+ attr_accessor :metadata
709
+ # The ID of the price object.
710
+ attr_accessor :price
711
+ # Quantity for this item.
712
+ attr_accessor :quantity
713
+ # 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`.
714
+ attr_accessor :tax_rates
715
+ # Options that configure the trial on the subscription item.
716
+ attr_accessor :trial
717
+
718
+ def initialize(
719
+ discounts: nil,
720
+ metadata: nil,
721
+ price: nil,
722
+ quantity: nil,
723
+ tax_rates: nil,
724
+ trial: nil
725
+ )
726
+ @discounts = discounts
727
+ @metadata = metadata
728
+ @price = price
729
+ @quantity = quantity
730
+ @tax_rates = tax_rates
731
+ @trial = trial
732
+ end
733
+ end
734
+
735
+ class RemoveDiscount < Stripe::RequestParams
736
+ # The coupon code to remove from the `discounts` array.
737
+ attr_accessor :coupon
738
+ # The ID of a discount to remove from the `discounts` array.
739
+ attr_accessor :discount
740
+ # The ID of a promotion code to remove from the `discounts` array.
741
+ attr_accessor :promotion_code
742
+
743
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
744
+ @coupon = coupon
745
+ @discount = discount
746
+ @promotion_code = promotion_code
747
+ end
748
+ end
749
+
750
+ class RemoveItem < Stripe::RequestParams
751
+ # ID of a price to remove.
752
+ attr_accessor :price
753
+
754
+ def initialize(price: nil)
755
+ @price = price
756
+ end
757
+ end
758
+
759
+ class SetDiscount < Stripe::RequestParams
760
+ # The coupon code to replace the `discounts` array with.
761
+ attr_accessor :coupon
762
+ # An ID of an existing discount to replace the `discounts` array with.
763
+ attr_accessor :discount
764
+ # An ID of an existing promotion code to replace the `discounts` array with.
765
+ attr_accessor :promotion_code
766
+
767
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
768
+ @coupon = coupon
769
+ @discount = discount
770
+ @promotion_code = promotion_code
771
+ end
772
+ end
773
+
774
+ class SetItem < Stripe::RequestParams
775
+ class Discount < Stripe::RequestParams
776
+ class DiscountEnd < Stripe::RequestParams
777
+ class Duration < Stripe::RequestParams
778
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
779
+ attr_accessor :interval
780
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
781
+ attr_accessor :interval_count
782
+
783
+ def initialize(interval: nil, interval_count: nil)
784
+ @interval = interval
785
+ @interval_count = interval_count
786
+ end
787
+ end
788
+ # Time span for the redeemed discount.
789
+ attr_accessor :duration
790
+ # A precise Unix timestamp for the discount to end. Must be in the future.
791
+ attr_accessor :timestamp
792
+ # The type of calculation made to determine when the discount ends.
793
+ attr_accessor :type
794
+
795
+ def initialize(duration: nil, timestamp: nil, type: nil)
796
+ @duration = duration
797
+ @timestamp = timestamp
798
+ @type = type
799
+ end
800
+ end
801
+ # ID of the coupon to create a new discount for.
802
+ attr_accessor :coupon
803
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
804
+ attr_accessor :discount
805
+ # Details to determine how long the discount should be applied for.
806
+ attr_accessor :discount_end
807
+ # ID of the promotion code to create a new discount for.
808
+ attr_accessor :promotion_code
809
+
810
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
811
+ @coupon = coupon
812
+ @discount = discount
813
+ @discount_end = discount_end
814
+ @promotion_code = promotion_code
815
+ end
816
+ end
817
+
818
+ class Trial < Stripe::RequestParams
819
+ # 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.
820
+ attr_accessor :converts_to
821
+ # Determines the type of trial for this item.
822
+ attr_accessor :type
823
+
824
+ def initialize(converts_to: nil, type: nil)
825
+ @converts_to = converts_to
826
+ @type = type
827
+ end
828
+ end
829
+ # 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`.
830
+ attr_accessor :discounts
831
+ # 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`.
832
+ attr_accessor :metadata
833
+ # The ID of the price object.
834
+ attr_accessor :price
835
+ # 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`.
836
+ attr_accessor :quantity
837
+ # 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`.
838
+ attr_accessor :tax_rates
839
+ # 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`.
840
+ attr_accessor :trial
841
+
842
+ def initialize(
843
+ discounts: nil,
844
+ metadata: nil,
845
+ price: nil,
846
+ quantity: nil,
847
+ tax_rates: nil,
848
+ trial: nil
849
+ )
850
+ @discounts = discounts
851
+ @metadata = metadata
852
+ @price = price
853
+ @quantity = quantity
854
+ @tax_rates = tax_rates
855
+ @trial = trial
856
+ end
857
+ end
858
+ # Details for the `add_discount` type.
859
+ attr_accessor :add_discount
860
+ # Details for the `add_item` type.
861
+ attr_accessor :add_item
862
+ # Details for the `add_metadata` type: specify a hash of key-value pairs.
863
+ attr_accessor :add_metadata
864
+ # Details for the `remove_discount` type.
865
+ attr_accessor :remove_discount
866
+ # Details for the `remove_item` type.
867
+ attr_accessor :remove_item
868
+ # Details for the `remove_metadata` type: specify an array of metadata keys.
869
+ attr_accessor :remove_metadata
870
+ # Details for the `set_discounts` type.
871
+ attr_accessor :set_discounts
872
+ # Details for the `set_items` type.
873
+ attr_accessor :set_items
874
+ # Details for the `set_metadata` type: specify an array of key-value pairs.
875
+ attr_accessor :set_metadata
876
+ # The type of action the quote line performs.
877
+ attr_accessor :type
878
+
879
+ def initialize(
880
+ add_discount: nil,
881
+ add_item: nil,
882
+ add_metadata: nil,
883
+ remove_discount: nil,
884
+ remove_item: nil,
885
+ remove_metadata: nil,
886
+ set_discounts: nil,
887
+ set_items: nil,
888
+ set_metadata: nil,
889
+ type: nil
890
+ )
891
+ @add_discount = add_discount
892
+ @add_item = add_item
893
+ @add_metadata = add_metadata
894
+ @remove_discount = remove_discount
895
+ @remove_item = remove_item
896
+ @remove_metadata = remove_metadata
897
+ @set_discounts = set_discounts
898
+ @set_items = set_items
899
+ @set_metadata = set_metadata
900
+ @type = type
901
+ end
902
+ end
903
+
904
+ class AppliesTo < Stripe::RequestParams
905
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
906
+ attr_accessor :new_reference
907
+ # The ID of the schedule the line applies to.
908
+ attr_accessor :subscription_schedule
909
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
910
+ attr_accessor :type
911
+
912
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
913
+ @new_reference = new_reference
914
+ @subscription_schedule = subscription_schedule
915
+ @type = type
916
+ end
917
+ end
918
+
919
+ class CancelSubscriptionSchedule < Stripe::RequestParams
920
+ # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
921
+ attr_accessor :cancel_at
922
+ # 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. Boolean that defaults to `true`.
923
+ attr_accessor :invoice_now
924
+ # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
925
+ attr_accessor :prorate
926
+
927
+ def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
928
+ @cancel_at = cancel_at
929
+ @invoice_now = invoice_now
930
+ @prorate = prorate
931
+ end
932
+ end
933
+
934
+ class EndsAt < Stripe::RequestParams
935
+ class DiscountEnd < Stripe::RequestParams
936
+ # The ID of a specific discount.
937
+ attr_accessor :discount
938
+
939
+ def initialize(discount: nil)
940
+ @discount = discount
941
+ end
942
+ end
943
+
944
+ class Duration < Stripe::RequestParams
945
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
946
+ attr_accessor :interval
947
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
948
+ attr_accessor :interval_count
949
+
950
+ def initialize(interval: nil, interval_count: nil)
951
+ @interval = interval
952
+ @interval_count = interval_count
953
+ end
954
+ end
955
+ # Use the `end` time of a given discount.
956
+ attr_accessor :discount_end
957
+ # Time span for the quote line starting from the `starts_at` date.
958
+ attr_accessor :duration
959
+ # A precise Unix timestamp.
960
+ attr_accessor :timestamp
961
+ # Select a way to pass in `ends_at`.
962
+ attr_accessor :type
963
+
964
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
965
+ @discount_end = discount_end
966
+ @duration = duration
967
+ @timestamp = timestamp
968
+ @type = type
969
+ end
970
+ end
971
+
972
+ class SetPauseCollection < Stripe::RequestParams
973
+ class Set < Stripe::RequestParams
974
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
975
+ attr_accessor :behavior
976
+
977
+ def initialize(behavior: nil)
978
+ @behavior = behavior
979
+ end
980
+ end
981
+ # Details of the pause_collection behavior to apply to the amendment.
982
+ attr_accessor :set
983
+ # Determines the type of the pause_collection amendment.
984
+ attr_accessor :type
985
+
986
+ def initialize(set: nil, type: nil)
987
+ @set = set
988
+ @type = type
989
+ end
990
+ end
991
+
992
+ class StartsAt < Stripe::RequestParams
993
+ class DiscountEnd < Stripe::RequestParams
994
+ # The ID of a specific discount.
995
+ attr_accessor :discount
996
+
997
+ def initialize(discount: nil)
998
+ @discount = discount
999
+ end
1000
+ end
1001
+
1002
+ class LineEndsAt < Stripe::RequestParams
1003
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1004
+ attr_accessor :index
1005
+
1006
+ def initialize(index: nil)
1007
+ @index = index
1008
+ end
1009
+ end
1010
+ # Use the `end` time of a given discount.
1011
+ attr_accessor :discount_end
1012
+ # The timestamp the given line ends at.
1013
+ attr_accessor :line_ends_at
1014
+ # A precise Unix timestamp.
1015
+ attr_accessor :timestamp
1016
+ # Select a way to pass in `starts_at`.
1017
+ attr_accessor :type
1018
+
1019
+ def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
1020
+ @discount_end = discount_end
1021
+ @line_ends_at = line_ends_at
1022
+ @timestamp = timestamp
1023
+ @type = type
1024
+ end
1025
+ end
1026
+
1027
+ class TrialSettings < Stripe::RequestParams
1028
+ class EndBehavior < Stripe::RequestParams
1029
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1030
+ attr_accessor :prorate_up_front
1031
+
1032
+ def initialize(prorate_up_front: nil)
1033
+ @prorate_up_front = prorate_up_front
1034
+ end
1035
+ end
1036
+ # Defines how the subscription should behave when a trial ends.
1037
+ attr_accessor :end_behavior
1038
+
1039
+ def initialize(end_behavior: nil)
1040
+ @end_behavior = end_behavior
1041
+ end
1042
+ end
1043
+ # An array of operations the quote line performs.
1044
+ attr_accessor :actions
1045
+ # Details to identify the subscription schedule the quote line applies to.
1046
+ attr_accessor :applies_to
1047
+ # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
1048
+ attr_accessor :billing_cycle_anchor
1049
+ # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
1050
+ attr_accessor :cancel_subscription_schedule
1051
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
1052
+ attr_accessor :ends_at
1053
+ # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
1054
+ attr_accessor :proration_behavior
1055
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1056
+ attr_accessor :set_pause_collection
1057
+ # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
1058
+ attr_accessor :set_schedule_end
1059
+ # Details to identify the earliest timestamp where the proposed change should take effect.
1060
+ attr_accessor :starts_at
1061
+ # Settings related to subscription trials.
1062
+ attr_accessor :trial_settings
1063
+
1064
+ def initialize(
1065
+ actions: nil,
1066
+ applies_to: nil,
1067
+ billing_cycle_anchor: nil,
1068
+ cancel_subscription_schedule: nil,
1069
+ ends_at: nil,
1070
+ proration_behavior: nil,
1071
+ set_pause_collection: nil,
1072
+ set_schedule_end: nil,
1073
+ starts_at: nil,
1074
+ trial_settings: nil
1075
+ )
1076
+ @actions = actions
1077
+ @applies_to = applies_to
1078
+ @billing_cycle_anchor = billing_cycle_anchor
1079
+ @cancel_subscription_schedule = cancel_subscription_schedule
1080
+ @ends_at = ends_at
1081
+ @proration_behavior = proration_behavior
1082
+ @set_pause_collection = set_pause_collection
1083
+ @set_schedule_end = set_schedule_end
1084
+ @starts_at = starts_at
1085
+ @trial_settings = trial_settings
1086
+ end
1087
+ end
1088
+
343
1089
  class LineItem < Stripe::RequestParams
344
1090
  class Discount < Stripe::RequestParams
1091
+ class DiscountEnd < Stripe::RequestParams
1092
+ class Duration < Stripe::RequestParams
1093
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1094
+ attr_accessor :interval
1095
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1096
+ attr_accessor :interval_count
1097
+
1098
+ def initialize(interval: nil, interval_count: nil)
1099
+ @interval = interval
1100
+ @interval_count = interval_count
1101
+ end
1102
+ end
1103
+ # Time span for the redeemed discount.
1104
+ attr_accessor :duration
1105
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1106
+ attr_accessor :timestamp
1107
+ # The type of calculation made to determine when the discount ends.
1108
+ attr_accessor :type
1109
+
1110
+ def initialize(duration: nil, timestamp: nil, type: nil)
1111
+ @duration = duration
1112
+ @timestamp = timestamp
1113
+ @type = type
1114
+ end
1115
+ end
345
1116
  # ID of the coupon to create a new discount for.
346
1117
  attr_accessor :coupon
347
1118
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
348
1119
  attr_accessor :discount
1120
+ # Details to determine how long the discount should be applied for.
1121
+ attr_accessor :discount_end
349
1122
  # ID of the promotion code to create a new discount for.
350
1123
  attr_accessor :promotion_code
351
1124
 
352
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1125
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
353
1126
  @coupon = coupon
354
1127
  @discount = discount
1128
+ @discount_end = discount_end
355
1129
  @promotion_code = promotion_code
356
1130
  end
357
1131
  end
@@ -418,6 +1192,84 @@ module Stripe
418
1192
  end
419
1193
 
420
1194
  class SubscriptionData < Stripe::RequestParams
1195
+ class BillOnAcceptance < Stripe::RequestParams
1196
+ class BillFrom < Stripe::RequestParams
1197
+ class LineStartsAt < Stripe::RequestParams
1198
+ # The ID of a quote line.
1199
+ attr_accessor :id
1200
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1201
+ attr_accessor :index
1202
+
1203
+ def initialize(id: nil, index: nil)
1204
+ @id = id
1205
+ @index = index
1206
+ end
1207
+ end
1208
+ # Details of a Quote line to start the bill period from.
1209
+ attr_accessor :line_starts_at
1210
+ # A precise Unix timestamp.
1211
+ attr_accessor :timestamp
1212
+ # The type of method to specify the `bill_from` time.
1213
+ attr_accessor :type
1214
+
1215
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
1216
+ @line_starts_at = line_starts_at
1217
+ @timestamp = timestamp
1218
+ @type = type
1219
+ end
1220
+ end
1221
+
1222
+ class BillUntil < Stripe::RequestParams
1223
+ class Duration < Stripe::RequestParams
1224
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1225
+ attr_accessor :interval
1226
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1227
+ attr_accessor :interval_count
1228
+
1229
+ def initialize(interval: nil, interval_count: nil)
1230
+ @interval = interval
1231
+ @interval_count = interval_count
1232
+ end
1233
+ end
1234
+
1235
+ class LineEndsAt < Stripe::RequestParams
1236
+ # The ID of a quote line.
1237
+ attr_accessor :id
1238
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1239
+ attr_accessor :index
1240
+
1241
+ def initialize(id: nil, index: nil)
1242
+ @id = id
1243
+ @index = index
1244
+ end
1245
+ end
1246
+ # Details of the duration over which to bill.
1247
+ attr_accessor :duration
1248
+ # Details of a Quote line item from which to bill until.
1249
+ attr_accessor :line_ends_at
1250
+ # A precise Unix timestamp.
1251
+ attr_accessor :timestamp
1252
+ # The type of method to specify the `bill_until` time.
1253
+ attr_accessor :type
1254
+
1255
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
1256
+ @duration = duration
1257
+ @line_ends_at = line_ends_at
1258
+ @timestamp = timestamp
1259
+ @type = type
1260
+ end
1261
+ end
1262
+ # The start of the period to bill from when the Quote is accepted.
1263
+ attr_accessor :bill_from
1264
+ # The end of the period to bill until when the Quote is accepted.
1265
+ attr_accessor :bill_until
1266
+
1267
+ def initialize(bill_from: nil, bill_until: nil)
1268
+ @bill_from = bill_from
1269
+ @bill_until = bill_until
1270
+ end
1271
+ end
1272
+
421
1273
  class BillingMode < Stripe::RequestParams
422
1274
  # Attribute for param field type
423
1275
  attr_accessor :type
@@ -426,32 +1278,208 @@ module Stripe
426
1278
  @type = type
427
1279
  end
428
1280
  end
1281
+
1282
+ class Prebilling < Stripe::RequestParams
1283
+ # This is used to determine the number of billing cycles to prebill.
1284
+ attr_accessor :iterations
1285
+
1286
+ def initialize(iterations: nil)
1287
+ @iterations = iterations
1288
+ end
1289
+ end
1290
+ # Describes the period to bill for upon accepting the quote.
1291
+ attr_accessor :bill_on_acceptance
1292
+ # 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.
1293
+ attr_accessor :billing_behavior
1294
+ # When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
1295
+ attr_accessor :billing_cycle_anchor
429
1296
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
430
1297
  attr_accessor :billing_mode
431
1298
  # The subscription's 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.
432
1299
  attr_accessor :description
433
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
1300
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
434
1301
  attr_accessor :effective_date
1302
+ # Behavior of the subscription schedule and underlying subscription when it ends.
1303
+ attr_accessor :end_behavior
1304
+ # The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden.
1305
+ attr_accessor :from_subscription
435
1306
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
436
1307
  attr_accessor :metadata
1308
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
1309
+ attr_accessor :prebilling
1310
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
1311
+ #
1312
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
1313
+ #
1314
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
1315
+ #
1316
+ # Prorations can be disabled by passing `none`.
1317
+ attr_accessor :proration_behavior
437
1318
  # Integer representing the number of trial period days before the customer is charged for the first time.
438
1319
  attr_accessor :trial_period_days
439
1320
 
440
1321
  def initialize(
1322
+ bill_on_acceptance: nil,
1323
+ billing_behavior: nil,
1324
+ billing_cycle_anchor: nil,
441
1325
  billing_mode: nil,
442
1326
  description: nil,
443
1327
  effective_date: nil,
1328
+ end_behavior: nil,
1329
+ from_subscription: nil,
444
1330
  metadata: nil,
1331
+ prebilling: nil,
1332
+ proration_behavior: nil,
445
1333
  trial_period_days: nil
446
1334
  )
1335
+ @bill_on_acceptance = bill_on_acceptance
1336
+ @billing_behavior = billing_behavior
1337
+ @billing_cycle_anchor = billing_cycle_anchor
447
1338
  @billing_mode = billing_mode
448
1339
  @description = description
449
1340
  @effective_date = effective_date
1341
+ @end_behavior = end_behavior
1342
+ @from_subscription = from_subscription
450
1343
  @metadata = metadata
1344
+ @prebilling = prebilling
1345
+ @proration_behavior = proration_behavior
451
1346
  @trial_period_days = trial_period_days
452
1347
  end
453
1348
  end
454
1349
 
1350
+ class SubscriptionDataOverride < Stripe::RequestParams
1351
+ class AppliesTo < Stripe::RequestParams
1352
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
1353
+ attr_accessor :new_reference
1354
+ # The ID of the schedule the line applies to.
1355
+ attr_accessor :subscription_schedule
1356
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
1357
+ attr_accessor :type
1358
+
1359
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
1360
+ @new_reference = new_reference
1361
+ @subscription_schedule = subscription_schedule
1362
+ @type = type
1363
+ end
1364
+ end
1365
+
1366
+ class BillOnAcceptance < Stripe::RequestParams
1367
+ class BillFrom < Stripe::RequestParams
1368
+ class LineStartsAt < Stripe::RequestParams
1369
+ # The ID of a quote line.
1370
+ attr_accessor :id
1371
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1372
+ attr_accessor :index
1373
+
1374
+ def initialize(id: nil, index: nil)
1375
+ @id = id
1376
+ @index = index
1377
+ end
1378
+ end
1379
+ # Details of a Quote line to start the bill period from.
1380
+ attr_accessor :line_starts_at
1381
+ # A precise Unix timestamp.
1382
+ attr_accessor :timestamp
1383
+ # The type of method to specify the `bill_from` time.
1384
+ attr_accessor :type
1385
+
1386
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
1387
+ @line_starts_at = line_starts_at
1388
+ @timestamp = timestamp
1389
+ @type = type
1390
+ end
1391
+ end
1392
+
1393
+ class BillUntil < Stripe::RequestParams
1394
+ class Duration < Stripe::RequestParams
1395
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1396
+ attr_accessor :interval
1397
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1398
+ attr_accessor :interval_count
1399
+
1400
+ def initialize(interval: nil, interval_count: nil)
1401
+ @interval = interval
1402
+ @interval_count = interval_count
1403
+ end
1404
+ end
1405
+
1406
+ class LineEndsAt < Stripe::RequestParams
1407
+ # The ID of a quote line.
1408
+ attr_accessor :id
1409
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1410
+ attr_accessor :index
1411
+
1412
+ def initialize(id: nil, index: nil)
1413
+ @id = id
1414
+ @index = index
1415
+ end
1416
+ end
1417
+ # Details of the duration over which to bill.
1418
+ attr_accessor :duration
1419
+ # Details of a Quote line item from which to bill until.
1420
+ attr_accessor :line_ends_at
1421
+ # A precise Unix timestamp.
1422
+ attr_accessor :timestamp
1423
+ # The type of method to specify the `bill_until` time.
1424
+ attr_accessor :type
1425
+
1426
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
1427
+ @duration = duration
1428
+ @line_ends_at = line_ends_at
1429
+ @timestamp = timestamp
1430
+ @type = type
1431
+ end
1432
+ end
1433
+ # The start of the period to bill from when the Quote is accepted.
1434
+ attr_accessor :bill_from
1435
+ # The end of the period to bill until when the Quote is accepted.
1436
+ attr_accessor :bill_until
1437
+
1438
+ def initialize(bill_from: nil, bill_until: nil)
1439
+ @bill_from = bill_from
1440
+ @bill_until = bill_until
1441
+ end
1442
+ end
1443
+ # Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
1444
+ attr_accessor :applies_to
1445
+ # Describes the period to bill for upon accepting the quote.
1446
+ attr_accessor :bill_on_acceptance
1447
+ # 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.
1448
+ attr_accessor :billing_behavior
1449
+ # The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`.
1450
+ attr_accessor :customer
1451
+ # The subscription's 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.
1452
+ attr_accessor :description
1453
+ # Behavior of the subscription schedule and underlying subscription when it ends.
1454
+ attr_accessor :end_behavior
1455
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
1456
+ #
1457
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
1458
+ #
1459
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
1460
+ #
1461
+ # Prorations can be disabled by passing `none`.
1462
+ attr_accessor :proration_behavior
1463
+
1464
+ def initialize(
1465
+ applies_to: nil,
1466
+ bill_on_acceptance: nil,
1467
+ billing_behavior: nil,
1468
+ customer: nil,
1469
+ description: nil,
1470
+ end_behavior: nil,
1471
+ proration_behavior: nil
1472
+ )
1473
+ @applies_to = applies_to
1474
+ @bill_on_acceptance = bill_on_acceptance
1475
+ @billing_behavior = billing_behavior
1476
+ @customer = customer
1477
+ @description = description
1478
+ @end_behavior = end_behavior
1479
+ @proration_behavior = proration_behavior
1480
+ end
1481
+ end
1482
+
455
1483
  class TransferData < Stripe::RequestParams
456
1484
  # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
457
1485
  attr_accessor :amount
@@ -466,6 +1494,8 @@ module Stripe
466
1494
  @destination = destination
467
1495
  end
468
1496
  end
1497
+ # Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
1498
+ attr_accessor :allow_backdated_lines
469
1499
  # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
470
1500
  attr_accessor :application_fee_amount
471
1501
  # 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. There must be at least 1 line item with a recurring price to use this field.
@@ -476,6 +1506,8 @@ module Stripe
476
1506
  attr_accessor :collection_method
477
1507
  # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
478
1508
  attr_accessor :customer
1509
+ # The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
1510
+ attr_accessor :customer_account
479
1511
  # The tax rates that will apply to any line item that does not have `tax_rates` set.
480
1512
  attr_accessor :default_tax_rates
481
1513
  # A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
@@ -496,23 +1528,29 @@ module Stripe
496
1528
  attr_accessor :invoice_settings
497
1529
  # A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
498
1530
  attr_accessor :line_items
1531
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
1532
+ attr_accessor :lines
499
1533
  # 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`.
500
1534
  attr_accessor :metadata
501
1535
  # The account on behalf of which to charge.
502
1536
  attr_accessor :on_behalf_of
503
1537
  # When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
504
1538
  attr_accessor :subscription_data
1539
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
1540
+ attr_accessor :subscription_data_overrides
505
1541
  # ID of the test clock to attach to the quote.
506
1542
  attr_accessor :test_clock
507
1543
  # The data with which to automatically create a Transfer for each of the invoices.
508
1544
  attr_accessor :transfer_data
509
1545
 
510
1546
  def initialize(
1547
+ allow_backdated_lines: nil,
511
1548
  application_fee_amount: nil,
512
1549
  application_fee_percent: nil,
513
1550
  automatic_tax: nil,
514
1551
  collection_method: nil,
515
1552
  customer: nil,
1553
+ customer_account: nil,
516
1554
  default_tax_rates: nil,
517
1555
  description: nil,
518
1556
  discounts: nil,
@@ -523,17 +1561,21 @@ module Stripe
523
1561
  header: nil,
524
1562
  invoice_settings: nil,
525
1563
  line_items: nil,
1564
+ lines: nil,
526
1565
  metadata: nil,
527
1566
  on_behalf_of: nil,
528
1567
  subscription_data: nil,
1568
+ subscription_data_overrides: nil,
529
1569
  test_clock: nil,
530
1570
  transfer_data: nil
531
1571
  )
1572
+ @allow_backdated_lines = allow_backdated_lines
532
1573
  @application_fee_amount = application_fee_amount
533
1574
  @application_fee_percent = application_fee_percent
534
1575
  @automatic_tax = automatic_tax
535
1576
  @collection_method = collection_method
536
1577
  @customer = customer
1578
+ @customer_account = customer_account
537
1579
  @default_tax_rates = default_tax_rates
538
1580
  @description = description
539
1581
  @discounts = discounts
@@ -544,9 +1586,11 @@ module Stripe
544
1586
  @header = header
545
1587
  @invoice_settings = invoice_settings
546
1588
  @line_items = line_items
1589
+ @lines = lines
547
1590
  @metadata = metadata
548
1591
  @on_behalf_of = on_behalf_of
549
1592
  @subscription_data = subscription_data
1593
+ @subscription_data_overrides = subscription_data_overrides
550
1594
  @test_clock = test_clock
551
1595
  @transfer_data = transfer_data
552
1596
  end
@@ -577,16 +1621,44 @@ module Stripe
577
1621
  end
578
1622
 
579
1623
  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
+ attr_accessor :interval
1628
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1629
+ attr_accessor :interval_count
1630
+
1631
+ def initialize(interval: nil, interval_count: nil)
1632
+ @interval = interval
1633
+ @interval_count = interval_count
1634
+ end
1635
+ end
1636
+ # Time span for the redeemed discount.
1637
+ attr_accessor :duration
1638
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1639
+ attr_accessor :timestamp
1640
+ # The type of calculation made to determine when the discount ends.
1641
+ attr_accessor :type
1642
+
1643
+ def initialize(duration: nil, timestamp: nil, type: nil)
1644
+ @duration = duration
1645
+ @timestamp = timestamp
1646
+ @type = type
1647
+ end
1648
+ end
580
1649
  # ID of the coupon to create a new discount for.
581
1650
  attr_accessor :coupon
582
1651
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
583
1652
  attr_accessor :discount
1653
+ # Details to determine how long the discount should be applied for.
1654
+ attr_accessor :discount_end
584
1655
  # ID of the promotion code to create a new discount for.
585
1656
  attr_accessor :promotion_code
586
1657
 
587
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1658
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
588
1659
  @coupon = coupon
589
1660
  @discount = discount
1661
+ @discount_end = discount_end
590
1662
  @promotion_code = promotion_code
591
1663
  end
592
1664
  end
@@ -614,18 +1686,529 @@ module Stripe
614
1686
  end
615
1687
  end
616
1688
 
1689
+ class Line < Stripe::RequestParams
1690
+ class Action < Stripe::RequestParams
1691
+ class AddDiscount < Stripe::RequestParams
1692
+ class DiscountEnd < Stripe::RequestParams
1693
+ # The type of calculation made to determine when the discount ends.
1694
+ attr_accessor :type
1695
+
1696
+ def initialize(type: nil)
1697
+ @type = type
1698
+ end
1699
+ end
1700
+ # The coupon code to redeem.
1701
+ attr_accessor :coupon
1702
+ # An ID of an existing discount for a coupon that was already redeemed.
1703
+ attr_accessor :discount
1704
+ # Details to determine how long the discount should be applied for.
1705
+ attr_accessor :discount_end
1706
+ # 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.
1707
+ attr_accessor :index
1708
+ # The promotion code to redeem.
1709
+ attr_accessor :promotion_code
1710
+
1711
+ def initialize(
1712
+ coupon: nil,
1713
+ discount: nil,
1714
+ discount_end: nil,
1715
+ index: nil,
1716
+ promotion_code: nil
1717
+ )
1718
+ @coupon = coupon
1719
+ @discount = discount
1720
+ @discount_end = discount_end
1721
+ @index = index
1722
+ @promotion_code = promotion_code
1723
+ end
1724
+ end
1725
+
1726
+ class AddItem < Stripe::RequestParams
1727
+ class Discount < Stripe::RequestParams
1728
+ class DiscountEnd < Stripe::RequestParams
1729
+ class Duration < Stripe::RequestParams
1730
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1731
+ attr_accessor :interval
1732
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1733
+ attr_accessor :interval_count
1734
+
1735
+ def initialize(interval: nil, interval_count: nil)
1736
+ @interval = interval
1737
+ @interval_count = interval_count
1738
+ end
1739
+ end
1740
+ # Time span for the redeemed discount.
1741
+ attr_accessor :duration
1742
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1743
+ attr_accessor :timestamp
1744
+ # The type of calculation made to determine when the discount ends.
1745
+ attr_accessor :type
1746
+
1747
+ def initialize(duration: nil, timestamp: nil, type: nil)
1748
+ @duration = duration
1749
+ @timestamp = timestamp
1750
+ @type = type
1751
+ end
1752
+ end
1753
+ # ID of the coupon to create a new discount for.
1754
+ attr_accessor :coupon
1755
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1756
+ attr_accessor :discount
1757
+ # Details to determine how long the discount should be applied for.
1758
+ attr_accessor :discount_end
1759
+ # ID of the promotion code to create a new discount for.
1760
+ attr_accessor :promotion_code
1761
+
1762
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1763
+ @coupon = coupon
1764
+ @discount = discount
1765
+ @discount_end = discount_end
1766
+ @promotion_code = promotion_code
1767
+ end
1768
+ end
1769
+
1770
+ class Trial < Stripe::RequestParams
1771
+ # 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.
1772
+ attr_accessor :converts_to
1773
+ # Determines the type of trial for this item.
1774
+ attr_accessor :type
1775
+
1776
+ def initialize(converts_to: nil, type: nil)
1777
+ @converts_to = converts_to
1778
+ @type = type
1779
+ end
1780
+ end
1781
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1782
+ attr_accessor :discounts
1783
+ # 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`.
1784
+ attr_accessor :metadata
1785
+ # The ID of the price object.
1786
+ attr_accessor :price
1787
+ # Quantity for this item.
1788
+ attr_accessor :quantity
1789
+ # 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`.
1790
+ attr_accessor :tax_rates
1791
+ # Options that configure the trial on the subscription item.
1792
+ attr_accessor :trial
1793
+
1794
+ def initialize(
1795
+ discounts: nil,
1796
+ metadata: nil,
1797
+ price: nil,
1798
+ quantity: nil,
1799
+ tax_rates: nil,
1800
+ trial: nil
1801
+ )
1802
+ @discounts = discounts
1803
+ @metadata = metadata
1804
+ @price = price
1805
+ @quantity = quantity
1806
+ @tax_rates = tax_rates
1807
+ @trial = trial
1808
+ end
1809
+ end
1810
+
1811
+ class RemoveDiscount < Stripe::RequestParams
1812
+ # The coupon code to remove from the `discounts` array.
1813
+ attr_accessor :coupon
1814
+ # The ID of a discount to remove from the `discounts` array.
1815
+ attr_accessor :discount
1816
+ # The ID of a promotion code to remove from the `discounts` array.
1817
+ attr_accessor :promotion_code
1818
+
1819
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1820
+ @coupon = coupon
1821
+ @discount = discount
1822
+ @promotion_code = promotion_code
1823
+ end
1824
+ end
1825
+
1826
+ class RemoveItem < Stripe::RequestParams
1827
+ # ID of a price to remove.
1828
+ attr_accessor :price
1829
+
1830
+ def initialize(price: nil)
1831
+ @price = price
1832
+ end
1833
+ end
1834
+
1835
+ class SetDiscount < Stripe::RequestParams
1836
+ # The coupon code to replace the `discounts` array with.
1837
+ attr_accessor :coupon
1838
+ # An ID of an existing discount to replace the `discounts` array with.
1839
+ attr_accessor :discount
1840
+ # An ID of an existing promotion code to replace the `discounts` array with.
1841
+ attr_accessor :promotion_code
1842
+
1843
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1844
+ @coupon = coupon
1845
+ @discount = discount
1846
+ @promotion_code = promotion_code
1847
+ end
1848
+ end
1849
+
1850
+ class SetItem < Stripe::RequestParams
1851
+ class Discount < Stripe::RequestParams
1852
+ class DiscountEnd < Stripe::RequestParams
1853
+ class Duration < Stripe::RequestParams
1854
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1855
+ attr_accessor :interval
1856
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1857
+ attr_accessor :interval_count
1858
+
1859
+ def initialize(interval: nil, interval_count: nil)
1860
+ @interval = interval
1861
+ @interval_count = interval_count
1862
+ end
1863
+ end
1864
+ # Time span for the redeemed discount.
1865
+ attr_accessor :duration
1866
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1867
+ attr_accessor :timestamp
1868
+ # The type of calculation made to determine when the discount ends.
1869
+ attr_accessor :type
1870
+
1871
+ def initialize(duration: nil, timestamp: nil, type: nil)
1872
+ @duration = duration
1873
+ @timestamp = timestamp
1874
+ @type = type
1875
+ end
1876
+ end
1877
+ # ID of the coupon to create a new discount for.
1878
+ attr_accessor :coupon
1879
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1880
+ attr_accessor :discount
1881
+ # Details to determine how long the discount should be applied for.
1882
+ attr_accessor :discount_end
1883
+ # ID of the promotion code to create a new discount for.
1884
+ attr_accessor :promotion_code
1885
+
1886
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1887
+ @coupon = coupon
1888
+ @discount = discount
1889
+ @discount_end = discount_end
1890
+ @promotion_code = promotion_code
1891
+ end
1892
+ end
1893
+
1894
+ class Trial < Stripe::RequestParams
1895
+ # 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.
1896
+ attr_accessor :converts_to
1897
+ # Determines the type of trial for this item.
1898
+ attr_accessor :type
1899
+
1900
+ def initialize(converts_to: nil, type: nil)
1901
+ @converts_to = converts_to
1902
+ @type = type
1903
+ end
1904
+ end
1905
+ # 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`.
1906
+ attr_accessor :discounts
1907
+ # 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`.
1908
+ attr_accessor :metadata
1909
+ # The ID of the price object.
1910
+ attr_accessor :price
1911
+ # 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`.
1912
+ attr_accessor :quantity
1913
+ # 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`.
1914
+ attr_accessor :tax_rates
1915
+ # 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`.
1916
+ attr_accessor :trial
1917
+
1918
+ def initialize(
1919
+ discounts: nil,
1920
+ metadata: nil,
1921
+ price: nil,
1922
+ quantity: nil,
1923
+ tax_rates: nil,
1924
+ trial: nil
1925
+ )
1926
+ @discounts = discounts
1927
+ @metadata = metadata
1928
+ @price = price
1929
+ @quantity = quantity
1930
+ @tax_rates = tax_rates
1931
+ @trial = trial
1932
+ end
1933
+ end
1934
+ # Details for the `add_discount` type.
1935
+ attr_accessor :add_discount
1936
+ # Details for the `add_item` type.
1937
+ attr_accessor :add_item
1938
+ # Details for the `add_metadata` type: specify a hash of key-value pairs.
1939
+ attr_accessor :add_metadata
1940
+ # Details for the `remove_discount` type.
1941
+ attr_accessor :remove_discount
1942
+ # Details for the `remove_item` type.
1943
+ attr_accessor :remove_item
1944
+ # Details for the `remove_metadata` type: specify an array of metadata keys.
1945
+ attr_accessor :remove_metadata
1946
+ # Details for the `set_discounts` type.
1947
+ attr_accessor :set_discounts
1948
+ # Details for the `set_items` type.
1949
+ attr_accessor :set_items
1950
+ # Details for the `set_metadata` type: specify an array of key-value pairs.
1951
+ attr_accessor :set_metadata
1952
+ # The type of action the quote line performs.
1953
+ attr_accessor :type
1954
+
1955
+ def initialize(
1956
+ add_discount: nil,
1957
+ add_item: nil,
1958
+ add_metadata: nil,
1959
+ remove_discount: nil,
1960
+ remove_item: nil,
1961
+ remove_metadata: nil,
1962
+ set_discounts: nil,
1963
+ set_items: nil,
1964
+ set_metadata: nil,
1965
+ type: nil
1966
+ )
1967
+ @add_discount = add_discount
1968
+ @add_item = add_item
1969
+ @add_metadata = add_metadata
1970
+ @remove_discount = remove_discount
1971
+ @remove_item = remove_item
1972
+ @remove_metadata = remove_metadata
1973
+ @set_discounts = set_discounts
1974
+ @set_items = set_items
1975
+ @set_metadata = set_metadata
1976
+ @type = type
1977
+ end
1978
+ end
1979
+
1980
+ class AppliesTo < Stripe::RequestParams
1981
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
1982
+ attr_accessor :new_reference
1983
+ # The ID of the schedule the line applies to.
1984
+ attr_accessor :subscription_schedule
1985
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
1986
+ attr_accessor :type
1987
+
1988
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
1989
+ @new_reference = new_reference
1990
+ @subscription_schedule = subscription_schedule
1991
+ @type = type
1992
+ end
1993
+ end
1994
+
1995
+ class CancelSubscriptionSchedule < Stripe::RequestParams
1996
+ # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
1997
+ attr_accessor :cancel_at
1998
+ # 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. Boolean that defaults to `true`.
1999
+ attr_accessor :invoice_now
2000
+ # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
2001
+ attr_accessor :prorate
2002
+
2003
+ def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
2004
+ @cancel_at = cancel_at
2005
+ @invoice_now = invoice_now
2006
+ @prorate = prorate
2007
+ end
2008
+ end
2009
+
2010
+ class EndsAt < Stripe::RequestParams
2011
+ class DiscountEnd < Stripe::RequestParams
2012
+ # The ID of a specific discount.
2013
+ attr_accessor :discount
2014
+
2015
+ def initialize(discount: nil)
2016
+ @discount = discount
2017
+ end
2018
+ end
2019
+
2020
+ class Duration < Stripe::RequestParams
2021
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2022
+ attr_accessor :interval
2023
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2024
+ attr_accessor :interval_count
2025
+
2026
+ def initialize(interval: nil, interval_count: nil)
2027
+ @interval = interval
2028
+ @interval_count = interval_count
2029
+ end
2030
+ end
2031
+ # Use the `end` time of a given discount.
2032
+ attr_accessor :discount_end
2033
+ # Time span for the quote line starting from the `starts_at` date.
2034
+ attr_accessor :duration
2035
+ # A precise Unix timestamp.
2036
+ attr_accessor :timestamp
2037
+ # Select a way to pass in `ends_at`.
2038
+ attr_accessor :type
2039
+
2040
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2041
+ @discount_end = discount_end
2042
+ @duration = duration
2043
+ @timestamp = timestamp
2044
+ @type = type
2045
+ end
2046
+ end
2047
+
2048
+ class SetPauseCollection < Stripe::RequestParams
2049
+ class Set < Stripe::RequestParams
2050
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2051
+ attr_accessor :behavior
2052
+
2053
+ def initialize(behavior: nil)
2054
+ @behavior = behavior
2055
+ end
2056
+ end
2057
+ # Details of the pause_collection behavior to apply to the amendment.
2058
+ attr_accessor :set
2059
+ # Determines the type of the pause_collection amendment.
2060
+ attr_accessor :type
2061
+
2062
+ def initialize(set: nil, type: nil)
2063
+ @set = set
2064
+ @type = type
2065
+ end
2066
+ end
2067
+
2068
+ class StartsAt < Stripe::RequestParams
2069
+ class DiscountEnd < Stripe::RequestParams
2070
+ # The ID of a specific discount.
2071
+ attr_accessor :discount
2072
+
2073
+ def initialize(discount: nil)
2074
+ @discount = discount
2075
+ end
2076
+ end
2077
+
2078
+ class LineEndsAt < Stripe::RequestParams
2079
+ # The ID of a quote line.
2080
+ attr_accessor :id
2081
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2082
+ attr_accessor :index
2083
+
2084
+ def initialize(id: nil, index: nil)
2085
+ @id = id
2086
+ @index = index
2087
+ end
2088
+ end
2089
+ # Use the `end` time of a given discount.
2090
+ attr_accessor :discount_end
2091
+ # The timestamp the given line ends at.
2092
+ attr_accessor :line_ends_at
2093
+ # A precise Unix timestamp.
2094
+ attr_accessor :timestamp
2095
+ # Select a way to pass in `starts_at`.
2096
+ attr_accessor :type
2097
+
2098
+ def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
2099
+ @discount_end = discount_end
2100
+ @line_ends_at = line_ends_at
2101
+ @timestamp = timestamp
2102
+ @type = type
2103
+ end
2104
+ end
2105
+
2106
+ class TrialSettings < Stripe::RequestParams
2107
+ class EndBehavior < Stripe::RequestParams
2108
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2109
+ attr_accessor :prorate_up_front
2110
+
2111
+ def initialize(prorate_up_front: nil)
2112
+ @prorate_up_front = prorate_up_front
2113
+ end
2114
+ end
2115
+ # Defines how the subscription should behave when a trial ends.
2116
+ attr_accessor :end_behavior
2117
+
2118
+ def initialize(end_behavior: nil)
2119
+ @end_behavior = end_behavior
2120
+ end
2121
+ end
2122
+ # An array of operations the quote line performs.
2123
+ attr_accessor :actions
2124
+ # Details to identify the subscription schedule the quote line applies to.
2125
+ attr_accessor :applies_to
2126
+ # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
2127
+ attr_accessor :billing_cycle_anchor
2128
+ # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
2129
+ attr_accessor :cancel_subscription_schedule
2130
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
2131
+ attr_accessor :ends_at
2132
+ # The ID of an existing line on the quote.
2133
+ attr_accessor :id
2134
+ # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
2135
+ attr_accessor :proration_behavior
2136
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2137
+ attr_accessor :set_pause_collection
2138
+ # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
2139
+ attr_accessor :set_schedule_end
2140
+ # Details to identify the earliest timestamp where the proposed change should take effect.
2141
+ attr_accessor :starts_at
2142
+ # Settings related to subscription trials.
2143
+ attr_accessor :trial_settings
2144
+
2145
+ def initialize(
2146
+ actions: nil,
2147
+ applies_to: nil,
2148
+ billing_cycle_anchor: nil,
2149
+ cancel_subscription_schedule: nil,
2150
+ ends_at: nil,
2151
+ id: nil,
2152
+ proration_behavior: nil,
2153
+ set_pause_collection: nil,
2154
+ set_schedule_end: nil,
2155
+ starts_at: nil,
2156
+ trial_settings: nil
2157
+ )
2158
+ @actions = actions
2159
+ @applies_to = applies_to
2160
+ @billing_cycle_anchor = billing_cycle_anchor
2161
+ @cancel_subscription_schedule = cancel_subscription_schedule
2162
+ @ends_at = ends_at
2163
+ @id = id
2164
+ @proration_behavior = proration_behavior
2165
+ @set_pause_collection = set_pause_collection
2166
+ @set_schedule_end = set_schedule_end
2167
+ @starts_at = starts_at
2168
+ @trial_settings = trial_settings
2169
+ end
2170
+ end
2171
+
617
2172
  class LineItem < Stripe::RequestParams
618
2173
  class Discount < Stripe::RequestParams
2174
+ class DiscountEnd < Stripe::RequestParams
2175
+ class Duration < Stripe::RequestParams
2176
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2177
+ attr_accessor :interval
2178
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2179
+ attr_accessor :interval_count
2180
+
2181
+ def initialize(interval: nil, interval_count: nil)
2182
+ @interval = interval
2183
+ @interval_count = interval_count
2184
+ end
2185
+ end
2186
+ # Time span for the redeemed discount.
2187
+ attr_accessor :duration
2188
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2189
+ attr_accessor :timestamp
2190
+ # The type of calculation made to determine when the discount ends.
2191
+ attr_accessor :type
2192
+
2193
+ def initialize(duration: nil, timestamp: nil, type: nil)
2194
+ @duration = duration
2195
+ @timestamp = timestamp
2196
+ @type = type
2197
+ end
2198
+ end
619
2199
  # ID of the coupon to create a new discount for.
620
2200
  attr_accessor :coupon
621
2201
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
622
2202
  attr_accessor :discount
2203
+ # Details to determine how long the discount should be applied for.
2204
+ attr_accessor :discount_end
623
2205
  # ID of the promotion code to create a new discount for.
624
2206
  attr_accessor :promotion_code
625
2207
 
626
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2208
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
627
2209
  @coupon = coupon
628
2210
  @discount = discount
2211
+ @discount_end = discount_end
629
2212
  @promotion_code = promotion_code
630
2213
  end
631
2214
  end
@@ -702,23 +2285,277 @@ module Stripe
702
2285
  end
703
2286
 
704
2287
  class SubscriptionData < Stripe::RequestParams
2288
+ class BillOnAcceptance < Stripe::RequestParams
2289
+ class BillFrom < Stripe::RequestParams
2290
+ class LineStartsAt < Stripe::RequestParams
2291
+ # The ID of a quote line.
2292
+ attr_accessor :id
2293
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2294
+ attr_accessor :index
2295
+
2296
+ def initialize(id: nil, index: nil)
2297
+ @id = id
2298
+ @index = index
2299
+ end
2300
+ end
2301
+ # Details of a Quote line to start the bill period from.
2302
+ attr_accessor :line_starts_at
2303
+ # A precise Unix timestamp.
2304
+ attr_accessor :timestamp
2305
+ # The type of method to specify the `bill_from` time.
2306
+ attr_accessor :type
2307
+
2308
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
2309
+ @line_starts_at = line_starts_at
2310
+ @timestamp = timestamp
2311
+ @type = type
2312
+ end
2313
+ end
2314
+
2315
+ class BillUntil < Stripe::RequestParams
2316
+ class Duration < Stripe::RequestParams
2317
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2318
+ attr_accessor :interval
2319
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2320
+ attr_accessor :interval_count
2321
+
2322
+ def initialize(interval: nil, interval_count: nil)
2323
+ @interval = interval
2324
+ @interval_count = interval_count
2325
+ end
2326
+ end
2327
+
2328
+ class LineEndsAt < Stripe::RequestParams
2329
+ # The ID of a quote line.
2330
+ attr_accessor :id
2331
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2332
+ attr_accessor :index
2333
+
2334
+ def initialize(id: nil, index: nil)
2335
+ @id = id
2336
+ @index = index
2337
+ end
2338
+ end
2339
+ # Details of the duration over which to bill.
2340
+ attr_accessor :duration
2341
+ # Details of a Quote line item from which to bill until.
2342
+ attr_accessor :line_ends_at
2343
+ # A precise Unix timestamp.
2344
+ attr_accessor :timestamp
2345
+ # The type of method to specify the `bill_until` time.
2346
+ attr_accessor :type
2347
+
2348
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
2349
+ @duration = duration
2350
+ @line_ends_at = line_ends_at
2351
+ @timestamp = timestamp
2352
+ @type = type
2353
+ end
2354
+ end
2355
+ # The start of the period to bill from when the Quote is accepted.
2356
+ attr_accessor :bill_from
2357
+ # The end of the period to bill until when the Quote is accepted.
2358
+ attr_accessor :bill_until
2359
+
2360
+ def initialize(bill_from: nil, bill_until: nil)
2361
+ @bill_from = bill_from
2362
+ @bill_until = bill_until
2363
+ end
2364
+ end
2365
+
2366
+ class Prebilling < Stripe::RequestParams
2367
+ # This is used to determine the number of billing cycles to prebill.
2368
+ attr_accessor :iterations
2369
+
2370
+ def initialize(iterations: nil)
2371
+ @iterations = iterations
2372
+ end
2373
+ end
2374
+ # Describes the period to bill for upon accepting the quote.
2375
+ attr_accessor :bill_on_acceptance
2376
+ # 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.
2377
+ attr_accessor :billing_behavior
2378
+ # When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
2379
+ attr_accessor :billing_cycle_anchor
705
2380
  # The subscription's 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.
706
2381
  attr_accessor :description
707
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
2382
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
708
2383
  attr_accessor :effective_date
2384
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2385
+ attr_accessor :end_behavior
709
2386
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
710
2387
  attr_accessor :metadata
2388
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
2389
+ attr_accessor :prebilling
2390
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
2391
+ #
2392
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
2393
+ #
2394
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
2395
+ #
2396
+ # Prorations can be disabled by passing `none`.
2397
+ attr_accessor :proration_behavior
711
2398
  # Integer representing the number of trial period days before the customer is charged for the first time.
712
2399
  attr_accessor :trial_period_days
713
2400
 
714
- def initialize(description: nil, effective_date: nil, metadata: nil, trial_period_days: nil)
2401
+ def initialize(
2402
+ bill_on_acceptance: nil,
2403
+ billing_behavior: nil,
2404
+ billing_cycle_anchor: nil,
2405
+ description: nil,
2406
+ effective_date: nil,
2407
+ end_behavior: nil,
2408
+ metadata: nil,
2409
+ prebilling: nil,
2410
+ proration_behavior: nil,
2411
+ trial_period_days: nil
2412
+ )
2413
+ @bill_on_acceptance = bill_on_acceptance
2414
+ @billing_behavior = billing_behavior
2415
+ @billing_cycle_anchor = billing_cycle_anchor
715
2416
  @description = description
716
2417
  @effective_date = effective_date
2418
+ @end_behavior = end_behavior
717
2419
  @metadata = metadata
2420
+ @prebilling = prebilling
2421
+ @proration_behavior = proration_behavior
718
2422
  @trial_period_days = trial_period_days
719
2423
  end
720
2424
  end
721
2425
 
2426
+ class SubscriptionDataOverride < Stripe::RequestParams
2427
+ class AppliesTo < Stripe::RequestParams
2428
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
2429
+ attr_accessor :new_reference
2430
+ # The ID of the schedule the line applies to.
2431
+ attr_accessor :subscription_schedule
2432
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
2433
+ attr_accessor :type
2434
+
2435
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
2436
+ @new_reference = new_reference
2437
+ @subscription_schedule = subscription_schedule
2438
+ @type = type
2439
+ end
2440
+ end
2441
+
2442
+ class BillOnAcceptance < Stripe::RequestParams
2443
+ class BillFrom < Stripe::RequestParams
2444
+ class LineStartsAt < Stripe::RequestParams
2445
+ # The ID of a quote line.
2446
+ attr_accessor :id
2447
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2448
+ attr_accessor :index
2449
+
2450
+ def initialize(id: nil, index: nil)
2451
+ @id = id
2452
+ @index = index
2453
+ end
2454
+ end
2455
+ # Details of a Quote line to start the bill period from.
2456
+ attr_accessor :line_starts_at
2457
+ # A precise Unix timestamp.
2458
+ attr_accessor :timestamp
2459
+ # The type of method to specify the `bill_from` time.
2460
+ attr_accessor :type
2461
+
2462
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
2463
+ @line_starts_at = line_starts_at
2464
+ @timestamp = timestamp
2465
+ @type = type
2466
+ end
2467
+ end
2468
+
2469
+ class BillUntil < Stripe::RequestParams
2470
+ class Duration < Stripe::RequestParams
2471
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2472
+ attr_accessor :interval
2473
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2474
+ attr_accessor :interval_count
2475
+
2476
+ def initialize(interval: nil, interval_count: nil)
2477
+ @interval = interval
2478
+ @interval_count = interval_count
2479
+ end
2480
+ end
2481
+
2482
+ class LineEndsAt < Stripe::RequestParams
2483
+ # The ID of a quote line.
2484
+ attr_accessor :id
2485
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2486
+ attr_accessor :index
2487
+
2488
+ def initialize(id: nil, index: nil)
2489
+ @id = id
2490
+ @index = index
2491
+ end
2492
+ end
2493
+ # Details of the duration over which to bill.
2494
+ attr_accessor :duration
2495
+ # Details of a Quote line item from which to bill until.
2496
+ attr_accessor :line_ends_at
2497
+ # A precise Unix timestamp.
2498
+ attr_accessor :timestamp
2499
+ # The type of method to specify the `bill_until` time.
2500
+ attr_accessor :type
2501
+
2502
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
2503
+ @duration = duration
2504
+ @line_ends_at = line_ends_at
2505
+ @timestamp = timestamp
2506
+ @type = type
2507
+ end
2508
+ end
2509
+ # The start of the period to bill from when the Quote is accepted.
2510
+ attr_accessor :bill_from
2511
+ # The end of the period to bill until when the Quote is accepted.
2512
+ attr_accessor :bill_until
2513
+
2514
+ def initialize(bill_from: nil, bill_until: nil)
2515
+ @bill_from = bill_from
2516
+ @bill_until = bill_until
2517
+ end
2518
+ end
2519
+ # Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
2520
+ attr_accessor :applies_to
2521
+ # Describes the period to bill for upon accepting the quote.
2522
+ attr_accessor :bill_on_acceptance
2523
+ # 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.
2524
+ attr_accessor :billing_behavior
2525
+ # The customer the Subscription Data override applies to.
2526
+ attr_accessor :customer
2527
+ # The subscription's 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.
2528
+ attr_accessor :description
2529
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2530
+ attr_accessor :end_behavior
2531
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
2532
+ #
2533
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
2534
+ #
2535
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
2536
+ #
2537
+ # Prorations can be disabled by passing `none`.
2538
+ attr_accessor :proration_behavior
2539
+
2540
+ def initialize(
2541
+ applies_to: nil,
2542
+ bill_on_acceptance: nil,
2543
+ billing_behavior: nil,
2544
+ customer: nil,
2545
+ description: nil,
2546
+ end_behavior: nil,
2547
+ proration_behavior: nil
2548
+ )
2549
+ @applies_to = applies_to
2550
+ @bill_on_acceptance = bill_on_acceptance
2551
+ @billing_behavior = billing_behavior
2552
+ @customer = customer
2553
+ @description = description
2554
+ @end_behavior = end_behavior
2555
+ @proration_behavior = proration_behavior
2556
+ end
2557
+ end
2558
+
722
2559
  class TransferData < Stripe::RequestParams
723
2560
  # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
724
2561
  attr_accessor :amount
@@ -733,6 +2570,8 @@ module Stripe
733
2570
  @destination = destination
734
2571
  end
735
2572
  end
2573
+ # Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
2574
+ attr_accessor :allow_backdated_lines
736
2575
  # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
737
2576
  attr_accessor :application_fee_amount
738
2577
  # 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. There must be at least 1 line item with a recurring price to use this field.
@@ -743,6 +2582,8 @@ module Stripe
743
2582
  attr_accessor :collection_method
744
2583
  # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
745
2584
  attr_accessor :customer
2585
+ # The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
2586
+ attr_accessor :customer_account
746
2587
  # The tax rates that will apply to any line item that does not have `tax_rates` set.
747
2588
  attr_accessor :default_tax_rates
748
2589
  # A description that will be displayed on the quote PDF.
@@ -761,21 +2602,27 @@ module Stripe
761
2602
  attr_accessor :invoice_settings
762
2603
  # A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
763
2604
  attr_accessor :line_items
2605
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
2606
+ attr_accessor :lines
764
2607
  # 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`.
765
2608
  attr_accessor :metadata
766
2609
  # The account on behalf of which to charge.
767
2610
  attr_accessor :on_behalf_of
768
2611
  # When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
769
2612
  attr_accessor :subscription_data
2613
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
2614
+ attr_accessor :subscription_data_overrides
770
2615
  # The data with which to automatically create a Transfer for each of the invoices.
771
2616
  attr_accessor :transfer_data
772
2617
 
773
2618
  def initialize(
2619
+ allow_backdated_lines: nil,
774
2620
  application_fee_amount: nil,
775
2621
  application_fee_percent: nil,
776
2622
  automatic_tax: nil,
777
2623
  collection_method: nil,
778
2624
  customer: nil,
2625
+ customer_account: nil,
779
2626
  default_tax_rates: nil,
780
2627
  description: nil,
781
2628
  discounts: nil,
@@ -785,16 +2632,20 @@ module Stripe
785
2632
  header: nil,
786
2633
  invoice_settings: nil,
787
2634
  line_items: nil,
2635
+ lines: nil,
788
2636
  metadata: nil,
789
2637
  on_behalf_of: nil,
790
2638
  subscription_data: nil,
2639
+ subscription_data_overrides: nil,
791
2640
  transfer_data: nil
792
2641
  )
2642
+ @allow_backdated_lines = allow_backdated_lines
793
2643
  @application_fee_amount = application_fee_amount
794
2644
  @application_fee_percent = application_fee_percent
795
2645
  @automatic_tax = automatic_tax
796
2646
  @collection_method = collection_method
797
2647
  @customer = customer
2648
+ @customer_account = customer_account
798
2649
  @default_tax_rates = default_tax_rates
799
2650
  @description = description
800
2651
  @discounts = discounts
@@ -804,9 +2655,11 @@ module Stripe
804
2655
  @header = header
805
2656
  @invoice_settings = invoice_settings
806
2657
  @line_items = line_items
2658
+ @lines = lines
807
2659
  @metadata = metadata
808
2660
  @on_behalf_of = on_behalf_of
809
2661
  @subscription_data = subscription_data
2662
+ @subscription_data_overrides = subscription_data_overrides
810
2663
  @transfer_data = transfer_data
811
2664
  end
812
2665
  end
@@ -847,6 +2700,24 @@ module Stripe
847
2700
  end
848
2701
  end
849
2702
 
2703
+ class ListLinesParams < Stripe::RequestParams
2704
+ # 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.
2705
+ attr_accessor :ending_before
2706
+ # Specifies which fields in the response should be expanded.
2707
+ attr_accessor :expand
2708
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
2709
+ attr_accessor :limit
2710
+ # 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.
2711
+ attr_accessor :starting_after
2712
+
2713
+ def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
2714
+ @ending_before = ending_before
2715
+ @expand = expand
2716
+ @limit = limit
2717
+ @starting_after = starting_after
2718
+ end
2719
+ end
2720
+
850
2721
  class AcceptParams < Stripe::RequestParams
851
2722
  # Specifies which fields in the response should be expanded.
852
2723
  attr_accessor :expand
@@ -877,6 +2748,36 @@ module Stripe
877
2748
  end
878
2749
  end
879
2750
 
2751
+ class MarkDraftParams < Stripe::RequestParams
2752
+ # Specifies which fields in the response should be expanded.
2753
+ attr_accessor :expand
2754
+
2755
+ def initialize(expand: nil)
2756
+ @expand = expand
2757
+ end
2758
+ end
2759
+
2760
+ class MarkStaleParams < Stripe::RequestParams
2761
+ # Specifies which fields in the response should be expanded.
2762
+ attr_accessor :expand
2763
+ # Reason the Quote is being marked stale.
2764
+ attr_accessor :reason
2765
+
2766
+ def initialize(expand: nil, reason: nil)
2767
+ @expand = expand
2768
+ @reason = reason
2769
+ end
2770
+ end
2771
+
2772
+ class ReestimateParams < Stripe::RequestParams
2773
+ # Specifies which fields in the response should be expanded.
2774
+ attr_accessor :expand
2775
+
2776
+ def initialize(expand: nil)
2777
+ @expand = expand
2778
+ end
2779
+ end
2780
+
880
2781
  class PdfParams < Stripe::RequestParams
881
2782
  # Specifies which fields in the response should be expanded.
882
2783
  attr_accessor :expand
@@ -885,6 +2786,26 @@ module Stripe
885
2786
  @expand = expand
886
2787
  end
887
2788
  end
2789
+
2790
+ class ListPreviewInvoiceLinesParams < Stripe::RequestParams
2791
+ # 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.
2792
+ attr_accessor :ending_before
2793
+ # Specifies which fields in the response should be expanded.
2794
+ attr_accessor :expand
2795
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
2796
+ attr_accessor :limit
2797
+ # 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.
2798
+ attr_accessor :starting_after
2799
+
2800
+ def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
2801
+ @ending_before = ending_before
2802
+ @expand = expand
2803
+ @limit = limit
2804
+ @starting_after = starting_after
2805
+ end
2806
+ end
2807
+ # Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
2808
+ attr_reader :allow_backdated_lines
888
2809
  # Total before any discounts or taxes are applied.
889
2810
  attr_reader :amount_subtotal
890
2811
  # Total after discounts and taxes are applied.
@@ -907,6 +2828,8 @@ module Stripe
907
2828
  attr_reader :currency
908
2829
  # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
909
2830
  attr_reader :customer
2831
+ # The account which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
2832
+ attr_reader :customer_account
910
2833
  # The tax rates applied to this quote.
911
2834
  attr_reader :default_tax_rates
912
2835
  # A description that will be displayed on the quote PDF.
@@ -929,6 +2852,8 @@ module Stripe
929
2852
  attr_reader :invoice_settings
930
2853
  # A list of items the customer is being quoted for.
931
2854
  attr_reader :line_items
2855
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
2856
+ attr_reader :lines
932
2857
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
933
2858
  attr_reader :livemode
934
2859
  # 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.
@@ -941,14 +2866,20 @@ module Stripe
941
2866
  attr_reader :on_behalf_of
942
2867
  # The status of the quote.
943
2868
  attr_reader :status
2869
+ # Details on when and why a quote has been marked as stale or canceled.
2870
+ attr_reader :status_details
944
2871
  # Attribute for field status_transitions
945
2872
  attr_reader :status_transitions
946
2873
  # The subscription that was created or updated from this quote.
947
2874
  attr_reader :subscription
948
2875
  # Attribute for field subscription_data
949
2876
  attr_reader :subscription_data
2877
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
2878
+ attr_reader :subscription_data_overrides
950
2879
  # The subscription schedule that was created or updated from this quote.
951
2880
  attr_reader :subscription_schedule
2881
+ # The subscription schedules that were created or updated from this quote.
2882
+ attr_reader :subscription_schedules
952
2883
  # ID of the test clock this quote belongs to.
953
2884
  attr_reader :test_clock
954
2885
  # Attribute for field total_details
@@ -1066,6 +2997,86 @@ module Stripe
1066
2997
  )
1067
2998
  end
1068
2999
 
3000
+ # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3001
+ def list_lines(params = {}, opts = {})
3002
+ request_stripe_object(
3003
+ method: :get,
3004
+ path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
3005
+ params: params,
3006
+ opts: opts
3007
+ )
3008
+ end
3009
+
3010
+ # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3011
+ def self.list_lines(quote, params = {}, opts = {})
3012
+ request_stripe_object(
3013
+ method: :get,
3014
+ path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
3015
+ params: params,
3016
+ opts: opts
3017
+ )
3018
+ end
3019
+
3020
+ # Preview the invoice line items that would be generated by accepting the quote.
3021
+ def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
3022
+ request_stripe_object(
3023
+ method: :get,
3024
+ path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
3025
+ params: params,
3026
+ opts: opts
3027
+ )
3028
+ end
3029
+
3030
+ # Preview the invoice line items that would be generated by accepting the quote.
3031
+ def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
3032
+ request_stripe_object(
3033
+ method: :get,
3034
+ path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
3035
+ params: params,
3036
+ opts: opts
3037
+ )
3038
+ end
3039
+
3040
+ # Converts a stale quote to draft.
3041
+ def mark_draft(params = {}, opts = {})
3042
+ request_stripe_object(
3043
+ method: :post,
3044
+ path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
3045
+ params: params,
3046
+ opts: opts
3047
+ )
3048
+ end
3049
+
3050
+ # Converts a stale quote to draft.
3051
+ def self.mark_draft(quote, params = {}, opts = {})
3052
+ request_stripe_object(
3053
+ method: :post,
3054
+ path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
3055
+ params: params,
3056
+ opts: opts
3057
+ )
3058
+ end
3059
+
3060
+ # Converts a draft or open quote to stale.
3061
+ def mark_stale(params = {}, opts = {})
3062
+ request_stripe_object(
3063
+ method: :post,
3064
+ path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
3065
+ params: params,
3066
+ opts: opts
3067
+ )
3068
+ end
3069
+
3070
+ # Converts a draft or open quote to stale.
3071
+ def self.mark_stale(quote, params = {}, opts = {})
3072
+ request_stripe_object(
3073
+ method: :post,
3074
+ path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
3075
+ params: params,
3076
+ opts: opts
3077
+ )
3078
+ end
3079
+
1069
3080
  # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
1070
3081
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
1071
3082
  opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
@@ -1092,6 +3103,26 @@ module Stripe
1092
3103
  )
1093
3104
  end
1094
3105
 
3106
+ # Recompute the upcoming invoice estimate for the quote.
3107
+ def reestimate(params = {}, opts = {})
3108
+ request_stripe_object(
3109
+ method: :post,
3110
+ path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
3111
+ params: params,
3112
+ opts: opts
3113
+ )
3114
+ end
3115
+
3116
+ # Recompute the upcoming invoice estimate for the quote.
3117
+ def self.reestimate(quote, params = {}, opts = {})
3118
+ request_stripe_object(
3119
+ method: :post,
3120
+ path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
3121
+ params: params,
3122
+ opts: opts
3123
+ )
3124
+ end
3125
+
1095
3126
  # A quote models prices and services for a customer.
1096
3127
  def self.update(quote, params = {}, opts = {})
1097
3128
  request_stripe_object(