@commet/node 9.6.0 → 9.8.0
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/dist/index.d.mts +258 -51
- package/dist/index.d.ts +258 -51
- package/dist/index.js +47 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -11
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/commet-skill.md +1 -1
- package/docs/ai-onboarding/mcp-server.md +2 -2
- package/docs/api-reference/customers.md +4 -2
- package/docs/api-reference/index.md +2 -2
- package/docs/api-reference/offers.md +2 -2
- package/docs/api-reference/plans.md +9 -1
- package/docs/api-reference/promo-codes.md +3 -1
- package/docs/api-reference/subscriptions.md +106 -8
- package/docs/api-reference/usage.md +0 -4
- package/docs/documentation/better-auth.md +1 -8
- package/docs/documentation/customers/customer-portal.md +1 -7
- package/docs/documentation/customers/manage-customers.md +0 -6
- package/docs/documentation/error-handling.md +1 -1
- package/docs/documentation/finance/acceptable-use.md +1 -6
- package/docs/documentation/finance/finance-overview.md +0 -5
- package/docs/documentation/finance/local-currency-taxes.md +0 -6
- package/docs/documentation/finance/merchant-of-record.md +0 -7
- package/docs/documentation/finance/payouts-verification.md +0 -5
- package/docs/documentation/finance/payouts.md +0 -6
- package/docs/documentation/finance/supported-countries.md +1 -6
- package/docs/documentation/go/integrate-with-encore.md +1 -8
- package/docs/documentation/go/integrate-with-go.md +1 -8
- package/docs/documentation/invoicing/handle-failed-payments.md +3 -9
- package/docs/documentation/invoicing/invoices-and-billing-cycles.md +0 -6
- package/docs/documentation/java/integrate-with-java.md +1 -5
- package/docs/documentation/nodejs/integrate-with-astro.md +1 -8
- package/docs/documentation/nodejs/integrate-with-bun.md +1 -8
- package/docs/documentation/nodejs/integrate-with-express.md +1 -8
- package/docs/documentation/nodejs/integrate-with-hono.md +1 -8
- package/docs/documentation/nodejs/integrate-with-nextjs.md +1 -8
- package/docs/documentation/nodejs/integrate-with-nuxt.md +1 -8
- package/docs/documentation/nodejs/integrate-with-remix.md +1 -8
- package/docs/documentation/nodejs/integrate-with-sveltekit.md +1 -8
- package/docs/documentation/payments/accept-one-time-payments.md +0 -8
- package/docs/documentation/payments/payment-orchestration.md +0 -6
- package/docs/documentation/payments/payment-providers.md +0 -6
- package/docs/documentation/php/integrate-with-laravel.md +1 -8
- package/docs/documentation/php/integrate-with-php.md +1 -7
- package/docs/documentation/php/integrate-with-symfony.md +1 -8
- package/docs/documentation/plans/add-ons.md +0 -8
- package/docs/documentation/plans/configure-features.md +1 -8
- package/docs/documentation/plans/consumption-models.md +0 -7
- package/docs/documentation/plans/create-plans.md +0 -9
- package/docs/documentation/plans/credit-packs.md +0 -7
- package/docs/documentation/plans/one-time-payments.md +36 -7
- package/docs/documentation/plans/plan-groups.md +0 -6
- package/docs/documentation/python/integrate-with-django.md +1 -8
- package/docs/documentation/python/integrate-with-fastapi.md +1 -8
- package/docs/documentation/python/integrate-with-flask.md +1 -8
- package/docs/documentation/python/integrate-with-python.md +1 -8
- package/docs/documentation/sales/introductory-offers.md +1 -9
- package/docs/documentation/sales/offers.md +0 -8
- package/docs/documentation/sales/promo-codes.md +0 -7
- package/docs/documentation/sales/promotional-offers.md +0 -7
- package/docs/documentation/sales/regional-prices.md +0 -7
- package/docs/documentation/sales/trial-periods.md +0 -8
- package/docs/documentation/sdk-reference.md +1 -1
- package/docs/documentation/subscriptions/manage-subscriptions.md +2 -9
- package/docs/documentation/subscriptions/pay-in-advance.md +161 -0
- package/docs/documentation/subscriptions/plan-grants.md +0 -6
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +1 -7
- package/docs/documentation/testing-sandbox.md +1 -1
- package/docs/documentation/usage/ai-token-billing.md +0 -6
- package/docs/documentation/usage/quota-management.md +1 -7
- package/docs/documentation/usage/seat-management.md +1 -7
- package/docs/documentation/usage/track-usage.md +1 -7
- package/docs/errors/customer_deleted.md +22 -0
- package/docs/errors/index.md +4 -0
- package/docs/errors/managed_by_integration.md +22 -0
- package/docs/errors/no_scheduled_plan_change.md +22 -0
- package/docs/errors/plan_credit_limit_reached.md +22 -0
- package/docs/knowledge-base/how-do-discounts-work.md +0 -8
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +1 -7
- package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +0 -6
- package/docs/knowledge-base/how-do-trial-periods-work.md +1 -8
- package/docs/knowledge-base/how-does-billing-work.md +1 -1
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +1 -7
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +1 -7
- package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +0 -6
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +0 -6
- package/docs/knowledge-base/what-happens-when-a-payment-fails.md +1 -7
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -7
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -7
- package/docs/manifest.json +51 -2
- package/docs/platform-documentation.md +1 -0
- package/docs/schemas.md +46 -8
- package/docs/webhooks/introduction.md +3 -3
- package/docs/webhooks.md +15 -15
- package/docs/webhooks.openapi.json +15 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -126,8 +126,8 @@ type ResolvedPlanCode<TConfig> = [InferPlanCodes<TConfig>] extends [
|
|
|
126
126
|
type BillingInterval = "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
|
|
127
127
|
type ConsumptionModel = "metered" | "credits" | "balance";
|
|
128
128
|
type FeatureType = "boolean" | "usage" | "seats" | "quota";
|
|
129
|
-
type InvoiceType = "recurring" | "overage" | "plan_change" | "adjustment" | "credit_purchase" | "balance_topup" | "addon_activation" | "one_time_payment" | "reactivation" | "resume";
|
|
130
|
-
type PaymentMethod = "card" | "oxxo" | "mercado_pago";
|
|
129
|
+
type InvoiceType = "recurring" | "overage" | "plan_change" | "adjustment" | "credit_purchase" | "balance_topup" | "addon_activation" | "one_time_payment" | "reactivation" | "resume" | "prepayment";
|
|
130
|
+
type PaymentMethod = "card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix";
|
|
131
131
|
type PaymentProvider = "stripe" | "commet" | "dlocal";
|
|
132
132
|
type SubPaymentMethod = "credit_card" | "debit_card" | "prepaid_card" | "bank_transfer" | "account_money";
|
|
133
133
|
type SubscriptionStatus = "draft" | "pending_payment" | "trialing" | "active" | "past_due" | "paused" | "canceled";
|
|
@@ -254,6 +254,8 @@ interface CreatedSubscription {
|
|
|
254
254
|
billingDayOfMonth: number | null;
|
|
255
255
|
nextBillingDate: string | null;
|
|
256
256
|
checkoutUrl: string | null;
|
|
257
|
+
/** Whether Commet can charge this subscription on its own at its next charge (the trial end or the renewal). A trial that started without a payment method reports false until the customer adds one for this subscription; a payment method saved for another subscription does not count. A subscription on a free plan reports false. */
|
|
258
|
+
hasPaymentMethod: boolean;
|
|
257
259
|
/** @format date-time */
|
|
258
260
|
createdAt: string;
|
|
259
261
|
/** @format date-time */
|
|
@@ -708,7 +710,7 @@ interface Invoice {
|
|
|
708
710
|
poNumber: string | null;
|
|
709
711
|
reference: string | null;
|
|
710
712
|
lineItems: Array<{
|
|
711
|
-
lineType: "plan_base" | "feature_overage" | "feature_seats" | "feature_quota" | "discount" | "promo_code_discount" | "credit" | "balance_overage" | "addon_base" | "one_time";
|
|
713
|
+
lineType: "plan_base" | "feature_overage" | "feature_seats" | "feature_quota" | "discount" | "promo_code_discount" | "credit" | "balance_overage" | "addon_base" | "one_time" | "prepaid_period";
|
|
712
714
|
featureName: string | null;
|
|
713
715
|
description: string;
|
|
714
716
|
quantity: number;
|
|
@@ -761,6 +763,7 @@ interface InvoiceListItem {
|
|
|
761
763
|
object: "invoice";
|
|
762
764
|
livemode: boolean;
|
|
763
765
|
}
|
|
766
|
+
type ManagedBy = "dub" | null;
|
|
764
767
|
interface Market {
|
|
765
768
|
id: string;
|
|
766
769
|
name: string;
|
|
@@ -777,9 +780,6 @@ interface Offer {
|
|
|
777
780
|
id: string;
|
|
778
781
|
name: string;
|
|
779
782
|
phases: Array<{
|
|
780
|
-
type: "free_trial";
|
|
781
|
-
durationDays: number;
|
|
782
|
-
} | {
|
|
783
783
|
type: "percentage";
|
|
784
784
|
durationCycles: number | null;
|
|
785
785
|
/** Unit the phase duration is counted in. Only a fixed-price phase may set it, because its amount is declared rather than derived from the plan. Defaults to the plan's own billing interval. */
|
|
@@ -811,6 +811,8 @@ interface Offer {
|
|
|
811
811
|
startsAt: string | null;
|
|
812
812
|
endsAt: string | null;
|
|
813
813
|
active: boolean;
|
|
814
|
+
/** Integration that manages this record, or null when the merchant does. While an integration manages it, its terms change only in that integration and edits answer 409 managed_by_integration. */
|
|
815
|
+
managedBy: ManagedBy;
|
|
814
816
|
/** @format date-time */
|
|
815
817
|
createdAt: string;
|
|
816
818
|
/** @format date-time */
|
|
@@ -822,7 +824,7 @@ interface Payment {
|
|
|
822
824
|
/** Charge context captured for new payments. Null for historical payments with no captured context. */
|
|
823
825
|
paymentContext: {
|
|
824
826
|
/** The original reason for the charge. Recovery never replaces this reason. */
|
|
825
|
-
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
|
|
827
|
+
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
|
|
826
828
|
/** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
|
|
827
829
|
paymentLinkId: string | null;
|
|
828
830
|
recovery: {
|
|
@@ -900,6 +902,21 @@ interface Plan {
|
|
|
900
902
|
isDefault: boolean;
|
|
901
903
|
isFree: boolean;
|
|
902
904
|
blockOnExhaustion: boolean | null;
|
|
905
|
+
/** Credits plans only; null for other consumption models. What happens to unused plan credits at each reset. Purchased credits never expire and never count toward maxPlanCredits. */
|
|
906
|
+
unusedPlanCredits: {
|
|
907
|
+
type: "expire";
|
|
908
|
+
} | {
|
|
909
|
+
type: "roll_over";
|
|
910
|
+
/** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
|
|
911
|
+
maxPlanCredits: number | null;
|
|
912
|
+
} | null;
|
|
913
|
+
/** Credits plans only. The most plan credits a subscription spends per day or per week; null means no limit. */
|
|
914
|
+
planCreditLimit: {
|
|
915
|
+
/** The most plan credits a subscription spends in one window. */
|
|
916
|
+
credits: number;
|
|
917
|
+
/** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
|
|
918
|
+
interval: "day" | "week";
|
|
919
|
+
} | null;
|
|
903
920
|
sortOrder: number;
|
|
904
921
|
planGroupId: string | null;
|
|
905
922
|
metadata: Record<string, unknown> | null;
|
|
@@ -934,6 +951,8 @@ interface Plan {
|
|
|
934
951
|
price: number;
|
|
935
952
|
isDefault: boolean;
|
|
936
953
|
trialDays: number;
|
|
954
|
+
/** Whether the price's free trial needs a payment method to start. When false, a new subscription starts trialing right away without checkout; without a payment method added by the trial end, the customer moves to the plan group's default plan, or the subscription is canceled when there is none. Null when the price has no trial. */
|
|
955
|
+
trialRequiresPaymentMethod: boolean | null;
|
|
937
956
|
includedBalance: number | null;
|
|
938
957
|
includedCredits: number | null;
|
|
939
958
|
/** Automatic introductory offer for this price. Pass a Promotional Offer ID when creating a subscription to override it. */
|
|
@@ -1215,6 +1234,8 @@ interface PlanPrice {
|
|
|
1215
1234
|
price: number;
|
|
1216
1235
|
isDefault: boolean;
|
|
1217
1236
|
trialDays: number;
|
|
1237
|
+
/** Whether the price's free trial needs a payment method to start. When false, a new subscription starts trialing right away without checkout; without a payment method added by the trial end, the customer moves to the plan group's default plan, or the subscription is canceled when there is none. Null when the price has no trial. */
|
|
1238
|
+
trialRequiresPaymentMethod: boolean | null;
|
|
1218
1239
|
includedBalance: number | null;
|
|
1219
1240
|
includedCredits: number | null;
|
|
1220
1241
|
/** Automatic introductory offer for this price. */
|
|
@@ -1263,6 +1284,11 @@ interface PortalAccess {
|
|
|
1263
1284
|
object: "portal_session";
|
|
1264
1285
|
livemode: boolean;
|
|
1265
1286
|
}
|
|
1287
|
+
interface PrepaidPeriodsCheckout {
|
|
1288
|
+
checkoutUrl: string;
|
|
1289
|
+
object: "checkout_session";
|
|
1290
|
+
livemode: boolean;
|
|
1291
|
+
}
|
|
1266
1292
|
interface PreviewChange {
|
|
1267
1293
|
currency: string;
|
|
1268
1294
|
currentPlanCredit: number;
|
|
@@ -1337,6 +1363,10 @@ interface PromoCode {
|
|
|
1337
1363
|
expiresAt: string | null;
|
|
1338
1364
|
isActive: boolean;
|
|
1339
1365
|
redemptionCount: number;
|
|
1366
|
+
/** Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. */
|
|
1367
|
+
firstPurchaseOnly: boolean;
|
|
1368
|
+
/** Integration that manages this record, or null when the merchant does. While an integration manages it, its terms change only in that integration and edits answer 409 managed_by_integration. */
|
|
1369
|
+
managedBy: ManagedBy;
|
|
1340
1370
|
/** @format date-time */
|
|
1341
1371
|
createdAt: string;
|
|
1342
1372
|
/** @format date-time */
|
|
@@ -1515,6 +1545,8 @@ interface Subscription {
|
|
|
1515
1545
|
billingDayOfMonth: number | null;
|
|
1516
1546
|
nextBillingDate: string | null;
|
|
1517
1547
|
checkoutUrl: string | null;
|
|
1548
|
+
/** Whether Commet can charge this subscription on its own at its next charge (the trial end or the renewal). A trial that started without a payment method reports false until the customer adds one for this subscription; a payment method saved for another subscription does not count. A subscription on a free plan reports false. */
|
|
1549
|
+
hasPaymentMethod: boolean;
|
|
1518
1550
|
/** @format date-time */
|
|
1519
1551
|
createdAt: string;
|
|
1520
1552
|
/** @format date-time */
|
|
@@ -1624,6 +1656,30 @@ interface SubscriptionAddon {
|
|
|
1624
1656
|
object: "subscription_addon";
|
|
1625
1657
|
livemode: boolean;
|
|
1626
1658
|
}
|
|
1659
|
+
interface SubscriptionAutoTopUp {
|
|
1660
|
+
/** Whether credits are bought automatically. Always false when the plan does not sell credits. */
|
|
1661
|
+
enabled: boolean;
|
|
1662
|
+
/** Credits at or below which a top-up is bought, or null when never configured. */
|
|
1663
|
+
threshold: number | null;
|
|
1664
|
+
/** Credits each top-up buys, or null when never configured. */
|
|
1665
|
+
quantity: number | null;
|
|
1666
|
+
/** Maximum top-ups per credit renewal period, or null when never configured. */
|
|
1667
|
+
maxPerPeriod: number | null;
|
|
1668
|
+
/** active buys when credits reach the threshold; paused stops after three consecutive failed top-ups, or after one whose charge could not be refunded, until the payment method changes, a credit purchase succeeds or it is saved enabled again; off buys nothing. */
|
|
1669
|
+
status: "active" | "paused" | "off";
|
|
1670
|
+
/** Top-ups bought in the current credit renewal period. */
|
|
1671
|
+
topUpsThisPeriod: number;
|
|
1672
|
+
/** When the top-up count of the period resets, or null before the subscription starts its first period. */
|
|
1673
|
+
periodResetsAt: string | null;
|
|
1674
|
+
/** The last top-up that failed, or null when none has failed. */
|
|
1675
|
+
lastFailure: {
|
|
1676
|
+
reason: "payment_declined" | "no_payment_method" | "quantity_below_minimum" | "purchase_failed";
|
|
1677
|
+
/** @format date-time */
|
|
1678
|
+
at: string;
|
|
1679
|
+
} | null;
|
|
1680
|
+
object: "subscription_auto_top_up";
|
|
1681
|
+
livemode: boolean;
|
|
1682
|
+
}
|
|
1627
1683
|
interface SubscriptionOfferApplication {
|
|
1628
1684
|
id: string;
|
|
1629
1685
|
name: string;
|
|
@@ -1726,6 +1782,8 @@ interface SubscriptionSummary {
|
|
|
1726
1782
|
billingDayOfMonth: number | null;
|
|
1727
1783
|
nextBillingDate: string | null;
|
|
1728
1784
|
checkoutUrl: string | null;
|
|
1785
|
+
/** Whether Commet can charge this subscription on its own at its next charge (the trial end or the renewal). A trial that started without a payment method reports false until the customer adds one for this subscription; a payment method saved for another subscription does not count. A subscription on a free plan reports false. */
|
|
1786
|
+
hasPaymentMethod: boolean;
|
|
1729
1787
|
/** @format date-time */
|
|
1730
1788
|
createdAt: string;
|
|
1731
1789
|
/** @format date-time */
|
|
@@ -1816,7 +1874,7 @@ interface Transaction {
|
|
|
1816
1874
|
/** Charge context captured for new payments. Null for historical payments with no captured context. */
|
|
1817
1875
|
paymentContext: {
|
|
1818
1876
|
/** The original reason for the charge. Recovery never replaces this reason. */
|
|
1819
|
-
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
|
|
1877
|
+
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
|
|
1820
1878
|
/** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
|
|
1821
1879
|
paymentLinkId: string | null;
|
|
1822
1880
|
recovery: {
|
|
@@ -1861,7 +1919,7 @@ interface TransactionListItem {
|
|
|
1861
1919
|
/** Charge context captured for new payments. Null for historical payments with no captured context. */
|
|
1862
1920
|
paymentContext: {
|
|
1863
1921
|
/** The original reason for the charge. Recovery never replaces this reason. */
|
|
1864
|
-
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
|
|
1922
|
+
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
|
|
1865
1923
|
/** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
|
|
1866
1924
|
paymentLinkId: string | null;
|
|
1867
1925
|
recovery: {
|
|
@@ -1952,6 +2010,21 @@ type UsageCheck = {
|
|
|
1952
2010
|
planCredits: number;
|
|
1953
2011
|
purchasedCredits: number;
|
|
1954
2012
|
totalCredits: number;
|
|
2013
|
+
planCreditLimit: {
|
|
2014
|
+
/** The most plan credits the subscription spends per window. */
|
|
2015
|
+
credits: number;
|
|
2016
|
+
/** The window length: 24 hours for `day`, 7 days for `week`. */
|
|
2017
|
+
interval: "day" | "week";
|
|
2018
|
+
/** Plan credits spent in the current window. */
|
|
2019
|
+
spent: number;
|
|
2020
|
+
/** Plan credits the subscription can still spend in the current window. Purchased credits are not limited. */
|
|
2021
|
+
remaining: number;
|
|
2022
|
+
/**
|
|
2023
|
+
* When the next window starts and spending resets.
|
|
2024
|
+
* @format date-time
|
|
2025
|
+
*/
|
|
2026
|
+
resetsAt: string;
|
|
2027
|
+
} | null;
|
|
1955
2028
|
object: "usage_check";
|
|
1956
2029
|
livemode: boolean;
|
|
1957
2030
|
} | {
|
|
@@ -1989,6 +2062,22 @@ interface UsageEvent {
|
|
|
1989
2062
|
deducted: number;
|
|
1990
2063
|
remaining: number;
|
|
1991
2064
|
blocked: boolean;
|
|
2065
|
+
/** Credits consumption only, omitted for balance. The plan credit limit after this event; null when the plan has no limit. */
|
|
2066
|
+
planCreditLimit?: {
|
|
2067
|
+
/** The most plan credits the subscription spends per window. */
|
|
2068
|
+
credits: number;
|
|
2069
|
+
/** The window length: 24 hours for `day`, 7 days for `week`. */
|
|
2070
|
+
interval: "day" | "week";
|
|
2071
|
+
/** Plan credits spent in the current window. */
|
|
2072
|
+
spent: number;
|
|
2073
|
+
/** Plan credits the subscription can still spend in the current window. Purchased credits are not limited. */
|
|
2074
|
+
remaining: number;
|
|
2075
|
+
/**
|
|
2076
|
+
* When the next window starts and spending resets.
|
|
2077
|
+
* @format date-time
|
|
2078
|
+
*/
|
|
2079
|
+
resetsAt: string;
|
|
2080
|
+
} | null;
|
|
1992
2081
|
};
|
|
1993
2082
|
object: "usage_event";
|
|
1994
2083
|
livemode: boolean;
|
|
@@ -2393,6 +2482,8 @@ interface BatchCreateCustomersParams {
|
|
|
2393
2482
|
region?: string;
|
|
2394
2483
|
};
|
|
2395
2484
|
}>;
|
|
2485
|
+
/** Plan group whose starting plan the customer starts on when it has no open subscription: its signup trial, a trial without a payment method, when the group has one and the customer never had that plan, otherwise its default plan. A customer who already had the signup trial plan in a group without a default plan starts on none. Without it, no plan is assigned. */
|
|
2486
|
+
planGroupId?: string;
|
|
2396
2487
|
}
|
|
2397
2488
|
interface ListCustomersParams {
|
|
2398
2489
|
cursor?: string;
|
|
@@ -2417,6 +2508,8 @@ interface CreateCustomerParams {
|
|
|
2417
2508
|
email: string;
|
|
2418
2509
|
timezone?: Timezone;
|
|
2419
2510
|
metadata?: Record<string, unknown>;
|
|
2511
|
+
/** Plan group whose starting plan the customer starts on when it has no open subscription: its signup trial, a trial without a payment method, when the group has one and the customer never had that plan, otherwise its default plan. A customer who already had the signup trial plan in a group without a default plan starts on none. Without it, no plan is assigned. */
|
|
2512
|
+
planGroupId?: string;
|
|
2420
2513
|
}
|
|
2421
2514
|
declare class CustomersResource {
|
|
2422
2515
|
private httpClient;
|
|
@@ -2449,7 +2542,7 @@ declare class CustomersResource {
|
|
|
2449
2542
|
get(params: GetCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
2450
2543
|
/** Update a customer's name, external ID, or metadata. */
|
|
2451
2544
|
update(params: UpdateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
2452
|
-
/** Create up to 100 customers in a single request. */
|
|
2545
|
+
/** Create up to 100 customers in a single request. With planGroupId, each customer without an open subscription starts on that group's starting plan (see planGroupId), and the entry of a deleted customer fails with customer_deleted. */
|
|
2453
2546
|
createBatch(params: BatchCreateCustomersParams, options?: RequestOptions): Promise<CustomerBatch>;
|
|
2454
2547
|
/** List customers with cursor-based pagination. */
|
|
2455
2548
|
list(params?: ListCustomersParams, options?: RequestOptions): Promise<{
|
|
@@ -2458,7 +2551,7 @@ declare class CustomersResource {
|
|
|
2458
2551
|
hasMore: boolean;
|
|
2459
2552
|
nextCursor?: string;
|
|
2460
2553
|
}>;
|
|
2461
|
-
/** Create a new customer. Idempotent when customerId is provided. */
|
|
2554
|
+
/** Create a new customer. Idempotent when customerId is provided. With planGroupId, a customer without an open subscription starts on that group's starting plan (see planGroupId), and the externalId of a deleted customer is rejected. */
|
|
2462
2555
|
create(params: CreateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
2463
2556
|
}
|
|
2464
2557
|
|
|
@@ -2614,9 +2707,6 @@ interface UpdateOfferParams {
|
|
|
2614
2707
|
id: string;
|
|
2615
2708
|
name: string;
|
|
2616
2709
|
phases: Array<{
|
|
2617
|
-
type: "free_trial";
|
|
2618
|
-
durationDays: number;
|
|
2619
|
-
} | {
|
|
2620
2710
|
type: "percentage";
|
|
2621
2711
|
durationCycles: number | null;
|
|
2622
2712
|
/** Unit the phase duration is counted in. Only a fixed-price phase may set it, because its amount is declared rather than derived from the plan. Defaults to the plan's own billing interval. */
|
|
@@ -2660,9 +2750,6 @@ interface ListOffersParams {
|
|
|
2660
2750
|
interface CreateOfferParams {
|
|
2661
2751
|
name: string;
|
|
2662
2752
|
phases: Array<{
|
|
2663
|
-
type: "free_trial";
|
|
2664
|
-
durationDays: number;
|
|
2665
|
-
} | {
|
|
2666
2753
|
type: "percentage";
|
|
2667
2754
|
durationCycles: number | null;
|
|
2668
2755
|
/** Unit the phase duration is counted in. Only a fixed-price phase may set it, because its amount is declared rather than derived from the plan. Defaults to the plan's own billing interval. */
|
|
@@ -2899,6 +2986,8 @@ interface UpdatePlanPriceParams {
|
|
|
2899
2986
|
price?: number;
|
|
2900
2987
|
isDefault?: boolean;
|
|
2901
2988
|
trialDays?: number;
|
|
2989
|
+
/** Set to false so the price's free trial starts without a payment method. Requires trialDays on the price. */
|
|
2990
|
+
trialRequiresPaymentMethod?: boolean;
|
|
2902
2991
|
includedBalance?: number | null;
|
|
2903
2992
|
includedCredits?: number | null;
|
|
2904
2993
|
/** Metadata keys to merge into the existing price metadata. */
|
|
@@ -2919,6 +3008,8 @@ type AddPlanPriceParams = {
|
|
|
2919
3008
|
metadata?: Record<string, unknown>;
|
|
2920
3009
|
price: number;
|
|
2921
3010
|
trialDays?: number;
|
|
3011
|
+
/** Set to false so the price's free trial starts without a payment method. Requires trialDays on the price. */
|
|
3012
|
+
trialRequiresPaymentMethod?: boolean;
|
|
2922
3013
|
isDefault?: boolean;
|
|
2923
3014
|
includedBalance?: number | null;
|
|
2924
3015
|
includedCredits?: number | null;
|
|
@@ -2967,6 +3058,23 @@ interface UpdatePlanParams {
|
|
|
2967
3058
|
description?: string | null;
|
|
2968
3059
|
metadata?: Record<string, unknown>;
|
|
2969
3060
|
isPublic?: boolean;
|
|
3061
|
+
/** Credits plans only. What happens to unused plan credits at each reset. Existing subscriptions apply it from their next reset. */
|
|
3062
|
+
unusedPlanCredits?: {
|
|
3063
|
+
type: "expire";
|
|
3064
|
+
} | {
|
|
3065
|
+
type: "roll_over";
|
|
3066
|
+
/** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
|
|
3067
|
+
maxPlanCredits: number | null;
|
|
3068
|
+
};
|
|
3069
|
+
/** Credits plans only. The most plan credits a subscription spends per day or per week; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period. */
|
|
3070
|
+
planCreditLimit?: {
|
|
3071
|
+
/** The most plan credits a subscription spends in one window. */
|
|
3072
|
+
credits: number;
|
|
3073
|
+
/** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
|
|
3074
|
+
interval: "day" | "week";
|
|
3075
|
+
} | null;
|
|
3076
|
+
/** Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan in a plan group; replaces the group's previous default plan. false unmarks it. */
|
|
3077
|
+
isDefault?: boolean;
|
|
2970
3078
|
}
|
|
2971
3079
|
interface DeletePlanParams {
|
|
2972
3080
|
id: string;
|
|
@@ -2986,7 +3094,24 @@ interface CreatePlanParams {
|
|
|
2986
3094
|
isPublic?: boolean;
|
|
2987
3095
|
isFree?: boolean;
|
|
2988
3096
|
blockOnExhaustion?: boolean;
|
|
3097
|
+
/** Credits plans only. What happens to unused plan credits at each reset; omitted means they expire. */
|
|
3098
|
+
unusedPlanCredits?: {
|
|
3099
|
+
type: "expire";
|
|
3100
|
+
} | {
|
|
3101
|
+
type: "roll_over";
|
|
3102
|
+
/** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
|
|
3103
|
+
maxPlanCredits: number | null;
|
|
3104
|
+
};
|
|
3105
|
+
/** Credits plans only. The most plan credits a subscription spends per day or per week; omitted or null means no limit. */
|
|
3106
|
+
planCreditLimit?: {
|
|
3107
|
+
/** The most plan credits a subscription spends in one window. */
|
|
3108
|
+
credits: number;
|
|
3109
|
+
/** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
|
|
3110
|
+
interval: "day" | "week";
|
|
3111
|
+
} | null;
|
|
2989
3112
|
planGroupId?: string;
|
|
3113
|
+
/** Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan with a planGroupId; replaces the group's previous default plan. */
|
|
3114
|
+
isDefault?: boolean;
|
|
2990
3115
|
metadata?: Record<string, unknown>;
|
|
2991
3116
|
}
|
|
2992
3117
|
declare class PlansResource {
|
|
@@ -3014,7 +3139,7 @@ declare class PlansResource {
|
|
|
3014
3139
|
setRegionalPricing(params: SetPlanRegionalPricingParams, options?: RequestOptions): Promise<PlanRegionalPricingResult>;
|
|
3015
3140
|
/** Get a plan with public price IDs and their automatic introductory offer IDs. */
|
|
3016
3141
|
get(params: GetPlanParams, options?: RequestOptions): Promise<Plan>;
|
|
3017
|
-
/** Update a plan's name, description, visibility, or
|
|
3142
|
+
/** Update a plan's name, description, visibility, default status, metadata, what happens to its unused plan credits, or its plan credit limit. */
|
|
3018
3143
|
update(params: UpdatePlanParams, options?: RequestOptions): Promise<Plan>;
|
|
3019
3144
|
/** Soft-delete a plan. */
|
|
3020
3145
|
delete(params: DeletePlanParams, options?: RequestOptions): Promise<DeletedObject>;
|
|
@@ -3055,6 +3180,8 @@ interface UpdatePromoCodeParams {
|
|
|
3055
3180
|
expiresAt?: string | null;
|
|
3056
3181
|
active?: boolean;
|
|
3057
3182
|
planIds?: Array<string>;
|
|
3183
|
+
/** Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. */
|
|
3184
|
+
firstPurchaseOnly?: boolean;
|
|
3058
3185
|
}
|
|
3059
3186
|
interface ListPromoCodesParams {
|
|
3060
3187
|
cursor?: string;
|
|
@@ -3068,6 +3195,8 @@ interface CreatePromoCodeParams {
|
|
|
3068
3195
|
/** @format date-time */
|
|
3069
3196
|
expiresAt?: string;
|
|
3070
3197
|
planIds?: Array<string>;
|
|
3198
|
+
/** Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. Defaults to false. */
|
|
3199
|
+
firstPurchaseOnly?: boolean;
|
|
3071
3200
|
}
|
|
3072
3201
|
declare class PromoCodesResource {
|
|
3073
3202
|
private httpClient;
|
|
@@ -3083,7 +3212,7 @@ declare class PromoCodesResource {
|
|
|
3083
3212
|
hasMore: boolean;
|
|
3084
3213
|
nextCursor?: string;
|
|
3085
3214
|
}>;
|
|
3086
|
-
/** Create a distribution code for an existing Offer with one or more sequential discount phases
|
|
3215
|
+
/** Create a distribution code for an existing Offer with one or more sequential discount phases. The code owns redemption restrictions. */
|
|
3087
3216
|
create(params: CreatePromoCodeParams, options?: RequestOptions): Promise<PromoCode>;
|
|
3088
3217
|
}
|
|
3089
3218
|
|
|
@@ -3204,6 +3333,16 @@ interface ActivateAddonParams {
|
|
|
3204
3333
|
id: string;
|
|
3205
3334
|
addonId: string;
|
|
3206
3335
|
}
|
|
3336
|
+
interface GetSubscriptionAutoTopUpParams {
|
|
3337
|
+
id: string;
|
|
3338
|
+
}
|
|
3339
|
+
interface UpdateSubscriptionAutoTopUpParams {
|
|
3340
|
+
id: string;
|
|
3341
|
+
enabled?: boolean;
|
|
3342
|
+
threshold?: number;
|
|
3343
|
+
quantity?: number;
|
|
3344
|
+
maxPerPeriod?: number;
|
|
3345
|
+
}
|
|
3207
3346
|
interface AdjustBalanceParams {
|
|
3208
3347
|
id: string;
|
|
3209
3348
|
amount: number;
|
|
@@ -3219,17 +3358,30 @@ interface CancelSubscriptionParams {
|
|
|
3219
3358
|
reason?: string;
|
|
3220
3359
|
immediate?: boolean;
|
|
3221
3360
|
}
|
|
3222
|
-
|
|
3361
|
+
type ChangePlanParams = {
|
|
3223
3362
|
id: string;
|
|
3224
3363
|
newPlanId?: string;
|
|
3225
3364
|
newBillingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
|
|
3226
3365
|
successUrl?: string;
|
|
3227
3366
|
offerId?: string;
|
|
3228
|
-
|
|
3229
|
-
|
|
3367
|
+
promoCode?: never;
|
|
3368
|
+
} | {
|
|
3369
|
+
id: string;
|
|
3370
|
+
newPlanId?: string;
|
|
3371
|
+
newBillingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
|
|
3372
|
+
successUrl?: string;
|
|
3373
|
+
offerId?: never;
|
|
3374
|
+
/** Promo code whose Offer prices the change, validated with the checkout's rules: a code the checkout would refuse returns 400 validation_error with the checkout's reason in details.reason. Cannot be combined with offerId. */
|
|
3375
|
+
promoCode: string;
|
|
3376
|
+
};
|
|
3377
|
+
type PurchaseCreditsParams = {
|
|
3230
3378
|
id: string;
|
|
3231
3379
|
creditPackId: string;
|
|
3232
|
-
|
|
3380
|
+
quantity?: never;
|
|
3381
|
+
} | {
|
|
3382
|
+
id: string;
|
|
3383
|
+
quantity: number;
|
|
3384
|
+
};
|
|
3233
3385
|
interface ApplySubscriptionOfferParams {
|
|
3234
3386
|
id: string;
|
|
3235
3387
|
offerId: string;
|
|
@@ -3255,12 +3407,28 @@ interface UpdatePaymentMethodParams {
|
|
|
3255
3407
|
id: string;
|
|
3256
3408
|
successUrl?: string;
|
|
3257
3409
|
}
|
|
3258
|
-
interface
|
|
3410
|
+
interface CreatePrepaidPeriodsCheckoutParams {
|
|
3411
|
+
id: string;
|
|
3412
|
+
/** Active subscriptions: billing periods to add after the last paid period. Pending-payment subscriptions: total billing periods the first payment covers, including the current one. */
|
|
3413
|
+
periods: number;
|
|
3414
|
+
/** Offer applied from the first added period for its full configured duration. Active subscriptions only; assign an Offer to a pending-payment subscription with PUT /subscriptions/{id}/offer. */
|
|
3415
|
+
offerId?: string;
|
|
3416
|
+
successUrl?: string;
|
|
3417
|
+
}
|
|
3418
|
+
type PreviewChangePlanParams = {
|
|
3259
3419
|
id: string;
|
|
3260
3420
|
planId: string;
|
|
3261
3421
|
billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
|
|
3262
3422
|
offerId?: string;
|
|
3263
|
-
|
|
3423
|
+
promoCode?: never;
|
|
3424
|
+
} | {
|
|
3425
|
+
id: string;
|
|
3426
|
+
planId: string;
|
|
3427
|
+
billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
|
|
3428
|
+
offerId?: never;
|
|
3429
|
+
/** Promo code whose Offer prices the change, validated with the checkout's rules: a code the checkout would refuse returns 400 validation_error with the checkout's reason in details.reason. Cannot be combined with offerId. */
|
|
3430
|
+
promoCode: string;
|
|
3431
|
+
};
|
|
3264
3432
|
interface ReactivateSubscriptionParams {
|
|
3265
3433
|
id: string;
|
|
3266
3434
|
offerId?: string;
|
|
@@ -3274,6 +3442,9 @@ interface ResumeSubscriptionParams {
|
|
|
3274
3442
|
interface GetSubscriptionParams {
|
|
3275
3443
|
id: string;
|
|
3276
3444
|
}
|
|
3445
|
+
interface RevokeScheduledPlanChangeParams {
|
|
3446
|
+
id: string;
|
|
3447
|
+
}
|
|
3277
3448
|
interface UncancelSubscriptionParams {
|
|
3278
3449
|
id: string;
|
|
3279
3450
|
}
|
|
@@ -3296,8 +3467,13 @@ type CreateSubscriptionParams = {
|
|
|
3296
3467
|
/** @format date-time */
|
|
3297
3468
|
startDate?: string;
|
|
3298
3469
|
successUrl?: string;
|
|
3470
|
+
/** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
|
|
3471
|
+
prepaidPeriods?: number;
|
|
3472
|
+
/** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
|
|
3473
|
+
cancelAtPeriodEnd?: boolean;
|
|
3299
3474
|
offerId?: never;
|
|
3300
3475
|
promoCode?: string;
|
|
3476
|
+
/** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
|
|
3301
3477
|
customTrialDays?: number;
|
|
3302
3478
|
skipTrial?: boolean;
|
|
3303
3479
|
planId: string;
|
|
@@ -3313,8 +3489,13 @@ type CreateSubscriptionParams = {
|
|
|
3313
3489
|
/** @format date-time */
|
|
3314
3490
|
startDate?: string;
|
|
3315
3491
|
successUrl?: string;
|
|
3492
|
+
/** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
|
|
3493
|
+
prepaidPeriods?: number;
|
|
3494
|
+
/** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
|
|
3495
|
+
cancelAtPeriodEnd?: boolean;
|
|
3316
3496
|
offerId?: never;
|
|
3317
3497
|
promoCode?: string;
|
|
3498
|
+
/** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
|
|
3318
3499
|
customTrialDays?: number;
|
|
3319
3500
|
skipTrial?: boolean;
|
|
3320
3501
|
planCode: string;
|
|
@@ -3330,10 +3511,15 @@ type CreateSubscriptionParams = {
|
|
|
3330
3511
|
/** @format date-time */
|
|
3331
3512
|
startDate?: string;
|
|
3332
3513
|
successUrl?: string;
|
|
3514
|
+
/** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
|
|
3515
|
+
prepaidPeriods?: number;
|
|
3516
|
+
/** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
|
|
3517
|
+
cancelAtPeriodEnd?: boolean;
|
|
3333
3518
|
offerId: string;
|
|
3334
3519
|
promoCode?: never;
|
|
3335
|
-
|
|
3336
|
-
|
|
3520
|
+
/** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
|
|
3521
|
+
customTrialDays?: number;
|
|
3522
|
+
skipTrial?: boolean;
|
|
3337
3523
|
planId: string;
|
|
3338
3524
|
} | {
|
|
3339
3525
|
customerId: string;
|
|
@@ -3347,10 +3533,15 @@ type CreateSubscriptionParams = {
|
|
|
3347
3533
|
/** @format date-time */
|
|
3348
3534
|
startDate?: string;
|
|
3349
3535
|
successUrl?: string;
|
|
3536
|
+
/** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
|
|
3537
|
+
prepaidPeriods?: number;
|
|
3538
|
+
/** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
|
|
3539
|
+
cancelAtPeriodEnd?: boolean;
|
|
3350
3540
|
offerId: string;
|
|
3351
3541
|
promoCode?: never;
|
|
3352
|
-
|
|
3353
|
-
|
|
3542
|
+
/** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
|
|
3543
|
+
customTrialDays?: number;
|
|
3544
|
+
skipTrial?: boolean;
|
|
3354
3545
|
planCode: string;
|
|
3355
3546
|
} | {
|
|
3356
3547
|
customerId: string;
|
|
@@ -3364,6 +3555,10 @@ type CreateSubscriptionParams = {
|
|
|
3364
3555
|
/** @format date-time */
|
|
3365
3556
|
startDate?: string;
|
|
3366
3557
|
successUrl?: string;
|
|
3558
|
+
/** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
|
|
3559
|
+
prepaidPeriods?: number;
|
|
3560
|
+
/** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
|
|
3561
|
+
cancelAtPeriodEnd?: boolean;
|
|
3367
3562
|
offerId?: never;
|
|
3368
3563
|
/** Public card promotion ID. The offer is shown immediately and remains conditional on card eligibility until checkout confirmation. */
|
|
3369
3564
|
cardPromotionId: string;
|
|
@@ -3383,6 +3578,10 @@ type CreateSubscriptionParams = {
|
|
|
3383
3578
|
/** @format date-time */
|
|
3384
3579
|
startDate?: string;
|
|
3385
3580
|
successUrl?: string;
|
|
3581
|
+
/** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
|
|
3582
|
+
prepaidPeriods?: number;
|
|
3583
|
+
/** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
|
|
3584
|
+
cancelAtPeriodEnd?: boolean;
|
|
3386
3585
|
offerId?: never;
|
|
3387
3586
|
/** Public card promotion ID. The offer is shown immediately and remains conditional on card eligibility until checkout confirmation. */
|
|
3388
3587
|
cardPromotionId: string;
|
|
@@ -3398,17 +3597,21 @@ declare class SubscriptionsResource {
|
|
|
3398
3597
|
deactivateAddon(params: DeactivateAddonParams, options?: RequestOptions): Promise<DeletedSubscriptionAddon>;
|
|
3399
3598
|
/** Activate an add-on on a subscription. Charges a prorated amount for the current billing period. */
|
|
3400
3599
|
activateAddon(params: ActivateAddonParams, options?: RequestOptions): Promise<SubscriptionAddon>;
|
|
3600
|
+
/** Read whether the subscription buys credits automatically with its saved payment method when credits reach a threshold, with the top-ups used this period and the last failure. */
|
|
3601
|
+
getAutoTopUp(params: GetSubscriptionAutoTopUpParams, options?: RequestOptions): Promise<SubscriptionAutoTopUp>;
|
|
3602
|
+
/** Turn automatic credit purchases on or off and set the threshold, the credits each top-up buys and the maximum top-ups per period. Send only the fields that change. Enabling requires a plan that sells credits. The quantity must be at least the plan's purchase minimum when auto top-up is enabled or when the quantity changes, so turning it off keeps working after the minimum rises. Saving it enabled resumes a paused auto top-up. */
|
|
3603
|
+
updateAutoTopUp(params: UpdateSubscriptionAutoTopUpParams, options?: RequestOptions): Promise<SubscriptionAutoTopUp>;
|
|
3401
3604
|
/** Adjust a subscription's balance or credits by a signed amount. Positive adds, negative subtracts. */
|
|
3402
3605
|
adjustBalance(params: AdjustBalanceParams, options?: RequestOptions): Promise<BalanceAdjustment>;
|
|
3403
3606
|
/** Top up a subscription's balance. Charges the customer's payment method for the specified amount. */
|
|
3404
3607
|
topupBalance(params: TopupBalanceParams, options?: RequestOptions): Promise<BalanceTopup>;
|
|
3405
3608
|
/** Cancel immediately or at period end and return the updated subscription. */
|
|
3406
3609
|
cancel(params: CancelSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
|
|
3407
|
-
/** Upgrade or change billing interval immediately, optionally applying an Offer. Scheduled changes
|
|
3610
|
+
/** Upgrade or change billing interval immediately, optionally applying an Offer by offerId or the Offer of a promoCode. Scheduled changes accept neither offerId nor promoCode. From a free plan, a promoCode opens the checkout with the code applied and counts its use when the checkout is paid; without offerId or promoCode, a destination price whose free trial requires no payment method starts that trial right away without checkout. During a trial without a payment method, an immediate change returns 409 no_payment_method; scheduled changes still apply. */
|
|
3408
3611
|
changePlan(params: ChangePlanParams, options?: RequestOptions): Promise<PlanChange>;
|
|
3409
|
-
/** Purchase a credit pack
|
|
3612
|
+
/** Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Charges the saved payment method and adds purchased credits. */
|
|
3410
3613
|
purchaseCredits(params: PurchaseCreditsParams, options?: RequestOptions): Promise<CreditGrant>;
|
|
3411
|
-
/** Apply a direct Offer to a subscription. On a pending
|
|
3614
|
+
/** Apply a direct Offer to a subscription. On a pending checkout it quotes or replaces the checkout discount, which starts after the plan price trial when there is one, and the existing checkout URL remains unchanged. On an active subscription it applies the Offer immediately with its discount phases starting at the next billing cycle; the call is rejected while another applied Offer still has active or upcoming discount phases. */
|
|
3412
3615
|
applyOffer(params: ApplySubscriptionOfferParams, options?: RequestOptions): Promise<Subscription>;
|
|
3413
3616
|
/** Remove the quoted direct Offer from a subscription's pending payment checkout. The existing checkout URL remains unchanged and returns to its undiscounted price. */
|
|
3414
3617
|
removeOffer(params: RemoveSubscriptionOfferParams, options?: RequestOptions): Promise<Subscription>;
|
|
@@ -3418,9 +3621,11 @@ declare class SubscriptionsResource {
|
|
|
3418
3621
|
updatePause(params: UpdateSubscriptionPauseParams, options?: RequestOptions): Promise<Subscription>;
|
|
3419
3622
|
/** Revoke a pause before it becomes effective. Active pauses must be resumed instead. */
|
|
3420
3623
|
revokePause(params: RevokeSubscriptionPauseParams, options?: RequestOptions): Promise<Subscription>;
|
|
3421
|
-
/** Creates a hosted checkout
|
|
3624
|
+
/** Creates a hosted checkout to update the payment method of an active, trialing or past_due subscription. Pending-payment subscriptions must use their payment checkout. */
|
|
3422
3625
|
updatePaymentMethod(params: UpdatePaymentMethodParams, options?: RequestOptions): Promise<PaymentMethodUpdateCheckout>;
|
|
3423
|
-
/**
|
|
3626
|
+
/** Creates a hosted checkout to pay billing periods of a recurring subscription in advance with any payment method. On an active subscription the paid periods start after the last paid period and replace any open prepaid-periods checkout. On a pending-payment subscription the first payment covers the requested periods and replaces its pending checkout. The billing interval does not change. */
|
|
3627
|
+
createPrepaidPeriodsCheckout(params: CreatePrepaidPeriodsCheckoutParams, options?: RequestOptions): Promise<PrepaidPeriodsCheckout>;
|
|
3628
|
+
/** Preview proration details for an immediate plan change without applying it. Free-to-paid changes are never scheduled and the change-plan endpoint returns hosted checkout for them, except a change without offerId or promoCode to a price whose free trial needs no payment method, for a customer who never had that plan: it starts the trial at once, so the preview reports nothing due today. For paid plans, interval direction takes precedence: a longer interval is immediate and a shorter interval is scheduled. When the interval is unchanged, a higher-sort-order plan is immediate and a lower-sort-order plan is scheduled. A paid-to-free change is always scheduled. Returns credit, charge, and net amount. The target plan must belong to the same plan group as the current plan, otherwise a 400 with code `plans_not_in_same_group` is returned. A change between two free plans has nothing to prorate and returns a zero-amount estimate. Scheduled changes return a 400 with code `plan_change_scheduled`; apply those via the change-plan endpoint. Pass offerId to quote the destination plan with an Offer, or promoCode to quote it with the Offer of a promo code validated with the checkout's rules. */
|
|
3424
3629
|
previewChange(params: PreviewChangePlanParams, options?: RequestOptions): Promise<PreviewChange>;
|
|
3425
3630
|
/** Reactivates a subscription. A past_due subscription retries its outstanding renewal charge (recovering to active on success). A canceled subscription generates a fresh invoice, charges the saved card, and resets the billing period. On a successful charge the subscription becomes active; a declined charge returns an error with a recoveryUrl in the error details that can be sent to the customer to update their card. A canceled subscription may apply an Offer by offerId; past-due recovery cannot. */
|
|
3426
3631
|
reactivate(params: ReactivateSubscriptionParams, options?: RequestOptions): Promise<ReactivatedSubscription>;
|
|
@@ -3430,6 +3635,8 @@ declare class SubscriptionsResource {
|
|
|
3430
3635
|
resume(params: ResumeSubscriptionParams, options?: RequestOptions): Promise<SubscriptionResume>;
|
|
3431
3636
|
/** Get a subscription by its public ID, regardless of status (including pending_payment and past_due). */
|
|
3432
3637
|
get(params: GetSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
|
|
3638
|
+
/** Revoke the plan or interval change scheduled for the end of the period, so the subscription stays on its current plan. Returns the updated subscription. */
|
|
3639
|
+
revokeScheduledPlanChange(params: RevokeScheduledPlanChangeParams, options?: RequestOptions): Promise<Subscription>;
|
|
3433
3640
|
/** Revert a scheduled cancellation and return the updated subscription. Only works before cancellation takes effect. */
|
|
3434
3641
|
uncancel(params: UncancelSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
|
|
3435
3642
|
/** Get the active subscription for a customer. Returns null if none. */
|
|
@@ -3441,7 +3648,7 @@ declare class SubscriptionsResource {
|
|
|
3441
3648
|
hasMore: boolean;
|
|
3442
3649
|
nextCursor?: string;
|
|
3443
3650
|
}>;
|
|
3444
|
-
/** Create a subscription for a customer. Commet selects the default price when priceId is omitted. The subscription starts at the base USD price; market and currency are resolved from the buyer's request country when the checkout opens. Without an offer override, Commet applies the price's automatic introductory Offer. Pass offerId to apply an active compatible Offer directly, or cardPromotionId to preselect a card-eligible Promotional Offer for the initial checkout when card promotions are enabled for the organization. For the initial checkout, provider accepts either a processor name or an exact payment connection ID. */
|
|
3651
|
+
/** Create a subscription for a customer. Commet selects the default price when priceId is omitted. The subscription starts at the base USD price; market and currency are resolved from the buyer's request country when the checkout opens. Without an offer override, Commet applies the price's automatic introductory Offer. Pass offerId to apply an active compatible Offer directly, or cardPromotionId to preselect a card-eligible Promotional Offer for the initial checkout when card promotions are enabled for the organization. For the initial checkout, provider accepts either a processor name or an exact payment connection ID. When the price's free trial requires no payment method, the subscription starts trialing right away with no checkout (checkoutUrl null, hasPaymentMethod false); it cannot be combined with offerId, promoCode, cardPromotionId or provider, and an organization that cannot charge yet receives 403. */
|
|
3445
3652
|
create(params: CreateSubscriptionParams, options?: RequestOptions): Promise<CreatedSubscription>;
|
|
3446
3653
|
}
|
|
3447
3654
|
|
|
@@ -3580,7 +3787,7 @@ declare class GeneratedResources {
|
|
|
3580
3787
|
}
|
|
3581
3788
|
|
|
3582
3789
|
type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
|
|
3583
|
-
/** Fired when a subscription record is created with status pending_payment
|
|
3790
|
+
/** Fired when a subscription record is created, usually with status pending_payment: the first charge has not been confirmed yet — do NOT grant access here; wait for subscription.activated. A trial whose price requires no payment method is created already trialing, together with trial.started. */
|
|
3584
3791
|
interface SubscriptionCreatedData {
|
|
3585
3792
|
/** The subscription ID. */
|
|
3586
3793
|
subscriptionId: string;
|
|
@@ -3752,7 +3959,7 @@ interface SubscriptionCanceledData {
|
|
|
3752
3959
|
status: string;
|
|
3753
3960
|
/** ISO 8601 datetime when the cancellation was requested or triggered. */
|
|
3754
3961
|
canceledAt?: string;
|
|
3755
|
-
/** The reason for cancellation, if provided. Set to "dunning_exhausted" when all payment retries fail. Historical refund-triggered cancellations may have "refund". */
|
|
3962
|
+
/** The reason for cancellation, if provided. Set to "dunning_exhausted" when all payment retries fail, and to "trial_ended_without_payment_method" when a trial without a payment method ends with no card and no default plan. Historical refund-triggered cancellations may have "refund". */
|
|
3756
3963
|
cancelReason: string | null;
|
|
3757
3964
|
/** ISO 8601 datetime when the subscription ended. Matches the billing period end for scheduled cancellations; for immediate terminations it is the moment of termination. */
|
|
3758
3965
|
endDate?: string;
|
|
@@ -3836,7 +4043,7 @@ interface SubscriptionPlanChangeScheduledData {
|
|
|
3836
4043
|
/** ISO 8601 datetime when the change executes (the billing period end). */
|
|
3837
4044
|
effectiveAt: string;
|
|
3838
4045
|
}
|
|
3839
|
-
/** Fired when a scheduled plan change
|
|
4046
|
+
/** Fired when a scheduled plan change will no longer take effect: it was revoked through the API, the dashboard or the customer portal, an immediate plan change or an immediate cancellation voided it, or a different change replaced it. A replacement also fires subscription.plan_change_scheduled with the new target plan. */
|
|
3840
4047
|
interface SubscriptionPlanChangeRevokedData {
|
|
3841
4048
|
/** The subscription ID. */
|
|
3842
4049
|
subscriptionId: string;
|
|
@@ -3866,7 +4073,7 @@ interface SubscriptionPastDueData {
|
|
|
3866
4073
|
/** The human-readable invoice number. */
|
|
3867
4074
|
invoiceNumber: string;
|
|
3868
4075
|
}
|
|
3869
|
-
/** Fired when a subscription enters its trial period after checkout. Grant access here — trialing subscriptions have full access until trialEndsAt. */
|
|
4076
|
+
/** Fired when a subscription enters its trial period: after checkout, or right away when the price's trial requires no payment method. Grant access here — trialing subscriptions have full access until trialEndsAt. */
|
|
3870
4077
|
interface TrialStartedData {
|
|
3871
4078
|
/** The subscription ID. */
|
|
3872
4079
|
subscriptionId: string;
|
|
@@ -3894,7 +4101,7 @@ interface TrialConvertedData {
|
|
|
3894
4101
|
/** The plan name. */
|
|
3895
4102
|
planName: string;
|
|
3896
4103
|
}
|
|
3897
|
-
/** Fired when a trial period runs out
|
|
4104
|
+
/** Fired when a trial period runs out. With a payment method the billing cycle activates the subscription and generates the first regular invoice right after — the natural trial-to-paid transition. A trial without a payment method instead moves to the plan group's default plan (subscription.plan_changed) or is canceled with cancelReason trial_ended_without_payment_method (subscription.canceled), without an invoice. */
|
|
3898
4105
|
interface TrialExpiredData {
|
|
3899
4106
|
/** The subscription ID. */
|
|
3900
4107
|
subscriptionId: string;
|
|
@@ -3924,7 +4131,7 @@ interface TrialWillEndData {
|
|
|
3924
4131
|
/** ISO 8601 datetime when the trial will end. */
|
|
3925
4132
|
trialEndsAt: string;
|
|
3926
4133
|
}
|
|
3927
|
-
/** Fired when a trial checkout link is ready to share with the customer. Completing this checkout saves a payment method and starts the trial (trial.started) — the customer is not charged until the trial ends. */
|
|
4134
|
+
/** Fired when a trial checkout link is ready to share with the customer. Completing this checkout saves a payment method and starts the trial (trial.started) — the customer is not charged until the trial ends. Not fired for a trial whose price requires no payment method, which starts without checkout. */
|
|
3928
4135
|
interface TrialCheckoutReadyData {
|
|
3929
4136
|
/** The subscription ID. */
|
|
3930
4137
|
subscriptionId: string;
|
|
@@ -3959,7 +4166,7 @@ interface PaymentReceivedData {
|
|
|
3959
4166
|
/** Charge context captured for new payments. Null for historical payments with no captured context. */
|
|
3960
4167
|
paymentContext: {
|
|
3961
4168
|
/** The original reason for the charge. Recovery never replaces this reason. */
|
|
3962
|
-
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
|
|
4169
|
+
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
|
|
3963
4170
|
/** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
|
|
3964
4171
|
paymentLinkId: string | null;
|
|
3965
4172
|
recovery: {
|
|
@@ -4006,7 +4213,7 @@ interface PaymentFailedData {
|
|
|
4006
4213
|
/** Charge context captured for new payments. Null for historical payments with no captured context. */
|
|
4007
4214
|
paymentContext: {
|
|
4008
4215
|
/** The original reason for the charge. Recovery never replaces this reason. */
|
|
4009
|
-
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
|
|
4216
|
+
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
|
|
4010
4217
|
/** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
|
|
4011
4218
|
paymentLinkId: string | null;
|
|
4012
4219
|
recovery: {
|
|
@@ -4163,7 +4370,7 @@ interface PaymentLinkCompletedData {
|
|
|
4163
4370
|
/** Charge context captured for new payments. Null for historical payments with no captured context. */
|
|
4164
4371
|
paymentContext: {
|
|
4165
4372
|
/** The original reason for the charge. Recovery never replaces this reason. */
|
|
4166
|
-
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
|
|
4373
|
+
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
|
|
4167
4374
|
/** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
|
|
4168
4375
|
paymentLinkId: string | null;
|
|
4169
4376
|
recovery: {
|
|
@@ -4204,7 +4411,7 @@ interface PaymentLinkFailedData {
|
|
|
4204
4411
|
/** Charge context captured for new payments. Null for historical payments with no captured context. */
|
|
4205
4412
|
paymentContext: {
|
|
4206
4413
|
/** The original reason for the charge. Recovery never replaces this reason. */
|
|
4207
|
-
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
|
|
4414
|
+
reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
|
|
4208
4415
|
/** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
|
|
4209
4416
|
paymentLinkId: string | null;
|
|
4210
4417
|
recovery: {
|
|
@@ -4846,7 +5053,7 @@ interface PlanGrantRevokedData {
|
|
|
4846
5053
|
/** The grant timeline through the represented transition. */
|
|
4847
5054
|
events: Array<WebhookPlanGrantTimelineEvent>;
|
|
4848
5055
|
}
|
|
4849
|
-
/** Fired when non-purchase credits are granted to a subscription: plan-included credits at the start of each billing period, or a manual adjustment from the dashboard. Credit
|
|
5056
|
+
/** Fired when non-purchase credits are granted to a subscription: plan-included credits at the start of each billing period, or a manual adjustment from the dashboard. Credit purchases through the API, automatic top-ups, or the customer portal fire credits.purchased instead. */
|
|
4850
5057
|
interface CreditsGrantedData {
|
|
4851
5058
|
/** The subscription ID. */
|
|
4852
5059
|
subscriptionId: string;
|
|
@@ -4857,7 +5064,7 @@ interface CreditsGrantedData {
|
|
|
4857
5064
|
/** Why the credits were granted: period_reset or manual_adjustment. */
|
|
4858
5065
|
reason: string;
|
|
4859
5066
|
}
|
|
4860
|
-
/** Fired when a customer buys a credit pack through the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets. Plan-included credit grants fire credits.granted instead. */
|
|
5067
|
+
/** Fired when a customer buys a credit pack or a chosen quantity of credits through the API, an automatic top-up, or the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets. Plan-included credit grants fire credits.granted instead. */
|
|
4861
5068
|
interface CreditsPurchasedData {
|
|
4862
5069
|
/** The subscription ID. */
|
|
4863
5070
|
subscriptionId: string;
|
|
@@ -4867,7 +5074,7 @@ interface CreditsPurchasedData {
|
|
|
4867
5074
|
invoiceId: string;
|
|
4868
5075
|
/** The human-readable invoice number. */
|
|
4869
5076
|
invoiceNumber: string;
|
|
4870
|
-
/** The purchased credit pack's name. */
|
|
5077
|
+
/** The purchased credit pack's name, or Credit purchase for a chosen quantity of credits. */
|
|
4871
5078
|
creditPackName: string;
|
|
4872
5079
|
/** The number of credits purchased. */
|
|
4873
5080
|
credits: number;
|
|
@@ -4894,13 +5101,13 @@ interface CreditsDepletedData {
|
|
|
4894
5101
|
/** Credits remaining after depletion. Always 0. */
|
|
4895
5102
|
remainingCredits: number;
|
|
4896
5103
|
}
|
|
4897
|
-
/** Fired at
|
|
5104
|
+
/** Fired at a reset when unused plan credits are discarded. On a plan whose unused plan credits expire, every unused plan credit expires at each reset. On a plan that rolls them over, a reset keeps them, up to the plan's maxPlanCredits when it has one, and only the excess expires. A change to another credits plan applies the new plan's terms the same way. Purchased credits never expire and are not affected. */
|
|
4898
5105
|
interface CreditsExpiredData {
|
|
4899
5106
|
/** The subscription ID. */
|
|
4900
5107
|
subscriptionId: string;
|
|
4901
5108
|
/** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
|
|
4902
5109
|
customerId: string;
|
|
4903
|
-
/** The
|
|
5110
|
+
/** The plan credits that were discarded. */
|
|
4904
5111
|
expiredCredits: number;
|
|
4905
5112
|
}
|
|
4906
5113
|
/** Fired when a customer on a balance plan tops up their prepaid balance through the customer portal and the payment succeeds. */
|
|
@@ -5273,4 +5480,4 @@ declare function registerIntegration(name: string, version: string): void;
|
|
|
5273
5480
|
declare const API_VERSION = "2026-08-27";
|
|
5274
5481
|
declare const SDK_VERSION: string;
|
|
5275
5482
|
|
|
5276
|
-
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApplySubscriptionOfferParams, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSetSeatsParams, type CancelPaymentParams, type CancelSubscriptionParams, type ChangePlanParams, type ChargePaymentParams, type CheckUsageAvailabilityParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, type CommetErrorContext, CommetValidationError, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerCreditParams, type CreateCustomerParams, type CreateFeatureParams, type CreateMarketParams, type CreateOfferParams, type CreatePaymentParams, type CreatePlanGrantParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookEndpointParams, type CreatedApiKey, type CreatedSubscription, type CreatedWebhook, type CreditGrant, type CreditPack, type CreditPackListItem, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerCredit, type CustomerCreditRevocation, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeleteMarketParams, type DeleteOfferParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookEndpointParams, type DeletedObject, type DeletedOffer, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DownloadInvoiceParams, type Feature, type FeatureAccess, type FeatureDef, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetMarketParams, type GetOfferParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookEndpointParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceListItem, type InvoiceOverdueData, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomerCreditsParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListOffersParams, type ListPaymentsParams, type ListPlanGrantsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhookEndpointsParams, type Market, type Offer, type PauseSubscriptionParams, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethod, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGrant, type PlanGrantCreatedData, type PlanGrantExpiredData, type PlanGrantRevokedData, type PlanGrantUpdatedData, type PlanGroup, type PlanGroupDetail, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PortalAccess, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type Refund, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemoveSubscriptionOfferParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type ResumeSubscriptionParams, type RetryTransactionParams, type RevokeCustomerCreditParams, type RevokePlanGrantParams, type RevokeSubscriptionPauseParams, SDK_VERSION, type SeatBalance, type SeatBalanceCollection, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type SetUsageParams, type SubPaymentMethod, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionOfferApplication, type SubscriptionOfferApplicationPhase, type SubscriptionPastDueData, type SubscriptionPauseRevokedData, type SubscriptionPauseScheduledData, type SubscriptionPauseUpdatedData, type SubscriptionPausedData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionResume, type SubscriptionResumeFailedData, type SubscriptionResumedData, type SubscriptionStatus, type SubscriptionSummary, type SubscriptionUpdatedData, type TestClock, type TestClockRun, type TestWebhookEndpointParams, type Timezone, type TopupBalanceParams, type TrackUsageParams, type Transaction, type TransactionListItem, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdateMarketParams, type UpdateOfferParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGrantParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateSubscriptionPauseParams, type UpdateWebhookEndpointParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheck, type UsageEvent, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type Webhook, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookPayload, type WebhookPlanGrantTimelineEvent, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTest, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|
|
5483
|
+
export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApplySubscriptionOfferParams, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSetSeatsParams, type CancelPaymentParams, type CancelSubscriptionParams, type ChangePlanParams, type ChargePaymentParams, type CheckUsageAvailabilityParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, type CommetErrorContext, CommetValidationError, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerCreditParams, type CreateCustomerParams, type CreateFeatureParams, type CreateMarketParams, type CreateOfferParams, type CreatePaymentParams, type CreatePlanGrantParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePrepaidPeriodsCheckoutParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookEndpointParams, type CreatedApiKey, type CreatedSubscription, type CreatedWebhook, type CreditGrant, type CreditPack, type CreditPackListItem, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerCredit, type CustomerCreditRevocation, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeleteMarketParams, type DeleteOfferParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookEndpointParams, type DeletedObject, type DeletedOffer, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DownloadInvoiceParams, type Feature, type FeatureAccess, type FeatureDef, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetMarketParams, type GetOfferParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionAutoTopUpParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookEndpointParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceListItem, type InvoiceOverdueData, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomerCreditsParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListOffersParams, type ListPaymentsParams, type ListPlanGrantsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhookEndpointsParams, type ManagedBy, type Market, type Offer, type PauseSubscriptionParams, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethod, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGrant, type PlanGrantCreatedData, type PlanGrantExpiredData, type PlanGrantRevokedData, type PlanGrantUpdatedData, type PlanGroup, type PlanGroupDetail, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PortalAccess, type PrepaidPeriodsCheckout, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type Refund, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemoveSubscriptionOfferParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type ResumeSubscriptionParams, type RetryTransactionParams, type RevokeCustomerCreditParams, type RevokePlanGrantParams, type RevokeScheduledPlanChangeParams, type RevokeSubscriptionPauseParams, SDK_VERSION, type SeatBalance, type SeatBalanceCollection, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type SetUsageParams, type SubPaymentMethod, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionAutoTopUp, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionOfferApplication, type SubscriptionOfferApplicationPhase, type SubscriptionPastDueData, type SubscriptionPauseRevokedData, type SubscriptionPauseScheduledData, type SubscriptionPauseUpdatedData, type SubscriptionPausedData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionResume, type SubscriptionResumeFailedData, type SubscriptionResumedData, type SubscriptionStatus, type SubscriptionSummary, type SubscriptionUpdatedData, type TestClock, type TestClockRun, type TestWebhookEndpointParams, type Timezone, type TopupBalanceParams, type TrackUsageParams, type Transaction, type TransactionListItem, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdateMarketParams, type UpdateOfferParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGrantParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateSubscriptionAutoTopUpParams, type UpdateSubscriptionPauseParams, type UpdateWebhookEndpointParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheck, type UsageEvent, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type Webhook, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookPayload, type WebhookPlanGrantTimelineEvent, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTest, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
|