stripe 15.1.0.pre.beta.2 → 15.1.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 (597) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +696 -1554
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +6 -0
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_requestor.rb +0 -28
  7. data/lib/stripe/api_version.rb +1 -1
  8. data/lib/stripe/errors.rb +0 -54
  9. data/lib/stripe/event_types.rb +1 -75
  10. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +1 -1
  11. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +1 -1
  12. data/lib/stripe/events/{v2_core_account_including_identity_updated_event.rb → v2_core_event_destination_ping_event.rb} +3 -3
  13. data/lib/stripe/object_types.rb +0 -53
  14. data/lib/stripe/resources/account.rb +3 -655
  15. data/lib/stripe/resources/account_session.rb +1 -299
  16. data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -2
  17. data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -4
  18. data/lib/stripe/resources/billing/credit_grant.rb +0 -10
  19. data/lib/stripe/resources/billing_portal/session.rb +0 -6
  20. data/lib/stripe/resources/card.rb +0 -2
  21. data/lib/stripe/resources/cash_balance.rb +0 -2
  22. data/lib/stripe/resources/charge.rb +0 -1470
  23. data/lib/stripe/resources/checkout/session.rb +3 -327
  24. data/lib/stripe/resources/confirmation_token.rb +3 -177
  25. data/lib/stripe/resources/coupon.rb +1 -30
  26. data/lib/stripe/resources/credit_note.rb +0 -10
  27. data/lib/stripe/resources/credit_note_line_item.rb +0 -9
  28. data/lib/stripe/resources/customer.rb +2 -4
  29. data/lib/stripe/resources/customer_balance_transaction.rb +0 -2
  30. data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -2
  31. data/lib/stripe/resources/customer_session.rb +1 -6
  32. data/lib/stripe/resources/discount.rb +0 -2
  33. data/lib/stripe/resources/event.rb +0 -31
  34. data/lib/stripe/resources/financial_connections/account.rb +1 -20
  35. data/lib/stripe/resources/financial_connections/session.rb +2 -62
  36. data/lib/stripe/resources/identity/verification_session.rb +0 -10
  37. data/lib/stripe/resources/invoice.rb +17 -1123
  38. data/lib/stripe/resources/invoice_item.rb +2 -78
  39. data/lib/stripe/resources/invoice_line_item.rb +1 -55
  40. data/lib/stripe/resources/invoice_payment.rb +53 -2
  41. data/lib/stripe/resources/issuing/cardholder.rb +1 -2
  42. data/lib/stripe/resources/issuing/transaction.rb +0 -6
  43. data/lib/stripe/resources/line_item.rb +0 -37
  44. data/lib/stripe/resources/mandate.rb +0 -24
  45. data/lib/stripe/resources/payment_intent.rb +331 -5153
  46. data/lib/stripe/resources/payment_method.rb +1 -196
  47. data/lib/stripe/resources/payment_method_configuration.rb +0 -295
  48. data/lib/stripe/resources/payout.rb +0 -6
  49. data/lib/stripe/resources/price.rb +0 -30
  50. data/lib/stripe/resources/product.rb +0 -59
  51. data/lib/stripe/resources/promotion_code.rb +0 -10
  52. data/lib/stripe/resources/quote.rb +6 -2040
  53. data/lib/stripe/resources/refund.rb +0 -9
  54. data/lib/stripe/resources/setup_attempt.rb +0 -21
  55. data/lib/stripe/resources/setup_intent.rb +9 -596
  56. data/lib/stripe/resources/source.rb +0 -29
  57. data/lib/stripe/resources/subscription.rb +11 -294
  58. data/lib/stripe/resources/subscription_item.rb +3 -84
  59. data/lib/stripe/resources/subscription_schedule.rb +10 -1007
  60. data/lib/stripe/resources/tax/calculation.rb +2 -2
  61. data/lib/stripe/resources/tax/registration.rb +60 -0
  62. data/lib/stripe/resources/tax/transaction.rb +1 -1
  63. data/lib/stripe/resources/tax_id.rb +4 -14
  64. data/lib/stripe/resources/terminal/reader.rb +0 -406
  65. data/lib/stripe/resources/transfer.rb +0 -6
  66. data/lib/stripe/resources/treasury/financial_account.rb +3 -22
  67. data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
  68. data/lib/stripe/resources/treasury/outbound_payment.rb +1 -4
  69. data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -37
  70. data/lib/stripe/resources/treasury/received_credit.rb +1 -38
  71. data/lib/stripe/resources/treasury/received_debit.rb +1 -40
  72. data/lib/stripe/resources/v2/billing/meter_event.rb +2 -2
  73. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +2 -2
  74. data/lib/stripe/resources/v2/billing/meter_event_session.rb +2 -2
  75. data/lib/stripe/resources/v2/event.rb +2 -2
  76. data/lib/stripe/resources/v2/event_destination.rb +2 -2
  77. data/lib/stripe/resources.rb +1 -90
  78. data/lib/stripe/services/account_external_account_service.rb +1 -1
  79. data/lib/stripe/services/account_service.rb +3 -564
  80. data/lib/stripe/services/account_session_service.rb +1 -269
  81. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -4
  82. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +0 -4
  83. data/lib/stripe/services/billing/credit_grant_service.rb +0 -8
  84. data/lib/stripe/services/billing_portal/session_service.rb +0 -4
  85. data/lib/stripe/services/charge_service.rb +0 -1350
  86. data/lib/stripe/services/checkout/session_service.rb +2 -243
  87. data/lib/stripe/services/coupon_service.rb +1 -17
  88. data/lib/stripe/services/credit_note_service.rb +0 -4
  89. data/lib/stripe/services/customer_payment_method_service.rb +1 -1
  90. data/lib/stripe/services/customer_service.rb +1 -1
  91. data/lib/stripe/services/customer_session_service.rb +1 -4
  92. data/lib/stripe/services/customer_tax_id_service.rb +1 -1
  93. data/lib/stripe/services/financial_connections/account_service.rb +2 -7
  94. data/lib/stripe/services/financial_connections/session_service.rb +2 -34
  95. data/lib/stripe/services/financial_connections_service.rb +1 -2
  96. data/lib/stripe/services/identity/verification_session_service.rb +0 -8
  97. data/lib/stripe/services/invoice_item_service.rb +2 -74
  98. data/lib/stripe/services/invoice_line_item_service.rb +1 -33
  99. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  100. data/lib/stripe/services/invoice_service.rb +16 -1052
  101. data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
  102. data/lib/stripe/services/issuing/transaction_service.rb +0 -4
  103. data/lib/stripe/services/issuing_service.rb +1 -5
  104. data/lib/stripe/services/payment_intent_service.rb +283 -4656
  105. data/lib/stripe/services/payment_method_configuration_service.rb +0 -210
  106. data/lib/stripe/services/payment_method_service.rb +1 -126
  107. data/lib/stripe/services/payout_service.rb +0 -4
  108. data/lib/stripe/services/price_service.rb +0 -19
  109. data/lib/stripe/services/product_service.rb +0 -38
  110. data/lib/stripe/services/promotion_code_service.rb +0 -8
  111. data/lib/stripe/services/quote_service.rb +7 -1726
  112. data/lib/stripe/services/setup_intent_service.rb +9 -556
  113. data/lib/stripe/services/subscription_item_service.rb +3 -75
  114. data/lib/stripe/services/subscription_schedule_service.rb +10 -911
  115. data/lib/stripe/services/subscription_service.rb +10 -254
  116. data/lib/stripe/services/tax/calculation_service.rb +1 -1
  117. data/lib/stripe/services/tax/registration_service.rb +39 -0
  118. data/lib/stripe/services/tax_id_service.rb +3 -9
  119. data/lib/stripe/services/tax_service.rb +1 -3
  120. data/lib/stripe/services/terminal/reader_service.rb +0 -180
  121. data/lib/stripe/services/terminal_service.rb +1 -2
  122. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +3 -106
  123. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +0 -43
  124. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
  125. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
  126. data/lib/stripe/services/transfer_service.rb +0 -4
  127. data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
  128. data/lib/stripe/services/treasury/financial_account_service.rb +2 -16
  129. data/lib/stripe/services/treasury/outbound_payment_service.rb +1 -4
  130. data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
  131. data/lib/stripe/services/v1_services.rb +2 -12
  132. data/lib/stripe/services/v2/core_service.rb +1 -4
  133. data/lib/stripe/services/v2_services.rb +2 -4
  134. data/lib/stripe/services.rb +1 -54
  135. data/lib/stripe/stripe_configuration.rb +1 -3
  136. data/lib/stripe/stripe_object.rb +1 -1
  137. data/lib/stripe/util.rb +1 -7
  138. data/lib/stripe/version.rb +1 -1
  139. data/lib/stripe.rb +0 -53
  140. data/rbi/stripe/resources/account.rbi +4903 -0
  141. data/rbi/stripe/resources/account_link.rbi +74 -0
  142. data/rbi/stripe/resources/account_session.rbi +894 -0
  143. data/rbi/stripe/resources/apple_pay_domain.rbi +90 -0
  144. data/rbi/stripe/resources/application.rbi +20 -0
  145. data/rbi/stripe/resources/application_fee.rbi +118 -0
  146. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  147. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  148. data/rbi/stripe/resources/balance.rbi +180 -0
  149. data/rbi/stripe/resources/balance_transaction.rbi +144 -0
  150. data/rbi/stripe/resources/bank_account.rbi +127 -0
  151. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  152. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  153. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  154. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  155. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  156. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  157. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  158. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  159. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  160. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  161. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  162. data/rbi/stripe/resources/capability.rbi +125 -0
  163. data/rbi/stripe/resources/card.rbi +125 -0
  164. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  165. data/rbi/stripe/resources/charge.rbi +2057 -0
  166. data/rbi/stripe/resources/checkout/session.rbi +3988 -0
  167. data/rbi/stripe/resources/climate/order.rbi +245 -0
  168. data/rbi/stripe/resources/climate/product.rbi +75 -0
  169. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  170. data/rbi/stripe/resources/confirmation_token.rbi +1873 -0
  171. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  172. data/rbi/stripe/resources/country_spec.rbi +85 -0
  173. data/rbi/stripe/resources/coupon.rbi +252 -0
  174. data/rbi/stripe/resources/credit_note.rbi +747 -0
  175. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  176. data/rbi/stripe/resources/customer.rbi +1009 -0
  177. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  178. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  179. data/rbi/stripe/resources/customer_session.rbi +200 -0
  180. data/rbi/stripe/resources/discount.rbi +53 -0
  181. data/rbi/stripe/resources/dispute.rbi +761 -0
  182. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  183. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  184. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  185. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  186. data/rbi/stripe/resources/event.rbi +149 -0
  187. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  188. data/rbi/stripe/resources/file.rbi +143 -0
  189. data/rbi/stripe/resources/file_link.rbi +141 -0
  190. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  191. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  192. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  193. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  194. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  195. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  196. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  197. data/rbi/stripe/resources/identity/verification_report.rbi +351 -0
  198. data/rbi/stripe/resources/identity/verification_session.rbi +517 -0
  199. data/rbi/stripe/resources/invoice.rbi +3736 -0
  200. data/rbi/stripe/resources/invoice_item.rbi +475 -0
  201. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  202. data/rbi/stripe/resources/invoice_payment.rbi +114 -0
  203. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  204. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  205. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  206. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  207. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  208. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  209. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  210. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  211. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  212. data/rbi/stripe/resources/line_item.rbi +72 -0
  213. data/rbi/stripe/resources/login_link.rbi +19 -0
  214. data/rbi/stripe/resources/mandate.rbi +187 -0
  215. data/rbi/stripe/resources/payment_intent.rbi +9795 -0
  216. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  217. data/rbi/stripe/resources/payment_method.rbi +1831 -0
  218. data/rbi/stripe/resources/payment_method_configuration.rbi +3220 -0
  219. data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
  220. data/rbi/stripe/resources/payout.rbi +300 -0
  221. data/rbi/stripe/resources/person.rbi +401 -0
  222. data/rbi/stripe/resources/plan.rbi +373 -0
  223. data/rbi/stripe/resources/price.rbi +694 -0
  224. data/rbi/stripe/resources/product.rbi +557 -0
  225. data/rbi/stripe/resources/product_feature.rbi +26 -0
  226. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  227. data/rbi/stripe/resources/quote.rbi +1126 -0
  228. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  229. data/rbi/stripe/resources/radar/value_list.rbi +170 -0
  230. data/rbi/stripe/resources/radar/value_list_item.rbi +131 -0
  231. data/rbi/stripe/resources/refund.rbi +519 -0
  232. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  233. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  234. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  235. data/rbi/stripe/resources/reversal.rbi +51 -0
  236. data/rbi/stripe/resources/review.rbi +154 -0
  237. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  238. data/rbi/stripe/resources/setup_intent.rbi +3869 -0
  239. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  240. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  241. data/rbi/stripe/resources/source.rbi +1496 -0
  242. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  243. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  244. data/rbi/stripe/resources/subscription.rbi +1964 -0
  245. data/rbi/stripe/resources/subscription_item.rbi +370 -0
  246. data/rbi/stripe/resources/subscription_schedule.rbi +1495 -0
  247. data/rbi/stripe/resources/tax/calculation.rbi +474 -0
  248. data/rbi/stripe/resources/tax/calculation_line_item.rbi +88 -0
  249. data/rbi/stripe/resources/tax/registration.rbi +2713 -0
  250. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  251. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  252. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  253. data/rbi/stripe/resources/tax_code.rbi +44 -0
  254. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  255. data/rbi/stripe/resources/tax_id.rbi +167 -0
  256. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  257. data/rbi/stripe/resources/terminal/configuration.rbi +1388 -0
  258. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  259. data/rbi/stripe/resources/terminal/location.rbi +224 -0
  260. data/rbi/stripe/resources/terminal/reader.rbi +587 -0
  261. data/rbi/stripe/resources/test_helpers/test_clock.rbi +134 -0
  262. data/rbi/stripe/resources/token.rbi +1283 -0
  263. data/rbi/stripe/resources/topup.rbi +222 -0
  264. data/rbi/stripe/resources/transfer.rbi +199 -0
  265. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  266. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  267. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  268. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  269. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  270. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  271. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  272. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  273. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  274. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  275. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  276. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  277. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  278. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  279. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  280. data/rbi/stripe/resources/v2/event.rbi +48 -0
  281. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  282. data/rbi/stripe/resources/webhook_endpoint.rbi +170 -0
  283. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  284. data/{lib/stripe/services/external_account_service.rb → rbi/stripe/services/account_external_account_service.rbi} +124 -136
  285. data/rbi/stripe/services/account_link_service.rbi +58 -0
  286. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  287. data/rbi/stripe/services/account_person_service.rbi +1013 -0
  288. data/rbi/stripe/services/account_service.rbi +4189 -0
  289. data/rbi/stripe/services/account_session_service.rbi +572 -0
  290. data/rbi/stripe/services/apple_pay_domain_service.rbi +78 -0
  291. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  292. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  293. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  294. data/rbi/stripe/services/apps_service.rbi +9 -0
  295. data/rbi/stripe/services/balance_service.rbi +21 -0
  296. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  297. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  298. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  299. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  300. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  301. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  302. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  303. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  304. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  305. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  306. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  307. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  308. data/rbi/stripe/services/billing_service.rbi +15 -0
  309. data/rbi/stripe/services/charge_service.rbi +448 -0
  310. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  311. data/rbi/stripe/services/checkout/session_service.rbi +2607 -0
  312. data/rbi/stripe/services/checkout_service.rbi +9 -0
  313. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  314. data/{lib/stripe/services/financial_connections/institution_service.rb → rbi/stripe/services/climate/product_service.rbi} +25 -36
  315. data/{lib/stripe/services/privacy/redaction_job_validation_error_service.rb → rbi/stripe/services/climate/supplier_service.rbi} +25 -36
  316. data/rbi/stripe/services/climate_service.rbi +11 -0
  317. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  318. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  319. data/rbi/stripe/services/coupon_service.rbi +196 -0
  320. data/{lib/stripe/services/quote_preview_invoice_service.rb → rbi/stripe/services/credit_note_line_item_service.rbi} +16 -20
  321. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  322. data/rbi/stripe/services/credit_note_service.rbi +416 -0
  323. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  324. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  325. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  326. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  327. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  328. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  329. data/rbi/stripe/services/customer_service.rbi +651 -0
  330. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  331. data/rbi/stripe/services/customer_tax_id_service.rbi +72 -0
  332. data/rbi/stripe/services/dispute_service.rbi +424 -0
  333. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  334. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  335. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  336. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  337. data/rbi/stripe/services/event_service.rbi +83 -0
  338. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  339. data/rbi/stripe/services/file_link_service.rbi +124 -0
  340. data/rbi/stripe/services/file_service.rbi +116 -0
  341. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  342. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  343. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  344. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  345. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  346. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  347. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  348. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  349. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  350. data/rbi/stripe/services/identity_service.rbi +10 -0
  351. data/rbi/stripe/services/invoice_item_service.rbi +368 -0
  352. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  353. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  354. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  355. data/rbi/stripe/services/invoice_service.rbi +2920 -0
  356. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  357. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  358. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  359. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  360. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  361. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  362. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  363. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  364. data/rbi/stripe/services/issuing_service.rbi +16 -0
  365. data/rbi/stripe/services/mandate_service.rbi +20 -0
  366. data/rbi/stripe/services/payment_intent_service.rbi +7819 -0
  367. data/{lib/stripe/services/payment_intent_amount_details_line_item_service.rb → rbi/stripe/services/payment_link_line_item_service.rbi} +16 -20
  368. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  369. data/rbi/stripe/services/payment_method_configuration_service.rbi +2255 -0
  370. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  371. data/rbi/stripe/services/payment_method_service.rbi +846 -0
  372. data/rbi/stripe/services/payout_service.rbi +205 -0
  373. data/rbi/stripe/services/plan_service.rbi +284 -0
  374. data/rbi/stripe/services/price_service.rbi +546 -0
  375. data/rbi/stripe/services/product_feature_service.rbi +69 -0
  376. data/rbi/stripe/services/product_service.rbi +479 -0
  377. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  378. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  379. data/{lib/stripe/services/order_line_item_service.rb → rbi/stripe/services/quote_line_item_service.rbi} +16 -20
  380. data/rbi/stripe/services/quote_service.rbi +686 -0
  381. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  382. data/rbi/stripe/services/radar/value_list_item_service.rbi +111 -0
  383. data/rbi/stripe/services/radar/value_list_service.rbi +143 -0
  384. data/rbi/stripe/services/radar_service.rbi +11 -0
  385. data/rbi/stripe/services/refund_service.rbi +185 -0
  386. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  387. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  388. data/rbi/stripe/services/reporting_service.rbi +10 -0
  389. data/rbi/stripe/services/review_service.rbi +84 -0
  390. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  391. data/rbi/stripe/services/setup_intent_service.rbi +3605 -0
  392. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  393. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  394. data/rbi/stripe/services/sigma_service.rbi +9 -0
  395. data/rbi/stripe/services/source_service.rbi +663 -0
  396. data/{lib/stripe/services/quote_line_service.rb → rbi/stripe/services/source_transaction_service.rbi} +16 -20
  397. data/rbi/stripe/services/subscription_item_service.rbi +324 -0
  398. data/rbi/stripe/services/subscription_schedule_service.rbi +1192 -0
  399. data/rbi/stripe/services/subscription_service.rbi +1596 -0
  400. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +33 -0
  401. data/rbi/stripe/services/tax/calculation_service.rbi +230 -0
  402. data/rbi/stripe/services/tax/registration_service.rbi +1845 -0
  403. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  404. data/{lib/stripe/services/financial_connections/account_inferred_balance_service.rb → rbi/stripe/services/tax/transaction_line_item_service.rbi} +17 -21
  405. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  406. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  407. data/rbi/stripe/services/tax_id_service.rbi +112 -0
  408. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  409. data/rbi/stripe/services/tax_service.rbi +12 -0
  410. data/rbi/stripe/services/terminal/configuration_service.rbi +1120 -0
  411. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  412. data/rbi/stripe/services/terminal/location_service.rbi +184 -0
  413. data/rbi/stripe/services/terminal/reader_service.rbi +344 -0
  414. data/rbi/stripe/services/terminal_service.rbi +12 -0
  415. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +805 -0
  416. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  417. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  418. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  419. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  420. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  421. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  422. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  423. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +62 -0
  424. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  425. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +92 -0
  426. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  427. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  428. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  429. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  430. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  431. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  432. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  433. data/rbi/stripe/services/token_service.rbi +1257 -0
  434. data/rbi/stripe/services/topup_service.rbi +176 -0
  435. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  436. data/rbi/stripe/services/transfer_service.rbi +152 -0
  437. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  438. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  439. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  440. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  441. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  442. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  443. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  444. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  445. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  446. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  447. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  448. data/rbi/stripe/services/treasury_service.rbi +18 -0
  449. data/rbi/stripe/services/v1_services.rbi +77 -0
  450. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  451. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  452. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +20 -0
  453. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  454. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  455. data/rbi/stripe/services/v2/core/event_destination_service.rbi +200 -0
  456. data/rbi/stripe/services/v2/core/event_service.rbi +38 -0
  457. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  458. data/rbi/stripe/services/v2_services.rbi +10 -0
  459. data/rbi/stripe/services/webhook_endpoint_service.rbi +131 -0
  460. data/stripe.gemspec +1 -4
  461. metadata +326 -149
  462. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +0 -23
  463. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +0 -21
  464. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +0 -23
  465. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +0 -21
  466. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +0 -23
  467. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +0 -21
  468. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +0 -21
  469. data/lib/stripe/events/v2_core_account_link_completed_event.rb +0 -13
  470. data/lib/stripe/events/v2_core_account_person_created_event.rb +0 -23
  471. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +0 -23
  472. data/lib/stripe/events/v2_core_account_person_updated_event.rb +0 -23
  473. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +0 -21
  474. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +0 -21
  475. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +0 -21
  476. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +0 -23
  477. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +0 -21
  478. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +0 -21
  479. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +0 -21
  480. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +0 -21
  481. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +0 -21
  482. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +0 -21
  483. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +0 -21
  484. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +0 -21
  485. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +0 -21
  486. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +0 -21
  487. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +0 -21
  488. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +0 -21
  489. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +0 -21
  490. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +0 -21
  491. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +0 -21
  492. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +0 -23
  493. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +0 -21
  494. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +0 -21
  495. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +0 -21
  496. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +0 -21
  497. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +0 -21
  498. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +0 -21
  499. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +0 -21
  500. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +0 -21
  501. data/lib/stripe/resources/account_notice.rb +0 -123
  502. data/lib/stripe/resources/balance_settings.rb +0 -105
  503. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  504. data/lib/stripe/resources/capital/financing_offer.rb +0 -179
  505. data/lib/stripe/resources/capital/financing_summary.rb +0 -55
  506. data/lib/stripe/resources/capital/financing_transaction.rb +0 -114
  507. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
  508. data/lib/stripe/resources/financial_connections/institution.rb +0 -90
  509. data/lib/stripe/resources/fx_quote.rb +0 -184
  510. data/lib/stripe/resources/gift_cards/card.rb +0 -208
  511. data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
  512. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -602
  513. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -82
  514. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -86
  515. data/lib/stripe/resources/issuing/settlement.rb +0 -53
  516. data/lib/stripe/resources/margin.rb +0 -115
  517. data/lib/stripe/resources/order.rb +0 -2859
  518. data/lib/stripe/resources/payment_attempt_record.rb +0 -1078
  519. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +0 -65
  520. data/lib/stripe/resources/payment_record.rb +0 -1607
  521. data/lib/stripe/resources/privacy/redaction_job.rb +0 -254
  522. data/lib/stripe/resources/privacy/redaction_job_root_objects.rb +0 -35
  523. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +0 -25
  524. data/lib/stripe/resources/quote_line.rb +0 -274
  525. data/lib/stripe/resources/quote_preview_invoice.rb +0 -663
  526. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -337
  527. data/lib/stripe/resources/tax/association.rb +0 -89
  528. data/lib/stripe/resources/tax/form.rb +0 -211
  529. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -31
  530. data/lib/stripe/resources/v2/core/account.rb +0 -1715
  531. data/lib/stripe/resources/v2/core/account_link.rb +0 -54
  532. data/lib/stripe/resources/v2/core/person.rb +0 -272
  533. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +0 -72
  534. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +0 -37
  535. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +0 -18
  536. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +0 -20
  537. data/lib/stripe/resources/v2/money_management/adjustment.rb +0 -49
  538. data/lib/stripe/resources/v2/money_management/financial_account.rb +0 -56
  539. data/lib/stripe/resources/v2/money_management/financial_address.rb +0 -66
  540. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +0 -92
  541. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +0 -127
  542. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +0 -74
  543. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +0 -43
  544. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +0 -115
  545. data/lib/stripe/resources/v2/money_management/payout_method.rb +0 -73
  546. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +0 -47
  547. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -134
  548. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -106
  549. data/lib/stripe/resources/v2/money_management/transaction.rb +0 -76
  550. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +0 -66
  551. data/lib/stripe/services/account_notice_service.rb +0 -101
  552. data/lib/stripe/services/balance_settings_service.rb +0 -96
  553. data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
  554. data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
  555. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
  556. data/lib/stripe/services/capital_service.rb +0 -15
  557. data/lib/stripe/services/fx_quote_service.rb +0 -123
  558. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  559. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  560. data/lib/stripe/services/gift_cards_service.rb +0 -14
  561. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
  562. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
  563. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
  564. data/lib/stripe/services/margin_service.rb +0 -119
  565. data/lib/stripe/services/order_service.rb +0 -2268
  566. data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
  567. data/lib/stripe/services/payment_record_service.rb +0 -542
  568. data/lib/stripe/services/privacy/redaction_job_service.rb +0 -231
  569. data/lib/stripe/services/privacy_service.rb +0 -13
  570. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
  571. data/lib/stripe/services/tax/association_service.rb +0 -31
  572. data/lib/stripe/services/tax/form_service.rb +0 -100
  573. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
  574. data/lib/stripe/services/v2/core/account_link_service.rb +0 -76
  575. data/lib/stripe/services/v2/core/account_service.rb +0 -4130
  576. data/lib/stripe/services/v2/core/accounts/person_service.rb +0 -1040
  577. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -135
  578. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +0 -109
  579. data/lib/stripe/services/v2/core/vault_service.rb +0 -18
  580. data/lib/stripe/services/v2/money_management/adjustment_service.rb +0 -75
  581. data/lib/stripe/services/v2/money_management/financial_account_service.rb +0 -44
  582. data/lib/stripe/services/v2/money_management/financial_address_service.rb +0 -81
  583. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +0 -126
  584. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +0 -80
  585. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +0 -202
  586. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +0 -237
  587. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +0 -174
  588. data/lib/stripe/services/v2/money_management/payout_method_service.rb +0 -95
  589. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +0 -32
  590. data/lib/stripe/services/v2/money_management/received_credit_service.rb +0 -71
  591. data/lib/stripe/services/v2/money_management/received_debit_service.rb +0 -44
  592. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +0 -70
  593. data/lib/stripe/services/v2/money_management/transaction_service.rb +0 -74
  594. data/lib/stripe/services/v2/money_management_service.rb +0 -31
  595. data/lib/stripe/services/v2/test_helper_service.rb +0 -15
  596. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +0 -50
  597. data/rbi/stripe.rbi +0 -191592
