stripe 13.3.0 → 13.4.0.pre.beta.2

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