stripe 20.1.0 → 20.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 (295) hide show
  1. package/CHANGELOG.md +1544 -47
  2. package/OPENAPI_VERSION +1 -1
  3. package/README.md +1 -0
  4. package/VERSION +1 -1
  5. package/cjs/Error.js +115 -1
  6. package/cjs/StripeEventNotificationHandler.js +118 -0
  7. package/cjs/apiVersion.js +2 -3
  8. package/cjs/resources/AccountNotices.js +21 -0
  9. package/cjs/resources/Billing/Analytics/MeterUsage.js +12 -0
  10. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  11. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  12. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  13. package/cjs/resources/ExternalAccounts.js +23 -0
  14. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  15. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  16. package/cjs/resources/FxQuotes.js +15 -0
  17. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  18. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  19. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  20. package/cjs/resources/Mandates.js +5 -0
  21. package/cjs/resources/Margins.js +22 -0
  22. package/cjs/resources/Orders.js +24 -0
  23. package/cjs/resources/PaymentIntents.js +8 -0
  24. package/cjs/resources/Privacy/RedactionJobs.js +42 -0
  25. package/cjs/resources/Quotes.js +32 -0
  26. package/cjs/resources/Reserve/Holds.js +14 -0
  27. package/cjs/resources/Reserve/Plans.js +9 -0
  28. package/cjs/resources/Reserve/Releases.js +17 -0
  29. package/cjs/resources/SubscriptionSchedules.js +4 -0
  30. package/cjs/resources/Subscriptions.js +4 -0
  31. package/cjs/resources/Tax/Forms.js +20 -0
  32. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  33. package/cjs/resources/V2/Billing/BillSettings/Versions.js +17 -0
  34. package/cjs/resources/V2/Billing/BillSettings.js +27 -0
  35. package/cjs/resources/V2/Billing/Cadences.js +23 -0
  36. package/cjs/resources/V2/Billing/CollectionSettings/Versions.js +17 -0
  37. package/cjs/resources/V2/Billing/CollectionSettings.js +30 -0
  38. package/cjs/resources/V2/Billing/Profiles.js +19 -0
  39. package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +33 -0
  40. package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +37 -0
  41. package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
  42. package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +29 -0
  43. package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
  44. package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
  45. package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
  46. package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
  47. package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
  48. package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
  49. package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
  50. package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
  51. package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
  52. package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
  53. package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
  54. package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
  55. package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
  56. package/cjs/resources.js +98 -4
  57. package/cjs/stripe.core.js +5 -1
  58. package/esm/Error.js +100 -0
  59. package/esm/StripeEventNotificationHandler.js +114 -0
  60. package/esm/apiVersion.js +1 -2
  61. package/esm/resources/AccountNotices.js +18 -0
  62. package/esm/resources/Billing/Analytics/MeterUsage.js +9 -0
  63. package/esm/resources/Capital/FinancingOffers.js +18 -0
  64. package/esm/resources/Capital/FinancingSummary.js +9 -0
  65. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  66. package/esm/resources/ExternalAccounts.js +20 -0
  67. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  68. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  69. package/esm/resources/FxQuotes.js +12 -0
  70. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  71. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  72. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  73. package/esm/resources/Mandates.js +5 -0
  74. package/esm/resources/Margins.js +19 -0
  75. package/esm/resources/Orders.js +21 -0
  76. package/esm/resources/PaymentIntents.js +8 -0
  77. package/esm/resources/Privacy/RedactionJobs.js +39 -0
  78. package/esm/resources/Quotes.js +32 -0
  79. package/esm/resources/Reserve/Holds.js +11 -0
  80. package/esm/resources/Reserve/Plans.js +6 -0
  81. package/esm/resources/Reserve/Releases.js +14 -0
  82. package/esm/resources/SubscriptionSchedules.js +4 -0
  83. package/esm/resources/Subscriptions.js +4 -0
  84. package/esm/resources/Tax/Forms.js +17 -0
  85. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  86. package/esm/resources/V2/Billing/BillSettings/Versions.js +14 -0
  87. package/esm/resources/V2/Billing/BillSettings.js +24 -0
  88. package/esm/resources/V2/Billing/Cadences.js +20 -0
  89. package/esm/resources/V2/Billing/CollectionSettings/Versions.js +14 -0
  90. package/esm/resources/V2/Billing/CollectionSettings.js +27 -0
  91. package/esm/resources/V2/Billing/Profiles.js +16 -0
  92. package/esm/resources/V2/Core/Vault/GbBankAccounts.js +30 -0
  93. package/esm/resources/V2/Core/Vault/UsBankAccounts.js +34 -0
  94. package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
  95. package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +26 -0
  96. package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
  97. package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
  98. package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
  99. package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
  100. package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
  101. package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
  102. package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
  103. package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
  104. package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
  105. package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
  106. package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
  107. package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
  108. package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
  109. package/esm/resources.js +89 -0
  110. package/esm/stripe.core.js +5 -1
  111. package/package.json +1 -1
  112. package/types/AccountLinksResource.d.ts +5 -1
  113. package/types/AccountNotices.d.ts +113 -0
  114. package/types/AccountNoticesResource.d.ts +98 -0
  115. package/types/AccountSessions.d.ts +45 -0
  116. package/types/AccountSessionsResource.d.ts +264 -0
  117. package/types/Accounts.d.ts +225 -1
  118. package/types/AccountsResource.d.ts +562 -0
  119. package/types/BankAccounts.d.ts +2 -0
  120. package/types/Billing/AlertTriggereds.d.ts +1 -1
  121. package/types/Billing/Analytics/MeterUsage.d.ts +31 -0
  122. package/types/Billing/Analytics/MeterUsageResource.d.ts +689 -0
  123. package/types/Billing/Analytics/MeterUsageRows.d.ts +51 -0
  124. package/types/Capabilities.d.ts +2 -0
  125. package/types/Capital/FinancingOffers.d.ts +188 -0
  126. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  127. package/types/Capital/FinancingSummary.d.ts +109 -0
  128. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  129. package/types/Capital/FinancingTransactions.d.ts +135 -0
  130. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  131. package/types/Cards.d.ts +5 -0
  132. package/types/Charges.d.ts +152 -0
  133. package/types/ChargesResource.d.ts +3855 -75
  134. package/types/Checkout/Sessions.d.ts +279 -2
  135. package/types/Checkout/SessionsResource.d.ts +362 -2
  136. package/types/ConfirmationTokens.d.ts +103 -0
  137. package/types/Coupons.d.ts +35 -0
  138. package/types/CouponsResource.d.ts +23 -0
  139. package/types/CreditNoteLineItems.d.ts +17 -0
  140. package/types/CustomerSessions.d.ts +41 -0
  141. package/types/CustomerSessionsResource.d.ts +41 -0
  142. package/types/CustomersResource.d.ts +7 -0
  143. package/types/Disputes.d.ts +40 -0
  144. package/types/DisputesResource.d.ts +11 -0
  145. package/types/Errors.d.ts +85 -0
  146. package/types/EventTypes.d.ts +630 -0
  147. package/types/Events.d.ts +96 -0
  148. package/types/ExternalAccountsResource.d.ts +304 -0
  149. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  150. package/types/FinancialConnections/Accounts.d.ts +34 -1
  151. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  152. package/types/FinancialConnections/Institutions.d.ts +98 -0
  153. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  154. package/types/FinancialConnections/Sessions.d.ts +49 -1
  155. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  156. package/types/FxQuotes.d.ts +155 -0
  157. package/types/FxQuotesResource.d.ts +130 -0
  158. package/types/InvoiceItems.d.ts +5 -0
  159. package/types/InvoiceItemsResource.d.ts +98 -0
  160. package/types/InvoiceLineItems.d.ts +45 -1
  161. package/types/Invoices.d.ts +198 -4
  162. package/types/InvoicesResource.d.ts +1606 -3
  163. package/types/Issuing/CardholdersResource.d.ts +2 -1
  164. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  165. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  166. package/types/Issuing/DisputeSettlementDetails.d.ts +85 -0
  167. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  168. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  169. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  170. package/types/Issuing/Settlements.d.ts +113 -0
  171. package/types/Issuing/Transactions.d.ts +5 -0
  172. package/types/Issuing/TransactionsResource.d.ts +5 -0
  173. package/types/LineItems.d.ts +45 -1
  174. package/types/Mandates.d.ts +69 -1
  175. package/types/MandatesResource.d.ts +31 -0
  176. package/types/Margins.d.ts +56 -0
  177. package/types/MarginsResource.d.ts +114 -0
  178. package/types/Orders.d.ts +1163 -0
  179. package/types/OrdersResource.d.ts +5505 -0
  180. package/types/PaymentAttemptRecords.d.ts +117 -0
  181. package/types/PaymentIntents.d.ts +683 -3
  182. package/types/PaymentIntentsResource.d.ts +19095 -6508
  183. package/types/PaymentLinks.d.ts +5 -0
  184. package/types/PaymentLinksResource.d.ts +10 -0
  185. package/types/PaymentMethodConfigurations.d.ts +180 -0
  186. package/types/PaymentMethodConfigurationsResource.d.ts +250 -0
  187. package/types/PaymentMethods.d.ts +108 -0
  188. package/types/PaymentMethodsResource.d.ts +110 -0
  189. package/types/PaymentRecords.d.ts +117 -0
  190. package/types/Persons.d.ts +2 -0
  191. package/types/Prices.d.ts +22 -0
  192. package/types/PricesResource.d.ts +22 -0
  193. package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
  194. package/types/Privacy/RedactionJobs.d.ts +111 -0
  195. package/types/Privacy/RedactionJobsResource.d.ts +230 -0
  196. package/types/QuoteLines.d.ts +634 -0
  197. package/types/QuotePreviewInvoices.d.ts +1821 -0
  198. package/types/QuotePreviewSubscriptionSchedules.d.ts +908 -0
  199. package/types/Quotes.d.ts +589 -1
  200. package/types/QuotesResource.d.ts +2567 -237
  201. package/types/Refunds.d.ts +14 -0
  202. package/types/Reserve/Holds.d.ts +104 -0
  203. package/types/Reserve/HoldsResource.d.ts +76 -0
  204. package/types/Reserve/Plans.d.ts +103 -0
  205. package/types/Reserve/PlansResource.d.ts +29 -0
  206. package/types/Reserve/Releases.d.ts +105 -0
  207. package/types/Reserve/ReleasesResource.d.ts +60 -0
  208. package/types/SetupAttempts.d.ts +42 -1
  209. package/types/SetupIntents.d.ts +138 -2
  210. package/types/SetupIntentsResource.d.ts +629 -3
  211. package/types/Sources.d.ts +29 -0
  212. package/types/SubscriptionItems.d.ts +26 -0
  213. package/types/SubscriptionItemsResource.d.ts +109 -0
  214. package/types/SubscriptionSchedules.d.ts +200 -0
  215. package/types/SubscriptionSchedulesResource.d.ts +1230 -12
  216. package/types/Subscriptions.d.ts +257 -1
  217. package/types/SubscriptionsResource.d.ts +726 -2
  218. package/types/Tax/Forms.d.ts +220 -0
  219. package/types/Tax/FormsResource.d.ts +107 -0
  220. package/types/Terminal/Configurations.d.ts +9 -0
  221. package/types/Terminal/ConfigurationsResource.d.ts +28 -0
  222. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  223. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  224. package/types/Terminal/Readers.d.ts +20 -0
  225. package/types/TestHelpers/ConfirmationTokensResource.d.ts +103 -0
  226. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  227. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  228. package/types/Transfers.d.ts +5 -0
  229. package/types/TransfersResource.d.ts +5 -0
  230. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  231. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  232. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  233. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  234. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  235. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  236. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  237. package/types/V2/Billing/BillSettingVersions.d.ts +97 -0
  238. package/types/V2/Billing/BillSettings/VersionsResource.d.ts +58 -0
  239. package/types/V2/Billing/BillSettings.d.ts +120 -0
  240. package/types/V2/Billing/BillSettingsResource.d.ts +241 -0
  241. package/types/V2/Billing/Cadences.d.ts +690 -0
  242. package/types/V2/Billing/CadencesResource.d.ts +487 -0
  243. package/types/V2/Billing/CollectionSettingVersions.d.ts +318 -0
  244. package/types/V2/Billing/CollectionSettings/VersionsResource.d.ts +62 -0
  245. package/types/V2/Billing/CollectionSettings.d.ts +341 -0
  246. package/types/V2/Billing/CollectionSettingsResource.d.ts +683 -0
  247. package/types/V2/Billing/Profiles.d.ts +70 -0
  248. package/types/V2/Billing/ProfilesResource.d.ts +150 -0
  249. package/types/V2/Core/AccountLinks.d.ts +10 -2
  250. package/types/V2/Core/AccountLinksResource.d.ts +10 -2
  251. package/types/V2/Core/AccountTokensResource.d.ts +12 -0
  252. package/types/V2/Core/Accounts.d.ts +999 -84
  253. package/types/V2/Core/AccountsResource.d.ts +523 -2
  254. package/types/V2/Core/EventTypes.d.ts +1564 -9
  255. package/types/V2/Core/Vault/GbBankAccounts.d.ts +160 -0
  256. package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +194 -0
  257. package/types/V2/Core/Vault/UsBankAccounts.d.ts +121 -0
  258. package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +198 -0
  259. package/types/V2/EventMisc.d.ts +37 -0
  260. package/types/V2/FinancialAddressCreditSimulations.d.ts +27 -0
  261. package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +46 -0
  262. package/types/V2/MoneyManagement/Adjustments.d.ts +122 -0
  263. package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
  264. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +186 -0
  265. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +172 -0
  266. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +175 -0
  267. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +109 -0
  268. package/types/V2/MoneyManagement/InboundTransfers.d.ts +250 -0
  269. package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +156 -0
  270. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +222 -0
  271. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +127 -0
  272. package/types/V2/MoneyManagement/OutboundPayments.d.ts +318 -0
  273. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +254 -0
  274. package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
  275. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +298 -0
  276. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +291 -0
  277. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +220 -0
  278. package/types/V2/MoneyManagement/PayoutMethods.d.ts +165 -0
  279. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpec.d.ts +93 -0
  280. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
  281. package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +115 -0
  282. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +323 -0
  283. package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
  284. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +188 -0
  285. package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
  286. package/types/V2/MoneyManagement/TransactionEntries.d.ts +200 -0
  287. package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
  288. package/types/V2/MoneyManagement/Transactions.d.ts +227 -0
  289. package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
  290. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +80 -0
  291. package/types/WebhookEndpointsResource.d.ts +76 -0
  292. package/types/apiVersion.d.ts +1 -2
  293. package/types/index.d.ts +160 -0
  294. package/types/lib.d.ts +10 -0
  295. package/types/test/typescriptTest.ts +27 -0