@@ -0,0 +1,3736 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ # typed: true
5
+ module Stripe
6
+ # Invoices are statements of amounts owed by a customer, and are either
7
+ # generated one-off, or generated periodically from a subscription.
8
+ #
9
+ # They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments
10
+ # that may be caused by subscription upgrades/downgrades (if necessary).
11
+ #
12
+ # If your invoice is configured to be billed through automatic charges,
13
+ # Stripe automatically finalizes your invoice and attempts payment. Note
14
+ # that finalizing the invoice,
15
+ # [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does
16
+ # not happen immediately as the invoice is created. Stripe waits
17
+ # until one hour after the last webhook was successfully sent (or the last
18
+ # webhook timed out after failing). If you (and the platforms you may have
19
+ # connected to) have no webhooks configured, Stripe waits one hour after
20
+ # creation to finalize the invoice.
21
+ #
22
+ # If your invoice is configured to be billed by sending an email, then based on your
23
+ # [email settings](https://dashboard.stripe.com/account/billing/automatic),
24
+ # Stripe will email the invoice to your customer and await payment. These
25
+ # emails can contain a link to a hosted page to pay the invoice.
26
+ #
27
+ # Stripe applies any customer credit on the account before determining the
28
+ # amount due for the invoice (i.e., the amount that will be actually
29
+ # charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge
30
+ # per currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the
31
+ # invoice is automatically marked paid, and we add the amount due to the
32
+ # customer's credit balance which is applied to the next invoice.
33
+ #
34
+ # More details on the customer's credit balance are
35
+ # [here](https://stripe.com/docs/billing/customer/balance).
36
+ #
37
+ # Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending)
38
+ class Invoice < APIResource
39
+ class AutomaticTax < Stripe::StripeObject
40
+ class Liability < Stripe::StripeObject
41
+ # The connected account being referenced when `type` is `account`.
42
+ sig { returns(T.any(String, Stripe::Account)) }
43
+ attr_reader :account
44
+ # Type of the account referenced.
45
+ sig { returns(String) }
46
+ attr_reader :type
47
+ end
48
+ # If Stripe disabled automatic tax, this enum describes why.
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :disabled_reason
51
+ # 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.
52
+ sig { returns(T::Boolean) }
53
+ attr_reader :enabled
54
+ # 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.
55
+ sig { returns(T.nilable(Liability)) }
56
+ attr_reader :liability
57
+ # The tax provider powering automatic tax.
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :provider
60
+ # The status of the most recent automated tax calculation for this invoice.
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :status
63
+ end
64
+ class ConfirmationSecret < Stripe::StripeObject
65
+ # The client_secret of the payment that Stripe creates for the invoice after finalization.
66
+ sig { returns(String) }
67
+ attr_reader :client_secret
68
+ # The type of client_secret. Currently this is always payment_intent, referencing the default payment_intent that Stripe creates during invoice finalization
69
+ sig { returns(String) }
70
+ attr_reader :type
71
+ end
72
+ class CustomField < Stripe::StripeObject
73
+ # The name of the custom field.
74
+ sig { returns(String) }
75
+ attr_reader :name
76
+ # The value of the custom field.
77
+ sig { returns(String) }
78
+ attr_reader :value
79
+ end
80
+ class CustomerAddress < Stripe::StripeObject
81
+ # City, district, suburb, town, or village.
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :city
84
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
85
+ sig { returns(T.nilable(String)) }
86
+ attr_reader :country
87
+ # Address line 1 (e.g., street, PO Box, or company name).
88
+ sig { returns(T.nilable(String)) }
89
+ attr_reader :line1
90
+ # Address line 2 (e.g., apartment, suite, unit, or building).
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :line2
93
+ # ZIP or postal code.
94
+ sig { returns(T.nilable(String)) }
95
+ attr_reader :postal_code
96
+ # State, county, province, or region.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_reader :state
99
+ end
100
+ class CustomerShipping < Stripe::StripeObject
101
+ class Address < Stripe::StripeObject
102
+ # City, district, suburb, town, or village.
103
+ sig { returns(T.nilable(String)) }
104
+ attr_reader :city
105
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
106
+ sig { returns(T.nilable(String)) }
107
+ attr_reader :country
108
+ # Address line 1 (e.g., street, PO Box, or company name).
109
+ sig { returns(T.nilable(String)) }
110
+ attr_reader :line1
111
+ # Address line 2 (e.g., apartment, suite, unit, or building).
112
+ sig { returns(T.nilable(String)) }
113
+ attr_reader :line2
114
+ # ZIP or postal code.
115
+ sig { returns(T.nilable(String)) }
116
+ attr_reader :postal_code
117
+ # State, county, province, or region.
118
+ sig { returns(T.nilable(String)) }
119
+ attr_reader :state
120
+ end
121
+ # Attribute for field address
122
+ sig { returns(Address) }
123
+ attr_reader :address
124
+ # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
125
+ sig { returns(T.nilable(String)) }
126
+ attr_reader :carrier
127
+ # Recipient name.
128
+ sig { returns(String) }
129
+ attr_reader :name
130
+ # Recipient phone (including extension).
131
+ sig { returns(T.nilable(String)) }
132
+ attr_reader :phone
133
+ # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
134
+ sig { returns(T.nilable(String)) }
135
+ attr_reader :tracking_number
136
+ end
137
+ class CustomerTaxId < Stripe::StripeObject
138
+ # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown`
139
+ sig { returns(String) }
140
+ attr_reader :type
141
+ # The value of the tax ID.
142
+ sig { returns(T.nilable(String)) }
143
+ attr_reader :value
144
+ end
145
+ class FromInvoice < Stripe::StripeObject
146
+ # The relation between this invoice and the cloned invoice
147
+ sig { returns(String) }
148
+ attr_reader :action
149
+ # The invoice that was cloned.
150
+ sig { returns(T.any(String, Stripe::Invoice)) }
151
+ attr_reader :invoice
152
+ end
153
+ class Issuer < Stripe::StripeObject
154
+ # The connected account being referenced when `type` is `account`.
155
+ sig { returns(T.any(String, Stripe::Account)) }
156
+ attr_reader :account
157
+ # Type of the account referenced.
158
+ sig { returns(String) }
159
+ attr_reader :type
160
+ end
161
+ class LastFinalizationError < Stripe::StripeObject
162
+ # For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one.
163
+ sig { returns(String) }
164
+ attr_reader :advice_code
165
+ # For card errors, the ID of the failed charge.
166
+ sig { returns(String) }
167
+ attr_reader :charge
168
+ # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
169
+ sig { returns(String) }
170
+ attr_reader :code
171
+ # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
172
+ sig { returns(String) }
173
+ attr_reader :decline_code
174
+ # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
175
+ sig { returns(String) }
176
+ attr_reader :doc_url
177
+ # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
178
+ sig { returns(String) }
179
+ attr_reader :message
180
+ # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
181
+ sig { returns(String) }
182
+ attr_reader :network_advice_code
183
+ # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed.
184
+ sig { returns(String) }
185
+ attr_reader :network_decline_code
186
+ # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
187
+ sig { returns(String) }
188
+ attr_reader :param
189
+ # A PaymentIntent guides you through the process of collecting a payment from your customer.
190
+ # We recommend that you create exactly one PaymentIntent for each order or
191
+ # customer session in your system. You can reference the PaymentIntent later to
192
+ # see the history of payment attempts for a particular session.
193
+ #
194
+ # A PaymentIntent transitions through
195
+ # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses)
196
+ # throughout its lifetime as it interfaces with Stripe.js to perform
197
+ # authentication flows and ultimately creates at most one successful charge.
198
+ #
199
+ # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents)
200
+ sig { returns(Stripe::PaymentIntent) }
201
+ attr_reader :payment_intent
202
+ # PaymentMethod objects represent your customer's payment instruments.
203
+ # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
204
+ # Customer objects to store instrument details for future payments.
205
+ #
206
+ # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
207
+ sig { returns(Stripe::PaymentMethod) }
208
+ attr_reader :payment_method
209
+ # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
210
+ sig { returns(String) }
211
+ attr_reader :payment_method_type
212
+ # A URL to the request log entry in your dashboard.
213
+ sig { returns(String) }
214
+ attr_reader :request_log_url
215
+ # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
216
+ # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
217
+ # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.
218
+ #
219
+ # Create a SetupIntent when you're ready to collect your customer's payment credentials.
220
+ # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
221
+ # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides
222
+ # you through the setup process.
223
+ #
224
+ # Successful SetupIntents result in payment credentials that are optimized for future payments.
225
+ # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
226
+ # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection
227
+ # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).
228
+ # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
229
+ # it automatically attaches the resulting payment method to that Customer after successful setup.
230
+ # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
231
+ # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.
232
+ #
233
+ # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.
234
+ #
235
+ # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
236
+ sig { returns(Stripe::SetupIntent) }
237
+ attr_reader :setup_intent
238
+ # Attribute for field source
239
+ sig { returns(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)) }
240
+ attr_reader :source
241
+ # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
242
+ sig { returns(String) }
243
+ attr_reader :type
244
+ end
245
+ class Parent < Stripe::StripeObject
246
+ class QuoteDetails < Stripe::StripeObject
247
+ # The quote that generated this invoice
248
+ sig { returns(String) }
249
+ attr_reader :quote
250
+ end
251
+ class SubscriptionDetails < Stripe::StripeObject
252
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization.
253
+ # *Note: This attribute is populated only for invoices created on or after June 29, 2023.*
254
+ sig { returns(T.nilable(T::Hash[String, String])) }
255
+ attr_reader :metadata
256
+ # The subscription that generated this invoice
257
+ sig { returns(T.any(String, Stripe::Subscription)) }
258
+ attr_reader :subscription
259
+ # Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
260
+ sig { returns(Integer) }
261
+ attr_reader :subscription_proration_date
262
+ end
263
+ # Details about the quote that generated this invoice
264
+ sig { returns(T.nilable(QuoteDetails)) }
265
+ attr_reader :quote_details
266
+ # Details about the subscription that generated this invoice
267
+ sig { returns(T.nilable(SubscriptionDetails)) }
268
+ attr_reader :subscription_details
269
+ # The type of parent that generated this invoice
270
+ sig { returns(String) }
271
+ attr_reader :type
272
+ end
273
+ class PaymentSettings < Stripe::StripeObject
274
+ class PaymentMethodOptions < Stripe::StripeObject
275
+ class AcssDebit < Stripe::StripeObject
276
+ class MandateOptions < Stripe::StripeObject
277
+ # Transaction type of the mandate.
278
+ sig { returns(T.nilable(String)) }
279
+ attr_reader :transaction_type
280
+ end
281
+ # Attribute for field mandate_options
282
+ sig { returns(MandateOptions) }
283
+ attr_reader :mandate_options
284
+ # Bank account verification method.
285
+ sig { returns(String) }
286
+ attr_reader :verification_method
287
+ end
288
+ class Bancontact < Stripe::StripeObject
289
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
290
+ sig { returns(String) }
291
+ attr_reader :preferred_language
292
+ end
293
+ class Card < Stripe::StripeObject
294
+ class Installments < Stripe::StripeObject
295
+ # Whether Installments are enabled for this Invoice.
296
+ sig { returns(T.nilable(T::Boolean)) }
297
+ attr_reader :enabled
298
+ end
299
+ # Attribute for field installments
300
+ sig { returns(Installments) }
301
+ attr_reader :installments
302
+ # 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.
303
+ sig { returns(T.nilable(String)) }
304
+ attr_reader :request_three_d_secure
305
+ end
306
+ class CustomerBalance < Stripe::StripeObject
307
+ class BankTransfer < Stripe::StripeObject
308
+ class EuBankTransfer < Stripe::StripeObject
309
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
310
+ sig { returns(String) }
311
+ attr_reader :country
312
+ end
313
+ # Attribute for field eu_bank_transfer
314
+ sig { returns(EuBankTransfer) }
315
+ attr_reader :eu_bank_transfer
316
+ # 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`.
317
+ sig { returns(T.nilable(String)) }
318
+ attr_reader :type
319
+ end
320
+ # Attribute for field bank_transfer
321
+ sig { returns(BankTransfer) }
322
+ attr_reader :bank_transfer
323
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
324
+ sig { returns(T.nilable(String)) }
325
+ attr_reader :funding_type
326
+ end
327
+ class Konbini < Stripe::StripeObject; end
328
+ class SepaDebit < Stripe::StripeObject; end
329
+ class UsBankAccount < Stripe::StripeObject
330
+ class FinancialConnections < Stripe::StripeObject
331
+ class Filters < Stripe::StripeObject
332
+ # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
333
+ sig { returns(T::Array[String]) }
334
+ attr_reader :account_subcategories
335
+ end
336
+ # Attribute for field filters
337
+ sig { returns(Filters) }
338
+ attr_reader :filters
339
+ # The list of permissions to request. The `payment_method` permission must be included.
340
+ sig { returns(T::Array[String]) }
341
+ attr_reader :permissions
342
+ # Data features requested to be retrieved upon account creation.
343
+ sig { returns(T.nilable(T::Array[String])) }
344
+ attr_reader :prefetch
345
+ end
346
+ # Attribute for field financial_connections
347
+ sig { returns(FinancialConnections) }
348
+ attr_reader :financial_connections
349
+ # Bank account verification method.
350
+ sig { returns(String) }
351
+ attr_reader :verification_method
352
+ end
353
+ # 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.
354
+ sig { returns(T.nilable(AcssDebit)) }
355
+ attr_reader :acss_debit
356
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
357
+ sig { returns(T.nilable(Bancontact)) }
358
+ attr_reader :bancontact
359
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
360
+ sig { returns(T.nilable(Card)) }
361
+ attr_reader :card
362
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
363
+ sig { returns(T.nilable(CustomerBalance)) }
364
+ attr_reader :customer_balance
365
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
366
+ sig { returns(T.nilable(Konbini)) }
367
+ attr_reader :konbini
368
+ # 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.
369
+ sig { returns(T.nilable(SepaDebit)) }
370
+ attr_reader :sepa_debit
371
+ # 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.
372
+ sig { returns(T.nilable(UsBankAccount)) }
373
+ attr_reader :us_bank_account
374
+ end
375
+ # 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.
376
+ sig { returns(T.nilable(String)) }
377
+ attr_reader :default_mandate
378
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
379
+ sig { returns(T.nilable(PaymentMethodOptions)) }
380
+ attr_reader :payment_method_options
381
+ # 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).
382
+ sig { returns(T.nilable(T::Array[String])) }
383
+ attr_reader :payment_method_types
384
+ end
385
+ class Rendering < Stripe::StripeObject
386
+ class Pdf < Stripe::StripeObject
387
+ # Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale.
388
+ sig { returns(T.nilable(String)) }
389
+ attr_reader :page_size
390
+ end
391
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
392
+ sig { returns(T.nilable(String)) }
393
+ attr_reader :amount_tax_display
394
+ # Invoice pdf rendering options
395
+ sig { returns(T.nilable(Pdf)) }
396
+ attr_reader :pdf
397
+ # ID of the rendering template that the invoice is formatted by.
398
+ sig { returns(T.nilable(String)) }
399
+ attr_reader :template
400
+ # Version of the rendering template that the invoice is using.
401
+ sig { returns(T.nilable(Integer)) }
402
+ attr_reader :template_version
403
+ end
404
+ class ShippingCost < Stripe::StripeObject
405
+ class Tax < Stripe::StripeObject
406
+ # Amount of tax applied for this rate.
407
+ sig { returns(Integer) }
408
+ attr_reader :amount
409
+ # Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
410
+ #
411
+ # Related guide: [Tax rates](/billing/taxes/tax-rates)
412
+ sig { returns(Stripe::TaxRate) }
413
+ attr_reader :rate
414
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
415
+ sig { returns(T.nilable(String)) }
416
+ attr_reader :taxability_reason
417
+ # The amount on which tax is calculated, in cents (or local equivalent).
418
+ sig { returns(T.nilable(Integer)) }
419
+ attr_reader :taxable_amount
420
+ end
421
+ # Total shipping cost before any taxes are applied.
422
+ sig { returns(Integer) }
423
+ attr_reader :amount_subtotal
424
+ # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0.
425
+ sig { returns(Integer) }
426
+ attr_reader :amount_tax
427
+ # Total shipping cost after taxes are applied.
428
+ sig { returns(Integer) }
429
+ attr_reader :amount_total
430
+ # The ID of the ShippingRate for this invoice.
431
+ sig { returns(T.nilable(T.any(String, Stripe::ShippingRate))) }
432
+ attr_reader :shipping_rate
433
+ # The taxes applied to the shipping rate.
434
+ sig { returns(T::Array[Tax]) }
435
+ attr_reader :taxes
436
+ end
437
+ class ShippingDetails < Stripe::StripeObject
438
+ class Address < Stripe::StripeObject
439
+ # City, district, suburb, town, or village.
440
+ sig { returns(T.nilable(String)) }
441
+ attr_reader :city
442
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
443
+ sig { returns(T.nilable(String)) }
444
+ attr_reader :country
445
+ # Address line 1 (e.g., street, PO Box, or company name).
446
+ sig { returns(T.nilable(String)) }
447
+ attr_reader :line1
448
+ # Address line 2 (e.g., apartment, suite, unit, or building).
449
+ sig { returns(T.nilable(String)) }
450
+ attr_reader :line2
451
+ # ZIP or postal code.
452
+ sig { returns(T.nilable(String)) }
453
+ attr_reader :postal_code
454
+ # State, county, province, or region.
455
+ sig { returns(T.nilable(String)) }
456
+ attr_reader :state
457
+ end
458
+ # Attribute for field address
459
+ sig { returns(Address) }
460
+ attr_reader :address
461
+ # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
462
+ sig { returns(T.nilable(String)) }
463
+ attr_reader :carrier
464
+ # Recipient name.
465
+ sig { returns(String) }
466
+ attr_reader :name
467
+ # Recipient phone (including extension).
468
+ sig { returns(T.nilable(String)) }
469
+ attr_reader :phone
470
+ # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
471
+ sig { returns(T.nilable(String)) }
472
+ attr_reader :tracking_number
473
+ end
474
+ class StatusTransitions < Stripe::StripeObject
475
+ # The time that the invoice draft was finalized.
476
+ sig { returns(T.nilable(Integer)) }
477
+ attr_reader :finalized_at
478
+ # The time that the invoice was marked uncollectible.
479
+ sig { returns(T.nilable(Integer)) }
480
+ attr_reader :marked_uncollectible_at
481
+ # The time that the invoice was paid.
482
+ sig { returns(T.nilable(Integer)) }
483
+ attr_reader :paid_at
484
+ # The time that the invoice was voided.
485
+ sig { returns(T.nilable(Integer)) }
486
+ attr_reader :voided_at
487
+ end
488
+ class ThresholdReason < Stripe::StripeObject
489
+ class ItemReason < Stripe::StripeObject
490
+ # The IDs of the line items that triggered the threshold invoice.
491
+ sig { returns(T::Array[String]) }
492
+ attr_reader :line_item_ids
493
+ # The quantity threshold boundary that applied to the given line item.
494
+ sig { returns(Integer) }
495
+ attr_reader :usage_gte
496
+ end
497
+ # The total invoice amount threshold boundary if it triggered the threshold invoice.
498
+ sig { returns(T.nilable(Integer)) }
499
+ attr_reader :amount_gte
500
+ # Indicates which line items triggered a threshold invoice.
501
+ sig { returns(T::Array[ItemReason]) }
502
+ attr_reader :item_reasons
503
+ end
504
+ class TotalDiscountAmount < Stripe::StripeObject
505
+ # The amount, in cents (or local equivalent), of the discount.
506
+ sig { returns(Integer) }
507
+ attr_reader :amount
508
+ # The discount that was applied to get this discount amount.
509
+ sig { returns(T.any(String, Stripe::Discount)) }
510
+ attr_reader :discount
511
+ end
512
+ class TotalPretaxCreditAmount < Stripe::StripeObject
513
+ # The amount, in cents (or local equivalent), of the pretax credit amount.
514
+ sig { returns(Integer) }
515
+ attr_reader :amount
516
+ # The credit balance transaction that was applied to get this pretax credit amount.
517
+ sig { returns(T.nilable(T.any(String, Stripe::Billing::CreditBalanceTransaction))) }
518
+ attr_reader :credit_balance_transaction
519
+ # The discount that was applied to get this pretax credit amount.
520
+ sig { returns(T.any(String, Stripe::Discount)) }
521
+ attr_reader :discount
522
+ # Type of the pretax credit amount referenced.
523
+ sig { returns(String) }
524
+ attr_reader :type
525
+ end
526
+ class TotalTax < Stripe::StripeObject
527
+ class TaxRateDetails < Stripe::StripeObject
528
+ # Attribute for field tax_rate
529
+ sig { returns(String) }
530
+ attr_reader :tax_rate
531
+ end
532
+ # The amount of the tax, in cents (or local equivalent).
533
+ sig { returns(Integer) }
534
+ attr_reader :amount
535
+ # Whether this tax is inclusive or exclusive.
536
+ sig { returns(String) }
537
+ attr_reader :tax_behavior
538
+ # Additional details about the tax rate. Only present when `type` is `tax_rate_details`.
539
+ sig { returns(T.nilable(TaxRateDetails)) }
540
+ attr_reader :tax_rate_details
541
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
542
+ sig { returns(String) }
543
+ attr_reader :taxability_reason
544
+ # The amount on which tax is calculated, in cents (or local equivalent).
545
+ sig { returns(T.nilable(Integer)) }
546
+ attr_reader :taxable_amount
547
+ # The type of tax information.
548
+ sig { returns(String) }
549
+ attr_reader :type
550
+ end
551
+ # The country of the business associated with this invoice, most often the business creating the invoice.
552
+ sig { returns(T.nilable(String)) }
553
+ attr_reader :account_country
554
+ # The public name of the business associated with this invoice, most often the business creating the invoice.
555
+ sig { returns(T.nilable(String)) }
556
+ attr_reader :account_name
557
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
558
+ sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) }
559
+ attr_reader :account_tax_ids
560
+ # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.
561
+ sig { returns(Integer) }
562
+ attr_reader :amount_due
563
+ # Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.
564
+ sig { returns(Integer) }
565
+ attr_reader :amount_overpaid
566
+ # The amount, in cents (or local equivalent), that was paid.
567
+ sig { returns(Integer) }
568
+ attr_reader :amount_paid
569
+ # The difference between amount_due and amount_paid, in cents (or local equivalent).
570
+ sig { returns(Integer) }
571
+ attr_reader :amount_remaining
572
+ # This is the sum of all the shipping amounts.
573
+ sig { returns(Integer) }
574
+ attr_reader :amount_shipping
575
+ # ID of the Connect Application that created the invoice.
576
+ sig { returns(T.nilable(T.any(String, Stripe::Application))) }
577
+ attr_reader :application
578
+ # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
579
+ sig { returns(Integer) }
580
+ attr_reader :attempt_count
581
+ # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.
582
+ sig { returns(T::Boolean) }
583
+ attr_reader :attempted
584
+ # 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.
585
+ sig { returns(T::Boolean) }
586
+ attr_reader :auto_advance
587
+ # Attribute for field automatic_tax
588
+ sig { returns(AutomaticTax) }
589
+ attr_reader :automatic_tax
590
+ # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized.
591
+ sig { returns(T.nilable(Integer)) }
592
+ attr_reader :automatically_finalizes_at
593
+ # Indicates the reason why the invoice was created.
594
+ #
595
+ # * `manual`: Unrelated to a subscription, for example, created via the invoice editor.
596
+ # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.
597
+ # * `subscription_create`: A new subscription was created.
598
+ # * `subscription_cycle`: A subscription advanced into a new period.
599
+ # * `subscription_threshold`: A subscription reached a billing threshold.
600
+ # * `subscription_update`: A subscription was updated.
601
+ # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.
602
+ sig { returns(T.nilable(String)) }
603
+ attr_reader :billing_reason
604
+ # 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.
605
+ sig { returns(String) }
606
+ attr_reader :collection_method
607
+ # The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization.
608
+ sig { returns(T.nilable(ConfirmationSecret)) }
609
+ attr_reader :confirmation_secret
610
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
611
+ sig { returns(Integer) }
612
+ attr_reader :created
613
+ # 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).
614
+ sig { returns(String) }
615
+ attr_reader :currency
616
+ # Custom fields displayed on the invoice.
617
+ sig { returns(T.nilable(T::Array[CustomField])) }
618
+ attr_reader :custom_fields
619
+ # The ID of the customer who will be billed.
620
+ sig { returns(T.nilable(T.any(String, Stripe::Customer))) }
621
+ attr_reader :customer
622
+ # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.
623
+ sig { returns(T.nilable(CustomerAddress)) }
624
+ attr_reader :customer_address
625
+ # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
626
+ sig { returns(T.nilable(String)) }
627
+ attr_reader :customer_email
628
+ # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.
629
+ sig { returns(T.nilable(String)) }
630
+ attr_reader :customer_name
631
+ # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.
632
+ sig { returns(T.nilable(String)) }
633
+ attr_reader :customer_phone
634
+ # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated.
635
+ sig { returns(T.nilable(CustomerShipping)) }
636
+ attr_reader :customer_shipping
637
+ # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.
638
+ sig { returns(T.nilable(String)) }
639
+ attr_reader :customer_tax_exempt
640
+ # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
641
+ sig { returns(T.nilable(T::Array[CustomerTaxId])) }
642
+ attr_reader :customer_tax_ids
643
+ # 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.
644
+ sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) }
645
+ attr_reader :default_payment_method
646
+ # 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.
647
+ sig {
648
+ returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source))))
649
+ }
650
+ attr_reader :default_source
651
+ # The tax rates applied to this invoice, if any.
652
+ sig { returns(T::Array[Stripe::TaxRate]) }
653
+ attr_reader :default_tax_rates
654
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
655
+ sig { returns(T.nilable(String)) }
656
+ attr_reader :description
657
+ # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
658
+ sig { returns(T::Array[T.any(String, Stripe::Discount)]) }
659
+ attr_reader :discounts
660
+ # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
661
+ sig { returns(T.nilable(Integer)) }
662
+ attr_reader :due_date
663
+ # 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.
664
+ sig { returns(T.nilable(Integer)) }
665
+ attr_reader :effective_at
666
+ # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
667
+ sig { returns(T.nilable(Integer)) }
668
+ attr_reader :ending_balance
669
+ # Footer displayed on the invoice.
670
+ sig { returns(T.nilable(String)) }
671
+ attr_reader :footer
672
+ # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
673
+ sig { returns(T.nilable(FromInvoice)) }
674
+ attr_reader :from_invoice
675
+ # The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
676
+ sig { returns(T.nilable(String)) }
677
+ attr_reader :hosted_invoice_url
678
+ # Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details.
679
+ sig { returns(String) }
680
+ attr_reader :id
681
+ # The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
682
+ sig { returns(T.nilable(String)) }
683
+ attr_reader :invoice_pdf
684
+ # Attribute for field issuer
685
+ sig { returns(Issuer) }
686
+ attr_reader :issuer
687
+ # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
688
+ sig { returns(T.nilable(LastFinalizationError)) }
689
+ attr_reader :last_finalization_error
690
+ # The ID of the most recent non-draft revision of this invoice
691
+ sig { returns(T.nilable(T.any(String, Stripe::Invoice))) }
692
+ attr_reader :latest_revision
693
+ # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
694
+ sig { returns(Stripe::ListObject) }
695
+ attr_reader :lines
696
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
697
+ sig { returns(T::Boolean) }
698
+ attr_reader :livemode
699
+ # 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.
700
+ sig { returns(T.nilable(T::Hash[String, String])) }
701
+ attr_reader :metadata
702
+ # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.
703
+ sig { returns(T.nilable(Integer)) }
704
+ attr_reader :next_payment_attempt
705
+ # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
706
+ sig { returns(T.nilable(String)) }
707
+ attr_reader :number
708
+ # String representing the object's type. Objects of the same type share the same value.
709
+ sig { returns(String) }
710
+ attr_reader :object
711
+ # 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.
712
+ sig { returns(T.nilable(T.any(String, Stripe::Account))) }
713
+ attr_reader :on_behalf_of
714
+ # The parent that generated this invoice
715
+ sig { returns(T.nilable(Parent)) }
716
+ attr_reader :parent
717
+ # Attribute for field payment_settings
718
+ sig { returns(PaymentSettings) }
719
+ attr_reader :payment_settings
720
+ # Payments for this invoice
721
+ sig { returns(Stripe::ListObject) }
722
+ attr_reader :payments
723
+ # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
724
+ sig { returns(Integer) }
725
+ attr_reader :period_end
726
+ # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
727
+ sig { returns(Integer) }
728
+ attr_reader :period_start
729
+ # Total amount of all post-payment credit notes issued for this invoice.
730
+ sig { returns(Integer) }
731
+ attr_reader :post_payment_credit_notes_amount
732
+ # Total amount of all pre-payment credit notes issued for this invoice.
733
+ sig { returns(Integer) }
734
+ attr_reader :pre_payment_credit_notes_amount
735
+ # This is the transaction number that appears on email receipts sent for this invoice.
736
+ sig { returns(T.nilable(String)) }
737
+ attr_reader :receipt_number
738
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
739
+ sig { returns(T.nilable(Rendering)) }
740
+ attr_reader :rendering
741
+ # The details of the cost of shipping, including the ShippingRate applied on the invoice.
742
+ sig { returns(T.nilable(ShippingCost)) }
743
+ attr_reader :shipping_cost
744
+ # 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.
745
+ sig { returns(T.nilable(ShippingDetails)) }
746
+ attr_reader :shipping_details
747
+ # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
748
+ sig { returns(Integer) }
749
+ attr_reader :starting_balance
750
+ # Extra information about an invoice for the customer's credit card statement.
751
+ sig { returns(T.nilable(String)) }
752
+ attr_reader :statement_descriptor
753
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
754
+ sig { returns(T.nilable(String)) }
755
+ attr_reader :status
756
+ # Attribute for field status_transitions
757
+ sig { returns(StatusTransitions) }
758
+ attr_reader :status_transitions
759
+ # Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
760
+ sig { returns(Integer) }
761
+ attr_reader :subtotal
762
+ # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
763
+ sig { returns(T.nilable(Integer)) }
764
+ attr_reader :subtotal_excluding_tax
765
+ # ID of the test clock this invoice belongs to.
766
+ sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) }
767
+ attr_reader :test_clock
768
+ # Attribute for field threshold_reason
769
+ sig { returns(ThresholdReason) }
770
+ attr_reader :threshold_reason
771
+ # Total after discounts and taxes.
772
+ sig { returns(Integer) }
773
+ attr_reader :total
774
+ # The aggregate amounts calculated per discount across all line items.
775
+ sig { returns(T.nilable(T::Array[TotalDiscountAmount])) }
776
+ attr_reader :total_discount_amounts
777
+ # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
778
+ sig { returns(T.nilable(Integer)) }
779
+ attr_reader :total_excluding_tax
780
+ # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
781
+ sig { returns(T.nilable(T::Array[TotalPretaxCreditAmount])) }
782
+ attr_reader :total_pretax_credit_amounts
783
+ # The aggregate tax information of all line items.
784
+ sig { returns(T.nilable(T::Array[TotalTax])) }
785
+ attr_reader :total_taxes
786
+ # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
787
+ sig { returns(T.nilable(Integer)) }
788
+ attr_reader :webhooks_delivered_at
789
+ # Always true for a deleted object
790
+ sig { returns(T::Boolean) }
791
+ attr_reader :deleted
792
+ class DeleteParams < Stripe::RequestParams
793
+
794
+ end
795
+ class UpdateParams < Stripe::RequestParams
796
+ class AutomaticTax < Stripe::RequestParams
797
+ class Liability < Stripe::RequestParams
798
+ # The connected account being referenced when `type` is `account`.
799
+ sig { returns(T.nilable(String)) }
800
+ attr_accessor :account
801
+ # Type of the account referenced in the request.
802
+ sig { returns(String) }
803
+ attr_accessor :type
804
+ sig { params(account: T.nilable(String), type: String).void }
805
+ def initialize(account: nil, type: nil); end
806
+ end
807
+ # 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.
808
+ sig { returns(T::Boolean) }
809
+ attr_accessor :enabled
810
+ # 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.
811
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax::Liability)) }
812
+ attr_accessor :liability
813
+ sig {
814
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax::Liability)).void
815
+ }
816
+ def initialize(enabled: nil, liability: nil); end
817
+ end
818
+ class CustomField < Stripe::RequestParams
819
+ # The name of the custom field. This may be up to 40 characters.
820
+ sig { returns(String) }
821
+ attr_accessor :name
822
+ # The value of the custom field. This may be up to 140 characters.
823
+ sig { returns(String) }
824
+ attr_accessor :value
825
+ sig { params(name: String, value: String).void }
826
+ def initialize(name: nil, value: nil); end
827
+ end
828
+ class Discount < Stripe::RequestParams
829
+ # ID of the coupon to create a new discount for.
830
+ sig { returns(T.nilable(String)) }
831
+ attr_accessor :coupon
832
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
833
+ sig { returns(T.nilable(String)) }
834
+ attr_accessor :discount
835
+ # ID of the promotion code to create a new discount for.
836
+ sig { returns(T.nilable(String)) }
837
+ attr_accessor :promotion_code
838
+ sig {
839
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
840
+ }
841
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
842
+ end
843
+ class Issuer < Stripe::RequestParams
844
+ # The connected account being referenced when `type` is `account`.
845
+ sig { returns(T.nilable(String)) }
846
+ attr_accessor :account
847
+ # Type of the account referenced in the request.
848
+ sig { returns(String) }
849
+ attr_accessor :type
850
+ sig { params(account: T.nilable(String), type: String).void }
851
+ def initialize(account: nil, type: nil); end
852
+ end
853
+ class PaymentSettings < Stripe::RequestParams
854
+ class PaymentMethodOptions < Stripe::RequestParams
855
+ class AcssDebit < Stripe::RequestParams
856
+ class MandateOptions < Stripe::RequestParams
857
+ # Transaction type of the mandate.
858
+ sig { returns(T.nilable(String)) }
859
+ attr_accessor :transaction_type
860
+ sig { params(transaction_type: T.nilable(String)).void }
861
+ def initialize(transaction_type: nil); end
862
+ end
863
+ # Additional fields for Mandate creation
864
+ sig {
865
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
866
+ }
867
+ attr_accessor :mandate_options
868
+ # Verification method for the intent
869
+ sig { returns(T.nilable(String)) }
870
+ attr_accessor :verification_method
871
+ sig {
872
+ params(mandate_options: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
873
+ }
874
+ def initialize(mandate_options: nil, verification_method: nil); end
875
+ end
876
+ class Bancontact < Stripe::RequestParams
877
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
878
+ sig { returns(T.nilable(String)) }
879
+ attr_accessor :preferred_language
880
+ sig { params(preferred_language: T.nilable(String)).void }
881
+ def initialize(preferred_language: nil); end
882
+ end
883
+ class Card < Stripe::RequestParams
884
+ class Installments < Stripe::RequestParams
885
+ class Plan < Stripe::RequestParams
886
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
887
+ sig { returns(T.nilable(Integer)) }
888
+ attr_accessor :count
889
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
890
+ # One of `month`.
891
+ sig { returns(T.nilable(String)) }
892
+ attr_accessor :interval
893
+ # Type of installment plan, one of `fixed_count`.
894
+ sig { returns(String) }
895
+ attr_accessor :type
896
+ sig {
897
+ params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void
898
+ }
899
+ def initialize(count: nil, interval: nil, type: nil); end
900
+ end
901
+ # Setting to true enables installments for this invoice.
902
+ # Setting to false will prevent any selected plan from applying to a payment.
903
+ sig { returns(T.nilable(T::Boolean)) }
904
+ attr_accessor :enabled
905
+ # The selected installment plan to use for this invoice.
906
+ sig {
907
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan))))
908
+ }
909
+ attr_accessor :plan
910
+ sig {
911
+ params(enabled: T.nilable(T::Boolean), plan: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan)))).void
912
+ }
913
+ def initialize(enabled: nil, plan: nil); end
914
+ end
915
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
916
+ #
917
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
918
+ sig {
919
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments))
920
+ }
921
+ attr_accessor :installments
922
+ # 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.
923
+ sig { returns(T.nilable(String)) }
924
+ attr_accessor :request_three_d_secure
925
+ sig {
926
+ params(installments: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::Installments), request_three_d_secure: T.nilable(String)).void
927
+ }
928
+ def initialize(installments: nil, request_three_d_secure: nil); end
929
+ end
930
+ class CustomerBalance < Stripe::RequestParams
931
+ class BankTransfer < Stripe::RequestParams
932
+ class EuBankTransfer < Stripe::RequestParams
933
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
934
+ sig { returns(String) }
935
+ attr_accessor :country
936
+ sig { params(country: String).void }
937
+ def initialize(country: nil); end
938
+ end
939
+ # Configuration for eu_bank_transfer funding type.
940
+ sig {
941
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
942
+ }
943
+ attr_accessor :eu_bank_transfer
944
+ # 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`.
945
+ sig { returns(T.nilable(String)) }
946
+ attr_accessor :type
947
+ sig {
948
+ params(eu_bank_transfer: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
949
+ }
950
+ def initialize(eu_bank_transfer: nil, type: nil); end
951
+ end
952
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
953
+ sig {
954
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
955
+ }
956
+ attr_accessor :bank_transfer
957
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
958
+ sig { returns(T.nilable(String)) }
959
+ attr_accessor :funding_type
960
+ sig {
961
+ params(bank_transfer: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
962
+ }
963
+ def initialize(bank_transfer: nil, funding_type: nil); end
964
+ end
965
+ class Konbini < Stripe::RequestParams
966
+
967
+ end
968
+ class SepaDebit < Stripe::RequestParams
969
+
970
+ end
971
+ class UsBankAccount < Stripe::RequestParams
972
+ class FinancialConnections < Stripe::RequestParams
973
+ class Filters < Stripe::RequestParams
974
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
975
+ sig { returns(T.nilable(T::Array[String])) }
976
+ attr_accessor :account_subcategories
977
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
978
+ def initialize(account_subcategories: nil); end
979
+ end
980
+ # Provide filters for the linked accounts that the customer can select for the payment method.
981
+ sig {
982
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
983
+ }
984
+ attr_accessor :filters
985
+ # 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`.
986
+ sig { returns(T.nilable(T::Array[String])) }
987
+ attr_accessor :permissions
988
+ # List of data features that you would like to retrieve upon account creation.
989
+ sig { returns(T.nilable(T::Array[String])) }
990
+ attr_accessor :prefetch
991
+ sig {
992
+ params(filters: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
993
+ }
994
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
995
+ end
996
+ # Additional fields for Financial Connections Session creation
997
+ sig {
998
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
999
+ }
1000
+ attr_accessor :financial_connections
1001
+ # Verification method for the intent
1002
+ sig { returns(T.nilable(String)) }
1003
+ attr_accessor :verification_method
1004
+ sig {
1005
+ params(financial_connections: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
1006
+ }
1007
+ def initialize(financial_connections: nil, verification_method: nil); end
1008
+ end
1009
+ # 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.
1010
+ sig {
1011
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
1012
+ }
1013
+ attr_accessor :acss_debit
1014
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1015
+ sig {
1016
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
1017
+ }
1018
+ attr_accessor :bancontact
1019
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1020
+ sig {
1021
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))))
1022
+ }
1023
+ attr_accessor :card
1024
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1025
+ sig {
1026
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
1027
+ }
1028
+ attr_accessor :customer_balance
1029
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1030
+ sig {
1031
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
1032
+ }
1033
+ attr_accessor :konbini
1034
+ # 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.
1035
+ sig {
1036
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
1037
+ }
1038
+ attr_accessor :sepa_debit
1039
+ # 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.
1040
+ sig {
1041
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
1042
+ }
1043
+ attr_accessor :us_bank_account
1044
+ sig {
1045
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
1046
+ }
1047
+ def initialize(
1048
+ acss_debit: nil,
1049
+ bancontact: nil,
1050
+ card: nil,
1051
+ customer_balance: nil,
1052
+ konbini: nil,
1053
+ sepa_debit: nil,
1054
+ us_bank_account: nil
1055
+ ); end
1056
+ end
1057
+ # 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.
1058
+ sig { returns(T.nilable(T.nilable(String))) }
1059
+ attr_accessor :default_mandate
1060
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
1061
+ sig {
1062
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions))
1063
+ }
1064
+ attr_accessor :payment_method_options
1065
+ # 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
1066
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1067
+ attr_accessor :payment_method_types
1068
+ sig {
1069
+ params(default_mandate: T.nilable(T.nilable(String)), payment_method_options: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1070
+ }
1071
+ def initialize(
1072
+ default_mandate: nil,
1073
+ payment_method_options: nil,
1074
+ payment_method_types: nil
1075
+ ); end
1076
+ end
1077
+ class Rendering < Stripe::RequestParams
1078
+ class Pdf < Stripe::RequestParams
1079
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
1080
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
1081
+ # Japanese locale and `letter` for customers with other locales.
1082
+ sig { returns(T.nilable(String)) }
1083
+ attr_accessor :page_size
1084
+ sig { params(page_size: T.nilable(String)).void }
1085
+ def initialize(page_size: nil); end
1086
+ end
1087
+ # 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.
1088
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
1089
+ attr_accessor :amount_tax_display
1090
+ # Invoice pdf rendering options
1091
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::Rendering::Pdf)) }
1092
+ attr_accessor :pdf
1093
+ # ID of the invoice rendering template to use for this invoice.
1094
+ sig { returns(T.nilable(String)) }
1095
+ attr_accessor :template
1096
+ # The specific version of invoice rendering template to use for this invoice.
1097
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
1098
+ attr_accessor :template_version
1099
+ sig {
1100
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), pdf: T.nilable(::Stripe::Invoice::UpdateParams::Rendering::Pdf), template: T.nilable(String), template_version: T.nilable(T.nilable(T.any(String, Integer)))).void
1101
+ }
1102
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil); end
1103
+ end
1104
+ class ShippingCost < Stripe::RequestParams
1105
+ class ShippingRateData < Stripe::RequestParams
1106
+ class DeliveryEstimate < Stripe::RequestParams
1107
+ class Maximum < Stripe::RequestParams
1108
+ # A unit of time.
1109
+ sig { returns(String) }
1110
+ attr_accessor :unit
1111
+ # Must be greater than 0.
1112
+ sig { returns(Integer) }
1113
+ attr_accessor :value
1114
+ sig { params(unit: String, value: Integer).void }
1115
+ def initialize(unit: nil, value: nil); end
1116
+ end
1117
+ class Minimum < Stripe::RequestParams
1118
+ # A unit of time.
1119
+ sig { returns(String) }
1120
+ attr_accessor :unit
1121
+ # Must be greater than 0.
1122
+ sig { returns(Integer) }
1123
+ attr_accessor :value
1124
+ sig { params(unit: String, value: Integer).void }
1125
+ def initialize(unit: nil, value: nil); end
1126
+ end
1127
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
1128
+ sig {
1129
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum))
1130
+ }
1131
+ attr_accessor :maximum
1132
+ # The lower bound of the estimated range. If empty, represents no lower bound.
1133
+ sig {
1134
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum))
1135
+ }
1136
+ attr_accessor :minimum
1137
+ sig {
1138
+ params(maximum: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum), minimum: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum)).void
1139
+ }
1140
+ def initialize(maximum: nil, minimum: nil); end
1141
+ end
1142
+ class FixedAmount < Stripe::RequestParams
1143
+ class CurrencyOptions < Stripe::RequestParams
1144
+ # A non-negative integer in cents representing how much to charge.
1145
+ sig { returns(Integer) }
1146
+ attr_accessor :amount
1147
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1148
+ sig { returns(T.nilable(String)) }
1149
+ attr_accessor :tax_behavior
1150
+ sig { params(amount: Integer, tax_behavior: T.nilable(String)).void }
1151
+ def initialize(amount: nil, tax_behavior: nil); end
1152
+ end
1153
+ # A non-negative integer in cents representing how much to charge.
1154
+ sig { returns(Integer) }
1155
+ attr_accessor :amount
1156
+ # 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).
1157
+ sig { returns(String) }
1158
+ attr_accessor :currency
1159
+ # 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).
1160
+ sig {
1161
+ returns(T.nilable(T::Hash[String, ::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions]))
1162
+ }
1163
+ attr_accessor :currency_options
1164
+ sig {
1165
+ params(amount: Integer, currency: String, currency_options: T.nilable(T::Hash[String, ::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions])).void
1166
+ }
1167
+ def initialize(amount: nil, currency: nil, currency_options: nil); end
1168
+ end
1169
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1170
+ sig {
1171
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate))
1172
+ }
1173
+ attr_accessor :delivery_estimate
1174
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1175
+ sig { returns(String) }
1176
+ attr_accessor :display_name
1177
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1178
+ sig {
1179
+ returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount))
1180
+ }
1181
+ attr_accessor :fixed_amount
1182
+ # 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`.
1183
+ sig { returns(T.nilable(T::Hash[String, String])) }
1184
+ attr_accessor :metadata
1185
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1186
+ sig { returns(T.nilable(String)) }
1187
+ attr_accessor :tax_behavior
1188
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1189
+ sig { returns(T.nilable(String)) }
1190
+ attr_accessor :tax_code
1191
+ # The type of calculation to use on the shipping rate.
1192
+ sig { returns(T.nilable(String)) }
1193
+ attr_accessor :type
1194
+ sig {
1195
+ params(delivery_estimate: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::DeliveryEstimate), display_name: String, fixed_amount: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData::FixedAmount), metadata: T.nilable(T::Hash[String, String]), tax_behavior: T.nilable(String), tax_code: T.nilable(String), type: T.nilable(String)).void
1196
+ }
1197
+ def initialize(
1198
+ delivery_estimate: nil,
1199
+ display_name: nil,
1200
+ fixed_amount: nil,
1201
+ metadata: nil,
1202
+ tax_behavior: nil,
1203
+ tax_code: nil,
1204
+ type: nil
1205
+ ); end
1206
+ end
1207
+ # The ID of the shipping rate to use for this order.
1208
+ sig { returns(T.nilable(String)) }
1209
+ attr_accessor :shipping_rate
1210
+ # Parameters to create a new ad-hoc shipping rate for this order.
1211
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData)) }
1212
+ attr_accessor :shipping_rate_data
1213
+ sig {
1214
+ params(shipping_rate: T.nilable(String), shipping_rate_data: T.nilable(::Stripe::Invoice::UpdateParams::ShippingCost::ShippingRateData)).void
1215
+ }
1216
+ def initialize(shipping_rate: nil, shipping_rate_data: nil); end
1217
+ end
1218
+ class ShippingDetails < Stripe::RequestParams
1219
+ class Address < Stripe::RequestParams
1220
+ # City, district, suburb, town, or village.
1221
+ sig { returns(T.nilable(String)) }
1222
+ attr_accessor :city
1223
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1224
+ sig { returns(T.nilable(String)) }
1225
+ attr_accessor :country
1226
+ # Address line 1 (e.g., street, PO Box, or company name).
1227
+ sig { returns(T.nilable(String)) }
1228
+ attr_accessor :line1
1229
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1230
+ sig { returns(T.nilable(String)) }
1231
+ attr_accessor :line2
1232
+ # ZIP or postal code.
1233
+ sig { returns(T.nilable(String)) }
1234
+ attr_accessor :postal_code
1235
+ # State, county, province, or region.
1236
+ sig { returns(T.nilable(String)) }
1237
+ attr_accessor :state
1238
+ sig {
1239
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
1240
+ }
1241
+ def initialize(
1242
+ city: nil,
1243
+ country: nil,
1244
+ line1: nil,
1245
+ line2: nil,
1246
+ postal_code: nil,
1247
+ state: nil
1248
+ ); end
1249
+ end
1250
+ # Shipping address
1251
+ sig { returns(::Stripe::Invoice::UpdateParams::ShippingDetails::Address) }
1252
+ attr_accessor :address
1253
+ # Recipient name.
1254
+ sig { returns(String) }
1255
+ attr_accessor :name
1256
+ # Recipient phone (including extension)
1257
+ sig { returns(T.nilable(T.nilable(String))) }
1258
+ attr_accessor :phone
1259
+ sig {
1260
+ params(address: ::Stripe::Invoice::UpdateParams::ShippingDetails::Address, name: String, phone: T.nilable(T.nilable(String))).void
1261
+ }
1262
+ def initialize(address: nil, name: nil, phone: nil); end
1263
+ end
1264
+ class TransferData < Stripe::RequestParams
1265
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
1266
+ sig { returns(T.nilable(Integer)) }
1267
+ attr_accessor :amount
1268
+ # ID of an existing, connected Stripe account.
1269
+ sig { returns(String) }
1270
+ attr_accessor :destination
1271
+ sig { params(amount: T.nilable(Integer), destination: String).void }
1272
+ def initialize(amount: nil, destination: nil); end
1273
+ end
1274
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1275
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1276
+ attr_accessor :account_tax_ids
1277
+ # 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).
1278
+ sig { returns(T.nilable(Integer)) }
1279
+ attr_accessor :application_fee_amount
1280
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
1281
+ sig { returns(T.nilable(T::Boolean)) }
1282
+ attr_accessor :auto_advance
1283
+ # Settings for automatic tax lookup for this invoice.
1284
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax)) }
1285
+ attr_accessor :automatic_tax
1286
+ # 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.
1287
+ sig { returns(T.nilable(Integer)) }
1288
+ attr_accessor :automatically_finalizes_at
1289
+ # Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices.
1290
+ sig { returns(T.nilable(String)) }
1291
+ attr_accessor :collection_method
1292
+ # 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.
1293
+ sig {
1294
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::CustomField]))))
1295
+ }
1296
+ attr_accessor :custom_fields
1297
+ # 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.
1298
+ sig { returns(T.nilable(Integer)) }
1299
+ attr_accessor :days_until_due
1300
+ # 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.
1301
+ sig { returns(T.nilable(String)) }
1302
+ attr_accessor :default_payment_method
1303
+ # 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.
1304
+ sig { returns(T.nilable(T.nilable(String))) }
1305
+ attr_accessor :default_source
1306
+ # 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.
1307
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1308
+ attr_accessor :default_tax_rates
1309
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
1310
+ sig { returns(T.nilable(String)) }
1311
+ attr_accessor :description
1312
+ # The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
1313
+ sig {
1314
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::Discount]))))
1315
+ }
1316
+ attr_accessor :discounts
1317
+ # 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.
1318
+ sig { returns(T.nilable(Integer)) }
1319
+ attr_accessor :due_date
1320
+ # 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.
1321
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
1322
+ attr_accessor :effective_at
1323
+ # Specifies which fields in the response should be expanded.
1324
+ sig { returns(T.nilable(T::Array[String])) }
1325
+ attr_accessor :expand
1326
+ # Footer to be displayed on the invoice.
1327
+ sig { returns(T.nilable(String)) }
1328
+ attr_accessor :footer
1329
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1330
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::Issuer)) }
1331
+ attr_accessor :issuer
1332
+ # 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`.
1333
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1334
+ attr_accessor :metadata
1335
+ # 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.
1336
+ sig { returns(T.nilable(T.nilable(String))) }
1337
+ attr_accessor :number
1338
+ # 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.
1339
+ sig { returns(T.nilable(T.nilable(String))) }
1340
+ attr_accessor :on_behalf_of
1341
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
1342
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings)) }
1343
+ attr_accessor :payment_settings
1344
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
1345
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateParams::Rendering)) }
1346
+ attr_accessor :rendering
1347
+ # Settings for the cost of shipping for this invoice.
1348
+ sig {
1349
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingCost))))
1350
+ }
1351
+ attr_accessor :shipping_cost
1352
+ # 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.
1353
+ sig {
1354
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingDetails))))
1355
+ }
1356
+ attr_accessor :shipping_details
1357
+ # 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`.
1358
+ sig { returns(T.nilable(String)) }
1359
+ attr_accessor :statement_descriptor
1360
+ # 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.
1361
+ sig {
1362
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::TransferData))))
1363
+ }
1364
+ attr_accessor :transfer_data
1365
+ sig {
1366
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), application_fee_amount: T.nilable(Integer), auto_advance: T.nilable(T::Boolean), automatic_tax: T.nilable(::Stripe::Invoice::UpdateParams::AutomaticTax), automatically_finalizes_at: T.nilable(Integer), collection_method: T.nilable(String), custom_fields: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::CustomField]))), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(T.nilable(String)), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(String), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateParams::Discount]))), due_date: T.nilable(Integer), effective_at: T.nilable(T.nilable(T.any(String, Integer))), expand: T.nilable(T::Array[String]), footer: T.nilable(String), issuer: T.nilable(::Stripe::Invoice::UpdateParams::Issuer), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), number: T.nilable(T.nilable(String)), on_behalf_of: T.nilable(T.nilable(String)), payment_settings: T.nilable(::Stripe::Invoice::UpdateParams::PaymentSettings), rendering: T.nilable(::Stripe::Invoice::UpdateParams::Rendering), shipping_cost: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingCost))), shipping_details: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::ShippingDetails))), statement_descriptor: T.nilable(String), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::UpdateParams::TransferData)))).void
1367
+ }
1368
+ def initialize(
1369
+ account_tax_ids: nil,
1370
+ application_fee_amount: nil,
1371
+ auto_advance: nil,
1372
+ automatic_tax: nil,
1373
+ automatically_finalizes_at: nil,
1374
+ collection_method: nil,
1375
+ custom_fields: nil,
1376
+ days_until_due: nil,
1377
+ default_payment_method: nil,
1378
+ default_source: nil,
1379
+ default_tax_rates: nil,
1380
+ description: nil,
1381
+ discounts: nil,
1382
+ due_date: nil,
1383
+ effective_at: nil,
1384
+ expand: nil,
1385
+ footer: nil,
1386
+ issuer: nil,
1387
+ metadata: nil,
1388
+ number: nil,
1389
+ on_behalf_of: nil,
1390
+ payment_settings: nil,
1391
+ rendering: nil,
1392
+ shipping_cost: nil,
1393
+ shipping_details: nil,
1394
+ statement_descriptor: nil,
1395
+ transfer_data: nil
1396
+ ); end
1397
+ end
1398
+ class ListParams < Stripe::RequestParams
1399
+ class Created < Stripe::RequestParams
1400
+ # Minimum value to filter by (exclusive)
1401
+ sig { returns(T.nilable(Integer)) }
1402
+ attr_accessor :gt
1403
+ # Minimum value to filter by (inclusive)
1404
+ sig { returns(T.nilable(Integer)) }
1405
+ attr_accessor :gte
1406
+ # Maximum value to filter by (exclusive)
1407
+ sig { returns(T.nilable(Integer)) }
1408
+ attr_accessor :lt
1409
+ # Maximum value to filter by (inclusive)
1410
+ sig { returns(T.nilable(Integer)) }
1411
+ attr_accessor :lte
1412
+ sig {
1413
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
1414
+ }
1415
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
1416
+ end
1417
+ class DueDate < Stripe::RequestParams
1418
+ # Minimum value to filter by (exclusive)
1419
+ sig { returns(T.nilable(Integer)) }
1420
+ attr_accessor :gt
1421
+ # Minimum value to filter by (inclusive)
1422
+ sig { returns(T.nilable(Integer)) }
1423
+ attr_accessor :gte
1424
+ # Maximum value to filter by (exclusive)
1425
+ sig { returns(T.nilable(Integer)) }
1426
+ attr_accessor :lt
1427
+ # Maximum value to filter by (inclusive)
1428
+ sig { returns(T.nilable(Integer)) }
1429
+ attr_accessor :lte
1430
+ sig {
1431
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
1432
+ }
1433
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
1434
+ end
1435
+ # The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`.
1436
+ sig { returns(T.nilable(String)) }
1437
+ attr_accessor :collection_method
1438
+ # Only return invoices that were created during the given date interval.
1439
+ sig { returns(T.nilable(T.any(::Stripe::Invoice::ListParams::Created, Integer))) }
1440
+ attr_accessor :created
1441
+ # Only return invoices for the customer specified by this customer ID.
1442
+ sig { returns(T.nilable(String)) }
1443
+ attr_accessor :customer
1444
+ # Attribute for param field due_date
1445
+ sig { returns(T.nilable(T.any(::Stripe::Invoice::ListParams::DueDate, Integer))) }
1446
+ attr_accessor :due_date
1447
+ # 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.
1448
+ sig { returns(T.nilable(String)) }
1449
+ attr_accessor :ending_before
1450
+ # Specifies which fields in the response should be expanded.
1451
+ sig { returns(T.nilable(T::Array[String])) }
1452
+ attr_accessor :expand
1453
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1454
+ sig { returns(T.nilable(Integer)) }
1455
+ attr_accessor :limit
1456
+ # 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.
1457
+ sig { returns(T.nilable(String)) }
1458
+ attr_accessor :starting_after
1459
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
1460
+ sig { returns(T.nilable(String)) }
1461
+ attr_accessor :status
1462
+ # Only return invoices for the subscription specified by this subscription ID.
1463
+ sig { returns(T.nilable(String)) }
1464
+ attr_accessor :subscription
1465
+ sig {
1466
+ params(collection_method: T.nilable(String), created: T.nilable(T.any(::Stripe::Invoice::ListParams::Created, Integer)), customer: T.nilable(String), due_date: T.nilable(T.any(::Stripe::Invoice::ListParams::DueDate, Integer)), ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), starting_after: T.nilable(String), status: T.nilable(String), subscription: T.nilable(String)).void
1467
+ }
1468
+ def initialize(
1469
+ collection_method: nil,
1470
+ created: nil,
1471
+ customer: nil,
1472
+ due_date: nil,
1473
+ ending_before: nil,
1474
+ expand: nil,
1475
+ limit: nil,
1476
+ starting_after: nil,
1477
+ status: nil,
1478
+ subscription: nil
1479
+ ); end
1480
+ end
1481
+ class CreateParams < Stripe::RequestParams
1482
+ class AutomaticTax < Stripe::RequestParams
1483
+ class Liability < Stripe::RequestParams
1484
+ # The connected account being referenced when `type` is `account`.
1485
+ sig { returns(T.nilable(String)) }
1486
+ attr_accessor :account
1487
+ # Type of the account referenced in the request.
1488
+ sig { returns(String) }
1489
+ attr_accessor :type
1490
+ sig { params(account: T.nilable(String), type: String).void }
1491
+ def initialize(account: nil, type: nil); end
1492
+ end
1493
+ # 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.
1494
+ sig { returns(T::Boolean) }
1495
+ attr_accessor :enabled
1496
+ # 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.
1497
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax::Liability)) }
1498
+ attr_accessor :liability
1499
+ sig {
1500
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax::Liability)).void
1501
+ }
1502
+ def initialize(enabled: nil, liability: nil); end
1503
+ end
1504
+ class CustomField < Stripe::RequestParams
1505
+ # The name of the custom field. This may be up to 40 characters.
1506
+ sig { returns(String) }
1507
+ attr_accessor :name
1508
+ # The value of the custom field. This may be up to 140 characters.
1509
+ sig { returns(String) }
1510
+ attr_accessor :value
1511
+ sig { params(name: String, value: String).void }
1512
+ def initialize(name: nil, value: nil); end
1513
+ end
1514
+ class Discount < Stripe::RequestParams
1515
+ # ID of the coupon to create a new discount for.
1516
+ sig { returns(T.nilable(String)) }
1517
+ attr_accessor :coupon
1518
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1519
+ sig { returns(T.nilable(String)) }
1520
+ attr_accessor :discount
1521
+ # ID of the promotion code to create a new discount for.
1522
+ sig { returns(T.nilable(String)) }
1523
+ attr_accessor :promotion_code
1524
+ sig {
1525
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1526
+ }
1527
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1528
+ end
1529
+ class FromInvoice < Stripe::RequestParams
1530
+ # The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted
1531
+ sig { returns(String) }
1532
+ attr_accessor :action
1533
+ # The `id` of the invoice that will be cloned.
1534
+ sig { returns(String) }
1535
+ attr_accessor :invoice
1536
+ sig { params(action: String, invoice: String).void }
1537
+ def initialize(action: nil, invoice: nil); end
1538
+ end
1539
+ class Issuer < Stripe::RequestParams
1540
+ # The connected account being referenced when `type` is `account`.
1541
+ sig { returns(T.nilable(String)) }
1542
+ attr_accessor :account
1543
+ # Type of the account referenced in the request.
1544
+ sig { returns(String) }
1545
+ attr_accessor :type
1546
+ sig { params(account: T.nilable(String), type: String).void }
1547
+ def initialize(account: nil, type: nil); end
1548
+ end
1549
+ class PaymentSettings < Stripe::RequestParams
1550
+ class PaymentMethodOptions < Stripe::RequestParams
1551
+ class AcssDebit < Stripe::RequestParams
1552
+ class MandateOptions < Stripe::RequestParams
1553
+ # Transaction type of the mandate.
1554
+ sig { returns(T.nilable(String)) }
1555
+ attr_accessor :transaction_type
1556
+ sig { params(transaction_type: T.nilable(String)).void }
1557
+ def initialize(transaction_type: nil); end
1558
+ end
1559
+ # Additional fields for Mandate creation
1560
+ sig {
1561
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
1562
+ }
1563
+ attr_accessor :mandate_options
1564
+ # Verification method for the intent
1565
+ sig { returns(T.nilable(String)) }
1566
+ attr_accessor :verification_method
1567
+ sig {
1568
+ params(mandate_options: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
1569
+ }
1570
+ def initialize(mandate_options: nil, verification_method: nil); end
1571
+ end
1572
+ class Bancontact < Stripe::RequestParams
1573
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
1574
+ sig { returns(T.nilable(String)) }
1575
+ attr_accessor :preferred_language
1576
+ sig { params(preferred_language: T.nilable(String)).void }
1577
+ def initialize(preferred_language: nil); end
1578
+ end
1579
+ class Card < Stripe::RequestParams
1580
+ class Installments < Stripe::RequestParams
1581
+ class Plan < Stripe::RequestParams
1582
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
1583
+ sig { returns(T.nilable(Integer)) }
1584
+ attr_accessor :count
1585
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
1586
+ # One of `month`.
1587
+ sig { returns(T.nilable(String)) }
1588
+ attr_accessor :interval
1589
+ # Type of installment plan, one of `fixed_count`.
1590
+ sig { returns(String) }
1591
+ attr_accessor :type
1592
+ sig {
1593
+ params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void
1594
+ }
1595
+ def initialize(count: nil, interval: nil, type: nil); end
1596
+ end
1597
+ # Setting to true enables installments for this invoice.
1598
+ # Setting to false will prevent any selected plan from applying to a payment.
1599
+ sig { returns(T.nilable(T::Boolean)) }
1600
+ attr_accessor :enabled
1601
+ # The selected installment plan to use for this invoice.
1602
+ sig {
1603
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan))))
1604
+ }
1605
+ attr_accessor :plan
1606
+ sig {
1607
+ params(enabled: T.nilable(T::Boolean), plan: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments::Plan)))).void
1608
+ }
1609
+ def initialize(enabled: nil, plan: nil); end
1610
+ end
1611
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
1612
+ #
1613
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
1614
+ sig {
1615
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments))
1616
+ }
1617
+ attr_accessor :installments
1618
+ # 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.
1619
+ sig { returns(T.nilable(String)) }
1620
+ attr_accessor :request_three_d_secure
1621
+ sig {
1622
+ params(installments: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card::Installments), request_three_d_secure: T.nilable(String)).void
1623
+ }
1624
+ def initialize(installments: nil, request_three_d_secure: nil); end
1625
+ end
1626
+ class CustomerBalance < Stripe::RequestParams
1627
+ class BankTransfer < Stripe::RequestParams
1628
+ class EuBankTransfer < Stripe::RequestParams
1629
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1630
+ sig { returns(String) }
1631
+ attr_accessor :country
1632
+ sig { params(country: String).void }
1633
+ def initialize(country: nil); end
1634
+ end
1635
+ # Configuration for eu_bank_transfer funding type.
1636
+ sig {
1637
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
1638
+ }
1639
+ attr_accessor :eu_bank_transfer
1640
+ # 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`.
1641
+ sig { returns(T.nilable(String)) }
1642
+ attr_accessor :type
1643
+ sig {
1644
+ params(eu_bank_transfer: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
1645
+ }
1646
+ def initialize(eu_bank_transfer: nil, type: nil); end
1647
+ end
1648
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1649
+ sig {
1650
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
1651
+ }
1652
+ attr_accessor :bank_transfer
1653
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
1654
+ sig { returns(T.nilable(String)) }
1655
+ attr_accessor :funding_type
1656
+ sig {
1657
+ params(bank_transfer: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
1658
+ }
1659
+ def initialize(bank_transfer: nil, funding_type: nil); end
1660
+ end
1661
+ class Konbini < Stripe::RequestParams
1662
+
1663
+ end
1664
+ class SepaDebit < Stripe::RequestParams
1665
+
1666
+ end
1667
+ class UsBankAccount < Stripe::RequestParams
1668
+ class FinancialConnections < Stripe::RequestParams
1669
+ class Filters < Stripe::RequestParams
1670
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1671
+ sig { returns(T.nilable(T::Array[String])) }
1672
+ attr_accessor :account_subcategories
1673
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
1674
+ def initialize(account_subcategories: nil); end
1675
+ end
1676
+ # Provide filters for the linked accounts that the customer can select for the payment method.
1677
+ sig {
1678
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
1679
+ }
1680
+ attr_accessor :filters
1681
+ # 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`.
1682
+ sig { returns(T.nilable(T::Array[String])) }
1683
+ attr_accessor :permissions
1684
+ # List of data features that you would like to retrieve upon account creation.
1685
+ sig { returns(T.nilable(T::Array[String])) }
1686
+ attr_accessor :prefetch
1687
+ sig {
1688
+ params(filters: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
1689
+ }
1690
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
1691
+ end
1692
+ # Additional fields for Financial Connections Session creation
1693
+ sig {
1694
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
1695
+ }
1696
+ attr_accessor :financial_connections
1697
+ # Verification method for the intent
1698
+ sig { returns(T.nilable(String)) }
1699
+ attr_accessor :verification_method
1700
+ sig {
1701
+ params(financial_connections: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
1702
+ }
1703
+ def initialize(financial_connections: nil, verification_method: nil); end
1704
+ end
1705
+ # 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.
1706
+ sig {
1707
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
1708
+ }
1709
+ attr_accessor :acss_debit
1710
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1711
+ sig {
1712
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
1713
+ }
1714
+ attr_accessor :bancontact
1715
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1716
+ sig {
1717
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card))))
1718
+ }
1719
+ attr_accessor :card
1720
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1721
+ sig {
1722
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
1723
+ }
1724
+ attr_accessor :customer_balance
1725
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1726
+ sig {
1727
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
1728
+ }
1729
+ attr_accessor :konbini
1730
+ # 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.
1731
+ sig {
1732
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
1733
+ }
1734
+ attr_accessor :sepa_debit
1735
+ # 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.
1736
+ sig {
1737
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
1738
+ }
1739
+ attr_accessor :us_bank_account
1740
+ sig {
1741
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
1742
+ }
1743
+ def initialize(
1744
+ acss_debit: nil,
1745
+ bancontact: nil,
1746
+ card: nil,
1747
+ customer_balance: nil,
1748
+ konbini: nil,
1749
+ sepa_debit: nil,
1750
+ us_bank_account: nil
1751
+ ); end
1752
+ end
1753
+ # 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.
1754
+ sig { returns(T.nilable(T.nilable(String))) }
1755
+ attr_accessor :default_mandate
1756
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
1757
+ sig {
1758
+ returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions))
1759
+ }
1760
+ attr_accessor :payment_method_options
1761
+ # 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
1762
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1763
+ attr_accessor :payment_method_types
1764
+ sig {
1765
+ params(default_mandate: T.nilable(T.nilable(String)), payment_method_options: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1766
+ }
1767
+ def initialize(
1768
+ default_mandate: nil,
1769
+ payment_method_options: nil,
1770
+ payment_method_types: nil
1771
+ ); end
1772
+ end
1773
+ class Rendering < Stripe::RequestParams
1774
+ class Pdf < Stripe::RequestParams
1775
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
1776
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
1777
+ # Japanese locale and `letter` for customers with other locales.
1778
+ sig { returns(T.nilable(String)) }
1779
+ attr_accessor :page_size
1780
+ sig { params(page_size: T.nilable(String)).void }
1781
+ def initialize(page_size: nil); end
1782
+ end
1783
+ # 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.
1784
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
1785
+ attr_accessor :amount_tax_display
1786
+ # Invoice pdf rendering options
1787
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::Rendering::Pdf)) }
1788
+ attr_accessor :pdf
1789
+ # ID of the invoice rendering template to use for this invoice.
1790
+ sig { returns(T.nilable(String)) }
1791
+ attr_accessor :template
1792
+ # The specific version of invoice rendering template to use for this invoice.
1793
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
1794
+ attr_accessor :template_version
1795
+ sig {
1796
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), pdf: T.nilable(::Stripe::Invoice::CreateParams::Rendering::Pdf), template: T.nilable(String), template_version: T.nilable(T.nilable(T.any(String, Integer)))).void
1797
+ }
1798
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil); end
1799
+ end
1800
+ class ShippingCost < Stripe::RequestParams
1801
+ class ShippingRateData < Stripe::RequestParams
1802
+ class DeliveryEstimate < Stripe::RequestParams
1803
+ class Maximum < Stripe::RequestParams
1804
+ # A unit of time.
1805
+ sig { returns(String) }
1806
+ attr_accessor :unit
1807
+ # Must be greater than 0.
1808
+ sig { returns(Integer) }
1809
+ attr_accessor :value
1810
+ sig { params(unit: String, value: Integer).void }
1811
+ def initialize(unit: nil, value: nil); end
1812
+ end
1813
+ class Minimum < Stripe::RequestParams
1814
+ # A unit of time.
1815
+ sig { returns(String) }
1816
+ attr_accessor :unit
1817
+ # Must be greater than 0.
1818
+ sig { returns(Integer) }
1819
+ attr_accessor :value
1820
+ sig { params(unit: String, value: Integer).void }
1821
+ def initialize(unit: nil, value: nil); end
1822
+ end
1823
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
1824
+ sig {
1825
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum))
1826
+ }
1827
+ attr_accessor :maximum
1828
+ # The lower bound of the estimated range. If empty, represents no lower bound.
1829
+ sig {
1830
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum))
1831
+ }
1832
+ attr_accessor :minimum
1833
+ sig {
1834
+ params(maximum: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Maximum), minimum: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate::Minimum)).void
1835
+ }
1836
+ def initialize(maximum: nil, minimum: nil); end
1837
+ end
1838
+ class FixedAmount < Stripe::RequestParams
1839
+ class CurrencyOptions < Stripe::RequestParams
1840
+ # A non-negative integer in cents representing how much to charge.
1841
+ sig { returns(Integer) }
1842
+ attr_accessor :amount
1843
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1844
+ sig { returns(T.nilable(String)) }
1845
+ attr_accessor :tax_behavior
1846
+ sig { params(amount: Integer, tax_behavior: T.nilable(String)).void }
1847
+ def initialize(amount: nil, tax_behavior: nil); end
1848
+ end
1849
+ # A non-negative integer in cents representing how much to charge.
1850
+ sig { returns(Integer) }
1851
+ attr_accessor :amount
1852
+ # 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).
1853
+ sig { returns(String) }
1854
+ attr_accessor :currency
1855
+ # 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).
1856
+ sig {
1857
+ returns(T.nilable(T::Hash[String, ::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions]))
1858
+ }
1859
+ attr_accessor :currency_options
1860
+ sig {
1861
+ params(amount: Integer, currency: String, currency_options: T.nilable(T::Hash[String, ::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount::CurrencyOptions])).void
1862
+ }
1863
+ def initialize(amount: nil, currency: nil, currency_options: nil); end
1864
+ end
1865
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1866
+ sig {
1867
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate))
1868
+ }
1869
+ attr_accessor :delivery_estimate
1870
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1871
+ sig { returns(String) }
1872
+ attr_accessor :display_name
1873
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1874
+ sig {
1875
+ returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount))
1876
+ }
1877
+ attr_accessor :fixed_amount
1878
+ # 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`.
1879
+ sig { returns(T.nilable(T::Hash[String, String])) }
1880
+ attr_accessor :metadata
1881
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1882
+ sig { returns(T.nilable(String)) }
1883
+ attr_accessor :tax_behavior
1884
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1885
+ sig { returns(T.nilable(String)) }
1886
+ attr_accessor :tax_code
1887
+ # The type of calculation to use on the shipping rate.
1888
+ sig { returns(T.nilable(String)) }
1889
+ attr_accessor :type
1890
+ sig {
1891
+ params(delivery_estimate: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::DeliveryEstimate), display_name: String, fixed_amount: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData::FixedAmount), metadata: T.nilable(T::Hash[String, String]), tax_behavior: T.nilable(String), tax_code: T.nilable(String), type: T.nilable(String)).void
1892
+ }
1893
+ def initialize(
1894
+ delivery_estimate: nil,
1895
+ display_name: nil,
1896
+ fixed_amount: nil,
1897
+ metadata: nil,
1898
+ tax_behavior: nil,
1899
+ tax_code: nil,
1900
+ type: nil
1901
+ ); end
1902
+ end
1903
+ # The ID of the shipping rate to use for this order.
1904
+ sig { returns(T.nilable(String)) }
1905
+ attr_accessor :shipping_rate
1906
+ # Parameters to create a new ad-hoc shipping rate for this order.
1907
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData)) }
1908
+ attr_accessor :shipping_rate_data
1909
+ sig {
1910
+ params(shipping_rate: T.nilable(String), shipping_rate_data: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost::ShippingRateData)).void
1911
+ }
1912
+ def initialize(shipping_rate: nil, shipping_rate_data: nil); end
1913
+ end
1914
+ class ShippingDetails < Stripe::RequestParams
1915
+ class Address < Stripe::RequestParams
1916
+ # City, district, suburb, town, or village.
1917
+ sig { returns(T.nilable(String)) }
1918
+ attr_accessor :city
1919
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1920
+ sig { returns(T.nilable(String)) }
1921
+ attr_accessor :country
1922
+ # Address line 1 (e.g., street, PO Box, or company name).
1923
+ sig { returns(T.nilable(String)) }
1924
+ attr_accessor :line1
1925
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1926
+ sig { returns(T.nilable(String)) }
1927
+ attr_accessor :line2
1928
+ # ZIP or postal code.
1929
+ sig { returns(T.nilable(String)) }
1930
+ attr_accessor :postal_code
1931
+ # State, county, province, or region.
1932
+ sig { returns(T.nilable(String)) }
1933
+ attr_accessor :state
1934
+ sig {
1935
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
1936
+ }
1937
+ def initialize(
1938
+ city: nil,
1939
+ country: nil,
1940
+ line1: nil,
1941
+ line2: nil,
1942
+ postal_code: nil,
1943
+ state: nil
1944
+ ); end
1945
+ end
1946
+ # Shipping address
1947
+ sig { returns(::Stripe::Invoice::CreateParams::ShippingDetails::Address) }
1948
+ attr_accessor :address
1949
+ # Recipient name.
1950
+ sig { returns(String) }
1951
+ attr_accessor :name
1952
+ # Recipient phone (including extension)
1953
+ sig { returns(T.nilable(T.nilable(String))) }
1954
+ attr_accessor :phone
1955
+ sig {
1956
+ params(address: ::Stripe::Invoice::CreateParams::ShippingDetails::Address, name: String, phone: T.nilable(T.nilable(String))).void
1957
+ }
1958
+ def initialize(address: nil, name: nil, phone: nil); end
1959
+ end
1960
+ class TransferData < Stripe::RequestParams
1961
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
1962
+ sig { returns(T.nilable(Integer)) }
1963
+ attr_accessor :amount
1964
+ # ID of an existing, connected Stripe account.
1965
+ sig { returns(String) }
1966
+ attr_accessor :destination
1967
+ sig { params(amount: T.nilable(Integer), destination: String).void }
1968
+ def initialize(amount: nil, destination: nil); end
1969
+ end
1970
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1971
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1972
+ attr_accessor :account_tax_ids
1973
+ # 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).
1974
+ sig { returns(T.nilable(Integer)) }
1975
+ attr_accessor :application_fee_amount
1976
+ # 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.
1977
+ sig { returns(T.nilable(T::Boolean)) }
1978
+ attr_accessor :auto_advance
1979
+ # Settings for automatic tax lookup for this invoice.
1980
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax)) }
1981
+ attr_accessor :automatic_tax
1982
+ # 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.
1983
+ sig { returns(T.nilable(Integer)) }
1984
+ attr_accessor :automatically_finalizes_at
1985
+ # 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`.
1986
+ sig { returns(T.nilable(String)) }
1987
+ attr_accessor :collection_method
1988
+ # The currency to create this invoice in. Defaults to that of `customer` if not specified.
1989
+ sig { returns(T.nilable(String)) }
1990
+ attr_accessor :currency
1991
+ # A list of up to 4 custom fields to be displayed on the invoice.
1992
+ sig {
1993
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::CustomField]))))
1994
+ }
1995
+ attr_accessor :custom_fields
1996
+ # The ID of the customer who will be billed.
1997
+ sig { returns(T.nilable(String)) }
1998
+ attr_accessor :customer
1999
+ # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
2000
+ sig { returns(T.nilable(Integer)) }
2001
+ attr_accessor :days_until_due
2002
+ # 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.
2003
+ sig { returns(T.nilable(String)) }
2004
+ attr_accessor :default_payment_method
2005
+ # 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.
2006
+ sig { returns(T.nilable(String)) }
2007
+ attr_accessor :default_source
2008
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
2009
+ sig { returns(T.nilable(T::Array[String])) }
2010
+ attr_accessor :default_tax_rates
2011
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
2012
+ sig { returns(T.nilable(String)) }
2013
+ attr_accessor :description
2014
+ # 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.
2015
+ sig {
2016
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::Discount]))))
2017
+ }
2018
+ attr_accessor :discounts
2019
+ # The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`.
2020
+ sig { returns(T.nilable(Integer)) }
2021
+ attr_accessor :due_date
2022
+ # 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.
2023
+ sig { returns(T.nilable(Integer)) }
2024
+ attr_accessor :effective_at
2025
+ # Specifies which fields in the response should be expanded.
2026
+ sig { returns(T.nilable(T::Array[String])) }
2027
+ attr_accessor :expand
2028
+ # Footer to be displayed on the invoice.
2029
+ sig { returns(T.nilable(String)) }
2030
+ attr_accessor :footer
2031
+ # 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.
2032
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::FromInvoice)) }
2033
+ attr_accessor :from_invoice
2034
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2035
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::Issuer)) }
2036
+ attr_accessor :issuer
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
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2039
+ attr_accessor :metadata
2040
+ # 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.
2041
+ sig { returns(T.nilable(String)) }
2042
+ attr_accessor :number
2043
+ # 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.
2044
+ sig { returns(T.nilable(String)) }
2045
+ attr_accessor :on_behalf_of
2046
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
2047
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings)) }
2048
+ attr_accessor :payment_settings
2049
+ # How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted.
2050
+ sig { returns(T.nilable(String)) }
2051
+ attr_accessor :pending_invoice_items_behavior
2052
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
2053
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::Rendering)) }
2054
+ attr_accessor :rendering
2055
+ # Settings for the cost of shipping for this invoice.
2056
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingCost)) }
2057
+ attr_accessor :shipping_cost
2058
+ # 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.
2059
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::ShippingDetails)) }
2060
+ attr_accessor :shipping_details
2061
+ # 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`.
2062
+ sig { returns(T.nilable(String)) }
2063
+ attr_accessor :statement_descriptor
2064
+ # 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.
2065
+ sig { returns(T.nilable(String)) }
2066
+ attr_accessor :subscription
2067
+ # 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.
2068
+ sig { returns(T.nilable(::Stripe::Invoice::CreateParams::TransferData)) }
2069
+ attr_accessor :transfer_data
2070
+ sig {
2071
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), application_fee_amount: T.nilable(Integer), auto_advance: T.nilable(T::Boolean), automatic_tax: T.nilable(::Stripe::Invoice::CreateParams::AutomaticTax), automatically_finalizes_at: T.nilable(Integer), collection_method: T.nilable(String), currency: T.nilable(String), custom_fields: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::CustomField]))), customer: T.nilable(String), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(String), default_tax_rates: T.nilable(T::Array[String]), description: T.nilable(String), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreateParams::Discount]))), due_date: T.nilable(Integer), effective_at: T.nilable(Integer), expand: T.nilable(T::Array[String]), footer: T.nilable(String), from_invoice: T.nilable(::Stripe::Invoice::CreateParams::FromInvoice), issuer: T.nilable(::Stripe::Invoice::CreateParams::Issuer), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), number: T.nilable(String), on_behalf_of: T.nilable(String), payment_settings: T.nilable(::Stripe::Invoice::CreateParams::PaymentSettings), pending_invoice_items_behavior: T.nilable(String), rendering: T.nilable(::Stripe::Invoice::CreateParams::Rendering), shipping_cost: T.nilable(::Stripe::Invoice::CreateParams::ShippingCost), shipping_details: T.nilable(::Stripe::Invoice::CreateParams::ShippingDetails), statement_descriptor: T.nilable(String), subscription: T.nilable(String), transfer_data: T.nilable(::Stripe::Invoice::CreateParams::TransferData)).void
2072
+ }
2073
+ def initialize(
2074
+ account_tax_ids: nil,
2075
+ application_fee_amount: nil,
2076
+ auto_advance: nil,
2077
+ automatic_tax: nil,
2078
+ automatically_finalizes_at: nil,
2079
+ collection_method: nil,
2080
+ currency: nil,
2081
+ custom_fields: nil,
2082
+ customer: nil,
2083
+ days_until_due: nil,
2084
+ default_payment_method: nil,
2085
+ default_source: nil,
2086
+ default_tax_rates: nil,
2087
+ description: nil,
2088
+ discounts: nil,
2089
+ due_date: nil,
2090
+ effective_at: nil,
2091
+ expand: nil,
2092
+ footer: nil,
2093
+ from_invoice: nil,
2094
+ issuer: nil,
2095
+ metadata: nil,
2096
+ number: nil,
2097
+ on_behalf_of: nil,
2098
+ payment_settings: nil,
2099
+ pending_invoice_items_behavior: nil,
2100
+ rendering: nil,
2101
+ shipping_cost: nil,
2102
+ shipping_details: nil,
2103
+ statement_descriptor: nil,
2104
+ subscription: nil,
2105
+ transfer_data: nil
2106
+ ); end
2107
+ end
2108
+ class SearchParams < Stripe::RequestParams
2109
+ # Specifies which fields in the response should be expanded.
2110
+ sig { returns(T.nilable(T::Array[String])) }
2111
+ attr_accessor :expand
2112
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
2113
+ sig { returns(T.nilable(Integer)) }
2114
+ attr_accessor :limit
2115
+ # 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.
2116
+ sig { returns(T.nilable(String)) }
2117
+ attr_accessor :page
2118
+ # 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).
2119
+ sig { returns(String) }
2120
+ attr_accessor :query
2121
+ sig {
2122
+ params(expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), page: T.nilable(String), query: String).void
2123
+ }
2124
+ def initialize(expand: nil, limit: nil, page: nil, query: nil); end
2125
+ end
2126
+ class AddLinesParams < Stripe::RequestParams
2127
+ class Line < Stripe::RequestParams
2128
+ class Discount < Stripe::RequestParams
2129
+ # ID of the coupon to create a new discount for.
2130
+ sig { returns(T.nilable(String)) }
2131
+ attr_accessor :coupon
2132
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2133
+ sig { returns(T.nilable(String)) }
2134
+ attr_accessor :discount
2135
+ # ID of the promotion code to create a new discount for.
2136
+ sig { returns(T.nilable(String)) }
2137
+ attr_accessor :promotion_code
2138
+ sig {
2139
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2140
+ }
2141
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2142
+ end
2143
+ class Period < Stripe::RequestParams
2144
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2145
+ sig { returns(Integer) }
2146
+ attr_accessor :end
2147
+ # The start of the period. This value is inclusive.
2148
+ sig { returns(Integer) }
2149
+ attr_accessor :start
2150
+ sig { params(end_: Integer, start: Integer).void }
2151
+ def initialize(end_: nil, start: nil); end
2152
+ end
2153
+ class PriceData < Stripe::RequestParams
2154
+ class ProductData < Stripe::RequestParams
2155
+ # 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.
2156
+ sig { returns(T.nilable(String)) }
2157
+ attr_accessor :description
2158
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
2159
+ sig { returns(T.nilable(T::Array[String])) }
2160
+ attr_accessor :images
2161
+ # 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`.
2162
+ sig { returns(T.nilable(T::Hash[String, String])) }
2163
+ attr_accessor :metadata
2164
+ # The product's name, meant to be displayable to the customer.
2165
+ sig { returns(String) }
2166
+ attr_accessor :name
2167
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2168
+ sig { returns(T.nilable(String)) }
2169
+ attr_accessor :tax_code
2170
+ sig {
2171
+ params(description: T.nilable(String), images: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), name: String, tax_code: T.nilable(String)).void
2172
+ }
2173
+ def initialize(
2174
+ description: nil,
2175
+ images: nil,
2176
+ metadata: nil,
2177
+ name: nil,
2178
+ tax_code: nil
2179
+ ); end
2180
+ end
2181
+ # 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).
2182
+ sig { returns(String) }
2183
+ attr_accessor :currency
2184
+ # 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.
2185
+ sig { returns(T.nilable(String)) }
2186
+ attr_accessor :product
2187
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
2188
+ sig {
2189
+ returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData::ProductData))
2190
+ }
2191
+ attr_accessor :product_data
2192
+ # 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.
2193
+ sig { returns(T.nilable(String)) }
2194
+ attr_accessor :tax_behavior
2195
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
2196
+ sig { returns(T.nilable(Integer)) }
2197
+ attr_accessor :unit_amount
2198
+ # 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.
2199
+ sig { returns(T.nilable(String)) }
2200
+ attr_accessor :unit_amount_decimal
2201
+ sig {
2202
+ params(currency: String, product: T.nilable(String), product_data: T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData::ProductData), tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2203
+ }
2204
+ def initialize(
2205
+ currency: nil,
2206
+ product: nil,
2207
+ product_data: nil,
2208
+ tax_behavior: nil,
2209
+ unit_amount: nil,
2210
+ unit_amount_decimal: nil
2211
+ ); end
2212
+ end
2213
+ class Pricing < Stripe::RequestParams
2214
+ # The ID of the price object.
2215
+ sig { returns(T.nilable(String)) }
2216
+ attr_accessor :price
2217
+ sig { params(price: T.nilable(String)).void }
2218
+ def initialize(price: nil); end
2219
+ end
2220
+ class TaxAmount < Stripe::RequestParams
2221
+ class TaxRateData < Stripe::RequestParams
2222
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2223
+ sig { returns(T.nilable(String)) }
2224
+ attr_accessor :country
2225
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
2226
+ sig { returns(T.nilable(String)) }
2227
+ attr_accessor :description
2228
+ # The display name of the tax rate, which will be shown to users.
2229
+ sig { returns(String) }
2230
+ attr_accessor :display_name
2231
+ # This specifies if the tax rate is inclusive or exclusive.
2232
+ sig { returns(T::Boolean) }
2233
+ attr_accessor :inclusive
2234
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
2235
+ sig { returns(T.nilable(String)) }
2236
+ attr_accessor :jurisdiction
2237
+ # The level of the jurisdiction that imposes this tax rate.
2238
+ sig { returns(T.nilable(String)) }
2239
+ attr_accessor :jurisdiction_level
2240
+ # 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.
2241
+ sig { returns(Float) }
2242
+ attr_accessor :percentage
2243
+ # [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.
2244
+ sig { returns(T.nilable(String)) }
2245
+ attr_accessor :state
2246
+ # The high-level tax type, such as `vat` or `sales_tax`.
2247
+ sig { returns(T.nilable(String)) }
2248
+ attr_accessor :tax_type
2249
+ sig {
2250
+ params(country: T.nilable(String), description: T.nilable(String), display_name: String, inclusive: T::Boolean, jurisdiction: T.nilable(String), jurisdiction_level: T.nilable(String), percentage: Float, state: T.nilable(String), tax_type: T.nilable(String)).void
2251
+ }
2252
+ def initialize(
2253
+ country: nil,
2254
+ description: nil,
2255
+ display_name: nil,
2256
+ inclusive: nil,
2257
+ jurisdiction: nil,
2258
+ jurisdiction_level: nil,
2259
+ percentage: nil,
2260
+ state: nil,
2261
+ tax_type: nil
2262
+ ); end
2263
+ end
2264
+ # The amount, in cents (or local equivalent), of the tax.
2265
+ sig { returns(Integer) }
2266
+ attr_accessor :amount
2267
+ # Data to find or create a TaxRate object.
2268
+ #
2269
+ # 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.
2270
+ sig { returns(::Stripe::Invoice::AddLinesParams::Line::TaxAmount::TaxRateData) }
2271
+ attr_accessor :tax_rate_data
2272
+ # The reasoning behind this tax, for example, if the product is tax exempt.
2273
+ sig { returns(T.nilable(String)) }
2274
+ attr_accessor :taxability_reason
2275
+ # The amount on which tax is calculated, in cents (or local equivalent).
2276
+ sig { returns(Integer) }
2277
+ attr_accessor :taxable_amount
2278
+ sig {
2279
+ params(amount: Integer, tax_rate_data: ::Stripe::Invoice::AddLinesParams::Line::TaxAmount::TaxRateData, taxability_reason: T.nilable(String), taxable_amount: Integer).void
2280
+ }
2281
+ def initialize(
2282
+ amount: nil,
2283
+ tax_rate_data: nil,
2284
+ taxability_reason: nil,
2285
+ taxable_amount: nil
2286
+ ); end
2287
+ end
2288
+ # 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.
2289
+ sig { returns(T.nilable(Integer)) }
2290
+ attr_accessor :amount
2291
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2292
+ sig { returns(T.nilable(String)) }
2293
+ attr_accessor :description
2294
+ # 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.
2295
+ sig { returns(T.nilable(T::Boolean)) }
2296
+ attr_accessor :discountable
2297
+ # 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.
2298
+ sig {
2299
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::Discount]))))
2300
+ }
2301
+ attr_accessor :discounts
2302
+ # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
2303
+ sig { returns(T.nilable(String)) }
2304
+ attr_accessor :invoice_item
2305
+ # 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`.
2306
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2307
+ attr_accessor :metadata
2308
+ # 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.
2309
+ sig { returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::Period)) }
2310
+ attr_accessor :period
2311
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2312
+ sig { returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData)) }
2313
+ attr_accessor :price_data
2314
+ # The pricing information for the invoice item.
2315
+ sig { returns(T.nilable(::Stripe::Invoice::AddLinesParams::Line::Pricing)) }
2316
+ attr_accessor :pricing
2317
+ # Non-negative integer. The quantity of units for the line item.
2318
+ sig { returns(T.nilable(Integer)) }
2319
+ attr_accessor :quantity
2320
+ # 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.
2321
+ sig {
2322
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::TaxAmount]))))
2323
+ }
2324
+ attr_accessor :tax_amounts
2325
+ # 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.
2326
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2327
+ attr_accessor :tax_rates
2328
+ sig {
2329
+ params(amount: T.nilable(Integer), description: T.nilable(String), discountable: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::Discount]))), invoice_item: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::Invoice::AddLinesParams::Line::Period), price_data: T.nilable(::Stripe::Invoice::AddLinesParams::Line::PriceData), pricing: T.nilable(::Stripe::Invoice::AddLinesParams::Line::Pricing), quantity: T.nilable(Integer), tax_amounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::AddLinesParams::Line::TaxAmount]))), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
2330
+ }
2331
+ def initialize(
2332
+ amount: nil,
2333
+ description: nil,
2334
+ discountable: nil,
2335
+ discounts: nil,
2336
+ invoice_item: nil,
2337
+ metadata: nil,
2338
+ period: nil,
2339
+ price_data: nil,
2340
+ pricing: nil,
2341
+ quantity: nil,
2342
+ tax_amounts: nil,
2343
+ tax_rates: nil
2344
+ ); end
2345
+ end
2346
+ # Specifies which fields in the response should be expanded.
2347
+ sig { returns(T.nilable(T::Array[String])) }
2348
+ attr_accessor :expand
2349
+ # 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`.
2350
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2351
+ attr_accessor :invoice_metadata
2352
+ # The line items to add.
2353
+ sig { returns(T::Array[::Stripe::Invoice::AddLinesParams::Line]) }
2354
+ attr_accessor :lines
2355
+ sig {
2356
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::Invoice::AddLinesParams::Line]).void
2357
+ }
2358
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
2359
+ end
2360
+ class FinalizeInvoiceParams < Stripe::RequestParams
2361
+ # 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.
2362
+ sig { returns(T.nilable(T::Boolean)) }
2363
+ attr_accessor :auto_advance
2364
+ # Specifies which fields in the response should be expanded.
2365
+ sig { returns(T.nilable(T::Array[String])) }
2366
+ attr_accessor :expand
2367
+ sig { params(auto_advance: T.nilable(T::Boolean), expand: T.nilable(T::Array[String])).void }
2368
+ def initialize(auto_advance: nil, expand: nil); end
2369
+ end
2370
+ class MarkUncollectibleParams < Stripe::RequestParams
2371
+ # Specifies which fields in the response should be expanded.
2372
+ sig { returns(T.nilable(T::Array[String])) }
2373
+ attr_accessor :expand
2374
+ sig { params(expand: T.nilable(T::Array[String])).void }
2375
+ def initialize(expand: nil); end
2376
+ end
2377
+ class PayParams < Stripe::RequestParams
2378
+ # Specifies which fields in the response should be expanded.
2379
+ sig { returns(T.nilable(T::Array[String])) }
2380
+ attr_accessor :expand
2381
+ # 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.
2382
+ #
2383
+ # 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`.
2384
+ sig { returns(T.nilable(T::Boolean)) }
2385
+ attr_accessor :forgive
2386
+ # 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.
2387
+ sig { returns(T.nilable(T.nilable(String))) }
2388
+ attr_accessor :mandate
2389
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).
2390
+ sig { returns(T.nilable(T::Boolean)) }
2391
+ attr_accessor :off_session
2392
+ # Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`.
2393
+ sig { returns(T.nilable(T::Boolean)) }
2394
+ attr_accessor :paid_out_of_band
2395
+ # A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.
2396
+ sig { returns(T.nilable(String)) }
2397
+ attr_accessor :payment_method
2398
+ # 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.
2399
+ sig { returns(T.nilable(String)) }
2400
+ attr_accessor :source
2401
+ sig {
2402
+ params(expand: T.nilable(T::Array[String]), forgive: T.nilable(T::Boolean), mandate: T.nilable(T.nilable(String)), off_session: T.nilable(T::Boolean), paid_out_of_band: T.nilable(T::Boolean), payment_method: T.nilable(String), source: T.nilable(String)).void
2403
+ }
2404
+ def initialize(
2405
+ expand: nil,
2406
+ forgive: nil,
2407
+ mandate: nil,
2408
+ off_session: nil,
2409
+ paid_out_of_band: nil,
2410
+ payment_method: nil,
2411
+ source: nil
2412
+ ); end
2413
+ end
2414
+ class RemoveLinesParams < Stripe::RequestParams
2415
+ class Line < Stripe::RequestParams
2416
+ # Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice.
2417
+ sig { returns(String) }
2418
+ attr_accessor :behavior
2419
+ # ID of an existing line item to remove from this invoice.
2420
+ sig { returns(String) }
2421
+ attr_accessor :id
2422
+ sig { params(behavior: String, id: String).void }
2423
+ def initialize(behavior: nil, id: nil); end
2424
+ end
2425
+ # Specifies which fields in the response should be expanded.
2426
+ sig { returns(T.nilable(T::Array[String])) }
2427
+ attr_accessor :expand
2428
+ # 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`.
2429
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2430
+ attr_accessor :invoice_metadata
2431
+ # The line items to remove.
2432
+ sig { returns(T::Array[::Stripe::Invoice::RemoveLinesParams::Line]) }
2433
+ attr_accessor :lines
2434
+ sig {
2435
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::Invoice::RemoveLinesParams::Line]).void
2436
+ }
2437
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
2438
+ end
2439
+ class SendInvoiceParams < Stripe::RequestParams
2440
+ # Specifies which fields in the response should be expanded.
2441
+ sig { returns(T.nilable(T::Array[String])) }
2442
+ attr_accessor :expand
2443
+ sig { params(expand: T.nilable(T::Array[String])).void }
2444
+ def initialize(expand: nil); end
2445
+ end
2446
+ class UpdateLinesParams < Stripe::RequestParams
2447
+ class Line < Stripe::RequestParams
2448
+ class Discount < Stripe::RequestParams
2449
+ # ID of the coupon to create a new discount for.
2450
+ sig { returns(T.nilable(String)) }
2451
+ attr_accessor :coupon
2452
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2453
+ sig { returns(T.nilable(String)) }
2454
+ attr_accessor :discount
2455
+ # ID of the promotion code to create a new discount for.
2456
+ sig { returns(T.nilable(String)) }
2457
+ attr_accessor :promotion_code
2458
+ sig {
2459
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2460
+ }
2461
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2462
+ end
2463
+ class Period < Stripe::RequestParams
2464
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2465
+ sig { returns(Integer) }
2466
+ attr_accessor :end
2467
+ # The start of the period. This value is inclusive.
2468
+ sig { returns(Integer) }
2469
+ attr_accessor :start
2470
+ sig { params(end_: Integer, start: Integer).void }
2471
+ def initialize(end_: nil, start: nil); end
2472
+ end
2473
+ class PriceData < Stripe::RequestParams
2474
+ class ProductData < Stripe::RequestParams
2475
+ # 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.
2476
+ sig { returns(T.nilable(String)) }
2477
+ attr_accessor :description
2478
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
2479
+ sig { returns(T.nilable(T::Array[String])) }
2480
+ attr_accessor :images
2481
+ # 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`.
2482
+ sig { returns(T.nilable(T::Hash[String, String])) }
2483
+ attr_accessor :metadata
2484
+ # The product's name, meant to be displayable to the customer.
2485
+ sig { returns(String) }
2486
+ attr_accessor :name
2487
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2488
+ sig { returns(T.nilable(String)) }
2489
+ attr_accessor :tax_code
2490
+ sig {
2491
+ params(description: T.nilable(String), images: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), name: String, tax_code: T.nilable(String)).void
2492
+ }
2493
+ def initialize(
2494
+ description: nil,
2495
+ images: nil,
2496
+ metadata: nil,
2497
+ name: nil,
2498
+ tax_code: nil
2499
+ ); end
2500
+ end
2501
+ # 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).
2502
+ sig { returns(String) }
2503
+ attr_accessor :currency
2504
+ # 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.
2505
+ sig { returns(T.nilable(String)) }
2506
+ attr_accessor :product
2507
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
2508
+ sig {
2509
+ returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData::ProductData))
2510
+ }
2511
+ attr_accessor :product_data
2512
+ # 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.
2513
+ sig { returns(T.nilable(String)) }
2514
+ attr_accessor :tax_behavior
2515
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
2516
+ sig { returns(T.nilable(Integer)) }
2517
+ attr_accessor :unit_amount
2518
+ # 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.
2519
+ sig { returns(T.nilable(String)) }
2520
+ attr_accessor :unit_amount_decimal
2521
+ sig {
2522
+ params(currency: String, product: T.nilable(String), product_data: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData::ProductData), tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2523
+ }
2524
+ def initialize(
2525
+ currency: nil,
2526
+ product: nil,
2527
+ product_data: nil,
2528
+ tax_behavior: nil,
2529
+ unit_amount: nil,
2530
+ unit_amount_decimal: nil
2531
+ ); end
2532
+ end
2533
+ class Pricing < Stripe::RequestParams
2534
+ # The ID of the price object.
2535
+ sig { returns(T.nilable(String)) }
2536
+ attr_accessor :price
2537
+ sig { params(price: T.nilable(String)).void }
2538
+ def initialize(price: nil); end
2539
+ end
2540
+ class TaxAmount < Stripe::RequestParams
2541
+ class TaxRateData < Stripe::RequestParams
2542
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2543
+ sig { returns(T.nilable(String)) }
2544
+ attr_accessor :country
2545
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
2546
+ sig { returns(T.nilable(String)) }
2547
+ attr_accessor :description
2548
+ # The display name of the tax rate, which will be shown to users.
2549
+ sig { returns(String) }
2550
+ attr_accessor :display_name
2551
+ # This specifies if the tax rate is inclusive or exclusive.
2552
+ sig { returns(T::Boolean) }
2553
+ attr_accessor :inclusive
2554
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
2555
+ sig { returns(T.nilable(String)) }
2556
+ attr_accessor :jurisdiction
2557
+ # The level of the jurisdiction that imposes this tax rate.
2558
+ sig { returns(T.nilable(String)) }
2559
+ attr_accessor :jurisdiction_level
2560
+ # 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.
2561
+ sig { returns(Float) }
2562
+ attr_accessor :percentage
2563
+ # [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.
2564
+ sig { returns(T.nilable(String)) }
2565
+ attr_accessor :state
2566
+ # The high-level tax type, such as `vat` or `sales_tax`.
2567
+ sig { returns(T.nilable(String)) }
2568
+ attr_accessor :tax_type
2569
+ sig {
2570
+ params(country: T.nilable(String), description: T.nilable(String), display_name: String, inclusive: T::Boolean, jurisdiction: T.nilable(String), jurisdiction_level: T.nilable(String), percentage: Float, state: T.nilable(String), tax_type: T.nilable(String)).void
2571
+ }
2572
+ def initialize(
2573
+ country: nil,
2574
+ description: nil,
2575
+ display_name: nil,
2576
+ inclusive: nil,
2577
+ jurisdiction: nil,
2578
+ jurisdiction_level: nil,
2579
+ percentage: nil,
2580
+ state: nil,
2581
+ tax_type: nil
2582
+ ); end
2583
+ end
2584
+ # The amount, in cents (or local equivalent), of the tax.
2585
+ sig { returns(Integer) }
2586
+ attr_accessor :amount
2587
+ # Data to find or create a TaxRate object.
2588
+ #
2589
+ # 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.
2590
+ sig { returns(::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount::TaxRateData) }
2591
+ attr_accessor :tax_rate_data
2592
+ # The reasoning behind this tax, for example, if the product is tax exempt.
2593
+ sig { returns(T.nilable(String)) }
2594
+ attr_accessor :taxability_reason
2595
+ # The amount on which tax is calculated, in cents (or local equivalent).
2596
+ sig { returns(Integer) }
2597
+ attr_accessor :taxable_amount
2598
+ sig {
2599
+ params(amount: Integer, tax_rate_data: ::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount::TaxRateData, taxability_reason: T.nilable(String), taxable_amount: Integer).void
2600
+ }
2601
+ def initialize(
2602
+ amount: nil,
2603
+ tax_rate_data: nil,
2604
+ taxability_reason: nil,
2605
+ taxable_amount: nil
2606
+ ); end
2607
+ end
2608
+ # 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.
2609
+ sig { returns(T.nilable(Integer)) }
2610
+ attr_accessor :amount
2611
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2612
+ sig { returns(T.nilable(String)) }
2613
+ attr_accessor :description
2614
+ # 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.
2615
+ sig { returns(T.nilable(T::Boolean)) }
2616
+ attr_accessor :discountable
2617
+ # 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.
2618
+ sig {
2619
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::Discount]))))
2620
+ }
2621
+ attr_accessor :discounts
2622
+ # ID of an existing line item on the invoice.
2623
+ sig { returns(String) }
2624
+ attr_accessor :id
2625
+ # 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.
2626
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2627
+ attr_accessor :metadata
2628
+ # 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.
2629
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Period)) }
2630
+ attr_accessor :period
2631
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2632
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData)) }
2633
+ attr_accessor :price_data
2634
+ # The pricing information for the invoice item.
2635
+ sig { returns(T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Pricing)) }
2636
+ attr_accessor :pricing
2637
+ # Non-negative integer. The quantity of units for the line item.
2638
+ sig { returns(T.nilable(Integer)) }
2639
+ attr_accessor :quantity
2640
+ # 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.
2641
+ sig {
2642
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount]))))
2643
+ }
2644
+ attr_accessor :tax_amounts
2645
+ # 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.
2646
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2647
+ attr_accessor :tax_rates
2648
+ sig {
2649
+ params(amount: T.nilable(Integer), description: T.nilable(String), discountable: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::Discount]))), id: String, metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Period), price_data: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::PriceData), pricing: T.nilable(::Stripe::Invoice::UpdateLinesParams::Line::Pricing), quantity: T.nilable(Integer), tax_amounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::UpdateLinesParams::Line::TaxAmount]))), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
2650
+ }
2651
+ def initialize(
2652
+ amount: nil,
2653
+ description: nil,
2654
+ discountable: nil,
2655
+ discounts: nil,
2656
+ id: nil,
2657
+ metadata: nil,
2658
+ period: nil,
2659
+ price_data: nil,
2660
+ pricing: nil,
2661
+ quantity: nil,
2662
+ tax_amounts: nil,
2663
+ tax_rates: nil
2664
+ ); end
2665
+ end
2666
+ # Specifies which fields in the response should be expanded.
2667
+ sig { returns(T.nilable(T::Array[String])) }
2668
+ attr_accessor :expand
2669
+ # 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.
2670
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2671
+ attr_accessor :invoice_metadata
2672
+ # The line items to update.
2673
+ sig { returns(T::Array[::Stripe::Invoice::UpdateLinesParams::Line]) }
2674
+ attr_accessor :lines
2675
+ sig {
2676
+ params(expand: T.nilable(T::Array[String]), invoice_metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), lines: T::Array[::Stripe::Invoice::UpdateLinesParams::Line]).void
2677
+ }
2678
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil); end
2679
+ end
2680
+ class VoidInvoiceParams < Stripe::RequestParams
2681
+ # Specifies which fields in the response should be expanded.
2682
+ sig { returns(T.nilable(T::Array[String])) }
2683
+ attr_accessor :expand
2684
+ sig { params(expand: T.nilable(T::Array[String])).void }
2685
+ def initialize(expand: nil); end
2686
+ end
2687
+ class CreatePreviewParams < Stripe::RequestParams
2688
+ class AutomaticTax < Stripe::RequestParams
2689
+ class Liability < Stripe::RequestParams
2690
+ # The connected account being referenced when `type` is `account`.
2691
+ sig { returns(T.nilable(String)) }
2692
+ attr_accessor :account
2693
+ # Type of the account referenced in the request.
2694
+ sig { returns(String) }
2695
+ attr_accessor :type
2696
+ sig { params(account: T.nilable(String), type: String).void }
2697
+ def initialize(account: nil, type: nil); end
2698
+ end
2699
+ # 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.
2700
+ sig { returns(T::Boolean) }
2701
+ attr_accessor :enabled
2702
+ # 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.
2703
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax::Liability)) }
2704
+ attr_accessor :liability
2705
+ sig {
2706
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax::Liability)).void
2707
+ }
2708
+ def initialize(enabled: nil, liability: nil); end
2709
+ end
2710
+ class CustomerDetails < Stripe::RequestParams
2711
+ class Address < Stripe::RequestParams
2712
+ # City, district, suburb, town, or village.
2713
+ sig { returns(T.nilable(String)) }
2714
+ attr_accessor :city
2715
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2716
+ sig { returns(T.nilable(String)) }
2717
+ attr_accessor :country
2718
+ # Address line 1 (e.g., street, PO Box, or company name).
2719
+ sig { returns(T.nilable(String)) }
2720
+ attr_accessor :line1
2721
+ # Address line 2 (e.g., apartment, suite, unit, or building).
2722
+ sig { returns(T.nilable(String)) }
2723
+ attr_accessor :line2
2724
+ # ZIP or postal code.
2725
+ sig { returns(T.nilable(String)) }
2726
+ attr_accessor :postal_code
2727
+ # State, county, province, or region.
2728
+ sig { returns(T.nilable(String)) }
2729
+ attr_accessor :state
2730
+ sig {
2731
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
2732
+ }
2733
+ def initialize(
2734
+ city: nil,
2735
+ country: nil,
2736
+ line1: nil,
2737
+ line2: nil,
2738
+ postal_code: nil,
2739
+ state: nil
2740
+ ); end
2741
+ end
2742
+ class Shipping < Stripe::RequestParams
2743
+ class Address < Stripe::RequestParams
2744
+ # City, district, suburb, town, or village.
2745
+ sig { returns(T.nilable(String)) }
2746
+ attr_accessor :city
2747
+ # 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)).
2748
+ sig { returns(T.nilable(String)) }
2749
+ attr_accessor :country
2750
+ # Address line 1 (e.g., street, PO Box, or company name).
2751
+ sig { returns(T.nilable(String)) }
2752
+ attr_accessor :line1
2753
+ # Address line 2 (e.g., apartment, suite, unit, or building).
2754
+ sig { returns(T.nilable(String)) }
2755
+ attr_accessor :line2
2756
+ # ZIP or postal code.
2757
+ sig { returns(T.nilable(String)) }
2758
+ attr_accessor :postal_code
2759
+ # State, county, province, or region.
2760
+ sig { returns(T.nilable(String)) }
2761
+ attr_accessor :state
2762
+ sig {
2763
+ params(city: T.nilable(String), country: T.nilable(String), line1: T.nilable(String), line2: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void
2764
+ }
2765
+ def initialize(
2766
+ city: nil,
2767
+ country: nil,
2768
+ line1: nil,
2769
+ line2: nil,
2770
+ postal_code: nil,
2771
+ state: nil
2772
+ ); end
2773
+ end
2774
+ # Customer shipping address.
2775
+ sig {
2776
+ returns(::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping::Address)
2777
+ }
2778
+ attr_accessor :address
2779
+ # Customer name.
2780
+ sig { returns(String) }
2781
+ attr_accessor :name
2782
+ # Customer phone (including extension).
2783
+ sig { returns(T.nilable(String)) }
2784
+ attr_accessor :phone
2785
+ sig {
2786
+ params(address: ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping::Address, name: String, phone: T.nilable(String)).void
2787
+ }
2788
+ def initialize(address: nil, name: nil, phone: nil); end
2789
+ end
2790
+ class Tax < Stripe::RequestParams
2791
+ # 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.
2792
+ sig { returns(T.nilable(T.nilable(String))) }
2793
+ attr_accessor :ip_address
2794
+ sig { params(ip_address: T.nilable(T.nilable(String))).void }
2795
+ def initialize(ip_address: nil); end
2796
+ end
2797
+ class TaxId < Stripe::RequestParams
2798
+ # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `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`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `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`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `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`
2799
+ sig { returns(String) }
2800
+ attr_accessor :type
2801
+ # Value of the tax ID.
2802
+ sig { returns(String) }
2803
+ attr_accessor :value
2804
+ sig { params(type: String, value: String).void }
2805
+ def initialize(type: nil, value: nil); end
2806
+ end
2807
+ # The customer's address.
2808
+ sig {
2809
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Address))))
2810
+ }
2811
+ attr_accessor :address
2812
+ # The customer's shipping information. Appears on invoices emailed to this customer.
2813
+ sig {
2814
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping))))
2815
+ }
2816
+ attr_accessor :shipping
2817
+ # Tax details about the customer.
2818
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Tax)) }
2819
+ attr_accessor :tax
2820
+ # The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
2821
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
2822
+ attr_accessor :tax_exempt
2823
+ # The customer's tax IDs.
2824
+ sig {
2825
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::CustomerDetails::TaxId]))
2826
+ }
2827
+ attr_accessor :tax_ids
2828
+ sig {
2829
+ params(address: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Address))), shipping: T.nilable(T.nilable(T.any(String, ::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Shipping))), tax: T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails::Tax), tax_exempt: T.nilable(T.nilable(T.any(String, String))), tax_ids: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::CustomerDetails::TaxId])).void
2830
+ }
2831
+ def initialize(address: nil, shipping: nil, tax: nil, tax_exempt: nil, tax_ids: nil); end
2832
+ end
2833
+ class Discount < Stripe::RequestParams
2834
+ # ID of the coupon to create a new discount for.
2835
+ sig { returns(T.nilable(String)) }
2836
+ attr_accessor :coupon
2837
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2838
+ sig { returns(T.nilable(String)) }
2839
+ attr_accessor :discount
2840
+ # ID of the promotion code to create a new discount for.
2841
+ sig { returns(T.nilable(String)) }
2842
+ attr_accessor :promotion_code
2843
+ sig {
2844
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2845
+ }
2846
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2847
+ end
2848
+ class InvoiceItem < Stripe::RequestParams
2849
+ class Discount < Stripe::RequestParams
2850
+ # ID of the coupon to create a new discount for.
2851
+ sig { returns(T.nilable(String)) }
2852
+ attr_accessor :coupon
2853
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2854
+ sig { returns(T.nilable(String)) }
2855
+ attr_accessor :discount
2856
+ # ID of the promotion code to create a new discount for.
2857
+ sig { returns(T.nilable(String)) }
2858
+ attr_accessor :promotion_code
2859
+ sig {
2860
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2861
+ }
2862
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
2863
+ end
2864
+ class Period < Stripe::RequestParams
2865
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2866
+ sig { returns(Integer) }
2867
+ attr_accessor :end
2868
+ # The start of the period. This value is inclusive.
2869
+ sig { returns(Integer) }
2870
+ attr_accessor :start
2871
+ sig { params(end_: Integer, start: Integer).void }
2872
+ def initialize(end_: nil, start: nil); end
2873
+ end
2874
+ class PriceData < Stripe::RequestParams
2875
+ # 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).
2876
+ sig { returns(String) }
2877
+ attr_accessor :currency
2878
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2879
+ sig { returns(String) }
2880
+ attr_accessor :product
2881
+ # 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.
2882
+ sig { returns(T.nilable(String)) }
2883
+ attr_accessor :tax_behavior
2884
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2885
+ sig { returns(T.nilable(Integer)) }
2886
+ attr_accessor :unit_amount
2887
+ # 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.
2888
+ sig { returns(T.nilable(String)) }
2889
+ attr_accessor :unit_amount_decimal
2890
+ sig {
2891
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2892
+ }
2893
+ def initialize(
2894
+ currency: nil,
2895
+ product: nil,
2896
+ tax_behavior: nil,
2897
+ unit_amount: nil,
2898
+ unit_amount_decimal: nil
2899
+ ); end
2900
+ end
2901
+ # The integer amount in cents (or local equivalent) of previewed invoice item.
2902
+ sig { returns(T.nilable(Integer)) }
2903
+ attr_accessor :amount
2904
+ # 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.
2905
+ sig { returns(T.nilable(String)) }
2906
+ attr_accessor :currency
2907
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2908
+ sig { returns(T.nilable(String)) }
2909
+ attr_accessor :description
2910
+ # Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
2911
+ sig { returns(T.nilable(T::Boolean)) }
2912
+ attr_accessor :discountable
2913
+ # The coupons to redeem into discounts for the invoice item in the preview.
2914
+ sig {
2915
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Discount]))))
2916
+ }
2917
+ attr_accessor :discounts
2918
+ # 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.
2919
+ sig { returns(T.nilable(String)) }
2920
+ attr_accessor :invoiceitem
2921
+ # 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`.
2922
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
2923
+ attr_accessor :metadata
2924
+ # 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.
2925
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Period)) }
2926
+ attr_accessor :period
2927
+ # The ID of the price object. One of `price` or `price_data` is required.
2928
+ sig { returns(T.nilable(String)) }
2929
+ attr_accessor :price
2930
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2931
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::PriceData)) }
2932
+ attr_accessor :price_data
2933
+ # Non-negative integer. The quantity of units for the invoice item.
2934
+ sig { returns(T.nilable(Integer)) }
2935
+ attr_accessor :quantity
2936
+ # 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.
2937
+ sig { returns(T.nilable(String)) }
2938
+ attr_accessor :tax_behavior
2939
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2940
+ sig { returns(T.nilable(T.nilable(String))) }
2941
+ attr_accessor :tax_code
2942
+ # The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
2943
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
2944
+ attr_accessor :tax_rates
2945
+ # 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.
2946
+ sig { returns(T.nilable(Integer)) }
2947
+ attr_accessor :unit_amount
2948
+ # 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.
2949
+ sig { returns(T.nilable(String)) }
2950
+ attr_accessor :unit_amount_decimal
2951
+ sig {
2952
+ params(amount: T.nilable(Integer), currency: T.nilable(String), description: T.nilable(String), discountable: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Discount]))), invoiceitem: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), period: T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::Period), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::InvoiceItem::PriceData), quantity: T.nilable(Integer), tax_behavior: T.nilable(String), tax_code: T.nilable(T.nilable(String)), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
2953
+ }
2954
+ def initialize(
2955
+ amount: nil,
2956
+ currency: nil,
2957
+ description: nil,
2958
+ discountable: nil,
2959
+ discounts: nil,
2960
+ invoiceitem: nil,
2961
+ metadata: nil,
2962
+ period: nil,
2963
+ price: nil,
2964
+ price_data: nil,
2965
+ quantity: nil,
2966
+ tax_behavior: nil,
2967
+ tax_code: nil,
2968
+ tax_rates: nil,
2969
+ unit_amount: nil,
2970
+ unit_amount_decimal: nil
2971
+ ); end
2972
+ end
2973
+ class Issuer < Stripe::RequestParams
2974
+ # The connected account being referenced when `type` is `account`.
2975
+ sig { returns(T.nilable(String)) }
2976
+ attr_accessor :account
2977
+ # Type of the account referenced in the request.
2978
+ sig { returns(String) }
2979
+ attr_accessor :type
2980
+ sig { params(account: T.nilable(String), type: String).void }
2981
+ def initialize(account: nil, type: nil); end
2982
+ end
2983
+ class ScheduleDetails < Stripe::RequestParams
2984
+ class Phase < Stripe::RequestParams
2985
+ class AddInvoiceItem < Stripe::RequestParams
2986
+ class Discount < Stripe::RequestParams
2987
+ # ID of the coupon to create a new discount for.
2988
+ sig { returns(T.nilable(String)) }
2989
+ attr_accessor :coupon
2990
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2991
+ sig { returns(T.nilable(String)) }
2992
+ attr_accessor :discount
2993
+ # ID of the promotion code to create a new discount for.
2994
+ sig { returns(T.nilable(String)) }
2995
+ attr_accessor :promotion_code
2996
+ sig {
2997
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
2998
+ }
2999
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3000
+ end
3001
+ class PriceData < Stripe::RequestParams
3002
+ # 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).
3003
+ sig { returns(String) }
3004
+ attr_accessor :currency
3005
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
3006
+ sig { returns(String) }
3007
+ attr_accessor :product
3008
+ # 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.
3009
+ sig { returns(T.nilable(String)) }
3010
+ attr_accessor :tax_behavior
3011
+ # 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.
3012
+ sig { returns(T.nilable(Integer)) }
3013
+ attr_accessor :unit_amount
3014
+ # 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.
3015
+ sig { returns(T.nilable(String)) }
3016
+ attr_accessor :unit_amount_decimal
3017
+ sig {
3018
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
3019
+ }
3020
+ def initialize(
3021
+ currency: nil,
3022
+ product: nil,
3023
+ tax_behavior: nil,
3024
+ unit_amount: nil,
3025
+ unit_amount_decimal: nil
3026
+ ); end
3027
+ end
3028
+ # The coupons to redeem into discounts for the item.
3029
+ sig {
3030
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::Discount]))
3031
+ }
3032
+ attr_accessor :discounts
3033
+ # The ID of the price object. One of `price` or `price_data` is required.
3034
+ sig { returns(T.nilable(String)) }
3035
+ attr_accessor :price
3036
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
3037
+ sig {
3038
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::PriceData))
3039
+ }
3040
+ attr_accessor :price_data
3041
+ # Quantity for this item. Defaults to 1.
3042
+ sig { returns(T.nilable(Integer)) }
3043
+ attr_accessor :quantity
3044
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
3045
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3046
+ attr_accessor :tax_rates
3047
+ sig {
3048
+ params(discounts: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
3049
+ }
3050
+ def initialize(
3051
+ discounts: nil,
3052
+ price: nil,
3053
+ price_data: nil,
3054
+ quantity: nil,
3055
+ tax_rates: nil
3056
+ ); end
3057
+ end
3058
+ class AutomaticTax < Stripe::RequestParams
3059
+ class Liability < Stripe::RequestParams
3060
+ # The connected account being referenced when `type` is `account`.
3061
+ sig { returns(T.nilable(String)) }
3062
+ attr_accessor :account
3063
+ # Type of the account referenced in the request.
3064
+ sig { returns(String) }
3065
+ attr_accessor :type
3066
+ sig { params(account: T.nilable(String), type: String).void }
3067
+ def initialize(account: nil, type: nil); end
3068
+ end
3069
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
3070
+ sig { returns(T::Boolean) }
3071
+ attr_accessor :enabled
3072
+ # 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.
3073
+ sig {
3074
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax::Liability))
3075
+ }
3076
+ attr_accessor :liability
3077
+ sig {
3078
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax::Liability)).void
3079
+ }
3080
+ def initialize(enabled: nil, liability: nil); end
3081
+ end
3082
+ class Discount < Stripe::RequestParams
3083
+ # ID of the coupon to create a new discount for.
3084
+ sig { returns(T.nilable(String)) }
3085
+ attr_accessor :coupon
3086
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3087
+ sig { returns(T.nilable(String)) }
3088
+ attr_accessor :discount
3089
+ # ID of the promotion code to create a new discount for.
3090
+ sig { returns(T.nilable(String)) }
3091
+ attr_accessor :promotion_code
3092
+ sig {
3093
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
3094
+ }
3095
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3096
+ end
3097
+ class InvoiceSettings < Stripe::RequestParams
3098
+ class Issuer < Stripe::RequestParams
3099
+ # The connected account being referenced when `type` is `account`.
3100
+ sig { returns(T.nilable(String)) }
3101
+ attr_accessor :account
3102
+ # Type of the account referenced in the request.
3103
+ sig { returns(String) }
3104
+ attr_accessor :type
3105
+ sig { params(account: T.nilable(String), type: String).void }
3106
+ def initialize(account: nil, type: nil); end
3107
+ end
3108
+ # 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.
3109
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3110
+ attr_accessor :account_tax_ids
3111
+ # 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`.
3112
+ sig { returns(T.nilable(Integer)) }
3113
+ attr_accessor :days_until_due
3114
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
3115
+ sig {
3116
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings::Issuer))
3117
+ }
3118
+ attr_accessor :issuer
3119
+ sig {
3120
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), days_until_due: T.nilable(Integer), issuer: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings::Issuer)).void
3121
+ }
3122
+ def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
3123
+ end
3124
+ class Item < Stripe::RequestParams
3125
+ class Discount < Stripe::RequestParams
3126
+ # ID of the coupon to create a new discount for.
3127
+ sig { returns(T.nilable(String)) }
3128
+ attr_accessor :coupon
3129
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3130
+ sig { returns(T.nilable(String)) }
3131
+ attr_accessor :discount
3132
+ # ID of the promotion code to create a new discount for.
3133
+ sig { returns(T.nilable(String)) }
3134
+ attr_accessor :promotion_code
3135
+ sig {
3136
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
3137
+ }
3138
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3139
+ end
3140
+ class PriceData < Stripe::RequestParams
3141
+ class Recurring < Stripe::RequestParams
3142
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
3143
+ sig { returns(String) }
3144
+ attr_accessor :interval
3145
+ # 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).
3146
+ sig { returns(T.nilable(Integer)) }
3147
+ attr_accessor :interval_count
3148
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
3149
+ def initialize(interval: nil, interval_count: nil); end
3150
+ end
3151
+ # 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).
3152
+ sig { returns(String) }
3153
+ attr_accessor :currency
3154
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
3155
+ sig { returns(String) }
3156
+ attr_accessor :product
3157
+ # The recurring components of a price such as `interval` and `interval_count`.
3158
+ sig {
3159
+ returns(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData::Recurring)
3160
+ }
3161
+ attr_accessor :recurring
3162
+ # 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.
3163
+ sig { returns(T.nilable(String)) }
3164
+ attr_accessor :tax_behavior
3165
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
3166
+ sig { returns(T.nilable(Integer)) }
3167
+ attr_accessor :unit_amount
3168
+ # 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.
3169
+ sig { returns(T.nilable(String)) }
3170
+ attr_accessor :unit_amount_decimal
3171
+ sig {
3172
+ params(currency: String, product: String, recurring: ::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
3173
+ }
3174
+ def initialize(
3175
+ currency: nil,
3176
+ product: nil,
3177
+ recurring: nil,
3178
+ tax_behavior: nil,
3179
+ unit_amount: nil,
3180
+ unit_amount_decimal: nil
3181
+ ); end
3182
+ end
3183
+ # The coupons to redeem into discounts for the subscription item.
3184
+ sig {
3185
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::Discount]))))
3186
+ }
3187
+ attr_accessor :discounts
3188
+ # 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`.
3189
+ sig { returns(T.nilable(T::Hash[String, String])) }
3190
+ attr_accessor :metadata
3191
+ # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
3192
+ sig { returns(T.nilable(String)) }
3193
+ attr_accessor :plan
3194
+ # The ID of the price object.
3195
+ sig { returns(T.nilable(String)) }
3196
+ attr_accessor :price
3197
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
3198
+ sig {
3199
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData))
3200
+ }
3201
+ attr_accessor :price_data
3202
+ # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
3203
+ sig { returns(T.nilable(Integer)) }
3204
+ attr_accessor :quantity
3205
+ # 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.
3206
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3207
+ attr_accessor :tax_rates
3208
+ sig {
3209
+ params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
3210
+ }
3211
+ def initialize(
3212
+ discounts: nil,
3213
+ metadata: nil,
3214
+ plan: nil,
3215
+ price: nil,
3216
+ price_data: nil,
3217
+ quantity: nil,
3218
+ tax_rates: nil
3219
+ ); end
3220
+ end
3221
+ class TransferData < Stripe::RequestParams
3222
+ # 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.
3223
+ sig { returns(T.nilable(Float)) }
3224
+ attr_accessor :amount_percent
3225
+ # ID of an existing, connected Stripe account.
3226
+ sig { returns(String) }
3227
+ attr_accessor :destination
3228
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
3229
+ def initialize(amount_percent: nil, destination: nil); end
3230
+ end
3231
+ # 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.
3232
+ sig {
3233
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem]))
3234
+ }
3235
+ attr_accessor :add_invoice_items
3236
+ # 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).
3237
+ sig { returns(T.nilable(Float)) }
3238
+ attr_accessor :application_fee_percent
3239
+ # Automatic tax settings for this phase.
3240
+ sig {
3241
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax))
3242
+ }
3243
+ attr_accessor :automatic_tax
3244
+ # 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).
3245
+ sig { returns(T.nilable(String)) }
3246
+ attr_accessor :billing_cycle_anchor
3247
+ # 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.
3248
+ sig { returns(T.nilable(String)) }
3249
+ attr_accessor :collection_method
3250
+ # 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).
3251
+ sig { returns(T.nilable(String)) }
3252
+ attr_accessor :currency
3253
+ # 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.
3254
+ sig { returns(T.nilable(String)) }
3255
+ attr_accessor :default_payment_method
3256
+ # 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.
3257
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3258
+ attr_accessor :default_tax_rates
3259
+ # 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.
3260
+ sig { returns(T.nilable(T.nilable(String))) }
3261
+ attr_accessor :description
3262
+ # 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.
3263
+ sig {
3264
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Discount]))))
3265
+ }
3266
+ attr_accessor :discounts
3267
+ # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
3268
+ sig { returns(T.nilable(T.any(Integer, String))) }
3269
+ attr_accessor :end_date
3270
+ # All invoices will be billed using the specified settings.
3271
+ sig {
3272
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings))
3273
+ }
3274
+ attr_accessor :invoice_settings
3275
+ # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
3276
+ sig {
3277
+ returns(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item])
3278
+ }
3279
+ attr_accessor :items
3280
+ # 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.
3281
+ sig { returns(T.nilable(Integer)) }
3282
+ attr_accessor :iterations
3283
+ # 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`.
3284
+ sig { returns(T.nilable(T::Hash[String, String])) }
3285
+ attr_accessor :metadata
3286
+ # The account on behalf of which to charge, for each of the associated subscription's invoices.
3287
+ sig { returns(T.nilable(String)) }
3288
+ attr_accessor :on_behalf_of
3289
+ # 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.
3290
+ sig { returns(T.nilable(String)) }
3291
+ attr_accessor :proration_behavior
3292
+ # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
3293
+ sig { returns(T.nilable(T.any(Integer, String))) }
3294
+ attr_accessor :start_date
3295
+ # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
3296
+ sig {
3297
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::TransferData))
3298
+ }
3299
+ attr_accessor :transfer_data
3300
+ # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
3301
+ sig { returns(T.nilable(T::Boolean)) }
3302
+ attr_accessor :trial
3303
+ # 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`
3304
+ sig { returns(T.nilable(T.any(Integer, String))) }
3305
+ attr_accessor :trial_end
3306
+ sig {
3307
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Discount]))), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::InvoiceSettings), items: T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), start_date: T.nilable(T.any(Integer, String)), transfer_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
3308
+ }
3309
+ def initialize(
3310
+ add_invoice_items: nil,
3311
+ application_fee_percent: nil,
3312
+ automatic_tax: nil,
3313
+ billing_cycle_anchor: nil,
3314
+ collection_method: nil,
3315
+ currency: nil,
3316
+ default_payment_method: nil,
3317
+ default_tax_rates: nil,
3318
+ description: nil,
3319
+ discounts: nil,
3320
+ end_date: nil,
3321
+ invoice_settings: nil,
3322
+ items: nil,
3323
+ iterations: nil,
3324
+ metadata: nil,
3325
+ on_behalf_of: nil,
3326
+ proration_behavior: nil,
3327
+ start_date: nil,
3328
+ transfer_data: nil,
3329
+ trial: nil,
3330
+ trial_end: nil
3331
+ ); end
3332
+ end
3333
+ # 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.
3334
+ sig { returns(T.nilable(String)) }
3335
+ attr_accessor :end_behavior
3336
+ # 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.
3337
+ sig {
3338
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase]))
3339
+ }
3340
+ attr_accessor :phases
3341
+ # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
3342
+ sig { returns(T.nilable(String)) }
3343
+ attr_accessor :proration_behavior
3344
+ sig {
3345
+ params(end_behavior: T.nilable(String), phases: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase]), proration_behavior: T.nilable(String)).void
3346
+ }
3347
+ def initialize(end_behavior: nil, phases: nil, proration_behavior: nil); end
3348
+ end
3349
+ class SubscriptionDetails < Stripe::RequestParams
3350
+ class Item < Stripe::RequestParams
3351
+ class Discount < Stripe::RequestParams
3352
+ # ID of the coupon to create a new discount for.
3353
+ sig { returns(T.nilable(String)) }
3354
+ attr_accessor :coupon
3355
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3356
+ sig { returns(T.nilable(String)) }
3357
+ attr_accessor :discount
3358
+ # ID of the promotion code to create a new discount for.
3359
+ sig { returns(T.nilable(String)) }
3360
+ attr_accessor :promotion_code
3361
+ sig {
3362
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
3363
+ }
3364
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
3365
+ end
3366
+ class PriceData < Stripe::RequestParams
3367
+ class Recurring < Stripe::RequestParams
3368
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
3369
+ sig { returns(String) }
3370
+ attr_accessor :interval
3371
+ # 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).
3372
+ sig { returns(T.nilable(Integer)) }
3373
+ attr_accessor :interval_count
3374
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
3375
+ def initialize(interval: nil, interval_count: nil); end
3376
+ end
3377
+ # 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).
3378
+ sig { returns(String) }
3379
+ attr_accessor :currency
3380
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
3381
+ sig { returns(String) }
3382
+ attr_accessor :product
3383
+ # The recurring components of a price such as `interval` and `interval_count`.
3384
+ sig {
3385
+ returns(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData::Recurring)
3386
+ }
3387
+ attr_accessor :recurring
3388
+ # 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.
3389
+ sig { returns(T.nilable(String)) }
3390
+ attr_accessor :tax_behavior
3391
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
3392
+ sig { returns(T.nilable(Integer)) }
3393
+ attr_accessor :unit_amount
3394
+ # 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.
3395
+ sig { returns(T.nilable(String)) }
3396
+ attr_accessor :unit_amount_decimal
3397
+ sig {
3398
+ params(currency: String, product: String, recurring: ::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
3399
+ }
3400
+ def initialize(
3401
+ currency: nil,
3402
+ product: nil,
3403
+ recurring: nil,
3404
+ tax_behavior: nil,
3405
+ unit_amount: nil,
3406
+ unit_amount_decimal: nil
3407
+ ); end
3408
+ end
3409
+ # 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.
3410
+ sig { returns(T.nilable(T::Boolean)) }
3411
+ attr_accessor :clear_usage
3412
+ # A flag that, if set to `true`, will delete the specified item.
3413
+ sig { returns(T.nilable(T::Boolean)) }
3414
+ attr_accessor :deleted
3415
+ # The coupons to redeem into discounts for the subscription item.
3416
+ sig {
3417
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::Discount]))))
3418
+ }
3419
+ attr_accessor :discounts
3420
+ # Subscription item to update.
3421
+ sig { returns(T.nilable(String)) }
3422
+ attr_accessor :id
3423
+ # 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`.
3424
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
3425
+ attr_accessor :metadata
3426
+ # Plan ID for this item, as a string.
3427
+ sig { returns(T.nilable(String)) }
3428
+ attr_accessor :plan
3429
+ # 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.
3430
+ sig { returns(T.nilable(String)) }
3431
+ attr_accessor :price
3432
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
3433
+ sig {
3434
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData))
3435
+ }
3436
+ attr_accessor :price_data
3437
+ # Quantity for this item.
3438
+ sig { returns(T.nilable(Integer)) }
3439
+ attr_accessor :quantity
3440
+ # 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.
3441
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3442
+ attr_accessor :tax_rates
3443
+ sig {
3444
+ params(clear_usage: T.nilable(T::Boolean), deleted: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::Discount]))), id: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
3445
+ }
3446
+ def initialize(
3447
+ clear_usage: nil,
3448
+ deleted: nil,
3449
+ discounts: nil,
3450
+ id: nil,
3451
+ metadata: nil,
3452
+ plan: nil,
3453
+ price: nil,
3454
+ price_data: nil,
3455
+ quantity: nil,
3456
+ tax_rates: nil
3457
+ ); end
3458
+ end
3459
+ # 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`.
3460
+ sig { returns(T.nilable(T.any(String, Integer))) }
3461
+ attr_accessor :billing_cycle_anchor
3462
+ # 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.
3463
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
3464
+ attr_accessor :cancel_at
3465
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
3466
+ sig { returns(T.nilable(T::Boolean)) }
3467
+ attr_accessor :cancel_at_period_end
3468
+ # This simulates the subscription being canceled or expired immediately.
3469
+ sig { returns(T.nilable(T::Boolean)) }
3470
+ attr_accessor :cancel_now
3471
+ # 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.
3472
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
3473
+ attr_accessor :default_tax_rates
3474
+ # A list of up to 20 subscription items, each with an attached price.
3475
+ sig {
3476
+ returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item]))
3477
+ }
3478
+ attr_accessor :items
3479
+ # 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`.
3480
+ sig { returns(T.nilable(String)) }
3481
+ attr_accessor :proration_behavior
3482
+ # 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'.
3483
+ sig { returns(T.nilable(Integer)) }
3484
+ attr_accessor :proration_date
3485
+ # For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
3486
+ sig { returns(T.nilable(String)) }
3487
+ attr_accessor :resume_at
3488
+ # Date a subscription is intended to start (can be future or past).
3489
+ sig { returns(T.nilable(Integer)) }
3490
+ attr_accessor :start_date
3491
+ # 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.
3492
+ sig { returns(T.nilable(T.any(String, Integer))) }
3493
+ attr_accessor :trial_end
3494
+ sig {
3495
+ params(billing_cycle_anchor: T.nilable(T.any(String, Integer)), cancel_at: T.nilable(T.nilable(T.any(String, Integer))), cancel_at_period_end: T.nilable(T::Boolean), cancel_now: T.nilable(T::Boolean), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item]), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), resume_at: T.nilable(String), start_date: T.nilable(Integer), trial_end: T.nilable(T.any(String, Integer))).void
3496
+ }
3497
+ def initialize(
3498
+ billing_cycle_anchor: nil,
3499
+ cancel_at: nil,
3500
+ cancel_at_period_end: nil,
3501
+ cancel_now: nil,
3502
+ default_tax_rates: nil,
3503
+ items: nil,
3504
+ proration_behavior: nil,
3505
+ proration_date: nil,
3506
+ resume_at: nil,
3507
+ start_date: nil,
3508
+ trial_end: nil
3509
+ ); end
3510
+ end
3511
+ # Settings for automatic tax lookup for this invoice preview.
3512
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax)) }
3513
+ attr_accessor :automatic_tax
3514
+ # The currency to preview this invoice in. Defaults to that of `customer` if not specified.
3515
+ sig { returns(T.nilable(String)) }
3516
+ attr_accessor :currency
3517
+ # 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.
3518
+ sig { returns(T.nilable(String)) }
3519
+ attr_accessor :customer
3520
+ # 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.
3521
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails)) }
3522
+ attr_accessor :customer_details
3523
+ # 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.
3524
+ sig {
3525
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::Discount]))))
3526
+ }
3527
+ attr_accessor :discounts
3528
+ # Specifies which fields in the response should be expanded.
3529
+ sig { returns(T.nilable(T::Array[String])) }
3530
+ attr_accessor :expand
3531
+ # List of invoice items to add or update in the upcoming invoice preview (up to 250).
3532
+ sig { returns(T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem])) }
3533
+ attr_accessor :invoice_items
3534
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
3535
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::Issuer)) }
3536
+ attr_accessor :issuer
3537
+ # 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.
3538
+ sig { returns(T.nilable(T.nilable(String))) }
3539
+ attr_accessor :on_behalf_of
3540
+ # Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
3541
+ sig { returns(T.nilable(String)) }
3542
+ attr_accessor :preview_mode
3543
+ # The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
3544
+ sig { returns(T.nilable(String)) }
3545
+ attr_accessor :schedule
3546
+ # The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
3547
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails)) }
3548
+ attr_accessor :schedule_details
3549
+ # 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.
3550
+ sig { returns(T.nilable(String)) }
3551
+ attr_accessor :subscription
3552
+ # The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
3553
+ sig { returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails)) }
3554
+ attr_accessor :subscription_details
3555
+ sig {
3556
+ params(automatic_tax: T.nilable(::Stripe::Invoice::CreatePreviewParams::AutomaticTax), currency: T.nilable(String), customer: T.nilable(String), customer_details: T.nilable(::Stripe::Invoice::CreatePreviewParams::CustomerDetails), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Invoice::CreatePreviewParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::InvoiceItem]), issuer: T.nilable(::Stripe::Invoice::CreatePreviewParams::Issuer), on_behalf_of: T.nilable(T.nilable(String)), preview_mode: T.nilable(String), schedule: T.nilable(String), schedule_details: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails), subscription: T.nilable(String), subscription_details: T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails)).void
3557
+ }
3558
+ def initialize(
3559
+ automatic_tax: nil,
3560
+ currency: nil,
3561
+ customer: nil,
3562
+ customer_details: nil,
3563
+ discounts: nil,
3564
+ expand: nil,
3565
+ invoice_items: nil,
3566
+ issuer: nil,
3567
+ on_behalf_of: nil,
3568
+ preview_mode: nil,
3569
+ schedule: nil,
3570
+ schedule_details: nil,
3571
+ subscription: nil,
3572
+ subscription_details: nil
3573
+ ); end
3574
+ end
3575
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
3576
+ sig {
3577
+ params(params: T.any(::Stripe::Invoice::AddLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3578
+ }
3579
+ def add_lines(params = {}, opts = {}); end
3580
+
3581
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
3582
+ sig {
3583
+ params(invoice: String, params: T.any(::Stripe::Invoice::AddLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3584
+ }
3585
+ def self.add_lines(invoice, params = {}, opts = {}); end
3586
+
3587
+ # 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.
3588
+ sig {
3589
+ params(params: T.any(::Stripe::Invoice::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3590
+ }
3591
+ def self.create(params = {}, opts = {}); end
3592
+
3593
+ # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.
3594
+ #
3595
+ # 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.
3596
+ #
3597
+ # 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.
3598
+ #
3599
+ # 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)
3600
+ sig {
3601
+ params(params: T.any(::Stripe::Invoice::CreatePreviewParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3602
+ }
3603
+ def self.create_preview(params = {}, opts = {}); end
3604
+
3605
+ # 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).
3606
+ sig {
3607
+ params(invoice: String, params: T.any(::Stripe::Invoice::DeleteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3608
+ }
3609
+ def self.delete(invoice, params = {}, opts = {}); end
3610
+
3611
+ # 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).
3612
+ sig {
3613
+ params(params: T.any(::Stripe::Invoice::DeleteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3614
+ }
3615
+ def delete(params = {}, opts = {}); end
3616
+
3617
+ # 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.
3618
+ sig {
3619
+ params(params: T.any(::Stripe::Invoice::FinalizeInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3620
+ }
3621
+ def finalize_invoice(params = {}, opts = {}); end
3622
+
3623
+ # 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.
3624
+ sig {
3625
+ params(invoice: String, params: T.any(::Stripe::Invoice::FinalizeInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3626
+ }
3627
+ def self.finalize_invoice(invoice, params = {}, opts = {}); end
3628
+
3629
+ # 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.
3630
+ sig {
3631
+ params(params: T.any(::Stripe::Invoice::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
3632
+ }
3633
+ def self.list(params = {}, opts = {}); end
3634
+
3635
+ # Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
3636
+ sig {
3637
+ params(params: T.any(::Stripe::Invoice::MarkUncollectibleParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3638
+ }
3639
+ def mark_uncollectible(params = {}, opts = {}); end
3640
+
3641
+ # Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
3642
+ sig {
3643
+ params(invoice: String, params: T.any(::Stripe::Invoice::MarkUncollectibleParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3644
+ }
3645
+ def self.mark_uncollectible(invoice, params = {}, opts = {}); end
3646
+
3647
+ # 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.
3648
+ sig {
3649
+ params(params: T.any(::Stripe::Invoice::PayParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3650
+ }
3651
+ def pay(params = {}, opts = {}); end
3652
+
3653
+ # 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.
3654
+ sig {
3655
+ params(invoice: String, params: T.any(::Stripe::Invoice::PayParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3656
+ }
3657
+ def self.pay(invoice, params = {}, opts = {}); end
3658
+
3659
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
3660
+ sig {
3661
+ params(params: T.any(::Stripe::Invoice::RemoveLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3662
+ }
3663
+ def remove_lines(params = {}, opts = {}); end
3664
+
3665
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
3666
+ sig {
3667
+ params(invoice: String, params: T.any(::Stripe::Invoice::RemoveLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3668
+ }
3669
+ def self.remove_lines(invoice, params = {}, opts = {}); end
3670
+
3671
+ sig {
3672
+ params(params: T.any(::Stripe::Invoice::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SearchResultObject)
3673
+ }
3674
+ def self.search(params = {}, opts = {}); end
3675
+
3676
+ sig {
3677
+ params(params: T.any(::Stripe::Invoice::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped, blk: T.untyped).returns(Stripe::SearchResultObject)
3678
+ }
3679
+ def self.search_auto_paging_each(params = {}, opts = {}, &blk); end
3680
+
3681
+ # 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.
3682
+ #
3683
+ # Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
3684
+ sig {
3685
+ params(params: T.any(::Stripe::Invoice::SendInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3686
+ }
3687
+ def send_invoice(params = {}, opts = {}); end
3688
+
3689
+ # 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.
3690
+ #
3691
+ # Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
3692
+ sig {
3693
+ params(invoice: String, params: T.any(::Stripe::Invoice::SendInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3694
+ }
3695
+ def self.send_invoice(invoice, params = {}, opts = {}); end
3696
+
3697
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
3698
+ # monetary values, as well as collection_method, become uneditable.
3699
+ #
3700
+ # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
3701
+ # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
3702
+ # auto_advance=false.
3703
+ sig {
3704
+ params(invoice: String, params: T.any(::Stripe::Invoice::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3705
+ }
3706
+ def self.update(invoice, params = {}, opts = {}); end
3707
+
3708
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
3709
+ sig {
3710
+ params(params: T.any(::Stripe::Invoice::UpdateLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3711
+ }
3712
+ def update_lines(params = {}, opts = {}); end
3713
+
3714
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
3715
+ sig {
3716
+ params(invoice: String, params: T.any(::Stripe::Invoice::UpdateLinesParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3717
+ }
3718
+ def self.update_lines(invoice, params = {}, opts = {}); end
3719
+
3720
+ # 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.
3721
+ #
3722
+ # 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.
3723
+ sig {
3724
+ params(params: T.any(::Stripe::Invoice::VoidInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3725
+ }
3726
+ def void_invoice(params = {}, opts = {}); end
3727
+
3728
+ # 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.
3729
+ #
3730
+ # 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.
3731
+ sig {
3732
+ params(invoice: String, params: T.any(::Stripe::Invoice::VoidInvoiceParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Invoice)
3733
+ }
3734
+ def self.void_invoice(invoice, params = {}, opts = {}); end
3735
+ end
3736
+ end