stripe 15.0.0 → 15.1.0.pre.beta.2

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