stripe 18.1.0 → 18.2.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 +1220 -140
- 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/FxQuotes.js +15 -0
- package/cjs/resources/GiftCards/Cards.js +23 -0
- package/cjs/resources/GiftCards/Transactions.js +33 -0
- package/cjs/resources/Invoices.js +4 -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/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 +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/TestHelpers/FinancialAddresses.js +16 -0
- package/cjs/resources.js +108 -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/FxQuotes.js +12 -0
- package/esm/resources/GiftCards/Cards.js +20 -0
- package/esm/resources/GiftCards/Transactions.js +30 -0
- package/esm/resources/Invoices.js +4 -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/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 +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/TestHelpers/FinancialAddresses.js +13 -0
- package/esm/resources.js +84 -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 +300 -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/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 +1314 -0
- package/types/Checkout/Sessions.d.ts +315 -2
- package/types/Checkout/SessionsResource.d.ts +340 -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 +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 +698 -0
- package/types/Events.d.ts +99 -0
- package/types/ExternalAccountsResource.d.ts +304 -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/FxQuotes.d.ts +153 -0
- package/types/FxQuotesResource.d.ts +130 -0
- package/types/GiftCards/Cards.d.ts +118 -0
- package/types/GiftCards/CardsResource.d.ts +159 -0
- package/types/GiftCards/Transactions.d.ts +129 -0
- package/types/GiftCards/TransactionsResource.d.ts +201 -0
- package/types/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 +136 -3
- package/types/InvoicesResource.d.ts +1483 -3
- 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 +1199 -0
- package/types/OrdersResource.d.ts +3001 -0
- package/types/PaymentAttemptRecords.d.ts +2112 -0
- package/types/PaymentAttemptRecordsResource.d.ts +47 -0
- package/types/PaymentIntentAmountDetailsLineItems.d.ts +110 -0
- package/types/PaymentIntents.d.ts +728 -2
- package/types/PaymentIntentsResource.d.ts +8618 -4094
- 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 +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/Privacy/RedactionJobValidationErrors.d.ts +30 -0
- package/types/Privacy/RedactionJobs.d.ts +65 -0
- package/types/Privacy/RedactionJobsResource.d.ts +218 -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 +1697 -0
- package/types/QuotePreviewSubscriptionSchedules.d.ts +785 -0
- package/types/Quotes.d.ts +603 -1
- package/types/QuotesResource.d.ts +2572 -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 +212 -0
- package/types/SubscriptionSchedulesResource.d.ts +1240 -5
- package/types/Subscriptions.d.ts +104 -1
- package/types/SubscriptionsResource.d.ts +397 -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 +126 -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/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 +3770 -0
- package/types/V2/Core/Accounts.d.ts +8169 -0
- package/types/V2/Core/AccountsResource.d.ts +10203 -0
- package/types/V2/Core/Persons.d.ts +1867 -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 +812 -1
- 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 +546 -0
- package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +52 -0
- package/types/V2/MoneyManagement/FinancialAddresses.d.ts +314 -0
- package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +288 -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 +207 -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 +285 -0
- package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
- package/types/V2/MoneyManagement/ReceivedDebits.d.ts +224 -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/TestHelpers/FinancialAddressesResource.d.ts +66 -0
- package/types/WebhookEndpointsResource.d.ts +82 -0
- package/types/index.d.ts +145 -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,26 @@
|
|
|
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
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
|
|
13
|
+
*/
|
|
14
|
+
billing_mode?: SubscriptionScheduleCreateParams.BillingMode;
|
|
15
|
+
|
|
6
16
|
/**
|
|
7
17
|
* The identifier of the customer to create the subscription schedule for.
|
|
8
18
|
*/
|
|
9
19
|
customer?: string;
|
|
10
20
|
|
|
21
|
+
/**
|
|
22
|
+
* The identifier of the account to create the subscription schedule for.
|
|
23
|
+
*/
|
|
24
|
+
customer_account?: string;
|
|
25
|
+
|
|
11
26
|
/**
|
|
12
27
|
* Object representing the subscription schedule's default settings.
|
|
13
28
|
*/
|
|
@@ -38,6 +53,11 @@ declare module 'stripe' {
|
|
|
38
53
|
*/
|
|
39
54
|
phases?: Array<SubscriptionScheduleCreateParams.Phase>;
|
|
40
55
|
|
|
56
|
+
/**
|
|
57
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed now.
|
|
58
|
+
*/
|
|
59
|
+
prebilling?: SubscriptionScheduleCreateParams.Prebilling;
|
|
60
|
+
|
|
41
61
|
/**
|
|
42
62
|
* 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
63
|
*/
|
|
@@ -45,6 +65,10 @@ declare module 'stripe' {
|
|
|
45
65
|
}
|
|
46
66
|
|
|
47
67
|
namespace SubscriptionScheduleCreateParams {
|
|
68
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
69
|
+
|
|
70
|
+
type BillingMode = 'classic' | 'flexible';
|
|
71
|
+
|
|
48
72
|
interface DefaultSettings {
|
|
49
73
|
/**
|
|
50
74
|
* 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 +282,11 @@ declare module 'stripe' {
|
|
|
258
282
|
*/
|
|
259
283
|
on_behalf_of?: string;
|
|
260
284
|
|
|
285
|
+
/**
|
|
286
|
+
* 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).
|
|
287
|
+
*/
|
|
288
|
+
pause_collection?: Phase.PauseCollection;
|
|
289
|
+
|
|
261
290
|
/**
|
|
262
291
|
* 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
292
|
*/
|
|
@@ -273,10 +302,20 @@ declare module 'stripe' {
|
|
|
273
302
|
*/
|
|
274
303
|
trial?: boolean;
|
|
275
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Specify trial behavior when crossing phase boundaries
|
|
307
|
+
*/
|
|
308
|
+
trial_continuation?: Phase.TrialContinuation;
|
|
309
|
+
|
|
276
310
|
/**
|
|
277
311
|
* 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
312
|
*/
|
|
279
313
|
trial_end?: number;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Settings related to subscription trials.
|
|
317
|
+
*/
|
|
318
|
+
trial_settings?: Phase.TrialSettings;
|
|
280
319
|
}
|
|
281
320
|
|
|
282
321
|
namespace Phase {
|
|
@@ -319,12 +358,56 @@ declare module 'stripe' {
|
|
|
319
358
|
*/
|
|
320
359
|
discount?: string;
|
|
321
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Details to determine how long the discount should be applied for.
|
|
363
|
+
*/
|
|
364
|
+
discount_end?: Discount.DiscountEnd;
|
|
365
|
+
|
|
322
366
|
/**
|
|
323
367
|
* ID of the promotion code to create a new discount for.
|
|
324
368
|
*/
|
|
325
369
|
promotion_code?: string;
|
|
326
370
|
}
|
|
327
371
|
|
|
372
|
+
namespace Discount {
|
|
373
|
+
interface DiscountEnd {
|
|
374
|
+
/**
|
|
375
|
+
* Time span for the redeemed discount.
|
|
376
|
+
*/
|
|
377
|
+
duration?: DiscountEnd.Duration;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
381
|
+
*/
|
|
382
|
+
timestamp?: number;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* The type of calculation made to determine when the discount ends.
|
|
386
|
+
*/
|
|
387
|
+
type: DiscountEnd.Type;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
namespace DiscountEnd {
|
|
391
|
+
interface Duration {
|
|
392
|
+
/**
|
|
393
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
394
|
+
*/
|
|
395
|
+
interval: Duration.Interval;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
399
|
+
*/
|
|
400
|
+
interval_count: number;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
namespace Duration {
|
|
404
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
type Type = 'duration' | 'timestamp';
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
328
411
|
interface PriceData {
|
|
329
412
|
/**
|
|
330
413
|
* 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 +485,56 @@ declare module 'stripe' {
|
|
|
402
485
|
*/
|
|
403
486
|
discount?: string;
|
|
404
487
|
|
|
488
|
+
/**
|
|
489
|
+
* Details to determine how long the discount should be applied for.
|
|
490
|
+
*/
|
|
491
|
+
discount_end?: Discount.DiscountEnd;
|
|
492
|
+
|
|
405
493
|
/**
|
|
406
494
|
* ID of the promotion code to create a new discount for.
|
|
407
495
|
*/
|
|
408
496
|
promotion_code?: string;
|
|
409
497
|
}
|
|
410
498
|
|
|
499
|
+
namespace Discount {
|
|
500
|
+
interface DiscountEnd {
|
|
501
|
+
/**
|
|
502
|
+
* Time span for the redeemed discount.
|
|
503
|
+
*/
|
|
504
|
+
duration?: DiscountEnd.Duration;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
508
|
+
*/
|
|
509
|
+
timestamp?: number;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* The type of calculation made to determine when the discount ends.
|
|
513
|
+
*/
|
|
514
|
+
type: DiscountEnd.Type;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
namespace DiscountEnd {
|
|
518
|
+
interface Duration {
|
|
519
|
+
/**
|
|
520
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
521
|
+
*/
|
|
522
|
+
interval: Duration.Interval;
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
526
|
+
*/
|
|
527
|
+
interval_count: number;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
namespace Duration {
|
|
531
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
type Type = 'duration' | 'timestamp';
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
411
538
|
interface InvoiceSettings {
|
|
412
539
|
/**
|
|
413
540
|
* 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 +605,11 @@ declare module 'stripe' {
|
|
|
478
605
|
* 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
606
|
*/
|
|
480
607
|
tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Options that configure the trial on the subscription item.
|
|
611
|
+
*/
|
|
612
|
+
trial?: Item.Trial;
|
|
481
613
|
}
|
|
482
614
|
|
|
483
615
|
namespace Item {
|
|
@@ -492,12 +624,56 @@ declare module 'stripe' {
|
|
|
492
624
|
*/
|
|
493
625
|
discount?: string;
|
|
494
626
|
|
|
627
|
+
/**
|
|
628
|
+
* Details to determine how long the discount should be applied for.
|
|
629
|
+
*/
|
|
630
|
+
discount_end?: Discount.DiscountEnd;
|
|
631
|
+
|
|
495
632
|
/**
|
|
496
633
|
* ID of the promotion code to create a new discount for.
|
|
497
634
|
*/
|
|
498
635
|
promotion_code?: string;
|
|
499
636
|
}
|
|
500
637
|
|
|
638
|
+
namespace Discount {
|
|
639
|
+
interface DiscountEnd {
|
|
640
|
+
/**
|
|
641
|
+
* Time span for the redeemed discount.
|
|
642
|
+
*/
|
|
643
|
+
duration?: DiscountEnd.Duration;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
647
|
+
*/
|
|
648
|
+
timestamp?: number;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* The type of calculation made to determine when the discount ends.
|
|
652
|
+
*/
|
|
653
|
+
type: DiscountEnd.Type;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
namespace DiscountEnd {
|
|
657
|
+
interface Duration {
|
|
658
|
+
/**
|
|
659
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
660
|
+
*/
|
|
661
|
+
interval: Duration.Interval;
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
665
|
+
*/
|
|
666
|
+
interval_count: number;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
namespace Duration {
|
|
670
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
type Type = 'duration' | 'timestamp';
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
501
677
|
interface PriceData {
|
|
502
678
|
/**
|
|
503
679
|
* 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 +725,33 @@ declare module 'stripe' {
|
|
|
549
725
|
|
|
550
726
|
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
|
|
551
727
|
}
|
|
728
|
+
|
|
729
|
+
interface Trial {
|
|
730
|
+
/**
|
|
731
|
+
* 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.
|
|
732
|
+
*/
|
|
733
|
+
converts_to?: Array<string>;
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Determines the type of trial for this item.
|
|
737
|
+
*/
|
|
738
|
+
type: Trial.Type;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
namespace Trial {
|
|
742
|
+
type Type = 'free' | 'paid';
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
interface PauseCollection {
|
|
747
|
+
/**
|
|
748
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
749
|
+
*/
|
|
750
|
+
behavior: PauseCollection.Behavior;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
namespace PauseCollection {
|
|
754
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
552
755
|
}
|
|
553
756
|
|
|
554
757
|
type ProrationBehavior =
|
|
@@ -567,6 +770,44 @@ declare module 'stripe' {
|
|
|
567
770
|
*/
|
|
568
771
|
destination: string;
|
|
569
772
|
}
|
|
773
|
+
|
|
774
|
+
type TrialContinuation = 'continue' | 'none';
|
|
775
|
+
|
|
776
|
+
interface TrialSettings {
|
|
777
|
+
/**
|
|
778
|
+
* Defines how the subscription should behave when a trial ends.
|
|
779
|
+
*/
|
|
780
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
namespace TrialSettings {
|
|
784
|
+
interface EndBehavior {
|
|
785
|
+
/**
|
|
786
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
787
|
+
*/
|
|
788
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
namespace EndBehavior {
|
|
792
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
interface Prebilling {
|
|
798
|
+
/**
|
|
799
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
800
|
+
*/
|
|
801
|
+
iterations: number;
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
805
|
+
*/
|
|
806
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
namespace Prebilling {
|
|
810
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
570
811
|
}
|
|
571
812
|
}
|
|
572
813
|
|
|
@@ -578,6 +819,11 @@ declare module 'stripe' {
|
|
|
578
819
|
}
|
|
579
820
|
|
|
580
821
|
interface SubscriptionScheduleUpdateParams {
|
|
822
|
+
/**
|
|
823
|
+
* 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.
|
|
824
|
+
*/
|
|
825
|
+
billing_behavior?: SubscriptionScheduleUpdateParams.BillingBehavior;
|
|
826
|
+
|
|
581
827
|
/**
|
|
582
828
|
* Object representing the subscription schedule's default settings.
|
|
583
829
|
*/
|
|
@@ -603,6 +849,11 @@ declare module 'stripe' {
|
|
|
603
849
|
*/
|
|
604
850
|
phases?: Array<SubscriptionScheduleUpdateParams.Phase>;
|
|
605
851
|
|
|
852
|
+
/**
|
|
853
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed now.
|
|
854
|
+
*/
|
|
855
|
+
prebilling?: SubscriptionScheduleUpdateParams.Prebilling;
|
|
856
|
+
|
|
606
857
|
/**
|
|
607
858
|
* If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
|
|
608
859
|
*/
|
|
@@ -610,6 +861,8 @@ declare module 'stripe' {
|
|
|
610
861
|
}
|
|
611
862
|
|
|
612
863
|
namespace SubscriptionScheduleUpdateParams {
|
|
864
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
865
|
+
|
|
613
866
|
interface DefaultSettings {
|
|
614
867
|
/**
|
|
615
868
|
* 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 +1076,11 @@ declare module 'stripe' {
|
|
|
823
1076
|
*/
|
|
824
1077
|
on_behalf_of?: string;
|
|
825
1078
|
|
|
1079
|
+
/**
|
|
1080
|
+
* 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).
|
|
1081
|
+
*/
|
|
1082
|
+
pause_collection?: Phase.PauseCollection;
|
|
1083
|
+
|
|
826
1084
|
/**
|
|
827
1085
|
* 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
1086
|
*/
|
|
@@ -843,10 +1101,20 @@ declare module 'stripe' {
|
|
|
843
1101
|
*/
|
|
844
1102
|
trial?: boolean;
|
|
845
1103
|
|
|
1104
|
+
/**
|
|
1105
|
+
* Specify trial behavior when crossing phase boundaries
|
|
1106
|
+
*/
|
|
1107
|
+
trial_continuation?: Phase.TrialContinuation;
|
|
1108
|
+
|
|
846
1109
|
/**
|
|
847
1110
|
* 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
1111
|
*/
|
|
849
1112
|
trial_end?: number | 'now';
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Settings related to subscription trials.
|
|
1116
|
+
*/
|
|
1117
|
+
trial_settings?: Phase.TrialSettings;
|
|
850
1118
|
}
|
|
851
1119
|
|
|
852
1120
|
namespace Phase {
|
|
@@ -889,12 +1157,56 @@ declare module 'stripe' {
|
|
|
889
1157
|
*/
|
|
890
1158
|
discount?: string;
|
|
891
1159
|
|
|
1160
|
+
/**
|
|
1161
|
+
* Details to determine how long the discount should be applied for.
|
|
1162
|
+
*/
|
|
1163
|
+
discount_end?: Discount.DiscountEnd;
|
|
1164
|
+
|
|
892
1165
|
/**
|
|
893
1166
|
* ID of the promotion code to create a new discount for.
|
|
894
1167
|
*/
|
|
895
1168
|
promotion_code?: string;
|
|
896
1169
|
}
|
|
897
1170
|
|
|
1171
|
+
namespace Discount {
|
|
1172
|
+
interface DiscountEnd {
|
|
1173
|
+
/**
|
|
1174
|
+
* Time span for the redeemed discount.
|
|
1175
|
+
*/
|
|
1176
|
+
duration?: DiscountEnd.Duration;
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1180
|
+
*/
|
|
1181
|
+
timestamp?: number;
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* The type of calculation made to determine when the discount ends.
|
|
1185
|
+
*/
|
|
1186
|
+
type: DiscountEnd.Type;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
namespace DiscountEnd {
|
|
1190
|
+
interface Duration {
|
|
1191
|
+
/**
|
|
1192
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1193
|
+
*/
|
|
1194
|
+
interval: Duration.Interval;
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1198
|
+
*/
|
|
1199
|
+
interval_count: number;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
namespace Duration {
|
|
1203
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
type Type = 'duration' | 'timestamp';
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
898
1210
|
interface PriceData {
|
|
899
1211
|
/**
|
|
900
1212
|
* 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 +1284,56 @@ declare module 'stripe' {
|
|
|
972
1284
|
*/
|
|
973
1285
|
discount?: string;
|
|
974
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* Details to determine how long the discount should be applied for.
|
|
1289
|
+
*/
|
|
1290
|
+
discount_end?: Discount.DiscountEnd;
|
|
1291
|
+
|
|
975
1292
|
/**
|
|
976
1293
|
* ID of the promotion code to create a new discount for.
|
|
977
1294
|
*/
|
|
978
1295
|
promotion_code?: string;
|
|
979
1296
|
}
|
|
980
1297
|
|
|
1298
|
+
namespace Discount {
|
|
1299
|
+
interface DiscountEnd {
|
|
1300
|
+
/**
|
|
1301
|
+
* Time span for the redeemed discount.
|
|
1302
|
+
*/
|
|
1303
|
+
duration?: DiscountEnd.Duration;
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1307
|
+
*/
|
|
1308
|
+
timestamp?: number;
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* The type of calculation made to determine when the discount ends.
|
|
1312
|
+
*/
|
|
1313
|
+
type: DiscountEnd.Type;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
namespace DiscountEnd {
|
|
1317
|
+
interface Duration {
|
|
1318
|
+
/**
|
|
1319
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1320
|
+
*/
|
|
1321
|
+
interval: Duration.Interval;
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1325
|
+
*/
|
|
1326
|
+
interval_count: number;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
namespace Duration {
|
|
1330
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
type Type = 'duration' | 'timestamp';
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
981
1337
|
interface InvoiceSettings {
|
|
982
1338
|
/**
|
|
983
1339
|
* 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 +1404,11 @@ declare module 'stripe' {
|
|
|
1048
1404
|
* 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
1405
|
*/
|
|
1050
1406
|
tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Options that configure the trial on the subscription item.
|
|
1410
|
+
*/
|
|
1411
|
+
trial?: Item.Trial;
|
|
1051
1412
|
}
|
|
1052
1413
|
|
|
1053
1414
|
namespace Item {
|
|
@@ -1062,12 +1423,56 @@ declare module 'stripe' {
|
|
|
1062
1423
|
*/
|
|
1063
1424
|
discount?: string;
|
|
1064
1425
|
|
|
1426
|
+
/**
|
|
1427
|
+
* Details to determine how long the discount should be applied for.
|
|
1428
|
+
*/
|
|
1429
|
+
discount_end?: Discount.DiscountEnd;
|
|
1430
|
+
|
|
1065
1431
|
/**
|
|
1066
1432
|
* ID of the promotion code to create a new discount for.
|
|
1067
1433
|
*/
|
|
1068
1434
|
promotion_code?: string;
|
|
1069
1435
|
}
|
|
1070
1436
|
|
|
1437
|
+
namespace Discount {
|
|
1438
|
+
interface DiscountEnd {
|
|
1439
|
+
/**
|
|
1440
|
+
* Time span for the redeemed discount.
|
|
1441
|
+
*/
|
|
1442
|
+
duration?: DiscountEnd.Duration;
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1446
|
+
*/
|
|
1447
|
+
timestamp?: number;
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* The type of calculation made to determine when the discount ends.
|
|
1451
|
+
*/
|
|
1452
|
+
type: DiscountEnd.Type;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
namespace DiscountEnd {
|
|
1456
|
+
interface Duration {
|
|
1457
|
+
/**
|
|
1458
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1459
|
+
*/
|
|
1460
|
+
interval: Duration.Interval;
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1464
|
+
*/
|
|
1465
|
+
interval_count: number;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
namespace Duration {
|
|
1469
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
type Type = 'duration' | 'timestamp';
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1071
1476
|
interface PriceData {
|
|
1072
1477
|
/**
|
|
1073
1478
|
* 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 +1524,33 @@ declare module 'stripe' {
|
|
|
1119
1524
|
|
|
1120
1525
|
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
|
|
1121
1526
|
}
|
|
1527
|
+
|
|
1528
|
+
interface Trial {
|
|
1529
|
+
/**
|
|
1530
|
+
* 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.
|
|
1531
|
+
*/
|
|
1532
|
+
converts_to?: Array<string>;
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Determines the type of trial for this item.
|
|
1536
|
+
*/
|
|
1537
|
+
type: Trial.Type;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
namespace Trial {
|
|
1541
|
+
type Type = 'free' | 'paid';
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
interface PauseCollection {
|
|
1546
|
+
/**
|
|
1547
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
1548
|
+
*/
|
|
1549
|
+
behavior: PauseCollection.Behavior;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
namespace PauseCollection {
|
|
1553
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
1122
1554
|
}
|
|
1123
1555
|
|
|
1124
1556
|
type ProrationBehavior =
|
|
@@ -1137,6 +1569,44 @@ declare module 'stripe' {
|
|
|
1137
1569
|
*/
|
|
1138
1570
|
destination: string;
|
|
1139
1571
|
}
|
|
1572
|
+
|
|
1573
|
+
type TrialContinuation = 'continue' | 'none';
|
|
1574
|
+
|
|
1575
|
+
interface TrialSettings {
|
|
1576
|
+
/**
|
|
1577
|
+
* Defines how the subscription should behave when a trial ends.
|
|
1578
|
+
*/
|
|
1579
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
namespace TrialSettings {
|
|
1583
|
+
interface EndBehavior {
|
|
1584
|
+
/**
|
|
1585
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
1586
|
+
*/
|
|
1587
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
namespace EndBehavior {
|
|
1591
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
interface Prebilling {
|
|
1597
|
+
/**
|
|
1598
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
1599
|
+
*/
|
|
1600
|
+
iterations: number;
|
|
1601
|
+
|
|
1602
|
+
/**
|
|
1603
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
1604
|
+
*/
|
|
1605
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
namespace Prebilling {
|
|
1609
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
1140
1610
|
}
|
|
1141
1611
|
|
|
1142
1612
|
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
|
|
@@ -1163,6 +1633,11 @@ declare module 'stripe' {
|
|
|
1163
1633
|
*/
|
|
1164
1634
|
customer?: string;
|
|
1165
1635
|
|
|
1636
|
+
/**
|
|
1637
|
+
* Only return subscription schedules for the given account.
|
|
1638
|
+
*/
|
|
1639
|
+
customer_account?: string;
|
|
1640
|
+
|
|
1166
1641
|
/**
|
|
1167
1642
|
* Specifies which fields in the response should be expanded.
|
|
1168
1643
|
*/
|
|
@@ -1179,21 +1654,768 @@ declare module 'stripe' {
|
|
|
1179
1654
|
scheduled?: boolean;
|
|
1180
1655
|
}
|
|
1181
1656
|
|
|
1182
|
-
interface
|
|
1657
|
+
interface SubscriptionScheduleAmendParams {
|
|
1658
|
+
/**
|
|
1659
|
+
* Changes to apply to the phases of the subscription schedule, in the order provided.
|
|
1660
|
+
*/
|
|
1661
|
+
amendments?: Array<SubscriptionScheduleAmendParams.Amendment>;
|
|
1662
|
+
|
|
1183
1663
|
/**
|
|
1184
1664
|
* Specifies which fields in the response should be expanded.
|
|
1185
1665
|
*/
|
|
1186
1666
|
expand?: Array<string>;
|
|
1187
1667
|
|
|
1188
1668
|
/**
|
|
1189
|
-
*
|
|
1669
|
+
* Provide any time periods to bill in advance.
|
|
1190
1670
|
*/
|
|
1191
|
-
|
|
1671
|
+
prebilling?: Stripe.Emptyable<
|
|
1672
|
+
Array<SubscriptionScheduleAmendParams.Prebilling>
|
|
1673
|
+
>;
|
|
1192
1674
|
|
|
1193
1675
|
/**
|
|
1194
|
-
*
|
|
1676
|
+
* In cases where the amendment changes the currently active phase,
|
|
1677
|
+
* specifies if and how to prorate at the time of the request.
|
|
1195
1678
|
*/
|
|
1196
|
-
|
|
1679
|
+
proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior;
|
|
1680
|
+
|
|
1681
|
+
/**
|
|
1682
|
+
* Changes to apply to the subscription schedule.
|
|
1683
|
+
*/
|
|
1684
|
+
schedule_settings?: SubscriptionScheduleAmendParams.ScheduleSettings;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
namespace SubscriptionScheduleAmendParams {
|
|
1688
|
+
interface Amendment {
|
|
1689
|
+
/**
|
|
1690
|
+
* 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.
|
|
1691
|
+
*/
|
|
1692
|
+
amendment_end?: Amendment.AmendmentEnd;
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* Details to identify the earliest timestamp where the proposed change should take effect.
|
|
1696
|
+
*/
|
|
1697
|
+
amendment_start: Amendment.AmendmentStart;
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* 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.
|
|
1701
|
+
*/
|
|
1702
|
+
billing_cycle_anchor?: Amendment.BillingCycleAnchor;
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
|
1706
|
+
*/
|
|
1707
|
+
discount_actions?: Array<Amendment.DiscountAction>;
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* Changes to the subscription items during the amendment time span.
|
|
1711
|
+
*/
|
|
1712
|
+
item_actions?: Array<Amendment.ItemAction>;
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Instructions for how to modify phase metadata
|
|
1716
|
+
*/
|
|
1717
|
+
metadata_actions?: Array<Amendment.MetadataAction>;
|
|
1718
|
+
|
|
1719
|
+
/**
|
|
1720
|
+
* 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`.
|
|
1721
|
+
*/
|
|
1722
|
+
proration_behavior?: Amendment.ProrationBehavior;
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
|
1726
|
+
*/
|
|
1727
|
+
set_pause_collection?: Amendment.SetPauseCollection;
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
|
1731
|
+
*/
|
|
1732
|
+
set_schedule_end?: Amendment.SetScheduleEnd;
|
|
1733
|
+
|
|
1734
|
+
/**
|
|
1735
|
+
* Settings related to subscription trials.
|
|
1736
|
+
*/
|
|
1737
|
+
trial_settings?: Amendment.TrialSettings;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
namespace Amendment {
|
|
1741
|
+
interface AmendmentEnd {
|
|
1742
|
+
/**
|
|
1743
|
+
* Use the `end` time of a given discount.
|
|
1744
|
+
*/
|
|
1745
|
+
discount_end?: AmendmentEnd.DiscountEnd;
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* Time span for the amendment starting from the `amendment_start`.
|
|
1749
|
+
*/
|
|
1750
|
+
duration?: AmendmentEnd.Duration;
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
|
1754
|
+
*/
|
|
1755
|
+
timestamp?: number;
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Select one of three ways to pass the `amendment_end`.
|
|
1759
|
+
*/
|
|
1760
|
+
type: AmendmentEnd.Type;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
namespace AmendmentEnd {
|
|
1764
|
+
interface DiscountEnd {
|
|
1765
|
+
/**
|
|
1766
|
+
* The ID of a specific discount.
|
|
1767
|
+
*/
|
|
1768
|
+
discount: string;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
interface Duration {
|
|
1772
|
+
/**
|
|
1773
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1774
|
+
*/
|
|
1775
|
+
interval: Duration.Interval;
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1779
|
+
*/
|
|
1780
|
+
interval_count: number;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
namespace Duration {
|
|
1784
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
type Type =
|
|
1788
|
+
| 'discount_end'
|
|
1789
|
+
| 'duration'
|
|
1790
|
+
| 'schedule_end'
|
|
1791
|
+
| 'timestamp'
|
|
1792
|
+
| 'trial_end'
|
|
1793
|
+
| 'trial_start'
|
|
1794
|
+
| 'upcoming_invoice';
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
interface AmendmentStart {
|
|
1798
|
+
/**
|
|
1799
|
+
* Details of another amendment in the same array, immediately after which this amendment should begin.
|
|
1800
|
+
*/
|
|
1801
|
+
amendment_end?: AmendmentStart.AmendmentEnd;
|
|
1802
|
+
|
|
1803
|
+
/**
|
|
1804
|
+
* Use the `end` time of a given discount.
|
|
1805
|
+
*/
|
|
1806
|
+
discount_end?: AmendmentStart.DiscountEnd;
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* A precise Unix timestamp for the amendment to start.
|
|
1810
|
+
*/
|
|
1811
|
+
timestamp?: number;
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* Select one of three ways to pass the `amendment_start`.
|
|
1815
|
+
*/
|
|
1816
|
+
type: AmendmentStart.Type;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
namespace AmendmentStart {
|
|
1820
|
+
interface AmendmentEnd {
|
|
1821
|
+
/**
|
|
1822
|
+
* 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.
|
|
1823
|
+
*/
|
|
1824
|
+
index: number;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
interface DiscountEnd {
|
|
1828
|
+
/**
|
|
1829
|
+
* The ID of a specific discount.
|
|
1830
|
+
*/
|
|
1831
|
+
discount: string;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
type Type =
|
|
1835
|
+
| 'amendment_end'
|
|
1836
|
+
| 'discount_end'
|
|
1837
|
+
| 'now'
|
|
1838
|
+
| 'schedule_end'
|
|
1839
|
+
| 'timestamp'
|
|
1840
|
+
| 'trial_end'
|
|
1841
|
+
| 'trial_start'
|
|
1842
|
+
| 'upcoming_invoice';
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
type BillingCycleAnchor = 'amendment_start' | 'automatic';
|
|
1846
|
+
|
|
1847
|
+
interface DiscountAction {
|
|
1848
|
+
/**
|
|
1849
|
+
* Details of the discount to add.
|
|
1850
|
+
*/
|
|
1851
|
+
add?: DiscountAction.Add;
|
|
1852
|
+
|
|
1853
|
+
/**
|
|
1854
|
+
* Details of the discount to remove.
|
|
1855
|
+
*/
|
|
1856
|
+
remove?: DiscountAction.Remove;
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* Details of the discount to replace the existing discounts with.
|
|
1860
|
+
*/
|
|
1861
|
+
set?: DiscountAction.Set;
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* Determines the type of discount action.
|
|
1865
|
+
*/
|
|
1866
|
+
type: DiscountAction.Type;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
namespace DiscountAction {
|
|
1870
|
+
interface Add {
|
|
1871
|
+
/**
|
|
1872
|
+
* The coupon code to redeem.
|
|
1873
|
+
*/
|
|
1874
|
+
coupon?: string;
|
|
1875
|
+
|
|
1876
|
+
/**
|
|
1877
|
+
* An ID of an existing discount for a coupon that was already redeemed.
|
|
1878
|
+
*/
|
|
1879
|
+
discount?: string;
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* Details to determine how long the discount should be applied for.
|
|
1883
|
+
*/
|
|
1884
|
+
discount_end?: Add.DiscountEnd;
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* 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.
|
|
1888
|
+
*/
|
|
1889
|
+
index?: number;
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* The promotion code to redeem.
|
|
1893
|
+
*/
|
|
1894
|
+
promotion_code?: string;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
namespace Add {
|
|
1898
|
+
interface DiscountEnd {
|
|
1899
|
+
/**
|
|
1900
|
+
* The type of calculation made to determine when the discount ends.
|
|
1901
|
+
*/
|
|
1902
|
+
type: 'amendment_end';
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
interface Remove {
|
|
1907
|
+
/**
|
|
1908
|
+
* The coupon code to remove from the `discounts` array.
|
|
1909
|
+
*/
|
|
1910
|
+
coupon?: string;
|
|
1911
|
+
|
|
1912
|
+
/**
|
|
1913
|
+
* The ID of a discount to remove from the `discounts` array.
|
|
1914
|
+
*/
|
|
1915
|
+
discount?: string;
|
|
1916
|
+
|
|
1917
|
+
/**
|
|
1918
|
+
* The ID of a promotion code to remove from the `discounts` array.
|
|
1919
|
+
*/
|
|
1920
|
+
promotion_code?: string;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
interface Set {
|
|
1924
|
+
/**
|
|
1925
|
+
* The coupon code to replace the `discounts` array with.
|
|
1926
|
+
*/
|
|
1927
|
+
coupon?: string;
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* An ID of an existing discount to replace the `discounts` array with.
|
|
1931
|
+
*/
|
|
1932
|
+
discount?: string;
|
|
1933
|
+
|
|
1934
|
+
/**
|
|
1935
|
+
* An ID of an existing promotion code to replace the `discounts` array with.
|
|
1936
|
+
*/
|
|
1937
|
+
promotion_code?: string;
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
type Type = 'add' | 'remove' | 'set';
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
interface ItemAction {
|
|
1944
|
+
/**
|
|
1945
|
+
* 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.
|
|
1946
|
+
*/
|
|
1947
|
+
add?: ItemAction.Add;
|
|
1948
|
+
|
|
1949
|
+
/**
|
|
1950
|
+
* Details of the subscription item to remove.
|
|
1951
|
+
*/
|
|
1952
|
+
remove?: ItemAction.Remove;
|
|
1953
|
+
|
|
1954
|
+
/**
|
|
1955
|
+
* 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.
|
|
1956
|
+
*/
|
|
1957
|
+
set?: ItemAction.Set;
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* Determines the type of item action.
|
|
1961
|
+
*/
|
|
1962
|
+
type: ItemAction.Type;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
namespace ItemAction {
|
|
1966
|
+
interface Add {
|
|
1967
|
+
/**
|
|
1968
|
+
* The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
|
1969
|
+
*/
|
|
1970
|
+
discounts?: Array<Add.Discount>;
|
|
1971
|
+
|
|
1972
|
+
/**
|
|
1973
|
+
* 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`.
|
|
1974
|
+
*/
|
|
1975
|
+
metadata?: Stripe.MetadataParam;
|
|
1976
|
+
|
|
1977
|
+
/**
|
|
1978
|
+
* The ID of the price object.
|
|
1979
|
+
*/
|
|
1980
|
+
price: string;
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* Quantity for this item.
|
|
1984
|
+
*/
|
|
1985
|
+
quantity?: number;
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* 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`.
|
|
1989
|
+
*/
|
|
1990
|
+
tax_rates?: Array<string>;
|
|
1991
|
+
|
|
1992
|
+
/**
|
|
1993
|
+
* Options that configure the trial on the subscription item.
|
|
1994
|
+
*/
|
|
1995
|
+
trial?: Add.Trial;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
namespace Add {
|
|
1999
|
+
interface Discount {
|
|
2000
|
+
/**
|
|
2001
|
+
* ID of the coupon to create a new discount for.
|
|
2002
|
+
*/
|
|
2003
|
+
coupon?: string;
|
|
2004
|
+
|
|
2005
|
+
/**
|
|
2006
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2007
|
+
*/
|
|
2008
|
+
discount?: string;
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* Details to determine how long the discount should be applied for.
|
|
2012
|
+
*/
|
|
2013
|
+
discount_end?: Discount.DiscountEnd;
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* ID of the promotion code to create a new discount for.
|
|
2017
|
+
*/
|
|
2018
|
+
promotion_code?: string;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
namespace Discount {
|
|
2022
|
+
interface DiscountEnd {
|
|
2023
|
+
/**
|
|
2024
|
+
* Time span for the redeemed discount.
|
|
2025
|
+
*/
|
|
2026
|
+
duration?: DiscountEnd.Duration;
|
|
2027
|
+
|
|
2028
|
+
/**
|
|
2029
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2030
|
+
*/
|
|
2031
|
+
timestamp?: number;
|
|
2032
|
+
|
|
2033
|
+
/**
|
|
2034
|
+
* The type of calculation made to determine when the discount ends.
|
|
2035
|
+
*/
|
|
2036
|
+
type: DiscountEnd.Type;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
namespace DiscountEnd {
|
|
2040
|
+
interface Duration {
|
|
2041
|
+
/**
|
|
2042
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2043
|
+
*/
|
|
2044
|
+
interval: Duration.Interval;
|
|
2045
|
+
|
|
2046
|
+
/**
|
|
2047
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2048
|
+
*/
|
|
2049
|
+
interval_count: number;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
namespace Duration {
|
|
2053
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
type Type = 'duration' | 'timestamp';
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
interface Trial {
|
|
2061
|
+
/**
|
|
2062
|
+
* 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.
|
|
2063
|
+
*/
|
|
2064
|
+
converts_to?: Array<string>;
|
|
2065
|
+
|
|
2066
|
+
/**
|
|
2067
|
+
* Determines the type of trial for this item.
|
|
2068
|
+
*/
|
|
2069
|
+
type: Trial.Type;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
namespace Trial {
|
|
2073
|
+
type Type = 'free' | 'paid';
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
interface Remove {
|
|
2078
|
+
/**
|
|
2079
|
+
* ID of a price to remove.
|
|
2080
|
+
*/
|
|
2081
|
+
price: string;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
interface Set {
|
|
2085
|
+
/**
|
|
2086
|
+
* 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`.
|
|
2087
|
+
*/
|
|
2088
|
+
discounts?: Array<Set.Discount>;
|
|
2089
|
+
|
|
2090
|
+
/**
|
|
2091
|
+
* 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`.
|
|
2092
|
+
*/
|
|
2093
|
+
metadata?: Stripe.MetadataParam;
|
|
2094
|
+
|
|
2095
|
+
/**
|
|
2096
|
+
* The ID of the price object.
|
|
2097
|
+
*/
|
|
2098
|
+
price: string;
|
|
2099
|
+
|
|
2100
|
+
/**
|
|
2101
|
+
* 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`.
|
|
2102
|
+
*/
|
|
2103
|
+
quantity?: number;
|
|
2104
|
+
|
|
2105
|
+
/**
|
|
2106
|
+
* 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`.
|
|
2107
|
+
*/
|
|
2108
|
+
tax_rates?: Array<string>;
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* 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`.
|
|
2112
|
+
*/
|
|
2113
|
+
trial?: Set.Trial;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
namespace Set {
|
|
2117
|
+
interface Discount {
|
|
2118
|
+
/**
|
|
2119
|
+
* ID of the coupon to create a new discount for.
|
|
2120
|
+
*/
|
|
2121
|
+
coupon?: string;
|
|
2122
|
+
|
|
2123
|
+
/**
|
|
2124
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2125
|
+
*/
|
|
2126
|
+
discount?: string;
|
|
2127
|
+
|
|
2128
|
+
/**
|
|
2129
|
+
* Details to determine how long the discount should be applied for.
|
|
2130
|
+
*/
|
|
2131
|
+
discount_end?: Discount.DiscountEnd;
|
|
2132
|
+
|
|
2133
|
+
/**
|
|
2134
|
+
* ID of the promotion code to create a new discount for.
|
|
2135
|
+
*/
|
|
2136
|
+
promotion_code?: string;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
namespace Discount {
|
|
2140
|
+
interface DiscountEnd {
|
|
2141
|
+
/**
|
|
2142
|
+
* Time span for the redeemed discount.
|
|
2143
|
+
*/
|
|
2144
|
+
duration?: DiscountEnd.Duration;
|
|
2145
|
+
|
|
2146
|
+
/**
|
|
2147
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2148
|
+
*/
|
|
2149
|
+
timestamp?: number;
|
|
2150
|
+
|
|
2151
|
+
/**
|
|
2152
|
+
* The type of calculation made to determine when the discount ends.
|
|
2153
|
+
*/
|
|
2154
|
+
type: DiscountEnd.Type;
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
namespace DiscountEnd {
|
|
2158
|
+
interface Duration {
|
|
2159
|
+
/**
|
|
2160
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2161
|
+
*/
|
|
2162
|
+
interval: Duration.Interval;
|
|
2163
|
+
|
|
2164
|
+
/**
|
|
2165
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2166
|
+
*/
|
|
2167
|
+
interval_count: number;
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
namespace Duration {
|
|
2171
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
type Type = 'duration' | 'timestamp';
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
interface Trial {
|
|
2179
|
+
/**
|
|
2180
|
+
* 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.
|
|
2181
|
+
*/
|
|
2182
|
+
converts_to?: Array<string>;
|
|
2183
|
+
|
|
2184
|
+
/**
|
|
2185
|
+
* Determines the type of trial for this item.
|
|
2186
|
+
*/
|
|
2187
|
+
type: Trial.Type;
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2190
|
+
namespace Trial {
|
|
2191
|
+
type Type = 'free' | 'paid';
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
type Type = 'add' | 'remove' | 'set';
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
interface MetadataAction {
|
|
2199
|
+
/**
|
|
2200
|
+
* Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
|
2201
|
+
*/
|
|
2202
|
+
add?: {
|
|
2203
|
+
[key: string]: string;
|
|
2204
|
+
};
|
|
2205
|
+
|
|
2206
|
+
/**
|
|
2207
|
+
* Keys to remove from schedule phase metadata.
|
|
2208
|
+
*/
|
|
2209
|
+
remove?: Array<string>;
|
|
2210
|
+
|
|
2211
|
+
/**
|
|
2212
|
+
* Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
|
2213
|
+
*/
|
|
2214
|
+
set?: Stripe.Emptyable<{
|
|
2215
|
+
[key: string]: string;
|
|
2216
|
+
}>;
|
|
2217
|
+
|
|
2218
|
+
/**
|
|
2219
|
+
* Select one of three ways to update phase-level `metadata` on subscription schedules.
|
|
2220
|
+
*/
|
|
2221
|
+
type: MetadataAction.Type;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
namespace MetadataAction {
|
|
2225
|
+
type Type = 'add' | 'remove' | 'set';
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
type ProrationBehavior =
|
|
2229
|
+
| 'always_invoice'
|
|
2230
|
+
| 'create_prorations'
|
|
2231
|
+
| 'none';
|
|
2232
|
+
|
|
2233
|
+
interface SetPauseCollection {
|
|
2234
|
+
/**
|
|
2235
|
+
* Details of the pause_collection behavior to apply to the amendment.
|
|
2236
|
+
*/
|
|
2237
|
+
set?: SetPauseCollection.Set;
|
|
2238
|
+
|
|
2239
|
+
/**
|
|
2240
|
+
* Determines the type of the pause_collection amendment.
|
|
2241
|
+
*/
|
|
2242
|
+
type: SetPauseCollection.Type;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
namespace SetPauseCollection {
|
|
2246
|
+
interface Set {
|
|
2247
|
+
/**
|
|
2248
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
2249
|
+
*/
|
|
2250
|
+
behavior: Set.Behavior;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
namespace Set {
|
|
2254
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
type Type = 'remove' | 'set';
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
type SetScheduleEnd = 'amendment_end' | 'amendment_start';
|
|
2261
|
+
|
|
2262
|
+
interface TrialSettings {
|
|
2263
|
+
/**
|
|
2264
|
+
* Defines how the subscription should behave when a trial ends.
|
|
2265
|
+
*/
|
|
2266
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
namespace TrialSettings {
|
|
2270
|
+
interface EndBehavior {
|
|
2271
|
+
/**
|
|
2272
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
2273
|
+
*/
|
|
2274
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
namespace EndBehavior {
|
|
2278
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
interface Prebilling {
|
|
2284
|
+
/**
|
|
2285
|
+
* The beginning of the prebilled time period. The default value is `now`.
|
|
2286
|
+
*/
|
|
2287
|
+
bill_from?: Prebilling.BillFrom;
|
|
2288
|
+
|
|
2289
|
+
/**
|
|
2290
|
+
* The end of the prebilled time period.
|
|
2291
|
+
*/
|
|
2292
|
+
bill_until?: Prebilling.BillUntil;
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* When the prebilling invoice should be created. The default value is `now`.
|
|
2296
|
+
*/
|
|
2297
|
+
invoice_at?: 'now';
|
|
2298
|
+
|
|
2299
|
+
/**
|
|
2300
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
2301
|
+
*/
|
|
2302
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
namespace Prebilling {
|
|
2306
|
+
interface BillFrom {
|
|
2307
|
+
/**
|
|
2308
|
+
* Start the prebilled period when a specified amendment begins.
|
|
2309
|
+
*/
|
|
2310
|
+
amendment_start?: BillFrom.AmendmentStart;
|
|
2311
|
+
|
|
2312
|
+
/**
|
|
2313
|
+
* Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
|
2314
|
+
*/
|
|
2315
|
+
timestamp?: number;
|
|
2316
|
+
|
|
2317
|
+
/**
|
|
2318
|
+
* Select one of several ways to pass the `bill_from` value.
|
|
2319
|
+
*/
|
|
2320
|
+
type: BillFrom.Type;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
namespace BillFrom {
|
|
2324
|
+
interface AmendmentStart {
|
|
2325
|
+
/**
|
|
2326
|
+
* 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.
|
|
2327
|
+
*/
|
|
2328
|
+
index: number;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
type Type = 'amendment_start' | 'now' | 'timestamp';
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
interface BillUntil {
|
|
2335
|
+
/**
|
|
2336
|
+
* End the prebilled period when a specified amendment ends.
|
|
2337
|
+
*/
|
|
2338
|
+
amendment_end?: BillUntil.AmendmentEnd;
|
|
2339
|
+
|
|
2340
|
+
/**
|
|
2341
|
+
* Time span for prebilling, starting from `bill_from`.
|
|
2342
|
+
*/
|
|
2343
|
+
duration?: BillUntil.Duration;
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
|
2347
|
+
*/
|
|
2348
|
+
timestamp?: number;
|
|
2349
|
+
|
|
2350
|
+
/**
|
|
2351
|
+
* Select one of several ways to pass the `bill_until` value.
|
|
2352
|
+
*/
|
|
2353
|
+
type: BillUntil.Type;
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
namespace BillUntil {
|
|
2357
|
+
interface AmendmentEnd {
|
|
2358
|
+
/**
|
|
2359
|
+
* 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.
|
|
2360
|
+
*/
|
|
2361
|
+
index: number;
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
interface Duration {
|
|
2365
|
+
/**
|
|
2366
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2367
|
+
*/
|
|
2368
|
+
interval: Duration.Interval;
|
|
2369
|
+
|
|
2370
|
+
/**
|
|
2371
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2372
|
+
*/
|
|
2373
|
+
interval_count: number;
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
namespace Duration {
|
|
2377
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
type Type =
|
|
2381
|
+
| 'amendment_end'
|
|
2382
|
+
| 'duration'
|
|
2383
|
+
| 'schedule_end'
|
|
2384
|
+
| 'timestamp';
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
|
|
2391
|
+
|
|
2392
|
+
interface ScheduleSettings {
|
|
2393
|
+
/**
|
|
2394
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
2395
|
+
*/
|
|
2396
|
+
end_behavior?: ScheduleSettings.EndBehavior;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
namespace ScheduleSettings {
|
|
2400
|
+
type EndBehavior = 'cancel' | 'release';
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
interface SubscriptionScheduleCancelParams {
|
|
2405
|
+
/**
|
|
2406
|
+
* Specifies which fields in the response should be expanded.
|
|
2407
|
+
*/
|
|
2408
|
+
expand?: Array<string>;
|
|
2409
|
+
|
|
2410
|
+
/**
|
|
2411
|
+
* 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`.
|
|
2412
|
+
*/
|
|
2413
|
+
invoice_now?: boolean;
|
|
2414
|
+
|
|
2415
|
+
/**
|
|
2416
|
+
* If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
|
|
2417
|
+
*/
|
|
2418
|
+
prorate?: boolean;
|
|
1197
2419
|
}
|
|
1198
2420
|
|
|
1199
2421
|
interface SubscriptionScheduleReleaseParams {
|
|
@@ -1253,6 +2475,19 @@ declare module 'stripe' {
|
|
|
1253
2475
|
options?: RequestOptions
|
|
1254
2476
|
): ApiListPromise<Stripe.SubscriptionSchedule>;
|
|
1255
2477
|
|
|
2478
|
+
/**
|
|
2479
|
+
* Amends an existing subscription schedule.
|
|
2480
|
+
*/
|
|
2481
|
+
amend(
|
|
2482
|
+
id: string,
|
|
2483
|
+
params?: SubscriptionScheduleAmendParams,
|
|
2484
|
+
options?: RequestOptions
|
|
2485
|
+
): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
|
|
2486
|
+
amend(
|
|
2487
|
+
id: string,
|
|
2488
|
+
options?: RequestOptions
|
|
2489
|
+
): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
|
|
2490
|
+
|
|
1256
2491
|
/**
|
|
1257
2492
|
* 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
2493
|
*/
|