stripe 16.2.0 → 16.4.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 (158) hide show
  1. package/CHANGELOG.md +768 -109
  2. package/README.md +33 -0
  3. package/VERSION +1 -1
  4. package/cjs/RequestSender.js +66 -5
  5. package/cjs/ResourceNamespace.js +3 -0
  6. package/cjs/StripeResource.js +1 -1
  7. package/cjs/Webhooks.js +29 -17
  8. package/cjs/apiVersion.js +2 -1
  9. package/cjs/multipart.js +4 -1
  10. package/cjs/resources/AccountNotices.js +21 -0
  11. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  12. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  13. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  14. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  15. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  16. package/cjs/resources/GiftCards/Cards.js +23 -0
  17. package/cjs/resources/GiftCards/Transactions.js +33 -0
  18. package/cjs/resources/Invoices.js +13 -0
  19. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  20. package/cjs/resources/Margins.js +22 -0
  21. package/cjs/resources/OAuth.js +1 -1
  22. package/cjs/resources/Orders.js +24 -0
  23. package/cjs/resources/PaymentIntents.js +4 -0
  24. package/cjs/resources/QuotePhases.js +22 -0
  25. package/cjs/resources/Quotes.js +32 -0
  26. package/cjs/resources/SubscriptionSchedules.js +4 -0
  27. package/cjs/resources/Tax/Forms.js +20 -0
  28. package/cjs/resources/Terminal/Readers.js +12 -0
  29. package/cjs/resources.js +38 -10
  30. package/cjs/stripe.core.js +16 -7
  31. package/cjs/utils.js +30 -3
  32. package/esm/RequestSender.js +67 -6
  33. package/esm/ResourceNamespace.js +3 -0
  34. package/esm/StripeResource.js +2 -2
  35. package/esm/Webhooks.js +29 -17
  36. package/esm/apiVersion.js +1 -0
  37. package/esm/multipart.js +5 -2
  38. package/esm/resources/AccountNotices.js +18 -0
  39. package/esm/resources/Capital/FinancingOffers.js +18 -0
  40. package/esm/resources/Capital/FinancingSummary.js +9 -0
  41. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  42. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  43. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  44. package/esm/resources/GiftCards/Cards.js +20 -0
  45. package/esm/resources/GiftCards/Transactions.js +30 -0
  46. package/esm/resources/Invoices.js +13 -0
  47. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  48. package/esm/resources/Margins.js +19 -0
  49. package/esm/resources/OAuth.js +2 -2
  50. package/esm/resources/Orders.js +21 -0
  51. package/esm/resources/PaymentIntents.js +4 -0
  52. package/esm/resources/QuotePhases.js +19 -0
  53. package/esm/resources/Quotes.js +32 -0
  54. package/esm/resources/SubscriptionSchedules.js +4 -0
  55. package/esm/resources/Tax/Forms.js +17 -0
  56. package/esm/resources/Terminal/Readers.js +12 -0
  57. package/esm/resources.js +24 -0
  58. package/esm/stripe.core.js +16 -7
  59. package/esm/utils.js +27 -1
  60. package/package.json +1 -1
  61. package/types/AccountLinksResource.d.ts +5 -1
  62. package/types/AccountNotices.d.ts +110 -0
  63. package/types/AccountNoticesResource.d.ts +98 -0
  64. package/types/AccountSessions.d.ts +15 -0
  65. package/types/AccountSessionsResource.d.ts +205 -0
  66. package/types/Accounts.d.ts +88 -1
  67. package/types/AccountsResource.d.ts +204 -0
  68. package/types/BillingPortal/Sessions.d.ts +1 -1
  69. package/types/Capital/FinancingOffers.d.ts +188 -0
  70. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  71. package/types/Capital/FinancingSummary.d.ts +106 -0
  72. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  73. package/types/Capital/FinancingTransactions.d.ts +135 -0
  74. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  75. package/types/Charges.d.ts +67 -0
  76. package/types/ChargesResource.d.ts +1294 -0
  77. package/types/Checkout/Sessions.d.ts +28 -1
  78. package/types/Checkout/SessionsResource.d.ts +15 -1
  79. package/types/ConfirmationTokens.d.ts +83 -0
  80. package/types/Coupons.d.ts +1 -1
  81. package/types/CouponsResource.d.ts +1 -1
  82. package/types/CreditNotes.d.ts +21 -0
  83. package/types/CreditNotesResource.d.ts +51 -0
  84. package/types/CustomerSessions.d.ts +76 -0
  85. package/types/CustomerSessionsResource.d.ts +76 -0
  86. package/types/CustomersResource.d.ts +2 -0
  87. package/types/Disputes.d.ts +168 -0
  88. package/types/DisputesResource.d.ts +120 -0
  89. package/types/EventTypes.d.ts +426 -0
  90. package/types/Events.d.ts +83 -0
  91. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  92. package/types/FinancialConnections/Accounts.d.ts +29 -1
  93. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  94. package/types/FinancialConnections/Institutions.d.ts +93 -0
  95. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  96. package/types/FinancialConnections/Sessions.d.ts +49 -1
  97. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  98. package/types/GiftCards/Cards.d.ts +118 -0
  99. package/types/GiftCards/CardsResource.d.ts +159 -0
  100. package/types/GiftCards/Transactions.d.ts +129 -0
  101. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  102. package/types/InvoiceItems.d.ts +5 -0
  103. package/types/InvoiceItemsResource.d.ts +98 -0
  104. package/types/InvoiceLineItems.d.ts +22 -0
  105. package/types/InvoicePayments.d.ts +91 -0
  106. package/types/Invoices.d.ts +116 -6
  107. package/types/InvoicesResource.d.ts +5395 -1818
  108. package/types/Issuing/CardholdersResource.d.ts +2 -1
  109. package/types/Issuing/Cards.d.ts +34 -0
  110. package/types/Issuing/CardsResource.d.ts +125 -0
  111. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  112. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  113. package/types/LineItems.d.ts +7 -0
  114. package/types/Mandates.d.ts +77 -0
  115. package/types/Margins.d.ts +56 -0
  116. package/types/MarginsResource.d.ts +114 -0
  117. package/types/Orders.d.ts +1057 -0
  118. package/types/OrdersResource.d.ts +2711 -0
  119. package/types/PaymentIntents.d.ts +469 -6
  120. package/types/PaymentIntentsResource.d.ts +6721 -3373
  121. package/types/PaymentMethods.d.ts +62 -0
  122. package/types/PaymentMethodsResource.d.ts +110 -0
  123. package/types/Plans.d.ts +1 -1
  124. package/types/Prices.d.ts +23 -1
  125. package/types/PricesResource.d.ts +22 -0
  126. package/types/Products.d.ts +39 -0
  127. package/types/ProductsResource.d.ts +36 -0
  128. package/types/QuoteLines.d.ts +634 -0
  129. package/types/QuotePhases.d.ts +198 -0
  130. package/types/QuotePhasesResource.d.ts +67 -0
  131. package/types/QuotePreviewInvoices.d.ts +1530 -0
  132. package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
  133. package/types/Quotes.d.ts +578 -1
  134. package/types/QuotesResource.d.ts +3174 -265
  135. package/types/SetupAttempts.d.ts +9 -5
  136. package/types/SetupIntents.d.ts +110 -6
  137. package/types/SetupIntentsResource.d.ts +498 -3
  138. package/types/Sources.d.ts +23 -0
  139. package/types/SubscriptionItems.d.ts +21 -0
  140. package/types/SubscriptionItemsResource.d.ts +109 -0
  141. package/types/SubscriptionSchedules.d.ts +164 -0
  142. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  143. package/types/Subscriptions.d.ts +46 -1
  144. package/types/SubscriptionsResource.d.ts +350 -5
  145. package/types/Tax/Forms.d.ts +133 -0
  146. package/types/Tax/FormsResource.d.ts +90 -0
  147. package/types/Terminal/Readers.d.ts +278 -0
  148. package/types/Terminal/ReadersResource.d.ts +208 -0
  149. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  150. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  151. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  152. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  153. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  154. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  155. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  156. package/types/WebhookEndpointsResource.d.ts +50 -0
  157. package/types/index.d.ts +64 -0
  158. package/types/lib.d.ts +12 -0
