stripe 12.5.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (688) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +197 -9
  3. data/Gemfile +4 -0
  4. data/Makefile +2 -0
  5. data/OPENAPI_VERSION +1 -1
  6. data/README.md +48 -13
  7. data/Rakefile +0 -5
  8. data/VERSION +1 -1
  9. data/examples/README.md +16 -0
  10. data/examples/example_template.rb +36 -0
  11. data/examples/meter_event_stream.rb +57 -0
  12. data/examples/thinevent_webhook_handler.rb +39 -0
  13. data/justfile +43 -0
  14. data/lib/stripe/api_operations/nested_resource.rb +1 -21
  15. data/lib/stripe/api_operations/request.rb +20 -69
  16. data/lib/stripe/api_operations/save.rb +5 -3
  17. data/lib/stripe/api_operations/singleton_save.rb +6 -2
  18. data/lib/stripe/api_requestor.rb +1136 -0
  19. data/lib/stripe/api_resource.rb +38 -17
  20. data/lib/stripe/api_version.rb +1 -1
  21. data/lib/stripe/connection_manager.rb +1 -1
  22. data/lib/stripe/errors.rb +8 -9
  23. data/lib/stripe/event_types.rb +14 -0
  24. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
  25. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
  26. data/lib/stripe/list_object.rb +2 -3
  27. data/lib/stripe/oauth.rb +8 -15
  28. data/lib/stripe/object_types.rb +26 -3
  29. data/lib/stripe/request_options.rb +129 -0
  30. data/lib/stripe/request_params.rb +24 -0
  31. data/lib/stripe/resources/account.rb +4642 -8
  32. data/lib/stripe/resources/account_link.rb +54 -0
  33. data/lib/stripe/resources/account_session.rb +739 -0
  34. data/lib/stripe/resources/apple_pay_domain.rb +58 -9
  35. data/lib/stripe/resources/application.rb +20 -0
  36. data/lib/stripe/resources/application_fee.rb +89 -2
  37. data/lib/stripe/resources/application_fee_refund.rb +17 -0
  38. data/lib/stripe/resources/apps/secret.rb +143 -2
  39. data/lib/stripe/resources/balance.rb +122 -0
  40. data/lib/stripe/resources/balance_transaction.rb +105 -2
  41. data/lib/stripe/resources/bank_account.rb +85 -3
  42. data/lib/stripe/resources/billing/alert.rb +137 -2
  43. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  44. data/lib/stripe/resources/billing/credit_balance_summary.rb +54 -0
  45. data/lib/stripe/resources/billing/credit_balance_transaction.rb +133 -0
  46. data/lib/stripe/resources/billing/credit_grant.rb +307 -0
  47. data/lib/stripe/resources/billing/meter.rb +180 -9
  48. data/lib/stripe/resources/billing/meter_event.rb +37 -3
  49. data/lib/stripe/resources/billing/meter_event_adjustment.rb +44 -1
  50. data/lib/stripe/resources/billing/meter_event_summary.rb +17 -0
  51. data/lib/stripe/resources/billing_portal/configuration.rb +557 -4
  52. data/lib/stripe/resources/billing_portal/session.rb +271 -0
  53. data/lib/stripe/resources/capability.rb +84 -0
  54. data/lib/stripe/resources/card.rb +78 -1
  55. data/lib/stripe/resources/cash_balance.rb +17 -0
  56. data/lib/stripe/resources/charge.rb +1616 -4
  57. data/lib/stripe/resources/checkout/session.rb +3534 -10
  58. data/lib/stripe/resources/climate/order.rb +171 -4
  59. data/lib/stripe/resources/climate/product.rb +49 -2
  60. data/lib/stripe/resources/climate/supplier.rb +47 -2
  61. data/lib/stripe/resources/confirmation_token.rb +1448 -0
  62. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  63. data/lib/stripe/resources/country_spec.rb +56 -2
  64. data/lib/stripe/resources/coupon.rb +195 -6
  65. data/lib/stripe/resources/credit_note.rb +641 -2
  66. data/lib/stripe/resources/credit_note_line_item.rb +67 -0
  67. data/lib/stripe/resources/customer.rb +832 -9
  68. data/lib/stripe/resources/customer_balance_transaction.rb +29 -0
  69. data/lib/stripe/resources/customer_cash_balance_transaction.rb +109 -0
  70. data/lib/stripe/resources/customer_session.rb +163 -0
  71. data/lib/stripe/resources/discount.rb +29 -0
  72. data/lib/stripe/resources/dispute.rb +614 -4
  73. data/lib/stripe/resources/entitlements/active_entitlement.rb +39 -2
  74. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  75. data/lib/stripe/resources/entitlements/feature.rb +83 -2
  76. data/lib/stripe/resources/ephemeral_key.rb +23 -2
  77. data/lib/stripe/resources/event.rb +92 -2
  78. data/lib/stripe/resources/exchange_rate.rb +26 -2
  79. data/lib/stripe/resources/file.rb +123 -15
  80. data/lib/stripe/resources/file_link.rb +107 -4
  81. data/lib/stripe/resources/financial_connections/account.rb +239 -2
  82. data/lib/stripe/resources/financial_connections/account_owner.rb +17 -0
  83. data/lib/stripe/resources/financial_connections/account_ownership.rb +9 -0
  84. data/lib/stripe/resources/financial_connections/session.rb +95 -0
  85. data/lib/stripe/resources/financial_connections/transaction.rb +94 -2
  86. data/lib/stripe/resources/forwarding/request.rb +158 -2
  87. data/lib/stripe/resources/funding_instructions.rb +308 -0
  88. data/lib/stripe/resources/identity/verification_report.rb +259 -2
  89. data/lib/stripe/resources/identity/verification_session.rb +356 -4
  90. data/lib/stripe/resources/invoice.rb +3210 -27
  91. data/lib/stripe/resources/invoice_item.rb +406 -6
  92. data/lib/stripe/resources/invoice_line_item.rb +356 -3
  93. data/lib/stripe/resources/invoice_payment.rb +105 -0
  94. data/lib/stripe/resources/invoice_rendering_template.rb +120 -0
  95. data/lib/stripe/resources/issuing/authorization.rb +1132 -6
  96. data/lib/stripe/resources/issuing/card.rb +682 -5
  97. data/lib/stripe/resources/issuing/cardholder.rb +653 -5
  98. data/lib/stripe/resources/issuing/dispute.rb +785 -4
  99. data/lib/stripe/resources/issuing/personalization_design.rb +280 -4
  100. data/lib/stripe/resources/issuing/physical_bundle.rb +56 -2
  101. data/lib/stripe/resources/issuing/token.rb +170 -4
  102. data/lib/stripe/resources/issuing/transaction.rb +916 -4
  103. data/lib/stripe/resources/line_item.rb +47 -0
  104. data/lib/stripe/resources/login_link.rb +7 -0
  105. data/lib/stripe/resources/mandate.rb +142 -0
  106. data/lib/stripe/resources/payment_intent.rb +8660 -4
  107. data/lib/stripe/resources/payment_link.rb +1636 -4
  108. data/lib/stripe/resources/payment_method.rb +1546 -4
  109. data/lib/stripe/resources/payment_method_configuration.rb +2780 -4
  110. data/lib/stripe/resources/payment_method_domain.rb +154 -10
  111. data/lib/stripe/resources/payout.rb +213 -4
  112. data/lib/stripe/resources/person.rb +264 -1
  113. data/lib/stripe/resources/plan.rb +308 -6
  114. data/lib/stripe/resources/price.rb +609 -5
  115. data/lib/stripe/resources/product.rb +474 -2
  116. data/lib/stripe/resources/product_feature.rb +12 -0
  117. data/lib/stripe/resources/promotion_code.rb +216 -4
  118. data/lib/stripe/resources/quote.rb +927 -10
  119. data/lib/stripe/resources/radar/early_fraud_warning.rb +70 -2
  120. data/lib/stripe/resources/radar/value_list.rb +122 -6
  121. data/lib/stripe/resources/radar/value_list_item.rb +90 -4
  122. data/lib/stripe/resources/refund.rb +396 -4
  123. data/lib/stripe/resources/reporting/report_run.rb +143 -2
  124. data/lib/stripe/resources/reporting/report_type.rb +29 -2
  125. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  126. data/lib/stripe/resources/reversal.rb +21 -0
  127. data/lib/stripe/resources/review.rb +101 -2
  128. data/lib/stripe/resources/setup_attempt.rb +370 -2
  129. data/lib/stripe/resources/setup_intent.rb +3477 -4
  130. data/lib/stripe/resources/shipping_rate.rb +254 -4
  131. data/lib/stripe/resources/sigma/scheduled_query_run.rb +47 -2
  132. data/lib/stripe/resources/source.rb +1203 -4
  133. data/lib/stripe/resources/source_mandate_notification.rb +66 -0
  134. data/lib/stripe/resources/source_transaction.rb +85 -0
  135. data/lib/stripe/resources/subscription.rb +1697 -11
  136. data/lib/stripe/resources/subscription_item.rb +319 -11
  137. data/lib/stripe/resources/subscription_schedule.rb +1285 -4
  138. data/lib/stripe/resources/tax/calculation.rb +378 -0
  139. data/lib/stripe/resources/tax/calculation_line_item.rb +56 -0
  140. data/lib/stripe/resources/tax/registration.rb +2375 -2
  141. data/lib/stripe/resources/tax/settings.rb +117 -0
  142. data/lib/stripe/resources/tax/transaction.rb +258 -0
  143. data/lib/stripe/resources/tax/transaction_line_item.rb +31 -0
  144. data/lib/stripe/resources/tax_code.rb +28 -2
  145. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  146. data/lib/stripe/resources/tax_id.rb +114 -2
  147. data/lib/stripe/resources/tax_rate.rb +197 -6
  148. data/lib/stripe/resources/terminal/configuration.rb +1266 -6
  149. data/lib/stripe/resources/terminal/connection_token.rb +18 -0
  150. data/lib/stripe/resources/terminal/location.rb +172 -6
  151. data/lib/stripe/resources/terminal/reader.rb +433 -6
  152. data/lib/stripe/resources/test_helpers/test_clock.rb +81 -4
  153. data/lib/stripe/resources/token.rb +1160 -1
  154. data/lib/stripe/resources/topup.rb +169 -4
  155. data/lib/stripe/resources/transfer.rb +148 -4
  156. data/lib/stripe/resources/treasury/credit_reversal.rb +85 -2
  157. data/lib/stripe/resources/treasury/debit_reversal.rb +96 -2
  158. data/lib/stripe/resources/treasury/financial_account.rb +749 -5
  159. data/lib/stripe/resources/treasury/financial_account_features.rb +189 -0
  160. data/lib/stripe/resources/treasury/inbound_transfer.rb +231 -3
  161. data/lib/stripe/resources/treasury/outbound_payment.rb +491 -3
  162. data/lib/stripe/resources/treasury/outbound_transfer.rb +346 -3
  163. data/lib/stripe/resources/treasury/received_credit.rb +239 -2
  164. data/lib/stripe/resources/treasury/received_debit.rb +198 -2
  165. data/lib/stripe/resources/treasury/transaction.rb +169 -2
  166. data/lib/stripe/resources/treasury/transaction_entry.rb +150 -2
  167. data/lib/stripe/resources/v2/amount.rb +9 -0
  168. data/lib/stripe/resources/v2/billing/meter_event.rb +34 -0
  169. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +36 -0
  170. data/lib/stripe/resources/v2/billing/meter_event_session.rb +29 -0
  171. data/lib/stripe/resources/v2/event.rb +41 -0
  172. data/lib/stripe/resources/v2/event_destination.rb +73 -0
  173. data/lib/stripe/resources/webhook_endpoint.rb +119 -11
  174. data/lib/stripe/resources.rb +19 -2
  175. data/lib/stripe/search_result_object.rb +1 -1
  176. data/lib/stripe/services/account_capability_service.rb +71 -0
  177. data/lib/stripe/services/account_external_account_service.rb +318 -0
  178. data/lib/stripe/services/account_link_service.rb +63 -0
  179. data/lib/stripe/services/account_login_link_service.rb +28 -0
  180. data/lib/stripe/services/account_person_service.rb +936 -0
  181. data/lib/stripe/services/account_service.rb +4100 -0
  182. data/lib/stripe/services/account_session_service.rb +501 -0
  183. data/lib/stripe/services/apple_pay_domain_service.rb +101 -0
  184. data/lib/stripe/services/application_fee_refund_service.rb +114 -0
  185. data/lib/stripe/services/application_fee_service.rb +92 -0
  186. data/lib/stripe/services/apps/secret_service.rb +168 -0
  187. data/lib/stripe/services/apps_service.rb +13 -0
  188. data/lib/stripe/services/balance_service.rb +21 -0
  189. data/lib/stripe/services/balance_transaction_service.rb +101 -0
  190. data/lib/stripe/services/billing/alert_service.rb +187 -0
  191. data/lib/stripe/services/billing/credit_balance_summary_service.rb +67 -0
  192. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +70 -0
  193. data/lib/stripe/services/billing/credit_grant_service.rb +240 -0
  194. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +45 -0
  195. data/lib/stripe/services/billing/meter_event_service.rb +40 -0
  196. data/lib/stripe/services/billing/meter_event_summary_service.rb +58 -0
  197. data/lib/stripe/services/billing/meter_service.rb +211 -0
  198. data/lib/stripe/services/billing_portal/configuration_service.rb +496 -0
  199. data/lib/stripe/services/billing_portal/session_service.rb +192 -0
  200. data/lib/stripe/services/billing_portal_service.rb +14 -0
  201. data/lib/stripe/services/billing_service.rb +20 -0
  202. data/lib/stripe/services/charge_service.rb +471 -0
  203. data/lib/stripe/services/checkout/session_line_item_service.rb +37 -0
  204. data/lib/stripe/services/checkout/session_service.rb +2466 -0
  205. data/lib/stripe/services/checkout_service.rb +13 -0
  206. data/lib/stripe/services/climate/order_service.rb +170 -0
  207. data/lib/stripe/services/climate/product_service.rb +57 -0
  208. data/lib/stripe/services/climate/supplier_service.rb +57 -0
  209. data/lib/stripe/services/climate_service.rb +15 -0
  210. data/lib/stripe/services/confirmation_token_service.rb +26 -0
  211. data/lib/stripe/services/country_spec_service.rb +55 -0
  212. data/lib/stripe/services/coupon_service.rb +203 -0
  213. data/lib/stripe/services/credit_note_line_item_service.rb +35 -0
  214. data/lib/stripe/services/credit_note_preview_lines_service.rb +169 -0
  215. data/lib/stripe/services/credit_note_service.rb +458 -0
  216. data/lib/stripe/services/customer_balance_transaction_service.rb +113 -0
  217. data/lib/stripe/services/customer_cash_balance_service.rb +57 -0
  218. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +55 -0
  219. data/lib/stripe/services/customer_funding_instructions_service.rb +61 -0
  220. data/lib/stripe/services/customer_payment_method_service.rb +68 -0
  221. data/lib/stripe/services/customer_payment_source_service.rb +255 -0
  222. data/lib/stripe/services/customer_service.rb +666 -0
  223. data/lib/stripe/services/customer_session_service.rb +113 -0
  224. data/lib/stripe/services/customer_tax_id_service.rb +95 -0
  225. data/lib/stripe/services/dispute_service.rb +422 -0
  226. data/lib/stripe/services/entitlements/active_entitlement_service.rb +66 -0
  227. data/lib/stripe/services/entitlements/feature_service.rb +128 -0
  228. data/lib/stripe/services/entitlements_service.rb +14 -0
  229. data/lib/stripe/services/ephemeral_key_service.rb +64 -0
  230. data/lib/stripe/services/event_service.rb +87 -0
  231. data/lib/stripe/services/exchange_rate_service.rb +55 -0
  232. data/lib/stripe/services/file_link_service.rb +132 -0
  233. data/lib/stripe/services/file_service.rb +124 -0
  234. data/lib/stripe/services/financial_connections/account_owner_service.rb +46 -0
  235. data/lib/stripe/services/financial_connections/account_service.rb +177 -0
  236. data/lib/stripe/services/financial_connections/session_service.rb +98 -0
  237. data/lib/stripe/services/financial_connections/transaction_service.rb +100 -0
  238. data/lib/stripe/services/financial_connections_service.rb +15 -0
  239. data/lib/stripe/services/forwarding/request_service.rb +147 -0
  240. data/lib/stripe/services/forwarding_service.rb +13 -0
  241. data/lib/stripe/services/identity/verification_report_service.rb +95 -0
  242. data/lib/stripe/services/identity/verification_session_service.rb +337 -0
  243. data/lib/stripe/services/identity_service.rb +14 -0
  244. data/lib/stripe/services/invoice_item_service.rb +395 -0
  245. data/lib/stripe/services/invoice_line_item_service.rb +252 -0
  246. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  247. data/lib/stripe/services/invoice_rendering_template_service.rb +101 -0
  248. data/lib/stripe/services/invoice_service.rb +2831 -0
  249. data/lib/stripe/services/issuing/authorization_service.rb +169 -0
  250. data/lib/stripe/services/issuing/card_service.rb +507 -0
  251. data/lib/stripe/services/issuing/cardholder_service.rb +577 -0
  252. data/lib/stripe/services/issuing/dispute_service.rb +696 -0
  253. data/lib/stripe/services/issuing/personalization_design_service.rb +245 -0
  254. data/lib/stripe/services/issuing/physical_bundle_service.rb +70 -0
  255. data/lib/stripe/services/issuing/token_service.rb +114 -0
  256. data/lib/stripe/services/issuing/transaction_service.rb +118 -0
  257. data/lib/stripe/services/issuing_service.rb +20 -0
  258. data/lib/stripe/services/mandate_service.rb +26 -0
  259. data/lib/stripe/services/oauth_service.rb +63 -0
  260. data/lib/stripe/services/payment_intent_service.rb +7258 -0
  261. data/lib/stripe/services/payment_link_line_item_service.rb +35 -0
  262. data/lib/stripe/services/payment_link_service.rb +1333 -0
  263. data/lib/stripe/services/payment_method_configuration_service.rb +2054 -0
  264. data/lib/stripe/services/payment_method_domain_service.rb +142 -0
  265. data/lib/stripe/services/payment_method_service.rb +894 -0
  266. data/lib/stripe/services/payout_service.rb +225 -0
  267. data/lib/stripe/services/plan_service.rb +298 -0
  268. data/lib/stripe/services/price_service.rb +545 -0
  269. data/lib/stripe/services/product_feature_service.rb +92 -0
  270. data/lib/stripe/services/product_service.rb +495 -0
  271. data/lib/stripe/services/promotion_code_service.rb +228 -0
  272. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +35 -0
  273. data/lib/stripe/services/quote_line_item_service.rb +35 -0
  274. data/lib/stripe/services/quote_service.rb +703 -0
  275. data/lib/stripe/services/radar/early_fraud_warning_service.rb +93 -0
  276. data/lib/stripe/services/radar/value_list_item_service.rb +131 -0
  277. data/lib/stripe/services/radar/value_list_service.rb +166 -0
  278. data/lib/stripe/services/radar_service.rb +15 -0
  279. data/lib/stripe/services/refund_service.rb +200 -0
  280. data/lib/stripe/services/reporting/report_run_service.rb +147 -0
  281. data/lib/stripe/services/reporting/report_type_service.rb +48 -0
  282. data/lib/stripe/services/reporting_service.rb +14 -0
  283. data/lib/stripe/services/review_service.rb +89 -0
  284. data/lib/stripe/services/setup_attempt_service.rb +68 -0
  285. data/lib/stripe/services/setup_intent_service.rb +3268 -0
  286. data/lib/stripe/services/shipping_rate_service.rb +250 -0
  287. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +57 -0
  288. data/lib/stripe/services/sigma_service.rb +13 -0
  289. data/lib/stripe/services/source_service.rb +665 -0
  290. data/lib/stripe/services/source_transaction_service.rb +35 -0
  291. data/lib/stripe/services/subscription_item_service.rb +346 -0
  292. data/lib/stripe/services/subscription_schedule_service.rb +1134 -0
  293. data/lib/stripe/services/subscription_service.rb +1539 -0
  294. data/lib/stripe/services/tax/calculation_line_item_service.rb +37 -0
  295. data/lib/stripe/services/tax/calculation_service.rb +242 -0
  296. data/lib/stripe/services/tax/registration_service.rb +1618 -0
  297. data/lib/stripe/services/tax/settings_service.rb +104 -0
  298. data/lib/stripe/services/tax/transaction_line_item_service.rb +37 -0
  299. data/lib/stripe/services/tax/transaction_service.rb +159 -0
  300. data/lib/stripe/services/tax_code_service.rb +49 -0
  301. data/lib/stripe/services/tax_id_service.rb +117 -0
  302. data/lib/stripe/services/tax_rate_service.rb +193 -0
  303. data/lib/stripe/services/tax_service.rb +16 -0
  304. data/lib/stripe/services/terminal/configuration_service.rb +1060 -0
  305. data/lib/stripe/services/terminal/connection_token_service.rb +31 -0
  306. data/lib/stripe/services/terminal/location_service.rb +208 -0
  307. data/lib/stripe/services/terminal/reader_service.rb +384 -0
  308. data/lib/stripe/services/terminal_service.rb +16 -0
  309. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +661 -0
  310. data/lib/stripe/services/test_helpers/customer_service.rb +37 -0
  311. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +832 -0
  312. data/lib/stripe/services/test_helpers/issuing/card_service.rb +110 -0
  313. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +84 -0
  314. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +675 -0
  315. data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
  316. data/lib/stripe/services/test_helpers/refund_service.rb +28 -0
  317. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +65 -0
  318. data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
  319. data/lib/stripe/services/test_helpers/test_clock_service.rb +120 -0
  320. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +81 -0
  321. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +141 -0
  322. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +141 -0
  323. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +81 -0
  324. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +81 -0
  325. data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
  326. data/lib/stripe/services/test_helpers_service.rb +19 -0
  327. data/lib/stripe/services/token_service.rb +1163 -0
  328. data/lib/stripe/services/topup_service.rb +191 -0
  329. data/lib/stripe/services/transfer_reversal_service.rb +122 -0
  330. data/lib/stripe/services/transfer_service.rb +166 -0
  331. data/lib/stripe/services/treasury/credit_reversal_service.rb +100 -0
  332. data/lib/stripe/services/treasury/debit_reversal_service.rb +104 -0
  333. data/lib/stripe/services/treasury/financial_account_features_service.rb +196 -0
  334. data/lib/stripe/services/treasury/financial_account_service.rb +554 -0
  335. data/lib/stripe/services/treasury/inbound_transfer_service.rb +140 -0
  336. data/lib/stripe/services/treasury/outbound_payment_service.rb +310 -0
  337. data/lib/stripe/services/treasury/outbound_transfer_service.rb +176 -0
  338. data/lib/stripe/services/treasury/received_credit_service.rb +82 -0
  339. data/lib/stripe/services/treasury/received_debit_service.rb +70 -0
  340. data/lib/stripe/services/treasury/transaction_entry_service.rb +117 -0
  341. data/lib/stripe/services/treasury/transaction_service.rb +125 -0
  342. data/lib/stripe/services/treasury_service.rb +22 -0
  343. data/lib/stripe/services/v1_services.rb +90 -0
  344. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +44 -0
  345. data/lib/stripe/services/v2/billing/meter_event_service.rb +46 -0
  346. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +24 -0
  347. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +56 -0
  348. data/lib/stripe/services/v2/billing_service.rb +18 -0
  349. data/lib/stripe/services/v2/core/event_destination_service.rb +241 -0
  350. data/lib/stripe/services/v2/core/event_service.rb +49 -0
  351. data/lib/stripe/services/v2/core_service.rb +16 -0
  352. data/lib/stripe/services/v2_services.rb +14 -0
  353. data/lib/stripe/services/webhook_endpoint_service.rb +157 -0
  354. data/lib/stripe/services.rb +180 -0
  355. data/lib/stripe/singleton_api_resource.rb +1 -18
  356. data/lib/stripe/stripe_client.rb +53 -1031
  357. data/lib/stripe/stripe_configuration.rb +52 -19
  358. data/lib/stripe/stripe_object.rb +54 -20
  359. data/lib/stripe/stripe_service.rb +32 -0
  360. data/lib/stripe/thin_event.rb +37 -0
  361. data/lib/stripe/util.rb +78 -37
  362. data/lib/stripe/v2_list_object.rb +84 -0
  363. data/lib/stripe/version.rb +1 -1
  364. data/lib/stripe/webhook.rb +1 -1
  365. data/lib/stripe.rb +38 -25
  366. data/rbi/stripe/resources/account.rbi +4840 -0
  367. data/rbi/stripe/resources/account_link.rbi +74 -0
  368. data/rbi/stripe/resources/account_session.rbi +894 -0
  369. data/rbi/stripe/resources/apple_pay_domain.rbi +90 -0
  370. data/rbi/stripe/resources/application.rbi +20 -0
  371. data/rbi/stripe/resources/application_fee.rbi +118 -0
  372. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  373. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  374. data/rbi/stripe/resources/balance.rbi +180 -0
  375. data/rbi/stripe/resources/balance_transaction.rbi +144 -0
  376. data/rbi/stripe/resources/bank_account.rbi +127 -0
  377. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  378. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  379. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  380. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  381. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  382. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  383. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  384. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  385. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  386. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  387. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  388. data/rbi/stripe/resources/capability.rbi +125 -0
  389. data/rbi/stripe/resources/card.rbi +125 -0
  390. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  391. data/rbi/stripe/resources/charge.rbi +2054 -0
  392. data/rbi/stripe/resources/checkout/session.rbi +3951 -0
  393. data/rbi/stripe/resources/climate/order.rbi +245 -0
  394. data/rbi/stripe/resources/climate/product.rbi +75 -0
  395. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  396. data/rbi/stripe/resources/confirmation_token.rbi +1793 -0
  397. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  398. data/rbi/stripe/resources/country_spec.rbi +85 -0
  399. data/rbi/stripe/resources/coupon.rbi +252 -0
  400. data/rbi/stripe/resources/credit_note.rbi +747 -0
  401. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  402. data/rbi/stripe/resources/customer.rbi +1009 -0
  403. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  404. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  405. data/rbi/stripe/resources/customer_session.rbi +200 -0
  406. data/rbi/stripe/resources/discount.rbi +53 -0
  407. data/rbi/stripe/resources/dispute.rbi +761 -0
  408. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  409. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  410. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  411. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  412. data/rbi/stripe/resources/event.rbi +146 -0
  413. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  414. data/rbi/stripe/resources/file.rbi +143 -0
  415. data/rbi/stripe/resources/file_link.rbi +141 -0
  416. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  417. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  418. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  419. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  420. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  421. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  422. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  423. data/rbi/stripe/resources/identity/verification_report.rbi +351 -0
  424. data/rbi/stripe/resources/identity/verification_session.rbi +517 -0
  425. data/rbi/stripe/resources/invoice.rbi +3733 -0
  426. data/rbi/stripe/resources/invoice_item.rbi +475 -0
  427. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  428. data/rbi/stripe/resources/invoice_payment.rbi +114 -0
  429. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  430. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  431. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  432. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  433. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  434. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  435. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  436. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  437. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  438. data/rbi/stripe/resources/line_item.rbi +72 -0
  439. data/rbi/stripe/resources/login_link.rbi +18 -0
  440. data/rbi/stripe/resources/mandate.rbi +187 -0
  441. data/rbi/stripe/resources/payment_intent.rbi +9731 -0
  442. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  443. data/rbi/stripe/resources/payment_method.rbi +1822 -0
  444. data/rbi/stripe/resources/payment_method_configuration.rbi +3154 -0
  445. data/rbi/stripe/resources/payment_method_domain.rbi +212 -0
  446. data/rbi/stripe/resources/payout.rbi +300 -0
  447. data/rbi/stripe/resources/person.rbi +371 -0
  448. data/rbi/stripe/resources/plan.rbi +373 -0
  449. data/rbi/stripe/resources/price.rbi +694 -0
  450. data/rbi/stripe/resources/product.rbi +557 -0
  451. data/rbi/stripe/resources/product_feature.rbi +26 -0
  452. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  453. data/rbi/stripe/resources/quote.rbi +1123 -0
  454. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  455. data/rbi/stripe/resources/radar/value_list.rbi +170 -0
  456. data/rbi/stripe/resources/radar/value_list_item.rbi +131 -0
  457. data/rbi/stripe/resources/refund.rbi +516 -0
  458. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  459. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  460. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  461. data/rbi/stripe/resources/reversal.rbi +51 -0
  462. data/rbi/stripe/resources/review.rbi +154 -0
  463. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  464. data/rbi/stripe/resources/setup_intent.rbi +3860 -0
  465. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  466. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  467. data/rbi/stripe/resources/source.rbi +1496 -0
  468. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  469. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  470. data/rbi/stripe/resources/subscription.rbi +1964 -0
  471. data/rbi/stripe/resources/subscription_item.rbi +370 -0
  472. data/rbi/stripe/resources/subscription_schedule.rbi +1495 -0
  473. data/rbi/stripe/resources/tax/calculation.rbi +474 -0
  474. data/rbi/stripe/resources/tax/calculation_line_item.rbi +88 -0
  475. data/rbi/stripe/resources/tax/registration.rbi +2485 -0
  476. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  477. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  478. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  479. data/rbi/stripe/resources/tax_code.rbi +44 -0
  480. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  481. data/rbi/stripe/resources/tax_id.rbi +167 -0
  482. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  483. data/rbi/stripe/resources/terminal/configuration.rbi +1388 -0
  484. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  485. data/rbi/stripe/resources/terminal/location.rbi +224 -0
  486. data/rbi/stripe/resources/terminal/reader.rbi +587 -0
  487. data/rbi/stripe/resources/test_helpers/test_clock.rbi +134 -0
  488. data/rbi/stripe/resources/token.rbi +1217 -0
  489. data/rbi/stripe/resources/topup.rbi +222 -0
  490. data/rbi/stripe/resources/transfer.rbi +199 -0
  491. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  492. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  493. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  494. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  495. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  496. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  497. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  498. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  499. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  500. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  501. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  502. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  503. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  504. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  505. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  506. data/rbi/stripe/resources/v2/event.rbi +48 -0
  507. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  508. data/rbi/stripe/resources/webhook_endpoint.rbi +170 -0
  509. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  510. data/rbi/stripe/services/account_external_account_service.rbi +306 -0
  511. data/rbi/stripe/services/account_link_service.rbi +58 -0
  512. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  513. data/rbi/stripe/services/account_person_service.rbi +923 -0
  514. data/rbi/stripe/services/account_service.rbi +4143 -0
  515. data/rbi/stripe/services/account_session_service.rbi +572 -0
  516. data/rbi/stripe/services/apple_pay_domain_service.rbi +78 -0
  517. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  518. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  519. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  520. data/rbi/stripe/services/apps_service.rbi +9 -0
  521. data/rbi/stripe/services/balance_service.rbi +21 -0
  522. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  523. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  524. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  525. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  526. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  527. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  528. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  529. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  530. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  531. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  532. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  533. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  534. data/rbi/stripe/services/billing_service.rbi +15 -0
  535. data/rbi/stripe/services/charge_service.rbi +448 -0
  536. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  537. data/rbi/stripe/services/checkout/session_service.rbi +2585 -0
  538. data/rbi/stripe/services/checkout_service.rbi +9 -0
  539. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  540. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  541. data/rbi/stripe/services/climate/supplier_service.rbi +46 -0
  542. data/rbi/stripe/services/climate_service.rbi +11 -0
  543. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  544. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  545. data/rbi/stripe/services/coupon_service.rbi +196 -0
  546. data/rbi/stripe/services/credit_note_line_item_service.rbi +31 -0
  547. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  548. data/rbi/stripe/services/credit_note_service.rbi +416 -0
  549. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  550. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  551. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  552. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  553. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  554. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  555. data/rbi/stripe/services/customer_service.rbi +651 -0
  556. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  557. data/rbi/stripe/services/customer_tax_id_service.rbi +72 -0
  558. data/rbi/stripe/services/dispute_service.rbi +424 -0
  559. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  560. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  561. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  562. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  563. data/rbi/stripe/services/event_service.rbi +83 -0
  564. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  565. data/rbi/stripe/services/file_link_service.rbi +124 -0
  566. data/rbi/stripe/services/file_service.rbi +116 -0
  567. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  568. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  569. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  570. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  571. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  572. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  573. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  574. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  575. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  576. data/rbi/stripe/services/identity_service.rbi +10 -0
  577. data/rbi/stripe/services/invoice_item_service.rbi +368 -0
  578. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  579. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  580. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  581. data/rbi/stripe/services/invoice_service.rbi +2920 -0
  582. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  583. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  584. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  585. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  586. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  587. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  588. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  589. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  590. data/rbi/stripe/services/issuing_service.rbi +16 -0
  591. data/rbi/stripe/services/mandate_service.rbi +20 -0
  592. data/rbi/stripe/services/payment_intent_service.rbi +7759 -0
  593. data/rbi/stripe/services/payment_link_line_item_service.rbi +31 -0
  594. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  595. data/rbi/stripe/services/payment_method_configuration_service.rbi +2211 -0
  596. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  597. data/rbi/stripe/services/payment_method_service.rbi +840 -0
  598. data/rbi/stripe/services/payout_service.rbi +205 -0
  599. data/rbi/stripe/services/plan_service.rbi +284 -0
  600. data/rbi/stripe/services/price_service.rbi +546 -0
  601. data/rbi/stripe/services/product_feature_service.rbi +69 -0
  602. data/rbi/stripe/services/product_service.rbi +479 -0
  603. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  604. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  605. data/rbi/stripe/services/quote_line_item_service.rbi +31 -0
  606. data/rbi/stripe/services/quote_service.rbi +686 -0
  607. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  608. data/rbi/stripe/services/radar/value_list_item_service.rbi +111 -0
  609. data/rbi/stripe/services/radar/value_list_service.rbi +143 -0
  610. data/rbi/stripe/services/radar_service.rbi +11 -0
  611. data/rbi/stripe/services/refund_service.rbi +185 -0
  612. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  613. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  614. data/rbi/stripe/services/reporting_service.rbi +10 -0
  615. data/rbi/stripe/services/review_service.rbi +84 -0
  616. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  617. data/rbi/stripe/services/setup_intent_service.rbi +3596 -0
  618. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  619. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  620. data/rbi/stripe/services/sigma_service.rbi +9 -0
  621. data/rbi/stripe/services/source_service.rbi +663 -0
  622. data/rbi/stripe/services/source_transaction_service.rbi +31 -0
  623. data/rbi/stripe/services/subscription_item_service.rbi +324 -0
  624. data/rbi/stripe/services/subscription_schedule_service.rbi +1192 -0
  625. data/rbi/stripe/services/subscription_service.rbi +1596 -0
  626. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +33 -0
  627. data/rbi/stripe/services/tax/calculation_service.rbi +230 -0
  628. data/rbi/stripe/services/tax/registration_service.rbi +1689 -0
  629. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  630. data/rbi/stripe/services/tax/transaction_line_item_service.rbi +33 -0
  631. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  632. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  633. data/rbi/stripe/services/tax_id_service.rbi +112 -0
  634. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  635. data/rbi/stripe/services/tax_service.rbi +12 -0
  636. data/rbi/stripe/services/terminal/configuration_service.rbi +1120 -0
  637. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  638. data/rbi/stripe/services/terminal/location_service.rbi +184 -0
  639. data/rbi/stripe/services/terminal/reader_service.rbi +344 -0
  640. data/rbi/stripe/services/terminal_service.rbi +12 -0
  641. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +746 -0
  642. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  643. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  644. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  645. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  646. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  647. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  648. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  649. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +62 -0
  650. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  651. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +92 -0
  652. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  653. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  654. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  655. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  656. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  657. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  658. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  659. data/rbi/stripe/services/token_service.rbi +1189 -0
  660. data/rbi/stripe/services/topup_service.rbi +176 -0
  661. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  662. data/rbi/stripe/services/transfer_service.rbi +152 -0
  663. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  664. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  665. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  666. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  667. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  668. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  669. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  670. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  671. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  672. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  673. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  674. data/rbi/stripe/services/treasury_service.rbi +18 -0
  675. data/rbi/stripe/services/v1_services.rbi +77 -0
  676. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  677. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  678. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +20 -0
  679. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  680. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  681. data/rbi/stripe/services/v2/core/event_destination_service.rbi +200 -0
  682. data/rbi/stripe/services/v2/core/event_service.rbi +38 -0
  683. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  684. data/rbi/stripe/services/v2_services.rbi +10 -0
  685. data/rbi/stripe/services/webhook_endpoint_service.rbi +131 -0
  686. metadata +533 -4
  687. data/lib/stripe/resources/usage_record.rb +0 -17
  688. data/lib/stripe/resources/usage_record_summary.rb +0 -11
