stripe 17.1.0 → 17.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +901 -109
- package/README.md +4 -4
- package/VERSION +1 -1
- package/cjs/resources/AccountNotices.js +21 -0
- package/cjs/resources/Capital/FinancingOffers.js +21 -0
- package/cjs/resources/Capital/FinancingSummary.js +12 -0
- package/cjs/resources/Capital/FinancingTransactions.js +17 -0
- package/cjs/resources/FinancialConnections/Accounts.js +5 -0
- package/cjs/resources/FinancialConnections/Institutions.js +17 -0
- package/cjs/resources/GiftCards/Cards.js +23 -0
- package/cjs/resources/GiftCards/Transactions.js +33 -0
- package/cjs/resources/Invoices.js +17 -0
- package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
- package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
- package/cjs/resources/Margins.js +22 -0
- package/cjs/resources/Orders.js +24 -0
- package/cjs/resources/PaymentIntents.js +4 -0
- package/cjs/resources/Quotes.js +32 -0
- package/cjs/resources/SubscriptionSchedules.js +4 -0
- package/cjs/resources/Tax/Associations.js +9 -0
- package/cjs/resources/Tax/Forms.js +20 -0
- package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
- package/cjs/resources/Terminal/Readers.js +12 -0
- package/cjs/resources/TestHelpers/Issuing/Cards.js +4 -0
- package/cjs/resources.js +42 -10
- package/cjs/stripe.core.js +1 -1
- package/esm/resources/AccountNotices.js +18 -0
- package/esm/resources/Capital/FinancingOffers.js +18 -0
- package/esm/resources/Capital/FinancingSummary.js +9 -0
- package/esm/resources/Capital/FinancingTransactions.js +14 -0
- package/esm/resources/FinancialConnections/Accounts.js +5 -0
- package/esm/resources/FinancialConnections/Institutions.js +14 -0
- package/esm/resources/GiftCards/Cards.js +20 -0
- package/esm/resources/GiftCards/Transactions.js +30 -0
- package/esm/resources/Invoices.js +17 -0
- package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
- package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
- package/esm/resources/Margins.js +19 -0
- package/esm/resources/Orders.js +21 -0
- package/esm/resources/PaymentIntents.js +4 -0
- package/esm/resources/Quotes.js +32 -0
- package/esm/resources/SubscriptionSchedules.js +4 -0
- package/esm/resources/Tax/Associations.js +6 -0
- package/esm/resources/Tax/Forms.js +17 -0
- package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
- package/esm/resources/Terminal/Readers.js +12 -0
- package/esm/resources/TestHelpers/Issuing/Cards.js +4 -0
- package/esm/resources.js +29 -0
- package/esm/stripe.core.js +1 -1
- package/package.json +1 -1
- package/types/AccountLinksResource.d.ts +5 -1
- package/types/AccountNotices.d.ts +113 -0
- package/types/AccountNoticesResource.d.ts +98 -0
- package/types/AccountSessions.d.ts +75 -5
- package/types/AccountSessionsResource.d.ts +354 -5
- package/types/Accounts.d.ts +127 -3
- package/types/AccountsResource.d.ts +296 -2
- package/types/Billing/CreditGrants.d.ts +2 -2
- package/types/Billing/CreditGrantsResource.d.ts +2 -2
- package/types/Billing/MeterErrorReports.d.ts +106 -0
- package/types/Billing/Meters.d.ts +2 -0
- package/types/Capital/FinancingOffers.d.ts +188 -0
- package/types/Capital/FinancingOffersResource.d.ts +97 -0
- package/types/Capital/FinancingSummary.d.ts +106 -0
- package/types/Capital/FinancingSummaryResource.d.ts +27 -0
- package/types/Capital/FinancingTransactions.d.ts +135 -0
- package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
- package/types/Charges.d.ts +152 -0
- package/types/ChargesResource.d.ts +1294 -0
- package/types/Checkout/Sessions.d.ts +309 -5
- package/types/Checkout/SessionsResource.d.ts +356 -5
- package/types/ConfirmationTokens.d.ts +137 -0
- package/types/Coupons.d.ts +1 -1
- package/types/CouponsResource.d.ts +1 -1
- package/types/CreditNotes.d.ts +21 -0
- package/types/CreditNotesResource.d.ts +51 -0
- package/types/CustomersResource.d.ts +22 -2
- package/types/Disputes.d.ts +152 -0
- package/types/DisputesResource.d.ts +120 -0
- package/types/EventTypes.d.ts +564 -2
- package/types/Events.d.ts +91 -0
- package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
- package/types/FinancialConnections/Accounts.d.ts +29 -1
- package/types/FinancialConnections/AccountsResource.d.ts +35 -3
- package/types/FinancialConnections/Institutions.d.ts +93 -0
- package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
- package/types/FinancialConnections/Sessions.d.ts +49 -1
- package/types/FinancialConnections/SessionsResource.d.ts +38 -1
- package/types/Forwarding/Requests.d.ts +5 -0
- package/types/GiftCards/Cards.d.ts +118 -0
- package/types/GiftCards/CardsResource.d.ts +159 -0
- package/types/GiftCards/Transactions.d.ts +129 -0
- package/types/GiftCards/TransactionsResource.d.ts +201 -0
- package/types/InvoiceItems.d.ts +5 -0
- package/types/InvoiceItemsResource.d.ts +98 -0
- package/types/InvoiceLineItems.d.ts +31 -1
- package/types/InvoicePayments.d.ts +138 -0
- package/types/Invoices.d.ts +134 -3
- package/types/InvoicesResource.d.ts +5478 -1799
- package/types/Issuing/Authorizations.d.ts +1 -1
- package/types/Issuing/AuthorizationsResource.d.ts +1 -1
- package/types/Issuing/CardholdersResource.d.ts +2 -1
- package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
- package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
- package/types/Issuing/DisputeSettlementDetails.d.ts +73 -0
- package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
- package/types/Issuing/Settlements.d.ts +103 -0
- package/types/Issuing/Transactions.d.ts +2 -0
- package/types/Issuing/TransactionsResource.d.ts +5 -0
- package/types/LineItems.d.ts +7 -0
- package/types/Mandates.d.ts +85 -0
- package/types/Margins.d.ts +56 -0
- package/types/MarginsResource.d.ts +114 -0
- package/types/Orders.d.ts +1154 -0
- package/types/OrdersResource.d.ts +2911 -0
- package/types/PaymentIntents.d.ts +643 -1
- package/types/PaymentIntentsResource.d.ts +7790 -3514
- package/types/PaymentLinks.d.ts +3 -0
- package/types/PaymentLinksResource.d.ts +6 -0
- package/types/PaymentMethodConfigurations.d.ts +36 -0
- package/types/PaymentMethodConfigurationsResource.d.ts +52 -2
- package/types/PaymentMethods.d.ts +137 -0
- package/types/PaymentMethodsResource.d.ts +158 -0
- package/types/Persons.d.ts +1 -1
- package/types/Prices.d.ts +22 -0
- package/types/PricesResource.d.ts +22 -0
- package/types/Products.d.ts +39 -0
- package/types/ProductsResource.d.ts +36 -0
- package/types/QuoteLines.d.ts +634 -0
- package/types/QuotePreviewInvoices.d.ts +1596 -0
- package/types/QuotePreviewSubscriptionSchedules.d.ts +814 -0
- package/types/Quotes.d.ts +591 -1
- package/types/QuotesResource.d.ts +2526 -194
- package/types/SetupAttempts.d.ts +19 -0
- package/types/SetupIntents.d.ts +112 -1
- package/types/SetupIntentsResource.d.ts +669 -3
- package/types/Sources.d.ts +23 -0
- package/types/SubscriptionItems.d.ts +21 -0
- package/types/SubscriptionItemsResource.d.ts +109 -0
- package/types/SubscriptionSchedules.d.ts +200 -0
- package/types/SubscriptionSchedulesResource.d.ts +1234 -16
- package/types/Subscriptions.d.ts +82 -1
- package/types/SubscriptionsResource.d.ts +348 -3
- package/types/Tax/Associations.d.ts +126 -0
- package/types/Tax/AssociationsResource.d.ts +29 -0
- package/types/Tax/CalculationLineItems.d.ts +1 -0
- package/types/Tax/Calculations.d.ts +33 -1
- package/types/Tax/CalculationsResource.d.ts +7 -1
- package/types/Tax/Forms.d.ts +133 -0
- package/types/Tax/FormsResource.d.ts +90 -0
- package/types/Tax/Registrations.d.ts +82 -0
- package/types/Tax/RegistrationsResource.d.ts +109 -0
- package/types/Tax/Transactions.d.ts +8 -1
- package/types/TaxIds.d.ts +7 -1
- package/types/TaxIdsResource.d.ts +7 -1
- package/types/TaxRates.d.ts +25 -0
- package/types/TaxRatesResource.d.ts +2 -0
- package/types/Terminal/ReaderCollectedData.d.ts +51 -0
- package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
- package/types/Terminal/Readers.d.ts +278 -0
- package/types/Terminal/ReadersResource.d.ts +215 -0
- package/types/TestHelpers/ConfirmationTokensResource.d.ts +112 -0
- package/types/TestHelpers/Issuing/CardsResource.d.ts +22 -0
- package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
- package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
- package/types/TokensResource.d.ts +1 -1
- package/types/Treasury/FinancialAccounts.d.ts +6 -1
- package/types/Treasury/FinancialAccountsResource.d.ts +10 -0
- package/types/Treasury/OutboundTransfers.d.ts +26 -0
- package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
- package/types/Treasury/ReceivedCredits.d.ts +26 -0
- package/types/Treasury/ReceivedDebits.d.ts +31 -0
- package/types/UsageRecordSummaries.d.ts +1 -1
- package/types/WebhookEndpointsResource.d.ts +66 -0
- package/types/index.d.ts +53 -0
package/types/Quotes.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ declare module 'stripe' {
|
|
|
17
17
|
*/
|
|
18
18
|
object: 'quote';
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
|
|
22
|
+
*/
|
|
23
|
+
allow_backdated_lines?: boolean | null;
|
|
24
|
+
|
|
20
25
|
/**
|
|
21
26
|
* Total before any discounts or taxes are applied.
|
|
22
27
|
*/
|
|
@@ -117,6 +122,11 @@ declare module 'stripe' {
|
|
|
117
122
|
*/
|
|
118
123
|
line_items?: ApiList<Stripe.LineItem>;
|
|
119
124
|
|
|
125
|
+
/**
|
|
126
|
+
* A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
|
|
127
|
+
*/
|
|
128
|
+
lines?: Array<string> | null;
|
|
129
|
+
|
|
120
130
|
/**
|
|
121
131
|
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
|
122
132
|
*/
|
|
@@ -142,6 +152,11 @@ declare module 'stripe' {
|
|
|
142
152
|
*/
|
|
143
153
|
status: Quote.Status;
|
|
144
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Details on when and why a quote has been marked as stale or canceled.
|
|
157
|
+
*/
|
|
158
|
+
status_details?: Quote.StatusDetails | null;
|
|
159
|
+
|
|
145
160
|
status_transitions: Quote.StatusTransitions;
|
|
146
161
|
|
|
147
162
|
/**
|
|
@@ -151,11 +166,23 @@ declare module 'stripe' {
|
|
|
151
166
|
|
|
152
167
|
subscription_data: Quote.SubscriptionData;
|
|
153
168
|
|
|
169
|
+
/**
|
|
170
|
+
* List representing overrides for `subscription_data` configurations for specific subscription schedules.
|
|
171
|
+
*/
|
|
172
|
+
subscription_data_overrides?: Array<
|
|
173
|
+
Quote.SubscriptionDataOverride
|
|
174
|
+
> | null;
|
|
175
|
+
|
|
154
176
|
/**
|
|
155
177
|
* The subscription schedule that was created or updated from this quote.
|
|
156
178
|
*/
|
|
157
179
|
subscription_schedule: string | Stripe.SubscriptionSchedule | null;
|
|
158
180
|
|
|
181
|
+
/**
|
|
182
|
+
* The subscription schedules that were created or updated from this quote.
|
|
183
|
+
*/
|
|
184
|
+
subscription_schedules?: Array<Quote.SubscriptionSchedule> | null;
|
|
185
|
+
|
|
159
186
|
/**
|
|
160
187
|
* ID of the test clock this quote belongs to.
|
|
161
188
|
*/
|
|
@@ -210,15 +237,62 @@ declare module 'stripe' {
|
|
|
210
237
|
type CollectionMethod = 'charge_automatically' | 'send_invoice';
|
|
211
238
|
|
|
212
239
|
interface Computed {
|
|
240
|
+
/**
|
|
241
|
+
* Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation.
|
|
242
|
+
*/
|
|
243
|
+
last_reestimation_details?: Computed.LastReestimationDetails | null;
|
|
244
|
+
|
|
213
245
|
/**
|
|
214
246
|
* The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices.
|
|
215
247
|
*/
|
|
216
248
|
recurring: Computed.Recurring | null;
|
|
217
249
|
|
|
250
|
+
/**
|
|
251
|
+
* The time at which the quote's estimated schedules and upcoming invoices were generated.
|
|
252
|
+
*/
|
|
253
|
+
updated_at?: number | null;
|
|
254
|
+
|
|
218
255
|
upfront: Computed.Upfront;
|
|
219
256
|
}
|
|
220
257
|
|
|
221
258
|
namespace Computed {
|
|
259
|
+
interface LastReestimationDetails {
|
|
260
|
+
/**
|
|
261
|
+
* When `status` is `failed`, provides details about the quote reestimation failure.
|
|
262
|
+
*/
|
|
263
|
+
failed: LastReestimationDetails.Failed | null;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Latest status of the reestimation.
|
|
267
|
+
*/
|
|
268
|
+
status: LastReestimationDetails.Status;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
namespace LastReestimationDetails {
|
|
272
|
+
interface Failed {
|
|
273
|
+
/**
|
|
274
|
+
* The failure `code` is more granular than the `reason` provided and may correspond to a Stripe error code. For automation errors, this field is one of: `reverse_api_failure`, `reverse_api_deadline_exceeeded`, or `reverse_api_response_validation_error`, which are Stripe error codes and map to the error `message` field.
|
|
275
|
+
*/
|
|
276
|
+
failure_code: string | null;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Information derived from the `failure_code` or a freeform message that explains the error as a human-readable English string. For example, "margin ID is not a valid ID".
|
|
280
|
+
*/
|
|
281
|
+
message: string | null;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* The reason the reestimation failed.
|
|
285
|
+
*/
|
|
286
|
+
reason: Failed.Reason;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
namespace Failed {
|
|
290
|
+
type Reason = 'automation_failure' | 'internal_error';
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
type Status = 'failed' | 'in_progress' | 'succeeded';
|
|
294
|
+
}
|
|
295
|
+
|
|
222
296
|
interface Recurring {
|
|
223
297
|
/**
|
|
224
298
|
* Total before any discounts or taxes are applied.
|
|
@@ -494,7 +568,153 @@ declare module 'stripe' {
|
|
|
494
568
|
}
|
|
495
569
|
}
|
|
496
570
|
|
|
497
|
-
type Status =
|
|
571
|
+
type Status =
|
|
572
|
+
| 'accepted'
|
|
573
|
+
| 'accepting'
|
|
574
|
+
| 'canceled'
|
|
575
|
+
| 'draft'
|
|
576
|
+
| 'open'
|
|
577
|
+
| 'stale';
|
|
578
|
+
|
|
579
|
+
interface StatusDetails {
|
|
580
|
+
canceled?: StatusDetails.Canceled;
|
|
581
|
+
|
|
582
|
+
stale?: StatusDetails.Stale;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
namespace StatusDetails {
|
|
586
|
+
interface Canceled {
|
|
587
|
+
/**
|
|
588
|
+
* The reason this quote was marked as canceled.
|
|
589
|
+
*/
|
|
590
|
+
reason: Canceled.Reason | null;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch.
|
|
594
|
+
*/
|
|
595
|
+
transitioned_at: number | null;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
namespace Canceled {
|
|
599
|
+
type Reason =
|
|
600
|
+
| 'canceled'
|
|
601
|
+
| 'quote_accepted'
|
|
602
|
+
| 'quote_expired'
|
|
603
|
+
| 'quote_superseded'
|
|
604
|
+
| 'subscription_canceled';
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
interface Stale {
|
|
608
|
+
/**
|
|
609
|
+
* Time at which the quote expires. Measured in seconds since the Unix epoch.
|
|
610
|
+
*/
|
|
611
|
+
expires_at: number | null;
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* The most recent reason this quote was marked as stale.
|
|
615
|
+
*/
|
|
616
|
+
last_reason: Stale.LastReason | null;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Time at which the stale reason was updated. Measured in seconds since the Unix epoch.
|
|
620
|
+
*/
|
|
621
|
+
last_updated_at: number | null;
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Time at which the quote was marked as stale. Measured in seconds since the Unix epoch.
|
|
625
|
+
*/
|
|
626
|
+
transitioned_at: number | null;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
namespace Stale {
|
|
630
|
+
interface LastReason {
|
|
631
|
+
/**
|
|
632
|
+
* The ID of the line that is invalid if the stale reason type is `line_invalid`.
|
|
633
|
+
*/
|
|
634
|
+
line_invalid?: string;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* The IDs of the lines that are invalid if the stale reason type is `lines_invalid`.
|
|
638
|
+
*/
|
|
639
|
+
lines_invalid?: Array<LastReason.LinesInvalid>;
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* The user supplied mark stale reason.
|
|
643
|
+
*/
|
|
644
|
+
marked_stale?: string | null;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* The ID of the subscription that was canceled.
|
|
648
|
+
*/
|
|
649
|
+
subscription_canceled?: string;
|
|
650
|
+
|
|
651
|
+
subscription_changed?: LastReason.SubscriptionChanged;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* The ID of the subscription that was expired.
|
|
655
|
+
*/
|
|
656
|
+
subscription_expired?: string;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* The ID of the subscription schedule that was canceled.
|
|
660
|
+
*/
|
|
661
|
+
subscription_schedule_canceled?: string;
|
|
662
|
+
|
|
663
|
+
subscription_schedule_changed?: LastReason.SubscriptionScheduleChanged;
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* The ID of the subscription schedule that was released.
|
|
667
|
+
*/
|
|
668
|
+
subscription_schedule_released?: string;
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* The reason the quote was marked as stale.
|
|
672
|
+
*/
|
|
673
|
+
type: LastReason.Type | null;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
namespace LastReason {
|
|
677
|
+
interface LinesInvalid {
|
|
678
|
+
/**
|
|
679
|
+
* The timestamp at which the lines were marked as invalid.
|
|
680
|
+
*/
|
|
681
|
+
invalid_at: number;
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* The list of lines that became invalid at the given timestamp.
|
|
685
|
+
*/
|
|
686
|
+
lines: Array<string>;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
interface SubscriptionChanged {
|
|
690
|
+
/**
|
|
691
|
+
* The subscription's state before the quote was marked as stale.
|
|
692
|
+
*/
|
|
693
|
+
previous_subscription: Stripe.Subscription | null;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
interface SubscriptionScheduleChanged {
|
|
697
|
+
/**
|
|
698
|
+
* The subscription schedule's state before the quote was marked as stale.
|
|
699
|
+
*/
|
|
700
|
+
previous_subscription_schedule: Stripe.SubscriptionSchedule | null;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
type Type =
|
|
704
|
+
| 'accept_failed_validations'
|
|
705
|
+
| 'bill_on_acceptance_invalid'
|
|
706
|
+
| 'line_invalid'
|
|
707
|
+
| 'lines_invalid'
|
|
708
|
+
| 'marked_stale'
|
|
709
|
+
| 'subscription_canceled'
|
|
710
|
+
| 'subscription_changed'
|
|
711
|
+
| 'subscription_expired'
|
|
712
|
+
| 'subscription_schedule_canceled'
|
|
713
|
+
| 'subscription_schedule_changed'
|
|
714
|
+
| 'subscription_schedule_released';
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
498
718
|
|
|
499
719
|
interface StatusTransitions {
|
|
500
720
|
/**
|
|
@@ -514,6 +734,21 @@ declare module 'stripe' {
|
|
|
514
734
|
}
|
|
515
735
|
|
|
516
736
|
interface SubscriptionData {
|
|
737
|
+
/**
|
|
738
|
+
* Describes the period to bill for upon accepting the quote.
|
|
739
|
+
*/
|
|
740
|
+
bill_on_acceptance?: SubscriptionData.BillOnAcceptance | null;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
|
|
744
|
+
*/
|
|
745
|
+
billing_behavior?: SubscriptionData.BillingBehavior;
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Whether the subscription will always start a new billing period when the quote is accepted.
|
|
749
|
+
*/
|
|
750
|
+
billing_cycle_anchor?: 'reset' | null;
|
|
751
|
+
|
|
517
752
|
/**
|
|
518
753
|
* The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
|
|
519
754
|
*/
|
|
@@ -524,17 +759,372 @@ declare module 'stripe' {
|
|
|
524
759
|
*/
|
|
525
760
|
effective_date: number | null;
|
|
526
761
|
|
|
762
|
+
/**
|
|
763
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
764
|
+
*/
|
|
765
|
+
end_behavior?: SubscriptionData.EndBehavior | null;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* The id of the subscription that will be updated when the quote is accepted.
|
|
769
|
+
*/
|
|
770
|
+
from_subscription?: string | Stripe.Subscription | null;
|
|
771
|
+
|
|
527
772
|
/**
|
|
528
773
|
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
|
|
529
774
|
*/
|
|
530
775
|
metadata: Stripe.Metadata | null;
|
|
531
776
|
|
|
777
|
+
/**
|
|
778
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
|
|
779
|
+
*/
|
|
780
|
+
prebilling?: SubscriptionData.Prebilling | null;
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
|
|
784
|
+
*/
|
|
785
|
+
proration_behavior?: SubscriptionData.ProrationBehavior;
|
|
786
|
+
|
|
532
787
|
/**
|
|
533
788
|
* Integer representing the number of trial period days before the customer is charged for the first time.
|
|
534
789
|
*/
|
|
535
790
|
trial_period_days: number | null;
|
|
536
791
|
}
|
|
537
792
|
|
|
793
|
+
namespace SubscriptionData {
|
|
794
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
795
|
+
|
|
796
|
+
interface BillOnAcceptance {
|
|
797
|
+
/**
|
|
798
|
+
* The start of the period to bill from when the Quote is accepted.
|
|
799
|
+
*/
|
|
800
|
+
bill_from: BillOnAcceptance.BillFrom | null;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* The end of the period to bill until when the Quote is accepted.
|
|
804
|
+
*/
|
|
805
|
+
bill_until: BillOnAcceptance.BillUntil | null;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
namespace BillOnAcceptance {
|
|
809
|
+
interface BillFrom {
|
|
810
|
+
/**
|
|
811
|
+
* The materialized time.
|
|
812
|
+
*/
|
|
813
|
+
computed: number | null;
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* The timestamp the given line starts at.
|
|
817
|
+
*/
|
|
818
|
+
line_starts_at: BillFrom.LineStartsAt | null;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* A precise Unix timestamp.
|
|
822
|
+
*/
|
|
823
|
+
timestamp: number | null;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* The type of method to specify the `bill_from` time.
|
|
827
|
+
*/
|
|
828
|
+
type: BillFrom.Type;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
namespace BillFrom {
|
|
832
|
+
interface LineStartsAt {
|
|
833
|
+
/**
|
|
834
|
+
* Unique identifier for the object.
|
|
835
|
+
*/
|
|
836
|
+
id: string;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
type Type =
|
|
840
|
+
| 'line_starts_at'
|
|
841
|
+
| 'now'
|
|
842
|
+
| 'pause_collection_start'
|
|
843
|
+
| 'quote_acceptance_date'
|
|
844
|
+
| 'timestamp';
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
interface BillUntil {
|
|
848
|
+
/**
|
|
849
|
+
* The materialized time.
|
|
850
|
+
*/
|
|
851
|
+
computed: number | null;
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Time span for the quote line starting from the `starts_at` date.
|
|
855
|
+
*/
|
|
856
|
+
duration: BillUntil.Duration | null;
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* The timestamp the given line ends at.
|
|
860
|
+
*/
|
|
861
|
+
line_ends_at: BillUntil.LineEndsAt | null;
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* A precise Unix timestamp.
|
|
865
|
+
*/
|
|
866
|
+
timestamp: number | null;
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* The type of method to specify the `bill_until` time.
|
|
870
|
+
*/
|
|
871
|
+
type: BillUntil.Type;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
namespace BillUntil {
|
|
875
|
+
interface Duration {
|
|
876
|
+
/**
|
|
877
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
878
|
+
*/
|
|
879
|
+
interval: Duration.Interval;
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
883
|
+
*/
|
|
884
|
+
interval_count: number;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
namespace Duration {
|
|
888
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
interface LineEndsAt {
|
|
892
|
+
/**
|
|
893
|
+
* Unique identifier for the object.
|
|
894
|
+
*/
|
|
895
|
+
id: string;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
type Type =
|
|
899
|
+
| 'duration'
|
|
900
|
+
| 'line_ends_at'
|
|
901
|
+
| 'schedule_end'
|
|
902
|
+
| 'timestamp'
|
|
903
|
+
| 'upcoming_invoice';
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
type EndBehavior = 'cancel' | 'release';
|
|
908
|
+
|
|
909
|
+
interface Prebilling {
|
|
910
|
+
iterations: number;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
type ProrationBehavior =
|
|
914
|
+
| 'always_invoice'
|
|
915
|
+
| 'create_prorations'
|
|
916
|
+
| 'none';
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
interface SubscriptionDataOverride {
|
|
920
|
+
applies_to: SubscriptionDataOverride.AppliesTo;
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Describes the period to bill for upon accepting the quote.
|
|
924
|
+
*/
|
|
925
|
+
bill_on_acceptance?: SubscriptionDataOverride.BillOnAcceptance | null;
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
|
|
929
|
+
*/
|
|
930
|
+
billing_behavior?: SubscriptionDataOverride.BillingBehavior;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
|
|
934
|
+
*/
|
|
935
|
+
customer: string | null;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
|
|
939
|
+
*/
|
|
940
|
+
description: string | null;
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
944
|
+
*/
|
|
945
|
+
end_behavior?: SubscriptionDataOverride.EndBehavior | null;
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
|
|
949
|
+
*/
|
|
950
|
+
proration_behavior?: SubscriptionDataOverride.ProrationBehavior | null;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
namespace SubscriptionDataOverride {
|
|
954
|
+
interface AppliesTo {
|
|
955
|
+
/**
|
|
956
|
+
* A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
|
|
957
|
+
*/
|
|
958
|
+
new_reference: string | null;
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* The ID of the schedule the line applies to.
|
|
962
|
+
*/
|
|
963
|
+
subscription_schedule: string | null;
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Describes whether the quote line is affecting a new schedule or an existing schedule.
|
|
967
|
+
*/
|
|
968
|
+
type: AppliesTo.Type;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
namespace AppliesTo {
|
|
972
|
+
type Type = 'new_reference' | 'subscription_schedule';
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
976
|
+
|
|
977
|
+
interface BillOnAcceptance {
|
|
978
|
+
/**
|
|
979
|
+
* The start of the period to bill from when the Quote is accepted.
|
|
980
|
+
*/
|
|
981
|
+
bill_from: BillOnAcceptance.BillFrom | null;
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* The end of the period to bill until when the Quote is accepted.
|
|
985
|
+
*/
|
|
986
|
+
bill_until: BillOnAcceptance.BillUntil | null;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
namespace BillOnAcceptance {
|
|
990
|
+
interface BillFrom {
|
|
991
|
+
/**
|
|
992
|
+
* The materialized time.
|
|
993
|
+
*/
|
|
994
|
+
computed: number | null;
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* The timestamp the given line starts at.
|
|
998
|
+
*/
|
|
999
|
+
line_starts_at: BillFrom.LineStartsAt | null;
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* A precise Unix timestamp.
|
|
1003
|
+
*/
|
|
1004
|
+
timestamp: number | null;
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* The type of method to specify the `bill_from` time.
|
|
1008
|
+
*/
|
|
1009
|
+
type: BillFrom.Type;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
namespace BillFrom {
|
|
1013
|
+
interface LineStartsAt {
|
|
1014
|
+
/**
|
|
1015
|
+
* Unique identifier for the object.
|
|
1016
|
+
*/
|
|
1017
|
+
id: string;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
type Type =
|
|
1021
|
+
| 'line_starts_at'
|
|
1022
|
+
| 'now'
|
|
1023
|
+
| 'pause_collection_start'
|
|
1024
|
+
| 'quote_acceptance_date'
|
|
1025
|
+
| 'timestamp';
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
interface BillUntil {
|
|
1029
|
+
/**
|
|
1030
|
+
* The materialized time.
|
|
1031
|
+
*/
|
|
1032
|
+
computed: number | null;
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Time span for the quote line starting from the `starts_at` date.
|
|
1036
|
+
*/
|
|
1037
|
+
duration: BillUntil.Duration | null;
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* The timestamp the given line ends at.
|
|
1041
|
+
*/
|
|
1042
|
+
line_ends_at: BillUntil.LineEndsAt | null;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* A precise Unix timestamp.
|
|
1046
|
+
*/
|
|
1047
|
+
timestamp: number | null;
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* The type of method to specify the `bill_until` time.
|
|
1051
|
+
*/
|
|
1052
|
+
type: BillUntil.Type;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
namespace BillUntil {
|
|
1056
|
+
interface Duration {
|
|
1057
|
+
/**
|
|
1058
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1059
|
+
*/
|
|
1060
|
+
interval: Duration.Interval;
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1064
|
+
*/
|
|
1065
|
+
interval_count: number;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
namespace Duration {
|
|
1069
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
interface LineEndsAt {
|
|
1073
|
+
/**
|
|
1074
|
+
* Unique identifier for the object.
|
|
1075
|
+
*/
|
|
1076
|
+
id: string;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
type Type =
|
|
1080
|
+
| 'duration'
|
|
1081
|
+
| 'line_ends_at'
|
|
1082
|
+
| 'schedule_end'
|
|
1083
|
+
| 'timestamp'
|
|
1084
|
+
| 'upcoming_invoice';
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
type EndBehavior = 'cancel' | 'release';
|
|
1089
|
+
|
|
1090
|
+
type ProrationBehavior =
|
|
1091
|
+
| 'always_invoice'
|
|
1092
|
+
| 'create_prorations'
|
|
1093
|
+
| 'none';
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
interface SubscriptionSchedule {
|
|
1097
|
+
applies_to: SubscriptionSchedule.AppliesTo;
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* The subscription schedule that was created or updated from this quote.
|
|
1101
|
+
*/
|
|
1102
|
+
subscription_schedule: string;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
namespace SubscriptionSchedule {
|
|
1106
|
+
interface AppliesTo {
|
|
1107
|
+
/**
|
|
1108
|
+
* A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
|
|
1109
|
+
*/
|
|
1110
|
+
new_reference: string | null;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* The ID of the schedule the line applies to.
|
|
1114
|
+
*/
|
|
1115
|
+
subscription_schedule: string | null;
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Describes whether the quote line is affecting a new schedule or an existing schedule.
|
|
1119
|
+
*/
|
|
1120
|
+
type: AppliesTo.Type;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
namespace AppliesTo {
|
|
1124
|
+
type Type = 'new_reference' | 'subscription_schedule';
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
538
1128
|
interface TotalDetails {
|
|
539
1129
|
/**
|
|
540
1130
|
* This is the sum of all the discounts.
|