stripe 18.0.0 → 18.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1155 -242
- package/OPENAPI_VERSION +1 -1
- package/README.md +1 -0
- package/VERSION +1 -1
- package/cjs/Error.js +91 -1
- package/cjs/apiVersion.js +1 -1
- 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/GiftCards/Cards.js +23 -0
- package/cjs/resources/GiftCards/Transactions.js +33 -0
- package/cjs/resources/Invoices.js +17 -0
- package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
- package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
- package/cjs/resources/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 +8 -0
- package/cjs/resources/PaymentRecords.js +29 -0
- package/cjs/resources/Quotes.js +32 -0
- package/cjs/resources/SubscriptionSchedules.js +4 -0
- package/cjs/resources/Tax/Associations.js +9 -0
- package/cjs/resources/Tax/Forms.js +20 -0
- package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
- package/cjs/resources/Terminal/Readers.js +12 -0
- package/cjs/resources/TestHelpers/Terminal/Readers.js +8 -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 +17 -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 +12 -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/TestHelpers/FinancialAddresses.js +16 -0
- package/cjs/resources.js +102 -18
- package/cjs/stripe.core.js +1 -1
- package/esm/Error.js +79 -0
- package/esm/apiVersion.js +1 -1
- 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/GiftCards/Cards.js +20 -0
- package/esm/resources/GiftCards/Transactions.js +30 -0
- package/esm/resources/Invoices.js +17 -0
- package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
- package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
- package/esm/resources/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 +8 -0
- package/esm/resources/PaymentRecords.js +26 -0
- package/esm/resources/Quotes.js +32 -0
- package/esm/resources/SubscriptionSchedules.js +4 -0
- package/esm/resources/Tax/Associations.js +6 -0
- package/esm/resources/Tax/Forms.js +17 -0
- package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
- package/esm/resources/Terminal/Readers.js +12 -0
- package/esm/resources/TestHelpers/Terminal/Readers.js +8 -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 +14 -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 +9 -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/TestHelpers/FinancialAddresses.js +13 -0
- package/esm/resources.js +79 -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 +243 -0
- package/types/Accounts.d.ts +212 -1
- package/types/AccountsResource.d.ts +544 -0
- package/types/BalanceSettings.d.ts +85 -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/Billing/MeterErrorReports.d.ts +106 -0
- 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 +1294 -0
- package/types/Checkout/Sessions.d.ts +312 -3
- package/types/Checkout/SessionsResource.d.ts +244 -1
- package/types/ConfirmationTokens.d.ts +151 -0
- package/types/Coupons.d.ts +1 -1
- package/types/CreditNoteLineItems.d.ts +17 -0
- package/types/CreditNotes.d.ts +9 -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/Errors.d.ts +69 -2
- package/types/EventTypes.d.ts +596 -0
- package/types/Events.d.ts +96 -1
- package/types/ExternalAccountsResource.d.ts +219 -0
- package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
- package/types/FinancialConnections/Accounts.d.ts +31 -1
- package/types/FinancialConnections/AccountsResource.d.ts +40 -3
- package/types/FinancialConnections/Institutions.d.ts +93 -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/GiftCards/Cards.d.ts +118 -0
- package/types/GiftCards/CardsResource.d.ts +159 -0
- package/types/GiftCards/Transactions.d.ts +129 -0
- package/types/GiftCards/TransactionsResource.d.ts +201 -0
- package/types/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 +141 -3
- package/types/InvoicesResource.d.ts +1545 -6
- 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 +1189 -0
- package/types/OrdersResource.d.ts +2981 -0
- package/types/PaymentAttemptRecords.d.ts +2112 -0
- package/types/PaymentAttemptRecordsResource.d.ts +47 -0
- package/types/PaymentIntents.d.ts +679 -2
- package/types/PaymentIntentsResource.d.ts +8437 -3941
- 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 +120 -0
- package/types/PaymentMethodsResource.d.ts +167 -2
- package/types/PaymentRecords.d.ts +2105 -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/Products.d.ts +39 -0
- package/types/ProductsResource.d.ts +36 -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 +1685 -0
- package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
- package/types/Quotes.d.ts +601 -1
- package/types/QuotesResource.d.ts +2565 -218
- package/types/Refunds.d.ts +14 -0
- package/types/SetupAttempts.d.ts +50 -1
- package/types/SetupIntents.d.ts +121 -2
- package/types/SetupIntentsResource.d.ts +730 -3
- package/types/Sources.d.ts +29 -0
- package/types/SubscriptionItems.d.ts +23 -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 +94 -1
- package/types/SubscriptionsResource.d.ts +384 -8
- package/types/Tax/Associations.d.ts +126 -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 +300 -0
- package/types/Terminal/ReadersResource.d.ts +220 -0
- package/types/TestHelpers/ConfirmationTokensResource.d.ts +171 -0
- package/types/TestHelpers/Terminal/ReadersResource.d.ts +53 -0
- package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
- package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -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 +101 -0
- package/types/V2/Core/AccountLinksResource.d.ts +90 -0
- package/types/V2/Core/Accounts/PersonsResource.d.ts +3760 -0
- package/types/V2/Core/Accounts.d.ts +8057 -0
- package/types/V2/Core/AccountsResource.d.ts +10184 -0
- package/types/V2/Core/Persons.d.ts +1857 -0
- package/types/V2/Core/Vault/GbBankAccounts.d.ts +155 -0
- package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +172 -0
- package/types/V2/Core/Vault/UsBankAccounts.d.ts +65 -0
- package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +123 -0
- package/types/V2/EventTypes.d.ts +687 -1
- package/types/V2/FinancialAddressCreditSimulations.d.ts +22 -0
- package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +27 -0
- package/types/V2/MoneyManagement/Adjustments.d.ts +105 -0
- package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
- package/types/V2/MoneyManagement/FinancialAccounts.d.ts +540 -0
- package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +52 -0
- package/types/V2/MoneyManagement/FinancialAddresses.d.ts +308 -0
- package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +287 -0
- package/types/V2/MoneyManagement/InboundTransfers.d.ts +201 -0
- package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +144 -0
- package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +141 -0
- package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +93 -0
- package/types/V2/MoneyManagement/OutboundPayments.d.ts +273 -0
- package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +242 -0
- package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +92 -0
- package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +296 -0
- package/types/V2/MoneyManagement/OutboundTransfers.d.ts +246 -0
- package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +207 -0
- package/types/V2/MoneyManagement/PayoutMethods.d.ts +146 -0
- package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
- package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecs.d.ts +82 -0
- package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +113 -0
- package/types/V2/MoneyManagement/ReceivedCredits.d.ts +280 -0
- package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
- package/types/V2/MoneyManagement/ReceivedDebits.d.ts +219 -0
- package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
- package/types/V2/MoneyManagement/TransactionEntries.d.ts +151 -0
- package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
- package/types/V2/MoneyManagement/Transactions.d.ts +166 -0
- package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
- package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +66 -0
- package/types/WebhookEndpointsResource.d.ts +72 -2
- package/types/index.d.ts +135 -5
- package/types/lib.d.ts +11 -1
- package/types/test/typescriptTest.ts +3 -3
- package/types/InvoicePaymentsResource.d.ts +0 -74
|
@@ -3,11 +3,21 @@
|
|
|
3
3
|
declare module 'stripe' {
|
|
4
4
|
namespace Stripe {
|
|
5
5
|
interface SubscriptionScheduleCreateParams {
|
|
6
|
+
/**
|
|
7
|
+
* 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.
|
|
8
|
+
*/
|
|
9
|
+
billing_behavior?: SubscriptionScheduleCreateParams.BillingBehavior;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* The identifier of the customer to create the subscription schedule for.
|
|
8
13
|
*/
|
|
9
14
|
customer?: string;
|
|
10
15
|
|
|
16
|
+
/**
|
|
17
|
+
* The identifier of the account to create the subscription schedule for.
|
|
18
|
+
*/
|
|
19
|
+
customer_account?: string;
|
|
20
|
+
|
|
11
21
|
/**
|
|
12
22
|
* Object representing the subscription schedule's default settings.
|
|
13
23
|
*/
|
|
@@ -38,6 +48,11 @@ declare module 'stripe' {
|
|
|
38
48
|
*/
|
|
39
49
|
phases?: Array<SubscriptionScheduleCreateParams.Phase>;
|
|
40
50
|
|
|
51
|
+
/**
|
|
52
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed now.
|
|
53
|
+
*/
|
|
54
|
+
prebilling?: SubscriptionScheduleCreateParams.Prebilling;
|
|
55
|
+
|
|
41
56
|
/**
|
|
42
57
|
* When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
|
|
43
58
|
*/
|
|
@@ -45,6 +60,8 @@ declare module 'stripe' {
|
|
|
45
60
|
}
|
|
46
61
|
|
|
47
62
|
namespace SubscriptionScheduleCreateParams {
|
|
63
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
64
|
+
|
|
48
65
|
interface DefaultSettings {
|
|
49
66
|
/**
|
|
50
67
|
* 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. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
|
|
@@ -258,6 +275,11 @@ declare module 'stripe' {
|
|
|
258
275
|
*/
|
|
259
276
|
on_behalf_of?: string;
|
|
260
277
|
|
|
278
|
+
/**
|
|
279
|
+
* If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
|
|
280
|
+
*/
|
|
281
|
+
pause_collection?: Phase.PauseCollection;
|
|
282
|
+
|
|
261
283
|
/**
|
|
262
284
|
* Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
|
|
263
285
|
*/
|
|
@@ -273,10 +295,20 @@ declare module 'stripe' {
|
|
|
273
295
|
*/
|
|
274
296
|
trial?: boolean;
|
|
275
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Specify trial behavior when crossing phase boundaries
|
|
300
|
+
*/
|
|
301
|
+
trial_continuation?: Phase.TrialContinuation;
|
|
302
|
+
|
|
276
303
|
/**
|
|
277
304
|
* Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
|
|
278
305
|
*/
|
|
279
306
|
trial_end?: number;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Settings related to subscription trials.
|
|
310
|
+
*/
|
|
311
|
+
trial_settings?: Phase.TrialSettings;
|
|
280
312
|
}
|
|
281
313
|
|
|
282
314
|
namespace Phase {
|
|
@@ -319,12 +351,56 @@ declare module 'stripe' {
|
|
|
319
351
|
*/
|
|
320
352
|
discount?: string;
|
|
321
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Details to determine how long the discount should be applied for.
|
|
356
|
+
*/
|
|
357
|
+
discount_end?: Discount.DiscountEnd;
|
|
358
|
+
|
|
322
359
|
/**
|
|
323
360
|
* ID of the promotion code to create a new discount for.
|
|
324
361
|
*/
|
|
325
362
|
promotion_code?: string;
|
|
326
363
|
}
|
|
327
364
|
|
|
365
|
+
namespace Discount {
|
|
366
|
+
interface DiscountEnd {
|
|
367
|
+
/**
|
|
368
|
+
* Time span for the redeemed discount.
|
|
369
|
+
*/
|
|
370
|
+
duration?: DiscountEnd.Duration;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
374
|
+
*/
|
|
375
|
+
timestamp?: number;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* The type of calculation made to determine when the discount ends.
|
|
379
|
+
*/
|
|
380
|
+
type: DiscountEnd.Type;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
namespace DiscountEnd {
|
|
384
|
+
interface Duration {
|
|
385
|
+
/**
|
|
386
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
387
|
+
*/
|
|
388
|
+
interval: Duration.Interval;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
392
|
+
*/
|
|
393
|
+
interval_count: number;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
namespace Duration {
|
|
397
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
type Type = 'duration' | 'timestamp';
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
328
404
|
interface PriceData {
|
|
329
405
|
/**
|
|
330
406
|
* 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).
|
|
@@ -402,12 +478,56 @@ declare module 'stripe' {
|
|
|
402
478
|
*/
|
|
403
479
|
discount?: string;
|
|
404
480
|
|
|
481
|
+
/**
|
|
482
|
+
* Details to determine how long the discount should be applied for.
|
|
483
|
+
*/
|
|
484
|
+
discount_end?: Discount.DiscountEnd;
|
|
485
|
+
|
|
405
486
|
/**
|
|
406
487
|
* ID of the promotion code to create a new discount for.
|
|
407
488
|
*/
|
|
408
489
|
promotion_code?: string;
|
|
409
490
|
}
|
|
410
491
|
|
|
492
|
+
namespace Discount {
|
|
493
|
+
interface DiscountEnd {
|
|
494
|
+
/**
|
|
495
|
+
* Time span for the redeemed discount.
|
|
496
|
+
*/
|
|
497
|
+
duration?: DiscountEnd.Duration;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
501
|
+
*/
|
|
502
|
+
timestamp?: number;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* The type of calculation made to determine when the discount ends.
|
|
506
|
+
*/
|
|
507
|
+
type: DiscountEnd.Type;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
namespace DiscountEnd {
|
|
511
|
+
interface Duration {
|
|
512
|
+
/**
|
|
513
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
514
|
+
*/
|
|
515
|
+
interval: Duration.Interval;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
519
|
+
*/
|
|
520
|
+
interval_count: number;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
namespace Duration {
|
|
524
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
type Type = 'duration' | 'timestamp';
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
411
531
|
interface InvoiceSettings {
|
|
412
532
|
/**
|
|
413
533
|
* The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
|
|
@@ -478,6 +598,11 @@ declare module 'stripe' {
|
|
|
478
598
|
* A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
|
|
479
599
|
*/
|
|
480
600
|
tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Options that configure the trial on the subscription item.
|
|
604
|
+
*/
|
|
605
|
+
trial?: Item.Trial;
|
|
481
606
|
}
|
|
482
607
|
|
|
483
608
|
namespace Item {
|
|
@@ -492,12 +617,56 @@ declare module 'stripe' {
|
|
|
492
617
|
*/
|
|
493
618
|
discount?: string;
|
|
494
619
|
|
|
620
|
+
/**
|
|
621
|
+
* Details to determine how long the discount should be applied for.
|
|
622
|
+
*/
|
|
623
|
+
discount_end?: Discount.DiscountEnd;
|
|
624
|
+
|
|
495
625
|
/**
|
|
496
626
|
* ID of the promotion code to create a new discount for.
|
|
497
627
|
*/
|
|
498
628
|
promotion_code?: string;
|
|
499
629
|
}
|
|
500
630
|
|
|
631
|
+
namespace Discount {
|
|
632
|
+
interface DiscountEnd {
|
|
633
|
+
/**
|
|
634
|
+
* Time span for the redeemed discount.
|
|
635
|
+
*/
|
|
636
|
+
duration?: DiscountEnd.Duration;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
640
|
+
*/
|
|
641
|
+
timestamp?: number;
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* The type of calculation made to determine when the discount ends.
|
|
645
|
+
*/
|
|
646
|
+
type: DiscountEnd.Type;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
namespace DiscountEnd {
|
|
650
|
+
interface Duration {
|
|
651
|
+
/**
|
|
652
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
653
|
+
*/
|
|
654
|
+
interval: Duration.Interval;
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
658
|
+
*/
|
|
659
|
+
interval_count: number;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
namespace Duration {
|
|
663
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
type Type = 'duration' | 'timestamp';
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
501
670
|
interface PriceData {
|
|
502
671
|
/**
|
|
503
672
|
* 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).
|
|
@@ -549,6 +718,33 @@ declare module 'stripe' {
|
|
|
549
718
|
|
|
550
719
|
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
|
|
551
720
|
}
|
|
721
|
+
|
|
722
|
+
interface Trial {
|
|
723
|
+
/**
|
|
724
|
+
* 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.
|
|
725
|
+
*/
|
|
726
|
+
converts_to?: Array<string>;
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Determines the type of trial for this item.
|
|
730
|
+
*/
|
|
731
|
+
type: Trial.Type;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
namespace Trial {
|
|
735
|
+
type Type = 'free' | 'paid';
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
interface PauseCollection {
|
|
740
|
+
/**
|
|
741
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
742
|
+
*/
|
|
743
|
+
behavior: PauseCollection.Behavior;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
namespace PauseCollection {
|
|
747
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
552
748
|
}
|
|
553
749
|
|
|
554
750
|
type ProrationBehavior =
|
|
@@ -567,6 +763,44 @@ declare module 'stripe' {
|
|
|
567
763
|
*/
|
|
568
764
|
destination: string;
|
|
569
765
|
}
|
|
766
|
+
|
|
767
|
+
type TrialContinuation = 'continue' | 'none';
|
|
768
|
+
|
|
769
|
+
interface TrialSettings {
|
|
770
|
+
/**
|
|
771
|
+
* Defines how the subscription should behave when a trial ends.
|
|
772
|
+
*/
|
|
773
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
namespace TrialSettings {
|
|
777
|
+
interface EndBehavior {
|
|
778
|
+
/**
|
|
779
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
780
|
+
*/
|
|
781
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
namespace EndBehavior {
|
|
785
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
interface Prebilling {
|
|
791
|
+
/**
|
|
792
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
793
|
+
*/
|
|
794
|
+
iterations: number;
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
798
|
+
*/
|
|
799
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
namespace Prebilling {
|
|
803
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
570
804
|
}
|
|
571
805
|
}
|
|
572
806
|
|
|
@@ -578,6 +812,11 @@ declare module 'stripe' {
|
|
|
578
812
|
}
|
|
579
813
|
|
|
580
814
|
interface SubscriptionScheduleUpdateParams {
|
|
815
|
+
/**
|
|
816
|
+
* 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.
|
|
817
|
+
*/
|
|
818
|
+
billing_behavior?: SubscriptionScheduleUpdateParams.BillingBehavior;
|
|
819
|
+
|
|
581
820
|
/**
|
|
582
821
|
* Object representing the subscription schedule's default settings.
|
|
583
822
|
*/
|
|
@@ -603,6 +842,11 @@ declare module 'stripe' {
|
|
|
603
842
|
*/
|
|
604
843
|
phases?: Array<SubscriptionScheduleUpdateParams.Phase>;
|
|
605
844
|
|
|
845
|
+
/**
|
|
846
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed now.
|
|
847
|
+
*/
|
|
848
|
+
prebilling?: SubscriptionScheduleUpdateParams.Prebilling;
|
|
849
|
+
|
|
606
850
|
/**
|
|
607
851
|
* If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
|
|
608
852
|
*/
|
|
@@ -610,6 +854,8 @@ declare module 'stripe' {
|
|
|
610
854
|
}
|
|
611
855
|
|
|
612
856
|
namespace SubscriptionScheduleUpdateParams {
|
|
857
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
858
|
+
|
|
613
859
|
interface DefaultSettings {
|
|
614
860
|
/**
|
|
615
861
|
* 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. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
|
|
@@ -823,6 +1069,11 @@ declare module 'stripe' {
|
|
|
823
1069
|
*/
|
|
824
1070
|
on_behalf_of?: string;
|
|
825
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
|
|
1074
|
+
*/
|
|
1075
|
+
pause_collection?: Phase.PauseCollection;
|
|
1076
|
+
|
|
826
1077
|
/**
|
|
827
1078
|
* Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
|
|
828
1079
|
*/
|
|
@@ -843,10 +1094,20 @@ declare module 'stripe' {
|
|
|
843
1094
|
*/
|
|
844
1095
|
trial?: boolean;
|
|
845
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* Specify trial behavior when crossing phase boundaries
|
|
1099
|
+
*/
|
|
1100
|
+
trial_continuation?: Phase.TrialContinuation;
|
|
1101
|
+
|
|
846
1102
|
/**
|
|
847
1103
|
* Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
|
|
848
1104
|
*/
|
|
849
1105
|
trial_end?: number | 'now';
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Settings related to subscription trials.
|
|
1109
|
+
*/
|
|
1110
|
+
trial_settings?: Phase.TrialSettings;
|
|
850
1111
|
}
|
|
851
1112
|
|
|
852
1113
|
namespace Phase {
|
|
@@ -889,12 +1150,56 @@ declare module 'stripe' {
|
|
|
889
1150
|
*/
|
|
890
1151
|
discount?: string;
|
|
891
1152
|
|
|
1153
|
+
/**
|
|
1154
|
+
* Details to determine how long the discount should be applied for.
|
|
1155
|
+
*/
|
|
1156
|
+
discount_end?: Discount.DiscountEnd;
|
|
1157
|
+
|
|
892
1158
|
/**
|
|
893
1159
|
* ID of the promotion code to create a new discount for.
|
|
894
1160
|
*/
|
|
895
1161
|
promotion_code?: string;
|
|
896
1162
|
}
|
|
897
1163
|
|
|
1164
|
+
namespace Discount {
|
|
1165
|
+
interface DiscountEnd {
|
|
1166
|
+
/**
|
|
1167
|
+
* Time span for the redeemed discount.
|
|
1168
|
+
*/
|
|
1169
|
+
duration?: DiscountEnd.Duration;
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1173
|
+
*/
|
|
1174
|
+
timestamp?: number;
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* The type of calculation made to determine when the discount ends.
|
|
1178
|
+
*/
|
|
1179
|
+
type: DiscountEnd.Type;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
namespace DiscountEnd {
|
|
1183
|
+
interface Duration {
|
|
1184
|
+
/**
|
|
1185
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1186
|
+
*/
|
|
1187
|
+
interval: Duration.Interval;
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1191
|
+
*/
|
|
1192
|
+
interval_count: number;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
namespace Duration {
|
|
1196
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
type Type = 'duration' | 'timestamp';
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
|
|
898
1203
|
interface PriceData {
|
|
899
1204
|
/**
|
|
900
1205
|
* 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).
|
|
@@ -972,12 +1277,56 @@ declare module 'stripe' {
|
|
|
972
1277
|
*/
|
|
973
1278
|
discount?: string;
|
|
974
1279
|
|
|
1280
|
+
/**
|
|
1281
|
+
* Details to determine how long the discount should be applied for.
|
|
1282
|
+
*/
|
|
1283
|
+
discount_end?: Discount.DiscountEnd;
|
|
1284
|
+
|
|
975
1285
|
/**
|
|
976
1286
|
* ID of the promotion code to create a new discount for.
|
|
977
1287
|
*/
|
|
978
1288
|
promotion_code?: string;
|
|
979
1289
|
}
|
|
980
1290
|
|
|
1291
|
+
namespace Discount {
|
|
1292
|
+
interface DiscountEnd {
|
|
1293
|
+
/**
|
|
1294
|
+
* Time span for the redeemed discount.
|
|
1295
|
+
*/
|
|
1296
|
+
duration?: DiscountEnd.Duration;
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1300
|
+
*/
|
|
1301
|
+
timestamp?: number;
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* The type of calculation made to determine when the discount ends.
|
|
1305
|
+
*/
|
|
1306
|
+
type: DiscountEnd.Type;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
namespace DiscountEnd {
|
|
1310
|
+
interface Duration {
|
|
1311
|
+
/**
|
|
1312
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1313
|
+
*/
|
|
1314
|
+
interval: Duration.Interval;
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1318
|
+
*/
|
|
1319
|
+
interval_count: number;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
namespace Duration {
|
|
1323
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
type Type = 'duration' | 'timestamp';
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
|
|
981
1330
|
interface InvoiceSettings {
|
|
982
1331
|
/**
|
|
983
1332
|
* The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
|
|
@@ -1048,6 +1397,11 @@ declare module 'stripe' {
|
|
|
1048
1397
|
* A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
|
|
1049
1398
|
*/
|
|
1050
1399
|
tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
1400
|
+
|
|
1401
|
+
/**
|
|
1402
|
+
* Options that configure the trial on the subscription item.
|
|
1403
|
+
*/
|
|
1404
|
+
trial?: Item.Trial;
|
|
1051
1405
|
}
|
|
1052
1406
|
|
|
1053
1407
|
namespace Item {
|
|
@@ -1062,12 +1416,56 @@ declare module 'stripe' {
|
|
|
1062
1416
|
*/
|
|
1063
1417
|
discount?: string;
|
|
1064
1418
|
|
|
1419
|
+
/**
|
|
1420
|
+
* Details to determine how long the discount should be applied for.
|
|
1421
|
+
*/
|
|
1422
|
+
discount_end?: Discount.DiscountEnd;
|
|
1423
|
+
|
|
1065
1424
|
/**
|
|
1066
1425
|
* ID of the promotion code to create a new discount for.
|
|
1067
1426
|
*/
|
|
1068
1427
|
promotion_code?: string;
|
|
1069
1428
|
}
|
|
1070
1429
|
|
|
1430
|
+
namespace Discount {
|
|
1431
|
+
interface DiscountEnd {
|
|
1432
|
+
/**
|
|
1433
|
+
* Time span for the redeemed discount.
|
|
1434
|
+
*/
|
|
1435
|
+
duration?: DiscountEnd.Duration;
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1439
|
+
*/
|
|
1440
|
+
timestamp?: number;
|
|
1441
|
+
|
|
1442
|
+
/**
|
|
1443
|
+
* The type of calculation made to determine when the discount ends.
|
|
1444
|
+
*/
|
|
1445
|
+
type: DiscountEnd.Type;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
namespace DiscountEnd {
|
|
1449
|
+
interface Duration {
|
|
1450
|
+
/**
|
|
1451
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1452
|
+
*/
|
|
1453
|
+
interval: Duration.Interval;
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1457
|
+
*/
|
|
1458
|
+
interval_count: number;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
namespace Duration {
|
|
1462
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
type Type = 'duration' | 'timestamp';
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1071
1469
|
interface PriceData {
|
|
1072
1470
|
/**
|
|
1073
1471
|
* 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).
|
|
@@ -1119,6 +1517,33 @@ declare module 'stripe' {
|
|
|
1119
1517
|
|
|
1120
1518
|
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
|
|
1121
1519
|
}
|
|
1520
|
+
|
|
1521
|
+
interface Trial {
|
|
1522
|
+
/**
|
|
1523
|
+
* 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.
|
|
1524
|
+
*/
|
|
1525
|
+
converts_to?: Array<string>;
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* Determines the type of trial for this item.
|
|
1529
|
+
*/
|
|
1530
|
+
type: Trial.Type;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
namespace Trial {
|
|
1534
|
+
type Type = 'free' | 'paid';
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
interface PauseCollection {
|
|
1539
|
+
/**
|
|
1540
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
1541
|
+
*/
|
|
1542
|
+
behavior: PauseCollection.Behavior;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
namespace PauseCollection {
|
|
1546
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
1122
1547
|
}
|
|
1123
1548
|
|
|
1124
1549
|
type ProrationBehavior =
|
|
@@ -1137,6 +1562,44 @@ declare module 'stripe' {
|
|
|
1137
1562
|
*/
|
|
1138
1563
|
destination: string;
|
|
1139
1564
|
}
|
|
1565
|
+
|
|
1566
|
+
type TrialContinuation = 'continue' | 'none';
|
|
1567
|
+
|
|
1568
|
+
interface TrialSettings {
|
|
1569
|
+
/**
|
|
1570
|
+
* Defines how the subscription should behave when a trial ends.
|
|
1571
|
+
*/
|
|
1572
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
namespace TrialSettings {
|
|
1576
|
+
interface EndBehavior {
|
|
1577
|
+
/**
|
|
1578
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
1579
|
+
*/
|
|
1580
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
namespace EndBehavior {
|
|
1584
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
interface Prebilling {
|
|
1590
|
+
/**
|
|
1591
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
1592
|
+
*/
|
|
1593
|
+
iterations: number;
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
1597
|
+
*/
|
|
1598
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
namespace Prebilling {
|
|
1602
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
1140
1603
|
}
|
|
1141
1604
|
|
|
1142
1605
|
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
|
|
@@ -1163,6 +1626,11 @@ declare module 'stripe' {
|
|
|
1163
1626
|
*/
|
|
1164
1627
|
customer?: string;
|
|
1165
1628
|
|
|
1629
|
+
/**
|
|
1630
|
+
* Only return subscription schedules for the given account.
|
|
1631
|
+
*/
|
|
1632
|
+
customer_account?: string;
|
|
1633
|
+
|
|
1166
1634
|
/**
|
|
1167
1635
|
* Specifies which fields in the response should be expanded.
|
|
1168
1636
|
*/
|
|
@@ -1179,28 +1647,775 @@ declare module 'stripe' {
|
|
|
1179
1647
|
scheduled?: boolean;
|
|
1180
1648
|
}
|
|
1181
1649
|
|
|
1182
|
-
interface
|
|
1650
|
+
interface SubscriptionScheduleAmendParams {
|
|
1651
|
+
/**
|
|
1652
|
+
* Changes to apply to the phases of the subscription schedule, in the order provided.
|
|
1653
|
+
*/
|
|
1654
|
+
amendments?: Array<SubscriptionScheduleAmendParams.Amendment>;
|
|
1655
|
+
|
|
1183
1656
|
/**
|
|
1184
1657
|
* Specifies which fields in the response should be expanded.
|
|
1185
1658
|
*/
|
|
1186
1659
|
expand?: Array<string>;
|
|
1187
1660
|
|
|
1188
1661
|
/**
|
|
1189
|
-
*
|
|
1662
|
+
* Provide any time periods to bill in advance.
|
|
1190
1663
|
*/
|
|
1191
|
-
|
|
1664
|
+
prebilling?: Stripe.Emptyable<
|
|
1665
|
+
Array<SubscriptionScheduleAmendParams.Prebilling>
|
|
1666
|
+
>;
|
|
1192
1667
|
|
|
1193
1668
|
/**
|
|
1194
|
-
*
|
|
1669
|
+
* In cases where the amendment changes the currently active phase,
|
|
1670
|
+
* specifies if and how to prorate at the time of the request.
|
|
1195
1671
|
*/
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1672
|
+
proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior;
|
|
1198
1673
|
|
|
1199
|
-
interface SubscriptionScheduleReleaseParams {
|
|
1200
1674
|
/**
|
|
1201
|
-
*
|
|
1675
|
+
* Changes to apply to the subscription schedule.
|
|
1202
1676
|
*/
|
|
1203
|
-
|
|
1677
|
+
schedule_settings?: SubscriptionScheduleAmendParams.ScheduleSettings;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
namespace SubscriptionScheduleAmendParams {
|
|
1681
|
+
interface Amendment {
|
|
1682
|
+
/**
|
|
1683
|
+
* Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
|
|
1684
|
+
*/
|
|
1685
|
+
amendment_end?: Amendment.AmendmentEnd;
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Details to identify the earliest timestamp where the proposed change should take effect.
|
|
1689
|
+
*/
|
|
1690
|
+
amendment_start: Amendment.AmendmentStart;
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
|
|
1694
|
+
*/
|
|
1695
|
+
billing_cycle_anchor?: Amendment.BillingCycleAnchor;
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
|
1699
|
+
*/
|
|
1700
|
+
discount_actions?: Array<Amendment.DiscountAction>;
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* Changes to the subscription items during the amendment time span.
|
|
1704
|
+
*/
|
|
1705
|
+
item_actions?: Array<Amendment.ItemAction>;
|
|
1706
|
+
|
|
1707
|
+
/**
|
|
1708
|
+
* Instructions for how to modify phase metadata
|
|
1709
|
+
*/
|
|
1710
|
+
metadata_actions?: Array<Amendment.MetadataAction>;
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
|
|
1714
|
+
*/
|
|
1715
|
+
proration_behavior?: Amendment.ProrationBehavior;
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
|
1719
|
+
*/
|
|
1720
|
+
set_pause_collection?: Amendment.SetPauseCollection;
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
|
1724
|
+
*/
|
|
1725
|
+
set_schedule_end?: Amendment.SetScheduleEnd;
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* Settings related to subscription trials.
|
|
1729
|
+
*/
|
|
1730
|
+
trial_settings?: Amendment.TrialSettings;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
namespace Amendment {
|
|
1734
|
+
interface AmendmentEnd {
|
|
1735
|
+
/**
|
|
1736
|
+
* Use the `end` time of a given discount.
|
|
1737
|
+
*/
|
|
1738
|
+
discount_end?: AmendmentEnd.DiscountEnd;
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* Time span for the amendment starting from the `amendment_start`.
|
|
1742
|
+
*/
|
|
1743
|
+
duration?: AmendmentEnd.Duration;
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
|
1747
|
+
*/
|
|
1748
|
+
timestamp?: number;
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* Select one of three ways to pass the `amendment_end`.
|
|
1752
|
+
*/
|
|
1753
|
+
type: AmendmentEnd.Type;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
namespace AmendmentEnd {
|
|
1757
|
+
interface DiscountEnd {
|
|
1758
|
+
/**
|
|
1759
|
+
* The ID of a specific discount.
|
|
1760
|
+
*/
|
|
1761
|
+
discount: string;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
interface Duration {
|
|
1765
|
+
/**
|
|
1766
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1767
|
+
*/
|
|
1768
|
+
interval: Duration.Interval;
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1772
|
+
*/
|
|
1773
|
+
interval_count: number;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
namespace Duration {
|
|
1777
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
type Type =
|
|
1781
|
+
| 'discount_end'
|
|
1782
|
+
| 'duration'
|
|
1783
|
+
| 'schedule_end'
|
|
1784
|
+
| 'timestamp'
|
|
1785
|
+
| 'trial_end'
|
|
1786
|
+
| 'trial_start'
|
|
1787
|
+
| 'upcoming_invoice';
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
interface AmendmentStart {
|
|
1791
|
+
/**
|
|
1792
|
+
* Details of another amendment in the same array, immediately after which this amendment should begin.
|
|
1793
|
+
*/
|
|
1794
|
+
amendment_end?: AmendmentStart.AmendmentEnd;
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* Use the `end` time of a given discount.
|
|
1798
|
+
*/
|
|
1799
|
+
discount_end?: AmendmentStart.DiscountEnd;
|
|
1800
|
+
|
|
1801
|
+
/**
|
|
1802
|
+
* A precise Unix timestamp for the amendment to start.
|
|
1803
|
+
*/
|
|
1804
|
+
timestamp?: number;
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* Select one of three ways to pass the `amendment_start`.
|
|
1808
|
+
*/
|
|
1809
|
+
type: AmendmentStart.Type;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
namespace AmendmentStart {
|
|
1813
|
+
interface AmendmentEnd {
|
|
1814
|
+
/**
|
|
1815
|
+
* The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
|
|
1816
|
+
*/
|
|
1817
|
+
index: number;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
interface DiscountEnd {
|
|
1821
|
+
/**
|
|
1822
|
+
* The ID of a specific discount.
|
|
1823
|
+
*/
|
|
1824
|
+
discount: string;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
type Type =
|
|
1828
|
+
| 'amendment_end'
|
|
1829
|
+
| 'discount_end'
|
|
1830
|
+
| 'now'
|
|
1831
|
+
| 'schedule_end'
|
|
1832
|
+
| 'timestamp'
|
|
1833
|
+
| 'trial_end'
|
|
1834
|
+
| 'trial_start'
|
|
1835
|
+
| 'upcoming_invoice';
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
type BillingCycleAnchor = 'amendment_start' | 'automatic';
|
|
1839
|
+
|
|
1840
|
+
interface DiscountAction {
|
|
1841
|
+
/**
|
|
1842
|
+
* Details of the discount to add.
|
|
1843
|
+
*/
|
|
1844
|
+
add?: DiscountAction.Add;
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Details of the discount to remove.
|
|
1848
|
+
*/
|
|
1849
|
+
remove?: DiscountAction.Remove;
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Details of the discount to replace the existing discounts with.
|
|
1853
|
+
*/
|
|
1854
|
+
set?: DiscountAction.Set;
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* Determines the type of discount action.
|
|
1858
|
+
*/
|
|
1859
|
+
type: DiscountAction.Type;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
namespace DiscountAction {
|
|
1863
|
+
interface Add {
|
|
1864
|
+
/**
|
|
1865
|
+
* The coupon code to redeem.
|
|
1866
|
+
*/
|
|
1867
|
+
coupon?: string;
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* An ID of an existing discount for a coupon that was already redeemed.
|
|
1871
|
+
*/
|
|
1872
|
+
discount?: string;
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Details to determine how long the discount should be applied for.
|
|
1876
|
+
*/
|
|
1877
|
+
discount_end?: Add.DiscountEnd;
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* 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.
|
|
1881
|
+
*/
|
|
1882
|
+
index?: number;
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* The promotion code to redeem.
|
|
1886
|
+
*/
|
|
1887
|
+
promotion_code?: string;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
namespace Add {
|
|
1891
|
+
interface DiscountEnd {
|
|
1892
|
+
/**
|
|
1893
|
+
* The type of calculation made to determine when the discount ends.
|
|
1894
|
+
*/
|
|
1895
|
+
type: 'amendment_end';
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
interface Remove {
|
|
1900
|
+
/**
|
|
1901
|
+
* The coupon code to remove from the `discounts` array.
|
|
1902
|
+
*/
|
|
1903
|
+
coupon?: string;
|
|
1904
|
+
|
|
1905
|
+
/**
|
|
1906
|
+
* The ID of a discount to remove from the `discounts` array.
|
|
1907
|
+
*/
|
|
1908
|
+
discount?: string;
|
|
1909
|
+
|
|
1910
|
+
/**
|
|
1911
|
+
* The ID of a promotion code to remove from the `discounts` array.
|
|
1912
|
+
*/
|
|
1913
|
+
promotion_code?: string;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
interface Set {
|
|
1917
|
+
/**
|
|
1918
|
+
* The coupon code to replace the `discounts` array with.
|
|
1919
|
+
*/
|
|
1920
|
+
coupon?: string;
|
|
1921
|
+
|
|
1922
|
+
/**
|
|
1923
|
+
* An ID of an existing discount to replace the `discounts` array with.
|
|
1924
|
+
*/
|
|
1925
|
+
discount?: string;
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* An ID of an existing promotion code to replace the `discounts` array with.
|
|
1929
|
+
*/
|
|
1930
|
+
promotion_code?: string;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
type Type = 'add' | 'remove' | 'set';
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
interface ItemAction {
|
|
1937
|
+
/**
|
|
1938
|
+
* Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
|
|
1939
|
+
*/
|
|
1940
|
+
add?: ItemAction.Add;
|
|
1941
|
+
|
|
1942
|
+
/**
|
|
1943
|
+
* Details of the subscription item to remove.
|
|
1944
|
+
*/
|
|
1945
|
+
remove?: ItemAction.Remove;
|
|
1946
|
+
|
|
1947
|
+
/**
|
|
1948
|
+
* Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
|
|
1949
|
+
*/
|
|
1950
|
+
set?: ItemAction.Set;
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* Determines the type of item action.
|
|
1954
|
+
*/
|
|
1955
|
+
type: ItemAction.Type;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
namespace ItemAction {
|
|
1959
|
+
interface Add {
|
|
1960
|
+
/**
|
|
1961
|
+
* The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
|
1962
|
+
*/
|
|
1963
|
+
discounts?: Array<Add.Discount>;
|
|
1964
|
+
|
|
1965
|
+
/**
|
|
1966
|
+
* 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`.
|
|
1967
|
+
*/
|
|
1968
|
+
metadata?: Stripe.MetadataParam;
|
|
1969
|
+
|
|
1970
|
+
/**
|
|
1971
|
+
* The ID of the price object.
|
|
1972
|
+
*/
|
|
1973
|
+
price: string;
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Quantity for this item.
|
|
1977
|
+
*/
|
|
1978
|
+
quantity?: number;
|
|
1979
|
+
|
|
1980
|
+
/**
|
|
1981
|
+
* 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`.
|
|
1982
|
+
*/
|
|
1983
|
+
tax_rates?: Array<string>;
|
|
1984
|
+
|
|
1985
|
+
/**
|
|
1986
|
+
* Options that configure the trial on the subscription item.
|
|
1987
|
+
*/
|
|
1988
|
+
trial?: Add.Trial;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
namespace Add {
|
|
1992
|
+
interface Discount {
|
|
1993
|
+
/**
|
|
1994
|
+
* ID of the coupon to create a new discount for.
|
|
1995
|
+
*/
|
|
1996
|
+
coupon?: string;
|
|
1997
|
+
|
|
1998
|
+
/**
|
|
1999
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2000
|
+
*/
|
|
2001
|
+
discount?: string;
|
|
2002
|
+
|
|
2003
|
+
/**
|
|
2004
|
+
* Details to determine how long the discount should be applied for.
|
|
2005
|
+
*/
|
|
2006
|
+
discount_end?: Discount.DiscountEnd;
|
|
2007
|
+
|
|
2008
|
+
/**
|
|
2009
|
+
* ID of the promotion code to create a new discount for.
|
|
2010
|
+
*/
|
|
2011
|
+
promotion_code?: string;
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
namespace Discount {
|
|
2015
|
+
interface DiscountEnd {
|
|
2016
|
+
/**
|
|
2017
|
+
* Time span for the redeemed discount.
|
|
2018
|
+
*/
|
|
2019
|
+
duration?: DiscountEnd.Duration;
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2023
|
+
*/
|
|
2024
|
+
timestamp?: number;
|
|
2025
|
+
|
|
2026
|
+
/**
|
|
2027
|
+
* The type of calculation made to determine when the discount ends.
|
|
2028
|
+
*/
|
|
2029
|
+
type: DiscountEnd.Type;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
namespace DiscountEnd {
|
|
2033
|
+
interface Duration {
|
|
2034
|
+
/**
|
|
2035
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2036
|
+
*/
|
|
2037
|
+
interval: Duration.Interval;
|
|
2038
|
+
|
|
2039
|
+
/**
|
|
2040
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2041
|
+
*/
|
|
2042
|
+
interval_count: number;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
namespace Duration {
|
|
2046
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
type Type = 'duration' | 'timestamp';
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
interface Trial {
|
|
2054
|
+
/**
|
|
2055
|
+
* 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.
|
|
2056
|
+
*/
|
|
2057
|
+
converts_to?: Array<string>;
|
|
2058
|
+
|
|
2059
|
+
/**
|
|
2060
|
+
* Determines the type of trial for this item.
|
|
2061
|
+
*/
|
|
2062
|
+
type: Trial.Type;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
namespace Trial {
|
|
2066
|
+
type Type = 'free' | 'paid';
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
interface Remove {
|
|
2071
|
+
/**
|
|
2072
|
+
* ID of a price to remove.
|
|
2073
|
+
*/
|
|
2074
|
+
price: string;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
interface Set {
|
|
2078
|
+
/**
|
|
2079
|
+
* 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`.
|
|
2080
|
+
*/
|
|
2081
|
+
discounts?: Array<Set.Discount>;
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
* 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`.
|
|
2085
|
+
*/
|
|
2086
|
+
metadata?: Stripe.MetadataParam;
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* The ID of the price object.
|
|
2090
|
+
*/
|
|
2091
|
+
price: string;
|
|
2092
|
+
|
|
2093
|
+
/**
|
|
2094
|
+
* 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`.
|
|
2095
|
+
*/
|
|
2096
|
+
quantity?: number;
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* 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`.
|
|
2100
|
+
*/
|
|
2101
|
+
tax_rates?: Array<string>;
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* 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`.
|
|
2105
|
+
*/
|
|
2106
|
+
trial?: Set.Trial;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
namespace Set {
|
|
2110
|
+
interface Discount {
|
|
2111
|
+
/**
|
|
2112
|
+
* ID of the coupon to create a new discount for.
|
|
2113
|
+
*/
|
|
2114
|
+
coupon?: string;
|
|
2115
|
+
|
|
2116
|
+
/**
|
|
2117
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2118
|
+
*/
|
|
2119
|
+
discount?: string;
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* Details to determine how long the discount should be applied for.
|
|
2123
|
+
*/
|
|
2124
|
+
discount_end?: Discount.DiscountEnd;
|
|
2125
|
+
|
|
2126
|
+
/**
|
|
2127
|
+
* ID of the promotion code to create a new discount for.
|
|
2128
|
+
*/
|
|
2129
|
+
promotion_code?: string;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
namespace Discount {
|
|
2133
|
+
interface DiscountEnd {
|
|
2134
|
+
/**
|
|
2135
|
+
* Time span for the redeemed discount.
|
|
2136
|
+
*/
|
|
2137
|
+
duration?: DiscountEnd.Duration;
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2141
|
+
*/
|
|
2142
|
+
timestamp?: number;
|
|
2143
|
+
|
|
2144
|
+
/**
|
|
2145
|
+
* The type of calculation made to determine when the discount ends.
|
|
2146
|
+
*/
|
|
2147
|
+
type: DiscountEnd.Type;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
namespace DiscountEnd {
|
|
2151
|
+
interface Duration {
|
|
2152
|
+
/**
|
|
2153
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2154
|
+
*/
|
|
2155
|
+
interval: Duration.Interval;
|
|
2156
|
+
|
|
2157
|
+
/**
|
|
2158
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2159
|
+
*/
|
|
2160
|
+
interval_count: number;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
namespace Duration {
|
|
2164
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
type Type = 'duration' | 'timestamp';
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
interface Trial {
|
|
2172
|
+
/**
|
|
2173
|
+
* 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.
|
|
2174
|
+
*/
|
|
2175
|
+
converts_to?: Array<string>;
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* Determines the type of trial for this item.
|
|
2179
|
+
*/
|
|
2180
|
+
type: Trial.Type;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
namespace Trial {
|
|
2184
|
+
type Type = 'free' | 'paid';
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
type Type = 'add' | 'remove' | 'set';
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
interface MetadataAction {
|
|
2192
|
+
/**
|
|
2193
|
+
* Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
|
2194
|
+
*/
|
|
2195
|
+
add?: {
|
|
2196
|
+
[key: string]: string;
|
|
2197
|
+
};
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* Keys to remove from schedule phase metadata.
|
|
2201
|
+
*/
|
|
2202
|
+
remove?: Array<string>;
|
|
2203
|
+
|
|
2204
|
+
/**
|
|
2205
|
+
* Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
|
2206
|
+
*/
|
|
2207
|
+
set?: Stripe.Emptyable<{
|
|
2208
|
+
[key: string]: string;
|
|
2209
|
+
}>;
|
|
2210
|
+
|
|
2211
|
+
/**
|
|
2212
|
+
* Select one of three ways to update phase-level `metadata` on subscription schedules.
|
|
2213
|
+
*/
|
|
2214
|
+
type: MetadataAction.Type;
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
namespace MetadataAction {
|
|
2218
|
+
type Type = 'add' | 'remove' | 'set';
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
type ProrationBehavior =
|
|
2222
|
+
| 'always_invoice'
|
|
2223
|
+
| 'create_prorations'
|
|
2224
|
+
| 'none';
|
|
2225
|
+
|
|
2226
|
+
interface SetPauseCollection {
|
|
2227
|
+
/**
|
|
2228
|
+
* Details of the pause_collection behavior to apply to the amendment.
|
|
2229
|
+
*/
|
|
2230
|
+
set?: SetPauseCollection.Set;
|
|
2231
|
+
|
|
2232
|
+
/**
|
|
2233
|
+
* Determines the type of the pause_collection amendment.
|
|
2234
|
+
*/
|
|
2235
|
+
type: SetPauseCollection.Type;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
namespace SetPauseCollection {
|
|
2239
|
+
interface Set {
|
|
2240
|
+
/**
|
|
2241
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
2242
|
+
*/
|
|
2243
|
+
behavior: Set.Behavior;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
namespace Set {
|
|
2247
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
type Type = 'remove' | 'set';
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
type SetScheduleEnd = 'amendment_end' | 'amendment_start';
|
|
2254
|
+
|
|
2255
|
+
interface TrialSettings {
|
|
2256
|
+
/**
|
|
2257
|
+
* Defines how the subscription should behave when a trial ends.
|
|
2258
|
+
*/
|
|
2259
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
namespace TrialSettings {
|
|
2263
|
+
interface EndBehavior {
|
|
2264
|
+
/**
|
|
2265
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
2266
|
+
*/
|
|
2267
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
namespace EndBehavior {
|
|
2271
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
interface Prebilling {
|
|
2277
|
+
/**
|
|
2278
|
+
* The beginning of the prebilled time period. The default value is `now`.
|
|
2279
|
+
*/
|
|
2280
|
+
bill_from?: Prebilling.BillFrom;
|
|
2281
|
+
|
|
2282
|
+
/**
|
|
2283
|
+
* The end of the prebilled time period.
|
|
2284
|
+
*/
|
|
2285
|
+
bill_until?: Prebilling.BillUntil;
|
|
2286
|
+
|
|
2287
|
+
/**
|
|
2288
|
+
* When the prebilling invoice should be created. The default value is `now`.
|
|
2289
|
+
*/
|
|
2290
|
+
invoice_at?: 'now';
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
2294
|
+
*/
|
|
2295
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
namespace Prebilling {
|
|
2299
|
+
interface BillFrom {
|
|
2300
|
+
/**
|
|
2301
|
+
* Start the prebilled period when a specified amendment begins.
|
|
2302
|
+
*/
|
|
2303
|
+
amendment_start?: BillFrom.AmendmentStart;
|
|
2304
|
+
|
|
2305
|
+
/**
|
|
2306
|
+
* Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
|
2307
|
+
*/
|
|
2308
|
+
timestamp?: number;
|
|
2309
|
+
|
|
2310
|
+
/**
|
|
2311
|
+
* Select one of several ways to pass the `bill_from` value.
|
|
2312
|
+
*/
|
|
2313
|
+
type: BillFrom.Type;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
namespace BillFrom {
|
|
2317
|
+
interface AmendmentStart {
|
|
2318
|
+
/**
|
|
2319
|
+
* The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments.
|
|
2320
|
+
*/
|
|
2321
|
+
index: number;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
type Type = 'amendment_start' | 'now' | 'timestamp';
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
interface BillUntil {
|
|
2328
|
+
/**
|
|
2329
|
+
* End the prebilled period when a specified amendment ends.
|
|
2330
|
+
*/
|
|
2331
|
+
amendment_end?: BillUntil.AmendmentEnd;
|
|
2332
|
+
|
|
2333
|
+
/**
|
|
2334
|
+
* Time span for prebilling, starting from `bill_from`.
|
|
2335
|
+
*/
|
|
2336
|
+
duration?: BillUntil.Duration;
|
|
2337
|
+
|
|
2338
|
+
/**
|
|
2339
|
+
* End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
|
2340
|
+
*/
|
|
2341
|
+
timestamp?: number;
|
|
2342
|
+
|
|
2343
|
+
/**
|
|
2344
|
+
* Select one of several ways to pass the `bill_until` value.
|
|
2345
|
+
*/
|
|
2346
|
+
type: BillUntil.Type;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
namespace BillUntil {
|
|
2350
|
+
interface AmendmentEnd {
|
|
2351
|
+
/**
|
|
2352
|
+
* The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
|
|
2353
|
+
*/
|
|
2354
|
+
index: number;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
interface Duration {
|
|
2358
|
+
/**
|
|
2359
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2360
|
+
*/
|
|
2361
|
+
interval: Duration.Interval;
|
|
2362
|
+
|
|
2363
|
+
/**
|
|
2364
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2365
|
+
*/
|
|
2366
|
+
interval_count: number;
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
namespace Duration {
|
|
2370
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
type Type =
|
|
2374
|
+
| 'amendment_end'
|
|
2375
|
+
| 'duration'
|
|
2376
|
+
| 'schedule_end'
|
|
2377
|
+
| 'timestamp';
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
|
|
2384
|
+
|
|
2385
|
+
interface ScheduleSettings {
|
|
2386
|
+
/**
|
|
2387
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
2388
|
+
*/
|
|
2389
|
+
end_behavior?: ScheduleSettings.EndBehavior;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
namespace ScheduleSettings {
|
|
2393
|
+
type EndBehavior = 'cancel' | 'release';
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
interface SubscriptionScheduleCancelParams {
|
|
2398
|
+
/**
|
|
2399
|
+
* Specifies which fields in the response should be expanded.
|
|
2400
|
+
*/
|
|
2401
|
+
expand?: Array<string>;
|
|
2402
|
+
|
|
2403
|
+
/**
|
|
2404
|
+
* 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. Defaults to `true`.
|
|
2405
|
+
*/
|
|
2406
|
+
invoice_now?: boolean;
|
|
2407
|
+
|
|
2408
|
+
/**
|
|
2409
|
+
* If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
|
|
2410
|
+
*/
|
|
2411
|
+
prorate?: boolean;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
interface SubscriptionScheduleReleaseParams {
|
|
2415
|
+
/**
|
|
2416
|
+
* Specifies which fields in the response should be expanded.
|
|
2417
|
+
*/
|
|
2418
|
+
expand?: Array<string>;
|
|
1204
2419
|
|
|
1205
2420
|
/**
|
|
1206
2421
|
* Keep any cancellation on the subscription that the schedule has set
|
|
@@ -1253,6 +2468,19 @@ declare module 'stripe' {
|
|
|
1253
2468
|
options?: RequestOptions
|
|
1254
2469
|
): ApiListPromise<Stripe.SubscriptionSchedule>;
|
|
1255
2470
|
|
|
2471
|
+
/**
|
|
2472
|
+
* Amends an existing subscription schedule.
|
|
2473
|
+
*/
|
|
2474
|
+
amend(
|
|
2475
|
+
id: string,
|
|
2476
|
+
params?: SubscriptionScheduleAmendParams,
|
|
2477
|
+
options?: RequestOptions
|
|
2478
|
+
): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
|
|
2479
|
+
amend(
|
|
2480
|
+
id: string,
|
|
2481
|
+
options?: RequestOptions
|
|
2482
|
+
): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
|
|
2483
|
+
|
|
1256
2484
|
/**
|
|
1257
2485
|
* Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
|
|
1258
2486
|
*/
|