stripe 17.1.0 → 17.2.0-beta.2

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 (175) hide show
  1. package/CHANGELOG.md +901 -109
  2. package/README.md +4 -4
  3. package/VERSION +1 -1
  4. package/cjs/resources/AccountNotices.js +21 -0
  5. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  6. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  7. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  8. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  9. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  10. package/cjs/resources/GiftCards/Cards.js +23 -0
  11. package/cjs/resources/GiftCards/Transactions.js +33 -0
  12. package/cjs/resources/Invoices.js +17 -0
  13. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  14. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  15. package/cjs/resources/Margins.js +22 -0
  16. package/cjs/resources/Orders.js +24 -0
  17. package/cjs/resources/PaymentIntents.js +4 -0
  18. package/cjs/resources/Quotes.js +32 -0
  19. package/cjs/resources/SubscriptionSchedules.js +4 -0
  20. package/cjs/resources/Tax/Associations.js +9 -0
  21. package/cjs/resources/Tax/Forms.js +20 -0
  22. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  23. package/cjs/resources/Terminal/Readers.js +12 -0
  24. package/cjs/resources/TestHelpers/Issuing/Cards.js +4 -0
  25. package/cjs/resources.js +42 -10
  26. package/cjs/stripe.core.js +1 -1
  27. package/esm/resources/AccountNotices.js +18 -0
  28. package/esm/resources/Capital/FinancingOffers.js +18 -0
  29. package/esm/resources/Capital/FinancingSummary.js +9 -0
  30. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  31. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  32. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  33. package/esm/resources/GiftCards/Cards.js +20 -0
  34. package/esm/resources/GiftCards/Transactions.js +30 -0
  35. package/esm/resources/Invoices.js +17 -0
  36. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  37. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  38. package/esm/resources/Margins.js +19 -0
  39. package/esm/resources/Orders.js +21 -0
  40. package/esm/resources/PaymentIntents.js +4 -0
  41. package/esm/resources/Quotes.js +32 -0
  42. package/esm/resources/SubscriptionSchedules.js +4 -0
  43. package/esm/resources/Tax/Associations.js +6 -0
  44. package/esm/resources/Tax/Forms.js +17 -0
  45. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  46. package/esm/resources/Terminal/Readers.js +12 -0
  47. package/esm/resources/TestHelpers/Issuing/Cards.js +4 -0
  48. package/esm/resources.js +29 -0
  49. package/esm/stripe.core.js +1 -1
  50. package/package.json +1 -1
  51. package/types/AccountLinksResource.d.ts +5 -1
  52. package/types/AccountNotices.d.ts +113 -0
  53. package/types/AccountNoticesResource.d.ts +98 -0
  54. package/types/AccountSessions.d.ts +75 -5
  55. package/types/AccountSessionsResource.d.ts +354 -5
  56. package/types/Accounts.d.ts +127 -3
  57. package/types/AccountsResource.d.ts +296 -2
  58. package/types/Billing/CreditGrants.d.ts +2 -2
  59. package/types/Billing/CreditGrantsResource.d.ts +2 -2
  60. package/types/Billing/MeterErrorReports.d.ts +106 -0
  61. package/types/Billing/Meters.d.ts +2 -0
  62. package/types/Capital/FinancingOffers.d.ts +188 -0
  63. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  64. package/types/Capital/FinancingSummary.d.ts +106 -0
  65. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  66. package/types/Capital/FinancingTransactions.d.ts +135 -0
  67. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  68. package/types/Charges.d.ts +152 -0
  69. package/types/ChargesResource.d.ts +1294 -0
  70. package/types/Checkout/Sessions.d.ts +309 -5
  71. package/types/Checkout/SessionsResource.d.ts +356 -5
  72. package/types/ConfirmationTokens.d.ts +137 -0
  73. package/types/Coupons.d.ts +1 -1
  74. package/types/CouponsResource.d.ts +1 -1
  75. package/types/CreditNotes.d.ts +21 -0
  76. package/types/CreditNotesResource.d.ts +51 -0
  77. package/types/CustomersResource.d.ts +22 -2
  78. package/types/Disputes.d.ts +152 -0
  79. package/types/DisputesResource.d.ts +120 -0
  80. package/types/EventTypes.d.ts +564 -2
  81. package/types/Events.d.ts +91 -0
  82. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  83. package/types/FinancialConnections/Accounts.d.ts +29 -1
  84. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  85. package/types/FinancialConnections/Institutions.d.ts +93 -0
  86. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  87. package/types/FinancialConnections/Sessions.d.ts +49 -1
  88. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  89. package/types/Forwarding/Requests.d.ts +5 -0
  90. package/types/GiftCards/Cards.d.ts +118 -0
  91. package/types/GiftCards/CardsResource.d.ts +159 -0
  92. package/types/GiftCards/Transactions.d.ts +129 -0
  93. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  94. package/types/InvoiceItems.d.ts +5 -0
  95. package/types/InvoiceItemsResource.d.ts +98 -0
  96. package/types/InvoiceLineItems.d.ts +31 -1
  97. package/types/InvoicePayments.d.ts +138 -0
  98. package/types/Invoices.d.ts +134 -3
  99. package/types/InvoicesResource.d.ts +5478 -1799
  100. package/types/Issuing/Authorizations.d.ts +1 -1
  101. package/types/Issuing/AuthorizationsResource.d.ts +1 -1
  102. package/types/Issuing/CardholdersResource.d.ts +2 -1
  103. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  104. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  105. package/types/Issuing/DisputeSettlementDetails.d.ts +73 -0
  106. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  107. package/types/Issuing/Settlements.d.ts +103 -0
  108. package/types/Issuing/Transactions.d.ts +2 -0
  109. package/types/Issuing/TransactionsResource.d.ts +5 -0
  110. package/types/LineItems.d.ts +7 -0
  111. package/types/Mandates.d.ts +85 -0
  112. package/types/Margins.d.ts +56 -0
  113. package/types/MarginsResource.d.ts +114 -0
  114. package/types/Orders.d.ts +1154 -0
  115. package/types/OrdersResource.d.ts +2911 -0
  116. package/types/PaymentIntents.d.ts +643 -1
  117. package/types/PaymentIntentsResource.d.ts +7790 -3514
  118. package/types/PaymentLinks.d.ts +3 -0
  119. package/types/PaymentLinksResource.d.ts +6 -0
  120. package/types/PaymentMethodConfigurations.d.ts +36 -0
  121. package/types/PaymentMethodConfigurationsResource.d.ts +52 -2
  122. package/types/PaymentMethods.d.ts +137 -0
  123. package/types/PaymentMethodsResource.d.ts +158 -0
  124. package/types/Persons.d.ts +1 -1
  125. package/types/Prices.d.ts +22 -0
  126. package/types/PricesResource.d.ts +22 -0
  127. package/types/Products.d.ts +39 -0
  128. package/types/ProductsResource.d.ts +36 -0
  129. package/types/QuoteLines.d.ts +634 -0
  130. package/types/QuotePreviewInvoices.d.ts +1596 -0
  131. package/types/QuotePreviewSubscriptionSchedules.d.ts +814 -0
  132. package/types/Quotes.d.ts +591 -1
  133. package/types/QuotesResource.d.ts +2526 -194
  134. package/types/SetupAttempts.d.ts +19 -0
  135. package/types/SetupIntents.d.ts +112 -1
  136. package/types/SetupIntentsResource.d.ts +669 -3
  137. package/types/Sources.d.ts +23 -0
  138. package/types/SubscriptionItems.d.ts +21 -0
  139. package/types/SubscriptionItemsResource.d.ts +109 -0
  140. package/types/SubscriptionSchedules.d.ts +200 -0
  141. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  142. package/types/Subscriptions.d.ts +82 -1
  143. package/types/SubscriptionsResource.d.ts +348 -3
  144. package/types/Tax/Associations.d.ts +126 -0
  145. package/types/Tax/AssociationsResource.d.ts +29 -0
  146. package/types/Tax/CalculationLineItems.d.ts +1 -0
  147. package/types/Tax/Calculations.d.ts +33 -1
  148. package/types/Tax/CalculationsResource.d.ts +7 -1
  149. package/types/Tax/Forms.d.ts +133 -0
  150. package/types/Tax/FormsResource.d.ts +90 -0
  151. package/types/Tax/Registrations.d.ts +82 -0
  152. package/types/Tax/RegistrationsResource.d.ts +109 -0
  153. package/types/Tax/Transactions.d.ts +8 -1
  154. package/types/TaxIds.d.ts +7 -1
  155. package/types/TaxIdsResource.d.ts +7 -1
  156. package/types/TaxRates.d.ts +25 -0
  157. package/types/TaxRatesResource.d.ts +2 -0
  158. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  159. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  160. package/types/Terminal/Readers.d.ts +278 -0
  161. package/types/Terminal/ReadersResource.d.ts +215 -0
  162. package/types/TestHelpers/ConfirmationTokensResource.d.ts +112 -0
  163. package/types/TestHelpers/Issuing/CardsResource.d.ts +22 -0
  164. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  165. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  166. package/types/TokensResource.d.ts +1 -1
  167. package/types/Treasury/FinancialAccounts.d.ts +6 -1
  168. package/types/Treasury/FinancialAccountsResource.d.ts +10 -0
  169. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  170. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  171. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  172. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  173. package/types/UsageRecordSummaries.d.ts +1 -1
  174. package/types/WebhookEndpointsResource.d.ts +66 -0
  175. package/types/index.d.ts +53 -0
