stripe 17.6.0 → 17.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CHANGELOG.md +1068 -109
  2. package/OPENAPI_VERSION +1 -0
  3. package/README.md +1 -0
  4. package/VERSION +1 -1
  5. package/cjs/resources/AccountNotices.js +21 -0
  6. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  7. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  8. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  9. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  10. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  11. package/cjs/resources/GiftCards/Cards.js +23 -0
  12. package/cjs/resources/GiftCards/Transactions.js +33 -0
  13. package/cjs/resources/Invoices.js +17 -0
  14. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  15. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  16. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  17. package/cjs/resources/Margins.js +22 -0
  18. package/cjs/resources/Orders.js +24 -0
  19. package/cjs/resources/PaymentAttemptRecords.js +17 -0
  20. package/cjs/resources/PaymentIntents.js +8 -0
  21. package/cjs/resources/PaymentRecords.js +29 -0
  22. package/cjs/resources/Quotes.js +32 -0
  23. package/cjs/resources/SubscriptionSchedules.js +4 -0
  24. package/cjs/resources/Tax/Associations.js +9 -0
  25. package/cjs/resources/Tax/Forms.js +20 -0
  26. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  27. package/cjs/resources/Terminal/Readers.js +12 -0
  28. package/cjs/resources.js +48 -10
  29. package/cjs/stripe.core.js +1 -1
  30. package/esm/resources/AccountNotices.js +18 -0
  31. package/esm/resources/Capital/FinancingOffers.js +18 -0
  32. package/esm/resources/Capital/FinancingSummary.js +9 -0
  33. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  34. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  35. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  36. package/esm/resources/GiftCards/Cards.js +20 -0
  37. package/esm/resources/GiftCards/Transactions.js +30 -0
  38. package/esm/resources/Invoices.js +17 -0
  39. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  40. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  41. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  42. package/esm/resources/Margins.js +19 -0
  43. package/esm/resources/Orders.js +21 -0
  44. package/esm/resources/PaymentAttemptRecords.js +14 -0
  45. package/esm/resources/PaymentIntents.js +8 -0
  46. package/esm/resources/PaymentRecords.js +26 -0
  47. package/esm/resources/Quotes.js +32 -0
  48. package/esm/resources/SubscriptionSchedules.js +4 -0
  49. package/esm/resources/Tax/Associations.js +6 -0
  50. package/esm/resources/Tax/Forms.js +17 -0
  51. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  52. package/esm/resources/Terminal/Readers.js +12 -0
  53. package/esm/resources.js +33 -0
  54. package/esm/stripe.core.js +1 -1
  55. package/package.json +1 -1
  56. package/types/AccountLinksResource.d.ts +5 -1
  57. package/types/AccountNotices.d.ts +113 -0
  58. package/types/AccountNoticesResource.d.ts +98 -0
  59. package/types/AccountSessions.d.ts +45 -0
  60. package/types/AccountSessionsResource.d.ts +243 -0
  61. package/types/Accounts.d.ts +205 -1
  62. package/types/AccountsResource.d.ts +526 -2
  63. package/types/Balance.d.ts +18 -18
  64. package/types/Billing/CreditBalanceSummaryResource.d.ts +14 -0
  65. package/types/Billing/CreditGrants.d.ts +15 -1
  66. package/types/Billing/CreditGrantsResource.d.ts +14 -0
  67. package/types/Billing/MeterErrorReports.d.ts +106 -0
  68. package/types/Billing/MeterEventSummaries.d.ts +2 -0
  69. package/types/Capital/FinancingOffers.d.ts +188 -0
  70. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  71. package/types/Capital/FinancingSummary.d.ts +106 -0
  72. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  73. package/types/Capital/FinancingTransactions.d.ts +135 -0
  74. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  75. package/types/Cards.d.ts +5 -0
  76. package/types/Charges.d.ts +151 -3
  77. package/types/ChargesResource.d.ts +1294 -0
  78. package/types/Checkout/Sessions.d.ts +362 -9
  79. package/types/Checkout/SessionsResource.d.ts +465 -5
  80. package/types/ConfirmationTokens.d.ts +103 -4
  81. package/types/Coupons.d.ts +1 -1
  82. package/types/CouponsResource.d.ts +1 -1
  83. package/types/CreditNotes.d.ts +23 -2
  84. package/types/CreditNotesResource.d.ts +51 -0
  85. package/types/CustomersResource.d.ts +7 -0
  86. package/types/EventTypes.d.ts +596 -0
  87. package/types/Events.d.ts +93 -0
  88. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  89. package/types/FinancialConnections/Accounts.d.ts +29 -1
  90. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  91. package/types/FinancialConnections/Institutions.d.ts +93 -0
  92. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  93. package/types/FinancialConnections/Sessions.d.ts +49 -1
  94. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  95. package/types/GiftCards/Cards.d.ts +118 -0
  96. package/types/GiftCards/CardsResource.d.ts +159 -0
  97. package/types/GiftCards/Transactions.d.ts +129 -0
  98. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  99. package/types/InvoiceItems.d.ts +5 -0
  100. package/types/InvoiceItemsResource.d.ts +98 -0
  101. package/types/InvoiceLineItems.d.ts +28 -1
  102. package/types/InvoicePayments.d.ts +113 -0
  103. package/types/Invoices.d.ts +139 -4
  104. package/types/InvoicesResource.d.ts +4618 -933
  105. package/types/Issuing/Authorizations.d.ts +1 -0
  106. package/types/Issuing/CardholdersResource.d.ts +2 -1
  107. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  108. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  109. package/types/Issuing/DisputeSettlementDetails.d.ts +73 -0
  110. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  111. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  112. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  113. package/types/Issuing/Settlements.d.ts +103 -0
  114. package/types/Issuing/Transactions.d.ts +2 -0
  115. package/types/Issuing/TransactionsResource.d.ts +5 -0
  116. package/types/LineItems.d.ts +34 -2
  117. package/types/Mandates.d.ts +77 -0
  118. package/types/Margins.d.ts +56 -0
  119. package/types/MarginsResource.d.ts +114 -0
  120. package/types/Orders.d.ts +1179 -0
  121. package/types/OrdersResource.d.ts +2961 -0
  122. package/types/PaymentAttemptRecords.d.ts +242 -0
  123. package/types/PaymentAttemptRecordsResource.d.ts +47 -0
  124. package/types/PaymentIntents.d.ts +644 -1
  125. package/types/PaymentIntentsResource.d.ts +8027 -3740
  126. package/types/PaymentLinks.d.ts +6 -0
  127. package/types/PaymentLinksResource.d.ts +12 -0
  128. package/types/PaymentMethodConfigurations.d.ts +180 -0
  129. package/types/PaymentMethodConfigurationsResource.d.ts +250 -0
  130. package/types/PaymentMethods.d.ts +103 -4
  131. package/types/PaymentMethodsResource.d.ts +133 -0
  132. package/types/PaymentRecords.d.ts +242 -0
  133. package/types/PaymentRecordsResource.d.ts +455 -0
  134. package/types/Prices.d.ts +22 -0
  135. package/types/PricesResource.d.ts +22 -0
  136. package/types/Products.d.ts +39 -0
  137. package/types/ProductsResource.d.ts +36 -0
  138. package/types/QuoteLines.d.ts +634 -0
  139. package/types/QuotePreviewInvoices.d.ts +1658 -0
  140. package/types/QuotePreviewSubscriptionSchedules.d.ts +824 -0
  141. package/types/Quotes.d.ts +597 -7
  142. package/types/QuotesResource.d.ts +2526 -194
  143. package/types/Refunds.d.ts +16 -2
  144. package/types/SetupAttempts.d.ts +38 -0
  145. package/types/SetupIntents.d.ts +111 -1
  146. package/types/SetupIntentsResource.d.ts +648 -6
  147. package/types/Sources.d.ts +29 -0
  148. package/types/SubscriptionItems.d.ts +21 -0
  149. package/types/SubscriptionItemsResource.d.ts +109 -0
  150. package/types/SubscriptionSchedules.d.ts +200 -0
  151. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  152. package/types/Subscriptions.d.ts +91 -1
  153. package/types/SubscriptionsResource.d.ts +369 -2
  154. package/types/Tax/Associations.d.ts +126 -0
  155. package/types/Tax/AssociationsResource.d.ts +29 -0
  156. package/types/Tax/CalculationLineItems.d.ts +1 -1
  157. package/types/Tax/Calculations.d.ts +1 -1
  158. package/types/Tax/Forms.d.ts +220 -0
  159. package/types/Tax/FormsResource.d.ts +107 -0
  160. package/types/Tax/Transactions.d.ts +1 -1
  161. package/types/TaxRates.d.ts +3 -3
  162. package/types/TaxRatesResource.d.ts +2 -2
  163. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  164. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  165. package/types/Terminal/Readers.d.ts +290 -0
  166. package/types/Terminal/ReadersResource.d.ts +215 -0
  167. package/types/TestHelpers/ConfirmationTokensResource.d.ts +104 -0
  168. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  169. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  170. package/types/TokensResource.d.ts +3 -1
  171. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  172. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  173. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  174. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  175. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  176. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  177. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  178. package/types/WebhookEndpointsResource.d.ts +70 -0
  179. package/types/index.d.ts +62 -0
