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