stripe 18.5.0 → 18.6.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 +1364 -33
- package/README.md +4 -5
- package/VERSION +1 -1
- package/cjs/Error.js +107 -1
- package/cjs/apiVersion.js +2 -3
- package/cjs/resources/AccountNotices.js +21 -0
- package/cjs/resources/BalanceSettings.js +10 -0
- package/cjs/resources/Billing/MeterUsage.js +12 -0
- package/cjs/resources/Capital/FinancingOffers.js +21 -0
- package/cjs/resources/Capital/FinancingSummary.js +12 -0
- package/cjs/resources/Capital/FinancingTransactions.js +17 -0
- package/cjs/resources/ExternalAccounts.js +23 -0
- package/cjs/resources/FinancialConnections/Accounts.js +5 -0
- package/cjs/resources/FinancialConnections/Institutions.js +17 -0
- package/cjs/resources/FxQuotes.js +15 -0
- package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
- package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
- package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
- package/cjs/resources/Mandates.js +5 -0
- package/cjs/resources/Margins.js +22 -0
- package/cjs/resources/Orders.js +24 -0
- package/cjs/resources/PaymentAttemptRecords.js +17 -0
- 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/OnboardingLinks.js +12 -0
- package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
- package/cjs/resources/V2/Core/AccountLinks.js +9 -0
- package/cjs/resources/V2/Core/Accounts/Persons.js +29 -0
- package/cjs/resources/V2/Core/Accounts.js +25 -0
- package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +28 -0
- package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +24 -0
- package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
- package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +25 -0
- package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
- package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
- package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
- package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
- package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
- package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
- package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
- package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
- package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
- package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
- package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
- package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
- package/cjs/resources/V2/Payments/OffSessionPayments.js +25 -0
- package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
- package/cjs/resources.js +102 -8
- package/cjs/stripe.core.js +1 -1
- package/esm/Error.js +93 -0
- package/esm/apiVersion.js +1 -2
- package/esm/resources/AccountNotices.js +18 -0
- package/esm/resources/BalanceSettings.js +7 -0
- package/esm/resources/Billing/MeterUsage.js +9 -0
- package/esm/resources/Capital/FinancingOffers.js +18 -0
- package/esm/resources/Capital/FinancingSummary.js +9 -0
- package/esm/resources/Capital/FinancingTransactions.js +14 -0
- package/esm/resources/ExternalAccounts.js +20 -0
- package/esm/resources/FinancialConnections/Accounts.js +5 -0
- package/esm/resources/FinancialConnections/Institutions.js +14 -0
- package/esm/resources/FxQuotes.js +12 -0
- package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
- package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
- package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
- package/esm/resources/Mandates.js +5 -0
- package/esm/resources/Margins.js +19 -0
- package/esm/resources/Orders.js +21 -0
- package/esm/resources/PaymentAttemptRecords.js +14 -0
- 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/OnboardingLinks.js +9 -0
- package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
- package/esm/resources/V2/Core/AccountLinks.js +6 -0
- package/esm/resources/V2/Core/Accounts/Persons.js +26 -0
- package/esm/resources/V2/Core/Accounts.js +22 -0
- package/esm/resources/V2/Core/Vault/GbBankAccounts.js +25 -0
- package/esm/resources/V2/Core/Vault/UsBankAccounts.js +21 -0
- package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
- package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +22 -0
- package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
- package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
- package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
- package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
- package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
- package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
- package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
- package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
- package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
- package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
- package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
- package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
- package/esm/resources/V2/Payments/OffSessionPayments.js +22 -0
- package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
- package/esm/resources.js +86 -0
- package/esm/stripe.core.js +1 -1
- package/package.json +1 -1
- package/types/AccountLinksResource.d.ts +5 -1
- package/types/AccountNotices.d.ts +113 -0
- package/types/AccountNoticesResource.d.ts +98 -0
- package/types/AccountSessions.d.ts +45 -0
- package/types/AccountSessionsResource.d.ts +264 -0
- package/types/Accounts.d.ts +212 -1
- package/types/AccountsResource.d.ts +544 -0
- package/types/BalanceSettings.d.ts +97 -0
- package/types/BalanceSettingsResource.d.ts +119 -0
- package/types/Billing/AlertTriggereds.d.ts +1 -1
- 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/MeterUsage.d.ts +32 -0
- package/types/Billing/MeterUsageResource.d.ts +685 -0
- package/types/Billing/MeterUsageRows.d.ts +49 -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 +171 -0
- package/types/ChargesResource.d.ts +1406 -0
- package/types/Checkout/Sessions.d.ts +374 -2
- package/types/Checkout/SessionsResource.d.ts +520 -2
- package/types/ConfirmationTokens.d.ts +125 -0
- package/types/Coupons.d.ts +33 -0
- package/types/CouponsResource.d.ts +21 -0
- package/types/CreditNoteLineItems.d.ts +17 -0
- package/types/CreditNotes.d.ts +5 -0
- package/types/CreditNotesResource.d.ts +5 -0
- package/types/CustomerBalanceTransactions.d.ts +2 -0
- package/types/CustomerCashBalanceTransactions.d.ts +2 -0
- package/types/CustomerSessions.d.ts +5 -0
- package/types/CustomerSessionsResource.d.ts +6 -1
- package/types/Customers.d.ts +2 -0
- package/types/CustomersResource.d.ts +8 -0
- package/types/Discounts.d.ts +10 -0
- package/types/Disputes.d.ts +29 -0
- package/types/Errors.d.ts +79 -0
- package/types/EventTypes.d.ts +664 -0
- package/types/Events.d.ts +97 -0
- package/types/ExternalAccountsResource.d.ts +304 -0
- package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
- package/types/FinancialConnections/Accounts.d.ts +36 -1
- package/types/FinancialConnections/AccountsResource.d.ts +40 -3
- package/types/FinancialConnections/Institutions.d.ts +98 -0
- package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
- package/types/FinancialConnections/Sessions.d.ts +51 -1
- package/types/FinancialConnections/SessionsResource.d.ts +43 -1
- package/types/FxQuotes.d.ts +155 -0
- package/types/FxQuotesResource.d.ts +130 -0
- package/types/Identity/VerificationSessions.d.ts +5 -0
- package/types/Identity/VerificationSessionsResource.d.ts +7 -0
- package/types/InvoiceItems.d.ts +10 -0
- package/types/InvoiceItemsResource.d.ts +117 -6
- package/types/InvoiceLineItems.d.ts +45 -1
- package/types/InvoicePayments.d.ts +5 -0
- package/types/InvoicePaymentsResource.d.ts +10 -1
- package/types/Invoices.d.ts +171 -3
- package/types/InvoicesResource.d.ts +1533 -22
- 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 +135 -1
- package/types/MandatesResource.d.ts +31 -0
- package/types/Margins.d.ts +56 -0
- package/types/MarginsResource.d.ts +114 -0
- package/types/Orders.d.ts +1163 -0
- package/types/OrdersResource.d.ts +3139 -0
- package/types/PaymentAttemptRecords.d.ts +2321 -0
- package/types/PaymentAttemptRecordsResource.d.ts +52 -0
- package/types/PaymentIntentAmountDetailsLineItems.d.ts +116 -0
- package/types/PaymentIntents.d.ts +836 -3
- package/types/PaymentIntentsResource.d.ts +11610 -5775
- 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 +130 -0
- package/types/PaymentMethodsResource.d.ts +167 -2
- package/types/PaymentRecords.d.ts +2314 -0
- package/types/PaymentRecordsResource.d.ts +476 -0
- package/types/Prices.d.ts +22 -0
- package/types/PricesResource.d.ts +22 -0
- package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
- package/types/Privacy/RedactionJobs.d.ts +111 -0
- package/types/Privacy/RedactionJobsResource.d.ts +230 -0
- package/types/PromotionCodes.d.ts +5 -0
- package/types/PromotionCodesResource.d.ts +10 -0
- package/types/QuoteLines.d.ts +634 -0
- package/types/QuotePreviewInvoices.d.ts +1736 -0
- package/types/QuotePreviewSubscriptionSchedules.d.ts +892 -0
- package/types/Quotes.d.ts +594 -1
- package/types/QuotesResource.d.ts +2577 -232
- package/types/Refunds.d.ts +14 -0
- package/types/SetupAttempts.d.ts +51 -1
- package/types/SetupIntents.d.ts +210 -2
- package/types/SetupIntentsResource.d.ts +938 -4
- package/types/Sources.d.ts +29 -0
- package/types/SubscriptionItems.d.ts +21 -0
- package/types/SubscriptionItemsResource.d.ts +109 -0
- package/types/SubscriptionSchedules.d.ts +205 -0
- package/types/SubscriptionSchedulesResource.d.ts +1233 -5
- package/types/Subscriptions.d.ts +135 -1
- package/types/SubscriptionsResource.d.ts +472 -8
- package/types/Tax/Associations.d.ts +82 -0
- package/types/Tax/AssociationsResource.d.ts +29 -0
- package/types/Tax/Forms.d.ts +220 -0
- package/types/Tax/FormsResource.d.ts +107 -0
- package/types/TaxIds.d.ts +10 -0
- package/types/TaxIdsResource.d.ts +10 -0
- package/types/Terminal/Configurations.d.ts +9 -0
- package/types/Terminal/ConfigurationsResource.d.ts +28 -0
- package/types/Terminal/OnboardingLinks.d.ts +57 -0
- package/types/Terminal/OnboardingLinksResource.d.ts +62 -0
- package/types/Terminal/ReaderCollectedData.d.ts +51 -0
- package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
- package/types/Terminal/Readers.d.ts +20 -0
- package/types/TestHelpers/ConfirmationTokensResource.d.ts +126 -0
- package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
- package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
- package/types/Transfers.d.ts +5 -0
- package/types/TransfersResource.d.ts +5 -0
- package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
- package/types/Treasury/FinancialAccounts.d.ts +5 -0
- package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
- package/types/Treasury/OutboundTransfers.d.ts +26 -0
- package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
- package/types/Treasury/ReceivedCredits.d.ts +26 -0
- package/types/Treasury/ReceivedDebits.d.ts +31 -0
- package/types/V2/Core/AccountLinks.d.ts +168 -0
- package/types/V2/Core/AccountLinksResource.d.ts +152 -0
- package/types/V2/Core/Accounts/PersonsResource.d.ts +3812 -0
- package/types/V2/Core/Accounts.d.ts +8862 -0
- package/types/V2/Core/AccountsResource.d.ts +10704 -0
- package/types/V2/Core/Persons.d.ts +1888 -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 +961 -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 +585 -0
- package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +331 -0
- package/types/V2/MoneyManagement/FinancialAddresses.d.ts +314 -0
- package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +289 -0
- package/types/V2/MoneyManagement/InboundTransfers.d.ts +206 -0
- package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +144 -0
- package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +168 -0
- package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +115 -0
- package/types/V2/MoneyManagement/OutboundPayments.d.ts +278 -0
- package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +242 -0
- package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
- package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +296 -0
- package/types/V2/MoneyManagement/OutboundTransfers.d.ts +251 -0
- package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +208 -0
- package/types/V2/MoneyManagement/PayoutMethods.d.ts +160 -0
- package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
- package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecs.d.ts +87 -0
- package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +113 -0
- package/types/V2/MoneyManagement/ReceivedCredits.d.ts +262 -0
- package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
- package/types/V2/MoneyManagement/ReceivedDebits.d.ts +176 -0
- package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
- package/types/V2/MoneyManagement/TransactionEntries.d.ts +162 -0
- package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
- package/types/V2/MoneyManagement/Transactions.d.ts +177 -0
- package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
- package/types/V2/Payments/OffSessionPayments.d.ts +179 -0
- package/types/V2/Payments/OffSessionPaymentsResource.d.ts +174 -0
- package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +68 -0
- package/types/WebhookEndpointsResource.d.ts +78 -0
- package/types/index.d.ts +145 -0
- package/types/lib.d.ts +11 -1
- package/types/test/typescriptTest.ts +3 -3
|
@@ -3,6 +3,11 @@
|
|
|
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
|
* Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
|
8
13
|
*/
|
|
@@ -13,6 +18,11 @@ declare module 'stripe' {
|
|
|
13
18
|
*/
|
|
14
19
|
customer?: string;
|
|
15
20
|
|
|
21
|
+
/**
|
|
22
|
+
* The identifier of the account to create the subscription schedule for.
|
|
23
|
+
*/
|
|
24
|
+
customer_account?: string;
|
|
25
|
+
|
|
16
26
|
/**
|
|
17
27
|
* Object representing the subscription schedule's default settings.
|
|
18
28
|
*/
|
|
@@ -43,6 +53,11 @@ declare module 'stripe' {
|
|
|
43
53
|
*/
|
|
44
54
|
phases?: Array<SubscriptionScheduleCreateParams.Phase>;
|
|
45
55
|
|
|
56
|
+
/**
|
|
57
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed now.
|
|
58
|
+
*/
|
|
59
|
+
prebilling?: SubscriptionScheduleCreateParams.Prebilling;
|
|
60
|
+
|
|
46
61
|
/**
|
|
47
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.
|
|
48
63
|
*/
|
|
@@ -50,6 +65,8 @@ declare module 'stripe' {
|
|
|
50
65
|
}
|
|
51
66
|
|
|
52
67
|
namespace SubscriptionScheduleCreateParams {
|
|
68
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
69
|
+
|
|
53
70
|
interface BillingMode {
|
|
54
71
|
/**
|
|
55
72
|
* Controls the calculation and orchestration of prorations and invoices for subscriptions.
|
|
@@ -303,6 +320,11 @@ declare module 'stripe' {
|
|
|
303
320
|
*/
|
|
304
321
|
on_behalf_of?: string;
|
|
305
322
|
|
|
323
|
+
/**
|
|
324
|
+
* 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).
|
|
325
|
+
*/
|
|
326
|
+
pause_collection?: Phase.PauseCollection;
|
|
327
|
+
|
|
306
328
|
/**
|
|
307
329
|
* Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. 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 (item price, quantity, etc.) of the current phase.
|
|
308
330
|
*/
|
|
@@ -318,10 +340,20 @@ declare module 'stripe' {
|
|
|
318
340
|
*/
|
|
319
341
|
trial?: boolean;
|
|
320
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Specify trial behavior when crossing phase boundaries
|
|
345
|
+
*/
|
|
346
|
+
trial_continuation?: Phase.TrialContinuation;
|
|
347
|
+
|
|
321
348
|
/**
|
|
322
349
|
* 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`
|
|
323
350
|
*/
|
|
324
351
|
trial_end?: number;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Settings related to subscription trials.
|
|
355
|
+
*/
|
|
356
|
+
trial_settings?: Phase.TrialSettings;
|
|
325
357
|
}
|
|
326
358
|
|
|
327
359
|
namespace Phase {
|
|
@@ -374,12 +406,56 @@ declare module 'stripe' {
|
|
|
374
406
|
*/
|
|
375
407
|
discount?: string;
|
|
376
408
|
|
|
409
|
+
/**
|
|
410
|
+
* Details to determine how long the discount should be applied for.
|
|
411
|
+
*/
|
|
412
|
+
discount_end?: Discount.DiscountEnd;
|
|
413
|
+
|
|
377
414
|
/**
|
|
378
415
|
* ID of the promotion code to create a new discount for.
|
|
379
416
|
*/
|
|
380
417
|
promotion_code?: string;
|
|
381
418
|
}
|
|
382
419
|
|
|
420
|
+
namespace Discount {
|
|
421
|
+
interface DiscountEnd {
|
|
422
|
+
/**
|
|
423
|
+
* Time span for the redeemed discount.
|
|
424
|
+
*/
|
|
425
|
+
duration?: DiscountEnd.Duration;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
429
|
+
*/
|
|
430
|
+
timestamp?: number;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* The type of calculation made to determine when the discount ends.
|
|
434
|
+
*/
|
|
435
|
+
type: DiscountEnd.Type;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
namespace DiscountEnd {
|
|
439
|
+
interface Duration {
|
|
440
|
+
/**
|
|
441
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
442
|
+
*/
|
|
443
|
+
interval: Duration.Interval;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
447
|
+
*/
|
|
448
|
+
interval_count: number;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
namespace Duration {
|
|
452
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
type Type = 'duration' | 'timestamp';
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
383
459
|
interface Period {
|
|
384
460
|
/**
|
|
385
461
|
* End of the invoice item period.
|
|
@@ -515,12 +591,56 @@ declare module 'stripe' {
|
|
|
515
591
|
*/
|
|
516
592
|
discount?: string;
|
|
517
593
|
|
|
594
|
+
/**
|
|
595
|
+
* Details to determine how long the discount should be applied for.
|
|
596
|
+
*/
|
|
597
|
+
discount_end?: Discount.DiscountEnd;
|
|
598
|
+
|
|
518
599
|
/**
|
|
519
600
|
* ID of the promotion code to create a new discount for.
|
|
520
601
|
*/
|
|
521
602
|
promotion_code?: string;
|
|
522
603
|
}
|
|
523
604
|
|
|
605
|
+
namespace Discount {
|
|
606
|
+
interface DiscountEnd {
|
|
607
|
+
/**
|
|
608
|
+
* Time span for the redeemed discount.
|
|
609
|
+
*/
|
|
610
|
+
duration?: DiscountEnd.Duration;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
614
|
+
*/
|
|
615
|
+
timestamp?: number;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* The type of calculation made to determine when the discount ends.
|
|
619
|
+
*/
|
|
620
|
+
type: DiscountEnd.Type;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
namespace DiscountEnd {
|
|
624
|
+
interface Duration {
|
|
625
|
+
/**
|
|
626
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
627
|
+
*/
|
|
628
|
+
interval: Duration.Interval;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
632
|
+
*/
|
|
633
|
+
interval_count: number;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
namespace Duration {
|
|
637
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
type Type = 'duration' | 'timestamp';
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
524
644
|
interface Duration {
|
|
525
645
|
/**
|
|
526
646
|
* Specifies phase duration. Either `day`, `week`, `month` or `year`.
|
|
@@ -612,6 +732,11 @@ declare module 'stripe' {
|
|
|
612
732
|
* 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.
|
|
613
733
|
*/
|
|
614
734
|
tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Options that configure the trial on the subscription item.
|
|
738
|
+
*/
|
|
739
|
+
trial?: Item.Trial;
|
|
615
740
|
}
|
|
616
741
|
|
|
617
742
|
namespace Item {
|
|
@@ -633,12 +758,56 @@ declare module 'stripe' {
|
|
|
633
758
|
*/
|
|
634
759
|
discount?: string;
|
|
635
760
|
|
|
761
|
+
/**
|
|
762
|
+
* Details to determine how long the discount should be applied for.
|
|
763
|
+
*/
|
|
764
|
+
discount_end?: Discount.DiscountEnd;
|
|
765
|
+
|
|
636
766
|
/**
|
|
637
767
|
* ID of the promotion code to create a new discount for.
|
|
638
768
|
*/
|
|
639
769
|
promotion_code?: string;
|
|
640
770
|
}
|
|
641
771
|
|
|
772
|
+
namespace Discount {
|
|
773
|
+
interface DiscountEnd {
|
|
774
|
+
/**
|
|
775
|
+
* Time span for the redeemed discount.
|
|
776
|
+
*/
|
|
777
|
+
duration?: DiscountEnd.Duration;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
781
|
+
*/
|
|
782
|
+
timestamp?: number;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* The type of calculation made to determine when the discount ends.
|
|
786
|
+
*/
|
|
787
|
+
type: DiscountEnd.Type;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
namespace DiscountEnd {
|
|
791
|
+
interface Duration {
|
|
792
|
+
/**
|
|
793
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
794
|
+
*/
|
|
795
|
+
interval: Duration.Interval;
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
799
|
+
*/
|
|
800
|
+
interval_count: number;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
namespace Duration {
|
|
804
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
type Type = 'duration' | 'timestamp';
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
642
811
|
interface PriceData {
|
|
643
812
|
/**
|
|
644
813
|
* 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).
|
|
@@ -690,6 +859,33 @@ declare module 'stripe' {
|
|
|
690
859
|
|
|
691
860
|
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
|
|
692
861
|
}
|
|
862
|
+
|
|
863
|
+
interface Trial {
|
|
864
|
+
/**
|
|
865
|
+
* 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.
|
|
866
|
+
*/
|
|
867
|
+
converts_to?: Array<string>;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Determines the type of trial for this item.
|
|
871
|
+
*/
|
|
872
|
+
type: Trial.Type;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
namespace Trial {
|
|
876
|
+
type Type = 'free' | 'paid';
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
interface PauseCollection {
|
|
881
|
+
/**
|
|
882
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
883
|
+
*/
|
|
884
|
+
behavior: PauseCollection.Behavior;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
namespace PauseCollection {
|
|
888
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
693
889
|
}
|
|
694
890
|
|
|
695
891
|
type ProrationBehavior =
|
|
@@ -708,6 +904,44 @@ declare module 'stripe' {
|
|
|
708
904
|
*/
|
|
709
905
|
destination: string;
|
|
710
906
|
}
|
|
907
|
+
|
|
908
|
+
type TrialContinuation = 'continue' | 'none';
|
|
909
|
+
|
|
910
|
+
interface TrialSettings {
|
|
911
|
+
/**
|
|
912
|
+
* Defines how the subscription should behave when a trial ends.
|
|
913
|
+
*/
|
|
914
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
namespace TrialSettings {
|
|
918
|
+
interface EndBehavior {
|
|
919
|
+
/**
|
|
920
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
921
|
+
*/
|
|
922
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
namespace EndBehavior {
|
|
926
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
interface Prebilling {
|
|
932
|
+
/**
|
|
933
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
934
|
+
*/
|
|
935
|
+
iterations: number;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
939
|
+
*/
|
|
940
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
namespace Prebilling {
|
|
944
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
711
945
|
}
|
|
712
946
|
}
|
|
713
947
|
|
|
@@ -719,6 +953,11 @@ declare module 'stripe' {
|
|
|
719
953
|
}
|
|
720
954
|
|
|
721
955
|
interface SubscriptionScheduleUpdateParams {
|
|
956
|
+
/**
|
|
957
|
+
* 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.
|
|
958
|
+
*/
|
|
959
|
+
billing_behavior?: SubscriptionScheduleUpdateParams.BillingBehavior;
|
|
960
|
+
|
|
722
961
|
/**
|
|
723
962
|
* Object representing the subscription schedule's default settings.
|
|
724
963
|
*/
|
|
@@ -744,6 +983,11 @@ declare module 'stripe' {
|
|
|
744
983
|
*/
|
|
745
984
|
phases?: Array<SubscriptionScheduleUpdateParams.Phase>;
|
|
746
985
|
|
|
986
|
+
/**
|
|
987
|
+
* If specified, the invoicing for the given billing cycle iterations will be processed now.
|
|
988
|
+
*/
|
|
989
|
+
prebilling?: SubscriptionScheduleUpdateParams.Prebilling;
|
|
990
|
+
|
|
747
991
|
/**
|
|
748
992
|
* If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.
|
|
749
993
|
*/
|
|
@@ -751,6 +995,8 @@ declare module 'stripe' {
|
|
|
751
995
|
}
|
|
752
996
|
|
|
753
997
|
namespace SubscriptionScheduleUpdateParams {
|
|
998
|
+
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
|
|
999
|
+
|
|
754
1000
|
interface DefaultSettings {
|
|
755
1001
|
/**
|
|
756
1002
|
* 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).
|
|
@@ -993,6 +1239,11 @@ declare module 'stripe' {
|
|
|
993
1239
|
*/
|
|
994
1240
|
on_behalf_of?: string;
|
|
995
1241
|
|
|
1242
|
+
/**
|
|
1243
|
+
* 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).
|
|
1244
|
+
*/
|
|
1245
|
+
pause_collection?: Phase.PauseCollection;
|
|
1246
|
+
|
|
996
1247
|
/**
|
|
997
1248
|
* Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. 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 (item price, quantity, etc.) of the current phase.
|
|
998
1249
|
*/
|
|
@@ -1013,10 +1264,20 @@ declare module 'stripe' {
|
|
|
1013
1264
|
*/
|
|
1014
1265
|
trial?: boolean;
|
|
1015
1266
|
|
|
1267
|
+
/**
|
|
1268
|
+
* Specify trial behavior when crossing phase boundaries
|
|
1269
|
+
*/
|
|
1270
|
+
trial_continuation?: Phase.TrialContinuation;
|
|
1271
|
+
|
|
1016
1272
|
/**
|
|
1017
1273
|
* 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`
|
|
1018
1274
|
*/
|
|
1019
1275
|
trial_end?: number | 'now';
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* Settings related to subscription trials.
|
|
1279
|
+
*/
|
|
1280
|
+
trial_settings?: Phase.TrialSettings;
|
|
1020
1281
|
}
|
|
1021
1282
|
|
|
1022
1283
|
namespace Phase {
|
|
@@ -1069,12 +1330,56 @@ declare module 'stripe' {
|
|
|
1069
1330
|
*/
|
|
1070
1331
|
discount?: string;
|
|
1071
1332
|
|
|
1333
|
+
/**
|
|
1334
|
+
* Details to determine how long the discount should be applied for.
|
|
1335
|
+
*/
|
|
1336
|
+
discount_end?: Discount.DiscountEnd;
|
|
1337
|
+
|
|
1072
1338
|
/**
|
|
1073
1339
|
* ID of the promotion code to create a new discount for.
|
|
1074
1340
|
*/
|
|
1075
1341
|
promotion_code?: string;
|
|
1076
1342
|
}
|
|
1077
1343
|
|
|
1344
|
+
namespace Discount {
|
|
1345
|
+
interface DiscountEnd {
|
|
1346
|
+
/**
|
|
1347
|
+
* Time span for the redeemed discount.
|
|
1348
|
+
*/
|
|
1349
|
+
duration?: DiscountEnd.Duration;
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1353
|
+
*/
|
|
1354
|
+
timestamp?: number;
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* The type of calculation made to determine when the discount ends.
|
|
1358
|
+
*/
|
|
1359
|
+
type: DiscountEnd.Type;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
namespace DiscountEnd {
|
|
1363
|
+
interface Duration {
|
|
1364
|
+
/**
|
|
1365
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1366
|
+
*/
|
|
1367
|
+
interval: Duration.Interval;
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1371
|
+
*/
|
|
1372
|
+
interval_count: number;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
namespace Duration {
|
|
1376
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
type Type = 'duration' | 'timestamp';
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1078
1383
|
interface Period {
|
|
1079
1384
|
/**
|
|
1080
1385
|
* End of the invoice item period.
|
|
@@ -1210,12 +1515,56 @@ declare module 'stripe' {
|
|
|
1210
1515
|
*/
|
|
1211
1516
|
discount?: string;
|
|
1212
1517
|
|
|
1518
|
+
/**
|
|
1519
|
+
* Details to determine how long the discount should be applied for.
|
|
1520
|
+
*/
|
|
1521
|
+
discount_end?: Discount.DiscountEnd;
|
|
1522
|
+
|
|
1213
1523
|
/**
|
|
1214
1524
|
* ID of the promotion code to create a new discount for.
|
|
1215
1525
|
*/
|
|
1216
1526
|
promotion_code?: string;
|
|
1217
1527
|
}
|
|
1218
1528
|
|
|
1529
|
+
namespace Discount {
|
|
1530
|
+
interface DiscountEnd {
|
|
1531
|
+
/**
|
|
1532
|
+
* Time span for the redeemed discount.
|
|
1533
|
+
*/
|
|
1534
|
+
duration?: DiscountEnd.Duration;
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1538
|
+
*/
|
|
1539
|
+
timestamp?: number;
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* The type of calculation made to determine when the discount ends.
|
|
1543
|
+
*/
|
|
1544
|
+
type: DiscountEnd.Type;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
namespace DiscountEnd {
|
|
1548
|
+
interface Duration {
|
|
1549
|
+
/**
|
|
1550
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1551
|
+
*/
|
|
1552
|
+
interval: Duration.Interval;
|
|
1553
|
+
|
|
1554
|
+
/**
|
|
1555
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1556
|
+
*/
|
|
1557
|
+
interval_count: number;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
namespace Duration {
|
|
1561
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
type Type = 'duration' | 'timestamp';
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1219
1568
|
interface Duration {
|
|
1220
1569
|
/**
|
|
1221
1570
|
* Specifies phase duration. Either `day`, `week`, `month` or `year`.
|
|
@@ -1307,6 +1656,11 @@ declare module 'stripe' {
|
|
|
1307
1656
|
* 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.
|
|
1308
1657
|
*/
|
|
1309
1658
|
tax_rates?: Stripe.Emptyable<Array<string>>;
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* Options that configure the trial on the subscription item.
|
|
1662
|
+
*/
|
|
1663
|
+
trial?: Item.Trial;
|
|
1310
1664
|
}
|
|
1311
1665
|
|
|
1312
1666
|
namespace Item {
|
|
@@ -1328,12 +1682,56 @@ declare module 'stripe' {
|
|
|
1328
1682
|
*/
|
|
1329
1683
|
discount?: string;
|
|
1330
1684
|
|
|
1685
|
+
/**
|
|
1686
|
+
* Details to determine how long the discount should be applied for.
|
|
1687
|
+
*/
|
|
1688
|
+
discount_end?: Discount.DiscountEnd;
|
|
1689
|
+
|
|
1331
1690
|
/**
|
|
1332
1691
|
* ID of the promotion code to create a new discount for.
|
|
1333
1692
|
*/
|
|
1334
1693
|
promotion_code?: string;
|
|
1335
1694
|
}
|
|
1336
1695
|
|
|
1696
|
+
namespace Discount {
|
|
1697
|
+
interface DiscountEnd {
|
|
1698
|
+
/**
|
|
1699
|
+
* Time span for the redeemed discount.
|
|
1700
|
+
*/
|
|
1701
|
+
duration?: DiscountEnd.Duration;
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
1705
|
+
*/
|
|
1706
|
+
timestamp?: number;
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* The type of calculation made to determine when the discount ends.
|
|
1710
|
+
*/
|
|
1711
|
+
type: DiscountEnd.Type;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
namespace DiscountEnd {
|
|
1715
|
+
interface Duration {
|
|
1716
|
+
/**
|
|
1717
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
1718
|
+
*/
|
|
1719
|
+
interval: Duration.Interval;
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
1723
|
+
*/
|
|
1724
|
+
interval_count: number;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
namespace Duration {
|
|
1728
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
type Type = 'duration' | 'timestamp';
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1337
1735
|
interface PriceData {
|
|
1338
1736
|
/**
|
|
1339
1737
|
* 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).
|
|
@@ -1385,6 +1783,33 @@ declare module 'stripe' {
|
|
|
1385
1783
|
|
|
1386
1784
|
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
|
|
1387
1785
|
}
|
|
1786
|
+
|
|
1787
|
+
interface Trial {
|
|
1788
|
+
/**
|
|
1789
|
+
* 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.
|
|
1790
|
+
*/
|
|
1791
|
+
converts_to?: Array<string>;
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* Determines the type of trial for this item.
|
|
1795
|
+
*/
|
|
1796
|
+
type: Trial.Type;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
namespace Trial {
|
|
1800
|
+
type Type = 'free' | 'paid';
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
interface PauseCollection {
|
|
1805
|
+
/**
|
|
1806
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
1807
|
+
*/
|
|
1808
|
+
behavior: PauseCollection.Behavior;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
namespace PauseCollection {
|
|
1812
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
1388
1813
|
}
|
|
1389
1814
|
|
|
1390
1815
|
type ProrationBehavior =
|
|
@@ -1403,6 +1828,44 @@ declare module 'stripe' {
|
|
|
1403
1828
|
*/
|
|
1404
1829
|
destination: string;
|
|
1405
1830
|
}
|
|
1831
|
+
|
|
1832
|
+
type TrialContinuation = 'continue' | 'none';
|
|
1833
|
+
|
|
1834
|
+
interface TrialSettings {
|
|
1835
|
+
/**
|
|
1836
|
+
* Defines how the subscription should behave when a trial ends.
|
|
1837
|
+
*/
|
|
1838
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
namespace TrialSettings {
|
|
1842
|
+
interface EndBehavior {
|
|
1843
|
+
/**
|
|
1844
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
1845
|
+
*/
|
|
1846
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
namespace EndBehavior {
|
|
1850
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
interface Prebilling {
|
|
1856
|
+
/**
|
|
1857
|
+
* This is used to determine the number of billing cycles to prebill.
|
|
1858
|
+
*/
|
|
1859
|
+
iterations: number;
|
|
1860
|
+
|
|
1861
|
+
/**
|
|
1862
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
1863
|
+
*/
|
|
1864
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
namespace Prebilling {
|
|
1868
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
1406
1869
|
}
|
|
1407
1870
|
|
|
1408
1871
|
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
|
|
@@ -1429,6 +1892,11 @@ declare module 'stripe' {
|
|
|
1429
1892
|
*/
|
|
1430
1893
|
customer?: string;
|
|
1431
1894
|
|
|
1895
|
+
/**
|
|
1896
|
+
* Only return subscription schedules for the given account.
|
|
1897
|
+
*/
|
|
1898
|
+
customer_account?: string;
|
|
1899
|
+
|
|
1432
1900
|
/**
|
|
1433
1901
|
* Specifies which fields in the response should be expanded.
|
|
1434
1902
|
*/
|
|
@@ -1445,21 +1913,768 @@ declare module 'stripe' {
|
|
|
1445
1913
|
scheduled?: boolean;
|
|
1446
1914
|
}
|
|
1447
1915
|
|
|
1448
|
-
interface
|
|
1916
|
+
interface SubscriptionScheduleAmendParams {
|
|
1917
|
+
/**
|
|
1918
|
+
* Changes to apply to the phases of the subscription schedule, in the order provided.
|
|
1919
|
+
*/
|
|
1920
|
+
amendments?: Array<SubscriptionScheduleAmendParams.Amendment>;
|
|
1921
|
+
|
|
1449
1922
|
/**
|
|
1450
1923
|
* Specifies which fields in the response should be expanded.
|
|
1451
1924
|
*/
|
|
1452
1925
|
expand?: Array<string>;
|
|
1453
1926
|
|
|
1454
1927
|
/**
|
|
1455
|
-
*
|
|
1928
|
+
* Provide any time periods to bill in advance.
|
|
1456
1929
|
*/
|
|
1457
|
-
|
|
1930
|
+
prebilling?: Stripe.Emptyable<
|
|
1931
|
+
Array<SubscriptionScheduleAmendParams.Prebilling>
|
|
1932
|
+
>;
|
|
1458
1933
|
|
|
1459
1934
|
/**
|
|
1460
|
-
*
|
|
1935
|
+
* In cases where the amendment changes the currently active phase,
|
|
1936
|
+
* specifies if and how to prorate at the time of the request.
|
|
1461
1937
|
*/
|
|
1462
|
-
|
|
1938
|
+
proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior;
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* Changes to apply to the subscription schedule.
|
|
1942
|
+
*/
|
|
1943
|
+
schedule_settings?: SubscriptionScheduleAmendParams.ScheduleSettings;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
namespace SubscriptionScheduleAmendParams {
|
|
1947
|
+
interface Amendment {
|
|
1948
|
+
/**
|
|
1949
|
+
* 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.
|
|
1950
|
+
*/
|
|
1951
|
+
amendment_end?: Amendment.AmendmentEnd;
|
|
1952
|
+
|
|
1953
|
+
/**
|
|
1954
|
+
* Details to identify the earliest timestamp where the proposed change should take effect.
|
|
1955
|
+
*/
|
|
1956
|
+
amendment_start: Amendment.AmendmentStart;
|
|
1957
|
+
|
|
1958
|
+
/**
|
|
1959
|
+
* 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.
|
|
1960
|
+
*/
|
|
1961
|
+
billing_cycle_anchor?: Amendment.BillingCycleAnchor;
|
|
1962
|
+
|
|
1963
|
+
/**
|
|
1964
|
+
* Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
|
1965
|
+
*/
|
|
1966
|
+
discount_actions?: Array<Amendment.DiscountAction>;
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* Changes to the subscription items during the amendment time span.
|
|
1970
|
+
*/
|
|
1971
|
+
item_actions?: Array<Amendment.ItemAction>;
|
|
1972
|
+
|
|
1973
|
+
/**
|
|
1974
|
+
* Instructions for how to modify phase metadata
|
|
1975
|
+
*/
|
|
1976
|
+
metadata_actions?: Array<Amendment.MetadataAction>;
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* 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`.
|
|
1980
|
+
*/
|
|
1981
|
+
proration_behavior?: Amendment.ProrationBehavior;
|
|
1982
|
+
|
|
1983
|
+
/**
|
|
1984
|
+
* Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
|
1985
|
+
*/
|
|
1986
|
+
set_pause_collection?: Amendment.SetPauseCollection;
|
|
1987
|
+
|
|
1988
|
+
/**
|
|
1989
|
+
* Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
|
1990
|
+
*/
|
|
1991
|
+
set_schedule_end?: Amendment.SetScheduleEnd;
|
|
1992
|
+
|
|
1993
|
+
/**
|
|
1994
|
+
* Settings related to subscription trials.
|
|
1995
|
+
*/
|
|
1996
|
+
trial_settings?: Amendment.TrialSettings;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
namespace Amendment {
|
|
2000
|
+
interface AmendmentEnd {
|
|
2001
|
+
/**
|
|
2002
|
+
* Use the `end` time of a given discount.
|
|
2003
|
+
*/
|
|
2004
|
+
discount_end?: AmendmentEnd.DiscountEnd;
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* Time span for the amendment starting from the `amendment_start`.
|
|
2008
|
+
*/
|
|
2009
|
+
duration?: AmendmentEnd.Duration;
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
|
2013
|
+
*/
|
|
2014
|
+
timestamp?: number;
|
|
2015
|
+
|
|
2016
|
+
/**
|
|
2017
|
+
* Select one of three ways to pass the `amendment_end`.
|
|
2018
|
+
*/
|
|
2019
|
+
type: AmendmentEnd.Type;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
namespace AmendmentEnd {
|
|
2023
|
+
interface DiscountEnd {
|
|
2024
|
+
/**
|
|
2025
|
+
* The ID of a specific discount.
|
|
2026
|
+
*/
|
|
2027
|
+
discount: string;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
interface Duration {
|
|
2031
|
+
/**
|
|
2032
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2033
|
+
*/
|
|
2034
|
+
interval: Duration.Interval;
|
|
2035
|
+
|
|
2036
|
+
/**
|
|
2037
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2038
|
+
*/
|
|
2039
|
+
interval_count: number;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
namespace Duration {
|
|
2043
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
type Type =
|
|
2047
|
+
| 'discount_end'
|
|
2048
|
+
| 'duration'
|
|
2049
|
+
| 'schedule_end'
|
|
2050
|
+
| 'timestamp'
|
|
2051
|
+
| 'trial_end'
|
|
2052
|
+
| 'trial_start'
|
|
2053
|
+
| 'upcoming_invoice';
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
interface AmendmentStart {
|
|
2057
|
+
/**
|
|
2058
|
+
* Details of another amendment in the same array, immediately after which this amendment should begin.
|
|
2059
|
+
*/
|
|
2060
|
+
amendment_end?: AmendmentStart.AmendmentEnd;
|
|
2061
|
+
|
|
2062
|
+
/**
|
|
2063
|
+
* Use the `end` time of a given discount.
|
|
2064
|
+
*/
|
|
2065
|
+
discount_end?: AmendmentStart.DiscountEnd;
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* A precise Unix timestamp for the amendment to start.
|
|
2069
|
+
*/
|
|
2070
|
+
timestamp?: number;
|
|
2071
|
+
|
|
2072
|
+
/**
|
|
2073
|
+
* Select one of three ways to pass the `amendment_start`.
|
|
2074
|
+
*/
|
|
2075
|
+
type: AmendmentStart.Type;
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
namespace AmendmentStart {
|
|
2079
|
+
interface AmendmentEnd {
|
|
2080
|
+
/**
|
|
2081
|
+
* 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.
|
|
2082
|
+
*/
|
|
2083
|
+
index: number;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
interface DiscountEnd {
|
|
2087
|
+
/**
|
|
2088
|
+
* The ID of a specific discount.
|
|
2089
|
+
*/
|
|
2090
|
+
discount: string;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
type Type =
|
|
2094
|
+
| 'amendment_end'
|
|
2095
|
+
| 'discount_end'
|
|
2096
|
+
| 'now'
|
|
2097
|
+
| 'schedule_end'
|
|
2098
|
+
| 'timestamp'
|
|
2099
|
+
| 'trial_end'
|
|
2100
|
+
| 'trial_start'
|
|
2101
|
+
| 'upcoming_invoice';
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
type BillingCycleAnchor = 'amendment_start' | 'automatic';
|
|
2105
|
+
|
|
2106
|
+
interface DiscountAction {
|
|
2107
|
+
/**
|
|
2108
|
+
* Details of the discount to add.
|
|
2109
|
+
*/
|
|
2110
|
+
add?: DiscountAction.Add;
|
|
2111
|
+
|
|
2112
|
+
/**
|
|
2113
|
+
* Details of the discount to remove.
|
|
2114
|
+
*/
|
|
2115
|
+
remove?: DiscountAction.Remove;
|
|
2116
|
+
|
|
2117
|
+
/**
|
|
2118
|
+
* Details of the discount to replace the existing discounts with.
|
|
2119
|
+
*/
|
|
2120
|
+
set?: DiscountAction.Set;
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* Determines the type of discount action.
|
|
2124
|
+
*/
|
|
2125
|
+
type: DiscountAction.Type;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
namespace DiscountAction {
|
|
2129
|
+
interface Add {
|
|
2130
|
+
/**
|
|
2131
|
+
* The coupon code to redeem.
|
|
2132
|
+
*/
|
|
2133
|
+
coupon?: string;
|
|
2134
|
+
|
|
2135
|
+
/**
|
|
2136
|
+
* An ID of an existing discount for a coupon that was already redeemed.
|
|
2137
|
+
*/
|
|
2138
|
+
discount?: string;
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* Details to determine how long the discount should be applied for.
|
|
2142
|
+
*/
|
|
2143
|
+
discount_end?: Add.DiscountEnd;
|
|
2144
|
+
|
|
2145
|
+
/**
|
|
2146
|
+
* 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.
|
|
2147
|
+
*/
|
|
2148
|
+
index?: number;
|
|
2149
|
+
|
|
2150
|
+
/**
|
|
2151
|
+
* The promotion code to redeem.
|
|
2152
|
+
*/
|
|
2153
|
+
promotion_code?: string;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
namespace Add {
|
|
2157
|
+
interface DiscountEnd {
|
|
2158
|
+
/**
|
|
2159
|
+
* The type of calculation made to determine when the discount ends.
|
|
2160
|
+
*/
|
|
2161
|
+
type: 'amendment_end';
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
interface Remove {
|
|
2166
|
+
/**
|
|
2167
|
+
* The coupon code to remove from the `discounts` array.
|
|
2168
|
+
*/
|
|
2169
|
+
coupon?: string;
|
|
2170
|
+
|
|
2171
|
+
/**
|
|
2172
|
+
* The ID of a discount to remove from the `discounts` array.
|
|
2173
|
+
*/
|
|
2174
|
+
discount?: string;
|
|
2175
|
+
|
|
2176
|
+
/**
|
|
2177
|
+
* The ID of a promotion code to remove from the `discounts` array.
|
|
2178
|
+
*/
|
|
2179
|
+
promotion_code?: string;
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
interface Set {
|
|
2183
|
+
/**
|
|
2184
|
+
* The coupon code to replace the `discounts` array with.
|
|
2185
|
+
*/
|
|
2186
|
+
coupon?: string;
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* An ID of an existing discount to replace the `discounts` array with.
|
|
2190
|
+
*/
|
|
2191
|
+
discount?: string;
|
|
2192
|
+
|
|
2193
|
+
/**
|
|
2194
|
+
* An ID of an existing promotion code to replace the `discounts` array with.
|
|
2195
|
+
*/
|
|
2196
|
+
promotion_code?: string;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
type Type = 'add' | 'remove' | 'set';
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
interface ItemAction {
|
|
2203
|
+
/**
|
|
2204
|
+
* 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.
|
|
2205
|
+
*/
|
|
2206
|
+
add?: ItemAction.Add;
|
|
2207
|
+
|
|
2208
|
+
/**
|
|
2209
|
+
* Details of the subscription item to remove.
|
|
2210
|
+
*/
|
|
2211
|
+
remove?: ItemAction.Remove;
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* 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.
|
|
2215
|
+
*/
|
|
2216
|
+
set?: ItemAction.Set;
|
|
2217
|
+
|
|
2218
|
+
/**
|
|
2219
|
+
* Determines the type of item action.
|
|
2220
|
+
*/
|
|
2221
|
+
type: ItemAction.Type;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
namespace ItemAction {
|
|
2225
|
+
interface Add {
|
|
2226
|
+
/**
|
|
2227
|
+
* The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
|
2228
|
+
*/
|
|
2229
|
+
discounts?: Array<Add.Discount>;
|
|
2230
|
+
|
|
2231
|
+
/**
|
|
2232
|
+
* 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`.
|
|
2233
|
+
*/
|
|
2234
|
+
metadata?: Stripe.MetadataParam;
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* The ID of the price object.
|
|
2238
|
+
*/
|
|
2239
|
+
price: string;
|
|
2240
|
+
|
|
2241
|
+
/**
|
|
2242
|
+
* Quantity for this item.
|
|
2243
|
+
*/
|
|
2244
|
+
quantity?: number;
|
|
2245
|
+
|
|
2246
|
+
/**
|
|
2247
|
+
* 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`.
|
|
2248
|
+
*/
|
|
2249
|
+
tax_rates?: Array<string>;
|
|
2250
|
+
|
|
2251
|
+
/**
|
|
2252
|
+
* Options that configure the trial on the subscription item.
|
|
2253
|
+
*/
|
|
2254
|
+
trial?: Add.Trial;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
namespace Add {
|
|
2258
|
+
interface Discount {
|
|
2259
|
+
/**
|
|
2260
|
+
* ID of the coupon to create a new discount for.
|
|
2261
|
+
*/
|
|
2262
|
+
coupon?: string;
|
|
2263
|
+
|
|
2264
|
+
/**
|
|
2265
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2266
|
+
*/
|
|
2267
|
+
discount?: string;
|
|
2268
|
+
|
|
2269
|
+
/**
|
|
2270
|
+
* Details to determine how long the discount should be applied for.
|
|
2271
|
+
*/
|
|
2272
|
+
discount_end?: Discount.DiscountEnd;
|
|
2273
|
+
|
|
2274
|
+
/**
|
|
2275
|
+
* ID of the promotion code to create a new discount for.
|
|
2276
|
+
*/
|
|
2277
|
+
promotion_code?: string;
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
namespace Discount {
|
|
2281
|
+
interface DiscountEnd {
|
|
2282
|
+
/**
|
|
2283
|
+
* Time span for the redeemed discount.
|
|
2284
|
+
*/
|
|
2285
|
+
duration?: DiscountEnd.Duration;
|
|
2286
|
+
|
|
2287
|
+
/**
|
|
2288
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2289
|
+
*/
|
|
2290
|
+
timestamp?: number;
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* The type of calculation made to determine when the discount ends.
|
|
2294
|
+
*/
|
|
2295
|
+
type: DiscountEnd.Type;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
namespace DiscountEnd {
|
|
2299
|
+
interface Duration {
|
|
2300
|
+
/**
|
|
2301
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2302
|
+
*/
|
|
2303
|
+
interval: Duration.Interval;
|
|
2304
|
+
|
|
2305
|
+
/**
|
|
2306
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2307
|
+
*/
|
|
2308
|
+
interval_count: number;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
namespace Duration {
|
|
2312
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
type Type = 'duration' | 'timestamp';
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
interface Trial {
|
|
2320
|
+
/**
|
|
2321
|
+
* 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.
|
|
2322
|
+
*/
|
|
2323
|
+
converts_to?: Array<string>;
|
|
2324
|
+
|
|
2325
|
+
/**
|
|
2326
|
+
* Determines the type of trial for this item.
|
|
2327
|
+
*/
|
|
2328
|
+
type: Trial.Type;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
namespace Trial {
|
|
2332
|
+
type Type = 'free' | 'paid';
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
interface Remove {
|
|
2337
|
+
/**
|
|
2338
|
+
* ID of a price to remove.
|
|
2339
|
+
*/
|
|
2340
|
+
price: string;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
interface Set {
|
|
2344
|
+
/**
|
|
2345
|
+
* 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`.
|
|
2346
|
+
*/
|
|
2347
|
+
discounts?: Array<Set.Discount>;
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* 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`.
|
|
2351
|
+
*/
|
|
2352
|
+
metadata?: Stripe.MetadataParam;
|
|
2353
|
+
|
|
2354
|
+
/**
|
|
2355
|
+
* The ID of the price object.
|
|
2356
|
+
*/
|
|
2357
|
+
price: string;
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* 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`.
|
|
2361
|
+
*/
|
|
2362
|
+
quantity?: number;
|
|
2363
|
+
|
|
2364
|
+
/**
|
|
2365
|
+
* 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`.
|
|
2366
|
+
*/
|
|
2367
|
+
tax_rates?: Array<string>;
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* 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`.
|
|
2371
|
+
*/
|
|
2372
|
+
trial?: Set.Trial;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
namespace Set {
|
|
2376
|
+
interface Discount {
|
|
2377
|
+
/**
|
|
2378
|
+
* ID of the coupon to create a new discount for.
|
|
2379
|
+
*/
|
|
2380
|
+
coupon?: string;
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* ID of an existing discount on the object (or one of its ancestors) to reuse.
|
|
2384
|
+
*/
|
|
2385
|
+
discount?: string;
|
|
2386
|
+
|
|
2387
|
+
/**
|
|
2388
|
+
* Details to determine how long the discount should be applied for.
|
|
2389
|
+
*/
|
|
2390
|
+
discount_end?: Discount.DiscountEnd;
|
|
2391
|
+
|
|
2392
|
+
/**
|
|
2393
|
+
* ID of the promotion code to create a new discount for.
|
|
2394
|
+
*/
|
|
2395
|
+
promotion_code?: string;
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
namespace Discount {
|
|
2399
|
+
interface DiscountEnd {
|
|
2400
|
+
/**
|
|
2401
|
+
* Time span for the redeemed discount.
|
|
2402
|
+
*/
|
|
2403
|
+
duration?: DiscountEnd.Duration;
|
|
2404
|
+
|
|
2405
|
+
/**
|
|
2406
|
+
* A precise Unix timestamp for the discount to end. Must be in the future.
|
|
2407
|
+
*/
|
|
2408
|
+
timestamp?: number;
|
|
2409
|
+
|
|
2410
|
+
/**
|
|
2411
|
+
* The type of calculation made to determine when the discount ends.
|
|
2412
|
+
*/
|
|
2413
|
+
type: DiscountEnd.Type;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
namespace DiscountEnd {
|
|
2417
|
+
interface Duration {
|
|
2418
|
+
/**
|
|
2419
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2420
|
+
*/
|
|
2421
|
+
interval: Duration.Interval;
|
|
2422
|
+
|
|
2423
|
+
/**
|
|
2424
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2425
|
+
*/
|
|
2426
|
+
interval_count: number;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
namespace Duration {
|
|
2430
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
type Type = 'duration' | 'timestamp';
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
interface Trial {
|
|
2438
|
+
/**
|
|
2439
|
+
* 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.
|
|
2440
|
+
*/
|
|
2441
|
+
converts_to?: Array<string>;
|
|
2442
|
+
|
|
2443
|
+
/**
|
|
2444
|
+
* Determines the type of trial for this item.
|
|
2445
|
+
*/
|
|
2446
|
+
type: Trial.Type;
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
namespace Trial {
|
|
2450
|
+
type Type = 'free' | 'paid';
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
type Type = 'add' | 'remove' | 'set';
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
interface MetadataAction {
|
|
2458
|
+
/**
|
|
2459
|
+
* Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
|
2460
|
+
*/
|
|
2461
|
+
add?: {
|
|
2462
|
+
[key: string]: string;
|
|
2463
|
+
};
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Keys to remove from schedule phase metadata.
|
|
2467
|
+
*/
|
|
2468
|
+
remove?: Array<string>;
|
|
2469
|
+
|
|
2470
|
+
/**
|
|
2471
|
+
* Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
|
2472
|
+
*/
|
|
2473
|
+
set?: Stripe.Emptyable<{
|
|
2474
|
+
[key: string]: string;
|
|
2475
|
+
}>;
|
|
2476
|
+
|
|
2477
|
+
/**
|
|
2478
|
+
* Select one of three ways to update phase-level `metadata` on subscription schedules.
|
|
2479
|
+
*/
|
|
2480
|
+
type: MetadataAction.Type;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
namespace MetadataAction {
|
|
2484
|
+
type Type = 'add' | 'remove' | 'set';
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
type ProrationBehavior =
|
|
2488
|
+
| 'always_invoice'
|
|
2489
|
+
| 'create_prorations'
|
|
2490
|
+
| 'none';
|
|
2491
|
+
|
|
2492
|
+
interface SetPauseCollection {
|
|
2493
|
+
/**
|
|
2494
|
+
* Details of the pause_collection behavior to apply to the amendment.
|
|
2495
|
+
*/
|
|
2496
|
+
set?: SetPauseCollection.Set;
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* Determines the type of the pause_collection amendment.
|
|
2500
|
+
*/
|
|
2501
|
+
type: SetPauseCollection.Type;
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
namespace SetPauseCollection {
|
|
2505
|
+
interface Set {
|
|
2506
|
+
/**
|
|
2507
|
+
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
|
2508
|
+
*/
|
|
2509
|
+
behavior: Set.Behavior;
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
namespace Set {
|
|
2513
|
+
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
type Type = 'remove' | 'set';
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
type SetScheduleEnd = 'amendment_end' | 'amendment_start';
|
|
2520
|
+
|
|
2521
|
+
interface TrialSettings {
|
|
2522
|
+
/**
|
|
2523
|
+
* Defines how the subscription should behave when a trial ends.
|
|
2524
|
+
*/
|
|
2525
|
+
end_behavior?: TrialSettings.EndBehavior;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
namespace TrialSettings {
|
|
2529
|
+
interface EndBehavior {
|
|
2530
|
+
/**
|
|
2531
|
+
* Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
|
2532
|
+
*/
|
|
2533
|
+
prorate_up_front?: EndBehavior.ProrateUpFront;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
namespace EndBehavior {
|
|
2537
|
+
type ProrateUpFront = 'defer' | 'include';
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
interface Prebilling {
|
|
2543
|
+
/**
|
|
2544
|
+
* The beginning of the prebilled time period. The default value is `now`.
|
|
2545
|
+
*/
|
|
2546
|
+
bill_from?: Prebilling.BillFrom;
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* The end of the prebilled time period.
|
|
2550
|
+
*/
|
|
2551
|
+
bill_until?: Prebilling.BillUntil;
|
|
2552
|
+
|
|
2553
|
+
/**
|
|
2554
|
+
* When the prebilling invoice should be created. The default value is `now`.
|
|
2555
|
+
*/
|
|
2556
|
+
invoice_at?: 'now';
|
|
2557
|
+
|
|
2558
|
+
/**
|
|
2559
|
+
* Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
|
2560
|
+
*/
|
|
2561
|
+
update_behavior?: Prebilling.UpdateBehavior;
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
namespace Prebilling {
|
|
2565
|
+
interface BillFrom {
|
|
2566
|
+
/**
|
|
2567
|
+
* Start the prebilled period when a specified amendment begins.
|
|
2568
|
+
*/
|
|
2569
|
+
amendment_start?: BillFrom.AmendmentStart;
|
|
2570
|
+
|
|
2571
|
+
/**
|
|
2572
|
+
* Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
|
2573
|
+
*/
|
|
2574
|
+
timestamp?: number;
|
|
2575
|
+
|
|
2576
|
+
/**
|
|
2577
|
+
* Select one of several ways to pass the `bill_from` value.
|
|
2578
|
+
*/
|
|
2579
|
+
type: BillFrom.Type;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
namespace BillFrom {
|
|
2583
|
+
interface AmendmentStart {
|
|
2584
|
+
/**
|
|
2585
|
+
* 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.
|
|
2586
|
+
*/
|
|
2587
|
+
index: number;
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
type Type = 'amendment_start' | 'now' | 'timestamp';
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
interface BillUntil {
|
|
2594
|
+
/**
|
|
2595
|
+
* End the prebilled period when a specified amendment ends.
|
|
2596
|
+
*/
|
|
2597
|
+
amendment_end?: BillUntil.AmendmentEnd;
|
|
2598
|
+
|
|
2599
|
+
/**
|
|
2600
|
+
* Time span for prebilling, starting from `bill_from`.
|
|
2601
|
+
*/
|
|
2602
|
+
duration?: BillUntil.Duration;
|
|
2603
|
+
|
|
2604
|
+
/**
|
|
2605
|
+
* End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
|
2606
|
+
*/
|
|
2607
|
+
timestamp?: number;
|
|
2608
|
+
|
|
2609
|
+
/**
|
|
2610
|
+
* Select one of several ways to pass the `bill_until` value.
|
|
2611
|
+
*/
|
|
2612
|
+
type: BillUntil.Type;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
namespace BillUntil {
|
|
2616
|
+
interface AmendmentEnd {
|
|
2617
|
+
/**
|
|
2618
|
+
* 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.
|
|
2619
|
+
*/
|
|
2620
|
+
index: number;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
interface Duration {
|
|
2624
|
+
/**
|
|
2625
|
+
* Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
|
2626
|
+
*/
|
|
2627
|
+
interval: Duration.Interval;
|
|
2628
|
+
|
|
2629
|
+
/**
|
|
2630
|
+
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
|
2631
|
+
*/
|
|
2632
|
+
interval_count: number;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
namespace Duration {
|
|
2636
|
+
type Interval = 'day' | 'month' | 'week' | 'year';
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
type Type =
|
|
2640
|
+
| 'amendment_end'
|
|
2641
|
+
| 'duration'
|
|
2642
|
+
| 'schedule_end'
|
|
2643
|
+
| 'timestamp';
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
type UpdateBehavior = 'prebill' | 'reset';
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
|
|
2650
|
+
|
|
2651
|
+
interface ScheduleSettings {
|
|
2652
|
+
/**
|
|
2653
|
+
* Behavior of the subscription schedule and underlying subscription when it ends.
|
|
2654
|
+
*/
|
|
2655
|
+
end_behavior?: ScheduleSettings.EndBehavior;
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
namespace ScheduleSettings {
|
|
2659
|
+
type EndBehavior = 'cancel' | 'release';
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
interface SubscriptionScheduleCancelParams {
|
|
2664
|
+
/**
|
|
2665
|
+
* Specifies which fields in the response should be expanded.
|
|
2666
|
+
*/
|
|
2667
|
+
expand?: Array<string>;
|
|
2668
|
+
|
|
2669
|
+
/**
|
|
2670
|
+
* 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`.
|
|
2671
|
+
*/
|
|
2672
|
+
invoice_now?: boolean;
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
|
|
2676
|
+
*/
|
|
2677
|
+
prorate?: boolean;
|
|
1463
2678
|
}
|
|
1464
2679
|
|
|
1465
2680
|
interface SubscriptionScheduleReleaseParams {
|
|
@@ -1519,6 +2734,19 @@ declare module 'stripe' {
|
|
|
1519
2734
|
options?: RequestOptions
|
|
1520
2735
|
): ApiListPromise<Stripe.SubscriptionSchedule>;
|
|
1521
2736
|
|
|
2737
|
+
/**
|
|
2738
|
+
* Amends an existing subscription schedule.
|
|
2739
|
+
*/
|
|
2740
|
+
amend(
|
|
2741
|
+
id: string,
|
|
2742
|
+
params?: SubscriptionScheduleAmendParams,
|
|
2743
|
+
options?: RequestOptions
|
|
2744
|
+
): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
|
|
2745
|
+
amend(
|
|
2746
|
+
id: string,
|
|
2747
|
+
options?: RequestOptions
|
|
2748
|
+
): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
|
|
2749
|
+
|
|
1522
2750
|
/**
|
|
1523
2751
|
* 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.
|
|
1524
2752
|
*/
|