stripe 16.0.0 → 16.2.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 (154) hide show
  1. package/CHANGELOG.md +761 -109
  2. package/README.md +33 -0
  3. package/VERSION +1 -1
  4. package/cjs/RequestSender.js +66 -5
  5. package/cjs/StripeResource.js +1 -1
  6. package/cjs/apiVersion.js +2 -1
  7. package/cjs/multipart.js +1 -1
  8. package/cjs/resources/AccountNotices.js +21 -0
  9. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  10. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  11. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  12. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  13. package/cjs/resources/GiftCards/Cards.js +23 -0
  14. package/cjs/resources/GiftCards/Transactions.js +33 -0
  15. package/cjs/resources/Invoices.js +25 -0
  16. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  17. package/cjs/resources/Margins.js +22 -0
  18. package/cjs/resources/OAuth.js +1 -1
  19. package/cjs/resources/Orders.js +24 -0
  20. package/cjs/resources/PaymentIntents.js +4 -0
  21. package/cjs/resources/QuotePhases.js +22 -0
  22. package/cjs/resources/Quotes.js +32 -0
  23. package/cjs/resources/SubscriptionSchedules.js +4 -0
  24. package/cjs/resources/Tax/Forms.js +20 -0
  25. package/cjs/resources/Terminal/Readers.js +12 -0
  26. package/cjs/resources.js +36 -10
  27. package/cjs/stripe.core.js +6 -3
  28. package/cjs/utils.js +30 -3
  29. package/esm/RequestSender.js +67 -6
  30. package/esm/StripeResource.js +2 -2
  31. package/esm/apiVersion.js +1 -0
  32. package/esm/multipart.js +2 -2
  33. package/esm/resources/AccountNotices.js +18 -0
  34. package/esm/resources/Capital/FinancingOffers.js +18 -0
  35. package/esm/resources/Capital/FinancingSummary.js +9 -0
  36. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  37. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  38. package/esm/resources/GiftCards/Cards.js +20 -0
  39. package/esm/resources/GiftCards/Transactions.js +30 -0
  40. package/esm/resources/Invoices.js +25 -0
  41. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  42. package/esm/resources/Margins.js +19 -0
  43. package/esm/resources/OAuth.js +2 -2
  44. package/esm/resources/Orders.js +21 -0
  45. package/esm/resources/PaymentIntents.js +4 -0
  46. package/esm/resources/QuotePhases.js +19 -0
  47. package/esm/resources/Quotes.js +32 -0
  48. package/esm/resources/SubscriptionSchedules.js +4 -0
  49. package/esm/resources/Tax/Forms.js +17 -0
  50. package/esm/resources/Terminal/Readers.js +12 -0
  51. package/esm/resources.js +22 -0
  52. package/esm/stripe.core.js +6 -3
  53. package/esm/utils.js +27 -1
  54. package/package.json +1 -1
  55. package/types/AccountLinksResource.d.ts +5 -1
  56. package/types/AccountNotices.d.ts +110 -0
  57. package/types/AccountNoticesResource.d.ts +98 -0
  58. package/types/AccountSessions.d.ts +15 -0
  59. package/types/AccountSessionsResource.d.ts +205 -0
  60. package/types/Accounts.d.ts +88 -1
  61. package/types/AccountsResource.d.ts +204 -0
  62. package/types/Billing/MetersResource.d.ts +6 -2
  63. package/types/Capabilities.d.ts +1 -1
  64. package/types/Capital/FinancingOffers.d.ts +188 -0
  65. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  66. package/types/Capital/FinancingSummary.d.ts +106 -0
  67. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  68. package/types/Capital/FinancingTransactions.d.ts +135 -0
  69. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  70. package/types/Charges.d.ts +67 -0
  71. package/types/ChargesResource.d.ts +1294 -0
  72. package/types/Checkout/Sessions.d.ts +36 -1
  73. package/types/Checkout/SessionsResource.d.ts +15 -1
  74. package/types/ConfirmationTokens.d.ts +83 -0
  75. package/types/Coupons.d.ts +1 -1
  76. package/types/CouponsResource.d.ts +1 -1
  77. package/types/CreditNotes.d.ts +21 -0
  78. package/types/CreditNotesResource.d.ts +72 -0
  79. package/types/CustomerSessions.d.ts +48 -0
  80. package/types/CustomerSessionsResource.d.ts +48 -0
  81. package/types/CustomersResource.d.ts +2 -0
  82. package/types/Disputes.d.ts +167 -0
  83. package/types/DisputesResource.d.ts +120 -0
  84. package/types/EventTypes.d.ts +426 -0
  85. package/types/Events.d.ts +83 -0
  86. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  87. package/types/FinancialConnections/Accounts.d.ts +29 -1
  88. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  89. package/types/FinancialConnections/Sessions.d.ts +58 -1
  90. package/types/FinancialConnections/SessionsResource.d.ts +47 -1
  91. package/types/GiftCards/Cards.d.ts +118 -0
  92. package/types/GiftCards/CardsResource.d.ts +159 -0
  93. package/types/GiftCards/Transactions.d.ts +129 -0
  94. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  95. package/types/InvoiceItems.d.ts +5 -0
  96. package/types/InvoiceItemsResource.d.ts +98 -0
  97. package/types/InvoiceLineItems.d.ts +22 -0
  98. package/types/InvoicePayments.d.ts +91 -0
  99. package/types/Invoices.d.ts +123 -1
  100. package/types/InvoicesResource.d.ts +6477 -2302
  101. package/types/Issuing/CardholdersResource.d.ts +2 -1
  102. package/types/Issuing/Cards.d.ts +34 -0
  103. package/types/Issuing/CardsResource.d.ts +125 -0
  104. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  105. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  106. package/types/LineItems.d.ts +7 -0
  107. package/types/Mandates.d.ts +77 -0
  108. package/types/Margins.d.ts +56 -0
  109. package/types/MarginsResource.d.ts +114 -0
  110. package/types/Orders.d.ts +1057 -0
  111. package/types/OrdersResource.d.ts +2711 -0
  112. package/types/PaymentIntents.d.ts +476 -1
  113. package/types/PaymentIntentsResource.d.ts +6735 -3354
  114. package/types/PaymentLinks.d.ts +4 -1
  115. package/types/PaymentLinksResource.d.ts +8 -2
  116. package/types/PaymentMethods.d.ts +62 -0
  117. package/types/PaymentMethodsResource.d.ts +110 -0
  118. package/types/Prices.d.ts +22 -0
  119. package/types/PricesResource.d.ts +22 -0
  120. package/types/Products.d.ts +39 -0
  121. package/types/ProductsResource.d.ts +36 -0
  122. package/types/QuoteLines.d.ts +634 -0
  123. package/types/QuotePhases.d.ts +198 -0
  124. package/types/QuotePhasesResource.d.ts +67 -0
  125. package/types/QuotePreviewInvoices.d.ts +1528 -0
  126. package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
  127. package/types/Quotes.d.ts +578 -1
  128. package/types/QuotesResource.d.ts +3174 -265
  129. package/types/SetupAttempts.d.ts +8 -0
  130. package/types/SetupIntents.d.ts +117 -1
  131. package/types/SetupIntentsResource.d.ts +531 -3
  132. package/types/Sources.d.ts +23 -0
  133. package/types/SubscriptionItems.d.ts +21 -0
  134. package/types/SubscriptionItemsResource.d.ts +109 -0
  135. package/types/SubscriptionSchedules.d.ts +164 -0
  136. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  137. package/types/Subscriptions.d.ts +54 -1
  138. package/types/SubscriptionsResource.d.ts +369 -2
  139. package/types/Tax/Forms.d.ts +133 -0
  140. package/types/Tax/FormsResource.d.ts +90 -0
  141. package/types/Terminal/Configurations.d.ts +14 -0
  142. package/types/Terminal/ConfigurationsResource.d.ts +36 -0
  143. package/types/Terminal/Readers.d.ts +278 -0
  144. package/types/Terminal/ReadersResource.d.ts +208 -0
  145. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  146. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  147. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  148. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  149. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  150. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  151. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  152. package/types/WebhookEndpointsResource.d.ts +50 -0
  153. package/types/index.d.ts +61 -0
  154. package/types/lib.d.ts +12 -0