@@ -43,6 +43,11 @@ declare module 'stripe' {
43
43
  */
44
44
  invoice?: string;
45
45
 
46
+ /**
47
+ * The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item.
48
+ */
49
+ margins?: Array<string>;
50
+
46
51
  /**
47
52
  * 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`.
48
53
  */
@@ -111,12 +116,56 @@ declare module 'stripe' {
111
116
  */
112
117
  discount?: string;
113
118
 
119
+ /**
120
+ * Details to determine how long the discount should be applied for.
121
+ */
122
+ discount_end?: Discount.DiscountEnd;
123
+
114
124
  /**
115
125
  * ID of the promotion code to create a new discount for.
116
126
  */
117
127
  promotion_code?: string;
118
128
  }
119
129
 
130
+ namespace Discount {
131
+ interface DiscountEnd {
132
+ /**
133
+ * Time span for the redeemed discount.
134
+ */
135
+ duration?: DiscountEnd.Duration;
136
+
137
+ /**
138
+ * A precise Unix timestamp for the discount to end. Must be in the future.
139
+ */
140
+ timestamp?: number;
141
+
142
+ /**
143
+ * The type of calculation made to determine when the discount ends.
144
+ */
145
+ type: DiscountEnd.Type;
146
+ }
147
+
148
+ namespace DiscountEnd {
149
+ interface Duration {
150
+ /**
151
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
152
+ */
153
+ interval: Duration.Interval;
154
+
155
+ /**
156
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
157
+ */
158
+ interval_count: number;
159
+ }
160
+
161
+ namespace Duration {
162
+ type Interval = 'day' | 'month' | 'week' | 'year';
163
+ }
164
+
165
+ type Type = 'duration' | 'timestamp';
166
+ }
167
+ }
168
+
120
169
  interface Period {
121
170
  /**
122
171
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -196,6 +245,11 @@ declare module 'stripe' {
196
245
  */
197
246
  expand?: Array<string>;
198
247
 
248
+ /**
249
+ * The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item.
250
+ */
251
+ margins?: Stripe.Emptyable<Array<string>>;
252
+
199
253
  /**
200
254
  * 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`.
201
255
  */
@@ -259,12 +313,56 @@ declare module 'stripe' {
259
313
  */
260
314
  discount?: string;
261
315
 
316
+ /**
317
+ * Details to determine how long the discount should be applied for.
318
+ */
319
+ discount_end?: Discount.DiscountEnd;
320
+
262
321
  /**
263
322
  * ID of the promotion code to create a new discount for.
264
323
  */
265
324
  promotion_code?: string;
266
325
  }
267
326
 
327
+ namespace Discount {
328
+ interface DiscountEnd {
329
+ /**
330
+ * Time span for the redeemed discount.
331
+ */
332
+ duration?: DiscountEnd.Duration;
333
+
334
+ /**
335
+ * A precise Unix timestamp for the discount to end. Must be in the future.
336
+ */
337
+ timestamp?: number;
338
+
339
+ /**
340
+ * The type of calculation made to determine when the discount ends.
341
+ */
342
+ type: DiscountEnd.Type;
343
+ }
344
+
345
+ namespace DiscountEnd {
346
+ interface Duration {
347
+ /**
348
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
349
+ */
350
+ interval: Duration.Interval;
351
+
352
+ /**
353
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
354
+ */
355
+ interval_count: number;
356
+ }
357
+
358
+ namespace Duration {
359
+ type Interval = 'day' | 'month' | 'week' | 'year';
360
+ }
361
+
362
+ type Type = 'duration' | 'timestamp';
363
+ }
364
+ }
365
+
268
366
  interface Period {
269
367
  /**
270
368
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -68,6 +68,16 @@ declare module 'stripe' {
68
68
  */
69
69
  livemode: boolean;
70
70
 
71
+ /**
72
+ * The amount of margin calculated per margin for this line item.
73
+ */
74
+ margin_amounts?: Array<InvoiceLineItem.MarginAmount> | null;
75
+
76
+ /**
77
+ * The margins applied to the line item. When set, the `default_margins` on the invoice do not apply to the line item. Use `expand[]=margins` to expand each margin.
78
+ */
79
+ margins?: Array<string | Stripe.Margin> | null;
80
+
71
81
  /**
72
82
  * 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. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
73
83
  */
@@ -80,6 +90,9 @@ declare module 'stripe' {
80
90
  */
81
91
  plan: Stripe.Plan | null;
82
92
 
93
+ /**
94
+ * Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
95
+ */
83
96
  pretax_credit_amounts?: Array<InvoiceLineItem.PretaxCreditAmount> | null;
84
97
 
85
98
  /**
@@ -146,6 +159,18 @@ declare module 'stripe' {
146
159
  discount: string | Stripe.Discount | Stripe.DeletedDiscount;
147
160
  }
148
161
 
162
+ interface MarginAmount {
163
+ /**
164
+ * The amount, in cents (or local equivalent), of the reduction in line item amount.
165
+ */
166
+ amount: number;
167
+
168
+ /**
169
+ * The margin that was applied to get this margin amount.
170
+ */
171
+ margin: string | Stripe.Margin;
172
+ }
173
+
149
174
  interface Period {
150
175
  /**
151
176
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -177,6 +202,11 @@ declare module 'stripe' {
177
202
  */
178
203
  discount?: string | Stripe.Discount | Stripe.DeletedDiscount;
179
204
 
205
+ /**
206
+ * The margin that was applied to get this pretax credit amount.
207
+ */
208
+ margin?: string | Stripe.Margin;
209
+
180
210
  /**
181
211
  * Type of the pretax credit amount referenced.
182
212
  */
@@ -184,7 +214,7 @@ declare module 'stripe' {
184
214
  }
185
215
 
186
216
  namespace PretaxCreditAmount {
187
- type Type = 'credit_balance_transaction' | 'discount';
217
+ type Type = 'credit_balance_transaction' | 'discount' | 'margin';
188
218
  }
189
219
 
190
220
  interface ProrationDetails {
@@ -0,0 +1,138 @@
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
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
36
+ */
37
+ created: number;
38
+
39
+ /**
40
+ * 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).
41
+ */
42
+ currency: string;
43
+
44
+ /**
45
+ * The invoice that was paid.
46
+ */
47
+ invoice: string | Stripe.Invoice | Stripe.DeletedInvoice;
48
+
49
+ /**
50
+ * 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.
51
+ */
52
+ is_default: boolean | null;
53
+
54
+ /**
55
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
56
+ */
57
+ livemode: boolean;
58
+
59
+ payment: InvoicePayment.Payment;
60
+
61
+ /**
62
+ * The status of the payment, one of `open`, `paid`, or `canceled`.
63
+ */
64
+ status: string;
65
+
66
+ status_transitions: InvoicePayment.StatusTransitions;
67
+ }
68
+
69
+ namespace InvoicePayment {
70
+ interface Payment {
71
+ /**
72
+ * ID of the successful charge for this payment when `type` is `charge`.
73
+ */
74
+ charge?: string | Stripe.Charge;
75
+
76
+ out_of_band_payment?: Payment.OutOfBandPayment;
77
+
78
+ /**
79
+ * ID of the PaymentIntent associated with this payment when `type` is `payment_intent`. Note: This property is only populated for invoices finalized on or after March 15th, 2019.
80
+ */
81
+ payment_intent?: string | Stripe.PaymentIntent;
82
+
83
+ /**
84
+ * Type of payment object associated with this invoice payment.
85
+ */
86
+ type: Payment.Type;
87
+ }
88
+
89
+ namespace Payment {
90
+ interface OutOfBandPayment {
91
+ /**
92
+ * Amount paid on this out of band payment, in cents (or local equivalent)
93
+ */
94
+ amount: number;
95
+
96
+ /**
97
+ * 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).
98
+ */
99
+ currency: string;
100
+
101
+ /**
102
+ * 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.
103
+ */
104
+ metadata: Stripe.Metadata | null;
105
+
106
+ /**
107
+ * The type of money movement for this out of band payment record.
108
+ */
109
+ money_movement_type: string;
110
+
111
+ /**
112
+ * The timestamp when this out of band payment was paid.
113
+ */
114
+ paid_at: number | null;
115
+
116
+ /**
117
+ * The reference for this out of band payment record.
118
+ */
119
+ payment_reference: string | null;
120
+ }
121
+
122
+ type Type = 'charge' | 'out_of_band_payment' | 'payment_intent';
123
+ }
124
+
125
+ interface StatusTransitions {
126
+ /**
127
+ * The time that the payment was canceled.
128
+ */
129
+ canceled_at: number | null;
130
+
131
+ /**
132
+ * The time that the payment succeeded.
133
+ */
134
+ paid_at: number | null;
135
+ }
136
+ }
137
+ }
138
+ }
@@ -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
  */
@@ -218,6 +223,11 @@ declare module 'stripe' {
218
223
  */
219
224
  customer_tax_ids?: Array<Invoice.CustomerTaxId> | null;
220
225
 
226
+ /**
227
+ * The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
228
+ */
229
+ default_margins?: Array<string | Stripe.Margin> | null;
230
+
221
231
  /**
222
232
  * 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.
223
233
  */
@@ -347,6 +357,11 @@ declare module 'stripe' {
347
357
 
348
358
  payment_settings: Invoice.PaymentSettings;
349
359
 
360
+ /**
361
+ * Payments for this invoice
362
+ */
363
+ payments?: ApiList<Stripe.InvoicePayment>;
364
+
350
365
  /**
351
366
  * 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.
352
367
  */
@@ -461,6 +476,14 @@ declare module 'stripe' {
461
476
  */
462
477
  total_excluding_tax: number | null;
463
478
 
479
+ /**
480
+ * The aggregate amounts calculated per margin across all line items.
481
+ */
482
+ total_margin_amounts?: Array<Invoice.TotalMarginAmount> | null;
483
+
484
+ /**
485
+ * 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.
486
+ */
464
487
  total_pretax_credit_amounts?: Array<
465
488
  Invoice.TotalPretaxCreditAmount
466
489
  > | null;
@@ -482,6 +505,52 @@ declare module 'stripe' {
482
505
  }
483
506
 
484
507
  namespace Invoice {
508
+ interface AmountsDue {
509
+ /**
510
+ * Incremental amount due for this payment in cents (or local equivalent).
511
+ */
512
+ amount: number;
513
+
514
+ /**
515
+ * The amount in cents (or local equivalent) that was paid for this payment.
516
+ */
517
+ amount_paid: number;
518
+
519
+ /**
520
+ * The difference between the payment's amount and amount_paid, in cents (or local equivalent).
521
+ */
522
+ amount_remaining: number;
523
+
524
+ /**
525
+ * Number of days from when invoice is finalized until the payment is due.
526
+ */
527
+ days_until_due: number | null;
528
+
529
+ /**
530
+ * An arbitrary string attached to the object. Often useful for displaying to users.
531
+ */
532
+ description: string | null;
533
+
534
+ /**
535
+ * Date on which a payment plan's payment is due.
536
+ */
537
+ due_date: number | null;
538
+
539
+ /**
540
+ * Timestamp when the payment was paid.
541
+ */
542
+ paid_at: number | null;
543
+
544
+ /**
545
+ * The status of the payment, one of `open`, `paid`, or `past_due`
546
+ */
547
+ status: AmountsDue.Status;
548
+ }
549
+
550
+ namespace AmountsDue {
551
+ type Status = 'open' | 'paid' | 'past_due';
552
+ }
553
+
485
554
  interface AutomaticTax {
486
555
  /**
487
556
  * 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.
@@ -560,7 +629,7 @@ declare module 'stripe' {
560
629
 
561
630
  interface CustomerTaxId {
562
631
  /**
563
- * 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`, `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`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown`
632
+ * 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`, `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`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown`
564
633
  */
565
634
  type: CustomerTaxId.Type;
566
635
 
@@ -582,6 +651,7 @@ declare module 'stripe' {
582
651
  | 'bo_tin'
583
652
  | 'br_cnpj'
584
653
  | 'br_cpf'
654
+ | 'by_tin'
585
655
  | 'ca_bn'
586
656
  | 'ca_gst_hst'
587
657
  | 'ca_pst_bc'
@@ -617,6 +687,8 @@ declare module 'stripe' {
617
687
  | 'kr_brn'
618
688
  | 'kz_bin'
619
689
  | 'li_uid'
690
+ | 'ma_vat'
691
+ | 'md_vat'
620
692
  | 'mx_rfc'
621
693
  | 'my_frp'
622
694
  | 'my_itn'
@@ -640,10 +712,13 @@ declare module 'stripe' {
640
712
  | 'th_vat'
641
713
  | 'tr_tin'
642
714
  | 'tw_vat'
715
+ | 'tz_vat'
643
716
  | 'ua_vat'
644
717
  | 'unknown'
645
718
  | 'us_ein'
646
719
  | 'uy_ruc'
720
+ | 'uz_tin'
721
+ | 'uz_vat'
647
722
  | 've_rif'
648
723
  | 'vn_tin'
649
724
  | 'za_vat';
@@ -837,11 +912,15 @@ declare module 'stripe' {
837
912
  | 'email_invalid'
838
913
  | 'expired_card'
839
914
  | 'financial_connections_account_inactive'
915
+ | 'financial_connections_institution_unavailable'
840
916
  | 'financial_connections_no_successful_transaction_refresh'
841
917
  | 'forwarding_api_inactive'
842
918
  | 'forwarding_api_invalid_parameter'
843
919
  | 'forwarding_api_upstream_connection_error'
844
920
  | 'forwarding_api_upstream_connection_timeout'
921
+ | 'gift_card_balance_insufficient'
922
+ | 'gift_card_code_exists'
923
+ | 'gift_card_inactive'
845
924
  | 'idempotency_key_in_use'
846
925
  | 'incorrect_address'
847
926
  | 'incorrect_cvc'
@@ -915,6 +994,7 @@ declare module 'stripe' {
915
994
  | 'payment_method_unexpected_state'
916
995
  | 'payment_method_unsupported_type'
917
996
  | 'payout_reconciliation_not_ready'
997
+ | 'payout_statement_descriptor_profanity'
918
998
  | 'payouts_limit_exceeded'
919
999
  | 'payouts_not_allowed'
920
1000
  | 'platform_account_required'
@@ -931,6 +1011,7 @@ declare module 'stripe' {
931
1011
  | 'return_intent_already_processed'
932
1012
  | 'routing_number_invalid'
933
1013
  | 'secret_key_required'
1014
+ | 'sensitive_data_access_expired'
934
1015
  | 'sepa_unsupported_account'
935
1016
  | 'setup_attempt_failed'
936
1017
  | 'setup_intent_authentication_failure'
@@ -948,6 +1029,7 @@ declare module 'stripe' {
948
1029
  | 'taxes_calculation_failed'
949
1030
  | 'terminal_location_country_unsupported'
950
1031
  | 'terminal_reader_busy'
1032
+ | 'terminal_reader_collected_data_invalid'
951
1033
  | 'terminal_reader_hardware_fault'
952
1034
  | 'terminal_reader_invalid_location_for_activation'
953
1035
  | 'terminal_reader_invalid_location_for_payment'
@@ -1147,6 +1229,11 @@ declare module 'stripe' {
1147
1229
  * The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
1148
1230
  */
1149
1231
  account_subcategories?: Array<Filters.AccountSubcategory>;
1232
+
1233
+ /**
1234
+ * The institution to use to filter for possible accounts to link.
1235
+ */
1236
+ institution?: string;
1150
1237
  }
1151
1238
 
1152
1239
  namespace Filters {
@@ -1159,7 +1246,11 @@ declare module 'stripe' {
1159
1246
  | 'payment_method'
1160
1247
  | 'transactions';
1161
1248
 
1162
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1249
+ type Prefetch =
1250
+ | 'balances'
1251
+ | 'inferred_balances'
1252
+ | 'ownership'
1253
+ | 'transactions';
1163
1254
  }
1164
1255
 
1165
1256
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1360,6 +1451,29 @@ declare module 'stripe' {
1360
1451
  * *Note: This attribute is populated only for invoices created on or after June 29, 2023.*
1361
1452
  */
1362
1453
  metadata: Stripe.Metadata | null;
1454
+
1455
+ /**
1456
+ * 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).
1457
+ */
1458
+ pause_collection?: SubscriptionDetails.PauseCollection | null;
1459
+ }
1460
+
1461
+ namespace SubscriptionDetails {
1462
+ interface PauseCollection {
1463
+ /**
1464
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1465
+ */
1466
+ behavior: PauseCollection.Behavior;
1467
+
1468
+ /**
1469
+ * The time after which the subscription will resume collecting payments.
1470
+ */
1471
+ resumes_at: number | null;
1472
+ }
1473
+
1474
+ namespace PauseCollection {
1475
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
1476
+ }
1363
1477
  }
1364
1478
 
1365
1479
  interface ThresholdReason {
@@ -1400,6 +1514,18 @@ declare module 'stripe' {
1400
1514
  discount: string | Stripe.Discount | Stripe.DeletedDiscount;
1401
1515
  }
1402
1516
 
1517
+ interface TotalMarginAmount {
1518
+ /**
1519
+ * The amount, in cents (or local equivalent), of the reduction in line item amount.
1520
+ */
1521
+ amount: number;
1522
+
1523
+ /**
1524
+ * The margin that was applied to get this margin amount.
1525
+ */
1526
+ margin: string | Stripe.Margin;
1527
+ }
1528
+
1403
1529
  interface TotalPretaxCreditAmount {
1404
1530
  /**
1405
1531
  * The amount, in cents (or local equivalent), of the pretax credit amount.
@@ -1419,6 +1545,11 @@ declare module 'stripe' {
1419
1545
  */
1420
1546
  discount?: string | Stripe.Discount | Stripe.DeletedDiscount;
1421
1547
 
1548
+ /**
1549
+ * The margin that was applied to get this pretax credit amount.
1550
+ */
1551
+ margin?: string | Stripe.Margin;
1552
+
1422
1553
  /**
1423
1554
  * Type of the pretax credit amount referenced.
1424
1555
  */
@@ -1426,7 +1557,7 @@ declare module 'stripe' {
1426
1557
  }
1427
1558
 
1428
1559
  namespace TotalPretaxCreditAmount {
1429
- type Type = 'credit_balance_transaction' | 'discount';
1560
+ type Type = 'credit_balance_transaction' | 'discount' | 'margin';
1430
1561
  }
1431
1562
 
1432
1563
  interface TotalTaxAmount {