stripe 17.2.1 → 17.3.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 (186) hide show
  1. package/CHANGELOG.md +925 -114
  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 +211 -3
  57. package/types/AccountsResource.d.ts +584 -2
  58. package/types/Billing/CreditBalanceSummary.d.ts +4 -4
  59. package/types/Billing/CreditBalanceSummaryResource.d.ts +2 -2
  60. package/types/Billing/CreditBalanceTransactions.d.ts +10 -10
  61. package/types/Billing/CreditGrants.d.ts +11 -8
  62. package/types/Billing/CreditGrantsResource.d.ts +6 -6
  63. package/types/Billing/MeterErrorReports.d.ts +106 -0
  64. package/types/Billing/Meters.d.ts +2 -0
  65. package/types/BillingPortal/Configurations.d.ts +22 -0
  66. package/types/BillingPortal/ConfigurationsResource.d.ts +56 -4
  67. package/types/Capital/FinancingOffers.d.ts +188 -0
  68. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  69. package/types/Capital/FinancingSummary.d.ts +106 -0
  70. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  71. package/types/Capital/FinancingTransactions.d.ts +135 -0
  72. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  73. package/types/Charges.d.ts +168 -0
  74. package/types/ChargesResource.d.ts +1294 -0
  75. package/types/Checkout/Sessions.d.ts +309 -5
  76. package/types/Checkout/SessionsResource.d.ts +360 -5
  77. package/types/ConfirmationTokens.d.ts +157 -0
  78. package/types/Coupons.d.ts +1 -1
  79. package/types/CouponsResource.d.ts +1 -1
  80. package/types/CreditNoteLineItems.d.ts +3 -0
  81. package/types/CreditNotes.d.ts +24 -0
  82. package/types/CreditNotesResource.d.ts +54 -3
  83. package/types/CustomersResource.d.ts +27 -3
  84. package/types/Disputes.d.ts +152 -0
  85. package/types/DisputesResource.d.ts +120 -0
  86. package/types/EventTypes.d.ts +564 -2
  87. package/types/Events.d.ts +91 -0
  88. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  89. package/types/FinancialConnections/Accounts.d.ts +29 -1
  90. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  91. package/types/FinancialConnections/Institutions.d.ts +93 -0
  92. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  93. package/types/FinancialConnections/Sessions.d.ts +49 -1
  94. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  95. package/types/Forwarding/Requests.d.ts +5 -0
  96. package/types/Forwarding/RequestsResource.d.ts +5 -0
  97. package/types/GiftCards/Cards.d.ts +118 -0
  98. package/types/GiftCards/CardsResource.d.ts +159 -0
  99. package/types/GiftCards/Transactions.d.ts +129 -0
  100. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  101. package/types/InvoiceItems.d.ts +5 -0
  102. package/types/InvoiceItemsResource.d.ts +98 -0
  103. package/types/InvoiceLineItems.d.ts +31 -1
  104. package/types/InvoicePayments.d.ts +138 -0
  105. package/types/Invoices.d.ts +139 -3
  106. package/types/InvoicesResource.d.ts +5488 -1799
  107. package/types/Issuing/CardholdersResource.d.ts +2 -1
  108. package/types/Issuing/CardsResource.d.ts +1 -1
  109. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  110. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  111. package/types/Issuing/DisputeSettlementDetails.d.ts +73 -0
  112. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  113. package/types/Issuing/Settlements.d.ts +103 -0
  114. package/types/Issuing/Transactions.d.ts +2 -0
  115. package/types/Issuing/TransactionsResource.d.ts +5 -0
  116. package/types/LineItems.d.ts +7 -0
  117. package/types/Mandates.d.ts +85 -0
  118. package/types/Margins.d.ts +56 -0
  119. package/types/MarginsResource.d.ts +114 -0
  120. package/types/Orders.d.ts +1154 -0
  121. package/types/OrdersResource.d.ts +2911 -0
  122. package/types/PaymentIntents.d.ts +697 -1
  123. package/types/PaymentIntentsResource.d.ts +7977 -3377
  124. package/types/PaymentLinks.d.ts +7 -0
  125. package/types/PaymentLinksResource.d.ts +14 -0
  126. package/types/PaymentMethodConfigurations.d.ts +72 -0
  127. package/types/PaymentMethodConfigurationsResource.d.ts +102 -2
  128. package/types/PaymentMethodDomains.d.ts +28 -0
  129. package/types/PaymentMethods.d.ts +157 -0
  130. package/types/PaymentMethodsResource.d.ts +195 -1
  131. package/types/Persons.d.ts +1 -1
  132. package/types/Prices.d.ts +22 -0
  133. package/types/PricesResource.d.ts +22 -0
  134. package/types/Products.d.ts +39 -0
  135. package/types/ProductsResource.d.ts +36 -0
  136. package/types/QuoteLines.d.ts +634 -0
  137. package/types/QuotePreviewInvoices.d.ts +1601 -0
  138. package/types/QuotePreviewSubscriptionSchedules.d.ts +814 -0
  139. package/types/Quotes.d.ts +591 -1
  140. package/types/QuotesResource.d.ts +2526 -194
  141. package/types/Refunds.d.ts +4 -0
  142. package/types/SetupAttempts.d.ts +19 -0
  143. package/types/SetupIntents.d.ts +112 -1
  144. package/types/SetupIntentsResource.d.ts +768 -6
  145. package/types/Sources.d.ts +23 -0
  146. package/types/SubscriptionItems.d.ts +21 -0
  147. package/types/SubscriptionItemsResource.d.ts +109 -0
  148. package/types/SubscriptionSchedules.d.ts +200 -0
  149. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  150. package/types/Subscriptions.d.ts +87 -1
  151. package/types/SubscriptionsResource.d.ts +359 -4
  152. package/types/Tax/Associations.d.ts +126 -0
  153. package/types/Tax/AssociationsResource.d.ts +29 -0
  154. package/types/Tax/CalculationLineItems.d.ts +1 -0
  155. package/types/Tax/Calculations.d.ts +33 -1
  156. package/types/Tax/CalculationsResource.d.ts +7 -1
  157. package/types/Tax/Forms.d.ts +220 -0
  158. package/types/Tax/FormsResource.d.ts +107 -0
  159. package/types/Tax/Registrations.d.ts +82 -0
  160. package/types/Tax/RegistrationsResource.d.ts +109 -0
  161. package/types/Tax/Transactions.d.ts +8 -1
  162. package/types/TaxIds.d.ts +7 -1
  163. package/types/TaxIdsResource.d.ts +7 -1
  164. package/types/TaxRates.d.ts +25 -0
  165. package/types/TaxRatesResource.d.ts +2 -0
  166. package/types/Terminal/Configurations.d.ts +19 -0
  167. package/types/Terminal/ConfigurationsResource.d.ts +44 -0
  168. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  169. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  170. package/types/Terminal/Readers.d.ts +278 -0
  171. package/types/Terminal/ReadersResource.d.ts +215 -0
  172. package/types/TestHelpers/ConfirmationTokensResource.d.ts +145 -1
  173. package/types/TestHelpers/Issuing/CardsResource.d.ts +22 -0
  174. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  175. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  176. package/types/TokensResource.d.ts +2 -2
  177. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  178. package/types/Treasury/FinancialAccounts.d.ts +6 -1
  179. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  180. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  181. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  182. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  183. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  184. package/types/UsageRecordSummaries.d.ts +1 -1
  185. package/types/WebhookEndpointsResource.d.ts +66 -0
  186. package/types/index.d.ts +53 -0
