stripe 15.4.0 → 15.5.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 (35) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +4 -3
  3. package/VERSION +1 -1
  4. package/cjs/stripe.core.js +1 -1
  5. package/esm/stripe.core.js +1 -1
  6. package/package.json +1 -1
  7. package/types/Apps/Secrets.d.ts +1 -1
  8. package/types/BillingPortal/Configurations.d.ts +1 -1
  9. package/types/Charges.d.ts +4 -1
  10. package/types/ConfirmationTokens.d.ts +2 -1
  11. package/types/Disputes.d.ts +17 -1
  12. package/types/Entitlements/FeaturesResource.d.ts +1 -1
  13. package/types/Identity/VerificationReports.d.ts +5 -5
  14. package/types/Identity/VerificationSessions.d.ts +4 -4
  15. package/types/Invoices.d.ts +3 -2
  16. package/types/InvoicesResource.d.ts +4 -0
  17. package/types/Issuing/AuthorizationsResource.d.ts +2 -0
  18. package/types/Issuing/Disputes.d.ts +1 -1
  19. package/types/Issuing/Transactions.d.ts +1 -1
  20. package/types/PaymentIntents.d.ts +2 -0
  21. package/types/PaymentIntentsResource.d.ts +8 -0
  22. package/types/PaymentMethods.d.ts +2 -1
  23. package/types/SetupAttempts.d.ts +1 -0
  24. package/types/SetupIntents.d.ts +2 -0
  25. package/types/SetupIntentsResource.d.ts +3 -0
  26. package/types/Tax/CalculationLineItems.d.ts +1 -1
  27. package/types/Tax/Calculations.d.ts +10 -1
  28. package/types/Tax/CalculationsResource.d.ts +46 -0
  29. package/types/Tax/Registrations.d.ts +63 -0
  30. package/types/Tax/RegistrationsResource.d.ts +84 -0
  31. package/types/Tax/Transactions.d.ts +10 -1
  32. package/types/Treasury/FinancialAccounts.d.ts +1 -1
  33. package/types/Treasury/ReceivedCredits.d.ts +1 -1
  34. package/types/Treasury/TransactionEntries.d.ts +1 -1
  35. package/types/Treasury/Transactions.d.ts +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 15.5.0 - 2024-05-02
