stripe 18.3.0 → 18.4.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 +1296 -12
- package/README.md +1 -0
- package/VERSION +1 -1
- package/cjs/Error.js +107 -1
- package/cjs/apiVersion.js +2 -3
- package/cjs/resources/AccountNotices.js +21 -0
- package/cjs/resources/BalanceSettings.js +10 -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/ExternalAccounts.js +23 -0
- package/cjs/resources/FinancialConnections/Accounts.js +5 -0
- package/cjs/resources/FinancialConnections/Institutions.js +17 -0
- package/cjs/resources/FxQuotes.js +15 -0
- package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
- package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
- package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
- package/cjs/resources/Margins.js +22 -0
- package/cjs/resources/Orders.js +24 -0
- package/cjs/resources/{InvoicePayments.js → PaymentAttemptRecords.js} +4 -4
- package/cjs/resources/PaymentIntents.js +13 -0
- package/cjs/resources/PaymentRecords.js +29 -0
- package/cjs/resources/Privacy/RedactionJobs.js +42 -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/V2/Core/AccountLinks.js +9 -0
- package/cjs/resources/V2/Core/Accounts/Persons.js +29 -0
- package/cjs/resources/V2/Core/Accounts.js +25 -0
- package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +28 -0
- package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +24 -0
- package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
- package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +25 -0
- package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
- package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
- package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
- package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
- package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
- package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
- package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
- package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
- package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
- package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
- package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
- package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
- package/cjs/resources/V2/Payments/OffSessionPayments.js +25 -0
- package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
- package/cjs/resources.js +98 -10
- package/cjs/stripe.core.js +1 -1
- package/esm/Error.js +93 -0
- package/esm/apiVersion.js +1 -2
- package/esm/resources/AccountNotices.js +18 -0
- package/esm/resources/BalanceSettings.js +7 -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/ExternalAccounts.js +20 -0
- package/esm/resources/FinancialConnections/Accounts.js +5 -0
- package/esm/resources/FinancialConnections/Institutions.js +14 -0
- package/esm/resources/FxQuotes.js +12 -0
- package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
- package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
- package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
- package/esm/resources/Margins.js +19 -0
- package/esm/resources/Orders.js +21 -0
- package/esm/resources/{InvoicePayments.js → PaymentAttemptRecords.js} +3 -3
- package/esm/resources/PaymentIntents.js +13 -0
- package/esm/resources/PaymentRecords.js +26 -0
- package/esm/resources/Privacy/RedactionJobs.js +39 -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/V2/Core/AccountLinks.js +6 -0
- package/esm/resources/V2/Core/Accounts/Persons.js +26 -0
- package/esm/resources/V2/Core/Accounts.js +22 -0
- package/esm/resources/V2/Core/Vault/GbBankAccounts.js +25 -0
- package/esm/resources/V2/Core/Vault/UsBankAccounts.js +21 -0
- package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
- package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +22 -0
- package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
- package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
- package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
- package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
- package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
- package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
- package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
- package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
- package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
- package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
- package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
- package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
- package/esm/resources/V2/Payments/OffSessionPayments.js +22 -0
- package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
- package/esm/resources.js +82 -1
- 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 +45 -0
- package/types/AccountSessionsResource.d.ts +264 -0
- package/types/Accounts.d.ts +212 -1
- package/types/AccountsResource.d.ts +544 -0
- package/types/BalanceSettings.d.ts +89 -0
- package/types/BalanceSettingsResource.d.ts +108 -0
- package/types/Billing/CreditBalanceSummary.d.ts +5 -0
- package/types/Billing/CreditBalanceSummaryResource.d.ts +8 -3
- package/types/Billing/CreditBalanceTransactionsResource.d.ts +12 -4
- package/types/Billing/CreditGrants.d.ts +5 -0
- package/types/Billing/CreditGrantsResource.d.ts +11 -1
- package/types/BillingPortal/Sessions.d.ts +5 -0
- package/types/BillingPortal/SessionsResource.d.ts +12 -4
- 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/Cards.d.ts +5 -0
- package/types/CashBalances.d.ts +5 -0
- package/types/Charges.d.ts +166 -0
- package/types/ChargesResource.d.ts +1406 -0
- package/types/Checkout/Sessions.d.ts +314 -1
- package/types/Checkout/SessionsResource.d.ts +333 -1
- package/types/ConfirmationTokens.d.ts +125 -0
- package/types/Coupons.d.ts +33 -0
- package/types/CouponsResource.d.ts +21 -0
- package/types/CreditNoteLineItems.d.ts +17 -0
- package/types/CreditNotes.d.ts +5 -0
- package/types/CreditNotesResource.d.ts +5 -0
- package/types/CustomerBalanceTransactions.d.ts +2 -0
- package/types/CustomerCashBalanceTransactions.d.ts +2 -0
- package/types/CustomerSessions.d.ts +5 -0
- package/types/CustomerSessionsResource.d.ts +6 -1
- package/types/Customers.d.ts +2 -0
- package/types/CustomersResource.d.ts +8 -0
- package/types/Discounts.d.ts +10 -0
- package/types/Disputes.d.ts +7 -0
- package/types/Errors.d.ts +81 -2
- package/types/EventTypes.d.ts +664 -0
- package/types/Events.d.ts +97 -0
- package/types/ExternalAccountsResource.d.ts +304 -0
- package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
- package/types/FinancialConnections/Accounts.d.ts +36 -1
- package/types/FinancialConnections/AccountsResource.d.ts +40 -3
- package/types/FinancialConnections/Institutions.d.ts +98 -0
- package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
- package/types/FinancialConnections/Sessions.d.ts +51 -1
- package/types/FinancialConnections/SessionsResource.d.ts +43 -1
- package/types/FxQuotes.d.ts +153 -0
- package/types/FxQuotesResource.d.ts +130 -0
- package/types/Identity/VerificationSessions.d.ts +5 -0
- package/types/Identity/VerificationSessionsResource.d.ts +7 -0
- package/types/InvoiceItems.d.ts +10 -0
- package/types/InvoiceItemsResource.d.ts +117 -6
- package/types/InvoiceLineItems.d.ts +45 -1
- package/types/InvoicePayments.d.ts +5 -0
- package/types/Invoices.d.ts +133 -3
- package/types/InvoicesResource.d.ts +1447 -16
- 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 +85 -0
- package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
- package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
- package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
- package/types/Issuing/Settlements.d.ts +113 -0
- package/types/Issuing/Transactions.d.ts +5 -0
- package/types/Issuing/TransactionsResource.d.ts +5 -0
- package/types/LineItems.d.ts +49 -0
- package/types/Mandates.d.ts +77 -0
- package/types/Margins.d.ts +56 -0
- package/types/MarginsResource.d.ts +114 -0
- package/types/Orders.d.ts +1163 -0
- package/types/OrdersResource.d.ts +3139 -0
- package/types/PaymentAttemptRecords.d.ts +2161 -0
- package/types/PaymentAttemptRecordsResource.d.ts +47 -0
- package/types/PaymentIntentAmountDetailsLineItems.d.ts +116 -0
- package/types/PaymentIntents.d.ts +768 -2
- package/types/PaymentIntentsResource.d.ts +8808 -4088
- package/types/PaymentLinks.d.ts +6 -0
- package/types/PaymentLinksResource.d.ts +12 -0
- package/types/PaymentMethodConfigurations.d.ts +180 -0
- package/types/PaymentMethodConfigurationsResource.d.ts +250 -0
- package/types/PaymentMethods.d.ts +125 -0
- package/types/PaymentMethodsResource.d.ts +167 -2
- package/types/PaymentRecords.d.ts +2154 -0
- package/types/PaymentRecordsResource.d.ts +455 -0
- package/types/Payouts.d.ts +5 -0
- package/types/PayoutsResource.d.ts +5 -0
- package/types/Prices.d.ts +22 -0
- package/types/PricesResource.d.ts +22 -0
- package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
- package/types/Privacy/RedactionJobs.d.ts +111 -0
- package/types/Privacy/RedactionJobsResource.d.ts +230 -0
- package/types/PromotionCodes.d.ts +5 -0
- package/types/PromotionCodesResource.d.ts +10 -0
- package/types/QuoteLines.d.ts +634 -0
- package/types/QuotePreviewInvoices.d.ts +1696 -0
- package/types/QuotePreviewSubscriptionSchedules.d.ts +845 -0
- package/types/Quotes.d.ts +594 -1
- package/types/QuotesResource.d.ts +2577 -232
- package/types/Refunds.d.ts +14 -0
- package/types/SetupAttempts.d.ts +47 -1
- package/types/SetupIntents.d.ts +118 -2
- package/types/SetupIntentsResource.d.ts +730 -3
- package/types/Sources.d.ts +29 -0
- package/types/SubscriptionItems.d.ts +21 -0
- package/types/SubscriptionItemsResource.d.ts +109 -0
- package/types/SubscriptionSchedules.d.ts +205 -0
- package/types/SubscriptionSchedulesResource.d.ts +1237 -9
- package/types/Subscriptions.d.ts +97 -1
- package/types/SubscriptionsResource.d.ts +396 -10
- package/types/Tax/Associations.d.ts +82 -0
- package/types/Tax/AssociationsResource.d.ts +29 -0
- package/types/Tax/Forms.d.ts +220 -0
- package/types/Tax/FormsResource.d.ts +107 -0
- package/types/TaxIds.d.ts +10 -0
- package/types/TaxIdsResource.d.ts +10 -0
- package/types/Terminal/ReaderCollectedData.d.ts +51 -0
- package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
- package/types/Terminal/Readers.d.ts +20 -0
- package/types/TestHelpers/ConfirmationTokensResource.d.ts +126 -0
- package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
- package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
- package/types/Transfers.d.ts +5 -0
- package/types/TransfersResource.d.ts +5 -0
- package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
- package/types/Treasury/FinancialAccounts.d.ts +5 -0
- package/types/Treasury/FinancialAccountsResource.d.ts +37 -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/V2/Core/AccountLinks.d.ts +106 -0
- package/types/V2/Core/AccountLinksResource.d.ts +90 -0
- package/types/V2/Core/Accounts/PersonsResource.d.ts +3780 -0
- package/types/V2/Core/Accounts.d.ts +8791 -0
- package/types/V2/Core/AccountsResource.d.ts +10582 -0
- package/types/V2/Core/Persons.d.ts +1872 -0
- package/types/V2/Core/Vault/GbBankAccounts.d.ts +160 -0
- package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +172 -0
- package/types/V2/Core/Vault/UsBankAccounts.d.ts +70 -0
- package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +123 -0
- package/types/V2/EventTypes.d.ts +958 -5
- package/types/V2/FinancialAddressCreditSimulations.d.ts +27 -0
- package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +32 -0
- package/types/V2/MoneyManagement/Adjustments.d.ts +110 -0
- package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
- package/types/V2/MoneyManagement/FinancialAccounts.d.ts +580 -0
- package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +326 -0
- package/types/V2/MoneyManagement/FinancialAddresses.d.ts +314 -0
- package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +289 -0
- package/types/V2/MoneyManagement/InboundTransfers.d.ts +206 -0
- package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +144 -0
- package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +168 -0
- package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +115 -0
- package/types/V2/MoneyManagement/OutboundPayments.d.ts +278 -0
- package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +242 -0
- package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
- package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +296 -0
- package/types/V2/MoneyManagement/OutboundTransfers.d.ts +251 -0
- package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +208 -0
- package/types/V2/MoneyManagement/PayoutMethods.d.ts +151 -0
- package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
- package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecs.d.ts +87 -0
- package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +113 -0
- package/types/V2/MoneyManagement/ReceivedCredits.d.ts +262 -0
- package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
- package/types/V2/MoneyManagement/ReceivedDebits.d.ts +176 -0
- package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
- package/types/V2/MoneyManagement/TransactionEntries.d.ts +155 -0
- package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
- package/types/V2/MoneyManagement/Transactions.d.ts +170 -0
- package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
- package/types/V2/Payments/OffSessionPayments.d.ts +162 -0
- package/types/V2/Payments/OffSessionPaymentsResource.d.ts +159 -0
- package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +66 -0
- package/types/WebhookEndpointsResource.d.ts +78 -0
- package/types/index.d.ts +138 -2
- package/types/lib.d.ts +11 -1
- package/types/test/typescriptTest.ts +3 -3
- package/types/InvoicePaymentsResource.d.ts +0 -74
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
declare module 'stripe' {
|
|
4
4
|
namespace Stripe {
|
|
5
5
|
interface QuoteCreateParams {
|
|
6
|
+
/**
|
|
7
|
+
* Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
|
|
8
|
+
*/
|
|
9
|
+
allow_backdated_lines?: boolean;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
|
|
8
13
|
*/
|
|
@@ -28,6 +33,11 @@ declare module 'stripe' {
|
|
|
28
33
|
*/
|
|
29
34
|
customer?: string;
|
|
30
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
|
|
38
|
+
*/
|
|
39
|
+
customer_account?: string;
|
|
40
|
+
|
|
31
41
|
/**
|
|
32
42
|
* The tax rates that will apply to any line item that does not have `tax_rates` set.
|
|
33
43
|
*/
|
|
@@ -78,6 +88,11 @@ declare module 'stripe' {
|
|
|
78
88
|
*/
|
|
79
89
|
line_items?: Array<QuoteCreateParams.LineItem>;
|
|
80
90
|
|
|
91
|
+
/**
|
|
92
|
+
* 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.
|
|
93
|
+
*/
|
|
94
|
+
lines?: Array<QuoteCreateParams.Line>;
|
|
95
|
+
|
|
81
96
|
/**
|
|
82
97
|
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
|
83
98
|
*/
|
|
@@ -93,6 +108,13 @@ declare module 'stripe' {
|
|
|
93
108
|
*/
|
|
94
109
|
subscription_data?: QuoteCreateParams.SubscriptionData;
|
|
95
110
|
|
|
111
|
+
/**
|
|
112
|
+
* List representing overrides for `subscription_data` configurations for specific subscription schedules.
|
|
113
|
+
*/
|
|
114
|
+
subscription_data_overrides?: Array<
|
|
115
|
+
QuoteCreateParams.SubscriptionDataOverride
|
|
116
|
+
>;
|
|
117
|
+
|
|
96
118
|
/**
|
|
97
119
|
* ID of the test clock to attach to the quote.
|
|
98
120
|
*/
|
|
@@ -148,12 +170,56 @@ declare module 'stripe' {
|
|
|
148
170
|
*/
|
|
149
171
|
discount?: string;
|
|
150
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Details to determine how long the discount should be applied for.
|
|
175
|
+
*/
|
|
176
|
+
discount_end?: Discount.DiscountEnd;
|
|
177
|
+
|
|
151
178
|
/**
|
|
152
179
|
* ID of the promotion code to create a new discount for.
|
|
153
180
|
*/
|
|
154
181
|
promotion_code?: string;
|
|
155
182
|
}
|
|
156
183
|
|
|
184
|
+
namespace Discount {
|
|
185
|
+
interface DiscountEnd {
|
|
186
|
+
/**
|
|
187
|
+
* Time span for the redeemed discount.
|
|
188
|
+
*/
|
|
189
|
+
duration?: DiscountEnd.Duration;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
193
|
+
*/
|
|
194
|
+
timestamp?: number;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* The type of calculation made to determine when the discount ends.
|
|
198
|
+
*/
|
|
199
|
+
type: DiscountEnd.Type;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
namespace DiscountEnd {
|
|
203
|
+
interface Duration {
|
|
204
|
+
/**
|
|
205
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
206
|
+
*/
|
|
207
|
+
interval: Duration.Interval;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
211
|
+
*/
|
|
212
|
+
interval_count: number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
namespace Duration {
|
|
216
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
type Type = 'duration' | 'timestamp';
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
157
223
|
interface FromQuote {
|
|
158
224
|
/**
|
|
159
225
|
* Whether this quote is a revision of the previous quote.
|
|
@@ -196,335 +262,2051 @@ declare module 'stripe' {
|
|
|
196
262
|
}
|
|
197
263
|
}
|
|
198
264
|
|
|
199
|
-
interface
|
|
265
|
+
interface Line {
|
|
200
266
|
/**
|
|
201
|
-
*
|
|
267
|
+
* An array of operations the quote line performs.
|
|
202
268
|
*/
|
|
203
|
-
|
|
269
|
+
actions?: Array<Line.Action>;
|
|
204
270
|
|
|
205
271
|
/**
|
|
206
|
-
*
|
|
272
|
+
* Details to identify the subscription schedule the quote line applies to.
|
|
207
273
|
*/
|
|
208
|
-
|
|
274
|
+
applies_to?: Line.AppliesTo;
|
|
209
275
|
|
|
210
276
|
/**
|
|
211
|
-
*
|
|
277
|
+
* For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
|
|
212
278
|
*/
|
|
213
|
-
|
|
279
|
+
billing_cycle_anchor?: Line.BillingCycleAnchor;
|
|
214
280
|
|
|
215
281
|
/**
|
|
216
|
-
*
|
|
282
|
+
* A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
|
|
217
283
|
*/
|
|
218
|
-
|
|
284
|
+
cancel_subscription_schedule?: Line.CancelSubscriptionSchedule;
|
|
219
285
|
|
|
220
286
|
/**
|
|
221
|
-
*
|
|
287
|
+
* Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
|
|
222
288
|
*/
|
|
223
|
-
|
|
289
|
+
ends_at?: Line.EndsAt;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
|
|
293
|
+
*/
|
|
294
|
+
proration_behavior?: Line.ProrationBehavior;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
|
298
|
+
*/
|
|
299
|
+
set_pause_collection?: Line.SetPauseCollection;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
|
|
303
|
+
*/
|
|
304
|
+
set_schedule_end?: Line.SetScheduleEnd;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Details to identify the earliest timestamp where the proposed change should take effect.
|
|
308
|
+
*/
|
|
309
|
+
starts_at?: Line.StartsAt;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Settings related to subscription trials.
|
|
313
|
+
*/
|
|
314
|
+
trial_settings?: Line.TrialSettings;
|
|
224
315
|
}
|
|
225
316
|
|
|
226
|
-
namespace
|
|
227
|
-
interface
|
|
317
|
+
namespace Line {
|
|
318
|
+
interface Action {
|
|
228
319
|
/**
|
|
229
|
-
*
|
|
320
|
+
* Details for the `add_discount` type.
|
|
230
321
|
*/
|
|
231
|
-
|
|
322
|
+
add_discount?: Action.AddDiscount;
|
|
232
323
|
|
|
233
324
|
/**
|
|
234
|
-
*
|
|
325
|
+
* Details for the `add_item` type.
|
|
235
326
|
*/
|
|
236
|
-
|
|
327
|
+
add_item?: Action.AddItem;
|
|
237
328
|
|
|
238
329
|
/**
|
|
239
|
-
*
|
|
330
|
+
* Details for the `add_metadata` type: specify a hash of key-value pairs.
|
|
240
331
|
*/
|
|
241
|
-
|
|
242
|
-
|
|
332
|
+
add_metadata?: {
|
|
333
|
+
[key: string]: string;
|
|
334
|
+
};
|
|
243
335
|
|
|
244
|
-
interface PriceData {
|
|
245
336
|
/**
|
|
246
|
-
*
|
|
337
|
+
* Details for the `remove_discount` type.
|
|
247
338
|
*/
|
|
248
|
-
|
|
339
|
+
remove_discount?: Action.RemoveDiscount;
|
|
249
340
|
|
|
250
341
|
/**
|
|
251
|
-
*
|
|
342
|
+
* Details for the `remove_item` type.
|
|
252
343
|
*/
|
|
253
|
-
|
|
344
|
+
remove_item?: Action.RemoveItem;
|
|
254
345
|
|
|
255
346
|
/**
|
|
256
|
-
*
|
|
347
|
+
* Details for the `remove_metadata` type: specify an array of metadata keys.
|
|
257
348
|
*/
|
|
258
|
-
|
|
349
|
+
remove_metadata?: Array<string>;
|
|
259
350
|
|
|
260
351
|
/**
|
|
261
|
-
*
|
|
352
|
+
* Details for the `set_discounts` type.
|
|
262
353
|
*/
|
|
263
|
-
|
|
354
|
+
set_discounts?: Array<Action.SetDiscount>;
|
|
264
355
|
|
|
265
356
|
/**
|
|
266
|
-
*
|
|
357
|
+
* Details for the `set_items` type.
|
|
267
358
|
*/
|
|
268
|
-
|
|
359
|
+
set_items?: Array<Action.SetItem>;
|
|
269
360
|
|
|
270
361
|
/**
|
|
271
|
-
*
|
|
362
|
+
* Details for the `set_metadata` type: specify an array of key-value pairs.
|
|
272
363
|
*/
|
|
273
|
-
|
|
364
|
+
set_metadata?: Stripe.Emptyable<{
|
|
365
|
+
[key: string]: string;
|
|
366
|
+
}>;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* The type of action the quote line performs.
|
|
370
|
+
*/
|
|
371
|
+
type: Action.Type;
|
|
274
372
|
}
|
|
275
373
|
|
|
276
|
-
namespace
|
|
277
|
-
interface
|
|
374
|
+
namespace Action {
|
|
375
|
+
interface AddDiscount {
|
|
278
376
|
/**
|
|
279
|
-
*
|
|
377
|
+
* The coupon code to redeem.
|
|
280
378
|
*/
|
|
281
|
-
|
|
379
|
+
coupon?: string;
|
|
282
380
|
|
|
283
381
|
/**
|
|
284
|
-
*
|
|
382
|
+
* An ID of an existing discount for a coupon that was already redeemed.
|
|
285
383
|
*/
|
|
286
|
-
|
|
384
|
+
discount?: string;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Details to determine how long the discount should be applied for.
|
|
388
|
+
*/
|
|
389
|
+
discount_end?: AddDiscount.DiscountEnd;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
|
|
393
|
+
*/
|
|
394
|
+
index?: number;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* The promotion code to redeem.
|
|
398
|
+
*/
|
|
399
|
+
promotion_code?: string;
|
|
287
400
|
}
|
|
288
401
|
|
|
289
|
-
namespace
|
|
290
|
-
|
|
402
|
+
namespace AddDiscount {
|
|
403
|
+
interface DiscountEnd {
|
|
404
|
+
/**
|
|
405
|
+
* The type of calculation made to determine when the discount ends.
|
|
406
|
+
*/
|
|
407
|
+
type: 'line_ends_at';
|
|
408
|
+
}
|
|
291
409
|
}
|
|
292
410
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
411
|
+
interface AddItem {
|
|
412
|
+
/**
|
|
413
|
+
* The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
|
414
|
+
*/
|
|
415
|
+
discounts?: Array<AddItem.Discount>;
|
|
296
416
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
billing_mode?: SubscriptionData.BillingMode;
|
|
417
|
+
/**
|
|
418
|
+
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
|
419
|
+
*/
|
|
420
|
+
metadata?: Stripe.MetadataParam;
|
|
302
421
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
422
|
+
/**
|
|
423
|
+
* The ID of the price object.
|
|
424
|
+
*/
|
|
425
|
+
price: string;
|
|
307
426
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
427
|
+
/**
|
|
428
|
+
* Quantity for this item.
|
|
429
|
+
*/
|
|
430
|
+
quantity?: number;
|
|
312
431
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
432
|
+
/**
|
|
433
|
+
* The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
|
|
434
|
+
*/
|
|
435
|
+
tax_rates?: Array<string>;
|
|
317
436
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
437
|
+
/**
|
|
438
|
+
* Options that configure the trial on the subscription item.
|
|
439
|
+
*/
|
|
440
|
+
trial?: AddItem.Trial;
|
|
441
|
+
}
|
|
323
442
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
443
|
+
namespace AddItem {
|
|
444
|
+
interface Discount {
|
|
445
|
+
/**
|
|
446
|
+
* ID of the coupon to create a new discount for.
|
|
447
|
+
*/
|
|
448
|
+
coupon?: string;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
452
|
+
*/
|
|
453
|
+
discount?: string;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Details to determine how long the discount should be applied for.
|
|
457
|
+
*/
|
|
458
|
+
discount_end?: Discount.DiscountEnd;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* ID of the promotion code to create a new discount for.
|
|
462
|
+
*/
|
|
463
|
+
promotion_code?: string;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
namespace Discount {
|
|
467
|
+
interface DiscountEnd {
|
|
468
|
+
/**
|
|
469
|
+
* Time span for the redeemed discount.
|
|
470
|
+
*/
|
|
471
|
+
duration?: DiscountEnd.Duration;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
475
|
+
*/
|
|
476
|
+
timestamp?: number;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The type of calculation made to determine when the discount ends.
|
|
480
|
+
*/
|
|
481
|
+
type: DiscountEnd.Type;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
namespace DiscountEnd {
|
|
485
|
+
interface Duration {
|
|
486
|
+
/**
|
|
487
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
488
|
+
*/
|
|
489
|
+
interval: Duration.Interval;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
493
|
+
*/
|
|
494
|
+
interval_count: number;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
namespace Duration {
|
|
498
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
type Type = 'duration' | 'timestamp';
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
interface Trial {
|
|
506
|
+
/**
|
|
507
|
+
* List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
|
508
|
+
*/
|
|
509
|
+
converts_to?: Array<string>;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Determines the type of trial for this item.
|
|
513
|
+
*/
|
|
514
|
+
type: Trial.Type;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
namespace Trial {
|
|
518
|
+
type Type = 'free' | 'paid';
|
|
519
|
+
}
|
|
520
|
+
}
|
|
328
521
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
522
|
+
interface RemoveDiscount {
|
|
523
|
+
/**
|
|
524
|
+
* The coupon code to remove from the `discounts` array.
|
|
525
|
+
*/
|
|
526
|
+
coupon?: string;
|
|
333
527
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
amount?: number;
|
|
528
|
+
/**
|
|
529
|
+
* The ID of a discount to remove from the `discounts` array.
|
|
530
|
+
*/
|
|
531
|
+
discount?: string;
|
|
339
532
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
533
|
+
/**
|
|
534
|
+
* The ID of a promotion code to remove from the `discounts` array.
|
|
535
|
+
*/
|
|
536
|
+
promotion_code?: string;
|
|
537
|
+
}
|
|
344
538
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
539
|
+
interface RemoveItem {
|
|
540
|
+
/**
|
|
541
|
+
* ID of a price to remove.
|
|
542
|
+
*/
|
|
543
|
+
price: string;
|
|
544
|
+
}
|
|
351
545
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
546
|
+
interface SetDiscount {
|
|
547
|
+
/**
|
|
548
|
+
* The coupon code to replace the `discounts` array with.
|
|
549
|
+
*/
|
|
550
|
+
coupon?: string;
|
|
358
551
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
application_fee_amount?: Stripe.Emptyable<number>;
|
|
552
|
+
/**
|
|
553
|
+
* An ID of an existing discount to replace the `discounts` array with.
|
|
554
|
+
*/
|
|
555
|
+
discount?: string;
|
|
364
556
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
557
|
+
/**
|
|
558
|
+
* An ID of an existing promotion code to replace the `discounts` array with.
|
|
559
|
+
*/
|
|
560
|
+
promotion_code?: string;
|
|
561
|
+
}
|
|
369
562
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
563
|
+
interface SetItem {
|
|
564
|
+
/**
|
|
565
|
+
* If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
|
|
566
|
+
*/
|
|
567
|
+
discounts?: Array<SetItem.Discount>;
|
|
374
568
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
569
|
+
/**
|
|
570
|
+
* If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
|
|
571
|
+
*/
|
|
572
|
+
metadata?: Stripe.MetadataParam;
|
|
379
573
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
574
|
+
/**
|
|
575
|
+
* The ID of the price object.
|
|
576
|
+
*/
|
|
577
|
+
price: string;
|
|
384
578
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
579
|
+
/**
|
|
580
|
+
* If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
|
|
581
|
+
*/
|
|
582
|
+
quantity?: number;
|
|
389
583
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
584
|
+
/**
|
|
585
|
+
* If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
|
|
586
|
+
*/
|
|
587
|
+
tax_rates?: Array<string>;
|
|
394
588
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
589
|
+
/**
|
|
590
|
+
* If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
|
|
591
|
+
*/
|
|
592
|
+
trial?: SetItem.Trial;
|
|
593
|
+
}
|
|
399
594
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
595
|
+
namespace SetItem {
|
|
596
|
+
interface Discount {
|
|
597
|
+
/**
|
|
598
|
+
* ID of the coupon to create a new discount for.
|
|
599
|
+
*/
|
|
600
|
+
coupon?: string;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
604
|
+
*/
|
|
605
|
+
discount?: string;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Details to determine how long the discount should be applied for.
|
|
609
|
+
*/
|
|
610
|
+
discount_end?: Discount.DiscountEnd;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* ID of the promotion code to create a new discount for.
|
|
614
|
+
*/
|
|
615
|
+
promotion_code?: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
namespace Discount {
|
|
619
|
+
interface DiscountEnd {
|
|
620
|
+
/**
|
|
621
|
+
* Time span for the redeemed discount.
|
|
622
|
+
*/
|
|
623
|
+
duration?: DiscountEnd.Duration;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
627
|
+
*/
|
|
628
|
+
timestamp?: number;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* The type of calculation made to determine when the discount ends.
|
|
632
|
+
*/
|
|
633
|
+
type: DiscountEnd.Type;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
namespace DiscountEnd {
|
|
637
|
+
interface Duration {
|
|
638
|
+
/**
|
|
639
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
640
|
+
*/
|
|
641
|
+
interval: Duration.Interval;
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
645
|
+
*/
|
|
646
|
+
interval_count: number;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
namespace Duration {
|
|
650
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
type Type = 'duration' | 'timestamp';
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
interface Trial {
|
|
658
|
+
/**
|
|
659
|
+
* List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
|
660
|
+
*/
|
|
661
|
+
converts_to?: Array<string>;
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Determines the type of trial for this item.
|
|
665
|
+
*/
|
|
666
|
+
type: Trial.Type;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
namespace Trial {
|
|
670
|
+
type Type = 'free' | 'paid';
|
|
671
|
+
}
|
|
672
|
+
}
|
|
404
673
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
674
|
+
type Type =
|
|
675
|
+
| 'add_discount'
|
|
676
|
+
| 'add_item'
|
|
677
|
+
| 'add_metadata'
|
|
678
|
+
| 'clear_discounts'
|
|
679
|
+
| 'clear_metadata'
|
|
680
|
+
| 'remove_discount'
|
|
681
|
+
| 'remove_item'
|
|
682
|
+
| 'remove_metadata'
|
|
683
|
+
| 'set_discounts'
|
|
684
|
+
| 'set_items'
|
|
685
|
+
| 'set_metadata';
|
|
686
|
+
}
|
|
409
687
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
688
|
+
interface AppliesTo {
|
|
689
|
+
/**
|
|
690
|
+
* 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.
|
|
691
|
+
*/
|
|
692
|
+
new_reference?: string;
|
|
414
693
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
694
|
+
/**
|
|
695
|
+
* The ID of the schedule the line applies to.
|
|
696
|
+
*/
|
|
697
|
+
subscription_schedule?: string;
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Describes whether the quote line is affecting a new schedule or an existing schedule.
|
|
701
|
+
*/
|
|
702
|
+
type: AppliesTo.Type;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
namespace AppliesTo {
|
|
706
|
+
type Type = 'new_reference' | 'subscription_schedule';
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
type BillingCycleAnchor = 'automatic' | 'line_starts_at';
|
|
710
|
+
|
|
711
|
+
interface CancelSubscriptionSchedule {
|
|
712
|
+
/**
|
|
713
|
+
* Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
|
|
714
|
+
*/
|
|
715
|
+
cancel_at: 'line_starts_at';
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
|
|
719
|
+
*/
|
|
720
|
+
invoice_now?: boolean;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
|
|
724
|
+
*/
|
|
725
|
+
prorate?: boolean;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
interface EndsAt {
|
|
729
|
+
/**
|
|
730
|
+
* Use the `end` time of a given discount.
|
|
731
|
+
*/
|
|
732
|
+
discount_end?: EndsAt.DiscountEnd;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Time span for the quote line starting from the `starts_at` date.
|
|
736
|
+
*/
|
|
737
|
+
duration?: EndsAt.Duration;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* A precise Unix timestamp.
|
|
741
|
+
*/
|
|
742
|
+
timestamp?: number;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Select a way to pass in `ends_at`.
|
|
746
|
+
*/
|
|
747
|
+
type: EndsAt.Type;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
namespace EndsAt {
|
|
751
|
+
interface DiscountEnd {
|
|
752
|
+
/**
|
|
753
|
+
* The ID of a specific discount.
|
|
754
|
+
*/
|
|
755
|
+
discount: string;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
interface Duration {
|
|
759
|
+
/**
|
|
760
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
761
|
+
*/
|
|
762
|
+
interval: Duration.Interval;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
766
|
+
*/
|
|
767
|
+
interval_count: number;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
namespace Duration {
|
|
771
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
type Type =
|
|
775
|
+
| 'billing_period_end'
|
|
776
|
+
| 'discount_end'
|
|
777
|
+
| 'duration'
|
|
778
|
+
| 'quote_acceptance_date'
|
|
779
|
+
| 'schedule_end'
|
|
780
|
+
| 'timestamp'
|
|
781
|
+
| 'upcoming_invoice';
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
type ProrationBehavior =
|
|
785
|
+
| 'always_invoice'
|
|
786
|
+
| 'create_prorations'
|
|
787
|
+
| 'none';
|
|
788
|
+
|
|
789
|
+
interface SetPauseCollection {
|
|
790
|
+
/**
|
|
791
|
+
* Details of the pause_collection behavior to apply to the amendment.
|
|
792
|
+
*/
|
|
793
|
+
set?: SetPauseCollection.Set;
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Determines the type of the pause_collection amendment.
|
|
797
|
+
*/
|
|
798
|
+
type: SetPauseCollection.Type;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
namespace SetPauseCollection {
|
|
802
|
+
interface Set {
|
|
803
|
+
/**
|
|
804
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
805
|
+
*/
|
|
806
|
+
behavior: Set.Behavior;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
namespace Set {
|
|
810
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
type Type = 'remove' | 'set';
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
type SetScheduleEnd = 'line_ends_at' | 'line_starts_at';
|
|
817
|
+
|
|
818
|
+
interface StartsAt {
|
|
819
|
+
/**
|
|
820
|
+
* Use the `end` time of a given discount.
|
|
821
|
+
*/
|
|
822
|
+
discount_end?: StartsAt.DiscountEnd;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* The timestamp the given line ends at.
|
|
826
|
+
*/
|
|
827
|
+
line_ends_at?: StartsAt.LineEndsAt;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* A precise Unix timestamp.
|
|
831
|
+
*/
|
|
832
|
+
timestamp?: number;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Select a way to pass in `starts_at`.
|
|
836
|
+
*/
|
|
837
|
+
type: StartsAt.Type;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
namespace StartsAt {
|
|
841
|
+
interface DiscountEnd {
|
|
842
|
+
/**
|
|
843
|
+
* The ID of a specific discount.
|
|
844
|
+
*/
|
|
845
|
+
discount: string;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
interface LineEndsAt {
|
|
849
|
+
/**
|
|
850
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
851
|
+
*/
|
|
852
|
+
index?: number;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
type Type =
|
|
856
|
+
| 'discount_end'
|
|
857
|
+
| 'line_ends_at'
|
|
858
|
+
| 'now'
|
|
859
|
+
| 'quote_acceptance_date'
|
|
860
|
+
| 'schedule_end'
|
|
861
|
+
| 'timestamp'
|
|
862
|
+
| 'upcoming_invoice';
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
interface TrialSettings {
|
|
866
|
+
/**
|
|
867
|
+
* Defines how the subscription should behave when a trial ends.
|
|
868
|
+
*/
|
|
869
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
namespace TrialSettings {
|
|
873
|
+
interface EndBehavior {
|
|
874
|
+
/**
|
|
875
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
876
|
+
*/
|
|
877
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
namespace EndBehavior {
|
|
881
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
interface LineItem {
|
|
887
|
+
/**
|
|
888
|
+
* The discounts applied to this line item.
|
|
889
|
+
*/
|
|
890
|
+
discounts?: Stripe.Emptyable<Array<LineItem.Discount>>;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* The ID of the price object. One of `price` or `price_data` is required.
|
|
894
|
+
*/
|
|
895
|
+
price?: string;
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
|
899
|
+
*/
|
|
900
|
+
price_data?: LineItem.PriceData;
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* The quantity of the line item.
|
|
904
|
+
*/
|
|
905
|
+
quantity?: number;
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
|
|
909
|
+
*/
|
|
910
|
+
tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
namespace LineItem {
|
|
914
|
+
interface Discount {
|
|
915
|
+
/**
|
|
916
|
+
* ID of the coupon to create a new discount for.
|
|
917
|
+
*/
|
|
918
|
+
coupon?: string;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
922
|
+
*/
|
|
923
|
+
discount?: string;
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Details to determine how long the discount should be applied for.
|
|
927
|
+
*/
|
|
928
|
+
discount_end?: Discount.DiscountEnd;
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* ID of the promotion code to create a new discount for.
|
|
932
|
+
*/
|
|
933
|
+
promotion_code?: string;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
namespace Discount {
|
|
937
|
+
interface DiscountEnd {
|
|
938
|
+
/**
|
|
939
|
+
* Time span for the redeemed discount.
|
|
940
|
+
*/
|
|
941
|
+
duration?: DiscountEnd.Duration;
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
945
|
+
*/
|
|
946
|
+
timestamp?: number;
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* The type of calculation made to determine when the discount ends.
|
|
950
|
+
*/
|
|
951
|
+
type: DiscountEnd.Type;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
namespace DiscountEnd {
|
|
955
|
+
interface Duration {
|
|
956
|
+
/**
|
|
957
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
958
|
+
*/
|
|
959
|
+
interval: Duration.Interval;
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
963
|
+
*/
|
|
964
|
+
interval_count: number;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
namespace Duration {
|
|
968
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
type Type = 'duration' | 'timestamp';
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
interface PriceData {
|
|
976
|
+
/**
|
|
977
|
+
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
|
978
|
+
*/
|
|
979
|
+
currency: string;
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
|
|
983
|
+
*/
|
|
984
|
+
product: string;
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* The recurring components of a price such as `interval` and `interval_count`.
|
|
988
|
+
*/
|
|
989
|
+
recurring?: PriceData.Recurring;
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
|
993
|
+
*/
|
|
994
|
+
tax_behavior?: PriceData.TaxBehavior;
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
|
|
998
|
+
*/
|
|
999
|
+
unit_amount?: number;
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
|
1003
|
+
*/
|
|
1004
|
+
unit_amount_decimal?: string;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
namespace PriceData {
|
|
1008
|
+
interface Recurring {
|
|
1009
|
+
/**
|
|
1010
|
+
* Specifies billing frequency. Either `day`, `week`, `month` or `year`.
|
|
1011
|
+
*/
|
|
1012
|
+
interval: Recurring.Interval;
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
|
|
1016
|
+
*/
|
|
1017
|
+
interval_count?: number;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
namespace Recurring {
|
|
1021
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
interface SubscriptionData {
|
|
1029
|
+
/**
|
|
1030
|
+
* Describes the period to bill for upon accepting the quote.
|
|
1031
|
+
*/
|
|
1032
|
+
bill_on_acceptance?: SubscriptionData.BillOnAcceptance;
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* 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.
|
|
1036
|
+
*/
|
|
1037
|
+
billing_behavior?: SubscriptionData.BillingBehavior;
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
|
|
1041
|
+
*/
|
|
1042
|
+
billing_cycle_anchor?: Stripe.Emptyable<'reset'>;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
|
1046
|
+
*/
|
|
1047
|
+
billing_mode?: SubscriptionData.BillingMode;
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* 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.
|
|
1051
|
+
*/
|
|
1052
|
+
description?: string;
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
|
|
1056
|
+
*/
|
|
1057
|
+
effective_date?: Stripe.Emptyable<'current_period_end' | number>;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
1061
|
+
*/
|
|
1062
|
+
end_behavior?: SubscriptionData.EndBehavior;
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden.
|
|
1066
|
+
*/
|
|
1067
|
+
from_subscription?: string;
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* 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.
|
|
1071
|
+
*/
|
|
1072
|
+
metadata?: Stripe.MetadataParam;
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
|
|
1076
|
+
*/
|
|
1077
|
+
prebilling?: Stripe.Emptyable<SubscriptionData.Prebilling>;
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
|
1081
|
+
*
|
|
1082
|
+
* When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
|
1083
|
+
*
|
|
1084
|
+
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
|
1085
|
+
*
|
|
1086
|
+
* Prorations can be disabled by passing `none`.
|
|
1087
|
+
*/
|
|
1088
|
+
proration_behavior?: SubscriptionData.ProrationBehavior;
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Integer representing the number of trial period days before the customer is charged for the first time.
|
|
1092
|
+
*/
|
|
1093
|
+
trial_period_days?: Stripe.Emptyable<number>;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
namespace SubscriptionData {
|
|
1097
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
1098
|
+
|
|
1099
|
+
interface BillingMode {
|
|
1100
|
+
type: BillingMode.Type;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
namespace BillingMode {
|
|
1104
|
+
type Type = 'classic' | 'flexible';
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
interface BillOnAcceptance {
|
|
1108
|
+
/**
|
|
1109
|
+
* The start of the period to bill from when the Quote is accepted.
|
|
1110
|
+
*/
|
|
1111
|
+
bill_from?: BillOnAcceptance.BillFrom;
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* The end of the period to bill until when the Quote is accepted.
|
|
1115
|
+
*/
|
|
1116
|
+
bill_until?: BillOnAcceptance.BillUntil;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
namespace BillOnAcceptance {
|
|
1120
|
+
interface BillFrom {
|
|
1121
|
+
/**
|
|
1122
|
+
* Details of a Quote line to start the bill period from.
|
|
1123
|
+
*/
|
|
1124
|
+
line_starts_at?: BillFrom.LineStartsAt;
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* A precise Unix timestamp.
|
|
1128
|
+
*/
|
|
1129
|
+
timestamp?: number;
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* The type of method to specify the `bill_from` time.
|
|
1133
|
+
*/
|
|
1134
|
+
type: BillFrom.Type;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
namespace BillFrom {
|
|
1138
|
+
interface LineStartsAt {
|
|
1139
|
+
/**
|
|
1140
|
+
* The ID of a quote line.
|
|
1141
|
+
*/
|
|
1142
|
+
id?: string;
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
1146
|
+
*/
|
|
1147
|
+
index?: number;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
type Type =
|
|
1151
|
+
| 'line_starts_at'
|
|
1152
|
+
| 'now'
|
|
1153
|
+
| 'pause_collection_start'
|
|
1154
|
+
| 'quote_acceptance_date'
|
|
1155
|
+
| 'timestamp';
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
interface BillUntil {
|
|
1159
|
+
/**
|
|
1160
|
+
* Details of the duration over which to bill.
|
|
1161
|
+
*/
|
|
1162
|
+
duration?: BillUntil.Duration;
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* Details of a Quote line item from which to bill until.
|
|
1166
|
+
*/
|
|
1167
|
+
line_ends_at?: BillUntil.LineEndsAt;
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* A precise Unix timestamp.
|
|
1171
|
+
*/
|
|
1172
|
+
timestamp?: number;
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* The type of method to specify the `bill_until` time.
|
|
1176
|
+
*/
|
|
1177
|
+
type: BillUntil.Type;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
namespace BillUntil {
|
|
1181
|
+
interface Duration {
|
|
1182
|
+
/**
|
|
1183
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1184
|
+
*/
|
|
1185
|
+
interval: Duration.Interval;
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1189
|
+
*/
|
|
1190
|
+
interval_count: number;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
namespace Duration {
|
|
1194
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
interface LineEndsAt {
|
|
1198
|
+
/**
|
|
1199
|
+
* The ID of a quote line.
|
|
1200
|
+
*/
|
|
1201
|
+
id?: string;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
1205
|
+
*/
|
|
1206
|
+
index?: number;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
type Type =
|
|
1210
|
+
| 'duration'
|
|
1211
|
+
| 'line_ends_at'
|
|
1212
|
+
| 'schedule_end'
|
|
1213
|
+
| 'timestamp'
|
|
1214
|
+
| 'upcoming_invoice';
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
type EndBehavior = 'cancel' | 'release';
|
|
1219
|
+
|
|
1220
|
+
interface Prebilling {
|
|
1221
|
+
/**
|
|
1222
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
1223
|
+
*/
|
|
1224
|
+
iterations: number;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
type ProrationBehavior =
|
|
1228
|
+
| 'always_invoice'
|
|
1229
|
+
| 'create_prorations'
|
|
1230
|
+
| 'none';
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
interface SubscriptionDataOverride {
|
|
1234
|
+
/**
|
|
1235
|
+
* Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
|
|
1236
|
+
*/
|
|
1237
|
+
applies_to: SubscriptionDataOverride.AppliesTo;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Describes the period to bill for upon accepting the quote.
|
|
1241
|
+
*/
|
|
1242
|
+
bill_on_acceptance?: SubscriptionDataOverride.BillOnAcceptance;
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* 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.
|
|
1246
|
+
*/
|
|
1247
|
+
billing_behavior?: SubscriptionDataOverride.BillingBehavior;
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`.
|
|
1251
|
+
*/
|
|
1252
|
+
customer?: string;
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* 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.
|
|
1256
|
+
*/
|
|
1257
|
+
description?: string;
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
1261
|
+
*/
|
|
1262
|
+
end_behavior?: SubscriptionDataOverride.EndBehavior;
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
|
1266
|
+
*
|
|
1267
|
+
* When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
|
1268
|
+
*
|
|
1269
|
+
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
|
1270
|
+
*
|
|
1271
|
+
* Prorations can be disabled by passing `none`.
|
|
1272
|
+
*/
|
|
1273
|
+
proration_behavior?: SubscriptionDataOverride.ProrationBehavior;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
namespace SubscriptionDataOverride {
|
|
1277
|
+
interface AppliesTo {
|
|
1278
|
+
/**
|
|
1279
|
+
* 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.
|
|
1280
|
+
*/
|
|
1281
|
+
new_reference?: string;
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* The ID of the schedule the line applies to.
|
|
1285
|
+
*/
|
|
1286
|
+
subscription_schedule?: string;
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Describes whether the quote line is affecting a new schedule or an existing schedule.
|
|
1290
|
+
*/
|
|
1291
|
+
type: AppliesTo.Type;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
namespace AppliesTo {
|
|
1295
|
+
type Type = 'new_reference' | 'subscription_schedule';
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
1299
|
+
|
|
1300
|
+
interface BillOnAcceptance {
|
|
1301
|
+
/**
|
|
1302
|
+
* The start of the period to bill from when the Quote is accepted.
|
|
1303
|
+
*/
|
|
1304
|
+
bill_from?: BillOnAcceptance.BillFrom;
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* The end of the period to bill until when the Quote is accepted.
|
|
1308
|
+
*/
|
|
1309
|
+
bill_until?: BillOnAcceptance.BillUntil;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
namespace BillOnAcceptance {
|
|
1313
|
+
interface BillFrom {
|
|
1314
|
+
/**
|
|
1315
|
+
* Details of a Quote line to start the bill period from.
|
|
1316
|
+
*/
|
|
1317
|
+
line_starts_at?: BillFrom.LineStartsAt;
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* A precise Unix timestamp.
|
|
1321
|
+
*/
|
|
1322
|
+
timestamp?: number;
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* The type of method to specify the `bill_from` time.
|
|
1326
|
+
*/
|
|
1327
|
+
type: BillFrom.Type;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
namespace BillFrom {
|
|
1331
|
+
interface LineStartsAt {
|
|
1332
|
+
/**
|
|
1333
|
+
* The ID of a quote line.
|
|
1334
|
+
*/
|
|
1335
|
+
id?: string;
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
1339
|
+
*/
|
|
1340
|
+
index?: number;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
type Type =
|
|
1344
|
+
| 'line_starts_at'
|
|
1345
|
+
| 'now'
|
|
1346
|
+
| 'pause_collection_start'
|
|
1347
|
+
| 'quote_acceptance_date'
|
|
1348
|
+
| 'timestamp';
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
interface BillUntil {
|
|
1352
|
+
/**
|
|
1353
|
+
* Details of the duration over which to bill.
|
|
1354
|
+
*/
|
|
1355
|
+
duration?: BillUntil.Duration;
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* Details of a Quote line item from which to bill until.
|
|
1359
|
+
*/
|
|
1360
|
+
line_ends_at?: BillUntil.LineEndsAt;
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* A precise Unix timestamp.
|
|
1364
|
+
*/
|
|
1365
|
+
timestamp?: number;
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* The type of method to specify the `bill_until` time.
|
|
1369
|
+
*/
|
|
1370
|
+
type: BillUntil.Type;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
namespace BillUntil {
|
|
1374
|
+
interface Duration {
|
|
1375
|
+
/**
|
|
1376
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1377
|
+
*/
|
|
1378
|
+
interval: Duration.Interval;
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1382
|
+
*/
|
|
1383
|
+
interval_count: number;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
namespace Duration {
|
|
1387
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
interface LineEndsAt {
|
|
1391
|
+
/**
|
|
1392
|
+
* The ID of a quote line.
|
|
1393
|
+
*/
|
|
1394
|
+
id?: string;
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
1398
|
+
*/
|
|
1399
|
+
index?: number;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
type Type =
|
|
1403
|
+
| 'duration'
|
|
1404
|
+
| 'line_ends_at'
|
|
1405
|
+
| 'schedule_end'
|
|
1406
|
+
| 'timestamp'
|
|
1407
|
+
| 'upcoming_invoice';
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
type EndBehavior = 'cancel' | 'release';
|
|
1412
|
+
|
|
1413
|
+
type ProrationBehavior =
|
|
1414
|
+
| 'always_invoice'
|
|
1415
|
+
| 'create_prorations'
|
|
1416
|
+
| 'none';
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
interface TransferData {
|
|
1420
|
+
/**
|
|
1421
|
+
* The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
|
|
1422
|
+
*/
|
|
1423
|
+
amount?: number;
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field.
|
|
1427
|
+
*/
|
|
1428
|
+
amount_percent?: number;
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* ID of an existing, connected Stripe account.
|
|
1432
|
+
*/
|
|
1433
|
+
destination: string;
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
interface QuoteRetrieveParams {
|
|
1438
|
+
/**
|
|
1439
|
+
* Specifies which fields in the response should be expanded.
|
|
1440
|
+
*/
|
|
1441
|
+
expand?: Array<string>;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
interface QuoteUpdateParams {
|
|
1445
|
+
/**
|
|
1446
|
+
* Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
|
|
1447
|
+
*/
|
|
1448
|
+
allow_backdated_lines?: boolean;
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
|
|
1452
|
+
*/
|
|
1453
|
+
application_fee_amount?: Stripe.Emptyable<number>;
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field.
|
|
1457
|
+
*/
|
|
1458
|
+
application_fee_percent?: Stripe.Emptyable<number>;
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
|
|
1462
|
+
*/
|
|
1463
|
+
automatic_tax?: QuoteUpdateParams.AutomaticTax;
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
|
|
1467
|
+
*/
|
|
1468
|
+
collection_method?: QuoteUpdateParams.CollectionMethod;
|
|
1469
|
+
|
|
1470
|
+
/**
|
|
1471
|
+
* The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
|
|
1472
|
+
*/
|
|
1473
|
+
customer?: string;
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
|
|
1477
|
+
*/
|
|
1478
|
+
customer_account?: string;
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* The tax rates that will apply to any line item that does not have `tax_rates` set.
|
|
1482
|
+
*/
|
|
1483
|
+
default_tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* A description that will be displayed on the quote PDF.
|
|
1487
|
+
*/
|
|
1488
|
+
description?: Stripe.Emptyable<string>;
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* The discounts applied to the quote.
|
|
1492
|
+
*/
|
|
1493
|
+
discounts?: Stripe.Emptyable<Array<QuoteUpdateParams.Discount>>;
|
|
1494
|
+
|
|
1495
|
+
/**
|
|
1496
|
+
* Specifies which fields in the response should be expanded.
|
|
1497
|
+
*/
|
|
1498
|
+
expand?: Array<string>;
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
|
|
1502
|
+
*/
|
|
1503
|
+
expires_at?: number;
|
|
1504
|
+
|
|
1505
|
+
/**
|
|
1506
|
+
* A footer that will be displayed on the quote PDF.
|
|
1507
|
+
*/
|
|
1508
|
+
footer?: Stripe.Emptyable<string>;
|
|
1509
|
+
|
|
1510
|
+
/**
|
|
1511
|
+
* A header that will be displayed on the quote PDF.
|
|
1512
|
+
*/
|
|
1513
|
+
header?: Stripe.Emptyable<string>;
|
|
1514
|
+
|
|
1515
|
+
/**
|
|
1516
|
+
* All invoices will be billed using the specified settings.
|
|
1517
|
+
*/
|
|
1518
|
+
invoice_settings?: QuoteUpdateParams.InvoiceSettings;
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
|
|
1522
|
+
*/
|
|
1523
|
+
line_items?: Array<QuoteUpdateParams.LineItem>;
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* 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.
|
|
1527
|
+
*/
|
|
1528
|
+
lines?: Array<QuoteUpdateParams.Line>;
|
|
1529
|
+
|
|
1530
|
+
/**
|
|
1531
|
+
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
|
1532
|
+
*/
|
|
1533
|
+
metadata?: Stripe.MetadataParam;
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* The account on behalf of which to charge.
|
|
1537
|
+
*/
|
|
1538
|
+
on_behalf_of?: Stripe.Emptyable<string>;
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
|
|
1542
|
+
*/
|
|
1543
|
+
subscription_data?: QuoteUpdateParams.SubscriptionData;
|
|
1544
|
+
|
|
1545
|
+
/**
|
|
1546
|
+
* List representing overrides for `subscription_data` configurations for specific subscription schedules.
|
|
1547
|
+
*/
|
|
1548
|
+
subscription_data_overrides?: Stripe.Emptyable<
|
|
1549
|
+
Array<QuoteUpdateParams.SubscriptionDataOverride>
|
|
1550
|
+
>;
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* The data with which to automatically create a Transfer for each of the invoices.
|
|
1554
|
+
*/
|
|
1555
|
+
transfer_data?: Stripe.Emptyable<QuoteUpdateParams.TransferData>;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
namespace QuoteUpdateParams {
|
|
1559
|
+
interface AutomaticTax {
|
|
1560
|
+
/**
|
|
1561
|
+
* Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
|
|
1562
|
+
*/
|
|
1563
|
+
enabled: boolean;
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
|
|
1567
|
+
*/
|
|
1568
|
+
liability?: AutomaticTax.Liability;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
namespace AutomaticTax {
|
|
1572
|
+
interface Liability {
|
|
1573
|
+
/**
|
|
1574
|
+
* The connected account being referenced when `type` is `account`.
|
|
1575
|
+
*/
|
|
1576
|
+
account?: string;
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* Type of the account referenced in the request.
|
|
1580
|
+
*/
|
|
1581
|
+
type: Liability.Type;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
namespace Liability {
|
|
1585
|
+
type Type = 'account' | 'self';
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
type CollectionMethod = 'charge_automatically' | 'send_invoice';
|
|
1590
|
+
|
|
1591
|
+
interface Discount {
|
|
1592
|
+
/**
|
|
1593
|
+
* ID of the coupon to create a new discount for.
|
|
1594
|
+
*/
|
|
1595
|
+
coupon?: string;
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
1599
|
+
*/
|
|
1600
|
+
discount?: string;
|
|
1601
|
+
|
|
1602
|
+
/**
|
|
1603
|
+
* Details to determine how long the discount should be applied for.
|
|
1604
|
+
*/
|
|
1605
|
+
discount_end?: Discount.DiscountEnd;
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* ID of the promotion code to create a new discount for.
|
|
1609
|
+
*/
|
|
1610
|
+
promotion_code?: string;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
namespace Discount {
|
|
1614
|
+
interface DiscountEnd {
|
|
1615
|
+
/**
|
|
1616
|
+
* Time span for the redeemed discount.
|
|
1617
|
+
*/
|
|
1618
|
+
duration?: DiscountEnd.Duration;
|
|
1619
|
+
|
|
1620
|
+
/**
|
|
1621
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1622
|
+
*/
|
|
1623
|
+
timestamp?: number;
|
|
1624
|
+
|
|
1625
|
+
/**
|
|
1626
|
+
* The type of calculation made to determine when the discount ends.
|
|
1627
|
+
*/
|
|
1628
|
+
type: DiscountEnd.Type;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
namespace DiscountEnd {
|
|
1632
|
+
interface Duration {
|
|
1633
|
+
/**
|
|
1634
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1635
|
+
*/
|
|
1636
|
+
interval: Duration.Interval;
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1640
|
+
*/
|
|
1641
|
+
interval_count: number;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
namespace Duration {
|
|
1645
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
type Type = 'duration' | 'timestamp';
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
interface InvoiceSettings {
|
|
1653
|
+
/**
|
|
1654
|
+
* Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
|
|
1655
|
+
*/
|
|
1656
|
+
days_until_due?: number;
|
|
1657
|
+
|
|
1658
|
+
/**
|
|
1659
|
+
* The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
|
|
1660
|
+
*/
|
|
1661
|
+
issuer?: InvoiceSettings.Issuer;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
namespace InvoiceSettings {
|
|
1665
|
+
interface Issuer {
|
|
1666
|
+
/**
|
|
1667
|
+
* The connected account being referenced when `type` is `account`.
|
|
1668
|
+
*/
|
|
1669
|
+
account?: string;
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Type of the account referenced in the request.
|
|
1673
|
+
*/
|
|
1674
|
+
type: Issuer.Type;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
namespace Issuer {
|
|
1678
|
+
type Type = 'account' | 'self';
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
interface Line {
|
|
1683
|
+
/**
|
|
1684
|
+
* An array of operations the quote line performs.
|
|
1685
|
+
*/
|
|
1686
|
+
actions?: Array<Line.Action>;
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* Details to identify the subscription schedule the quote line applies to.
|
|
1690
|
+
*/
|
|
1691
|
+
applies_to?: Line.AppliesTo;
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
|
|
1695
|
+
*/
|
|
1696
|
+
billing_cycle_anchor?: Line.BillingCycleAnchor;
|
|
1697
|
+
|
|
1698
|
+
/**
|
|
1699
|
+
* A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
|
|
1700
|
+
*/
|
|
1701
|
+
cancel_subscription_schedule?: Line.CancelSubscriptionSchedule;
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
|
|
1705
|
+
*/
|
|
1706
|
+
ends_at?: Line.EndsAt;
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* The ID of an existing line on the quote.
|
|
1710
|
+
*/
|
|
1711
|
+
id?: string;
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
|
|
1715
|
+
*/
|
|
1716
|
+
proration_behavior?: Line.ProrationBehavior;
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
|
1720
|
+
*/
|
|
1721
|
+
set_pause_collection?: Line.SetPauseCollection;
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
|
|
1725
|
+
*/
|
|
1726
|
+
set_schedule_end?: Line.SetScheduleEnd;
|
|
1727
|
+
|
|
1728
|
+
/**
|
|
1729
|
+
* Details to identify the earliest timestamp where the proposed change should take effect.
|
|
1730
|
+
*/
|
|
1731
|
+
starts_at?: Line.StartsAt;
|
|
1732
|
+
|
|
1733
|
+
/**
|
|
1734
|
+
* Settings related to subscription trials.
|
|
1735
|
+
*/
|
|
1736
|
+
trial_settings?: Line.TrialSettings;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
namespace Line {
|
|
1740
|
+
interface Action {
|
|
1741
|
+
/**
|
|
1742
|
+
* Details for the `add_discount` type.
|
|
1743
|
+
*/
|
|
1744
|
+
add_discount?: Action.AddDiscount;
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* Details for the `add_item` type.
|
|
1748
|
+
*/
|
|
1749
|
+
add_item?: Action.AddItem;
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Details for the `add_metadata` type: specify a hash of key-value pairs.
|
|
1753
|
+
*/
|
|
1754
|
+
add_metadata?: {
|
|
1755
|
+
[key: string]: string;
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1758
|
+
/**
|
|
1759
|
+
* Details for the `remove_discount` type.
|
|
1760
|
+
*/
|
|
1761
|
+
remove_discount?: Action.RemoveDiscount;
|
|
1762
|
+
|
|
1763
|
+
/**
|
|
1764
|
+
* Details for the `remove_item` type.
|
|
1765
|
+
*/
|
|
1766
|
+
remove_item?: Action.RemoveItem;
|
|
1767
|
+
|
|
1768
|
+
/**
|
|
1769
|
+
* Details for the `remove_metadata` type: specify an array of metadata keys.
|
|
1770
|
+
*/
|
|
1771
|
+
remove_metadata?: Array<string>;
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* Details for the `set_discounts` type.
|
|
1775
|
+
*/
|
|
1776
|
+
set_discounts?: Array<Action.SetDiscount>;
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* Details for the `set_items` type.
|
|
1780
|
+
*/
|
|
1781
|
+
set_items?: Array<Action.SetItem>;
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* Details for the `set_metadata` type: specify an array of key-value pairs.
|
|
1785
|
+
*/
|
|
1786
|
+
set_metadata?: Stripe.Emptyable<{
|
|
1787
|
+
[key: string]: string;
|
|
1788
|
+
}>;
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* The type of action the quote line performs.
|
|
1792
|
+
*/
|
|
1793
|
+
type: Action.Type;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
namespace Action {
|
|
1797
|
+
interface AddDiscount {
|
|
1798
|
+
/**
|
|
1799
|
+
* The coupon code to redeem.
|
|
1800
|
+
*/
|
|
1801
|
+
coupon?: string;
|
|
1802
|
+
|
|
1803
|
+
/**
|
|
1804
|
+
* An ID of an existing discount for a coupon that was already redeemed.
|
|
1805
|
+
*/
|
|
1806
|
+
discount?: string;
|
|
419
1807
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
1808
|
+
/**
|
|
1809
|
+
* Details to determine how long the discount should be applied for.
|
|
1810
|
+
*/
|
|
1811
|
+
discount_end?: AddDiscount.DiscountEnd;
|
|
424
1812
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
1813
|
+
/**
|
|
1814
|
+
* The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
|
|
1815
|
+
*/
|
|
1816
|
+
index?: number;
|
|
429
1817
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
1818
|
+
/**
|
|
1819
|
+
* The promotion code to redeem.
|
|
1820
|
+
*/
|
|
1821
|
+
promotion_code?: string;
|
|
1822
|
+
}
|
|
434
1823
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
1824
|
+
namespace AddDiscount {
|
|
1825
|
+
interface DiscountEnd {
|
|
1826
|
+
/**
|
|
1827
|
+
* The type of calculation made to determine when the discount ends.
|
|
1828
|
+
*/
|
|
1829
|
+
type: 'line_ends_at';
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
439
1832
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
1833
|
+
interface AddItem {
|
|
1834
|
+
/**
|
|
1835
|
+
* The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
|
1836
|
+
*/
|
|
1837
|
+
discounts?: Array<AddItem.Discount>;
|
|
444
1838
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
|
1841
|
+
*/
|
|
1842
|
+
metadata?: Stripe.MetadataParam;
|
|
450
1843
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
*/
|
|
456
|
-
enabled: boolean;
|
|
1844
|
+
/**
|
|
1845
|
+
* The ID of the price object.
|
|
1846
|
+
*/
|
|
1847
|
+
price: string;
|
|
457
1848
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Quantity for this item.
|
|
1851
|
+
*/
|
|
1852
|
+
quantity?: number;
|
|
463
1853
|
|
|
464
|
-
|
|
465
|
-
|
|
1854
|
+
/**
|
|
1855
|
+
* The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
|
|
1856
|
+
*/
|
|
1857
|
+
tax_rates?: Array<string>;
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* Options that configure the trial on the subscription item.
|
|
1861
|
+
*/
|
|
1862
|
+
trial?: AddItem.Trial;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
namespace AddItem {
|
|
1866
|
+
interface Discount {
|
|
1867
|
+
/**
|
|
1868
|
+
* ID of the coupon to create a new discount for.
|
|
1869
|
+
*/
|
|
1870
|
+
coupon?: string;
|
|
1871
|
+
|
|
1872
|
+
/**
|
|
1873
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
1874
|
+
*/
|
|
1875
|
+
discount?: string;
|
|
1876
|
+
|
|
1877
|
+
/**
|
|
1878
|
+
* Details to determine how long the discount should be applied for.
|
|
1879
|
+
*/
|
|
1880
|
+
discount_end?: Discount.DiscountEnd;
|
|
1881
|
+
|
|
1882
|
+
/**
|
|
1883
|
+
* ID of the promotion code to create a new discount for.
|
|
1884
|
+
*/
|
|
1885
|
+
promotion_code?: string;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
namespace Discount {
|
|
1889
|
+
interface DiscountEnd {
|
|
1890
|
+
/**
|
|
1891
|
+
* Time span for the redeemed discount.
|
|
1892
|
+
*/
|
|
1893
|
+
duration?: DiscountEnd.Duration;
|
|
1894
|
+
|
|
1895
|
+
/**
|
|
1896
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1897
|
+
*/
|
|
1898
|
+
timestamp?: number;
|
|
1899
|
+
|
|
1900
|
+
/**
|
|
1901
|
+
* The type of calculation made to determine when the discount ends.
|
|
1902
|
+
*/
|
|
1903
|
+
type: DiscountEnd.Type;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
namespace DiscountEnd {
|
|
1907
|
+
interface Duration {
|
|
1908
|
+
/**
|
|
1909
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1910
|
+
*/
|
|
1911
|
+
interval: Duration.Interval;
|
|
1912
|
+
|
|
1913
|
+
/**
|
|
1914
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1915
|
+
*/
|
|
1916
|
+
interval_count: number;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
namespace Duration {
|
|
1920
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
type Type = 'duration' | 'timestamp';
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
interface Trial {
|
|
1928
|
+
/**
|
|
1929
|
+
* List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
|
1930
|
+
*/
|
|
1931
|
+
converts_to?: Array<string>;
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* Determines the type of trial for this item.
|
|
1935
|
+
*/
|
|
1936
|
+
type: Trial.Type;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
namespace Trial {
|
|
1940
|
+
type Type = 'free' | 'paid';
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
interface RemoveDiscount {
|
|
1945
|
+
/**
|
|
1946
|
+
* The coupon code to remove from the `discounts` array.
|
|
1947
|
+
*/
|
|
1948
|
+
coupon?: string;
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* The ID of a discount to remove from the `discounts` array.
|
|
1952
|
+
*/
|
|
1953
|
+
discount?: string;
|
|
1954
|
+
|
|
1955
|
+
/**
|
|
1956
|
+
* The ID of a promotion code to remove from the `discounts` array.
|
|
1957
|
+
*/
|
|
1958
|
+
promotion_code?: string;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
interface RemoveItem {
|
|
1962
|
+
/**
|
|
1963
|
+
* ID of a price to remove.
|
|
1964
|
+
*/
|
|
1965
|
+
price: string;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
interface SetDiscount {
|
|
1969
|
+
/**
|
|
1970
|
+
* The coupon code to replace the `discounts` array with.
|
|
1971
|
+
*/
|
|
1972
|
+
coupon?: string;
|
|
1973
|
+
|
|
1974
|
+
/**
|
|
1975
|
+
* An ID of an existing discount to replace the `discounts` array with.
|
|
1976
|
+
*/
|
|
1977
|
+
discount?: string;
|
|
1978
|
+
|
|
1979
|
+
/**
|
|
1980
|
+
* An ID of an existing promotion code to replace the `discounts` array with.
|
|
1981
|
+
*/
|
|
1982
|
+
promotion_code?: string;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
interface SetItem {
|
|
1986
|
+
/**
|
|
1987
|
+
* If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
|
|
1988
|
+
*/
|
|
1989
|
+
discounts?: Array<SetItem.Discount>;
|
|
1990
|
+
|
|
1991
|
+
/**
|
|
1992
|
+
* If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
|
|
1993
|
+
*/
|
|
1994
|
+
metadata?: Stripe.MetadataParam;
|
|
1995
|
+
|
|
1996
|
+
/**
|
|
1997
|
+
* The ID of the price object.
|
|
1998
|
+
*/
|
|
1999
|
+
price: string;
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
|
|
2003
|
+
*/
|
|
2004
|
+
quantity?: number;
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
|
|
2008
|
+
*/
|
|
2009
|
+
tax_rates?: Array<string>;
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
|
|
2013
|
+
*/
|
|
2014
|
+
trial?: SetItem.Trial;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
namespace SetItem {
|
|
2018
|
+
interface Discount {
|
|
2019
|
+
/**
|
|
2020
|
+
* ID of the coupon to create a new discount for.
|
|
2021
|
+
*/
|
|
2022
|
+
coupon?: string;
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2026
|
+
*/
|
|
2027
|
+
discount?: string;
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Details to determine how long the discount should be applied for.
|
|
2031
|
+
*/
|
|
2032
|
+
discount_end?: Discount.DiscountEnd;
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* ID of the promotion code to create a new discount for.
|
|
2036
|
+
*/
|
|
2037
|
+
promotion_code?: string;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
namespace Discount {
|
|
2041
|
+
interface DiscountEnd {
|
|
2042
|
+
/**
|
|
2043
|
+
* Time span for the redeemed discount.
|
|
2044
|
+
*/
|
|
2045
|
+
duration?: DiscountEnd.Duration;
|
|
2046
|
+
|
|
2047
|
+
/**
|
|
2048
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2049
|
+
*/
|
|
2050
|
+
timestamp?: number;
|
|
2051
|
+
|
|
2052
|
+
/**
|
|
2053
|
+
* The type of calculation made to determine when the discount ends.
|
|
2054
|
+
*/
|
|
2055
|
+
type: DiscountEnd.Type;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
namespace DiscountEnd {
|
|
2059
|
+
interface Duration {
|
|
2060
|
+
/**
|
|
2061
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2062
|
+
*/
|
|
2063
|
+
interval: Duration.Interval;
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2067
|
+
*/
|
|
2068
|
+
interval_count: number;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
namespace Duration {
|
|
2072
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
type Type = 'duration' | 'timestamp';
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
interface Trial {
|
|
2080
|
+
/**
|
|
2081
|
+
* List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
|
2082
|
+
*/
|
|
2083
|
+
converts_to?: Array<string>;
|
|
2084
|
+
|
|
2085
|
+
/**
|
|
2086
|
+
* Determines the type of trial for this item.
|
|
2087
|
+
*/
|
|
2088
|
+
type: Trial.Type;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
namespace Trial {
|
|
2092
|
+
type Type = 'free' | 'paid';
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
type Type =
|
|
2097
|
+
| 'add_discount'
|
|
2098
|
+
| 'add_item'
|
|
2099
|
+
| 'add_metadata'
|
|
2100
|
+
| 'clear_discounts'
|
|
2101
|
+
| 'clear_metadata'
|
|
2102
|
+
| 'remove_discount'
|
|
2103
|
+
| 'remove_item'
|
|
2104
|
+
| 'remove_metadata'
|
|
2105
|
+
| 'set_discounts'
|
|
2106
|
+
| 'set_items'
|
|
2107
|
+
| 'set_metadata';
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
interface AppliesTo {
|
|
466
2111
|
/**
|
|
467
|
-
*
|
|
2112
|
+
* 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.
|
|
468
2113
|
*/
|
|
469
|
-
|
|
2114
|
+
new_reference?: string;
|
|
470
2115
|
|
|
471
2116
|
/**
|
|
472
|
-
*
|
|
2117
|
+
* The ID of the schedule the line applies to.
|
|
473
2118
|
*/
|
|
474
|
-
|
|
2119
|
+
subscription_schedule?: string;
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* Describes whether the quote line is affecting a new schedule or an existing schedule.
|
|
2123
|
+
*/
|
|
2124
|
+
type: AppliesTo.Type;
|
|
475
2125
|
}
|
|
476
2126
|
|
|
477
|
-
namespace
|
|
478
|
-
type Type = '
|
|
2127
|
+
namespace AppliesTo {
|
|
2128
|
+
type Type = 'new_reference' | 'subscription_schedule';
|
|
479
2129
|
}
|
|
480
|
-
}
|
|
481
2130
|
|
|
482
|
-
|
|
2131
|
+
type BillingCycleAnchor = 'automatic' | 'line_starts_at';
|
|
483
2132
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
2133
|
+
interface CancelSubscriptionSchedule {
|
|
2134
|
+
/**
|
|
2135
|
+
* Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
|
|
2136
|
+
*/
|
|
2137
|
+
cancel_at: 'line_starts_at';
|
|
489
2138
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
2139
|
+
/**
|
|
2140
|
+
* If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
|
|
2141
|
+
*/
|
|
2142
|
+
invoice_now?: boolean;
|
|
494
2143
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
2144
|
+
/**
|
|
2145
|
+
* If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
|
|
2146
|
+
*/
|
|
2147
|
+
prorate?: boolean;
|
|
2148
|
+
}
|
|
500
2149
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
2150
|
+
interface EndsAt {
|
|
2151
|
+
/**
|
|
2152
|
+
* Use the `end` time of a given discount.
|
|
2153
|
+
*/
|
|
2154
|
+
discount_end?: EndsAt.DiscountEnd;
|
|
506
2155
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Time span for the quote line starting from the `starts_at` date.
|
|
2158
|
+
*/
|
|
2159
|
+
duration?: EndsAt.Duration;
|
|
512
2160
|
|
|
513
|
-
namespace InvoiceSettings {
|
|
514
|
-
interface Issuer {
|
|
515
2161
|
/**
|
|
516
|
-
*
|
|
2162
|
+
* A precise Unix timestamp.
|
|
517
2163
|
*/
|
|
518
|
-
|
|
2164
|
+
timestamp?: number;
|
|
519
2165
|
|
|
520
2166
|
/**
|
|
521
|
-
*
|
|
2167
|
+
* Select a way to pass in `ends_at`.
|
|
522
2168
|
*/
|
|
523
|
-
type:
|
|
2169
|
+
type: EndsAt.Type;
|
|
524
2170
|
}
|
|
525
2171
|
|
|
526
|
-
namespace
|
|
527
|
-
|
|
2172
|
+
namespace EndsAt {
|
|
2173
|
+
interface DiscountEnd {
|
|
2174
|
+
/**
|
|
2175
|
+
* The ID of a specific discount.
|
|
2176
|
+
*/
|
|
2177
|
+
discount: string;
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
interface Duration {
|
|
2181
|
+
/**
|
|
2182
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2183
|
+
*/
|
|
2184
|
+
interval: Duration.Interval;
|
|
2185
|
+
|
|
2186
|
+
/**
|
|
2187
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2188
|
+
*/
|
|
2189
|
+
interval_count: number;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
namespace Duration {
|
|
2193
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
type Type =
|
|
2197
|
+
| 'billing_period_end'
|
|
2198
|
+
| 'discount_end'
|
|
2199
|
+
| 'duration'
|
|
2200
|
+
| 'quote_acceptance_date'
|
|
2201
|
+
| 'schedule_end'
|
|
2202
|
+
| 'timestamp'
|
|
2203
|
+
| 'upcoming_invoice';
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
type ProrationBehavior =
|
|
2207
|
+
| 'always_invoice'
|
|
2208
|
+
| 'create_prorations'
|
|
2209
|
+
| 'none';
|
|
2210
|
+
|
|
2211
|
+
interface SetPauseCollection {
|
|
2212
|
+
/**
|
|
2213
|
+
* Details of the pause_collection behavior to apply to the amendment.
|
|
2214
|
+
*/
|
|
2215
|
+
set?: SetPauseCollection.Set;
|
|
2216
|
+
|
|
2217
|
+
/**
|
|
2218
|
+
* Determines the type of the pause_collection amendment.
|
|
2219
|
+
*/
|
|
2220
|
+
type: SetPauseCollection.Type;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
namespace SetPauseCollection {
|
|
2224
|
+
interface Set {
|
|
2225
|
+
/**
|
|
2226
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
2227
|
+
*/
|
|
2228
|
+
behavior: Set.Behavior;
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
namespace Set {
|
|
2232
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
type Type = 'remove' | 'set';
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
type SetScheduleEnd = 'line_ends_at' | 'line_starts_at';
|
|
2239
|
+
|
|
2240
|
+
interface StartsAt {
|
|
2241
|
+
/**
|
|
2242
|
+
* Use the `end` time of a given discount.
|
|
2243
|
+
*/
|
|
2244
|
+
discount_end?: StartsAt.DiscountEnd;
|
|
2245
|
+
|
|
2246
|
+
/**
|
|
2247
|
+
* The timestamp the given line ends at.
|
|
2248
|
+
*/
|
|
2249
|
+
line_ends_at?: StartsAt.LineEndsAt;
|
|
2250
|
+
|
|
2251
|
+
/**
|
|
2252
|
+
* A precise Unix timestamp.
|
|
2253
|
+
*/
|
|
2254
|
+
timestamp?: number;
|
|
2255
|
+
|
|
2256
|
+
/**
|
|
2257
|
+
* Select a way to pass in `starts_at`.
|
|
2258
|
+
*/
|
|
2259
|
+
type: StartsAt.Type;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
namespace StartsAt {
|
|
2263
|
+
interface DiscountEnd {
|
|
2264
|
+
/**
|
|
2265
|
+
* The ID of a specific discount.
|
|
2266
|
+
*/
|
|
2267
|
+
discount: string;
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
interface LineEndsAt {
|
|
2271
|
+
/**
|
|
2272
|
+
* The ID of a quote line.
|
|
2273
|
+
*/
|
|
2274
|
+
id?: string;
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
2278
|
+
*/
|
|
2279
|
+
index?: number;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
type Type =
|
|
2283
|
+
| 'discount_end'
|
|
2284
|
+
| 'line_ends_at'
|
|
2285
|
+
| 'now'
|
|
2286
|
+
| 'quote_acceptance_date'
|
|
2287
|
+
| 'schedule_end'
|
|
2288
|
+
| 'timestamp'
|
|
2289
|
+
| 'upcoming_invoice';
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
interface TrialSettings {
|
|
2293
|
+
/**
|
|
2294
|
+
* Defines how the subscription should behave when a trial ends.
|
|
2295
|
+
*/
|
|
2296
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
namespace TrialSettings {
|
|
2300
|
+
interface EndBehavior {
|
|
2301
|
+
/**
|
|
2302
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
2303
|
+
*/
|
|
2304
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
namespace EndBehavior {
|
|
2308
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
2309
|
+
}
|
|
528
2310
|
}
|
|
529
2311
|
}
|
|
530
2312
|
|
|
@@ -567,15 +2349,59 @@ declare module 'stripe' {
|
|
|
567
2349
|
*/
|
|
568
2350
|
coupon?: string;
|
|
569
2351
|
|
|
570
|
-
/**
|
|
571
|
-
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
572
|
-
*/
|
|
573
|
-
discount?: string;
|
|
2352
|
+
/**
|
|
2353
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2354
|
+
*/
|
|
2355
|
+
discount?: string;
|
|
2356
|
+
|
|
2357
|
+
/**
|
|
2358
|
+
* Details to determine how long the discount should be applied for.
|
|
2359
|
+
*/
|
|
2360
|
+
discount_end?: Discount.DiscountEnd;
|
|
2361
|
+
|
|
2362
|
+
/**
|
|
2363
|
+
* ID of the promotion code to create a new discount for.
|
|
2364
|
+
*/
|
|
2365
|
+
promotion_code?: string;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
namespace Discount {
|
|
2369
|
+
interface DiscountEnd {
|
|
2370
|
+
/**
|
|
2371
|
+
* Time span for the redeemed discount.
|
|
2372
|
+
*/
|
|
2373
|
+
duration?: DiscountEnd.Duration;
|
|
2374
|
+
|
|
2375
|
+
/**
|
|
2376
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2377
|
+
*/
|
|
2378
|
+
timestamp?: number;
|
|
2379
|
+
|
|
2380
|
+
/**
|
|
2381
|
+
* The type of calculation made to determine when the discount ends.
|
|
2382
|
+
*/
|
|
2383
|
+
type: DiscountEnd.Type;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
namespace DiscountEnd {
|
|
2387
|
+
interface Duration {
|
|
2388
|
+
/**
|
|
2389
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2390
|
+
*/
|
|
2391
|
+
interval: Duration.Interval;
|
|
574
2392
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
2393
|
+
/**
|
|
2394
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2395
|
+
*/
|
|
2396
|
+
interval_count: number;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
namespace Duration {
|
|
2400
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
type Type = 'duration' | 'timestamp';
|
|
2404
|
+
}
|
|
579
2405
|
}
|
|
580
2406
|
|
|
581
2407
|
interface PriceData {
|
|
@@ -632,27 +2458,382 @@ declare module 'stripe' {
|
|
|
632
2458
|
}
|
|
633
2459
|
|
|
634
2460
|
interface SubscriptionData {
|
|
2461
|
+
/**
|
|
2462
|
+
* Describes the period to bill for upon accepting the quote.
|
|
2463
|
+
*/
|
|
2464
|
+
bill_on_acceptance?: Stripe.Emptyable<
|
|
2465
|
+
SubscriptionData.BillOnAcceptance
|
|
2466
|
+
>;
|
|
2467
|
+
|
|
2468
|
+
/**
|
|
2469
|
+
* 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.
|
|
2470
|
+
*/
|
|
2471
|
+
billing_behavior?: SubscriptionData.BillingBehavior;
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
|
|
2475
|
+
*/
|
|
2476
|
+
billing_cycle_anchor?: Stripe.Emptyable<'reset'>;
|
|
2477
|
+
|
|
635
2478
|
/**
|
|
636
2479
|
* 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.
|
|
637
2480
|
*/
|
|
638
2481
|
description?: Stripe.Emptyable<string>;
|
|
639
2482
|
|
|
640
2483
|
/**
|
|
641
|
-
* When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
|
|
2484
|
+
* When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
|
|
642
2485
|
*/
|
|
643
2486
|
effective_date?: Stripe.Emptyable<'current_period_end' | number>;
|
|
644
2487
|
|
|
2488
|
+
/**
|
|
2489
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
2490
|
+
*/
|
|
2491
|
+
end_behavior?: SubscriptionData.EndBehavior;
|
|
2492
|
+
|
|
645
2493
|
/**
|
|
646
2494
|
* 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.
|
|
647
2495
|
*/
|
|
648
2496
|
metadata?: Stripe.MetadataParam;
|
|
649
2497
|
|
|
2498
|
+
/**
|
|
2499
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
|
|
2500
|
+
*/
|
|
2501
|
+
prebilling?: Stripe.Emptyable<SubscriptionData.Prebilling>;
|
|
2502
|
+
|
|
2503
|
+
/**
|
|
2504
|
+
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
|
2505
|
+
*
|
|
2506
|
+
* When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
|
2507
|
+
*
|
|
2508
|
+
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
|
2509
|
+
*
|
|
2510
|
+
* Prorations can be disabled by passing `none`.
|
|
2511
|
+
*/
|
|
2512
|
+
proration_behavior?: SubscriptionData.ProrationBehavior;
|
|
2513
|
+
|
|
650
2514
|
/**
|
|
651
2515
|
* Integer representing the number of trial period days before the customer is charged for the first time.
|
|
652
2516
|
*/
|
|
653
2517
|
trial_period_days?: Stripe.Emptyable<number>;
|
|
654
2518
|
}
|
|
655
2519
|
|
|
2520
|
+
namespace SubscriptionData {
|
|
2521
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
2522
|
+
|
|
2523
|
+
interface BillOnAcceptance {
|
|
2524
|
+
/**
|
|
2525
|
+
* The start of the period to bill from when the Quote is accepted.
|
|
2526
|
+
*/
|
|
2527
|
+
bill_from?: BillOnAcceptance.BillFrom;
|
|
2528
|
+
|
|
2529
|
+
/**
|
|
2530
|
+
* The end of the period to bill until when the Quote is accepted.
|
|
2531
|
+
*/
|
|
2532
|
+
bill_until?: BillOnAcceptance.BillUntil;
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
namespace BillOnAcceptance {
|
|
2536
|
+
interface BillFrom {
|
|
2537
|
+
/**
|
|
2538
|
+
* Details of a Quote line to start the bill period from.
|
|
2539
|
+
*/
|
|
2540
|
+
line_starts_at?: BillFrom.LineStartsAt;
|
|
2541
|
+
|
|
2542
|
+
/**
|
|
2543
|
+
* A precise Unix timestamp.
|
|
2544
|
+
*/
|
|
2545
|
+
timestamp?: number;
|
|
2546
|
+
|
|
2547
|
+
/**
|
|
2548
|
+
* The type of method to specify the `bill_from` time.
|
|
2549
|
+
*/
|
|
2550
|
+
type: BillFrom.Type;
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
namespace BillFrom {
|
|
2554
|
+
interface LineStartsAt {
|
|
2555
|
+
/**
|
|
2556
|
+
* The ID of a quote line.
|
|
2557
|
+
*/
|
|
2558
|
+
id?: string;
|
|
2559
|
+
|
|
2560
|
+
/**
|
|
2561
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
2562
|
+
*/
|
|
2563
|
+
index?: number;
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
type Type =
|
|
2567
|
+
| 'line_starts_at'
|
|
2568
|
+
| 'now'
|
|
2569
|
+
| 'pause_collection_start'
|
|
2570
|
+
| 'quote_acceptance_date'
|
|
2571
|
+
| 'timestamp';
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
interface BillUntil {
|
|
2575
|
+
/**
|
|
2576
|
+
* Details of the duration over which to bill.
|
|
2577
|
+
*/
|
|
2578
|
+
duration?: BillUntil.Duration;
|
|
2579
|
+
|
|
2580
|
+
/**
|
|
2581
|
+
* Details of a Quote line item from which to bill until.
|
|
2582
|
+
*/
|
|
2583
|
+
line_ends_at?: BillUntil.LineEndsAt;
|
|
2584
|
+
|
|
2585
|
+
/**
|
|
2586
|
+
* A precise Unix timestamp.
|
|
2587
|
+
*/
|
|
2588
|
+
timestamp?: number;
|
|
2589
|
+
|
|
2590
|
+
/**
|
|
2591
|
+
* The type of method to specify the `bill_until` time.
|
|
2592
|
+
*/
|
|
2593
|
+
type: BillUntil.Type;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
namespace BillUntil {
|
|
2597
|
+
interface Duration {
|
|
2598
|
+
/**
|
|
2599
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2600
|
+
*/
|
|
2601
|
+
interval: Duration.Interval;
|
|
2602
|
+
|
|
2603
|
+
/**
|
|
2604
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2605
|
+
*/
|
|
2606
|
+
interval_count: number;
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
namespace Duration {
|
|
2610
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
interface LineEndsAt {
|
|
2614
|
+
/**
|
|
2615
|
+
* The ID of a quote line.
|
|
2616
|
+
*/
|
|
2617
|
+
id?: string;
|
|
2618
|
+
|
|
2619
|
+
/**
|
|
2620
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
2621
|
+
*/
|
|
2622
|
+
index?: number;
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
type Type =
|
|
2626
|
+
| 'duration'
|
|
2627
|
+
| 'line_ends_at'
|
|
2628
|
+
| 'schedule_end'
|
|
2629
|
+
| 'timestamp'
|
|
2630
|
+
| 'upcoming_invoice';
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
type EndBehavior = 'cancel' | 'release';
|
|
2635
|
+
|
|
2636
|
+
interface Prebilling {
|
|
2637
|
+
/**
|
|
2638
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
2639
|
+
*/
|
|
2640
|
+
iterations: number;
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
type ProrationBehavior =
|
|
2644
|
+
| 'always_invoice'
|
|
2645
|
+
| 'create_prorations'
|
|
2646
|
+
| 'none';
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
interface SubscriptionDataOverride {
|
|
2650
|
+
/**
|
|
2651
|
+
* Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
|
|
2652
|
+
*/
|
|
2653
|
+
applies_to: SubscriptionDataOverride.AppliesTo;
|
|
2654
|
+
|
|
2655
|
+
/**
|
|
2656
|
+
* Describes the period to bill for upon accepting the quote.
|
|
2657
|
+
*/
|
|
2658
|
+
bill_on_acceptance?: Stripe.Emptyable<
|
|
2659
|
+
SubscriptionDataOverride.BillOnAcceptance
|
|
2660
|
+
>;
|
|
2661
|
+
|
|
2662
|
+
/**
|
|
2663
|
+
* 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.
|
|
2664
|
+
*/
|
|
2665
|
+
billing_behavior?: SubscriptionDataOverride.BillingBehavior;
|
|
2666
|
+
|
|
2667
|
+
/**
|
|
2668
|
+
* The customer the Subscription Data override applies to.
|
|
2669
|
+
*/
|
|
2670
|
+
customer?: string;
|
|
2671
|
+
|
|
2672
|
+
/**
|
|
2673
|
+
* 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.
|
|
2674
|
+
*/
|
|
2675
|
+
description?: Stripe.Emptyable<string>;
|
|
2676
|
+
|
|
2677
|
+
/**
|
|
2678
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
2679
|
+
*/
|
|
2680
|
+
end_behavior?: SubscriptionDataOverride.EndBehavior;
|
|
2681
|
+
|
|
2682
|
+
/**
|
|
2683
|
+
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
|
2684
|
+
*
|
|
2685
|
+
* When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
|
2686
|
+
*
|
|
2687
|
+
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
|
2688
|
+
*
|
|
2689
|
+
* Prorations can be disabled by passing `none`.
|
|
2690
|
+
*/
|
|
2691
|
+
proration_behavior?: SubscriptionDataOverride.ProrationBehavior;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
namespace SubscriptionDataOverride {
|
|
2695
|
+
interface AppliesTo {
|
|
2696
|
+
/**
|
|
2697
|
+
* 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.
|
|
2698
|
+
*/
|
|
2699
|
+
new_reference?: string;
|
|
2700
|
+
|
|
2701
|
+
/**
|
|
2702
|
+
* The ID of the schedule the line applies to.
|
|
2703
|
+
*/
|
|
2704
|
+
subscription_schedule?: string;
|
|
2705
|
+
|
|
2706
|
+
/**
|
|
2707
|
+
* Describes whether the quote line is affecting a new schedule or an existing schedule.
|
|
2708
|
+
*/
|
|
2709
|
+
type: AppliesTo.Type;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
namespace AppliesTo {
|
|
2713
|
+
type Type = 'new_reference' | 'subscription_schedule';
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
2717
|
+
|
|
2718
|
+
interface BillOnAcceptance {
|
|
2719
|
+
/**
|
|
2720
|
+
* The start of the period to bill from when the Quote is accepted.
|
|
2721
|
+
*/
|
|
2722
|
+
bill_from?: BillOnAcceptance.BillFrom;
|
|
2723
|
+
|
|
2724
|
+
/**
|
|
2725
|
+
* The end of the period to bill until when the Quote is accepted.
|
|
2726
|
+
*/
|
|
2727
|
+
bill_until?: BillOnAcceptance.BillUntil;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
namespace BillOnAcceptance {
|
|
2731
|
+
interface BillFrom {
|
|
2732
|
+
/**
|
|
2733
|
+
* Details of a Quote line to start the bill period from.
|
|
2734
|
+
*/
|
|
2735
|
+
line_starts_at?: BillFrom.LineStartsAt;
|
|
2736
|
+
|
|
2737
|
+
/**
|
|
2738
|
+
* A precise Unix timestamp.
|
|
2739
|
+
*/
|
|
2740
|
+
timestamp?: number;
|
|
2741
|
+
|
|
2742
|
+
/**
|
|
2743
|
+
* The type of method to specify the `bill_from` time.
|
|
2744
|
+
*/
|
|
2745
|
+
type: BillFrom.Type;
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
namespace BillFrom {
|
|
2749
|
+
interface LineStartsAt {
|
|
2750
|
+
/**
|
|
2751
|
+
* The ID of a quote line.
|
|
2752
|
+
*/
|
|
2753
|
+
id?: string;
|
|
2754
|
+
|
|
2755
|
+
/**
|
|
2756
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
2757
|
+
*/
|
|
2758
|
+
index?: number;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
type Type =
|
|
2762
|
+
| 'line_starts_at'
|
|
2763
|
+
| 'now'
|
|
2764
|
+
| 'pause_collection_start'
|
|
2765
|
+
| 'quote_acceptance_date'
|
|
2766
|
+
| 'timestamp';
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
interface BillUntil {
|
|
2770
|
+
/**
|
|
2771
|
+
* Details of the duration over which to bill.
|
|
2772
|
+
*/
|
|
2773
|
+
duration?: BillUntil.Duration;
|
|
2774
|
+
|
|
2775
|
+
/**
|
|
2776
|
+
* Details of a Quote line item from which to bill until.
|
|
2777
|
+
*/
|
|
2778
|
+
line_ends_at?: BillUntil.LineEndsAt;
|
|
2779
|
+
|
|
2780
|
+
/**
|
|
2781
|
+
* A precise Unix timestamp.
|
|
2782
|
+
*/
|
|
2783
|
+
timestamp?: number;
|
|
2784
|
+
|
|
2785
|
+
/**
|
|
2786
|
+
* The type of method to specify the `bill_until` time.
|
|
2787
|
+
*/
|
|
2788
|
+
type: BillUntil.Type;
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
namespace BillUntil {
|
|
2792
|
+
interface Duration {
|
|
2793
|
+
/**
|
|
2794
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2795
|
+
*/
|
|
2796
|
+
interval: Duration.Interval;
|
|
2797
|
+
|
|
2798
|
+
/**
|
|
2799
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2800
|
+
*/
|
|
2801
|
+
interval_count: number;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
namespace Duration {
|
|
2805
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
interface LineEndsAt {
|
|
2809
|
+
/**
|
|
2810
|
+
* The ID of a quote line.
|
|
2811
|
+
*/
|
|
2812
|
+
id?: string;
|
|
2813
|
+
|
|
2814
|
+
/**
|
|
2815
|
+
* The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
|
2816
|
+
*/
|
|
2817
|
+
index?: number;
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
type Type =
|
|
2821
|
+
| 'duration'
|
|
2822
|
+
| 'line_ends_at'
|
|
2823
|
+
| 'schedule_end'
|
|
2824
|
+
| 'timestamp'
|
|
2825
|
+
| 'upcoming_invoice';
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
type EndBehavior = 'cancel' | 'release';
|
|
2830
|
+
|
|
2831
|
+
type ProrationBehavior =
|
|
2832
|
+
| 'always_invoice'
|
|
2833
|
+
| 'create_prorations'
|
|
2834
|
+
| 'none';
|
|
2835
|
+
}
|
|
2836
|
+
|
|
656
2837
|
interface TransferData {
|
|
657
2838
|
/**
|
|
658
2839
|
* The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
|
|
@@ -677,11 +2858,21 @@ declare module 'stripe' {
|
|
|
677
2858
|
*/
|
|
678
2859
|
customer?: string;
|
|
679
2860
|
|
|
2861
|
+
/**
|
|
2862
|
+
* The ID of the account whose quotes will be retrieved.
|
|
2863
|
+
*/
|
|
2864
|
+
customer_account?: string;
|
|
2865
|
+
|
|
680
2866
|
/**
|
|
681
2867
|
* Specifies which fields in the response should be expanded.
|
|
682
2868
|
*/
|
|
683
2869
|
expand?: Array<string>;
|
|
684
2870
|
|
|
2871
|
+
/**
|
|
2872
|
+
* The subscription which the quote updates.
|
|
2873
|
+
*/
|
|
2874
|
+
from_subscription?: string;
|
|
2875
|
+
|
|
685
2876
|
/**
|
|
686
2877
|
* The status of the quote.
|
|
687
2878
|
*/
|
|
@@ -694,7 +2885,13 @@ declare module 'stripe' {
|
|
|
694
2885
|
}
|
|
695
2886
|
|
|
696
2887
|
namespace QuoteListParams {
|
|
697
|
-
type Status =
|
|
2888
|
+
type Status =
|
|
2889
|
+
| 'accepted'
|
|
2890
|
+
| 'accepting'
|
|
2891
|
+
| 'canceled'
|
|
2892
|
+
| 'draft'
|
|
2893
|
+
| 'open'
|
|
2894
|
+
| 'stale';
|
|
698
2895
|
}
|
|
699
2896
|
|
|
700
2897
|
interface QuoteAcceptParams {
|
|
@@ -723,6 +2920,13 @@ declare module 'stripe' {
|
|
|
723
2920
|
expires_at?: number;
|
|
724
2921
|
}
|
|
725
2922
|
|
|
2923
|
+
interface QuoteListPreviewInvoiceLinesParams extends PaginationParams {
|
|
2924
|
+
/**
|
|
2925
|
+
* Specifies which fields in the response should be expanded.
|
|
2926
|
+
*/
|
|
2927
|
+
expand?: Array<string>;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
726
2930
|
interface QuoteListComputedUpfrontLineItemsParams extends PaginationParams {
|
|
727
2931
|
/**
|
|
728
2932
|
* Specifies which fields in the response should be expanded.
|
|
@@ -737,6 +2941,47 @@ declare module 'stripe' {
|
|
|
737
2941
|
expand?: Array<string>;
|
|
738
2942
|
}
|
|
739
2943
|
|
|
2944
|
+
interface QuoteListLinesParams extends PaginationParams {
|
|
2945
|
+
/**
|
|
2946
|
+
* Specifies which fields in the response should be expanded.
|
|
2947
|
+
*/
|
|
2948
|
+
expand?: Array<string>;
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
interface QuoteListPreviewInvoicesParams extends PaginationParams {
|
|
2952
|
+
/**
|
|
2953
|
+
* Specifies which fields in the response should be expanded.
|
|
2954
|
+
*/
|
|
2955
|
+
expand?: Array<string>;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
interface QuoteListPreviewSubscriptionSchedulesParams
|
|
2959
|
+
extends PaginationParams {
|
|
2960
|
+
/**
|
|
2961
|
+
* Specifies which fields in the response should be expanded.
|
|
2962
|
+
*/
|
|
2963
|
+
expand?: Array<string>;
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
interface QuoteMarkDraftParams {
|
|
2967
|
+
/**
|
|
2968
|
+
* Specifies which fields in the response should be expanded.
|
|
2969
|
+
*/
|
|
2970
|
+
expand?: Array<string>;
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
interface QuoteMarkStaleParams {
|
|
2974
|
+
/**
|
|
2975
|
+
* Specifies which fields in the response should be expanded.
|
|
2976
|
+
*/
|
|
2977
|
+
expand?: Array<string>;
|
|
2978
|
+
|
|
2979
|
+
/**
|
|
2980
|
+
* Reason the Quote is being marked stale.
|
|
2981
|
+
*/
|
|
2982
|
+
reason?: string;
|
|
2983
|
+
}
|
|
2984
|
+
|
|
740
2985
|
interface QuotePdfParams {
|
|
741
2986
|
/**
|
|
742
2987
|
* Specifies which fields in the response should be expanded.
|
|
@@ -744,6 +2989,13 @@ declare module 'stripe' {
|
|
|
744
2989
|
expand?: Array<string>;
|
|
745
2990
|
}
|
|
746
2991
|
|
|
2992
|
+
interface QuoteReestimateParams {
|
|
2993
|
+
/**
|
|
2994
|
+
* Specifies which fields in the response should be expanded.
|
|
2995
|
+
*/
|
|
2996
|
+
expand?: Array<string>;
|
|
2997
|
+
}
|
|
2998
|
+
|
|
747
2999
|
class QuotesResource {
|
|
748
3000
|
/**
|
|
749
3001
|
* A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
|
|
@@ -824,6 +3076,21 @@ declare module 'stripe' {
|
|
|
824
3076
|
options?: RequestOptions
|
|
825
3077
|
): Promise<Stripe.Response<Stripe.Quote>>;
|
|
826
3078
|
|
|
3079
|
+
/**
|
|
3080
|
+
* Preview the invoice line items that would be generated by accepting the quote.
|
|
3081
|
+
*/
|
|
3082
|
+
listPreviewInvoiceLines(
|
|
3083
|
+
quoteId: string,
|
|
3084
|
+
id: string,
|
|
3085
|
+
params?: QuoteListPreviewInvoiceLinesParams,
|
|
3086
|
+
options?: RequestOptions
|
|
3087
|
+
): ApiListPromise<Stripe.InvoiceLineItem>;
|
|
3088
|
+
listPreviewInvoiceLines(
|
|
3089
|
+
quoteId: string,
|
|
3090
|
+
id: string,
|
|
3091
|
+
options?: RequestOptions
|
|
3092
|
+
): ApiListPromise<Stripe.InvoiceLineItem>;
|
|
3093
|
+
|
|
827
3094
|
/**
|
|
828
3095
|
* When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
|
|
829
3096
|
*/
|
|
@@ -850,6 +3117,71 @@ declare module 'stripe' {
|
|
|
850
3117
|
options?: RequestOptions
|
|
851
3118
|
): ApiListPromise<Stripe.LineItem>;
|
|
852
3119
|
|
|
3120
|
+
/**
|
|
3121
|
+
* Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
|
|
3122
|
+
*/
|
|
3123
|
+
listLines(
|
|
3124
|
+
id: string,
|
|
3125
|
+
params?: QuoteListLinesParams,
|
|
3126
|
+
options?: RequestOptions
|
|
3127
|
+
): ApiListPromise<Stripe.QuoteLine>;
|
|
3128
|
+
listLines(
|
|
3129
|
+
id: string,
|
|
3130
|
+
options?: RequestOptions
|
|
3131
|
+
): ApiListPromise<Stripe.QuoteLine>;
|
|
3132
|
+
|
|
3133
|
+
/**
|
|
3134
|
+
* Preview the invoices that would be generated by accepting the quote.
|
|
3135
|
+
*/
|
|
3136
|
+
listPreviewInvoices(
|
|
3137
|
+
id: string,
|
|
3138
|
+
params?: QuoteListPreviewInvoicesParams,
|
|
3139
|
+
options?: RequestOptions
|
|
3140
|
+
): ApiListPromise<Stripe.QuotePreviewInvoice>;
|
|
3141
|
+
listPreviewInvoices(
|
|
3142
|
+
id: string,
|
|
3143
|
+
options?: RequestOptions
|
|
3144
|
+
): ApiListPromise<Stripe.QuotePreviewInvoice>;
|
|
3145
|
+
|
|
3146
|
+
/**
|
|
3147
|
+
* Preview the schedules that would be generated by accepting the quote
|
|
3148
|
+
*/
|
|
3149
|
+
listPreviewSubscriptionSchedules(
|
|
3150
|
+
id: string,
|
|
3151
|
+
params?: QuoteListPreviewSubscriptionSchedulesParams,
|
|
3152
|
+
options?: RequestOptions
|
|
3153
|
+
): ApiListPromise<Stripe.QuotePreviewSubscriptionSchedule>;
|
|
3154
|
+
listPreviewSubscriptionSchedules(
|
|
3155
|
+
id: string,
|
|
3156
|
+
options?: RequestOptions
|
|
3157
|
+
): ApiListPromise<Stripe.QuotePreviewSubscriptionSchedule>;
|
|
3158
|
+
|
|
3159
|
+
/**
|
|
3160
|
+
* Converts a stale quote to draft.
|
|
3161
|
+
*/
|
|
3162
|
+
markDraft(
|
|
3163
|
+
id: string,
|
|
3164
|
+
params?: QuoteMarkDraftParams,
|
|
3165
|
+
options?: RequestOptions
|
|
3166
|
+
): Promise<Stripe.Response<Stripe.Quote>>;
|
|
3167
|
+
markDraft(
|
|
3168
|
+
id: string,
|
|
3169
|
+
options?: RequestOptions
|
|
3170
|
+
): Promise<Stripe.Response<Stripe.Quote>>;
|
|
3171
|
+
|
|
3172
|
+
/**
|
|
3173
|
+
* Converts a draft or open quote to stale.
|
|
3174
|
+
*/
|
|
3175
|
+
markStale(
|
|
3176
|
+
id: string,
|
|
3177
|
+
params?: QuoteMarkStaleParams,
|
|
3178
|
+
options?: RequestOptions
|
|
3179
|
+
): Promise<Stripe.Response<Stripe.Quote>>;
|
|
3180
|
+
markStale(
|
|
3181
|
+
id: string,
|
|
3182
|
+
options?: RequestOptions
|
|
3183
|
+
): Promise<Stripe.Response<Stripe.Quote>>;
|
|
3184
|
+
|
|
853
3185
|
/**
|
|
854
3186
|
* Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
|
855
3187
|
*/
|
|
@@ -859,6 +3191,19 @@ declare module 'stripe' {
|
|
|
859
3191
|
options?: RequestOptions
|
|
860
3192
|
): Promise<StripeStreamResponse>;
|
|
861
3193
|
pdf(id: string, options?: RequestOptions): Promise<StripeStreamResponse>;
|
|
3194
|
+
|
|
3195
|
+
/**
|
|
3196
|
+
* Recompute the upcoming invoice estimate for the quote.
|
|
3197
|
+
*/
|
|
3198
|
+
reestimate(
|
|
3199
|
+
id: string,
|
|
3200
|
+
params?: QuoteReestimateParams,
|
|
3201
|
+
options?: RequestOptions
|
|
3202
|
+
): Promise<Stripe.Response<Stripe.Quote>>;
|
|
3203
|
+
reestimate(
|
|
3204
|
+
id: string,
|
|
3205
|
+
options?: RequestOptions
|
|
3206
|
+
): Promise<Stripe.Response<Stripe.Quote>>;
|
|
862
3207
|
}
|
|
863
3208
|
}
|
|
864
3209
|
}
|