@@ -30,7 +30,7 @@ declare module 'stripe' {
30
30
  billing_address_collection?: SessionCreateParams.BillingAddressCollection;
31
31
 
32
32
  /**
33
- * If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded`.
33
+ * If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded` or `custom`.
34
34
  */
35
35
  cancel_url?: string;
36
36
 
@@ -192,6 +192,13 @@ declare module 'stripe' {
192
192
  */
193
193
  payment_method_types?: Array<SessionCreateParams.PaymentMethodType>;
194
194
 
195
+ /**
196
+ * This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.
197
+ *
198
+ * For specific permissions, please refer to their dedicated subsections, such as `permissions.update.shipping_details`.
199
+ */
200
+ permissions?: SessionCreateParams.Permissions;
201
+
195
202
  /**
196
203
  * Controls phone number collection settings for the session.
197
204
  *
@@ -207,7 +214,7 @@ declare module 'stripe' {
207
214
 
208
215
  /**
209
216
  * The URL to redirect your customer back to after they authenticate or cancel their payment on the
210
- * payment method's app or site. This parameter is required if ui_mode is `embedded`
217
+ * payment method's app or site. This parameter is required if `ui_mode` is `embedded` or `custom`
211
218
  * and redirect-based payment methods are enabled on the session.
212
219
  */
213
220
  return_url?: string;
@@ -247,7 +254,7 @@ declare module 'stripe' {
247
254
  /**
248
255
  * The URL to which Stripe should send customers when payment or setup
249
256
  * is complete.
250
- * This parameter is not allowed if ui_mode is `embedded`. If you'd like to use
257
+ * This parameter is not allowed if ui_mode is `embedded` or `custom`. If you'd like to use
251
258
  * information from the successful Checkout Session on your page, read the
252
259
  * guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page).
253
260
  */
@@ -680,6 +687,11 @@ declare module 'stripe' {
680
687
  */
681
688
  dynamic_tax_rates?: Array<string>;
682
689
 
690
+ /**
691
+ * 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`.
692
+ */
693
+ metadata?: Stripe.MetadataParam;
694
+
683
695
  /**
684
696
  * The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required.
685
697
  */
@@ -1152,6 +1164,11 @@ declare module 'stripe' {
1152
1164
  */
1153
1165
  paypal?: PaymentMethodOptions.Paypal;
1154
1166
 
1167
+ /**
1168
+ * contains details about the PayTo payment method options.
1169
+ */
1170
+ payto?: PaymentMethodOptions.Payto;
1171
+
1155
1172
  /**
1156
1173
  * contains details about the Pix payment method options.
1157
1174
  */
@@ -1406,6 +1423,11 @@ declare module 'stripe' {
1406
1423
  */
1407
1424
  installments?: Card.Installments;
1408
1425
 
1426
+ /**
1427
+ * Request ability to [capture beyond the standard authorization validity window](https://stripe.com/payments/extended-authorization) for this CheckoutSession.
1428
+ */
1429
+ request_decremental_authorization?: Card.RequestDecrementalAuthorization;
1430
+
1409
1431
  /**
1410
1432
  * Request ability to [capture beyond the standard authorization validity window](https://stripe.com/payments/extended-authorization) for this CheckoutSession.
1411
1433
  */
@@ -1431,6 +1453,11 @@ declare module 'stripe' {
1431
1453
  */
1432
1454
  request_three_d_secure?: Card.RequestThreeDSecure;
1433
1455
 
1456
+ /**
1457
+ * Restrictions to apply to the card payment method. For example, you can block specific card brands.
1458
+ */
1459
+ restrictions?: Card.Restrictions;
1460
+
1434
1461
  /**
1435
1462
  * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1436
1463
  *
@@ -1462,6 +1489,8 @@ declare module 'stripe' {
1462
1489
  enabled?: boolean;
1463
1490
  }
1464
1491
 
1492
+ type RequestDecrementalAuthorization = 'if_available' | 'never';
1493
+
1465
1494
  type RequestExtendedAuthorization = 'if_available' | 'never';
1466
1495
 
1467
1496
  type RequestIncrementalAuthorization = 'if_available' | 'never';
@@ -1472,6 +1501,21 @@ declare module 'stripe' {
1472
1501
 
1473
1502
  type RequestThreeDSecure = 'any' | 'automatic' | 'challenge';
1474
1503
 
1504
+ interface Restrictions {
1505
+ /**
1506
+ * Specify the card brands to block in the Checkout Session. If a customer enters or selects a card belonging to a blocked brand, they can't complete the Session.
1507
+ */
1508
+ brands_blocked?: Array<Restrictions.BrandsBlocked>;
1509
+ }
1510
+
1511
+ namespace Restrictions {
1512
+ type BrandsBlocked =
1513
+ | 'american_express'
1514
+ | 'discover_global_network'
1515
+ | 'mastercard'
1516
+ | 'visa';
1517
+ }
1518
+
1475
1519
  type SetupFutureUsage = 'off_session' | 'on_session';
1476
1520
  }
1477
1521
 
@@ -1842,6 +1886,11 @@ declare module 'stripe' {
1842
1886
  */
1843
1887
  reference?: string;
1844
1888
 
1889
+ /**
1890
+ * A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
1891
+ */
1892
+ reference_id?: string;
1893
+
1845
1894
  /**
1846
1895
  * The risk correlation ID for an on-session payment using a saved PayPal payment method.
1847
1896
  */
@@ -1859,6 +1908,11 @@ declare module 'stripe' {
1859
1908
  * If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
1860
1909
  */
1861
1910
  setup_future_usage?: Stripe.Emptyable<Paypal.SetupFutureUsage>;
1911
+
1912
+ /**
1913
+ * The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used.
1914
+ */
1915
+ subsellers?: Array<string>;
1862
1916
  }
1863
1917
 
1864
1918
  namespace Paypal {
@@ -1888,6 +1942,92 @@ declare module 'stripe' {
1888
1942
  type SetupFutureUsage = 'none' | 'off_session';
1889
1943
  }
1890
1944
 
1945
+ interface Payto {
1946
+ /**
1947
+ * Additional fields for Mandate creation
1948
+ */
1949
+ mandate_options?: Payto.MandateOptions;
1950
+
1951
+ /**
1952
+ * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1953
+ *
1954
+ * If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1955
+ *
1956
+ * If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1957
+ *
1958
+ * When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication).
1959
+ */
1960
+ setup_future_usage?: Payto.SetupFutureUsage;
1961
+ }
1962
+
1963
+ namespace Payto {
1964
+ interface MandateOptions {
1965
+ /**
1966
+ * Amount that will be collected. It is required when `amount_type` is `fixed`.
1967
+ */
1968
+ amount?: number;
1969
+
1970
+ /**
1971
+ * The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
1972
+ */
1973
+ amount_type?: MandateOptions.AmountType;
1974
+
1975
+ /**
1976
+ * Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date.
1977
+ */
1978
+ end_date?: string;
1979
+
1980
+ /**
1981
+ * The periodicity at which payments will be collected.
1982
+ */
1983
+ payment_schedule?: MandateOptions.PaymentSchedule;
1984
+
1985
+ /**
1986
+ * The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit.
1987
+ */
1988
+ payments_per_period?: number;
1989
+
1990
+ /**
1991
+ * The purpose for which payments are made. Defaults to retail.
1992
+ */
1993
+ purpose?: MandateOptions.Purpose;
1994
+
1995
+ /**
1996
+ * Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time.
1997
+ */
1998
+ start_date?: string;
1999
+ }
2000
+
2001
+ namespace MandateOptions {
2002
+ type AmountType = 'fixed' | 'maximum';
2003
+
2004
+ type PaymentSchedule =
2005
+ | 'adhoc'
2006
+ | 'annual'
2007
+ | 'daily'
2008
+ | 'fortnightly'
2009
+ | 'monthly'
2010
+ | 'quarterly'
2011
+ | 'semi_annual'
2012
+ | 'weekly';
2013
+
2014
+ type Purpose =
2015
+ | 'dependant_support'
2016
+ | 'government'
2017
+ | 'loan'
2018
+ | 'mortgage'
2019
+ | 'other'
2020
+ | 'pension'
2021
+ | 'personal'
2022
+ | 'retail'
2023
+ | 'salary'
2024
+ | 'tax'
2025
+ | 'utility';
2026
+ }
2027
+
2028
+ type SetupFutureUsage = 'none' | 'off_session';
2029
+ }
2030
+
1891
2031
  interface Pix {
1892
2032
  /**
1893
2033
  * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds.
@@ -2011,7 +2151,11 @@ declare module 'stripe' {
2011
2151
  | 'payment_method'
2012
2152
  | 'transactions';
2013
2153
 
2014
- type Prefetch = 'balances' | 'ownership' | 'transactions';
2154
+ type Prefetch =
2155
+ | 'balances'
2156
+ | 'inferred_balances'
2157
+ | 'ownership'
2158
+ | 'transactions';
2015
2159
  }
2016
2160
 
2017
2161
  type SetupFutureUsage = 'none' | 'off_session' | 'on_session';
@@ -2065,6 +2209,7 @@ declare module 'stripe' {
2065
2209
  | 'eps'
2066
2210
  | 'fpx'
2067
2211
  | 'giropay'
2212
+ | 'gopay'
2068
2213
  | 'grabpay'
2069
2214
  | 'ideal'
2070
2215
  | 'kakao_pay'
@@ -2072,6 +2217,7 @@ declare module 'stripe' {
2072
2217
  | 'konbini'
2073
2218
  | 'kr_card'
2074
2219
  | 'link'
2220
+ | 'mb_way'
2075
2221
  | 'mobilepay'
2076
2222
  | 'multibanco'
2077
2223
  | 'naver_pay'
@@ -2081,11 +2227,15 @@ declare module 'stripe' {
2081
2227
  | 'payco'
2082
2228
  | 'paynow'
2083
2229
  | 'paypal'
2230
+ | 'payto'
2084
2231
  | 'pix'
2085
2232
  | 'promptpay'
2233
+ | 'qris'
2234
+ | 'rechnung'
2086
2235
  | 'revolut_pay'
2087
2236
  | 'samsung_pay'
2088
2237
  | 'sepa_debit'
2238
+ | 'shopeepay'
2089
2239
  | 'sofort'
2090
2240
  | 'swish'
2091
2241
  | 'twint'
@@ -2093,6 +2243,41 @@ declare module 'stripe' {
2093
2243
  | 'wechat_pay'
2094
2244
  | 'zip';
2095
2245
 
2246
+ interface Permissions {
2247
+ /**
2248
+ * Permissions for updating the Checkout Session.
2249
+ */
2250
+ update?: Permissions.Update;
2251
+ }
2252
+
2253
+ namespace Permissions {
2254
+ interface Update {
2255
+ /**
2256
+ * Determines which entity is allowed to update the line items.
2257
+ *
2258
+ * Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items.
2259
+ *
2260
+ * When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API.
2261
+ */
2262
+ line_items?: Update.LineItems;
2263
+
2264
+ /**
2265
+ * Determines which entity is allowed to update the shipping details.
2266
+ *
2267
+ * Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details.
2268
+ *
2269
+ * When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API.
2270
+ */
2271
+ shipping_details?: Update.ShippingDetails;
2272
+ }
2273
+
2274
+ namespace Update {
2275
+ type LineItems = 'client_only' | 'server_only';
2276
+
2277
+ type ShippingDetails = 'client_only' | 'server_only';
2278
+ }
2279
+ }
2280
+
2096
2281
  interface PhoneNumberCollection {
2097
2282
  /**
2098
2283
  * Set to `true` to enable phone number collection.
@@ -2677,7 +2862,7 @@ declare module 'stripe' {
2677
2862
  type Required = 'if_supported' | 'never';
2678
2863
  }
2679
2864
 
2680
- type UiMode = 'embedded' | 'hosted';
2865
+ type UiMode = 'custom' | 'embedded' | 'hosted';
2681
2866
  }
2682
2867
 
2683
2868
  interface SessionRetrieveParams {
@@ -2688,15 +2873,290 @@ declare module 'stripe' {
2688
2873
  }
2689
2874
 
2690
2875
  interface SessionUpdateParams {
2876
+ /**
2877
+ * Information about the customer collected within the Checkout Session.
2878
+ */
2879
+ collected_information?: SessionUpdateParams.CollectedInformation;
2880
+
2691
2881
  /**
2692
2882
  * Specifies which fields in the response should be expanded.
2693
2883
  */
2694
2884
  expand?: Array<string>;
2695
2885
 
2886
+ /**
2887
+ * A list of items the customer is purchasing.
2888
+ *
2889
+ * When updating line items, you must retransmit the entire array of line items.
2890
+ *
2891
+ * To retain an existing line item, specify its `id`.
2892
+ *
2893
+ * To update an existing line item, specify its `id` along with the new values of the fields to update.
2894
+ *
2895
+ * To add a new line item, specify a `price` and `quantity`. We don't currently support recurring prices.
2896
+ *
2897
+ * To remove an existing line item, omit the line item's ID from the retransmitted array.
2898
+ *
2899
+ * To reorder a line item, specify it at the desired position in the retransmitted array.
2900
+ */
2901
+ line_items?: Array<SessionUpdateParams.LineItem>;
2902
+
2696
2903
  /**
2697
2904
  * 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`.
2698
2905
  */
2699
2906
  metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
2907
+
2908
+ /**
2909
+ * The shipping rate options to apply to this Session. Up to a maximum of 5.
2910
+ */
2911
+ shipping_options?: Stripe.Emptyable<
2912
+ Array<SessionUpdateParams.ShippingOption>
2913
+ >;
2914
+ }
2915
+
2916
+ namespace SessionUpdateParams {
2917
+ interface CollectedInformation {
2918
+ /**
2919
+ * The shipping details to apply to this Session.
2920
+ */
2921
+ shipping_details?: CollectedInformation.ShippingDetails;
2922
+ }
2923
+
2924
+ namespace CollectedInformation {
2925
+ interface ShippingDetails {
2926
+ /**
2927
+ * The address of the customer
2928
+ */
2929
+ address: ShippingDetails.Address;
2930
+
2931
+ /**
2932
+ * The name of customer
2933
+ */
2934
+ name: string;
2935
+ }
2936
+
2937
+ namespace ShippingDetails {
2938
+ interface Address {
2939
+ /**
2940
+ * City, district, suburb, town, or village.
2941
+ */
2942
+ city?: string;
2943
+
2944
+ /**
2945
+ * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2946
+ */
2947
+ country: string;
2948
+
2949
+ /**
2950
+ * Address line 1 (e.g., street, PO Box, or company name).
2951
+ */
2952
+ line1: string;
2953
+
2954
+ /**
2955
+ * Address line 2 (e.g., apartment, suite, unit, or building).
2956
+ */
2957
+ line2?: string;
2958
+
2959
+ /**
2960
+ * ZIP or postal code.
2961
+ */
2962
+ postal_code?: string;
2963
+
2964
+ /**
2965
+ * State, county, province, or region.
2966
+ */
2967
+ state?: string;
2968
+ }
2969
+ }
2970
+ }
2971
+
2972
+ interface LineItem {
2973
+ /**
2974
+ * When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout.
2975
+ */
2976
+ adjustable_quantity?: LineItem.AdjustableQuantity;
2977
+
2978
+ /**
2979
+ * ID of an existing line item.
2980
+ */
2981
+ id?: string;
2982
+
2983
+ /**
2984
+ * 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`.
2985
+ */
2986
+ metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
2987
+
2988
+ /**
2989
+ * The ID of the [Price](https://stripe.com/docs/api/prices).
2990
+ */
2991
+ price?: string;
2992
+
2993
+ /**
2994
+ * The quantity of the line item being purchased.
2995
+ */
2996
+ quantity?: number;
2997
+
2998
+ /**
2999
+ * The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item.
3000
+ */
3001
+ tax_rates?: Stripe.Emptyable<Array<string>>;
3002
+ }
3003
+
3004
+ namespace LineItem {
3005
+ interface AdjustableQuantity {
3006
+ /**
3007
+ * Set to true if the quantity can be adjusted to any positive integer. Setting to false will remove any previously specified constraints on quantity.
3008
+ */
3009
+ enabled: boolean;
3010
+
3011
+ /**
3012
+ * The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999.
3013
+ */
3014
+ maximum?: number;
3015
+
3016
+ /**
3017
+ * The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0.
3018
+ */
3019
+ minimum?: number;
3020
+ }
3021
+ }
3022
+
3023
+ interface ShippingOption {
3024
+ /**
3025
+ * The ID of the Shipping Rate to use for this shipping option.
3026
+ */
3027
+ shipping_rate?: string;
3028
+
3029
+ /**
3030
+ * Parameters to be passed to Shipping Rate creation for this shipping option.
3031
+ */
3032
+ shipping_rate_data?: ShippingOption.ShippingRateData;
3033
+ }
3034
+
3035
+ namespace ShippingOption {
3036
+ interface ShippingRateData {
3037
+ /**
3038
+ * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
3039
+ */
3040
+ delivery_estimate?: ShippingRateData.DeliveryEstimate;
3041
+
3042
+ /**
3043
+ * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
3044
+ */
3045
+ display_name: string;
3046
+
3047
+ /**
3048
+ * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
3049
+ */
3050
+ fixed_amount?: ShippingRateData.FixedAmount;
3051
+
3052
+ /**
3053
+ * 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`.
3054
+ */
3055
+ metadata?: Stripe.MetadataParam;
3056
+
3057
+ /**
3058
+ * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
3059
+ */
3060
+ tax_behavior?: ShippingRateData.TaxBehavior;
3061
+
3062
+ /**
3063
+ * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
3064
+ */
3065
+ tax_code?: string;
3066
+
3067
+ /**
3068
+ * The type of calculation to use on the shipping rate.
3069
+ */
3070
+ type?: 'fixed_amount';
3071
+ }
3072
+
3073
+ namespace ShippingRateData {
3074
+ interface DeliveryEstimate {
3075
+ /**
3076
+ * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
3077
+ */
3078
+ maximum?: DeliveryEstimate.Maximum;
3079
+
3080
+ /**
3081
+ * The lower bound of the estimated range. If empty, represents no lower bound.
3082
+ */
3083
+ minimum?: DeliveryEstimate.Minimum;
3084
+ }
3085
+
3086
+ namespace DeliveryEstimate {
3087
+ interface Maximum {
3088
+ /**
3089
+ * A unit of time.
3090
+ */
3091
+ unit: Maximum.Unit;
3092
+
3093
+ /**
3094
+ * Must be greater than 0.
3095
+ */
3096
+ value: number;
3097
+ }
3098
+
3099
+ namespace Maximum {
3100
+ type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week';
3101
+ }
3102
+
3103
+ interface Minimum {
3104
+ /**
3105
+ * A unit of time.
3106
+ */
3107
+ unit: Minimum.Unit;
3108
+
3109
+ /**
3110
+ * Must be greater than 0.
3111
+ */
3112
+ value: number;
3113
+ }
3114
+
3115
+ namespace Minimum {
3116
+ type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week';
3117
+ }
3118
+ }
3119
+
3120
+ interface FixedAmount {
3121
+ /**
3122
+ * A non-negative integer in cents representing how much to charge.
3123
+ */
3124
+ amount: number;
3125
+
3126
+ /**
3127
+ * 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).
3128
+ */
3129
+ currency: string;
3130
+
3131
+ /**
3132
+ * 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).
3133
+ */
3134
+ currency_options?: {
3135
+ [key: string]: FixedAmount.CurrencyOptions;
3136
+ };
3137
+ }
3138
+
3139
+ namespace FixedAmount {
3140
+ interface CurrencyOptions {
3141
+ /**
3142
+ * A non-negative integer in cents representing how much to charge.
3143
+ */
3144
+ amount: number;
3145
+
3146
+ /**
3147
+ * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
3148
+ */
3149
+ tax_behavior?: CurrencyOptions.TaxBehavior;
3150
+ }
3151
+
3152
+ namespace CurrencyOptions {
3153
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
3154
+ }
3155
+ }
3156
+
3157
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
3158
+ }
3159
+ }
2700
3160
  }
2701
3161
 
2702
3162
  interface SessionListParams extends PaginationParams {