@@ -48,6 +48,11 @@ declare module 'stripe' {
48
48
  */
49
49
  invoice?: string;
50
50
 
51
+ /**
52
+ * 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.
53
+ */
54
+ margins?: Array<string>;
55
+
51
56
  /**
52
57
  * Set of [key-value pairs](https://docs.stripe.com/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`.
53
58
  */
@@ -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.
@@ -203,6 +252,11 @@ declare module 'stripe' {
203
252
  */
204
253
  expand?: Array<string>;
205
254
 
255
+ /**
256
+ * 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.
257
+ */
258
+ margins?: Stripe.Emptyable<Array<string>>;
259
+
206
260
  /**
207
261
  * Set of [key-value pairs](https://docs.stripe.com/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`.
208
262
  */
@@ -261,12 +315,56 @@ declare module 'stripe' {
261
315
  */
262
316
  discount?: string;
263
317
 
318
+ /**
319
+ * Details to determine how long the discount should be applied for.
320
+ */
321
+ discount_end?: Discount.DiscountEnd;
322
+
264
323
  /**
265
324
  * ID of the promotion code to create a new discount for.
266
325
  */
267
326
  promotion_code?: string;
268
327
  }
269
328
 
329
+ namespace Discount {
330
+ interface DiscountEnd {
331
+ /**
332
+ * Time span for the redeemed discount.
333
+ */
334
+ duration?: DiscountEnd.Duration;
335
+
336
+ /**
337
+ * A precise Unix timestamp for the discount to end. Must be in the future.
338
+ */
339
+ timestamp?: number;
340
+
341
+ /**
342
+ * The type of calculation made to determine when the discount ends.
343
+ */
344
+ type: DiscountEnd.Type;
345
+ }
346
+
347
+ namespace DiscountEnd {
348
+ interface Duration {
349
+ /**
350
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
351
+ */
352
+ interval: Duration.Interval;
353
+
354
+ /**
355
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
356
+ */
357
+ interval_count: number;
358
+ }
359
+
360
+ namespace Duration {
361
+ type Interval = 'day' | 'month' | 'week' | 'year';
362
+ }
363
+
364
+ type Type = 'duration' | 'timestamp';
365
+ }
366
+ }
367
+
270
368
  interface Period {
271
369
  /**
272
370
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -58,6 +58,16 @@ declare module 'stripe' {
58
58
  */
59
59
  livemode: boolean;
60
60
 
61
+ /**
62
+ * The amount of margin calculated per margin for this line item.
63
+ */
64
+ margin_amounts?: Array<InvoiceLineItem.MarginAmount> | null;
65
+
66
+ /**
67
+ * 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.
68
+ */
69
+ margins?: Array<string | Stripe.Margin> | null;
70
+
61
71
  /**
62
72
  * Set of [key-value pairs](https://docs.stripe.com/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.
63
73
  */
@@ -92,6 +102,11 @@ declare module 'stripe' {
92
102
  */
93
103
  subtotal: number;
94
104
 
105
+ /**
106
+ * The tax calculation identifiers of the line item.
107
+ */
108
+ tax_calculation_reference?: InvoiceLineItem.TaxCalculationReference | null;
109
+
95
110
  /**
96
111
  * The tax information of the line item.
97
112
  */
@@ -111,6 +126,18 @@ declare module 'stripe' {
111
126
  discount: string | Stripe.Discount | Stripe.DeletedDiscount;
112
127
  }
113
128
 
129
+ interface MarginAmount {
130
+ /**
131
+ * The amount, in cents (or local equivalent), of the reduction in line item amount.
132
+ */
133
+ amount: number;
134
+
135
+ /**
136
+ * The margin that was applied to get this margin amount.
137
+ */
138
+ margin: string | Stripe.Margin;
139
+ }
140
+
114
141
  interface Parent {
115
142
  /**
116
143
  * Details about the invoice item that generated this line item
@@ -258,6 +285,11 @@ declare module 'stripe' {
258
285
  */
259
286
  discount?: string | Stripe.Discount | Stripe.DeletedDiscount;
260
287
 
288
+ /**
289
+ * The margin that was applied to get this pretax credit amount.
290
+ */
291
+ margin?: string | Stripe.Margin;
292
+
261
293
  /**
262
294
  * Type of the pretax credit amount referenced.
263
295
  */
@@ -265,7 +297,7 @@ declare module 'stripe' {
265
297
  }
266
298
 
267
299
  namespace PretaxCreditAmount {
268
- type Type = 'credit_balance_transaction' | 'discount';
300
+ type Type = 'credit_balance_transaction' | 'discount' | 'margin';
269
301
  }
270
302
 
271
303
  interface Pricing {
@@ -356,6 +388,18 @@ declare module 'stripe' {
356
388
  tax_rate: string;
357
389
  }
358
390
  }
391
+
392
+ interface TaxCalculationReference {
393
+ /**
394
+ * The calculation identifier for tax calculation response.
395
+ */
396
+ calculation_id: string | null;
397
+
398
+ /**
399
+ * The calculation identifier for tax calculation response line item.
400
+ */
401
+ calculation_item_id: string | null;
402
+ }
359
403
  }
360
404
  }
361
405
  }
@@ -109,6 +109,11 @@ declare module 'stripe' {
109
109
  */
110
110
  amount_shipping: number;
111
111
 
112
+ /**
113
+ * List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
114
+ */
115
+ amounts_due?: Array<Invoice.AmountsDue> | null;
116
+
112
117
  /**
113
118
  * ID of the Connect Application that created the invoice.
114
119
  */
@@ -223,6 +228,11 @@ declare module 'stripe' {
223
228
  */
224
229
  customer_tax_ids?: Array<Invoice.CustomerTaxId> | null;
225
230
 
231
+ /**
232
+ * The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
233
+ */
234
+ default_margins?: Array<string | Stripe.Margin> | null;
235
+
226
236
  /**
227
237
  * 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.
228
238
  */
@@ -431,6 +441,11 @@ declare module 'stripe' {
431
441
  */
432
442
  total_excluding_tax: number | null;
433
443
 
444
+ /**
445
+ * The aggregate amounts calculated per margin across all line items.
446
+ */
447
+ total_margin_amounts?: Array<Invoice.TotalMarginAmount> | null;
448
+
434
449
  /**
435
450
  * 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.
436
451
  */
@@ -450,6 +465,52 @@ declare module 'stripe' {
450
465
  }
451
466
 
452
467
  namespace Invoice {
468
+ interface AmountsDue {
469
+ /**
470
+ * Incremental amount due for this payment in cents (or local equivalent).
471
+ */
472
+ amount: number;
473
+
474
+ /**
475
+ * The amount in cents (or local equivalent) that was paid for this payment.
476
+ */
477
+ amount_paid: number;
478
+
479
+ /**
480
+ * The difference between the payment's amount and amount_paid, in cents (or local equivalent).
481
+ */
482
+ amount_remaining: number;
483
+
484
+ /**
485
+ * Number of days from when invoice is finalized until the payment is due.
486
+ */
487
+ days_until_due: number | null;
488
+
489
+ /**
490
+ * An arbitrary string attached to the object. Often useful for displaying to users.
491
+ */
492
+ description: string | null;
493
+
494
+ /**
495
+ * Date on which a payment plan's payment is due.
496
+ */
497
+ due_date: number | null;
498
+
499
+ /**
500
+ * Timestamp when the payment was paid.
501
+ */
502
+ paid_at: number | null;
503
+
504
+ /**
505
+ * The status of the payment, one of `open`, `paid`, or `past_due`
506
+ */
507
+ status: AmountsDue.Status;
508
+ }
509
+
510
+ namespace AmountsDue {
511
+ type Status = 'open' | 'paid' | 'past_due';
512
+ }
513
+
453
514
  interface AutomaticTax {
454
515
  /**
455
516
  * If Stripe disabled automatic tax, this enum describes why.
@@ -886,6 +947,7 @@ declare module 'stripe' {
886
947
  | 'financial_connections_account_inactive'
887
948
  | 'financial_connections_account_pending_account_numbers'
888
949
  | 'financial_connections_account_unavailable_account_numbers'
950
+ | 'financial_connections_institution_unavailable'
889
951
  | 'financial_connections_no_successful_transaction_refresh'
890
952
  | 'forwarding_api_inactive'
891
953
  | 'forwarding_api_invalid_parameter'
@@ -984,6 +1046,7 @@ declare module 'stripe' {
984
1046
  | 'return_intent_already_processed'
985
1047
  | 'routing_number_invalid'
986
1048
  | 'secret_key_required'
1049
+ | 'sensitive_data_access_expired'
987
1050
  | 'sepa_unsupported_account'
988
1051
  | 'setup_attempt_failed'
989
1052
  | 'setup_intent_authentication_failure'
@@ -1003,6 +1066,7 @@ declare module 'stripe' {
1003
1066
  | 'taxes_calculation_failed'
1004
1067
  | 'terminal_location_country_unsupported'
1005
1068
  | 'terminal_reader_busy'
1069
+ | 'terminal_reader_collected_data_invalid'
1006
1070
  | 'terminal_reader_hardware_fault'
1007
1071
  | 'terminal_reader_invalid_location_for_activation'
1008
1072
  | 'terminal_reader_invalid_location_for_payment'
@@ -1015,7 +1079,9 @@ declare module 'stripe' {
1015
1079
  | 'token_in_use'
1016
1080
  | 'transfer_source_balance_parameters_mismatch'
1017
1081
  | 'transfers_not_allowed'
1018
- | 'url_invalid';
1082
+ | 'url_invalid'
1083
+ | 'v2_account_disconnection_unsupported'
1084
+ | 'v2_account_missing_configuration';
1019
1085
 
1020
1086
  type Type =
1021
1087
  | 'api_error'
@@ -1025,6 +1091,11 @@ declare module 'stripe' {
1025
1091
  }
1026
1092
 
1027
1093
  interface Parent {
1094
+ /**
1095
+ * Details about the billing cadence that generated this invoice
1096
+ */
1097
+ billing_cadence_details?: Parent.BillingCadenceDetails | null;
1098
+
1028
1099
  /**
1029
1100
  * Details about the quote that generated this invoice
1030
1101
  */
@@ -1042,6 +1113,13 @@ declare module 'stripe' {
1042
1113
  }
1043
1114
 
1044
1115
  namespace Parent {
1116
+ interface BillingCadenceDetails {
1117
+ /**
1118
+ * The billing cadence that generated this invoice
1119
+ */
1120
+ billing_cadence: string;
1121
+ }
1122
+
1045
1123
  interface QuoteDetails {
1046
1124
  /**
1047
1125
  * The quote that generated this invoice
@@ -1056,6 +1134,11 @@ declare module 'stripe' {
1056
1134
  */
1057
1135
  metadata: Stripe.Metadata | null;
1058
1136
 
1137
+ /**
1138
+ * 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://docs.stripe.com/billing/subscriptions/pause-payment).
1139
+ */
1140
+ pause_collection?: SubscriptionDetails.PauseCollection | null;
1141
+
1059
1142
  /**
1060
1143
  * The subscription that generated this invoice
1061
1144
  */
@@ -1067,7 +1150,28 @@ declare module 'stripe' {
1067
1150
  subscription_proration_date?: number;
1068
1151
  }
1069
1152
 
1070
- type Type = 'quote_details' | 'subscription_details';
1153
+ namespace SubscriptionDetails {
1154
+ interface PauseCollection {
1155
+ /**
1156
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1157
+ */
1158
+ behavior: PauseCollection.Behavior | null;
1159
+
1160
+ /**
1161
+ * The time after which the subscription will resume collecting payments.
1162
+ */
1163
+ resumes_at: number | null;
1164
+ }
1165
+
1166
+ namespace PauseCollection {
1167
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
1168
+ }
1169
+ }
1170
+
1171
+ type Type =
1172
+ | 'billing_cadence_details'
1173
+ | 'quote_details'
1174
+ | 'subscription_details';
1071
1175
  }
1072
1176
 
1073
1177
  interface PaymentSettings {
@@ -1109,6 +1213,11 @@ declare module 'stripe' {
1109
1213
  */
1110
1214
  customer_balance: PaymentMethodOptions.CustomerBalance | null;
1111
1215
 
1216
+ /**
1217
+ * If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent.
1218
+ */
1219
+ id_bank_transfer?: PaymentMethodOptions.IdBankTransfer | null;
1220
+
1112
1221
  /**
1113
1222
  * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
1114
1223
  */
@@ -1119,11 +1228,21 @@ declare module 'stripe' {
1119
1228
  */
1120
1229
  payto?: PaymentMethodOptions.Payto | null;
1121
1230
 
1231
+ /**
1232
+ * If paying by `pix`, this sub-hash contains details about the Pix payment method options to pass to the invoice's PaymentIntent.
1233
+ */
1234
+ pix?: PaymentMethodOptions.Pix | null;
1235
+
1122
1236
  /**
1123
1237
  * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent.
1124
1238
  */
1125
1239
  sepa_debit: PaymentMethodOptions.SepaDebit | null;
1126
1240
 
1241
+ /**
1242
+ * If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice's PaymentIntent.
1243
+ */
1244
+ upi?: PaymentMethodOptions.Upi | null;
1245
+
1127
1246
  /**
1128
1247
  * If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent.
1129
1248
  */
@@ -1219,6 +1338,8 @@ declare module 'stripe' {
1219
1338
  }
1220
1339
  }
1221
1340
 
1341
+ interface IdBankTransfer {}
1342
+
1222
1343
  interface Konbini {}
1223
1344
 
1224
1345
  interface Payto {
@@ -1261,8 +1382,51 @@ declare module 'stripe' {
1261
1382
  }
1262
1383
  }
1263
1384
 
1385
+ interface Pix {
1386
+ /**
1387
+ * Determines if the amount includes the IOF tax.
1388
+ */
1389
+ amount_includes_iof: Pix.AmountIncludesIof | null;
1390
+ }
1391
+
1392
+ namespace Pix {
1393
+ type AmountIncludesIof = 'always' | 'never';
1394
+ }
1395
+
1264
1396
  interface SepaDebit {}
1265
1397
 
1398
+ interface Upi {
1399
+ mandate_options?: Upi.MandateOptions;
1400
+ }
1401
+
1402
+ namespace Upi {
1403
+ interface MandateOptions {
1404
+ /**
1405
+ * Amount to be charged for future payments.
1406
+ */
1407
+ amount: number | null;
1408
+
1409
+ /**
1410
+ * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1411
+ */
1412
+ amount_type: MandateOptions.AmountType | null;
1413
+
1414
+ /**
1415
+ * A description of the mandate or subscription that is meant to be displayed to the customer.
1416
+ */
1417
+ description: string | null;
1418
+
1419
+ /**
1420
+ * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
1421
+ */
1422
+ end_date: number | null;
1423
+ }
1424
+
1425
+ namespace MandateOptions {
1426
+ type AmountType = 'fixed' | 'maximum';
1427
+ }
1428
+ }
1429
+
1266
1430
  interface UsBankAccount {
1267
1431
  financial_connections?: UsBankAccount.FinancialConnections;
1268
1432
 
@@ -1293,6 +1457,11 @@ declare module 'stripe' {
1293
1457
  * The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
1294
1458
  */
1295
1459
  account_subcategories?: Array<Filters.AccountSubcategory>;
1460
+
1461
+ /**
1462
+ * The institution to use to filter for possible accounts to link.
1463
+ */
1464
+ institution?: string;
1296
1465
  }
1297
1466
 
1298
1467
  namespace Filters {
@@ -1305,7 +1474,11 @@ declare module 'stripe' {
1305
1474
  | 'payment_method'
1306
1475
  | 'transactions';
1307
1476
 
1308
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1477
+ type Prefetch =
1478
+ | 'balances'
1479
+ | 'inferred_balances'
1480
+ | 'ownership'
1481
+ | 'transactions';
1309
1482
  }
1310
1483
 
1311
1484
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1331,6 +1504,7 @@ declare module 'stripe' {
1331
1504
  | 'fpx'
1332
1505
  | 'giropay'
1333
1506
  | 'grabpay'
1507
+ | 'id_bank_transfer'
1334
1508
  | 'ideal'
1335
1509
  | 'jp_credit_transfer'
1336
1510
  | 'kakao_pay'
@@ -1346,12 +1520,15 @@ declare module 'stripe' {
1346
1520
  | 'paynow'
1347
1521
  | 'paypal'
1348
1522
  | 'payto'
1523
+ | 'pix'
1349
1524
  | 'promptpay'
1350
1525
  | 'revolut_pay'
1351
1526
  | 'sepa_credit_transfer'
1352
1527
  | 'sepa_debit'
1353
1528
  | 'sofort'
1529
+ | 'stripe_balance'
1354
1530
  | 'swish'
1531
+ | 'upi'
1355
1532
  | 'us_bank_account'
1356
1533
  | 'wechat_pay';
1357
1534
  }
@@ -1549,6 +1726,18 @@ declare module 'stripe' {
1549
1726
  discount: string | Stripe.Discount | Stripe.DeletedDiscount;
1550
1727
  }
1551
1728
 
1729
+ interface TotalMarginAmount {
1730
+ /**
1731
+ * The amount, in cents (or local equivalent), of the reduction in line item amount.
1732
+ */
1733
+ amount: number;
1734
+
1735
+ /**
1736
+ * The margin that was applied to get this margin amount.
1737
+ */
1738
+ margin: string | Stripe.Margin;
1739
+ }
1740
+
1552
1741
  interface TotalPretaxCreditAmount {
1553
1742
  /**
1554
1743
  * The amount, in cents (or local equivalent), of the pretax credit amount.
@@ -1568,6 +1757,11 @@ declare module 'stripe' {
1568
1757
  */
1569
1758
  discount?: string | Stripe.Discount | Stripe.DeletedDiscount;
1570
1759
 
1760
+ /**
1761
+ * The margin that was applied to get this pretax credit amount.
1762
+ */
1763
+ margin?: string | Stripe.Margin;
1764
+
1571
1765
  /**
1572
1766
  * Type of the pretax credit amount referenced.
1573
1767
  */
@@ -1575,7 +1769,7 @@ declare module 'stripe' {
1575
1769
  }
1576
1770
 
1577
1771
  namespace TotalPretaxCreditAmount {
1578
- type Type = 'credit_balance_transaction' | 'discount';
1772
+ type Type = 'credit_balance_transaction' | 'discount' | 'margin';
1579
1773
  }
1580
1774
 
1581
1775
  interface TotalTax {