@@ -4,7 +4,7 @@ declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  namespace Billing {
6
6
  /**
7
- * Indicates the credit balance for credits granted to a customer.
7
+ * Indicates the billing credit balance for billing credits granted to a customer.
8
8
  */
9
9
  interface CreditBalanceSummary {
10
10
  /**
@@ -13,7 +13,7 @@ declare module 'stripe' {
13
13
  object: 'billing.credit_balance_summary';
14
14
 
15
15
  /**
16
- * The credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
16
+ * The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
17
17
  */
18
18
  balances: Array<CreditBalanceSummary.Balance>;
19
19
 
@@ -43,7 +43,7 @@ declare module 'stripe' {
43
43
  monetary: AvailableBalance.Monetary | null;
44
44
 
45
45
  /**
46
- * The type of this amount. We currently only support `monetary` credits.
46
+ * The type of this amount. We currently only support `monetary` billing credits.
47
47
  */
48
48
  type: 'monetary';
49
49
  }
@@ -69,7 +69,7 @@ declare module 'stripe' {
69
69
  monetary: LedgerBalance.Monetary | null;
70
70
 
71
71
  /**
72
- * The type of this amount. We currently only support `monetary` credits.
72
+ * The type of this amount. We currently only support `monetary` billing credits.
73
73
  */
74
74
  type: 'monetary';
75
75
  }
@@ -23,12 +23,12 @@ declare module 'stripe' {
23
23
  namespace CreditBalanceSummaryRetrieveParams {
24
24
  interface Filter {
25
25
  /**
26
- * The credit applicability scope for which to fetch balance summary.
26
+ * The billing credit applicability scope for which to fetch credit balance summary.
27
27
  */
28
28
  applicability_scope?: Filter.ApplicabilityScope;
29
29
 
30
30
  /**
31
- * The credit grant for which to fetch balance summary.
31
+ * The credit grant for which to fetch credit balance summary.
32
32
  */
33
33
  credit_grant?: string;
34
34
 
@@ -23,22 +23,22 @@ declare module 'stripe' {
23
23
  created: number;
24
24
 
25
25
  /**
26
- * Credit details for this balance transaction. Only present if type is `credit`.
26
+ * Credit details for this credit balance transaction. Only present if type is `credit`.
27
27
  */
28
28
  credit: CreditBalanceTransaction.Credit | null;
29
29
 
30
30
  /**
31
- * The credit grant associated with this balance transaction.
31
+ * The credit grant associated with this credit balance transaction.
32
32
  */
33
33
  credit_grant: string | Stripe.Billing.CreditGrant;
34
34
 
35
35
  /**
36
- * Debit details for this balance transaction. Only present if type is `debit`.
36
+ * Debit details for this credit balance transaction. Only present if type is `debit`.
37
37
  */
38
38
  debit: CreditBalanceTransaction.Debit | null;
39
39
 
40
40
  /**
41
- * The effective time of this balance transaction.
41
+ * The effective time of this credit balance transaction.
42
42
  */
43
43
  effective_at: number;
44
44
 
@@ -53,7 +53,7 @@ declare module 'stripe' {
53
53
  test_clock: string | Stripe.TestHelpers.TestClock | null;
54
54
 
55
55
  /**
56
- * The type of balance transaction (credit or debit).
56
+ * The type of credit balance transaction (credit or debit).
57
57
  */
58
58
  type: CreditBalanceTransaction.Type | null;
59
59
  }
@@ -76,7 +76,7 @@ declare module 'stripe' {
76
76
  monetary: Amount.Monetary | null;
77
77
 
78
78
  /**
79
- * The type of this amount. We currently only support `monetary` credits.
79
+ * The type of this amount. We currently only support `monetary` billing credits.
80
80
  */
81
81
  type: 'monetary';
82
82
  }
@@ -100,7 +100,7 @@ declare module 'stripe' {
100
100
  amount: Debit.Amount;
101
101
 
102
102
  /**
103
- * Details of how the credits were applied to an invoice. Only present if `type` is `credits_applied`.
103
+ * Details of how the billing credits were applied to an invoice. Only present if `type` is `credits_applied`.
104
104
  */
105
105
  credits_applied: Debit.CreditsApplied | null;
106
106
 
@@ -118,7 +118,7 @@ declare module 'stripe' {
118
118
  monetary: Amount.Monetary | null;
119
119
 
120
120
  /**
121
- * The type of this amount. We currently only support `monetary` credits.
121
+ * The type of this amount. We currently only support `monetary` billing credits.
122
122
  */
123
123
  type: 'monetary';
124
124
  }
@@ -139,12 +139,12 @@ declare module 'stripe' {
139
139
 
140
140
  interface CreditsApplied {
141
141
  /**
142
- * The invoice to which the credits were applied.
142
+ * The invoice to which the billing credits were applied.
143
143
  */
144
144
  invoice: string | Stripe.Invoice;
145
145
 
146
146
  /**
147
- * The invoice line item to which the credits were applied.
147
+ * The invoice line item to which the billing credits were applied.
148
148
  */
149
149
  invoice_line_item: string;
150
150
  }
@@ -4,7 +4,10 @@ declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  namespace Billing {
6
6
  /**
7
- * A credit grant is a resource that records a grant of some credit to a customer.
7
+ * A credit grant is an API resource that documents the allocation of some billing credits to a customer.
8
+ *
9
+ * Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
10
+ * end
8
11
  */
9
12
  interface CreditGrant {
10
13
  /**
@@ -22,7 +25,7 @@ declare module 'stripe' {
22
25
  applicability_config: CreditGrant.ApplicabilityConfig;
23
26
 
24
27
  /**
25
- * The category of this credit grant.
28
+ * The category of this credit grant. This is for tracking purposes and will not be displayed to the customer.
26
29
  */
27
30
  category: CreditGrant.Category;
28
31
 
@@ -32,17 +35,17 @@ declare module 'stripe' {
32
35
  created: number;
33
36
 
34
37
  /**
35
- * Id of the customer to whom the credit was granted.
38
+ * ID of the customer to whom the billing credits are granted.
36
39
  */
37
40
  customer: string | Stripe.Customer | Stripe.DeletedCustomer;
38
41
 
39
42
  /**
40
- * The time when the credit becomes effective i.e when it is eligible to be used.
43
+ * The time when the billing credits become effective i.e when they are eligible to be used.
41
44
  */
42
45
  effective_at: number | null;
43
46
 
44
47
  /**
45
- * The time when the credit will expire. If not present, the credit will never expire.
48
+ * The time when the billing credits will expire. If not present, the billing credits will never expire.
46
49
  */
47
50
  expires_at: number | null;
48
51
 
@@ -57,7 +60,7 @@ declare module 'stripe' {
57
60
  metadata: Stripe.Metadata;
58
61
 
59
62
  /**
60
- * A descriptive name shown in dashboard and on invoices.
63
+ * A descriptive name shown in dashboard.
61
64
  */
62
65
  name: string | null;
63
66
 
@@ -85,7 +88,7 @@ declare module 'stripe' {
85
88
  monetary: Amount.Monetary | null;
86
89
 
87
90
  /**
88
- * The type of this amount. We currently only support `monetary` credits.
91
+ * The type of this amount. We currently only support `monetary` billing credits.
89
92
  */
90
93
  type: 'monetary';
91
94
  }
@@ -111,7 +114,7 @@ declare module 'stripe' {
111
114
  namespace ApplicabilityConfig {
112
115
  interface Scope {
113
116
  /**
114
- * The price type to which credit grants can apply to. We currently only support `metered` price type.
117
+ * The price type to which credit grants can apply to. We currently only support `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
115
118
  */
116
119
  price_type: 'metered';
117
120
  }
@@ -20,12 +20,12 @@ declare module 'stripe' {
20
20
  category: CreditGrantCreateParams.Category;
21
21
 
22
22
  /**
23
- * Id of the customer to whom the credit should be granted.
23
+ * ID of the customer to whom the billing credits should be granted.
24
24
  */
25
25
  customer: string;
26
26
 
27
27
  /**
28
- * The time when the credit becomes effective i.e when it is eligible to be used. Defaults to the current timestamp if not specified.
28
+ * The time when the billing credits become effective i.e when they are eligible to be used. Defaults to the current timestamp if not specified.
29
29
  */
30
30
  effective_at?: number;
31
31
 
@@ -35,7 +35,7 @@ declare module 'stripe' {
35
35
  expand?: Array<string>;
36
36
 
37
37
  /**
38
- * The time when the credit will expire. If not specified, the credit will never expire.
38
+ * The time when the billing credits will expire. If not specified, the billing credits will never expire.
39
39
  */
40
40
  expires_at?: number;
41
41
 
@@ -45,7 +45,7 @@ declare module 'stripe' {
45
45
  metadata?: Stripe.MetadataParam;
46
46
 
47
47
  /**
48
- * A descriptive name shown in dashboard and on invoices.
48
+ * A descriptive name shown in dashboard.
49
49
  */
50
50
  name?: string;
51
51
  }
@@ -58,7 +58,7 @@ declare module 'stripe' {
58
58
  monetary?: Amount.Monetary;
59
59
 
60
60
  /**
61
- * Specify the type of this amount. We currently only support `monetary` credits.
61
+ * Specify the type of this amount. We currently only support `monetary` billing credits.
62
62
  */
63
63
  type: 'monetary';
64
64
  }
@@ -110,7 +110,7 @@ declare module 'stripe' {
110
110
  expand?: Array<string>;
111
111
 
112
112
  /**
113
- * The time when the credit created by this credit grant will expire. If set to empty, the credit will never expire.
113
+ * The time when the billing credits created by this credit grant will expire. If set to empty, the billing credits will never expire.
114
114
  */
115
115
  expires_at?: Stripe.Emptyable<number>;
116
116
 
@@ -0,0 +1,106 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Billing {
6
+ /**
7
+ * The MeterErrorReport object.
8
+ */
9
+ interface MeterErrorReport {
10
+ /**
11
+ * Unique identifier for the object.
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * String representing the object's type. Objects of the same type share the same value.
17
+ */
18
+ object: 'billing.meter_error_report';
19
+
20
+ reason: MeterErrorReport.Reason;
21
+
22
+ /**
23
+ * The related objects about the error
24
+ */
25
+ related_object: MeterErrorReport.RelatedObject | null;
26
+
27
+ /**
28
+ * Summary of invalid events
29
+ */
30
+ summary: string;
31
+
32
+ /**
33
+ * Time when validation ended. Measured in seconds since the Unix epoch
34
+ */
35
+ validation_end: number;
36
+
37
+ /**
38
+ * Time when validation started. Measured in seconds since the Unix epoch
39
+ */
40
+ validation_start: number;
41
+ }
42
+
43
+ namespace MeterErrorReport {
44
+ interface Reason {
45
+ /**
46
+ * The number of errors generated
47
+ */
48
+ error_count: number;
49
+
50
+ /**
51
+ * More information about errors
52
+ */
53
+ error_types: Array<Reason.ErrorType>;
54
+ }
55
+
56
+ namespace Reason {
57
+ interface ErrorType {
58
+ sample_errors: Array<ErrorType.SampleError>;
59
+ }
60
+
61
+ namespace ErrorType {
62
+ interface SampleError {
63
+ api_request: SampleError.ApiRequest | null;
64
+
65
+ /**
66
+ * message of the error
67
+ */
68
+ error_message: string;
69
+ }
70
+
71
+ namespace SampleError {
72
+ interface ApiRequest {
73
+ /**
74
+ * Unique identifier for the object.
75
+ */
76
+ id: string;
77
+
78
+ /**
79
+ * idempotency_key of the request
80
+ */
81
+ idempotency_key: string;
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ interface RelatedObject {
88
+ /**
89
+ * Unique identifier for the object.
90
+ */
91
+ id: string;
92
+
93
+ /**
94
+ * The type of meter error related object. Should be 'meter'
95
+ */
96
+ object: string;
97
+
98
+ /**
99
+ * The url of the meter object
100
+ */
101
+ url: string;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
@@ -5,6 +5,8 @@ declare module 'stripe' {
5
5
  namespace Billing {
6
6
  /**
7
7
  * A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make.
8
+ *
9
+ * Related guide: [Usage based billing](https://docs.stripe.com/billing/subscriptions/usage-based)
8
10
  */
9
11
  interface Meter {
10
12
  /**
@@ -209,6 +209,8 @@ declare module 'stripe' {
209
209
  * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation.
210
210
  */
211
211
  proration_behavior: SubscriptionUpdate.ProrationBehavior;
212
+
213
+ schedule_at_period_end?: SubscriptionUpdate.ScheduleAtPeriodEnd;
212
214
  }
213
215
 
214
216
  namespace SubscriptionUpdate {
@@ -230,6 +232,26 @@ declare module 'stripe' {
230
232
  | 'always_invoice'
231
233
  | 'create_prorations'
232
234
  | 'none';
235
+
236
+ interface ScheduleAtPeriodEnd {
237
+ /**
238
+ * List of conditions. When any condition is true, an update will be scheduled at the end of the current period.
239
+ */
240
+ conditions: Array<ScheduleAtPeriodEnd.Condition>;
241
+ }
242
+
243
+ namespace ScheduleAtPeriodEnd {
244
+ interface Condition {
245
+ /**
246
+ * The type of condition.
247
+ */
248
+ type: Condition.Type;
249
+ }
250
+
251
+ namespace Condition {
252
+ type Type = 'decreasing_item_amount' | 'shortening_interval';
253
+ }
254
+ }
233
255
  }
234
256
  }
235
257
 
@@ -5,14 +5,14 @@ declare module 'stripe' {
5
5
  namespace BillingPortal {
6
6
  interface ConfigurationCreateParams {
7
7
  /**
8
- * The business information shown to customers in the portal.
8
+ * Information about the features available in the portal.
9
9
  */
10
- business_profile: ConfigurationCreateParams.BusinessProfile;
10
+ features: ConfigurationCreateParams.Features;
11
11
 
12
12
  /**
13
- * Information about the features available in the portal.
13
+ * The business information shown to customers in the portal.
14
14
  */
15
- features: ConfigurationCreateParams.Features;
15
+ business_profile?: ConfigurationCreateParams.BusinessProfile;
16
16
 
17
17
  /**
18
18
  * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
@@ -196,6 +196,11 @@ declare module 'stripe' {
196
196
  * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
197
197
  */
198
198
  proration_behavior?: SubscriptionUpdate.ProrationBehavior;
199
+
200
+ /**
201
+ * Setting to control when an update should be scheduled at the end of the period instead of applying immediately.
202
+ */
203
+ schedule_at_period_end?: SubscriptionUpdate.ScheduleAtPeriodEnd;
199
204
  }
200
205
 
201
206
  namespace SubscriptionUpdate {
@@ -217,6 +222,26 @@ declare module 'stripe' {
217
222
  | 'always_invoice'
218
223
  | 'create_prorations'
219
224
  | 'none';
225
+
226
+ interface ScheduleAtPeriodEnd {
227
+ /**
228
+ * List of conditions. When any condition is true, the update will be scheduled at the end of the current period.
229
+ */
230
+ conditions?: Array<ScheduleAtPeriodEnd.Condition>;
231
+ }
232
+
233
+ namespace ScheduleAtPeriodEnd {
234
+ interface Condition {
235
+ /**
236
+ * The type of condition.
237
+ */
238
+ type: Condition.Type;
239
+ }
240
+
241
+ namespace Condition {
242
+ type Type = 'decreasing_item_amount' | 'shortening_interval';
243
+ }
244
+ }
220
245
  }
221
246
  }
222
247
 
@@ -433,6 +458,11 @@ declare module 'stripe' {
433
458
  * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
434
459
  */
435
460
  proration_behavior?: SubscriptionUpdate.ProrationBehavior;
461
+
462
+ /**
463
+ * Setting to control when an update should be scheduled at the end of the period instead of applying immediately.
464
+ */
465
+ schedule_at_period_end?: SubscriptionUpdate.ScheduleAtPeriodEnd;
436
466
  }
437
467
 
438
468
  namespace SubscriptionUpdate {
@@ -454,6 +484,28 @@ declare module 'stripe' {
454
484
  | 'always_invoice'
455
485
  | 'create_prorations'
456
486
  | 'none';
487
+
488
+ interface ScheduleAtPeriodEnd {
489
+ /**
490
+ * List of conditions. When any condition is true, the update will be scheduled at the end of the current period.
491
+ */
492
+ conditions?: Stripe.Emptyable<
493
+ Array<ScheduleAtPeriodEnd.Condition>
494
+ >;
495
+ }
496
+
497
+ namespace ScheduleAtPeriodEnd {
498
+ interface Condition {
499
+ /**
500
+ * The type of condition.
501
+ */
502
+ type: Condition.Type;
503
+ }
504
+
505
+ namespace Condition {
506
+ type Type = 'decreasing_item_amount' | 'shortening_interval';
507
+ }
508
+ }
457
509
  }
458
510
  }
459
511
 
@@ -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
+ }