4
+ * [#2072](https://github.com/stripe/stripe-node/pull/2072) Update generated code
5
+ * Add support for new value `shipping_address_invalid` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
6
+ * Fix properties incorrectly marked as required in the OpenAPI spec.
7
+ * Change `Apps.Secret.payload`, `BillingPortal.Configuration.features.subscription_update.products`, `Charge.refunds`, `ConfirmationToken.payment_method_preview.klarna.dob`, `Identity.VerificationReport.document.dob`, `Identity.VerificationReport.document.expiration_date`, `Identity.VerificationReport.document.number`, `Identity.VerificationReport.id_number.dob`, `Identity.VerificationReport.id_number.id_number`, `Identity.VerificationSession.provided_details`, `Identity.VerificationSession.verified_outputs.dob`, `Identity.VerificationSession.verified_outputs.id_number`, `Identity.VerificationSession.verified_outputs`, `Issuing.Dispute.balance_transactions`, `Issuing.Transaction.purchase_details`, `PaymentMethod.klarna.dob`, `Tax.Calculation.line_items`, `Tax.CalculationLineItem.tax_breakdown`, `Tax.Transaction.line_items`, `Treasury.FinancialAccount.financial_addresses[].aba.account_number`, `Treasury.ReceivedCredit.linked_flows.source_flow_details`, `Treasury.Transaction.entries`, `Treasury.Transaction.flow_details`, and `Treasury.TransactionEntry.flow_details` to be optional
8
+ * Add support for `paypal` on `Dispute.payment_method_details`
9
+ * Change type of `Dispute.payment_method_details.type` from `literal('card')` to `enum('card'|'paypal')`
10
+ * Change type of `Entitlements.FeatureUpdateParams.metadata` from `map(string: string)` to `emptyable(map(string: string))`
11
+ * Add support for `payment_method_types` on `PaymentIntentConfirmParams`
12
+ * Add support for `ship_from_details` on `Tax.CalculationCreateParams`, `Tax.Calculation`, and `Tax.Transaction`
13
+ * Add support for `bh`, `eg`, `ge`, `ke`, `kz`, `ng`, and `om` on `Tax.Registration.country_options` and `Tax.RegistrationCreateParams.country_options`
14
+ * [#2077](https://github.com/stripe/stripe-node/pull/2077) Deprecate Node methods and params based on OpenAPI spec
15
+ - Mark as deprecated the `approve` and `decline` methods on `Issuing.Authorization`. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
16
+ - Mark as deprecated the `persistent_token` property on `ConfirmationToken.PaymentMethodPreview.Link`, `PaymentIntent.PaymentMethodOptions.Link`, `PaymentIntentResource.PaymentMethodOptions.Link`, `PaymentMethod.Link.persistent_token`. `SetupIntents.PaymentMethodOptions.Card.Link.persistent_token`, `SetupIntentsResource.persistent_token`. This is a legacy parameter that no longer has any function.
17
+ * [#2074](https://github.com/stripe/stripe-node/pull/2074) Add a more explicit comment on `limit` param in `autoPagingToArray`
18
+
3
19
  ## 15.4.0 - 2024-04-25
4
20
  * [#2071](https://github.com/stripe/stripe-node/pull/2071) Update generated code
5
21
  * Add support for `setup_future_usage` on `Checkout.Session.payment_method_options.amazon_pay`, `Checkout.Session.payment_method_options.revolut_pay`, `PaymentIntent.payment_method_options.amazon_pay`, and `PaymentIntent.payment_method_options.revolut_pay`
package/README.md CHANGED
@@ -467,14 +467,15 @@ stripe.customers
467
467
 
468
468
  This is a convenience for cases where you expect the number of items
469
469
  to be relatively small; accordingly, you must pass a `limit` option
470
- to prevent runaway list growth from consuming too much memory.
470
+ to prevent runaway list growth from consuming too much memory. Once the
471
+ `limit` number of items have been fetched, auto-pagination will stop.
471
472
 
472
473
  Returns a promise of an array of all items across pages for a list request.
473
474
 
474
475
  ```js
475
476
  const allNewCustomers = await stripe.customers
476
- .list({created: {gt: lastMonth}})
477
- .autoPagingToArray({limit: 10000});
477
+ .list({created: {gt: lastMonth}, limit: 100}) // 100 items per page
478
+ .autoPagingToArray({limit: 10000}); // Stop after 10000 items total
478
479
  ```
479
480
 
480
481
  ### Telemetry
package/VERSION CHANGED
@@ -1 +1 @@
1
- 15.4.0
1
+ 15.5.0
@@ -34,7 +34,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
34
34
  ];
35
35
  const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
36
36
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
37
- Stripe.PACKAGE_VERSION = '15.4.0';
37
+ Stripe.PACKAGE_VERSION = '15.5.0';
38
38
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
39
39
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
40
40
  Stripe.resources = resources;
@@ -31,7 +31,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
31
31
  ];
32
32
  const defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
33
33
  export function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
34
- Stripe.PACKAGE_VERSION = '15.4.0';
34
+ Stripe.PACKAGE_VERSION = '15.5.0';
35
35
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
36
36
  Stripe.StripeResource = StripeResource;
37
37
  Stripe.resources = resources;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "15.4.0",
3
+ "version": "15.5.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -53,7 +53,7 @@ declare module 'stripe' {
53
53
  /**
54
54
  * The plaintext secret value to be stored.
55
55
  */
56
- payload: string | null;
56
+ payload?: string | null;
57
57
 
58
58
  scope: Secret.Scope;
59
59
  }
@@ -203,7 +203,7 @@ declare module 'stripe' {
203
203
  /**
204
204
  * The list of up to 10 products that support subscription updates.
205
205
  */
206
- products: Array<SubscriptionUpdate.Product> | null;
206
+ products?: Array<SubscriptionUpdate.Product> | null;
207
207
 
208
208
  /**
209
209
  * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation.
@@ -191,7 +191,7 @@ declare module 'stripe' {
191
191
  /**
192
192
  * A list of refunds that have been applied to the charge.
193
193
  */
194
- refunds: ApiList<Stripe.Refund> | null;
194
+ refunds?: ApiList<Stripe.Refund> | null;
195
195
 
196
196
  /**
197
197
  * ID of the review associated with this charge if one exists.
@@ -1642,6 +1642,9 @@ declare module 'stripe' {
1642
1642
  }
1643
1643
 
1644
1644
  interface Mobilepay {
1645
+ /**
1646
+ * Internal card details
1647
+ */
1645
1648
  card: Mobilepay.Card | null;
1646
1649
  }
1647
1650
 
@@ -847,7 +847,7 @@ declare module 'stripe' {
847
847
  /**
848
848
  * The customer's date of birth, if provided.
849
849
  */
850
- dob: Klarna.Dob | null;
850
+ dob?: Klarna.Dob | null;
851
851
  }
852
852
 
853
853
  namespace Klarna {
@@ -879,6 +879,7 @@ declare module 'stripe' {
879
879
 
880
880
  /**
881
881
  * [Deprecated] This is a legacy parameter that no longer has any function.
882
+ * @deprecated
882
883
  */
883
884
  persistent_token?: string;
884
885
  }
@@ -250,10 +250,12 @@ declare module 'stripe' {
250
250
  interface PaymentMethodDetails {
251
251
  card?: PaymentMethodDetails.Card;
252
252
 
253
+ paypal?: PaymentMethodDetails.Paypal;
254
+
253
255
  /**
254
256
  * Payment method type.
255
257
  */
256
- type: 'card';
258
+ type: PaymentMethodDetails.Type;
257
259
  }
258
260
 
259
261
  namespace PaymentMethodDetails {
@@ -268,6 +270,20 @@ declare module 'stripe' {
268
270
  */
269
271
  network_reason_code: string | null;
270
272
  }
273
+
274
+ interface Paypal {
275
+ /**
276
+ * The ID of the dispute in PayPal.
277
+ */
278
+ case_id: string | null;
279
+
280
+ /**
281
+ * The reason for the dispute as defined by PayPal
282
+ */
283
+ reason_code: string | null;
284
+ }
285
+
286
+ type Type = 'card' | 'paypal';
271
287
  }
272
288
 
273
289
  type Status =
@@ -46,7 +46,7 @@ declare module 'stripe' {
46
46
  /**
47
47
  * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
48
48
  */
49
- metadata?: Stripe.MetadataParam;
49
+ metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
50
50
 
51
51
  /**
52
52
  * The feature's name, for your own purpose, not meant to be displayable to the customer.
@@ -95,7 +95,7 @@ declare module 'stripe' {
95
95
  /**
96
96
  * Date of birth as it appears in the document.
97
97
  */
98
- dob: Document.Dob | null;
98
+ dob?: Document.Dob | null;
99
99
 
100
100
  /**
101
101
  * Details on the verification error. Present when status is `unverified`.
@@ -105,7 +105,7 @@ declare module 'stripe' {
105
105
  /**
106
106
  * Expiration date of the document.
107
107
  */
108
- expiration_date: Document.ExpirationDate | null;
108
+ expiration_date?: Document.ExpirationDate | null;
109
109
 
110
110
  /**
111
111
  * Array of [File](https://stripe.com/docs/api/files) ids containing images for this document.
@@ -135,7 +135,7 @@ declare module 'stripe' {
135
135
  /**
136
136
  * Document ID number.
137
137
  */
138
- number: string | null;
138
+ number?: string | null;
139
139
 
140
140
  /**
141
141
  * Status of this `document` check.
@@ -267,7 +267,7 @@ declare module 'stripe' {
267
267
  /**
268
268
  * Date of birth.
269
269
  */
270
- dob: IdNumber.Dob | null;
270
+ dob?: IdNumber.Dob | null;
271
271
 
272
272
  /**
273
273
  * Details on the verification error. Present when status is `unverified`.
@@ -282,7 +282,7 @@ declare module 'stripe' {
282
282
  /**
283
283
  * ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present.
284
284
  */
285
- id_number: string | null;
285
+ id_number?: string | null;
286
286
 
287
287
  /**
288
288
  * Type of ID number.
@@ -73,7 +73,7 @@ declare module 'stripe' {
73
73
  /**
74
74
  * Details provided about the user being verified. These details may be shown to the user.
75
75
  */
76
- provided_details: VerificationSession.ProvidedDetails | null;
76
+ provided_details?: VerificationSession.ProvidedDetails | null;
77
77
 
78
78
  /**
79
79
  * Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
@@ -103,7 +103,7 @@ declare module 'stripe' {
103
103
  /**
104
104
  * The user's verified data.
105
105
  */
106
- verified_outputs: VerificationSession.VerifiedOutputs | null;
106
+ verified_outputs?: VerificationSession.VerifiedOutputs | null;
107
107
  }
108
108
 
109
109
  namespace VerificationSession {
@@ -232,7 +232,7 @@ declare module 'stripe' {
232
232
  /**
233
233
  * The user's verified date of birth.
234
234
  */
235
- dob: VerifiedOutputs.Dob | null;
235
+ dob?: VerifiedOutputs.Dob | null;
236
236
 
237
237
  /**
238
238
  * The user's verified email address
@@ -247,7 +247,7 @@ declare module 'stripe' {
247
247
  /**
248
248
  * The user's verified id number.
249
249
  */
250
- id_number: string | null;
250
+ id_number?: string | null;
251
251
 
252
252
  /**
253
253
  * The user's verified id number type.
@@ -343,12 +343,12 @@ declare module 'stripe' {
343
343
  payment_settings: Invoice.PaymentSettings;
344
344
 
345
345
  /**
346
- * End of the usage period during which invoice items were added to this invoice.
346
+ * 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](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
347
347
  */
348
348
  period_end: number;
349
349
 
350
350
  /**
351
- * Start of the usage period during which invoice items were added to this invoice.
351
+ * 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](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
352
352
  */
353
353
  period_start: number;
354
354
 
@@ -928,6 +928,7 @@ declare module 'stripe' {
928
928
  | 'setup_intent_mandate_invalid'
929
929
  | 'setup_intent_setup_attempt_expired'
930
930
  | 'setup_intent_unexpected_state'
931
+ | 'shipping_address_invalid'
931
932
  | 'shipping_calculation_failed'
932
933
  | 'sku_inactive'
933
934
  | 'state_unsupported'
@@ -5498,6 +5498,8 @@ declare module 'stripe' {
5498
5498
  * 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.
5499
5499
  *
5500
5500
  * 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.
5501
+ *
5502
+ * 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)
5501
5503
  */
5502
5504
  createPreview(
5503
5505
  params?: InvoiceCreatePreviewParams,
@@ -5576,6 +5578,8 @@ declare module 'stripe' {
5576
5578
  * 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.
5577
5579
  *
5578
5580
  * 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.
5581
+ *
5582
+ * 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)
5579
5583
  */
5580
5584
  retrieveUpcoming(
5581
5585
  params?: InvoiceRetrieveUpcomingParams,
@@ -119,6 +119,7 @@ declare module 'stripe' {
119
119
  /**
120
120
  * [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
121
121
  * This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
122
+ * @deprecated This method is deprecated, please refer to the description for details.
122
123
  */
123
124
  approve(
124
125
  id: string,
@@ -133,6 +134,7 @@ declare module 'stripe' {
133
134
  /**
134
135
  * [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
135
136
  * This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
137
+ * @deprecated This method is deprecated, please refer to the description for details.
136
138
  */
137
139
  decline(
138
140
  id: string,
@@ -27,7 +27,7 @@ declare module 'stripe' {
27
27
  /**
28
28
  * List of balance transactions associated with the dispute.
29
29
  */
30
- balance_transactions: Array<Stripe.BalanceTransaction> | null;
30
+ balance_transactions?: Array<Stripe.BalanceTransaction> | null;
31
31
 
32
32
  /**
33
33
  * Time at which the object was created. Measured in seconds since the Unix epoch.
@@ -96,7 +96,7 @@ declare module 'stripe' {
96
96
  /**
97
97
  * Additional purchase information that is optionally provided by the merchant.
98
98
  */
99
- purchase_details: Transaction.PurchaseDetails | null;
99
+ purchase_details?: Transaction.PurchaseDetails | null;
100
100
 
101
101
  /**
102
102
  * [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.
@@ -526,6 +526,7 @@ declare module 'stripe' {
526
526
  | 'setup_intent_mandate_invalid'
527
527
  | 'setup_intent_setup_attempt_expired'
528
528
  | 'setup_intent_unexpected_state'
529
+ | 'shipping_address_invalid'
529
530
  | 'shipping_calculation_failed'
530
531
  | 'sku_inactive'
531
532
  | 'state_unsupported'
@@ -1964,6 +1965,7 @@ declare module 'stripe' {
1964
1965
 
1965
1966
  /**
1966
1967
  * [Deprecated] This is a legacy parameter that no longer has any function.
1968
+ * @deprecated
1967
1969
  */
1968
1970
  persistent_token: string | null;
1969
1971
 
@@ -1889,6 +1889,7 @@ declare module 'stripe' {
1889
1889
 
1890
1890
  /**
1891
1891
  * [Deprecated] This is a legacy parameter that no longer has any function.
1892
+ * @deprecated
1892
1893
  */
1893
1894
  persistent_token?: string;
1894
1895
 
@@ -4131,6 +4132,7 @@ declare module 'stripe' {
4131
4132
 
4132
4133
  /**
4133
4134
  * [Deprecated] This is a legacy parameter that no longer has any function.
4135
+ * @deprecated
4134
4136
  */
4135
4137
  persistent_token?: string;
4136
4138
 
@@ -4752,6 +4754,11 @@ declare module 'stripe' {
4752
4754
  */
4753
4755
  payment_method_options?: PaymentIntentConfirmParams.PaymentMethodOptions;
4754
4756
 
4757
+ /**
4758
+ * The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
4759
+ */
4760
+ payment_method_types?: Array<string>;
4761
+
4755
4762
  /**
4756
4763
  * Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
4757
4764
  */
@@ -6518,6 +6525,7 @@ declare module 'stripe' {
6518
6525
 
6519
6526
  /**
6520
6527
  * [Deprecated] This is a legacy parameter that no longer has any function.
6528
+ * @deprecated
6521
6529
  */
6522
6530
  persistent_token?: string;
6523
6531
 
@@ -775,7 +775,7 @@ declare module 'stripe' {
775
775
  /**
776
776
  * The customer's date of birth, if provided.
777
777
  */
778
- dob: Klarna.Dob | null;
778
+ dob?: Klarna.Dob | null;
779
779
  }
780
780
 
781
781
  namespace Klarna {
@@ -807,6 +807,7 @@ declare module 'stripe' {
807
807
 
808
808
  /**
809
809
  * [Deprecated] This is a legacy parameter that no longer has any function.
810
+ * @deprecated
810
811
  */
811
812
  persistent_token?: string;
812
813
  }
@@ -769,6 +769,7 @@ declare module 'stripe' {
769
769
  | 'setup_intent_mandate_invalid'
770
770
  | 'setup_intent_setup_attempt_expired'
771
771
  | 'setup_intent_unexpected_state'
772
+ | 'shipping_address_invalid'
772
773
  | 'shipping_calculation_failed'
773
774
  | 'sku_inactive'
774
775
  | 'state_unsupported'
@@ -439,6 +439,7 @@ declare module 'stripe' {
439
439
  | 'setup_intent_mandate_invalid'
440
440
  | 'setup_intent_setup_attempt_expired'
441
441
  | 'setup_intent_unexpected_state'
442
+ | 'shipping_address_invalid'
442
443
  | 'shipping_calculation_failed'
443
444
  | 'sku_inactive'
444
445
  | 'state_unsupported'
@@ -740,6 +741,7 @@ declare module 'stripe' {
740
741
  interface Link {
741
742
  /**
742
743
  * [Deprecated] This is a legacy parameter that no longer has any function.
744
+ * @deprecated
743
745
  */
744
746
  persistent_token: string | null;
745
747
  }
@@ -1072,6 +1072,7 @@ declare module 'stripe' {
1072
1072
  interface Link {
1073
1073
  /**
1074
1074
  * [Deprecated] This is a legacy parameter that no longer has any function.
1075
+ * @deprecated
1075
1076
  */
1076
1077
  persistent_token?: string;
1077
1078
  }
@@ -2149,6 +2150,7 @@ declare module 'stripe' {
2149
2150
  interface Link {
2150
2151
  /**
2151
2152
  * [Deprecated] This is a legacy parameter that no longer has any function.
2153
+ * @deprecated
2152
2154
  */
2153
2155
  persistent_token?: string;
2154
2156
  }
@@ -3313,6 +3315,7 @@ declare module 'stripe' {
3313
3315
  interface Link {
3314
3316
  /**
3315
3317
  * [Deprecated] This is a legacy parameter that no longer has any function.
3318
+ * @deprecated
3316
3319
  */
3317
3320
  persistent_token?: string;
3318
3321
  }
@@ -55,7 +55,7 @@ declare module 'stripe' {
55
55
  /**
56
56
  * Detailed account of taxes relevant to this line item.
57
57
  */
58
- tax_breakdown: Array<CalculationLineItem.TaxBreakdown> | null;
58
+ tax_breakdown?: Array<CalculationLineItem.TaxBreakdown> | null;
59
59
 
60
60
  /**
61
61
  * The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource.
@@ -44,13 +44,18 @@ declare module 'stripe' {
44
44
  /**
45
45
  * The list of items the customer is purchasing.
46
46
  */
47
- line_items: ApiList<Stripe.Tax.CalculationLineItem> | null;
47
+ line_items?: ApiList<Stripe.Tax.CalculationLineItem> | null;
48
48
 
49
49
  /**
50
50
  * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
51
51
  */
52
52
  livemode: boolean;
53
53
 
54
+ /**
55
+ * The details of the ship from location, such as the address.
56
+ */
57
+ ship_from_details: Calculation.ShipFromDetails | null;
58
+
54
59
  /**
55
60
  * The shipping cost details for the calculation.
56
61
  */
@@ -202,6 +207,10 @@ declare module 'stripe' {
202
207
  }
203
208
  }
204
209
 
210
+ interface ShipFromDetails {
211
+ address: Stripe.Address;
212
+ }
213
+
205
214
  interface ShippingCost {
206
215
  /**
207
216
  * The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
@@ -29,6 +29,11 @@ declare module 'stripe' {
29
29
  */
30
30
  expand?: Array<string>;
31
31
 
32
+ /**
33
+ * Details about the address from which the goods are being shipped.
34
+ */
35
+ ship_from_details?: CalculationCreateParams.ShipFromDetails;
36
+
32
37
  /**
33
38
  * Shipping cost details to be used for the calculation.
34
39
  */
@@ -235,6 +240,47 @@ declare module 'stripe' {
235
240
  type TaxBehavior = 'exclusive' | 'inclusive';
236
241
  }
237
242
 
243
+ interface ShipFromDetails {
244
+ /**
245
+ * The address from which the goods are being shipped from.
246
+ */
247
+ address: ShipFromDetails.Address;
248
+ }
249
+
250
+ namespace ShipFromDetails {
251
+ interface Address {
252
+ /**
253
+ * City, district, suburb, town, or village.
254
+ */
255
+ city?: Stripe.Emptyable<string>;
256
+
257
+ /**
258
+ * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
259
+ */
260
+ country: string;
261
+
262
+ /**
263
+ * Address line 1 (e.g., street, PO Box, or company name).
264
+ */
265
+ line1?: Stripe.Emptyable<string>;
266
+
267
+ /**
268
+ * Address line 2 (e.g., apartment, suite, unit, or building).
269
+ */
270
+ line2?: Stripe.Emptyable<string>;
271
+
272
+ /**
273
+ * ZIP or postal code.
274
+ */
275
+ postal_code?: Stripe.Emptyable<string>;
276
+
277
+ /**
278
+ * State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX".
279
+ */
280
+ state?: Stripe.Emptyable<string>;
281
+ }
282
+ }
283
+
238
284
  interface ShippingCost {
239
285
  /**
240
286
  * A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
@@ -66,6 +66,8 @@ declare module 'stripe' {
66
66
 
67
67
  bg?: CountryOptions.Bg;
68
68
 
69
+ bh?: CountryOptions.Bh;
70
+
69
71
  ca?: CountryOptions.Ca;
70
72
 
71
73
  ch?: CountryOptions.Ch;
@@ -84,6 +86,8 @@ declare module 'stripe' {
84
86
 
85
87
  ee?: CountryOptions.Ee;
86
88
 
89
+ eg?: CountryOptions.Eg;
90
+
87
91
  es?: CountryOptions.Es;
88
92
 
89
93
  fi?: CountryOptions.Fi;
@@ -92,6 +96,8 @@ declare module 'stripe' {
92
96
 
93
97
  gb?: CountryOptions.Gb;
94
98
 
99
+ ge?: CountryOptions.Ge;
100
+
95
101
  gr?: CountryOptions.Gr;
96
102
 
97
103
  hr?: CountryOptions.Hr;
@@ -108,8 +114,12 @@ declare module 'stripe' {
108
114
 
109
115
  jp?: CountryOptions.Jp;
110
116
 
117
+ ke?: CountryOptions.Ke;
118
+
111
119
  kr?: CountryOptions.Kr;
112
120
 
121
+ kz?: CountryOptions.Kz;
122
+
113
123
  lt?: CountryOptions.Lt;
114
124
 
115
125
  lu?: CountryOptions.Lu;
@@ -122,12 +132,16 @@ declare module 'stripe' {
122
132
 
123
133
  my?: CountryOptions.My;
124
134
 
135
+ ng?: CountryOptions.Ng;
136
+
125
137
  nl?: CountryOptions.Nl;
126
138
 
127
139
  no?: CountryOptions.No;
128
140
 
129
141
  nz?: CountryOptions.Nz;
130
142
 
143
+ om?: CountryOptions.Om;
144
+
131
145
  pl?: CountryOptions.Pl;
132
146
 
133
147
  pt?: CountryOptions.Pt;
@@ -242,6 +256,13 @@ declare module 'stripe' {
242
256
  type Type = 'ioss' | 'oss_non_union' | 'oss_union' | 'standard';
243
257
  }
244
258
 
259
+ interface Bh {
260
+ /**
261
+ * Type of registration in `country`.
262
+ */
263
+ type: 'standard';
264
+ }
265
+
245
266
  interface Ca {
246
267
  province_standard?: Ca.ProvinceStandard;
247
268
 
@@ -403,6 +424,13 @@ declare module 'stripe' {
403
424
  type Type = 'ioss' | 'oss_non_union' | 'oss_union' | 'standard';
404
425
  }
405
426
 
427
+ interface Eg {
428
+ /**
429
+ * Type of registration in `country`.
430
+ */
431
+ type: 'simplified';
432
+ }
433
+
406
434
  interface Es {
407
435
  standard?: Es.Standard;
408
436
 
@@ -482,6 +510,13 @@ declare module 'stripe' {
482
510
  type: 'standard';
483
511
  }
484
512
 
513
+ interface Ge {
514
+ /**
515
+ * Type of registration in `country`.
516
+ */
517
+ type: 'simplified';
518
+ }
519
+
485
520
  interface Gr {
486
521
  standard?: Gr.Standard;
487
522
 
@@ -623,6 +658,13 @@ declare module 'stripe' {
623
658
  type: 'standard';
624
659
  }
625
660
 
661
+ interface Ke {
662
+ /**
663
+ * Type of registration in `country`.
664
+ */
665
+ type: 'simplified';
666
+ }
667
+
626
668
  interface Kr {
627
669
  /**
628
670
  * Type of registration in `country`.
@@ -630,6 +672,13 @@ declare module 'stripe' {
630
672
  type: 'simplified';
631
673
  }
632
674
 
675
+ interface Kz {
676
+ /**
677
+ * Type of registration in `country`.
678
+ */
679
+ type: 'simplified';
680
+ }
681
+
633
682
  interface Lt {
634
683
  standard?: Lt.Standard;
635
684
 
@@ -740,6 +789,13 @@ declare module 'stripe' {
740
789
  type: 'simplified';
741
790
  }
742
791
 
792
+ interface Ng {
793
+ /**
794
+ * Type of registration in `country`.
795
+ */
796
+ type: 'simplified';
797
+ }
798
+
743
799
  interface Nl {
744
800
  standard?: Nl.Standard;
745
801
 
@@ -778,6 +834,13 @@ declare module 'stripe' {
778
834
  type: 'standard';
779
835
  }
780
836
 
837
+ interface Om {
838
+ /**
839
+ * Type of registration in `country`.
840
+ */
841
+ type: 'standard';
842
+ }
843
+
781
844
  interface Pl {
782
845
  standard?: Pl.Standard;
783
846
 
@@ -57,6 +57,11 @@ declare module 'stripe' {
57
57
  */
58
58
  bg?: CountryOptions.Bg;
59
59
 
60
+ /**
61
+ * Options for the registration in BH.
62
+ */
63
+ bh?: CountryOptions.Bh;
64
+
60
65
  /**
61
66
  * Options for the registration in CA.
62
67
  */
@@ -102,6 +107,11 @@ declare module 'stripe' {
102
107
  */
103
108
  ee?: CountryOptions.Ee;
104
109
 
110
+ /**
111
+ * Options for the registration in EG.
112
+ */
113
+ eg?: CountryOptions.Eg;
114
+
105
115
  /**
106
116
  * Options for the registration in ES.
107
117
  */
@@ -122,6 +132,11 @@ declare module 'stripe' {
122
132
  */
123
133
  gb?: CountryOptions.Gb;
124
134
 
135
+ /**
136
+ * Options for the registration in GE.
137
+ */
138
+ ge?: CountryOptions.Ge;
139
+
125
140
  /**
126
141
  * Options for the registration in GR.
127
142
  */
@@ -162,11 +177,21 @@ declare module 'stripe' {
162
177
  */
163
178
  jp?: CountryOptions.Jp;
164
179
 
180
+ /**
181
+ * Options for the registration in KE.
182
+ */
183
+ ke?: CountryOptions.Ke;
184
+
165
185
  /**
166
186
  * Options for the registration in KR.
167
187
  */
168
188
  kr?: CountryOptions.Kr;
169
189
 
190
+ /**
191
+ * Options for the registration in KZ.
192
+ */
193
+ kz?: CountryOptions.Kz;
194
+
170
195
  /**
171
196
  * Options for the registration in LT.
172
197
  */
@@ -197,6 +222,11 @@ declare module 'stripe' {
197
222
  */
198
223
  my?: CountryOptions.My;
199
224
 
225
+ /**
226
+ * Options for the registration in NG.
227
+ */
228
+ ng?: CountryOptions.Ng;
229
+
200
230
  /**
201
231
  * Options for the registration in NL.
202
232
  */
@@ -212,6 +242,11 @@ declare module 'stripe' {
212
242
  */
213
243
  nz?: CountryOptions.Nz;
214
244
 
245
+ /**
246
+ * Options for the registration in OM.
247
+ */
248
+ om?: CountryOptions.Om;
249
+
215
250
  /**
216
251
  * Options for the registration in PL.
217
252
  */
@@ -374,6 +409,13 @@ declare module 'stripe' {
374
409
  type Type = 'ioss' | 'oss_non_union' | 'oss_union' | 'standard';
375
410
  }
376
411
 
412
+ interface Bh {
413
+ /**
414
+ * Type of registration to be created in `country`.
415
+ */
416
+ type: 'standard';
417
+ }
418
+
377
419
  interface Ca {
378
420
  /**
379
421
  * Options for the provincial tax registration.
@@ -553,6 +595,13 @@ declare module 'stripe' {
553
595
  type Type = 'ioss' | 'oss_non_union' | 'oss_union' | 'standard';
554
596
  }
555
597
 
598
+ interface Eg {
599
+ /**
600
+ * Type of registration to be created in `country`.
601
+ */
602
+ type: 'simplified';
603
+ }
604
+
556
605
  interface Es {
557
606
  /**
558
607
  * Options for the standard registration.
@@ -641,6 +690,13 @@ declare module 'stripe' {
641
690
  type: 'standard';
642
691
  }
643
692
 
693
+ interface Ge {
694
+ /**
695
+ * Type of registration to be created in `country`.
696
+ */
697
+ type: 'simplified';
698
+ }
699
+
644
700
  interface Gr {
645
701
  /**
646
702
  * Options for the standard registration.
@@ -797,6 +853,13 @@ declare module 'stripe' {
797
853
  type: 'standard';
798
854
  }
799
855
 
856
+ interface Ke {
857
+ /**
858
+ * Type of registration to be created in `country`.
859
+ */
860
+ type: 'simplified';
861
+ }
862
+
800
863
  interface Kr {
801
864
  /**
802
865
  * Type of registration to be created in `country`.
@@ -804,6 +867,13 @@ declare module 'stripe' {
804
867
  type: 'simplified';
805
868
  }
806
869
 
870
+ interface Kz {
871
+ /**
872
+ * Type of registration to be created in `country`.
873
+ */
874
+ type: 'simplified';
875
+ }
876
+
807
877
  interface Lt {
808
878
  /**
809
879
  * Options for the standard registration.
@@ -926,6 +996,13 @@ declare module 'stripe' {
926
996
  type: 'simplified';
927
997
  }
928
998
 
999
+ interface Ng {
1000
+ /**
1001
+ * Type of registration to be created in `country`.
1002
+ */
1003
+ type: 'simplified';
1004
+ }
1005
+
929
1006
  interface Nl {
930
1007
  /**
931
1008
  * Options for the standard registration.
@@ -967,6 +1044,13 @@ declare module 'stripe' {
967
1044
  type: 'standard';
968
1045
  }
969
1046
 
1047
+ interface Om {
1048
+ /**
1049
+ * Type of registration to be created in `country`.
1050
+ */
1051
+ type: 'standard';
1052
+ }
1053
+
970
1054
  interface Pl {
971
1055
  /**
972
1056
  * Options for the standard registration.
@@ -39,7 +39,7 @@ declare module 'stripe' {
39
39
  /**
40
40
  * The tax collected or refunded, by line item.
41
41
  */
42
- line_items: ApiList<Stripe.Tax.TransactionLineItem> | null;
42
+ line_items?: ApiList<Stripe.Tax.TransactionLineItem> | null;
43
43
 
44
44
  /**
45
45
  * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
@@ -61,6 +61,11 @@ declare module 'stripe' {
61
61
  */
62
62
  reversal: Transaction.Reversal | null;
63
63
 
64
+ /**
65
+ * The details of the ship from location, such as the address.
66
+ */
67
+ ship_from_details: Transaction.ShipFromDetails | null;
68
+
64
69
  /**
65
70
  * The shipping cost details for the transaction.
66
71
  */
@@ -209,6 +214,10 @@ declare module 'stripe' {
209
214
  original_transaction: string | null;
210
215
  }
211
216
 
217
+ interface ShipFromDetails {
218
+ address: Stripe.Address;
219
+ }
220
+
212
221
  interface ShippingCost {
213
222
  /**
214
223
  * The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
@@ -150,7 +150,7 @@ declare module 'stripe' {
150
150
  /**
151
151
  * The account number.
152
152
  */
153
- account_number: string | null;
153
+ account_number?: string | null;
154
154
 
155
155
  /**
156
156
  * The last four characters of the account number.
@@ -184,7 +184,7 @@ declare module 'stripe' {
184
184
  /**
185
185
  * The expandable object of the source flow.
186
186
  */
187
- source_flow_details: LinkedFlows.SourceFlowDetails | null;
187
+ source_flow_details?: LinkedFlows.SourceFlowDetails | null;
188
188
 
189
189
  /**
190
190
  * The type of flow that originated the ReceivedCredit (for example, `outbound_payment`).
@@ -50,7 +50,7 @@ declare module 'stripe' {
50
50
  /**
51
51
  * Details of the flow associated with the TransactionEntry.
52
52
  */
53
- flow_details: TransactionEntry.FlowDetails | null;
53
+ flow_details?: TransactionEntry.FlowDetails | null;
54
54
 
55
55
  /**
56
56
  * Type of the flow associated with the TransactionEntry.
@@ -45,7 +45,7 @@ declare module 'stripe' {
45
45
  /**
46
46
  * A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints.
47
47
  */
48
- entries: ApiList<Stripe.Treasury.TransactionEntry> | null;
48
+ entries?: ApiList<Stripe.Treasury.TransactionEntry> | null;
49
49
 
50
50
  /**
51
51
  * The FinancialAccount associated with this object.
@@ -60,7 +60,7 @@ declare module 'stripe' {
60
60
  /**
61
61
  * Details of the flow that created the Transaction.
62
62
  */
63
- flow_details: Transaction.FlowDetails | null;
63
+ flow_details?: Transaction.FlowDetails | null;
64
64
 
65
65
  /**
66
66
  * Type of the flow that created the Transaction.