@@ -0,0 +1,91 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ /**
6
+ * The invoice payment object
7
+ */
8
+ interface InvoicePayment {
9
+ /**
10
+ * Unique identifier for the object.
11
+ */
12
+ id: string;
13
+
14
+ /**
15
+ * String representing the object's type. Objects of the same type share the same value.
16
+ */
17
+ object: 'invoice_payment';
18
+
19
+ /**
20
+ * Excess payment that was received for this invoice and credited to the customer's `invoice_credit_balance`. This field is null until the payment is `paid`. Overpayment can happen when you attach more than one PaymentIntent to the invoice, and each of them succeeds. To avoid overpayment, cancel any PaymentIntents that you do not need before attaching more.
21
+ */
22
+ amount_overpaid: number | null;
23
+
24
+ /**
25
+ * Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent's `amount_received` is not sufficient to pay all of the invoices that it is attached to.
26
+ */
27
+ amount_paid: number | null;
28
+
29
+ /**
30
+ * Amount intended to be paid toward this invoice, in cents (or local equivalent)
31
+ */
32
+ amount_requested: number;
33
+
34
+ /**
35
+ * ID of the successful charge for this payment. This field is null when the payment is `open` or `canceled`.
36
+ */
37
+ charge: string | Stripe.Charge | null;
38
+
39
+ /**
40
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
41
+ */
42
+ created: number;
43
+
44
+ /**
45
+ * 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).
46
+ */
47
+ currency: string;
48
+
49
+ /**
50
+ * The invoice that was paid.
51
+ */
52
+ invoice: string | Stripe.Invoice | Stripe.DeletedInvoice;
53
+
54
+ /**
55
+ * Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice's `amount_remaining`. The PaymentIntent associated with the default payment can't be edited or canceled directly.
56
+ */
57
+ is_default: boolean | null;
58
+
59
+ /**
60
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
61
+ */
62
+ livemode: boolean;
63
+
64
+ /**
65
+ * ID of the PaymentIntent associated with this payment. Note: This property is only populated for invoices finalized on or after March 15th, 2019.
66
+ */
67
+ payment_intent: string | Stripe.PaymentIntent | null;
68
+
69
+ /**
70
+ * The status of the payment, one of `open`, `paid`, or `canceled`.
71
+ */
72
+ status: string;
73
+
74
+ status_transitions: InvoicePayment.StatusTransitions;
75
+ }
76
+
77
+ namespace InvoicePayment {
78
+ interface StatusTransitions {
79
+ /**
80
+ * The time that the payment was canceled.
81
+ */
82
+ canceled_at: number | null;
83
+
84
+ /**
85
+ * The time that the payment succeeded.
86
+ */
87
+ paid_at: number | null;
88
+ }
89
+ }
90
+ }
91
+ }
@@ -104,6 +104,11 @@ declare module 'stripe' {
104
104
  */
105
105
  amount_shipping: number;
106
106
 
107
+ /**
108
+ * List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
109
+ */
110
+ amounts_due?: Array<Invoice.AmountsDue> | null;
111
+
107
112
  /**
108
113
  * ID of the Connect Application that created the invoice.
109
114
  */
@@ -213,6 +218,11 @@ declare module 'stripe' {
213
218
  */
214
219
  customer_tax_ids?: Array<Invoice.CustomerTaxId> | null;
215
220
 
221
+ /**
222
+ * The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
223
+ */
224
+ default_margins?: Array<string | Stripe.Margin> | null;
225
+
216
226
  /**
217
227
  * 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.
218
228
  */
@@ -342,6 +352,11 @@ declare module 'stripe' {
342
352
 
343
353
  payment_settings: Invoice.PaymentSettings;
344
354
 
355
+ /**
356
+ * Payments for this invoice
357
+ */
358
+ payments?: ApiList<Stripe.InvoicePayment>;
359
+
345
360
  /**
346
361
  * 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
362
  */
@@ -456,6 +471,11 @@ declare module 'stripe' {
456
471
  */
457
472
  total_excluding_tax: number | null;
458
473
 
474
+ /**
475
+ * The aggregate amounts calculated per margin across all line items.
476
+ */
477
+ total_margin_amounts?: Array<Invoice.TotalMarginAmount> | null;
478
+
459
479
  /**
460
480
  * The aggregate amounts calculated per tax rate for all line items.
461
481
  */
@@ -473,6 +493,52 @@ declare module 'stripe' {
473
493
  }
474
494
 
475
495
  namespace Invoice {
496
+ interface AmountsDue {
497
+ /**
498
+ * Incremental amount due for this payment in cents (or local equivalent).
499
+ */
500
+ amount: number;
501
+
502
+ /**
503
+ * The amount in cents (or local equivalent) that was paid for this payment.
504
+ */
505
+ amount_paid: number;
506
+
507
+ /**
508
+ * The difference between the payment's amount and amount_paid, in cents (or local equivalent).
509
+ */
510
+ amount_remaining: number;
511
+
512
+ /**
513
+ * Number of days from when invoice is finalized until the payment is due.
514
+ */
515
+ days_until_due: number | null;
516
+
517
+ /**
518
+ * An arbitrary string attached to the object. Often useful for displaying to users.
519
+ */
520
+ description: string | null;
521
+
522
+ /**
523
+ * Date on which a payment plan's payment is due.
524
+ */
525
+ due_date: number | null;
526
+
527
+ /**
528
+ * Timestamp when the payment was paid.
529
+ */
530
+ paid_at: number | null;
531
+
532
+ /**
533
+ * The status of the payment, one of `open`, `paid`, or `past_due`
534
+ */
535
+ status: AmountsDue.Status;
536
+ }
537
+
538
+ namespace AmountsDue {
539
+ type Status = 'open' | 'paid' | 'past_due';
540
+ }
541
+
476
542
  interface AutomaticTax {
477
543
  /**
478
544
  * 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.
@@ -835,6 +901,9 @@ declare module 'stripe' {
835
901
  | 'forwarding_api_invalid_parameter'
836
902
  | 'forwarding_api_upstream_connection_error'
837
903
  | 'forwarding_api_upstream_connection_timeout'
904
+ | 'gift_card_balance_insufficient'
905
+ | 'gift_card_code_exists'
906
+ | 'gift_card_inactive'
838
907
  | 'idempotency_key_in_use'
839
908
  | 'incorrect_address'
840
909
  | 'incorrect_cvc'
@@ -923,6 +992,7 @@ declare module 'stripe' {
923
992
  | 'return_intent_already_processed'
924
993
  | 'routing_number_invalid'
925
994
  | 'secret_key_required'
995
+ | 'sensitive_data_access_expired'
926
996
  | 'sepa_unsupported_account'
927
997
  | 'setup_attempt_failed'
928
998
  | 'setup_intent_authentication_failure'
@@ -1119,6 +1189,8 @@ declare module 'stripe' {
1119
1189
 
1120
1190
  namespace UsBankAccount {
1121
1191
  interface FinancialConnections {
1192
+ filters?: FinancialConnections.Filters;
1193
+
1122
1194
  /**
1123
1195
  * The list of permissions to request. The `payment_method` permission must be included.
1124
1196
  */
@@ -1131,13 +1203,28 @@ declare module 'stripe' {
1131
1203
  }
1132
1204
 
1133
1205
  namespace FinancialConnections {
1206
+ interface Filters {
1207
+ /**
1208
+ * The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
1209
+ */
1210
+ account_subcategories?: Array<Filters.AccountSubcategory>;
1211
+ }
1212
+
1213
+ namespace Filters {
1214
+ type AccountSubcategory = 'checking' | 'savings';
1215
+ }
1216
+
1134
1217
  type Permission =
1135
1218
  | 'balances'
1136
1219
  | 'ownership'
1137
1220
  | 'payment_method'
1138
1221
  | 'transactions';
1139
1222
 
1140
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1223
+ type Prefetch =
1224
+ | 'balances'
1225
+ | 'inferred_balances'
1226
+ | 'ownership'
1227
+ | 'transactions';
1141
1228
  }
1142
1229
 
1143
1230
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1327,6 +1414,29 @@ declare module 'stripe' {
1327
1414
  * *Note: This attribute is populated only for invoices created on or after June 29, 2023.*
1328
1415
  */
1329
1416
  metadata: Stripe.Metadata | null;
1417
+
1418
+ /**
1419
+ * If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment).
1420
+ */
1421
+ pause_collection?: SubscriptionDetails.PauseCollection | null;
1422
+ }
1423
+
1424
+ namespace SubscriptionDetails {
1425
+ interface PauseCollection {
1426
+ /**
1427
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1428
+ */
1429
+ behavior: PauseCollection.Behavior;
1430
+
1431
+ /**
1432
+ * The time after which the subscription will resume collecting payments.
1433
+ */
1434
+ resumes_at: number | null;
1435
+ }
1436
+
1437
+ namespace PauseCollection {
1438
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
1439
+ }
1330
1440
  }
1331
1441
 
1332
1442
  interface ThresholdReason {
@@ -1367,6 +1477,18 @@ declare module 'stripe' {
1367
1477
  discount: string | Stripe.Discount | Stripe.DeletedDiscount;
1368
1478
  }
1369
1479
 
1480
+ interface TotalMarginAmount {
1481
+ /**
1482
+ * The amount, in cents (or local equivalent), of the reduction in line item amount.
1483
+ */
1484
+ amount: number;
1485
+
1486
+ /**
1487
+ * The margin that was applied to get this margin amount.
1488
+ */
1489
+ margin: string | Stripe.Margin;
1490
+ }
1491
+
1370
1492
  interface TotalTaxAmount {
1371
1493
  /**
1372
1494
  * The amount, in cents (or local equivalent), of the tax.