@@ -0,0 +1,2831 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class InvoiceService < StripeService
6
+ attr_reader :line_items
7
+
8
+ def initialize(requestor)
9
+ super(requestor)
10
+ @line_items = Stripe::InvoiceLineItemService.new(@requestor)
11
+ end
12
+
13
+ class DeleteParams < Stripe::RequestParams
14
+ end
15
+
16
+ class RetrieveParams < Stripe::RequestParams
17
+ # Specifies which fields in the response should be expanded.
18
+ attr_accessor :expand
19
+
20
+ def initialize(expand: nil)
21
+ @expand = expand
22
+ end
23
+ end
24
+
25
+ class UpdateParams < Stripe::RequestParams
26
+ class AutomaticTax < Stripe::RequestParams
27
+ class Liability < Stripe::RequestParams
28
+ # The connected account being referenced when `type` is `account`.
29
+ attr_accessor :account
30
+ # Type of the account referenced in the request.
31
+ attr_accessor :type
32
+
33
+ def initialize(account: nil, type: nil)
34
+ @account = account
35
+ @type = type
36
+ end
37
+ end
38
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
39
+ attr_accessor :enabled
40
+ # 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.
41
+ attr_accessor :liability
42
+
43
+ def initialize(enabled: nil, liability: nil)
44
+ @enabled = enabled
45
+ @liability = liability
46
+ end
47
+ end
48
+
49
+ class CustomField < Stripe::RequestParams
50
+ # The name of the custom field. This may be up to 40 characters.
51
+ attr_accessor :name
52
+ # The value of the custom field. This may be up to 140 characters.
53
+ attr_accessor :value
54
+
55
+ def initialize(name: nil, value: nil)
56
+ @name = name
57
+ @value = value
58
+ end
59
+ end
60
+
61
+ class Discount < Stripe::RequestParams
62
+ # ID of the coupon to create a new discount for.
63
+ attr_accessor :coupon
64
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
65
+ attr_accessor :discount
66
+ # ID of the promotion code to create a new discount for.
67
+ attr_accessor :promotion_code
68
+
69
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
70
+ @coupon = coupon
71
+ @discount = discount
72
+ @promotion_code = promotion_code
73
+ end
74
+ end
75
+
76
+ class Issuer < Stripe::RequestParams
77
+ # The connected account being referenced when `type` is `account`.
78
+ attr_accessor :account
79
+ # Type of the account referenced in the request.
80
+ attr_accessor :type
81
+
82
+ def initialize(account: nil, type: nil)
83
+ @account = account
84
+ @type = type
85
+ end
86
+ end
87
+
88
+ class PaymentSettings < Stripe::RequestParams
89
+ class PaymentMethodOptions < Stripe::RequestParams
90
+ class AcssDebit < Stripe::RequestParams
91
+ class MandateOptions < Stripe::RequestParams
92
+ # Transaction type of the mandate.
93
+ attr_accessor :transaction_type
94
+
95
+ def initialize(transaction_type: nil)
96
+ @transaction_type = transaction_type
97
+ end
98
+ end
99
+ # Additional fields for Mandate creation
100
+ attr_accessor :mandate_options
101
+ # Verification method for the intent
102
+ attr_accessor :verification_method
103
+
104
+ def initialize(mandate_options: nil, verification_method: nil)
105
+ @mandate_options = mandate_options
106
+ @verification_method = verification_method
107
+ end
108
+ end
109
+
110
+ class Bancontact < Stripe::RequestParams
111
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
112
+ attr_accessor :preferred_language
113
+
114
+ def initialize(preferred_language: nil)
115
+ @preferred_language = preferred_language
116
+ end
117
+ end
118
+
119
+ class Card < Stripe::RequestParams
120
+ class Installments < Stripe::RequestParams
121
+ class Plan < Stripe::RequestParams
122
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
123
+ attr_accessor :count
124
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
125
+ # One of `month`.
126
+ attr_accessor :interval
127
+ # Type of installment plan, one of `fixed_count`.
128
+ attr_accessor :type
129
+
130
+ def initialize(count: nil, interval: nil, type: nil)
131
+ @count = count
132
+ @interval = interval
133
+ @type = type
134
+ end
135
+ end
136
+ # Setting to true enables installments for this invoice.
137
+ # Setting to false will prevent any selected plan from applying to a payment.
138
+ attr_accessor :enabled
139
+ # The selected installment plan to use for this invoice.
140
+ attr_accessor :plan
141
+
142
+ def initialize(enabled: nil, plan: nil)
143
+ @enabled = enabled
144
+ @plan = plan
145
+ end
146
+ end
147
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
148
+ #
149
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
150
+ attr_accessor :installments
151
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
152
+ attr_accessor :request_three_d_secure
153
+
154
+ def initialize(installments: nil, request_three_d_secure: nil)
155
+ @installments = installments
156
+ @request_three_d_secure = request_three_d_secure
157
+ end
158
+ end
159
+
160
+ class CustomerBalance < Stripe::RequestParams
161
+ class BankTransfer < Stripe::RequestParams
162
+ class EuBankTransfer < Stripe::RequestParams
163
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
164
+ attr_accessor :country
165
+
166
+ def initialize(country: nil)
167
+ @country = country
168
+ end
169
+ end
170
+ # Configuration for eu_bank_transfer funding type.
171
+ attr_accessor :eu_bank_transfer
172
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
173
+ attr_accessor :type
174
+
175
+ def initialize(eu_bank_transfer: nil, type: nil)
176
+ @eu_bank_transfer = eu_bank_transfer
177
+ @type = type
178
+ end
179
+ end
180
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
181
+ attr_accessor :bank_transfer
182
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
183
+ attr_accessor :funding_type
184
+
185
+ def initialize(bank_transfer: nil, funding_type: nil)
186
+ @bank_transfer = bank_transfer
187
+ @funding_type = funding_type
188
+ end
189
+ end
190
+
191
+ class Konbini < Stripe::RequestParams
192
+ end
193
+
194
+ class SepaDebit < Stripe::RequestParams
195
+ end
196
+
197
+ class UsBankAccount < Stripe::RequestParams
198
+ class FinancialConnections < Stripe::RequestParams
199
+ class Filters < Stripe::RequestParams
200
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
201
+ attr_accessor :account_subcategories
202
+
203
+ def initialize(account_subcategories: nil)
204
+ @account_subcategories = account_subcategories
205
+ end
206
+ end
207
+ # Provide filters for the linked accounts that the customer can select for the payment method.
208
+ attr_accessor :filters
209
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
210
+ attr_accessor :permissions
211
+ # List of data features that you would like to retrieve upon account creation.
212
+ attr_accessor :prefetch
213
+
214
+ def initialize(filters: nil, permissions: nil, prefetch: nil)
215
+ @filters = filters
216
+ @permissions = permissions
217
+ @prefetch = prefetch
218
+ end
219
+ end
220
+ # Additional fields for Financial Connections Session creation
221
+ attr_accessor :financial_connections
222
+ # Verification method for the intent
223
+ attr_accessor :verification_method
224
+
225
+ def initialize(financial_connections: nil, verification_method: nil)
226
+ @financial_connections = financial_connections
227
+ @verification_method = verification_method
228
+ end
229
+ end
230
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
231
+ attr_accessor :acss_debit
232
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
233
+ attr_accessor :bancontact
234
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
235
+ attr_accessor :card
236
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
237
+ attr_accessor :customer_balance
238
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
239
+ attr_accessor :konbini
240
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
241
+ attr_accessor :sepa_debit
242
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
243
+ attr_accessor :us_bank_account
244
+
245
+ def initialize(
246
+ acss_debit: nil,
247
+ bancontact: nil,
248
+ card: nil,
249
+ customer_balance: nil,
250
+ konbini: nil,
251
+ sepa_debit: nil,
252
+ us_bank_account: nil
253
+ )
254
+ @acss_debit = acss_debit
255
+ @bancontact = bancontact
256
+ @card = card
257
+ @customer_balance = customer_balance
258
+ @konbini = konbini
259
+ @sepa_debit = sepa_debit
260
+ @us_bank_account = us_bank_account
261
+ end
262
+ end
263
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
264
+ attr_accessor :default_mandate
265
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
266
+ attr_accessor :payment_method_options
267
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
268
+ attr_accessor :payment_method_types
269
+
270
+ def initialize(default_mandate: nil, payment_method_options: nil, payment_method_types: nil)
271
+ @default_mandate = default_mandate
272
+ @payment_method_options = payment_method_options
273
+ @payment_method_types = payment_method_types
274
+ end
275
+ end
276
+
277
+ class Rendering < Stripe::RequestParams
278
+ class Pdf < Stripe::RequestParams
279
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
280
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
281
+ # Japanese locale and `letter` for customers with other locales.
282
+ attr_accessor :page_size
283
+
284
+ def initialize(page_size: nil)
285
+ @page_size = page_size
286
+ end
287
+ end
288
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
289
+ attr_accessor :amount_tax_display
290
+ # Invoice pdf rendering options
291
+ attr_accessor :pdf
292
+ # ID of the invoice rendering template to use for this invoice.
293
+ attr_accessor :template
294
+ # The specific version of invoice rendering template to use for this invoice.
295
+ attr_accessor :template_version
296
+
297
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil)
298
+ @amount_tax_display = amount_tax_display
299
+ @pdf = pdf
300
+ @template = template
301
+ @template_version = template_version
302
+ end
303
+ end
304
+
305
+ class ShippingCost < Stripe::RequestParams
306
+ class ShippingRateData < Stripe::RequestParams
307
+ class DeliveryEstimate < Stripe::RequestParams
308
+ class Maximum < Stripe::RequestParams
309
+ # A unit of time.
310
+ attr_accessor :unit
311
+ # Must be greater than 0.
312
+ attr_accessor :value
313
+
314
+ def initialize(unit: nil, value: nil)
315
+ @unit = unit
316
+ @value = value
317
+ end
318
+ end
319
+
320
+ class Minimum < Stripe::RequestParams
321
+ # A unit of time.
322
+ attr_accessor :unit
323
+ # Must be greater than 0.
324
+ attr_accessor :value
325
+
326
+ def initialize(unit: nil, value: nil)
327
+ @unit = unit
328
+ @value = value
329
+ end
330
+ end
331
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
332
+ attr_accessor :maximum
333
+ # The lower bound of the estimated range. If empty, represents no lower bound.
334
+ attr_accessor :minimum
335
+
336
+ def initialize(maximum: nil, minimum: nil)
337
+ @maximum = maximum
338
+ @minimum = minimum
339
+ end
340
+ end
341
+
342
+ class FixedAmount < Stripe::RequestParams
343
+ class CurrencyOptions < Stripe::RequestParams
344
+ # A non-negative integer in cents representing how much to charge.
345
+ attr_accessor :amount
346
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
347
+ attr_accessor :tax_behavior
348
+
349
+ def initialize(amount: nil, tax_behavior: nil)
350
+ @amount = amount
351
+ @tax_behavior = tax_behavior
352
+ end
353
+ end
354
+ # A non-negative integer in cents representing how much to charge.
355
+ attr_accessor :amount
356
+ # 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).
357
+ attr_accessor :currency
358
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
359
+ attr_accessor :currency_options
360
+
361
+ def initialize(amount: nil, currency: nil, currency_options: nil)
362
+ @amount = amount
363
+ @currency = currency
364
+ @currency_options = currency_options
365
+ end
366
+ end
367
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
368
+ attr_accessor :delivery_estimate
369
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
370
+ attr_accessor :display_name
371
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
372
+ attr_accessor :fixed_amount
373
+ # 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`.
374
+ attr_accessor :metadata
375
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
376
+ attr_accessor :tax_behavior
377
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
378
+ attr_accessor :tax_code
379
+ # The type of calculation to use on the shipping rate.
380
+ attr_accessor :type
381
+
382
+ def initialize(
383
+ delivery_estimate: nil,
384
+ display_name: nil,
385
+ fixed_amount: nil,
386
+ metadata: nil,
387
+ tax_behavior: nil,
388
+ tax_code: nil,
389
+ type: nil
390
+ )
391
+ @delivery_estimate = delivery_estimate
392
+ @display_name = display_name
393
+ @fixed_amount = fixed_amount
394
+ @metadata = metadata
395
+ @tax_behavior = tax_behavior
396
+ @tax_code = tax_code
397
+ @type = type
398
+ end
399
+ end
400
+ # The ID of the shipping rate to use for this order.
401
+ attr_accessor :shipping_rate
402
+ # Parameters to create a new ad-hoc shipping rate for this order.
403
+ attr_accessor :shipping_rate_data
404
+
405
+ def initialize(shipping_rate: nil, shipping_rate_data: nil)
406
+ @shipping_rate = shipping_rate
407
+ @shipping_rate_data = shipping_rate_data
408
+ end
409
+ end
410
+
411
+ class ShippingDetails < Stripe::RequestParams
412
+ class Address < Stripe::RequestParams
413
+ # City, district, suburb, town, or village.
414
+ attr_accessor :city
415
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
416
+ attr_accessor :country
417
+ # Address line 1 (e.g., street, PO Box, or company name).
418
+ attr_accessor :line1
419
+ # Address line 2 (e.g., apartment, suite, unit, or building).
420
+ attr_accessor :line2
421
+ # ZIP or postal code.
422
+ attr_accessor :postal_code
423
+ # State, county, province, or region.
424
+ attr_accessor :state
425
+
426
+ def initialize(
427
+ city: nil,
428
+ country: nil,
429
+ line1: nil,
430
+ line2: nil,
431
+ postal_code: nil,
432
+ state: nil
433
+ )
434
+ @city = city
435
+ @country = country
436
+ @line1 = line1
437
+ @line2 = line2
438
+ @postal_code = postal_code
439
+ @state = state
440
+ end
441
+ end
442
+ # Shipping address
443
+ attr_accessor :address
444
+ # Recipient name.
445
+ attr_accessor :name
446
+ # Recipient phone (including extension)
447
+ attr_accessor :phone
448
+
449
+ def initialize(address: nil, name: nil, phone: nil)
450
+ @address = address
451
+ @name = name
452
+ @phone = phone
453
+ end
454
+ end
455
+
456
+ class TransferData < Stripe::RequestParams
457
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
458
+ attr_accessor :amount
459
+ # ID of an existing, connected Stripe account.
460
+ attr_accessor :destination
461
+
462
+ def initialize(amount: nil, destination: nil)
463
+ @amount = amount
464
+ @destination = destination
465
+ end
466
+ end
467
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
468
+ attr_accessor :account_tax_ids
469
+ # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
470
+ attr_accessor :application_fee_amount
471
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
472
+ attr_accessor :auto_advance
473
+ # Settings for automatic tax lookup for this invoice.
474
+ attr_accessor :automatic_tax
475
+ # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false.
476
+ attr_accessor :automatically_finalizes_at
477
+ # Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices.
478
+ attr_accessor :collection_method
479
+ # A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
480
+ attr_accessor :custom_fields
481
+ # The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
482
+ attr_accessor :days_until_due
483
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
484
+ attr_accessor :default_payment_method
485
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
486
+ attr_accessor :default_source
487
+ # The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates.
488
+ attr_accessor :default_tax_rates
489
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
490
+ attr_accessor :description
491
+ # The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
492
+ attr_accessor :discounts
493
+ # The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
494
+ attr_accessor :due_date
495
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
496
+ attr_accessor :effective_at
497
+ # Specifies which fields in the response should be expanded.
498
+ attr_accessor :expand
499
+ # Footer to be displayed on the invoice.
500
+ attr_accessor :footer
501
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
502
+ attr_accessor :issuer
503
+ # 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`.
504
+ attr_accessor :metadata
505
+ # Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.
506
+ attr_accessor :number
507
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
508
+ attr_accessor :on_behalf_of
509
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
510
+ attr_accessor :payment_settings
511
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
512
+ attr_accessor :rendering
513
+ # Settings for the cost of shipping for this invoice.
514
+ attr_accessor :shipping_cost
515
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
516
+ attr_accessor :shipping_details
517
+ # Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
518
+ attr_accessor :statement_descriptor
519
+ # If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value.
520
+ attr_accessor :transfer_data
521
+
522
+ def initialize(
523
+ account_tax_ids: nil,
524
+ application_fee_amount: nil,
525
+ auto_advance: nil,
526
+ automatic_tax: nil,
527
+ automatically_finalizes_at: nil,
528
+ collection_method: nil,
529
+ custom_fields: nil,
530
+ days_until_due: nil,
531
+ default_payment_method: nil,
532
+ default_source: nil,
533
+ default_tax_rates: nil,
534
+ description: nil,
535
+ discounts: nil,
536
+ due_date: nil,
537
+ effective_at: nil,
538
+ expand: nil,
539
+ footer: nil,
540
+ issuer: nil,
541
+ metadata: nil,
542
+ number: nil,
543
+ on_behalf_of: nil,
544
+ payment_settings: nil,
545
+ rendering: nil,
546
+ shipping_cost: nil,
547
+ shipping_details: nil,
548
+ statement_descriptor: nil,
549
+ transfer_data: nil
550
+ )
551
+ @account_tax_ids = account_tax_ids
552
+ @application_fee_amount = application_fee_amount
553
+ @auto_advance = auto_advance
554
+ @automatic_tax = automatic_tax
555
+ @automatically_finalizes_at = automatically_finalizes_at
556
+ @collection_method = collection_method
557
+ @custom_fields = custom_fields
558
+ @days_until_due = days_until_due
559
+ @default_payment_method = default_payment_method
560
+ @default_source = default_source
561
+ @default_tax_rates = default_tax_rates
562
+ @description = description
563
+ @discounts = discounts
564
+ @due_date = due_date
565
+ @effective_at = effective_at
566
+ @expand = expand
567
+ @footer = footer
568
+ @issuer = issuer
569
+ @metadata = metadata
570
+ @number = number
571
+ @on_behalf_of = on_behalf_of
572
+ @payment_settings = payment_settings
573
+ @rendering = rendering
574
+ @shipping_cost = shipping_cost
575
+ @shipping_details = shipping_details
576
+ @statement_descriptor = statement_descriptor
577
+ @transfer_data = transfer_data
578
+ end
579
+ end
580
+
581
+ class ListParams < Stripe::RequestParams
582
+ class Created < Stripe::RequestParams
583
+ # Minimum value to filter by (exclusive)
584
+ attr_accessor :gt
585
+ # Minimum value to filter by (inclusive)
586
+ attr_accessor :gte
587
+ # Maximum value to filter by (exclusive)
588
+ attr_accessor :lt
589
+ # Maximum value to filter by (inclusive)
590
+ attr_accessor :lte
591
+
592
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil)
593
+ @gt = gt
594
+ @gte = gte
595
+ @lt = lt
596
+ @lte = lte
597
+ end
598
+ end
599
+
600
+ class DueDate < Stripe::RequestParams
601
+ # Minimum value to filter by (exclusive)
602
+ attr_accessor :gt
603
+ # Minimum value to filter by (inclusive)
604
+ attr_accessor :gte
605
+ # Maximum value to filter by (exclusive)
606
+ attr_accessor :lt
607
+ # Maximum value to filter by (inclusive)
608
+ attr_accessor :lte
609
+
610
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil)
611
+ @gt = gt
612
+ @gte = gte
613
+ @lt = lt
614
+ @lte = lte
615
+ end
616
+ end
617
+ # The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`.
618
+ attr_accessor :collection_method
619
+ # Only return invoices that were created during the given date interval.
620
+ attr_accessor :created
621
+ # Only return invoices for the customer specified by this customer ID.
622
+ attr_accessor :customer
623
+ # Attribute for param field due_date
624
+ attr_accessor :due_date
625
+ # 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.
626
+ attr_accessor :ending_before
627
+ # Specifies which fields in the response should be expanded.
628
+ attr_accessor :expand
629
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
630
+ attr_accessor :limit
631
+ # 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.
632
+ attr_accessor :starting_after
633
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
634
+ attr_accessor :status
635
+ # Only return invoices for the subscription specified by this subscription ID.
636
+ attr_accessor :subscription
637
+
638
+ def initialize(
639
+ collection_method: nil,
640
+ created: nil,
641
+ customer: nil,
642
+ due_date: nil,
643
+ ending_before: nil,
644
+ expand: nil,
645
+ limit: nil,
646
+ starting_after: nil,
647
+ status: nil,
648
+ subscription: nil
649
+ )
650
+ @collection_method = collection_method
651
+ @created = created
652
+ @customer = customer
653
+ @due_date = due_date
654
+ @ending_before = ending_before
655
+ @expand = expand
656
+ @limit = limit
657
+ @starting_after = starting_after
658
+ @status = status
659
+ @subscription = subscription
660
+ end
661
+ end
662
+
663
+ class CreateParams < Stripe::RequestParams
664
+ class AutomaticTax < Stripe::RequestParams
665
+ class Liability < Stripe::RequestParams
666
+ # The connected account being referenced when `type` is `account`.
667
+ attr_accessor :account
668
+ # Type of the account referenced in the request.
669
+ attr_accessor :type
670
+
671
+ def initialize(account: nil, type: nil)
672
+ @account = account
673
+ @type = type
674
+ end
675
+ end
676
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
677
+ attr_accessor :enabled
678
+ # 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.
679
+ attr_accessor :liability
680
+
681
+ def initialize(enabled: nil, liability: nil)
682
+ @enabled = enabled
683
+ @liability = liability
684
+ end
685
+ end
686
+
687
+ class CustomField < Stripe::RequestParams
688
+ # The name of the custom field. This may be up to 40 characters.
689
+ attr_accessor :name
690
+ # The value of the custom field. This may be up to 140 characters.
691
+ attr_accessor :value
692
+
693
+ def initialize(name: nil, value: nil)
694
+ @name = name
695
+ @value = value
696
+ end
697
+ end
698
+
699
+ class Discount < Stripe::RequestParams
700
+ # ID of the coupon to create a new discount for.
701
+ attr_accessor :coupon
702
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
703
+ attr_accessor :discount
704
+ # ID of the promotion code to create a new discount for.
705
+ attr_accessor :promotion_code
706
+
707
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
708
+ @coupon = coupon
709
+ @discount = discount
710
+ @promotion_code = promotion_code
711
+ end
712
+ end
713
+
714
+ class FromInvoice < Stripe::RequestParams
715
+ # The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted
716
+ attr_accessor :action
717
+ # The `id` of the invoice that will be cloned.
718
+ attr_accessor :invoice
719
+
720
+ def initialize(action: nil, invoice: nil)
721
+ @action = action
722
+ @invoice = invoice
723
+ end
724
+ end
725
+
726
+ class Issuer < Stripe::RequestParams
727
+ # The connected account being referenced when `type` is `account`.
728
+ attr_accessor :account
729
+ # Type of the account referenced in the request.
730
+ attr_accessor :type
731
+
732
+ def initialize(account: nil, type: nil)
733
+ @account = account
734
+ @type = type
735
+ end
736
+ end
737
+
738
+ class PaymentSettings < Stripe::RequestParams
739
+ class PaymentMethodOptions < Stripe::RequestParams
740
+ class AcssDebit < Stripe::RequestParams
741
+ class MandateOptions < Stripe::RequestParams
742
+ # Transaction type of the mandate.
743
+ attr_accessor :transaction_type
744
+
745
+ def initialize(transaction_type: nil)
746
+ @transaction_type = transaction_type
747
+ end
748
+ end
749
+ # Additional fields for Mandate creation
750
+ attr_accessor :mandate_options
751
+ # Verification method for the intent
752
+ attr_accessor :verification_method
753
+
754
+ def initialize(mandate_options: nil, verification_method: nil)
755
+ @mandate_options = mandate_options
756
+ @verification_method = verification_method
757
+ end
758
+ end
759
+
760
+ class Bancontact < Stripe::RequestParams
761
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
762
+ attr_accessor :preferred_language
763
+
764
+ def initialize(preferred_language: nil)
765
+ @preferred_language = preferred_language
766
+ end
767
+ end
768
+
769
+ class Card < Stripe::RequestParams
770
+ class Installments < Stripe::RequestParams
771
+ class Plan < Stripe::RequestParams
772
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
773
+ attr_accessor :count
774
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
775
+ # One of `month`.
776
+ attr_accessor :interval
777
+ # Type of installment plan, one of `fixed_count`.
778
+ attr_accessor :type
779
+
780
+ def initialize(count: nil, interval: nil, type: nil)
781
+ @count = count
782
+ @interval = interval
783
+ @type = type
784
+ end
785
+ end
786
+ # Setting to true enables installments for this invoice.
787
+ # Setting to false will prevent any selected plan from applying to a payment.
788
+ attr_accessor :enabled
789
+ # The selected installment plan to use for this invoice.
790
+ attr_accessor :plan
791
+
792
+ def initialize(enabled: nil, plan: nil)
793
+ @enabled = enabled
794
+ @plan = plan
795
+ end
796
+ end
797
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
798
+ #
799
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
800
+ attr_accessor :installments
801
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
802
+ attr_accessor :request_three_d_secure
803
+
804
+ def initialize(installments: nil, request_three_d_secure: nil)
805
+ @installments = installments
806
+ @request_three_d_secure = request_three_d_secure
807
+ end
808
+ end
809
+
810
+ class CustomerBalance < Stripe::RequestParams
811
+ class BankTransfer < Stripe::RequestParams
812
+ class EuBankTransfer < Stripe::RequestParams
813
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
814
+ attr_accessor :country
815
+
816
+ def initialize(country: nil)
817
+ @country = country
818
+ end
819
+ end
820
+ # Configuration for eu_bank_transfer funding type.
821
+ attr_accessor :eu_bank_transfer
822
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
823
+ attr_accessor :type
824
+
825
+ def initialize(eu_bank_transfer: nil, type: nil)
826
+ @eu_bank_transfer = eu_bank_transfer
827
+ @type = type
828
+ end
829
+ end
830
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
831
+ attr_accessor :bank_transfer
832
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
833
+ attr_accessor :funding_type
834
+
835
+ def initialize(bank_transfer: nil, funding_type: nil)
836
+ @bank_transfer = bank_transfer
837
+ @funding_type = funding_type
838
+ end
839
+ end
840
+
841
+ class Konbini < Stripe::RequestParams
842
+ end
843
+
844
+ class SepaDebit < Stripe::RequestParams
845
+ end
846
+
847
+ class UsBankAccount < Stripe::RequestParams
848
+ class FinancialConnections < Stripe::RequestParams
849
+ class Filters < Stripe::RequestParams
850
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
851
+ attr_accessor :account_subcategories
852
+
853
+ def initialize(account_subcategories: nil)
854
+ @account_subcategories = account_subcategories
855
+ end
856
+ end
857
+ # Provide filters for the linked accounts that the customer can select for the payment method.
858
+ attr_accessor :filters
859
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
860
+ attr_accessor :permissions
861
+ # List of data features that you would like to retrieve upon account creation.
862
+ attr_accessor :prefetch
863
+
864
+ def initialize(filters: nil, permissions: nil, prefetch: nil)
865
+ @filters = filters
866
+ @permissions = permissions
867
+ @prefetch = prefetch
868
+ end
869
+ end
870
+ # Additional fields for Financial Connections Session creation
871
+ attr_accessor :financial_connections
872
+ # Verification method for the intent
873
+ attr_accessor :verification_method
874
+
875
+ def initialize(financial_connections: nil, verification_method: nil)
876
+ @financial_connections = financial_connections
877
+ @verification_method = verification_method
878
+ end
879
+ end
880
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
881
+ attr_accessor :acss_debit
882
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
883
+ attr_accessor :bancontact
884
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
885
+ attr_accessor :card
886
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
887
+ attr_accessor :customer_balance
888
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
889
+ attr_accessor :konbini
890
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
891
+ attr_accessor :sepa_debit
892
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
893
+ attr_accessor :us_bank_account
894
+
895
+ def initialize(
896
+ acss_debit: nil,
897
+ bancontact: nil,
898
+ card: nil,
899
+ customer_balance: nil,
900
+ konbini: nil,
901
+ sepa_debit: nil,
902
+ us_bank_account: nil
903
+ )
904
+ @acss_debit = acss_debit
905
+ @bancontact = bancontact
906
+ @card = card
907
+ @customer_balance = customer_balance
908
+ @konbini = konbini
909
+ @sepa_debit = sepa_debit
910
+ @us_bank_account = us_bank_account
911
+ end
912
+ end
913
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
914
+ attr_accessor :default_mandate
915
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
916
+ attr_accessor :payment_method_options
917
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
918
+ attr_accessor :payment_method_types
919
+
920
+ def initialize(default_mandate: nil, payment_method_options: nil, payment_method_types: nil)
921
+ @default_mandate = default_mandate
922
+ @payment_method_options = payment_method_options
923
+ @payment_method_types = payment_method_types
924
+ end
925
+ end
926
+
927
+ class Rendering < Stripe::RequestParams
928
+ class Pdf < Stripe::RequestParams
929
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
930
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
931
+ # Japanese locale and `letter` for customers with other locales.
932
+ attr_accessor :page_size
933
+
934
+ def initialize(page_size: nil)
935
+ @page_size = page_size
936
+ end
937
+ end
938
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
939
+ attr_accessor :amount_tax_display
940
+ # Invoice pdf rendering options
941
+ attr_accessor :pdf
942
+ # ID of the invoice rendering template to use for this invoice.
943
+ attr_accessor :template
944
+ # The specific version of invoice rendering template to use for this invoice.
945
+ attr_accessor :template_version
946
+
947
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil)
948
+ @amount_tax_display = amount_tax_display
949
+ @pdf = pdf
950
+ @template = template
951
+ @template_version = template_version
952
+ end
953
+ end
954
+
955
+ class ShippingCost < Stripe::RequestParams
956
+ class ShippingRateData < Stripe::RequestParams
957
+ class DeliveryEstimate < Stripe::RequestParams
958
+ class Maximum < Stripe::RequestParams
959
+ # A unit of time.
960
+ attr_accessor :unit
961
+ # Must be greater than 0.
962
+ attr_accessor :value
963
+
964
+ def initialize(unit: nil, value: nil)
965
+ @unit = unit
966
+ @value = value
967
+ end
968
+ end
969
+
970
+ class Minimum < Stripe::RequestParams
971
+ # A unit of time.
972
+ attr_accessor :unit
973
+ # Must be greater than 0.
974
+ attr_accessor :value
975
+
976
+ def initialize(unit: nil, value: nil)
977
+ @unit = unit
978
+ @value = value
979
+ end
980
+ end
981
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
982
+ attr_accessor :maximum
983
+ # The lower bound of the estimated range. If empty, represents no lower bound.
984
+ attr_accessor :minimum
985
+
986
+ def initialize(maximum: nil, minimum: nil)
987
+ @maximum = maximum
988
+ @minimum = minimum
989
+ end
990
+ end
991
+
992
+ class FixedAmount < Stripe::RequestParams
993
+ class CurrencyOptions < Stripe::RequestParams
994
+ # A non-negative integer in cents representing how much to charge.
995
+ attr_accessor :amount
996
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
997
+ attr_accessor :tax_behavior
998
+
999
+ def initialize(amount: nil, tax_behavior: nil)
1000
+ @amount = amount
1001
+ @tax_behavior = tax_behavior
1002
+ end
1003
+ end
1004
+ # A non-negative integer in cents representing how much to charge.
1005
+ attr_accessor :amount
1006
+ # 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).
1007
+ attr_accessor :currency
1008
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
1009
+ attr_accessor :currency_options
1010
+
1011
+ def initialize(amount: nil, currency: nil, currency_options: nil)
1012
+ @amount = amount
1013
+ @currency = currency
1014
+ @currency_options = currency_options
1015
+ end
1016
+ end
1017
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1018
+ attr_accessor :delivery_estimate
1019
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1020
+ attr_accessor :display_name
1021
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1022
+ attr_accessor :fixed_amount
1023
+ # 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`.
1024
+ attr_accessor :metadata
1025
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1026
+ attr_accessor :tax_behavior
1027
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1028
+ attr_accessor :tax_code
1029
+ # The type of calculation to use on the shipping rate.
1030
+ attr_accessor :type
1031
+
1032
+ def initialize(
1033
+ delivery_estimate: nil,
1034
+ display_name: nil,
1035
+ fixed_amount: nil,
1036
+ metadata: nil,
1037
+ tax_behavior: nil,
1038
+ tax_code: nil,
1039
+ type: nil
1040
+ )
1041
+ @delivery_estimate = delivery_estimate
1042
+ @display_name = display_name
1043
+ @fixed_amount = fixed_amount
1044
+ @metadata = metadata
1045
+ @tax_behavior = tax_behavior
1046
+ @tax_code = tax_code
1047
+ @type = type
1048
+ end
1049
+ end
1050
+ # The ID of the shipping rate to use for this order.
1051
+ attr_accessor :shipping_rate
1052
+ # Parameters to create a new ad-hoc shipping rate for this order.
1053
+ attr_accessor :shipping_rate_data
1054
+
1055
+ def initialize(shipping_rate: nil, shipping_rate_data: nil)
1056
+ @shipping_rate = shipping_rate
1057
+ @shipping_rate_data = shipping_rate_data
1058
+ end
1059
+ end
1060
+
1061
+ class ShippingDetails < Stripe::RequestParams
1062
+ class Address < Stripe::RequestParams
1063
+ # City, district, suburb, town, or village.
1064
+ attr_accessor :city
1065
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1066
+ attr_accessor :country
1067
+ # Address line 1 (e.g., street, PO Box, or company name).
1068
+ attr_accessor :line1
1069
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1070
+ attr_accessor :line2
1071
+ # ZIP or postal code.
1072
+ attr_accessor :postal_code
1073
+ # State, county, province, or region.
1074
+ attr_accessor :state
1075
+
1076
+ def initialize(
1077
+ city: nil,
1078
+ country: nil,
1079
+ line1: nil,
1080
+ line2: nil,
1081
+ postal_code: nil,
1082
+ state: nil
1083
+ )
1084
+ @city = city
1085
+ @country = country
1086
+ @line1 = line1
1087
+ @line2 = line2
1088
+ @postal_code = postal_code
1089
+ @state = state
1090
+ end
1091
+ end
1092
+ # Shipping address
1093
+ attr_accessor :address
1094
+ # Recipient name.
1095
+ attr_accessor :name
1096
+ # Recipient phone (including extension)
1097
+ attr_accessor :phone
1098
+
1099
+ def initialize(address: nil, name: nil, phone: nil)
1100
+ @address = address
1101
+ @name = name
1102
+ @phone = phone
1103
+ end
1104
+ end
1105
+
1106
+ class TransferData < Stripe::RequestParams
1107
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
1108
+ attr_accessor :amount
1109
+ # ID of an existing, connected Stripe account.
1110
+ attr_accessor :destination
1111
+
1112
+ def initialize(amount: nil, destination: nil)
1113
+ @amount = amount
1114
+ @destination = destination
1115
+ end
1116
+ end
1117
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1118
+ attr_accessor :account_tax_ids
1119
+ # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1120
+ attr_accessor :application_fee_amount
1121
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1122
+ attr_accessor :auto_advance
1123
+ # Settings for automatic tax lookup for this invoice.
1124
+ attr_accessor :automatic_tax
1125
+ # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state.
1126
+ attr_accessor :automatically_finalizes_at
1127
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`.
1128
+ attr_accessor :collection_method
1129
+ # The currency to create this invoice in. Defaults to that of `customer` if not specified.
1130
+ attr_accessor :currency
1131
+ # A list of up to 4 custom fields to be displayed on the invoice.
1132
+ attr_accessor :custom_fields
1133
+ # The ID of the customer who will be billed.
1134
+ attr_accessor :customer
1135
+ # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1136
+ attr_accessor :days_until_due
1137
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
1138
+ attr_accessor :default_payment_method
1139
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
1140
+ attr_accessor :default_source
1141
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
1142
+ attr_accessor :default_tax_rates
1143
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
1144
+ attr_accessor :description
1145
+ # The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts.
1146
+ attr_accessor :discounts
1147
+ # The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`.
1148
+ attr_accessor :due_date
1149
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
1150
+ attr_accessor :effective_at
1151
+ # Specifies which fields in the response should be expanded.
1152
+ attr_accessor :expand
1153
+ # Footer to be displayed on the invoice.
1154
+ attr_accessor :footer
1155
+ # Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
1156
+ attr_accessor :from_invoice
1157
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1158
+ attr_accessor :issuer
1159
+ # 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`.
1160
+ attr_accessor :metadata
1161
+ # Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.
1162
+ attr_accessor :number
1163
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
1164
+ attr_accessor :on_behalf_of
1165
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
1166
+ attr_accessor :payment_settings
1167
+ # How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted.
1168
+ attr_accessor :pending_invoice_items_behavior
1169
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
1170
+ attr_accessor :rendering
1171
+ # Settings for the cost of shipping for this invoice.
1172
+ attr_accessor :shipping_cost
1173
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
1174
+ attr_accessor :shipping_details
1175
+ # Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
1176
+ attr_accessor :statement_descriptor
1177
+ # The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected.
1178
+ attr_accessor :subscription
1179
+ # If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge.
1180
+ attr_accessor :transfer_data
1181
+
1182
+ def initialize(
1183
+ account_tax_ids: nil,
1184
+ application_fee_amount: nil,
1185
+ auto_advance: nil,
1186
+ automatic_tax: nil,
1187
+ automatically_finalizes_at: nil,
1188
+ collection_method: nil,
1189
+ currency: nil,
1190
+ custom_fields: nil,
1191
+ customer: nil,
1192
+ days_until_due: nil,
1193
+ default_payment_method: nil,
1194
+ default_source: nil,
1195
+ default_tax_rates: nil,
1196
+ description: nil,
1197
+ discounts: nil,
1198
+ due_date: nil,
1199
+ effective_at: nil,
1200
+ expand: nil,
1201
+ footer: nil,
1202
+ from_invoice: nil,
1203
+ issuer: nil,
1204
+ metadata: nil,
1205
+ number: nil,
1206
+ on_behalf_of: nil,
1207
+ payment_settings: nil,
1208
+ pending_invoice_items_behavior: nil,
1209
+ rendering: nil,
1210
+ shipping_cost: nil,
1211
+ shipping_details: nil,
1212
+ statement_descriptor: nil,
1213
+ subscription: nil,
1214
+ transfer_data: nil
1215
+ )
1216
+ @account_tax_ids = account_tax_ids
1217
+ @application_fee_amount = application_fee_amount
1218
+ @auto_advance = auto_advance
1219
+ @automatic_tax = automatic_tax
1220
+ @automatically_finalizes_at = automatically_finalizes_at
1221
+ @collection_method = collection_method
1222
+ @currency = currency
1223
+ @custom_fields = custom_fields
1224
+ @customer = customer
1225
+ @days_until_due = days_until_due
1226
+ @default_payment_method = default_payment_method
1227
+ @default_source = default_source
1228
+ @default_tax_rates = default_tax_rates
1229
+ @description = description
1230
+ @discounts = discounts
1231
+ @due_date = due_date
1232
+ @effective_at = effective_at
1233
+ @expand = expand
1234
+ @footer = footer
1235
+ @from_invoice = from_invoice
1236
+ @issuer = issuer
1237
+ @metadata = metadata
1238
+ @number = number
1239
+ @on_behalf_of = on_behalf_of
1240
+ @payment_settings = payment_settings
1241
+ @pending_invoice_items_behavior = pending_invoice_items_behavior
1242
+ @rendering = rendering
1243
+ @shipping_cost = shipping_cost
1244
+ @shipping_details = shipping_details
1245
+ @statement_descriptor = statement_descriptor
1246
+ @subscription = subscription
1247
+ @transfer_data = transfer_data
1248
+ end
1249
+ end
1250
+
1251
+ class SearchParams < Stripe::RequestParams
1252
+ # Specifies which fields in the response should be expanded.
1253
+ attr_accessor :expand
1254
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1255
+ attr_accessor :limit
1256
+ # A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
1257
+ attr_accessor :page
1258
+ # The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices).
1259
+ attr_accessor :query
1260
+
1261
+ def initialize(expand: nil, limit: nil, page: nil, query: nil)
1262
+ @expand = expand
1263
+ @limit = limit
1264
+ @page = page
1265
+ @query = query
1266
+ end
1267
+ end
1268
+
1269
+ class AddLinesParams < Stripe::RequestParams
1270
+ class Line < Stripe::RequestParams
1271
+ class Discount < Stripe::RequestParams
1272
+ # ID of the coupon to create a new discount for.
1273
+ attr_accessor :coupon
1274
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1275
+ attr_accessor :discount
1276
+ # ID of the promotion code to create a new discount for.
1277
+ attr_accessor :promotion_code
1278
+
1279
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1280
+ @coupon = coupon
1281
+ @discount = discount
1282
+ @promotion_code = promotion_code
1283
+ end
1284
+ end
1285
+
1286
+ class Period < Stripe::RequestParams
1287
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
1288
+ attr_accessor :end
1289
+ # The start of the period. This value is inclusive.
1290
+ attr_accessor :start
1291
+
1292
+ def initialize(end_: nil, start: nil)
1293
+ @end = end_
1294
+ @start = start
1295
+ end
1296
+ end
1297
+
1298
+ class PriceData < Stripe::RequestParams
1299
+ class ProductData < Stripe::RequestParams
1300
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
1301
+ attr_accessor :description
1302
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
1303
+ attr_accessor :images
1304
+ # 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`.
1305
+ attr_accessor :metadata
1306
+ # The product's name, meant to be displayable to the customer.
1307
+ attr_accessor :name
1308
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
1309
+ attr_accessor :tax_code
1310
+
1311
+ def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil)
1312
+ @description = description
1313
+ @images = images
1314
+ @metadata = metadata
1315
+ @name = name
1316
+ @tax_code = tax_code
1317
+ end
1318
+ end
1319
+ # 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).
1320
+ attr_accessor :currency
1321
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
1322
+ attr_accessor :product
1323
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
1324
+ attr_accessor :product_data
1325
+ # 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.
1326
+ attr_accessor :tax_behavior
1327
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
1328
+ attr_accessor :unit_amount
1329
+ # 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.
1330
+ attr_accessor :unit_amount_decimal
1331
+
1332
+ def initialize(
1333
+ currency: nil,
1334
+ product: nil,
1335
+ product_data: nil,
1336
+ tax_behavior: nil,
1337
+ unit_amount: nil,
1338
+ unit_amount_decimal: nil
1339
+ )
1340
+ @currency = currency
1341
+ @product = product
1342
+ @product_data = product_data
1343
+ @tax_behavior = tax_behavior
1344
+ @unit_amount = unit_amount
1345
+ @unit_amount_decimal = unit_amount_decimal
1346
+ end
1347
+ end
1348
+
1349
+ class Pricing < Stripe::RequestParams
1350
+ # The ID of the price object.
1351
+ attr_accessor :price
1352
+
1353
+ def initialize(price: nil)
1354
+ @price = price
1355
+ end
1356
+ end
1357
+
1358
+ class TaxAmount < Stripe::RequestParams
1359
+ class TaxRateData < Stripe::RequestParams
1360
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1361
+ attr_accessor :country
1362
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
1363
+ attr_accessor :description
1364
+ # The display name of the tax rate, which will be shown to users.
1365
+ attr_accessor :display_name
1366
+ # This specifies if the tax rate is inclusive or exclusive.
1367
+ attr_accessor :inclusive
1368
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
1369
+ attr_accessor :jurisdiction
1370
+ # The level of the jurisdiction that imposes this tax rate.
1371
+ attr_accessor :jurisdiction_level
1372
+ # The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
1373
+ attr_accessor :percentage
1374
+ # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
1375
+ attr_accessor :state
1376
+ # The high-level tax type, such as `vat` or `sales_tax`.
1377
+ attr_accessor :tax_type
1378
+
1379
+ def initialize(
1380
+ country: nil,
1381
+ description: nil,
1382
+ display_name: nil,
1383
+ inclusive: nil,
1384
+ jurisdiction: nil,
1385
+ jurisdiction_level: nil,
1386
+ percentage: nil,
1387
+ state: nil,
1388
+ tax_type: nil
1389
+ )
1390
+ @country = country
1391
+ @description = description
1392
+ @display_name = display_name
1393
+ @inclusive = inclusive
1394
+ @jurisdiction = jurisdiction
1395
+ @jurisdiction_level = jurisdiction_level
1396
+ @percentage = percentage
1397
+ @state = state
1398
+ @tax_type = tax_type
1399
+ end
1400
+ end
1401
+ # The amount, in cents (or local equivalent), of the tax.
1402
+ attr_accessor :amount
1403
+ # Data to find or create a TaxRate object.
1404
+ #
1405
+ # Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
1406
+ attr_accessor :tax_rate_data
1407
+ # The reasoning behind this tax, for example, if the product is tax exempt.
1408
+ attr_accessor :taxability_reason
1409
+ # The amount on which tax is calculated, in cents (or local equivalent).
1410
+ attr_accessor :taxable_amount
1411
+
1412
+ def initialize(
1413
+ amount: nil,
1414
+ tax_rate_data: nil,
1415
+ taxability_reason: nil,
1416
+ taxable_amount: nil
1417
+ )
1418
+ @amount = amount
1419
+ @tax_rate_data = tax_rate_data
1420
+ @taxability_reason = taxability_reason
1421
+ @taxable_amount = taxable_amount
1422
+ end
1423
+ end
1424
+ # The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
1425
+ attr_accessor :amount
1426
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
1427
+ attr_accessor :description
1428
+ # Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
1429
+ attr_accessor :discountable
1430
+ # The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
1431
+ attr_accessor :discounts
1432
+ # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1433
+ attr_accessor :invoice_item
1434
+ # 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`.
1435
+ attr_accessor :metadata
1436
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
1437
+ attr_accessor :period
1438
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1439
+ attr_accessor :price_data
1440
+ # The pricing information for the invoice item.
1441
+ attr_accessor :pricing
1442
+ # Non-negative integer. The quantity of units for the line item.
1443
+ attr_accessor :quantity
1444
+ # A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
1445
+ attr_accessor :tax_amounts
1446
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
1447
+ attr_accessor :tax_rates
1448
+
1449
+ def initialize(
1450
+ amount: nil,
1451
+ description: nil,
1452
+ discountable: nil,
1453
+ discounts: nil,
1454
+ invoice_item: nil,
1455
+ metadata: nil,
1456
+ period: nil,
1457
+ price_data: nil,
1458
+ pricing: nil,
1459
+ quantity: nil,
1460
+ tax_amounts: nil,
1461
+ tax_rates: nil
1462
+ )
1463
+ @amount = amount
1464
+ @description = description
1465
+ @discountable = discountable
1466
+ @discounts = discounts
1467
+ @invoice_item = invoice_item
1468
+ @metadata = metadata
1469
+ @period = period
1470
+ @price_data = price_data
1471
+ @pricing = pricing
1472
+ @quantity = quantity
1473
+ @tax_amounts = tax_amounts
1474
+ @tax_rates = tax_rates
1475
+ end
1476
+ end
1477
+ # Specifies which fields in the response should be expanded.
1478
+ attr_accessor :expand
1479
+ # 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`.
1480
+ attr_accessor :invoice_metadata
1481
+ # The line items to add.
1482
+ attr_accessor :lines
1483
+
1484
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil)
1485
+ @expand = expand
1486
+ @invoice_metadata = invoice_metadata
1487
+ @lines = lines
1488
+ end
1489
+ end
1490
+
1491
+ class FinalizeInvoiceParams < Stripe::RequestParams
1492
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1493
+ attr_accessor :auto_advance
1494
+ # Specifies which fields in the response should be expanded.
1495
+ attr_accessor :expand
1496
+
1497
+ def initialize(auto_advance: nil, expand: nil)
1498
+ @auto_advance = auto_advance
1499
+ @expand = expand
1500
+ end
1501
+ end
1502
+
1503
+ class MarkUncollectibleParams < Stripe::RequestParams
1504
+ # Specifies which fields in the response should be expanded.
1505
+ attr_accessor :expand
1506
+
1507
+ def initialize(expand: nil)
1508
+ @expand = expand
1509
+ end
1510
+ end
1511
+
1512
+ class PayParams < Stripe::RequestParams
1513
+ # Specifies which fields in the response should be expanded.
1514
+ attr_accessor :expand
1515
+ # In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due.
1516
+ #
1517
+ # Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`.
1518
+ attr_accessor :forgive
1519
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set.
1520
+ attr_accessor :mandate
1521
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).
1522
+ attr_accessor :off_session
1523
+ # Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`.
1524
+ attr_accessor :paid_out_of_band
1525
+ # A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.
1526
+ attr_accessor :payment_method
1527
+ # A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid.
1528
+ attr_accessor :source
1529
+
1530
+ def initialize(
1531
+ expand: nil,
1532
+ forgive: nil,
1533
+ mandate: nil,
1534
+ off_session: nil,
1535
+ paid_out_of_band: nil,
1536
+ payment_method: nil,
1537
+ source: nil
1538
+ )
1539
+ @expand = expand
1540
+ @forgive = forgive
1541
+ @mandate = mandate
1542
+ @off_session = off_session
1543
+ @paid_out_of_band = paid_out_of_band
1544
+ @payment_method = payment_method
1545
+ @source = source
1546
+ end
1547
+ end
1548
+
1549
+ class RemoveLinesParams < Stripe::RequestParams
1550
+ class Line < Stripe::RequestParams
1551
+ # Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice.
1552
+ attr_accessor :behavior
1553
+ # ID of an existing line item to remove from this invoice.
1554
+ attr_accessor :id
1555
+
1556
+ def initialize(behavior: nil, id: nil)
1557
+ @behavior = behavior
1558
+ @id = id
1559
+ end
1560
+ end
1561
+ # Specifies which fields in the response should be expanded.
1562
+ attr_accessor :expand
1563
+ # 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`.
1564
+ attr_accessor :invoice_metadata
1565
+ # The line items to remove.
1566
+ attr_accessor :lines
1567
+
1568
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil)
1569
+ @expand = expand
1570
+ @invoice_metadata = invoice_metadata
1571
+ @lines = lines
1572
+ end
1573
+ end
1574
+
1575
+ class SendInvoiceParams < Stripe::RequestParams
1576
+ # Specifies which fields in the response should be expanded.
1577
+ attr_accessor :expand
1578
+
1579
+ def initialize(expand: nil)
1580
+ @expand = expand
1581
+ end
1582
+ end
1583
+
1584
+ class UpdateLinesParams < Stripe::RequestParams
1585
+ class Line < Stripe::RequestParams
1586
+ class Discount < Stripe::RequestParams
1587
+ # ID of the coupon to create a new discount for.
1588
+ attr_accessor :coupon
1589
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1590
+ attr_accessor :discount
1591
+ # ID of the promotion code to create a new discount for.
1592
+ attr_accessor :promotion_code
1593
+
1594
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1595
+ @coupon = coupon
1596
+ @discount = discount
1597
+ @promotion_code = promotion_code
1598
+ end
1599
+ end
1600
+
1601
+ class Period < Stripe::RequestParams
1602
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
1603
+ attr_accessor :end
1604
+ # The start of the period. This value is inclusive.
1605
+ attr_accessor :start
1606
+
1607
+ def initialize(end_: nil, start: nil)
1608
+ @end = end_
1609
+ @start = start
1610
+ end
1611
+ end
1612
+
1613
+ class PriceData < Stripe::RequestParams
1614
+ class ProductData < Stripe::RequestParams
1615
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
1616
+ attr_accessor :description
1617
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
1618
+ attr_accessor :images
1619
+ # 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`.
1620
+ attr_accessor :metadata
1621
+ # The product's name, meant to be displayable to the customer.
1622
+ attr_accessor :name
1623
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
1624
+ attr_accessor :tax_code
1625
+
1626
+ def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil)
1627
+ @description = description
1628
+ @images = images
1629
+ @metadata = metadata
1630
+ @name = name
1631
+ @tax_code = tax_code
1632
+ end
1633
+ end
1634
+ # 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).
1635
+ attr_accessor :currency
1636
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
1637
+ attr_accessor :product
1638
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
1639
+ attr_accessor :product_data
1640
+ # 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.
1641
+ attr_accessor :tax_behavior
1642
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
1643
+ attr_accessor :unit_amount
1644
+ # 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.
1645
+ attr_accessor :unit_amount_decimal
1646
+
1647
+ def initialize(
1648
+ currency: nil,
1649
+ product: nil,
1650
+ product_data: nil,
1651
+ tax_behavior: nil,
1652
+ unit_amount: nil,
1653
+ unit_amount_decimal: nil
1654
+ )
1655
+ @currency = currency
1656
+ @product = product
1657
+ @product_data = product_data
1658
+ @tax_behavior = tax_behavior
1659
+ @unit_amount = unit_amount
1660
+ @unit_amount_decimal = unit_amount_decimal
1661
+ end
1662
+ end
1663
+
1664
+ class Pricing < Stripe::RequestParams
1665
+ # The ID of the price object.
1666
+ attr_accessor :price
1667
+
1668
+ def initialize(price: nil)
1669
+ @price = price
1670
+ end
1671
+ end
1672
+
1673
+ class TaxAmount < Stripe::RequestParams
1674
+ class TaxRateData < Stripe::RequestParams
1675
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1676
+ attr_accessor :country
1677
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
1678
+ attr_accessor :description
1679
+ # The display name of the tax rate, which will be shown to users.
1680
+ attr_accessor :display_name
1681
+ # This specifies if the tax rate is inclusive or exclusive.
1682
+ attr_accessor :inclusive
1683
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
1684
+ attr_accessor :jurisdiction
1685
+ # The level of the jurisdiction that imposes this tax rate.
1686
+ attr_accessor :jurisdiction_level
1687
+ # The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
1688
+ attr_accessor :percentage
1689
+ # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
1690
+ attr_accessor :state
1691
+ # The high-level tax type, such as `vat` or `sales_tax`.
1692
+ attr_accessor :tax_type
1693
+
1694
+ def initialize(
1695
+ country: nil,
1696
+ description: nil,
1697
+ display_name: nil,
1698
+ inclusive: nil,
1699
+ jurisdiction: nil,
1700
+ jurisdiction_level: nil,
1701
+ percentage: nil,
1702
+ state: nil,
1703
+ tax_type: nil
1704
+ )
1705
+ @country = country
1706
+ @description = description
1707
+ @display_name = display_name
1708
+ @inclusive = inclusive
1709
+ @jurisdiction = jurisdiction
1710
+ @jurisdiction_level = jurisdiction_level
1711
+ @percentage = percentage
1712
+ @state = state
1713
+ @tax_type = tax_type
1714
+ end
1715
+ end
1716
+ # The amount, in cents (or local equivalent), of the tax.
1717
+ attr_accessor :amount
1718
+ # Data to find or create a TaxRate object.
1719
+ #
1720
+ # Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
1721
+ attr_accessor :tax_rate_data
1722
+ # The reasoning behind this tax, for example, if the product is tax exempt.
1723
+ attr_accessor :taxability_reason
1724
+ # The amount on which tax is calculated, in cents (or local equivalent).
1725
+ attr_accessor :taxable_amount
1726
+
1727
+ def initialize(
1728
+ amount: nil,
1729
+ tax_rate_data: nil,
1730
+ taxability_reason: nil,
1731
+ taxable_amount: nil
1732
+ )
1733
+ @amount = amount
1734
+ @tax_rate_data = tax_rate_data
1735
+ @taxability_reason = taxability_reason
1736
+ @taxable_amount = taxable_amount
1737
+ end
1738
+ end
1739
+ # The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
1740
+ attr_accessor :amount
1741
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
1742
+ attr_accessor :description
1743
+ # Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
1744
+ attr_accessor :discountable
1745
+ # The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
1746
+ attr_accessor :discounts
1747
+ # ID of an existing line item on the invoice.
1748
+ attr_accessor :id
1749
+ # 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`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
1750
+ attr_accessor :metadata
1751
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
1752
+ attr_accessor :period
1753
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1754
+ attr_accessor :price_data
1755
+ # The pricing information for the invoice item.
1756
+ attr_accessor :pricing
1757
+ # Non-negative integer. The quantity of units for the line item.
1758
+ attr_accessor :quantity
1759
+ # A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
1760
+ attr_accessor :tax_amounts
1761
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
1762
+ attr_accessor :tax_rates
1763
+
1764
+ def initialize(
1765
+ amount: nil,
1766
+ description: nil,
1767
+ discountable: nil,
1768
+ discounts: nil,
1769
+ id: nil,
1770
+ metadata: nil,
1771
+ period: nil,
1772
+ price_data: nil,
1773
+ pricing: nil,
1774
+ quantity: nil,
1775
+ tax_amounts: nil,
1776
+ tax_rates: nil
1777
+ )
1778
+ @amount = amount
1779
+ @description = description
1780
+ @discountable = discountable
1781
+ @discounts = discounts
1782
+ @id = id
1783
+ @metadata = metadata
1784
+ @period = period
1785
+ @price_data = price_data
1786
+ @pricing = pricing
1787
+ @quantity = quantity
1788
+ @tax_amounts = tax_amounts
1789
+ @tax_rates = tax_rates
1790
+ end
1791
+ end
1792
+ # Specifies which fields in the response should be expanded.
1793
+ attr_accessor :expand
1794
+ # 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`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
1795
+ attr_accessor :invoice_metadata
1796
+ # The line items to update.
1797
+ attr_accessor :lines
1798
+
1799
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil)
1800
+ @expand = expand
1801
+ @invoice_metadata = invoice_metadata
1802
+ @lines = lines
1803
+ end
1804
+ end
1805
+
1806
+ class VoidInvoiceParams < Stripe::RequestParams
1807
+ # Specifies which fields in the response should be expanded.
1808
+ attr_accessor :expand
1809
+
1810
+ def initialize(expand: nil)
1811
+ @expand = expand
1812
+ end
1813
+ end
1814
+
1815
+ class CreatePreviewParams < Stripe::RequestParams
1816
+ class AutomaticTax < Stripe::RequestParams
1817
+ class Liability < Stripe::RequestParams
1818
+ # The connected account being referenced when `type` is `account`.
1819
+ attr_accessor :account
1820
+ # Type of the account referenced in the request.
1821
+ attr_accessor :type
1822
+
1823
+ def initialize(account: nil, type: nil)
1824
+ @account = account
1825
+ @type = type
1826
+ end
1827
+ end
1828
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
1829
+ attr_accessor :enabled
1830
+ # 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.
1831
+ attr_accessor :liability
1832
+
1833
+ def initialize(enabled: nil, liability: nil)
1834
+ @enabled = enabled
1835
+ @liability = liability
1836
+ end
1837
+ end
1838
+
1839
+ class CustomerDetails < Stripe::RequestParams
1840
+ class Address < Stripe::RequestParams
1841
+ # City, district, suburb, town, or village.
1842
+ attr_accessor :city
1843
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1844
+ attr_accessor :country
1845
+ # Address line 1 (e.g., street, PO Box, or company name).
1846
+ attr_accessor :line1
1847
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1848
+ attr_accessor :line2
1849
+ # ZIP or postal code.
1850
+ attr_accessor :postal_code
1851
+ # State, county, province, or region.
1852
+ attr_accessor :state
1853
+
1854
+ def initialize(
1855
+ city: nil,
1856
+ country: nil,
1857
+ line1: nil,
1858
+ line2: nil,
1859
+ postal_code: nil,
1860
+ state: nil
1861
+ )
1862
+ @city = city
1863
+ @country = country
1864
+ @line1 = line1
1865
+ @line2 = line2
1866
+ @postal_code = postal_code
1867
+ @state = state
1868
+ end
1869
+ end
1870
+
1871
+ class Shipping < Stripe::RequestParams
1872
+ class Address < Stripe::RequestParams
1873
+ # City, district, suburb, town, or village.
1874
+ attr_accessor :city
1875
+ # A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1876
+ attr_accessor :country
1877
+ # Address line 1 (e.g., street, PO Box, or company name).
1878
+ attr_accessor :line1
1879
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1880
+ attr_accessor :line2
1881
+ # ZIP or postal code.
1882
+ attr_accessor :postal_code
1883
+ # State, county, province, or region.
1884
+ attr_accessor :state
1885
+
1886
+ def initialize(
1887
+ city: nil,
1888
+ country: nil,
1889
+ line1: nil,
1890
+ line2: nil,
1891
+ postal_code: nil,
1892
+ state: nil
1893
+ )
1894
+ @city = city
1895
+ @country = country
1896
+ @line1 = line1
1897
+ @line2 = line2
1898
+ @postal_code = postal_code
1899
+ @state = state
1900
+ end
1901
+ end
1902
+ # Customer shipping address.
1903
+ attr_accessor :address
1904
+ # Customer name.
1905
+ attr_accessor :name
1906
+ # Customer phone (including extension).
1907
+ attr_accessor :phone
1908
+
1909
+ def initialize(address: nil, name: nil, phone: nil)
1910
+ @address = address
1911
+ @name = name
1912
+ @phone = phone
1913
+ end
1914
+ end
1915
+
1916
+ class Tax < Stripe::RequestParams
1917
+ # A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
1918
+ attr_accessor :ip_address
1919
+
1920
+ def initialize(ip_address: nil)
1921
+ @ip_address = ip_address
1922
+ end
1923
+ end
1924
+
1925
+ class TaxId < Stripe::RequestParams
1926
+ # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
1927
+ attr_accessor :type
1928
+ # Value of the tax ID.
1929
+ attr_accessor :value
1930
+
1931
+ def initialize(type: nil, value: nil)
1932
+ @type = type
1933
+ @value = value
1934
+ end
1935
+ end
1936
+ # The customer's address.
1937
+ attr_accessor :address
1938
+ # The customer's shipping information. Appears on invoices emailed to this customer.
1939
+ attr_accessor :shipping
1940
+ # Tax details about the customer.
1941
+ attr_accessor :tax
1942
+ # The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
1943
+ attr_accessor :tax_exempt
1944
+ # The customer's tax IDs.
1945
+ attr_accessor :tax_ids
1946
+
1947
+ def initialize(address: nil, shipping: nil, tax: nil, tax_exempt: nil, tax_ids: nil)
1948
+ @address = address
1949
+ @shipping = shipping
1950
+ @tax = tax
1951
+ @tax_exempt = tax_exempt
1952
+ @tax_ids = tax_ids
1953
+ end
1954
+ end
1955
+
1956
+ class Discount < Stripe::RequestParams
1957
+ # ID of the coupon to create a new discount for.
1958
+ attr_accessor :coupon
1959
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1960
+ attr_accessor :discount
1961
+ # ID of the promotion code to create a new discount for.
1962
+ attr_accessor :promotion_code
1963
+
1964
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1965
+ @coupon = coupon
1966
+ @discount = discount
1967
+ @promotion_code = promotion_code
1968
+ end
1969
+ end
1970
+
1971
+ class InvoiceItem < Stripe::RequestParams
1972
+ class Discount < Stripe::RequestParams
1973
+ # ID of the coupon to create a new discount for.
1974
+ attr_accessor :coupon
1975
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1976
+ attr_accessor :discount
1977
+ # ID of the promotion code to create a new discount for.
1978
+ attr_accessor :promotion_code
1979
+
1980
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1981
+ @coupon = coupon
1982
+ @discount = discount
1983
+ @promotion_code = promotion_code
1984
+ end
1985
+ end
1986
+
1987
+ class Period < Stripe::RequestParams
1988
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
1989
+ attr_accessor :end
1990
+ # The start of the period. This value is inclusive.
1991
+ attr_accessor :start
1992
+
1993
+ def initialize(end_: nil, start: nil)
1994
+ @end = end_
1995
+ @start = start
1996
+ end
1997
+ end
1998
+
1999
+ class PriceData < Stripe::RequestParams
2000
+ # 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).
2001
+ attr_accessor :currency
2002
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2003
+ attr_accessor :product
2004
+ # 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.
2005
+ attr_accessor :tax_behavior
2006
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2007
+ attr_accessor :unit_amount
2008
+ # 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.
2009
+ attr_accessor :unit_amount_decimal
2010
+
2011
+ def initialize(
2012
+ currency: nil,
2013
+ product: nil,
2014
+ tax_behavior: nil,
2015
+ unit_amount: nil,
2016
+ unit_amount_decimal: nil
2017
+ )
2018
+ @currency = currency
2019
+ @product = product
2020
+ @tax_behavior = tax_behavior
2021
+ @unit_amount = unit_amount
2022
+ @unit_amount_decimal = unit_amount_decimal
2023
+ end
2024
+ end
2025
+ # The integer amount in cents (or local equivalent) of previewed invoice item.
2026
+ attr_accessor :amount
2027
+ # 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). Only applicable to new invoice items.
2028
+ attr_accessor :currency
2029
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2030
+ attr_accessor :description
2031
+ # Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
2032
+ attr_accessor :discountable
2033
+ # The coupons to redeem into discounts for the invoice item in the preview.
2034
+ attr_accessor :discounts
2035
+ # The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
2036
+ attr_accessor :invoiceitem
2037
+ # 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`.
2038
+ attr_accessor :metadata
2039
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
2040
+ attr_accessor :period
2041
+ # The ID of the price object. One of `price` or `price_data` is required.
2042
+ attr_accessor :price
2043
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2044
+ attr_accessor :price_data
2045
+ # Non-negative integer. The quantity of units for the invoice item.
2046
+ attr_accessor :quantity
2047
+ # 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.
2048
+ attr_accessor :tax_behavior
2049
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2050
+ attr_accessor :tax_code
2051
+ # The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
2052
+ attr_accessor :tax_rates
2053
+ # The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
2054
+ attr_accessor :unit_amount
2055
+ # 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.
2056
+ attr_accessor :unit_amount_decimal
2057
+
2058
+ def initialize(
2059
+ amount: nil,
2060
+ currency: nil,
2061
+ description: nil,
2062
+ discountable: nil,
2063
+ discounts: nil,
2064
+ invoiceitem: nil,
2065
+ metadata: nil,
2066
+ period: nil,
2067
+ price: nil,
2068
+ price_data: nil,
2069
+ quantity: nil,
2070
+ tax_behavior: nil,
2071
+ tax_code: nil,
2072
+ tax_rates: nil,
2073
+ unit_amount: nil,
2074
+ unit_amount_decimal: nil
2075
+ )
2076
+ @amount = amount
2077
+ @currency = currency
2078
+ @description = description
2079
+ @discountable = discountable
2080
+ @discounts = discounts
2081
+ @invoiceitem = invoiceitem
2082
+ @metadata = metadata
2083
+ @period = period
2084
+ @price = price
2085
+ @price_data = price_data
2086
+ @quantity = quantity
2087
+ @tax_behavior = tax_behavior
2088
+ @tax_code = tax_code
2089
+ @tax_rates = tax_rates
2090
+ @unit_amount = unit_amount
2091
+ @unit_amount_decimal = unit_amount_decimal
2092
+ end
2093
+ end
2094
+
2095
+ class Issuer < Stripe::RequestParams
2096
+ # The connected account being referenced when `type` is `account`.
2097
+ attr_accessor :account
2098
+ # Type of the account referenced in the request.
2099
+ attr_accessor :type
2100
+
2101
+ def initialize(account: nil, type: nil)
2102
+ @account = account
2103
+ @type = type
2104
+ end
2105
+ end
2106
+
2107
+ class ScheduleDetails < Stripe::RequestParams
2108
+ class Phase < Stripe::RequestParams
2109
+ class AddInvoiceItem < Stripe::RequestParams
2110
+ class Discount < Stripe::RequestParams
2111
+ # ID of the coupon to create a new discount for.
2112
+ attr_accessor :coupon
2113
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2114
+ attr_accessor :discount
2115
+ # ID of the promotion code to create a new discount for.
2116
+ attr_accessor :promotion_code
2117
+
2118
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2119
+ @coupon = coupon
2120
+ @discount = discount
2121
+ @promotion_code = promotion_code
2122
+ end
2123
+ end
2124
+
2125
+ class PriceData < Stripe::RequestParams
2126
+ # 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).
2127
+ attr_accessor :currency
2128
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2129
+ attr_accessor :product
2130
+ # 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.
2131
+ attr_accessor :tax_behavior
2132
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
2133
+ attr_accessor :unit_amount
2134
+ # 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.
2135
+ attr_accessor :unit_amount_decimal
2136
+
2137
+ def initialize(
2138
+ currency: nil,
2139
+ product: nil,
2140
+ tax_behavior: nil,
2141
+ unit_amount: nil,
2142
+ unit_amount_decimal: nil
2143
+ )
2144
+ @currency = currency
2145
+ @product = product
2146
+ @tax_behavior = tax_behavior
2147
+ @unit_amount = unit_amount
2148
+ @unit_amount_decimal = unit_amount_decimal
2149
+ end
2150
+ end
2151
+ # The coupons to redeem into discounts for the item.
2152
+ attr_accessor :discounts
2153
+ # The ID of the price object. One of `price` or `price_data` is required.
2154
+ attr_accessor :price
2155
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2156
+ attr_accessor :price_data
2157
+ # Quantity for this item. Defaults to 1.
2158
+ attr_accessor :quantity
2159
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
2160
+ attr_accessor :tax_rates
2161
+
2162
+ def initialize(
2163
+ discounts: nil,
2164
+ price: nil,
2165
+ price_data: nil,
2166
+ quantity: nil,
2167
+ tax_rates: nil
2168
+ )
2169
+ @discounts = discounts
2170
+ @price = price
2171
+ @price_data = price_data
2172
+ @quantity = quantity
2173
+ @tax_rates = tax_rates
2174
+ end
2175
+ end
2176
+
2177
+ class AutomaticTax < Stripe::RequestParams
2178
+ class Liability < Stripe::RequestParams
2179
+ # The connected account being referenced when `type` is `account`.
2180
+ attr_accessor :account
2181
+ # Type of the account referenced in the request.
2182
+ attr_accessor :type
2183
+
2184
+ def initialize(account: nil, type: nil)
2185
+ @account = account
2186
+ @type = type
2187
+ end
2188
+ end
2189
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
2190
+ attr_accessor :enabled
2191
+ # 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.
2192
+ attr_accessor :liability
2193
+
2194
+ def initialize(enabled: nil, liability: nil)
2195
+ @enabled = enabled
2196
+ @liability = liability
2197
+ end
2198
+ end
2199
+
2200
+ class Discount < Stripe::RequestParams
2201
+ # ID of the coupon to create a new discount for.
2202
+ attr_accessor :coupon
2203
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2204
+ attr_accessor :discount
2205
+ # ID of the promotion code to create a new discount for.
2206
+ attr_accessor :promotion_code
2207
+
2208
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2209
+ @coupon = coupon
2210
+ @discount = discount
2211
+ @promotion_code = promotion_code
2212
+ end
2213
+ end
2214
+
2215
+ class InvoiceSettings < Stripe::RequestParams
2216
+ class Issuer < Stripe::RequestParams
2217
+ # The connected account being referenced when `type` is `account`.
2218
+ attr_accessor :account
2219
+ # Type of the account referenced in the request.
2220
+ attr_accessor :type
2221
+
2222
+ def initialize(account: nil, type: nil)
2223
+ @account = account
2224
+ @type = type
2225
+ end
2226
+ end
2227
+ # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
2228
+ attr_accessor :account_tax_ids
2229
+ # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
2230
+ attr_accessor :days_until_due
2231
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2232
+ attr_accessor :issuer
2233
+
2234
+ def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil)
2235
+ @account_tax_ids = account_tax_ids
2236
+ @days_until_due = days_until_due
2237
+ @issuer = issuer
2238
+ end
2239
+ end
2240
+
2241
+ class Item < Stripe::RequestParams
2242
+ class Discount < Stripe::RequestParams
2243
+ # ID of the coupon to create a new discount for.
2244
+ attr_accessor :coupon
2245
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2246
+ attr_accessor :discount
2247
+ # ID of the promotion code to create a new discount for.
2248
+ attr_accessor :promotion_code
2249
+
2250
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2251
+ @coupon = coupon
2252
+ @discount = discount
2253
+ @promotion_code = promotion_code
2254
+ end
2255
+ end
2256
+
2257
+ class PriceData < Stripe::RequestParams
2258
+ class Recurring < Stripe::RequestParams
2259
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2260
+ attr_accessor :interval
2261
+ # 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).
2262
+ attr_accessor :interval_count
2263
+
2264
+ def initialize(interval: nil, interval_count: nil)
2265
+ @interval = interval
2266
+ @interval_count = interval_count
2267
+ end
2268
+ end
2269
+ # 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).
2270
+ attr_accessor :currency
2271
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2272
+ attr_accessor :product
2273
+ # The recurring components of a price such as `interval` and `interval_count`.
2274
+ attr_accessor :recurring
2275
+ # 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.
2276
+ attr_accessor :tax_behavior
2277
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2278
+ attr_accessor :unit_amount
2279
+ # 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.
2280
+ attr_accessor :unit_amount_decimal
2281
+
2282
+ def initialize(
2283
+ currency: nil,
2284
+ product: nil,
2285
+ recurring: nil,
2286
+ tax_behavior: nil,
2287
+ unit_amount: nil,
2288
+ unit_amount_decimal: nil
2289
+ )
2290
+ @currency = currency
2291
+ @product = product
2292
+ @recurring = recurring
2293
+ @tax_behavior = tax_behavior
2294
+ @unit_amount = unit_amount
2295
+ @unit_amount_decimal = unit_amount_decimal
2296
+ end
2297
+ end
2298
+ # The coupons to redeem into discounts for the subscription item.
2299
+ attr_accessor :discounts
2300
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
2301
+ attr_accessor :metadata
2302
+ # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
2303
+ attr_accessor :plan
2304
+ # The ID of the price object.
2305
+ attr_accessor :price
2306
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2307
+ attr_accessor :price_data
2308
+ # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
2309
+ attr_accessor :quantity
2310
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
2311
+ attr_accessor :tax_rates
2312
+
2313
+ def initialize(
2314
+ discounts: nil,
2315
+ metadata: nil,
2316
+ plan: nil,
2317
+ price: nil,
2318
+ price_data: nil,
2319
+ quantity: nil,
2320
+ tax_rates: nil
2321
+ )
2322
+ @discounts = discounts
2323
+ @metadata = metadata
2324
+ @plan = plan
2325
+ @price = price
2326
+ @price_data = price_data
2327
+ @quantity = quantity
2328
+ @tax_rates = tax_rates
2329
+ end
2330
+ end
2331
+
2332
+ class TransferData < Stripe::RequestParams
2333
+ # 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.
2334
+ attr_accessor :amount_percent
2335
+ # ID of an existing, connected Stripe account.
2336
+ attr_accessor :destination
2337
+
2338
+ def initialize(amount_percent: nil, destination: nil)
2339
+ @amount_percent = amount_percent
2340
+ @destination = destination
2341
+ end
2342
+ end
2343
+ # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
2344
+ attr_accessor :add_invoice_items
2345
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
2346
+ attr_accessor :application_fee_percent
2347
+ # Automatic tax settings for this phase.
2348
+ attr_accessor :automatic_tax
2349
+ # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
2350
+ attr_accessor :billing_cycle_anchor
2351
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
2352
+ attr_accessor :collection_method
2353
+ # 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).
2354
+ attr_accessor :currency
2355
+ # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
2356
+ attr_accessor :default_payment_method
2357
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
2358
+ attr_accessor :default_tax_rates
2359
+ # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
2360
+ attr_accessor :description
2361
+ # The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
2362
+ attr_accessor :discounts
2363
+ # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
2364
+ attr_accessor :end_date
2365
+ # All invoices will be billed using the specified settings.
2366
+ attr_accessor :invoice_settings
2367
+ # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
2368
+ attr_accessor :items
2369
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
2370
+ attr_accessor :iterations
2371
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
2372
+ attr_accessor :metadata
2373
+ # The account on behalf of which to charge, for each of the associated subscription's invoices.
2374
+ attr_accessor :on_behalf_of
2375
+ # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
2376
+ attr_accessor :proration_behavior
2377
+ # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
2378
+ attr_accessor :start_date
2379
+ # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
2380
+ attr_accessor :transfer_data
2381
+ # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2382
+ attr_accessor :trial
2383
+ # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
2384
+ attr_accessor :trial_end
2385
+
2386
+ def initialize(
2387
+ add_invoice_items: nil,
2388
+ application_fee_percent: nil,
2389
+ automatic_tax: nil,
2390
+ billing_cycle_anchor: nil,
2391
+ collection_method: nil,
2392
+ currency: nil,
2393
+ default_payment_method: nil,
2394
+ default_tax_rates: nil,
2395
+ description: nil,
2396
+ discounts: nil,
2397
+ end_date: nil,
2398
+ invoice_settings: nil,
2399
+ items: nil,
2400
+ iterations: nil,
2401
+ metadata: nil,
2402
+ on_behalf_of: nil,
2403
+ proration_behavior: nil,
2404
+ start_date: nil,
2405
+ transfer_data: nil,
2406
+ trial: nil,
2407
+ trial_end: nil
2408
+ )
2409
+ @add_invoice_items = add_invoice_items
2410
+ @application_fee_percent = application_fee_percent
2411
+ @automatic_tax = automatic_tax
2412
+ @billing_cycle_anchor = billing_cycle_anchor
2413
+ @collection_method = collection_method
2414
+ @currency = currency
2415
+ @default_payment_method = default_payment_method
2416
+ @default_tax_rates = default_tax_rates
2417
+ @description = description
2418
+ @discounts = discounts
2419
+ @end_date = end_date
2420
+ @invoice_settings = invoice_settings
2421
+ @items = items
2422
+ @iterations = iterations
2423
+ @metadata = metadata
2424
+ @on_behalf_of = on_behalf_of
2425
+ @proration_behavior = proration_behavior
2426
+ @start_date = start_date
2427
+ @transfer_data = transfer_data
2428
+ @trial = trial
2429
+ @trial_end = trial_end
2430
+ end
2431
+ end
2432
+ # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
2433
+ attr_accessor :end_behavior
2434
+ # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
2435
+ attr_accessor :phases
2436
+ # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2437
+ attr_accessor :proration_behavior
2438
+
2439
+ def initialize(end_behavior: nil, phases: nil, proration_behavior: nil)
2440
+ @end_behavior = end_behavior
2441
+ @phases = phases
2442
+ @proration_behavior = proration_behavior
2443
+ end
2444
+ end
2445
+
2446
+ class SubscriptionDetails < Stripe::RequestParams
2447
+ class Item < Stripe::RequestParams
2448
+ class Discount < Stripe::RequestParams
2449
+ # ID of the coupon to create a new discount for.
2450
+ attr_accessor :coupon
2451
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2452
+ attr_accessor :discount
2453
+ # ID of the promotion code to create a new discount for.
2454
+ attr_accessor :promotion_code
2455
+
2456
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2457
+ @coupon = coupon
2458
+ @discount = discount
2459
+ @promotion_code = promotion_code
2460
+ end
2461
+ end
2462
+
2463
+ class PriceData < Stripe::RequestParams
2464
+ class Recurring < Stripe::RequestParams
2465
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2466
+ attr_accessor :interval
2467
+ # 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).
2468
+ attr_accessor :interval_count
2469
+
2470
+ def initialize(interval: nil, interval_count: nil)
2471
+ @interval = interval
2472
+ @interval_count = interval_count
2473
+ end
2474
+ end
2475
+ # 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).
2476
+ attr_accessor :currency
2477
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2478
+ attr_accessor :product
2479
+ # The recurring components of a price such as `interval` and `interval_count`.
2480
+ attr_accessor :recurring
2481
+ # 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.
2482
+ attr_accessor :tax_behavior
2483
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2484
+ attr_accessor :unit_amount
2485
+ # 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.
2486
+ attr_accessor :unit_amount_decimal
2487
+
2488
+ def initialize(
2489
+ currency: nil,
2490
+ product: nil,
2491
+ recurring: nil,
2492
+ tax_behavior: nil,
2493
+ unit_amount: nil,
2494
+ unit_amount_decimal: nil
2495
+ )
2496
+ @currency = currency
2497
+ @product = product
2498
+ @recurring = recurring
2499
+ @tax_behavior = tax_behavior
2500
+ @unit_amount = unit_amount
2501
+ @unit_amount_decimal = unit_amount_decimal
2502
+ end
2503
+ end
2504
+ # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
2505
+ attr_accessor :clear_usage
2506
+ # A flag that, if set to `true`, will delete the specified item.
2507
+ attr_accessor :deleted
2508
+ # The coupons to redeem into discounts for the subscription item.
2509
+ attr_accessor :discounts
2510
+ # Subscription item to update.
2511
+ attr_accessor :id
2512
+ # 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`.
2513
+ attr_accessor :metadata
2514
+ # Plan ID for this item, as a string.
2515
+ attr_accessor :plan
2516
+ # The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
2517
+ attr_accessor :price
2518
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2519
+ attr_accessor :price_data
2520
+ # Quantity for this item.
2521
+ attr_accessor :quantity
2522
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
2523
+ attr_accessor :tax_rates
2524
+
2525
+ def initialize(
2526
+ clear_usage: nil,
2527
+ deleted: nil,
2528
+ discounts: nil,
2529
+ id: nil,
2530
+ metadata: nil,
2531
+ plan: nil,
2532
+ price: nil,
2533
+ price_data: nil,
2534
+ quantity: nil,
2535
+ tax_rates: nil
2536
+ )
2537
+ @clear_usage = clear_usage
2538
+ @deleted = deleted
2539
+ @discounts = discounts
2540
+ @id = id
2541
+ @metadata = metadata
2542
+ @plan = plan
2543
+ @price = price
2544
+ @price_data = price_data
2545
+ @quantity = quantity
2546
+ @tax_rates = tax_rates
2547
+ end
2548
+ end
2549
+ # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
2550
+ attr_accessor :billing_cycle_anchor
2551
+ # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
2552
+ attr_accessor :cancel_at
2553
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
2554
+ attr_accessor :cancel_at_period_end
2555
+ # This simulates the subscription being canceled or expired immediately.
2556
+ attr_accessor :cancel_now
2557
+ # If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.
2558
+ attr_accessor :default_tax_rates
2559
+ # A list of up to 20 subscription items, each with an attached price.
2560
+ attr_accessor :items
2561
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
2562
+ attr_accessor :proration_behavior
2563
+ # If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
2564
+ attr_accessor :proration_date
2565
+ # For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
2566
+ attr_accessor :resume_at
2567
+ # Date a subscription is intended to start (can be future or past).
2568
+ attr_accessor :start_date
2569
+ # If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required.
2570
+ attr_accessor :trial_end
2571
+
2572
+ def initialize(
2573
+ billing_cycle_anchor: nil,
2574
+ cancel_at: nil,
2575
+ cancel_at_period_end: nil,
2576
+ cancel_now: nil,
2577
+ default_tax_rates: nil,
2578
+ items: nil,
2579
+ proration_behavior: nil,
2580
+ proration_date: nil,
2581
+ resume_at: nil,
2582
+ start_date: nil,
2583
+ trial_end: nil
2584
+ )
2585
+ @billing_cycle_anchor = billing_cycle_anchor
2586
+ @cancel_at = cancel_at
2587
+ @cancel_at_period_end = cancel_at_period_end
2588
+ @cancel_now = cancel_now
2589
+ @default_tax_rates = default_tax_rates
2590
+ @items = items
2591
+ @proration_behavior = proration_behavior
2592
+ @proration_date = proration_date
2593
+ @resume_at = resume_at
2594
+ @start_date = start_date
2595
+ @trial_end = trial_end
2596
+ end
2597
+ end
2598
+ # Settings for automatic tax lookup for this invoice preview.
2599
+ attr_accessor :automatic_tax
2600
+ # The currency to preview this invoice in. Defaults to that of `customer` if not specified.
2601
+ attr_accessor :currency
2602
+ # The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
2603
+ attr_accessor :customer
2604
+ # Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
2605
+ attr_accessor :customer_details
2606
+ # The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
2607
+ attr_accessor :discounts
2608
+ # Specifies which fields in the response should be expanded.
2609
+ attr_accessor :expand
2610
+ # List of invoice items to add or update in the upcoming invoice preview (up to 250).
2611
+ attr_accessor :invoice_items
2612
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2613
+ attr_accessor :issuer
2614
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
2615
+ attr_accessor :on_behalf_of
2616
+ # Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
2617
+ attr_accessor :preview_mode
2618
+ # The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
2619
+ attr_accessor :schedule
2620
+ # The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
2621
+ attr_accessor :schedule_details
2622
+ # The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
2623
+ attr_accessor :subscription
2624
+ # The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
2625
+ attr_accessor :subscription_details
2626
+
2627
+ def initialize(
2628
+ automatic_tax: nil,
2629
+ currency: nil,
2630
+ customer: nil,
2631
+ customer_details: nil,
2632
+ discounts: nil,
2633
+ expand: nil,
2634
+ invoice_items: nil,
2635
+ issuer: nil,
2636
+ on_behalf_of: nil,
2637
+ preview_mode: nil,
2638
+ schedule: nil,
2639
+ schedule_details: nil,
2640
+ subscription: nil,
2641
+ subscription_details: nil
2642
+ )
2643
+ @automatic_tax = automatic_tax
2644
+ @currency = currency
2645
+ @customer = customer
2646
+ @customer_details = customer_details
2647
+ @discounts = discounts
2648
+ @expand = expand
2649
+ @invoice_items = invoice_items
2650
+ @issuer = issuer
2651
+ @on_behalf_of = on_behalf_of
2652
+ @preview_mode = preview_mode
2653
+ @schedule = schedule
2654
+ @schedule_details = schedule_details
2655
+ @subscription = subscription
2656
+ @subscription_details = subscription_details
2657
+ end
2658
+ end
2659
+
2660
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
2661
+ def add_lines(invoice, params = {}, opts = {})
2662
+ request(
2663
+ method: :post,
2664
+ path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(invoice) }),
2665
+ params: params,
2666
+ opts: opts,
2667
+ base_address: :api
2668
+ )
2669
+ end
2670
+
2671
+ # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
2672
+ def create(params = {}, opts = {})
2673
+ request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
2674
+ end
2675
+
2676
+ # At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
2677
+ #
2678
+ # Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
2679
+ #
2680
+ # You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
2681
+ #
2682
+ # Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
2683
+ def create_preview(params = {}, opts = {})
2684
+ request(
2685
+ method: :post,
2686
+ path: "/v1/invoices/create_preview",
2687
+ params: params,
2688
+ opts: opts,
2689
+ base_address: :api
2690
+ )
2691
+ end
2692
+
2693
+ # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice).
2694
+ def delete(invoice, params = {}, opts = {})
2695
+ request(
2696
+ method: :delete,
2697
+ path: format("/v1/invoices/%<invoice>s", { invoice: CGI.escape(invoice) }),
2698
+ params: params,
2699
+ opts: opts,
2700
+ base_address: :api
2701
+ )
2702
+ end
2703
+
2704
+ # Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
2705
+ def finalize_invoice(invoice, params = {}, opts = {})
2706
+ request(
2707
+ method: :post,
2708
+ path: format("/v1/invoices/%<invoice>s/finalize", { invoice: CGI.escape(invoice) }),
2709
+ params: params,
2710
+ opts: opts,
2711
+ base_address: :api
2712
+ )
2713
+ end
2714
+
2715
+ # You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
2716
+ def list(params = {}, opts = {})
2717
+ request(method: :get, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
2718
+ end
2719
+
2720
+ # Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
2721
+ def mark_uncollectible(invoice, params = {}, opts = {})
2722
+ request(
2723
+ method: :post,
2724
+ path: format("/v1/invoices/%<invoice>s/mark_uncollectible", { invoice: CGI.escape(invoice) }),
2725
+ params: params,
2726
+ opts: opts,
2727
+ base_address: :api
2728
+ )
2729
+ end
2730
+
2731
+ # Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
2732
+ def pay(invoice, params = {}, opts = {})
2733
+ request(
2734
+ method: :post,
2735
+ path: format("/v1/invoices/%<invoice>s/pay", { invoice: CGI.escape(invoice) }),
2736
+ params: params,
2737
+ opts: opts,
2738
+ base_address: :api
2739
+ )
2740
+ end
2741
+
2742
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
2743
+ def remove_lines(invoice, params = {}, opts = {})
2744
+ request(
2745
+ method: :post,
2746
+ path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(invoice) }),
2747
+ params: params,
2748
+ opts: opts,
2749
+ base_address: :api
2750
+ )
2751
+ end
2752
+
2753
+ # Retrieves the invoice with the given ID.
2754
+ def retrieve(invoice, params = {}, opts = {})
2755
+ request(
2756
+ method: :get,
2757
+ path: format("/v1/invoices/%<invoice>s", { invoice: CGI.escape(invoice) }),
2758
+ params: params,
2759
+ opts: opts,
2760
+ base_address: :api
2761
+ )
2762
+ end
2763
+
2764
+ # Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
2765
+ # Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
2766
+ # conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
2767
+ # to an hour behind during outages. Search functionality is not available to merchants in India.
2768
+ def search(params = {}, opts = {})
2769
+ request(
2770
+ method: :get,
2771
+ path: "/v1/invoices/search",
2772
+ params: params,
2773
+ opts: opts,
2774
+ base_address: :api
2775
+ )
2776
+ end
2777
+
2778
+ # Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
2779
+ #
2780
+ # Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
2781
+ def send_invoice(invoice, params = {}, opts = {})
2782
+ request(
2783
+ method: :post,
2784
+ path: format("/v1/invoices/%<invoice>s/send", { invoice: CGI.escape(invoice) }),
2785
+ params: params,
2786
+ opts: opts,
2787
+ base_address: :api
2788
+ )
2789
+ end
2790
+
2791
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
2792
+ # monetary values, as well as collection_method, become uneditable.
2793
+ #
2794
+ # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
2795
+ # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
2796
+ # auto_advance=false.
2797
+ def update(invoice, params = {}, opts = {})
2798
+ request(
2799
+ method: :post,
2800
+ path: format("/v1/invoices/%<invoice>s", { invoice: CGI.escape(invoice) }),
2801
+ params: params,
2802
+ opts: opts,
2803
+ base_address: :api
2804
+ )
2805
+ end
2806
+
2807
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
2808
+ def update_lines(invoice, params = {}, opts = {})
2809
+ request(
2810
+ method: :post,
2811
+ path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(invoice) }),
2812
+ params: params,
2813
+ opts: opts,
2814
+ base_address: :api
2815
+ )
2816
+ end
2817
+
2818
+ # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
2819
+ #
2820
+ # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
2821
+ def void_invoice(invoice, params = {}, opts = {})
2822
+ request(
2823
+ method: :post,
2824
+ path: format("/v1/invoices/%<invoice>s/void", { invoice: CGI.escape(invoice) }),
2825
+ params: params,
2826
+ opts: opts,
2827
+ base_address: :api
2828
+ )
2829
+ end
2830
+ end
2831
+ end