@@ -82,6 +82,11 @@ declare module 'stripe' {
82
82
  */
83
83
  metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
84
84
 
85
+ /**
86
+ * A hash to configure risk controls on the account. Please see [this page for more details](https://docs.stripe.com/connect/pausing-payments-or-payouts-on-connected-accounts).
87
+ */
88
+ risk_controls?: AccountCreateParams.RiskControls;
89
+
85
90
  /**
86
91
  * Options for customizing how the account functions within Stripe.
87
92
  */
@@ -359,11 +364,26 @@ declare module 'stripe' {
359
364
  */
360
365
  paynow_payments?: Capabilities.PaynowPayments;
361
366
 
367
+ /**
368
+ * The paypal_payments capability.
369
+ */
370
+ paypal_payments?: Capabilities.PaypalPayments;
371
+
372
+ /**
373
+ * The payto_payments capability.
374
+ */
375
+ payto_payments?: Capabilities.PaytoPayments;
376
+
362
377
  /**
363
378
  * The promptpay_payments capability.
364
379
  */
365
380
  promptpay_payments?: Capabilities.PromptpayPayments;
366
381
 
382
+ /**
383
+ * The rechnung_payments capability.
384
+ */
385
+ rechnung_payments?: Capabilities.RechnungPayments;
386
+
367
387
  /**
368
388
  * The revolut_pay_payments capability.
369
389
  */
@@ -662,6 +682,20 @@ declare module 'stripe' {
662
682
  requested?: boolean;
663
683
  }
664
684
 
685
+ interface PaypalPayments {
686
+ /**
687
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
688
+ */
689
+ requested?: boolean;
690
+ }
691
+
692
+ interface PaytoPayments {
693
+ /**
694
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
695
+ */
696
+ requested?: boolean;
697
+ }
698
+
665
699
  interface PromptpayPayments {
666
700
  /**
667
701
  * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
@@ -669,6 +703,13 @@ declare module 'stripe' {
669
703
  requested?: boolean;
670
704
  }
671
705
 
706
+ interface RechnungPayments {
707
+ /**
708
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
709
+ */
710
+ requested?: boolean;
711
+ }
712
+
672
713
  interface RevolutPayPayments {
673
714
  /**
674
715
  * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
@@ -924,6 +965,16 @@ declare module 'stripe' {
924
965
  }
925
966
 
926
967
  interface Controller {
968
+ /**
969
+ * A hash of configuration describing the Connect application that controls the account.
970
+ */
971
+ application?: Controller.Application;
972
+
973
+ /**
974
+ * Properties of the account's dashboard.
975
+ */
976
+ dashboard?: Controller.Dashboard;
977
+
927
978
  /**
928
979
  * A hash of configuration for who pays Stripe fees for product usage on this account.
929
980
  */
@@ -946,6 +997,34 @@ declare module 'stripe' {
946
997
  }
947
998
 
948
999
  namespace Controller {
1000
+ interface Application {
1001
+ /**
1002
+ * Whether the controller is liable for losses on this account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).
1003
+ */
1004
+ loss_liable: boolean;
1005
+
1006
+ /**
1007
+ * Whether the controller owns onboarding for this account.
1008
+ */
1009
+ onboarding_owner?: boolean;
1010
+
1011
+ /**
1012
+ * Whether the controller has pricing controls for this account.
1013
+ */
1014
+ pricing_controls?: boolean;
1015
+ }
1016
+
1017
+ interface Dashboard {
1018
+ /**
1019
+ * Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`.
1020
+ */
1021
+ type?: Dashboard.Type;
1022
+ }
1023
+
1024
+ namespace Dashboard {
1025
+ type Type = 'express' | 'full' | 'none';
1026
+ }
1027
+
949
1028
  interface Fees {
950
1029
  /**
951
1030
  * A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior).
@@ -1310,6 +1389,36 @@ declare module 'stripe' {
1310
1389
  }
1311
1390
  }
1312
1391
 
1392
+ interface RiskControls {
1393
+ /**
1394
+ * Represents the risk control status of charges. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts).
1395
+ */
1396
+ charges?: RiskControls.Charges;
1397
+
1398
+ /**
1399
+ * Represents the risk control status of payouts. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts).
1400
+ */
1401
+ payouts?: RiskControls.Payouts;
1402
+ }
1403
+
1404
+ namespace RiskControls {
1405
+ interface Charges {
1406
+ /**
1407
+ * To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`.
1408
+ * There can be a delay before the risk control is paused or unpaused.
1409
+ */
1410
+ pause_requested?: boolean;
1411
+ }
1412
+
1413
+ interface Payouts {
1414
+ /**
1415
+ * To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`.
1416
+ * There can be a delay before the risk control is paused or unpaused.
1417
+ */
1418
+ pause_requested?: boolean;
1419
+ }
1420
+ }
1421
+
1313
1422
  interface Settings {
1314
1423
  /**
1315
1424
  * Settings specific to Bacs Direct Debit.
@@ -1341,6 +1450,11 @@ declare module 'stripe' {
1341
1450
  */
1342
1451
  payouts?: Settings.Payouts;
1343
1452
 
1453
+ /**
1454
+ * Settings specific to the account's tax forms.
1455
+ */
1456
+ tax_forms?: Settings.TaxForms;
1457
+
1344
1458
  /**
1345
1459
  * Settings specific to the account's Treasury FinancialAccounts.
1346
1460
  */
@@ -1510,6 +1624,13 @@ declare module 'stripe' {
1510
1624
  }
1511
1625
  }
1512
1626
 
1627
+ interface TaxForms {
1628
+ /**
1629
+ * Whether the account opted out of receiving their tax forms by postal delivery.
1630
+ */
1631
+ consented_to_paperless_delivery?: boolean;
1632
+ }
1633
+
1513
1634
  interface Treasury {
1514
1635
  /**
1515
1636
  * Details on the account's acceptance of the Stripe Treasury Services Agreement.
@@ -1644,6 +1765,11 @@ declare module 'stripe' {
1644
1765
  */
1645
1766
  metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
1646
1767
 
1768
+ /**
1769
+ * A hash to configure risk controls on the account. Please see [this page for more details](https://docs.stripe.com/connect/pausing-payments-or-payouts-on-connected-accounts).
1770
+ */
1771
+ risk_controls?: AccountUpdateParams.RiskControls;
1772
+
1647
1773
  /**
1648
1774
  * Options for customizing how the account functions within Stripe.
1649
1775
  */
@@ -1954,11 +2080,26 @@ declare module 'stripe' {
1954
2080
  */
1955
2081
  paynow_payments?: Capabilities.PaynowPayments;
1956
2082
 
2083
+ /**
2084
+ * The paypal_payments capability.
2085
+ */
2086
+ paypal_payments?: Capabilities.PaypalPayments;
2087
+
2088
+ /**
2089
+ * The payto_payments capability.
2090
+ */
2091
+ payto_payments?: Capabilities.PaytoPayments;
2092
+
1957
2093
  /**
1958
2094
  * The promptpay_payments capability.
1959
2095
  */
1960
2096
  promptpay_payments?: Capabilities.PromptpayPayments;
1961
2097
 
2098
+ /**
2099
+ * The rechnung_payments capability.
2100
+ */
2101
+ rechnung_payments?: Capabilities.RechnungPayments;
2102
+
1962
2103
  /**
1963
2104
  * The revolut_pay_payments capability.
1964
2105
  */
@@ -2257,6 +2398,20 @@ declare module 'stripe' {
2257
2398
  requested?: boolean;
2258
2399
  }
2259
2400
 
2401
+ interface PaypalPayments {
2402
+ /**
2403
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
2404
+ */
2405
+ requested?: boolean;
2406
+ }
2407
+
2408
+ interface PaytoPayments {
2409
+ /**
2410
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
2411
+ */
2412
+ requested?: boolean;
2413
+ }
2414
+
2260
2415
  interface PromptpayPayments {
2261
2416
  /**
2262
2417
  * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
@@ -2264,6 +2419,13 @@ declare module 'stripe' {
2264
2419
  requested?: boolean;
2265
2420
  }
2266
2421
 
2422
+ interface RechnungPayments {
2423
+ /**
2424
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
2425
+ */
2426
+ requested?: boolean;
2427
+ }
2428
+
2267
2429
  interface RevolutPayPayments {
2268
2430
  /**
2269
2431
  * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
@@ -2852,6 +3014,36 @@ declare module 'stripe' {
2852
3014
  }
2853
3015
  }
2854
3016
 
3017
+ interface RiskControls {
3018
+ /**
3019
+ * Represents the risk control status of charges. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts).
3020
+ */
3021
+ charges?: RiskControls.Charges;
3022
+
3023
+ /**
3024
+ * Represents the risk control status of payouts. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts).
3025
+ */
3026
+ payouts?: RiskControls.Payouts;
3027
+ }
3028
+
3029
+ namespace RiskControls {
3030
+ interface Charges {
3031
+ /**
3032
+ * To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`.
3033
+ * There can be a delay before the risk control is paused or unpaused.
3034
+ */
3035
+ pause_requested?: boolean;
3036
+ }
3037
+
3038
+ interface Payouts {
3039
+ /**
3040
+ * To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`.
3041
+ * There can be a delay before the risk control is paused or unpaused.
3042
+ */
3043
+ pause_requested?: boolean;
3044
+ }
3045
+ }
3046
+
2855
3047
  interface Settings {
2856
3048
  /**
2857
3049
  * Settings specific to Bacs Direct Debit payments.
@@ -2888,6 +3080,11 @@ declare module 'stripe' {
2888
3080
  */
2889
3081
  payouts?: Settings.Payouts;
2890
3082
 
3083
+ /**
3084
+ * Settings specific to the account's tax forms.
3085
+ */
3086
+ tax_forms?: Settings.TaxForms;
3087
+
2891
3088
  /**
2892
3089
  * Settings specific to the account's Treasury FinancialAccounts.
2893
3090
  */
@@ -3064,6 +3261,13 @@ declare module 'stripe' {
3064
3261
  }
3065
3262
  }
3066
3263
 
3264
+ interface TaxForms {
3265
+ /**
3266
+ * Whether the account opted out of receiving their tax forms by postal delivery.
3267
+ */
3268
+ consented_to_paperless_delivery?: boolean;
3269
+ }
3270
+
3067
3271
  interface Treasury {
3068
3272
  /**
3069
3273
  * Details on the account's acceptance of the Stripe Treasury Services Agreement.
@@ -17,7 +17,7 @@ declare module 'stripe' {
17
17
  * Create sessions on-demand when customers intend to manage their subscriptions
18
18
  * and billing details.
19
19
  *
20
- * Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal).
20
+ * Related guide: [Customer management](https://stripe.com/customer-management)
21
21
  */
22
22
  interface Session {
23
23
  /**
@@ -0,0 +1,188 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Capital {
6
+ /**
7
+ * This is an object representing an offer of financing from
8
+ * Stripe Capital to a Connect subaccount.
9
+ */
10
+ interface FinancingOffer {
11
+ /**
12
+ * A unique identifier for the financing object.
13
+ */
14
+ id: string;
15
+
16
+ /**
17
+ * The object type: financing_offer.
18
+ */
19
+ object: 'capital.financing_offer';
20
+
21
+ /**
22
+ * This is an object representing the terms of an offer of financing from
23
+ * Stripe Capital to a Connected account. This resource represents
24
+ * the terms accepted by the Connected account, which may differ from those
25
+ * offered.
26
+ */
27
+ accepted_terms?: FinancingOffer.AcceptedTerms;
28
+
29
+ /**
30
+ * The ID of the merchant associated with this financing object.
31
+ */
32
+ account: string;
33
+
34
+ /**
35
+ * The time at which this financing offer was charged off, if applicable. Given in seconds since unix epoch.
36
+ */
37
+ charged_off_at?: number;
38
+
39
+ /**
40
+ * Time at which the offer was created. Given in seconds since unix epoch.
41
+ */
42
+ created: number;
43
+
44
+ /**
45
+ * Time at which the offer expires. Given in seconds since unix epoch.
46
+ */
47
+ expires_after: number;
48
+
49
+ /**
50
+ * The type of financing being offered.
51
+ */
52
+ financing_type?: FinancingOffer.FinancingType;
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
+ /**
60
+ * 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.
61
+ */
62
+ metadata?: Stripe.Metadata;
63
+
64
+ /**
65
+ * This is an object representing the terms of an offer of financing from
66
+ * Stripe Capital to a Connected account. This resource represents
67
+ * both the terms offered to the Connected account.
68
+ */
69
+ offered_terms?: FinancingOffer.OfferedTerms;
70
+
71
+ /**
72
+ * Financing product identifier.
73
+ */
74
+ product_type?: FinancingOffer.ProductType;
75
+
76
+ /**
77
+ * The ID of the financing offer that replaced this offer.
78
+ */
79
+ replacement?: string;
80
+
81
+ /**
82
+ * The ID of the financing offer that this offer is a replacement for.
83
+ */
84
+ replacement_for?: string;
85
+
86
+ /**
87
+ * The current status of the offer.
88
+ */
89
+ status: FinancingOffer.Status;
90
+
91
+ /**
92
+ * See [financing_type](https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type).
93
+ */
94
+ type?: FinancingOffer.Type;
95
+ }
96
+
97
+ namespace FinancingOffer {
98
+ interface AcceptedTerms {
99
+ /**
100
+ * Amount of financing offered, in minor units.
101
+ */
102
+ advance_amount: number;
103
+
104
+ /**
105
+ * Currency that the financing offer is transacted in. For example, `usd`.
106
+ */
107
+ currency: string;
108
+
109
+ /**
110
+ * Fixed fee amount, in minor units.
111
+ */
112
+ fee_amount: number;
113
+
114
+ /**
115
+ * Populated when the `product_type` of the `financingoffer` is `refill`.
116
+ * Represents the discount amount on remaining premium for the existing loan at payout time.
117
+ */
118
+ previous_financing_fee_discount_amount: number | null;
119
+
120
+ /**
121
+ * Per-transaction rate at which Stripe will withhold funds to repay the financing.
122
+ */
123
+ withhold_rate: number;
124
+ }
125
+
126
+ type FinancingType = 'cash_advance' | 'flex_loan';
127
+
128
+ interface OfferedTerms {
129
+ /**
130
+ * Amount of financing offered, in minor units.
131
+ */
132
+ advance_amount: number;
133
+
134
+ /**
135
+ * Describes the type of user the offer is being extended to.
136
+ */
137
+ campaign_type: OfferedTerms.CampaignType;
138
+
139
+ /**
140
+ * Currency that the financing offer is transacted in. For example, `usd`.
141
+ */
142
+ currency: string;
143
+
144
+ /**
145
+ * Fixed fee amount, in minor units.
146
+ */
147
+ fee_amount: number;
148
+
149
+ /**
150
+ * Populated when the `product_type` of the `financingoffer` is `refill`.
151
+ * Represents the discount rate percentage on remaining fee on the existing loan. When the `financing_offer`
152
+ * is paid out, the `previous_financing_fee_discount_amount` will be computed as the multiple of this rate
153
+ * and the remaining fee.
154
+ */
155
+ previous_financing_fee_discount_rate: number | null;
156
+
157
+ /**
158
+ * Per-transaction rate at which Stripe will withhold funds to repay the financing.
159
+ */
160
+ withhold_rate: number;
161
+ }
162
+
163
+ namespace OfferedTerms {
164
+ type CampaignType =
165
+ | 'newly_eligible_user'
166
+ | 'previously_eligible_user'
167
+ | 'repeat_user';
168
+ }
169
+
170
+ type ProductType = 'refill' | 'standard';
171
+
172
+ type Status =
173
+ | 'accepted'
174
+ | 'canceled'
175
+ | 'completed'
176
+ | 'delivered'
177
+ | 'expired'
178
+ | 'fully_repaid'
179
+ | 'paid_out'
180
+ | 'rejected'
181
+ | 'replaced'
182
+ | 'undelivered';
183
+
184
+ type Type = 'cash_advance' | 'flex_loan';
185
+ }
186
+ }
187
+ }
188
+ }
@@ -0,0 +1,97 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Capital {
6
+ interface FinancingOfferRetrieveParams {
7
+ /**
8
+ * Specifies which fields in the response should be expanded.
9
+ */
10
+ expand?: Array<string>;
11
+ }
12
+
13
+ interface FinancingOfferListParams extends PaginationParams {
14
+ /**
15
+ * limit list to offers belonging to given connected account
16
+ */
17
+ connected_account?: string;
18
+
19
+ /**
20
+ * Only return offers that were created during the given date interval.
21
+ */
22
+ created?: Stripe.RangeQueryParam | number;
23
+
24
+ /**
25
+ * Specifies which fields in the response should be expanded.
26
+ */
27
+ expand?: Array<string>;
28
+
29
+ /**
30
+ * limit list to offers with given status
31
+ */
32
+ status?: FinancingOfferListParams.Status;
33
+ }
34
+
35
+ namespace FinancingOfferListParams {
36
+ type Status =
37
+ | 'accepted'
38
+ | 'canceled'
39
+ | 'completed'
40
+ | 'delivered'
41
+ | 'expired'
42
+ | 'fully_repaid'
43
+ | 'paid_out'
44
+ | 'rejected'
45
+ | 'revoked'
46
+ | 'undelivered';
47
+ }
48
+
49
+ interface FinancingOfferMarkDeliveredParams {
50
+ /**
51
+ * Specifies which fields in the response should be expanded.
52
+ */
53
+ expand?: Array<string>;
54
+ }
55
+
56
+ class FinancingOffersResource {
57
+ /**
58
+ * Get the details of the financing offer
59
+ */
60
+ retrieve(
61
+ id: string,
62
+ params?: FinancingOfferRetrieveParams,
63
+ options?: RequestOptions
64
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
65
+ retrieve(
66
+ id: string,
67
+ options?: RequestOptions
68
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
69
+
70
+ /**
71
+ * Retrieves the financing offers available for Connected accounts that belong to your platform.
72
+ */
73
+ list(
74
+ params?: FinancingOfferListParams,
75
+ options?: RequestOptions
76
+ ): ApiListPromise<Stripe.Capital.FinancingOffer>;
77
+ list(
78
+ options?: RequestOptions
79
+ ): ApiListPromise<Stripe.Capital.FinancingOffer>;
80
+
81
+ /**
82
+ * Acknowledges that platform has received and delivered the financing_offer to
83
+ * the intended merchant recipient.
84
+ */
85
+ markDelivered(
86
+ id: string,
87
+ params?: FinancingOfferMarkDeliveredParams,
88
+ options?: RequestOptions
89
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
90
+ markDelivered(
91
+ id: string,
92
+ options?: RequestOptions
93
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
94
+ }
95
+ }
96
+ }
97
+ }