@stigg/typescript 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +270 -0
- package/README.md +9 -0
- package/client.d.mts +7 -9
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -9
- package/client.d.ts.map +1 -1
- package/client.js +29 -26
- package/client.js.map +1 -1
- package/client.mjs +30 -27
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/v1/addons/addons.d.mts +1305 -0
- package/resources/v1/addons/addons.d.mts.map +1 -0
- package/resources/v1/addons/addons.d.ts +1305 -0
- package/resources/v1/addons/addons.d.ts.map +1 -0
- package/resources/v1/addons/addons.js +81 -0
- package/resources/v1/addons/addons.js.map +1 -0
- package/resources/v1/addons/addons.mjs +76 -0
- package/resources/v1/addons/addons.mjs.map +1 -0
- package/resources/v1/addons/entitlements.d.mts +860 -0
- package/resources/v1/addons/entitlements.d.mts.map +1 -0
- package/resources/v1/addons/entitlements.d.ts +860 -0
- package/resources/v1/addons/entitlements.d.ts.map +1 -0
- package/resources/v1/addons/entitlements.js +36 -0
- package/resources/v1/addons/entitlements.js.map +1 -0
- package/resources/v1/addons/entitlements.mjs +32 -0
- package/resources/v1/addons/entitlements.mjs.map +1 -0
- package/resources/v1/addons/index.d.mts +3 -0
- package/resources/v1/addons/index.d.mts.map +1 -0
- package/resources/v1/addons/index.d.ts +3 -0
- package/resources/v1/addons/index.d.ts.map +1 -0
- package/resources/v1/addons/index.js +9 -0
- package/resources/v1/addons/index.js.map +1 -0
- package/resources/v1/addons/index.mjs +4 -0
- package/resources/v1/addons/index.mjs.map +1 -0
- package/resources/v1/addons.d.mts +2 -0
- package/resources/v1/addons.d.mts.map +1 -0
- package/resources/v1/addons.d.ts +2 -0
- package/resources/v1/addons.d.ts.map +1 -0
- package/resources/v1/addons.js +6 -0
- package/resources/v1/addons.js.map +1 -0
- package/resources/v1/addons.mjs +3 -0
- package/resources/v1/addons.mjs.map +1 -0
- package/resources/v1/coupons.d.mts +113 -82
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +113 -82
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +19 -3
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +19 -3
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +221 -45
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +221 -45
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +32 -15
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +32 -15
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +2 -2
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +2 -2
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js +3 -3
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +10 -2
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +10 -2
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +7 -2
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +7 -2
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +501 -0
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.d.ts +501 -0
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.js +35 -0
- package/resources/v1/customers/promotional-entitlements.js.map +1 -0
- package/resources/v1/customers/promotional-entitlements.mjs +31 -0
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
- package/resources/v1/events/credits/credits.d.mts +260 -0
- package/resources/v1/events/credits/credits.d.mts.map +1 -0
- package/resources/v1/events/credits/credits.d.ts +260 -0
- package/resources/v1/events/credits/credits.d.ts.map +1 -0
- package/resources/v1/events/credits/credits.js +41 -0
- package/resources/v1/events/credits/credits.js.map +1 -0
- package/resources/v1/events/credits/credits.mjs +36 -0
- package/resources/v1/events/credits/credits.mjs.map +1 -0
- package/resources/v1/events/credits/grants.d.mts +549 -0
- package/resources/v1/events/credits/grants.d.mts.map +1 -0
- package/resources/v1/events/credits/grants.d.ts +549 -0
- package/resources/v1/events/credits/grants.d.ts.map +1 -0
- package/resources/v1/events/credits/grants.js +37 -0
- package/resources/v1/events/credits/grants.js.map +1 -0
- package/resources/v1/events/credits/grants.mjs +33 -0
- package/resources/v1/events/credits/grants.mjs.map +1 -0
- package/resources/v1/events/credits/index.d.mts +3 -0
- package/resources/v1/events/credits/index.d.mts.map +1 -0
- package/resources/v1/events/credits/index.d.ts +3 -0
- package/resources/v1/events/credits/index.d.ts.map +1 -0
- package/resources/v1/events/credits/index.js +9 -0
- package/resources/v1/events/credits/index.js.map +1 -0
- package/resources/v1/events/credits/index.mjs +4 -0
- package/resources/v1/events/credits/index.mjs.map +1 -0
- package/resources/v1/events/credits.d.mts +2 -0
- package/resources/v1/events/credits.d.mts.map +1 -0
- package/resources/v1/events/credits.d.ts +2 -0
- package/resources/v1/events/credits.d.ts.map +1 -0
- package/resources/v1/events/credits.js +6 -0
- package/resources/v1/events/credits.js.map +1 -0
- package/resources/v1/events/credits.mjs +3 -0
- package/resources/v1/events/credits.mjs.map +1 -0
- package/resources/v1/events/events.d.mts +70 -0
- package/resources/v1/events/events.d.mts.map +1 -0
- package/resources/v1/events/events.d.ts +70 -0
- package/resources/v1/events/events.d.ts.map +1 -0
- package/resources/v1/events/events.js +27 -0
- package/resources/v1/events/events.js.map +1 -0
- package/resources/v1/events/events.mjs +22 -0
- package/resources/v1/events/events.mjs.map +1 -0
- package/resources/v1/events/index.d.mts +3 -0
- package/resources/v1/events/index.d.mts.map +1 -0
- package/resources/v1/events/index.d.ts +3 -0
- package/resources/v1/events/index.d.ts.map +1 -0
- package/resources/v1/events/index.js +9 -0
- package/resources/v1/events/index.js.map +1 -0
- package/resources/v1/events/index.mjs +4 -0
- package/resources/v1/events/index.mjs.map +1 -0
- package/resources/v1/events.d.mts +2 -0
- package/resources/v1/events.d.mts.map +1 -0
- package/resources/v1/events.d.ts +2 -0
- package/resources/v1/events.d.ts.map +1 -0
- package/resources/v1/events.js +6 -0
- package/resources/v1/events.js.map +1 -0
- package/resources/v1/events.mjs +3 -0
- package/resources/v1/events.mjs.map +1 -0
- package/resources/v1/features.d.mts +447 -0
- package/resources/v1/features.d.mts.map +1 -0
- package/resources/v1/features.d.ts +447 -0
- package/resources/v1/features.d.ts.map +1 -0
- package/resources/v1/features.js +54 -0
- package/resources/v1/features.js.map +1 -0
- package/resources/v1/features.mjs +50 -0
- package/resources/v1/features.mjs.map +1 -0
- package/resources/v1/index.d.mts +10 -4
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +10 -4
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +17 -5
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +7 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/entitlements.d.mts +860 -0
- package/resources/v1/plans/entitlements.d.mts.map +1 -0
- package/resources/v1/plans/entitlements.d.ts +860 -0
- package/resources/v1/plans/entitlements.d.ts.map +1 -0
- package/resources/v1/plans/entitlements.js +36 -0
- package/resources/v1/plans/entitlements.js.map +1 -0
- package/resources/v1/plans/entitlements.mjs +32 -0
- package/resources/v1/plans/entitlements.mjs.map +1 -0
- package/resources/v1/plans/index.d.mts +3 -0
- package/resources/v1/plans/index.d.mts.map +1 -0
- package/resources/v1/plans/index.d.ts +3 -0
- package/resources/v1/plans/index.d.ts.map +1 -0
- package/resources/v1/plans/index.js +9 -0
- package/resources/v1/plans/index.js.map +1 -0
- package/resources/v1/plans/index.mjs +4 -0
- package/resources/v1/plans/index.mjs.map +1 -0
- package/resources/v1/plans/plans.d.mts +976 -0
- package/resources/v1/plans/plans.d.mts.map +1 -0
- package/resources/v1/plans/plans.d.ts +976 -0
- package/resources/v1/plans/plans.d.ts.map +1 -0
- package/resources/v1/plans/plans.js +79 -0
- package/resources/v1/plans/plans.js.map +1 -0
- package/resources/v1/plans/plans.mjs +74 -0
- package/resources/v1/plans/plans.mjs.map +1 -0
- package/resources/v1/plans.d.mts +2 -0
- package/resources/v1/plans.d.mts.map +1 -0
- package/resources/v1/plans.d.ts +2 -0
- package/resources/v1/plans.d.ts.map +1 -0
- package/resources/v1/plans.js +6 -0
- package/resources/v1/plans.js.map +1 -0
- package/resources/v1/plans.mjs +3 -0
- package/resources/v1/plans.mjs.map +1 -0
- package/resources/v1/products.d.mts +335 -0
- package/resources/v1/products.d.mts.map +1 -0
- package/resources/v1/products.d.ts +335 -0
- package/resources/v1/products.d.ts.map +1 -0
- package/resources/v1/products.js +55 -0
- package/resources/v1/products.js.map +1 -0
- package/resources/v1/products.mjs +51 -0
- package/resources/v1/products.mjs.map +1 -0
- package/resources/v1/subscriptions/future-update.d.mts +15 -19
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +15 -19
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +6 -2
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +6 -2
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/index.d.mts +4 -2
- package/resources/v1/subscriptions/index.d.mts.map +1 -1
- package/resources/v1/subscriptions/index.d.ts +4 -2
- package/resources/v1/subscriptions/index.d.ts.map +1 -1
- package/resources/v1/subscriptions/index.js +5 -1
- package/resources/v1/subscriptions/index.js.map +1 -1
- package/resources/v1/subscriptions/index.mjs +3 -1
- package/resources/v1/subscriptions/index.mjs.map +1 -1
- package/resources/v1/subscriptions/invoice.d.mts +37 -0
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -0
- package/resources/v1/subscriptions/invoice.d.ts +37 -0
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -0
- package/resources/v1/subscriptions/invoice.js +20 -0
- package/resources/v1/subscriptions/invoice.js.map +1 -0
- package/resources/v1/subscriptions/invoice.mjs +16 -0
- package/resources/v1/subscriptions/invoice.mjs.map +1 -0
- package/resources/v1/subscriptions/subscriptions.d.mts +2547 -561
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +2547 -561
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +47 -11
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +49 -13
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +101 -0
- package/resources/v1/subscriptions/usage.d.mts.map +1 -0
- package/resources/v1/subscriptions/usage.d.ts +101 -0
- package/resources/v1/subscriptions/usage.d.ts.map +1 -0
- package/resources/v1/subscriptions/usage.js +27 -0
- package/resources/v1/subscriptions/usage.js.map +1 -0
- package/resources/v1/subscriptions/usage.mjs +23 -0
- package/resources/v1/subscriptions/usage.mjs.map +1 -0
- package/resources/v1/usage.d.mts +238 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +238 -0
- package/resources/v1/usage.d.ts.map +1 -0
- package/resources/v1/usage.js +27 -0
- package/resources/v1/usage.js.map +1 -0
- package/resources/v1/usage.mjs +23 -0
- package/resources/v1/usage.mjs.map +1 -0
- package/resources/v1/v1.d.mts +30 -149
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +30 -149
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +24 -12
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +24 -12
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +41 -47
- package/src/internal/parse.ts +6 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/index.ts +1 -7
- package/src/resources/v1/addons/addons.ts +3253 -0
- package/src/resources/v1/addons/entitlements.ts +1120 -0
- package/src/resources/v1/addons/index.ts +26 -0
- package/src/resources/v1/addons.ts +3 -0
- package/src/resources/v1/coupons.ts +126 -216
- package/src/resources/v1/customers/customers.ts +296 -61
- package/src/resources/v1/customers/index.ts +16 -2
- package/src/resources/v1/customers/payment-method.ts +10 -2
- package/src/resources/v1/customers/promotional-entitlements.ts +672 -0
- package/src/resources/v1/events/credits/credits.ts +356 -0
- package/src/resources/v1/events/credits/grants.ts +795 -0
- package/src/resources/v1/events/credits/index.ts +20 -0
- package/src/resources/v1/events/credits.ts +3 -0
- package/src/resources/v1/events/events.ts +103 -0
- package/src/resources/v1/events/index.ts +13 -0
- package/src/resources/v1/events.ts +3 -0
- package/src/resources/v1/features.ts +574 -0
- package/src/resources/v1/index.ts +70 -15
- package/src/resources/v1/plans/entitlements.ts +1112 -0
- package/src/resources/v1/plans/index.ts +24 -0
- package/src/resources/v1/plans/plans.ts +2035 -0
- package/src/resources/v1/plans.ts +3 -0
- package/src/resources/v1/products.ts +426 -0
- package/src/resources/v1/subscriptions/future-update.ts +15 -27
- package/src/resources/v1/subscriptions/index.ts +15 -11
- package/src/resources/v1/subscriptions/invoice.ts +45 -0
- package/src/resources/v1/subscriptions/subscriptions.ts +5836 -777
- package/src/resources/v1/subscriptions/usage.ts +129 -0
- package/src/resources/v1/usage.ts +293 -0
- package/src/resources/v1/v1.ts +168 -197
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/v1/customers/usage.d.mts +0 -98
- package/resources/v1/customers/usage.d.mts.map +0 -1
- package/resources/v1/customers/usage.d.ts +0 -98
- package/resources/v1/customers/usage.d.ts.map +0 -1
- package/resources/v1/customers/usage.js +0 -20
- package/resources/v1/customers/usage.js.map +0 -1
- package/resources/v1/customers/usage.mjs +0 -16
- package/resources/v1/customers/usage.mjs.map +0 -1
- package/src/resources/v1/customers/usage.ts +0 -132
|
@@ -1,159 +1,82 @@
|
|
|
1
1
|
import { APIResource } from "../../../core/resource.mjs";
|
|
2
2
|
import * as FutureUpdateAPI from "./future-update.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { CancelSubscription, FutureUpdate as FutureUpdateAPIFutureUpdate } from "./future-update.mjs";
|
|
4
|
+
import * as InvoiceAPI from "./invoice.mjs";
|
|
5
|
+
import { Invoice, InvoiceMarkAsPaidResponse } from "./invoice.mjs";
|
|
6
|
+
import * as UsageAPI from "./usage.mjs";
|
|
7
|
+
import { Usage, UsageChargeUsageParams, UsageChargeUsageResponse, UsageSyncResponse } from "./usage.mjs";
|
|
4
8
|
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
5
9
|
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
6
10
|
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
7
11
|
export declare class Subscriptions extends APIResource {
|
|
8
12
|
futureUpdate: FutureUpdateAPI.FutureUpdate;
|
|
13
|
+
usage: UsageAPI.Usage;
|
|
14
|
+
invoice: InvoiceAPI.Invoice;
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
16
|
+
* Retrieves a subscription by its unique identifier, including plan details,
|
|
17
|
+
* billing period, status, and add-ons.
|
|
11
18
|
*/
|
|
12
|
-
|
|
19
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Subscription>;
|
|
13
20
|
/**
|
|
14
|
-
*
|
|
21
|
+
* Updates an active subscription's properties including billing period, add-ons,
|
|
22
|
+
* unit quantities, and discounts.
|
|
15
23
|
*/
|
|
16
|
-
|
|
24
|
+
update(id: string, body: SubscriptionUpdateParams, options?: RequestOptions): APIPromise<Subscription>;
|
|
17
25
|
/**
|
|
18
|
-
*
|
|
26
|
+
* Retrieves a paginated list of subscriptions, with optional filters for customer,
|
|
27
|
+
* status, and plan.
|
|
19
28
|
*/
|
|
20
29
|
list(query?: SubscriptionListParams | null | undefined, options?: RequestOptions): PagePromise<SubscriptionListResponsesMyCursorIDPage, SubscriptionListResponse>;
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
31
|
+
* Cancels an active subscription, either immediately or at a specified time such
|
|
32
|
+
* as end of billing period.
|
|
23
33
|
*/
|
|
24
|
-
|
|
34
|
+
cancel(id: string, body: SubscriptionCancelParams, options?: RequestOptions): APIPromise<Subscription>;
|
|
25
35
|
/**
|
|
26
|
-
*
|
|
36
|
+
* Delegates the payment responsibility of a subscription to a different customer.
|
|
37
|
+
* The delegated customer will be billed for this subscription.
|
|
27
38
|
*/
|
|
28
|
-
|
|
39
|
+
delegate(id: string, body: SubscriptionDelegateParams, options?: RequestOptions): APIPromise<Subscription>;
|
|
29
40
|
/**
|
|
30
|
-
*
|
|
41
|
+
* Imports multiple subscriptions in bulk. Used for migrating subscription data
|
|
42
|
+
* from external systems.
|
|
43
|
+
*/
|
|
44
|
+
import(body: SubscriptionImportParams, options?: RequestOptions): APIPromise<SubscriptionImportResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Migrates a subscription to the latest published version of its plan or add-ons.
|
|
47
|
+
* Handles prorated charges or credits automatically.
|
|
48
|
+
*/
|
|
49
|
+
migrate(id: string, body: SubscriptionMigrateParams, options?: RequestOptions): APIPromise<Subscription>;
|
|
50
|
+
/**
|
|
51
|
+
* Previews the pricing impact of creating or updating a subscription without
|
|
52
|
+
* making changes. Returns estimated costs, taxes, and proration details.
|
|
31
53
|
*/
|
|
32
54
|
preview(body: SubscriptionPreviewParams, options?: RequestOptions): APIPromise<SubscriptionPreviewResponse>;
|
|
33
55
|
/**
|
|
34
|
-
*
|
|
56
|
+
* Creates a new subscription for an existing customer. When payment is required
|
|
57
|
+
* and no payment method exists, returns a checkout URL.
|
|
35
58
|
*/
|
|
36
|
-
|
|
59
|
+
provision(body: SubscriptionProvisionParams, options?: RequestOptions): APIPromise<SubscriptionProvisionResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Transfers a subscription to a different resource ID. Used for multi-resource
|
|
62
|
+
* products where subscriptions apply to specific entities like websites or apps.
|
|
63
|
+
*/
|
|
64
|
+
transfer(id: string, body: SubscriptionTransferParams, options?: RequestOptions): APIPromise<Subscription>;
|
|
37
65
|
}
|
|
38
66
|
export type SubscriptionListResponsesMyCursorIDPage = MyCursorIDPage<SubscriptionListResponse>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
id: string;
|
|
48
|
-
/**
|
|
49
|
-
* Provision status: SUCCESS or PAYMENT_REQUIRED
|
|
50
|
-
*/
|
|
51
|
-
status: 'SUCCESS' | 'PAYMENT_REQUIRED';
|
|
52
|
-
/**
|
|
53
|
-
* Checkout billing ID when payment is required
|
|
54
|
-
*/
|
|
55
|
-
checkoutBillingId?: string | null;
|
|
56
|
-
/**
|
|
57
|
-
* URL to complete payment when PAYMENT_REQUIRED
|
|
58
|
-
*/
|
|
59
|
-
checkoutUrl?: string | null;
|
|
60
|
-
/**
|
|
61
|
-
* Whether the subscription is scheduled for future activation
|
|
62
|
-
*/
|
|
63
|
-
isScheduled?: boolean;
|
|
64
|
-
subscription?: Data.Subscription;
|
|
65
|
-
}
|
|
66
|
-
namespace Data {
|
|
67
|
-
interface Subscription {
|
|
68
|
-
/**
|
|
69
|
-
* Subscription ID
|
|
70
|
-
*/
|
|
71
|
-
id: string;
|
|
72
|
-
/**
|
|
73
|
-
* Billing ID
|
|
74
|
-
*/
|
|
75
|
-
billingId: string | null;
|
|
76
|
-
/**
|
|
77
|
-
* Created at
|
|
78
|
-
*/
|
|
79
|
-
createdAt: string;
|
|
80
|
-
/**
|
|
81
|
-
* Customer ID
|
|
82
|
-
*/
|
|
83
|
-
customerId: string;
|
|
84
|
-
/**
|
|
85
|
-
* Payment collection
|
|
86
|
-
*/
|
|
87
|
-
paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
|
|
88
|
-
/**
|
|
89
|
-
* Plan ID
|
|
90
|
-
*/
|
|
91
|
-
planId: string;
|
|
92
|
-
/**
|
|
93
|
-
* Pricing type
|
|
94
|
-
*/
|
|
95
|
-
pricingType: 'FREE' | 'PAID' | 'CUSTOM';
|
|
96
|
-
/**
|
|
97
|
-
* Subscription start date
|
|
98
|
-
*/
|
|
99
|
-
startDate: string;
|
|
100
|
-
/**
|
|
101
|
-
* Subscription status
|
|
102
|
-
*/
|
|
103
|
-
status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
|
|
104
|
-
/**
|
|
105
|
-
* Subscription cancellation date
|
|
106
|
-
*/
|
|
107
|
-
cancellationDate?: string | null;
|
|
108
|
-
/**
|
|
109
|
-
* Subscription cancel reason
|
|
110
|
-
*/
|
|
111
|
-
cancelReason?: 'UPGRADE_OR_DOWNGRADE' | 'CANCELLED_BY_BILLING' | 'EXPIRED' | 'DETACH_BILLING' | 'TRIAL_ENDED' | 'Immediate' | 'TRIAL_CONVERTED' | 'PENDING_PAYMENT_EXPIRED' | 'ScheduledCancellation' | 'CustomerArchived' | 'AutoCancellationRule' | null;
|
|
112
|
-
/**
|
|
113
|
-
* End of the current billing period
|
|
114
|
-
*/
|
|
115
|
-
currentBillingPeriodEnd?: string | null;
|
|
116
|
-
/**
|
|
117
|
-
* Start of the current billing period
|
|
118
|
-
*/
|
|
119
|
-
currentBillingPeriodStart?: string | null;
|
|
120
|
-
/**
|
|
121
|
-
* Subscription effective end date
|
|
122
|
-
*/
|
|
123
|
-
effectiveEndDate?: string | null;
|
|
124
|
-
/**
|
|
125
|
-
* Subscription end date
|
|
126
|
-
*/
|
|
127
|
-
endDate?: string | null;
|
|
128
|
-
/**
|
|
129
|
-
* Additional metadata for the subscription
|
|
130
|
-
*/
|
|
131
|
-
metadata?: {
|
|
132
|
-
[key: string]: string;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Paying customer ID for delegated billing
|
|
136
|
-
*/
|
|
137
|
-
payingCustomerId?: string | null;
|
|
138
|
-
/**
|
|
139
|
-
* The method used to collect payments for a subscription
|
|
140
|
-
*/
|
|
141
|
-
paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
|
|
142
|
-
/**
|
|
143
|
-
* Resource ID
|
|
144
|
-
*/
|
|
145
|
-
resourceId?: string | null;
|
|
146
|
-
/**
|
|
147
|
-
* Subscription trial end date
|
|
148
|
-
*/
|
|
149
|
-
trialEndDate?: string | null;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
export interface SubscriptionRetrieveResponse {
|
|
154
|
-
data: SubscriptionRetrieveResponse.Data;
|
|
67
|
+
/**
|
|
68
|
+
* Response object
|
|
69
|
+
*/
|
|
70
|
+
export interface Subscription {
|
|
71
|
+
/**
|
|
72
|
+
* Customer subscription to a plan
|
|
73
|
+
*/
|
|
74
|
+
data: Subscription.Data;
|
|
155
75
|
}
|
|
156
|
-
export declare namespace
|
|
76
|
+
export declare namespace Subscription {
|
|
77
|
+
/**
|
|
78
|
+
* Customer subscription to a plan
|
|
79
|
+
*/
|
|
157
80
|
interface Data {
|
|
158
81
|
/**
|
|
159
82
|
* Subscription ID
|
|
@@ -191,6 +114,15 @@ export declare namespace SubscriptionRetrieveResponse {
|
|
|
191
114
|
* Subscription status
|
|
192
115
|
*/
|
|
193
116
|
status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
|
|
117
|
+
addons?: Array<Data.Addon>;
|
|
118
|
+
/**
|
|
119
|
+
* Billing cycle anchor date
|
|
120
|
+
*/
|
|
121
|
+
billingCycleAnchor?: string | null;
|
|
122
|
+
/**
|
|
123
|
+
* Budget configuration
|
|
124
|
+
*/
|
|
125
|
+
budget?: Data.Budget | null;
|
|
194
126
|
/**
|
|
195
127
|
* Subscription cancellation date
|
|
196
128
|
*/
|
|
@@ -199,6 +131,10 @@ export declare namespace SubscriptionRetrieveResponse {
|
|
|
199
131
|
* Subscription cancel reason
|
|
200
132
|
*/
|
|
201
133
|
cancelReason?: 'UPGRADE_OR_DOWNGRADE' | 'CANCELLED_BY_BILLING' | 'EXPIRED' | 'DETACH_BILLING' | 'TRIAL_ENDED' | 'Immediate' | 'TRIAL_CONVERTED' | 'PENDING_PAYMENT_EXPIRED' | 'ScheduledCancellation' | 'CustomerArchived' | 'AutoCancellationRule' | null;
|
|
134
|
+
/**
|
|
135
|
+
* Coupons applied to the subscription
|
|
136
|
+
*/
|
|
137
|
+
coupons?: Array<Data.Coupon>;
|
|
202
138
|
/**
|
|
203
139
|
* End of the current billing period
|
|
204
140
|
*/
|
|
@@ -215,12 +151,24 @@ export declare namespace SubscriptionRetrieveResponse {
|
|
|
215
151
|
* Subscription end date
|
|
216
152
|
*/
|
|
217
153
|
endDate?: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* Scheduled future updates for the subscription
|
|
156
|
+
*/
|
|
157
|
+
futureUpdates?: Array<Data.FutureUpdate>;
|
|
158
|
+
/**
|
|
159
|
+
* Latest invoice for the subscription
|
|
160
|
+
*/
|
|
161
|
+
latestInvoice?: Data.LatestInvoice | null;
|
|
218
162
|
/**
|
|
219
163
|
* Additional metadata for the subscription
|
|
220
164
|
*/
|
|
221
165
|
metadata?: {
|
|
222
166
|
[key: string]: string;
|
|
223
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* Minimum spend configuration
|
|
170
|
+
*/
|
|
171
|
+
minimumSpend?: Data.MinimumSpend | null;
|
|
224
172
|
/**
|
|
225
173
|
* Paying customer ID for delegated billing
|
|
226
174
|
*/
|
|
@@ -229,250 +177,1881 @@ export declare namespace SubscriptionRetrieveResponse {
|
|
|
229
177
|
* The method used to collect payments for a subscription
|
|
230
178
|
*/
|
|
231
179
|
paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
|
|
180
|
+
prices?: Array<Data.Price>;
|
|
232
181
|
/**
|
|
233
182
|
* Resource ID
|
|
234
183
|
*/
|
|
235
184
|
resourceId?: string | null;
|
|
236
185
|
/**
|
|
237
|
-
*
|
|
238
|
-
*/
|
|
239
|
-
trialEndDate?: string | null;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
export interface SubscriptionListResponse {
|
|
243
|
-
/**
|
|
244
|
-
* Subscription ID
|
|
245
|
-
*/
|
|
246
|
-
id: string;
|
|
247
|
-
/**
|
|
248
|
-
* Billing ID
|
|
249
|
-
*/
|
|
250
|
-
billingId: string | null;
|
|
251
|
-
/**
|
|
252
|
-
* Created at
|
|
253
|
-
*/
|
|
254
|
-
createdAt: string;
|
|
255
|
-
/**
|
|
256
|
-
* Customer ID
|
|
257
|
-
*/
|
|
258
|
-
customerId: string;
|
|
259
|
-
/**
|
|
260
|
-
* Payment collection
|
|
261
|
-
*/
|
|
262
|
-
paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
|
|
263
|
-
/**
|
|
264
|
-
* Plan ID
|
|
265
|
-
*/
|
|
266
|
-
planId: string;
|
|
267
|
-
/**
|
|
268
|
-
* Pricing type
|
|
269
|
-
*/
|
|
270
|
-
pricingType: 'FREE' | 'PAID' | 'CUSTOM';
|
|
271
|
-
/**
|
|
272
|
-
* Subscription start date
|
|
273
|
-
*/
|
|
274
|
-
startDate: string;
|
|
275
|
-
/**
|
|
276
|
-
* Subscription status
|
|
277
|
-
*/
|
|
278
|
-
status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
|
|
279
|
-
/**
|
|
280
|
-
* Subscription cancellation date
|
|
281
|
-
*/
|
|
282
|
-
cancellationDate?: string | null;
|
|
283
|
-
/**
|
|
284
|
-
* Subscription cancel reason
|
|
285
|
-
*/
|
|
286
|
-
cancelReason?: 'UPGRADE_OR_DOWNGRADE' | 'CANCELLED_BY_BILLING' | 'EXPIRED' | 'DETACH_BILLING' | 'TRIAL_ENDED' | 'Immediate' | 'TRIAL_CONVERTED' | 'PENDING_PAYMENT_EXPIRED' | 'ScheduledCancellation' | 'CustomerArchived' | 'AutoCancellationRule' | null;
|
|
287
|
-
/**
|
|
288
|
-
* End of the current billing period
|
|
289
|
-
*/
|
|
290
|
-
currentBillingPeriodEnd?: string | null;
|
|
291
|
-
/**
|
|
292
|
-
* Start of the current billing period
|
|
293
|
-
*/
|
|
294
|
-
currentBillingPeriodStart?: string | null;
|
|
295
|
-
/**
|
|
296
|
-
* Subscription effective end date
|
|
297
|
-
*/
|
|
298
|
-
effectiveEndDate?: string | null;
|
|
299
|
-
/**
|
|
300
|
-
* Subscription end date
|
|
301
|
-
*/
|
|
302
|
-
endDate?: string | null;
|
|
303
|
-
/**
|
|
304
|
-
* Additional metadata for the subscription
|
|
305
|
-
*/
|
|
306
|
-
metadata?: {
|
|
307
|
-
[key: string]: string;
|
|
308
|
-
};
|
|
309
|
-
/**
|
|
310
|
-
* Paying customer ID for delegated billing
|
|
311
|
-
*/
|
|
312
|
-
payingCustomerId?: string | null;
|
|
313
|
-
/**
|
|
314
|
-
* The method used to collect payments for a subscription
|
|
315
|
-
*/
|
|
316
|
-
paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
|
|
317
|
-
/**
|
|
318
|
-
* Resource ID
|
|
319
|
-
*/
|
|
320
|
-
resourceId?: string | null;
|
|
321
|
-
/**
|
|
322
|
-
* Subscription trial end date
|
|
323
|
-
*/
|
|
324
|
-
trialEndDate?: string | null;
|
|
325
|
-
}
|
|
326
|
-
export interface SubscriptionDelegateResponse {
|
|
327
|
-
data: SubscriptionDelegateResponse.Data;
|
|
328
|
-
}
|
|
329
|
-
export declare namespace SubscriptionDelegateResponse {
|
|
330
|
-
interface Data {
|
|
331
|
-
/**
|
|
332
|
-
* Subscription ID
|
|
333
|
-
*/
|
|
334
|
-
id: string;
|
|
335
|
-
/**
|
|
336
|
-
* Billing ID
|
|
186
|
+
* Entitlements associated with the subscription
|
|
337
187
|
*/
|
|
338
|
-
|
|
188
|
+
subscriptionEntitlements?: Array<Data.SubscriptionEntitlement>;
|
|
339
189
|
/**
|
|
340
|
-
*
|
|
190
|
+
* Trial configuration
|
|
341
191
|
*/
|
|
342
|
-
|
|
192
|
+
trial?: Data.Trial | null;
|
|
343
193
|
/**
|
|
344
|
-
*
|
|
194
|
+
* Subscription trial end date
|
|
345
195
|
*/
|
|
346
|
-
|
|
196
|
+
trialEndDate?: string | null;
|
|
197
|
+
}
|
|
198
|
+
namespace Data {
|
|
347
199
|
/**
|
|
348
|
-
*
|
|
200
|
+
* Addon configuration
|
|
349
201
|
*/
|
|
350
|
-
|
|
202
|
+
interface Addon {
|
|
203
|
+
/**
|
|
204
|
+
* Addon ID
|
|
205
|
+
*/
|
|
206
|
+
id: string;
|
|
207
|
+
/**
|
|
208
|
+
* Number of addon instances
|
|
209
|
+
*/
|
|
210
|
+
quantity: number;
|
|
211
|
+
}
|
|
351
212
|
/**
|
|
352
|
-
*
|
|
213
|
+
* Budget configuration
|
|
353
214
|
*/
|
|
354
|
-
|
|
215
|
+
interface Budget {
|
|
216
|
+
/**
|
|
217
|
+
* Whether the budget is a soft limit
|
|
218
|
+
*/
|
|
219
|
+
hasSoftLimit: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Maximum spending limit
|
|
222
|
+
*/
|
|
223
|
+
limit: number;
|
|
224
|
+
}
|
|
355
225
|
/**
|
|
356
|
-
*
|
|
226
|
+
* Coupon applied to a subscription
|
|
357
227
|
*/
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
228
|
+
interface Coupon {
|
|
229
|
+
/**
|
|
230
|
+
* Coupon ID
|
|
231
|
+
*/
|
|
232
|
+
id: string;
|
|
233
|
+
/**
|
|
234
|
+
* Coupon name
|
|
235
|
+
*/
|
|
236
|
+
name: string;
|
|
237
|
+
/**
|
|
238
|
+
* Coupon status
|
|
239
|
+
*/
|
|
240
|
+
status: 'ACTIVE' | 'EXPIRED' | 'REMOVED';
|
|
241
|
+
/**
|
|
242
|
+
* Fixed amount discounts by currency
|
|
243
|
+
*/
|
|
244
|
+
amountsOff?: Array<Coupon.AmountsOff> | null;
|
|
245
|
+
/**
|
|
246
|
+
* Percentage discount
|
|
247
|
+
*/
|
|
248
|
+
percentOff?: number | null;
|
|
249
|
+
}
|
|
250
|
+
namespace Coupon {
|
|
251
|
+
interface AmountsOff {
|
|
252
|
+
/**
|
|
253
|
+
* The price amount
|
|
254
|
+
*/
|
|
255
|
+
amount?: number;
|
|
256
|
+
/**
|
|
257
|
+
* The price currency
|
|
258
|
+
*/
|
|
259
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Scheduled subscription update
|
|
264
|
+
*/
|
|
265
|
+
interface FutureUpdate {
|
|
266
|
+
/**
|
|
267
|
+
* Scheduled execution time
|
|
268
|
+
*/
|
|
269
|
+
scheduledExecutionTime: string;
|
|
270
|
+
/**
|
|
271
|
+
* Status of the scheduled update
|
|
272
|
+
*/
|
|
273
|
+
scheduleStatus: 'PENDING_PAYMENT' | 'SCHEDULED' | 'CANCELED' | 'DONE' | 'FAILED';
|
|
274
|
+
/**
|
|
275
|
+
* Type of scheduled change
|
|
276
|
+
*/
|
|
277
|
+
subscriptionScheduleType: 'DOWNGRADE' | 'PLAN' | 'BILLING_PERIOD' | 'UNIT_AMOUNT' | 'RECURRING_CREDITS' | 'PRICE_OVERRIDE' | 'ADDON' | 'COUPON' | 'MIGRATE_TO_LATEST' | 'ADDITIONAL_META_DATA' | 'BILLING_INFO_METADATA';
|
|
278
|
+
/**
|
|
279
|
+
* Target package for the update
|
|
280
|
+
*/
|
|
281
|
+
targetPackage?: FutureUpdate.TargetPackage | null;
|
|
282
|
+
}
|
|
283
|
+
namespace FutureUpdate {
|
|
284
|
+
/**
|
|
285
|
+
* Target package for the update
|
|
286
|
+
*/
|
|
287
|
+
interface TargetPackage {
|
|
288
|
+
/**
|
|
289
|
+
* Target package for the update
|
|
290
|
+
*/
|
|
291
|
+
id: string;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Latest invoice for the subscription
|
|
296
|
+
*/
|
|
297
|
+
interface LatestInvoice {
|
|
298
|
+
/**
|
|
299
|
+
* Invoice billing ID
|
|
300
|
+
*/
|
|
301
|
+
billingId: string;
|
|
302
|
+
/**
|
|
303
|
+
* Invoice creation date
|
|
304
|
+
*/
|
|
305
|
+
createdAt: string;
|
|
306
|
+
/**
|
|
307
|
+
* Whether payment requires action
|
|
308
|
+
*/
|
|
309
|
+
requiresAction: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Invoice status
|
|
312
|
+
*/
|
|
313
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
314
|
+
/**
|
|
315
|
+
* Amount due
|
|
316
|
+
*/
|
|
317
|
+
amountDue?: number | null;
|
|
318
|
+
/**
|
|
319
|
+
* Billing reason
|
|
320
|
+
*/
|
|
321
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
322
|
+
/**
|
|
323
|
+
* Invoice currency
|
|
324
|
+
*/
|
|
325
|
+
currency?: string | null;
|
|
326
|
+
/**
|
|
327
|
+
* Invoice PDF URL
|
|
328
|
+
*/
|
|
329
|
+
pdfUrl?: string | null;
|
|
330
|
+
/**
|
|
331
|
+
* Total amount
|
|
332
|
+
*/
|
|
333
|
+
total?: number | null;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Minimum spend configuration
|
|
337
|
+
*/
|
|
338
|
+
interface MinimumSpend {
|
|
339
|
+
/**
|
|
340
|
+
* The price amount
|
|
341
|
+
*/
|
|
342
|
+
amount?: number;
|
|
343
|
+
/**
|
|
344
|
+
* The price currency
|
|
345
|
+
*/
|
|
346
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
347
|
+
}
|
|
348
|
+
interface Price {
|
|
349
|
+
/**
|
|
350
|
+
* Addon identifier for the price override
|
|
351
|
+
*/
|
|
352
|
+
addonId?: string | null;
|
|
353
|
+
/**
|
|
354
|
+
* The price amount
|
|
355
|
+
*/
|
|
356
|
+
amount?: number;
|
|
357
|
+
/**
|
|
358
|
+
* Whether this is a base charge override
|
|
359
|
+
*/
|
|
360
|
+
baseCharge?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* The billing country code of the price
|
|
363
|
+
*/
|
|
364
|
+
billingCountryCode?: string;
|
|
365
|
+
/**
|
|
366
|
+
* Block size for pricing
|
|
367
|
+
*/
|
|
368
|
+
blockSize?: number;
|
|
369
|
+
/**
|
|
370
|
+
* The price currency
|
|
371
|
+
*/
|
|
372
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
373
|
+
/**
|
|
374
|
+
* Feature identifier for the price override
|
|
375
|
+
*/
|
|
376
|
+
featureId?: string | null;
|
|
377
|
+
/**
|
|
378
|
+
* Pricing tiers configuration
|
|
379
|
+
*/
|
|
380
|
+
tiers?: Array<Price.Tier>;
|
|
381
|
+
}
|
|
382
|
+
namespace Price {
|
|
383
|
+
interface Tier {
|
|
384
|
+
/**
|
|
385
|
+
* The flat fee price of the price tier
|
|
386
|
+
*/
|
|
387
|
+
flatPrice?: Tier.FlatPrice;
|
|
388
|
+
/**
|
|
389
|
+
* The unit price of the price tier
|
|
390
|
+
*/
|
|
391
|
+
unitPrice?: Tier.UnitPrice;
|
|
392
|
+
/**
|
|
393
|
+
* The up to quantity of the price tier
|
|
394
|
+
*/
|
|
395
|
+
upTo?: number;
|
|
396
|
+
}
|
|
397
|
+
namespace Tier {
|
|
398
|
+
/**
|
|
399
|
+
* The flat fee price of the price tier
|
|
400
|
+
*/
|
|
401
|
+
interface FlatPrice {
|
|
402
|
+
/**
|
|
403
|
+
* The price amount
|
|
404
|
+
*/
|
|
405
|
+
amount: number;
|
|
406
|
+
/**
|
|
407
|
+
* The price currency
|
|
408
|
+
*/
|
|
409
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* The unit price of the price tier
|
|
413
|
+
*/
|
|
414
|
+
interface UnitPrice {
|
|
415
|
+
/**
|
|
416
|
+
* The price amount
|
|
417
|
+
*/
|
|
418
|
+
amount: number;
|
|
419
|
+
/**
|
|
420
|
+
* The price currency
|
|
421
|
+
*/
|
|
422
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Subscription entitlement reference
|
|
428
|
+
*/
|
|
429
|
+
interface SubscriptionEntitlement {
|
|
430
|
+
/**
|
|
431
|
+
* Feature ID or currency ID
|
|
432
|
+
*/
|
|
433
|
+
id: string;
|
|
434
|
+
/**
|
|
435
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
436
|
+
*/
|
|
437
|
+
type: 'FEATURE' | 'CREDIT';
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Trial configuration
|
|
441
|
+
*/
|
|
442
|
+
interface Trial {
|
|
443
|
+
/**
|
|
444
|
+
* Behavior when the trial ends
|
|
445
|
+
*/
|
|
446
|
+
trialEndBehavior: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Customer subscription to a plan
|
|
452
|
+
*/
|
|
453
|
+
export interface SubscriptionListResponse {
|
|
454
|
+
/**
|
|
455
|
+
* Subscription ID
|
|
456
|
+
*/
|
|
457
|
+
id: string;
|
|
458
|
+
/**
|
|
459
|
+
* Billing ID
|
|
460
|
+
*/
|
|
461
|
+
billingId: string | null;
|
|
462
|
+
/**
|
|
463
|
+
* Created at
|
|
464
|
+
*/
|
|
465
|
+
createdAt: string;
|
|
466
|
+
/**
|
|
467
|
+
* Customer ID
|
|
468
|
+
*/
|
|
469
|
+
customerId: string;
|
|
470
|
+
/**
|
|
471
|
+
* Payment collection
|
|
472
|
+
*/
|
|
473
|
+
paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
|
|
474
|
+
/**
|
|
475
|
+
* Plan ID
|
|
476
|
+
*/
|
|
477
|
+
planId: string;
|
|
478
|
+
/**
|
|
479
|
+
* Pricing type
|
|
480
|
+
*/
|
|
481
|
+
pricingType: 'FREE' | 'PAID' | 'CUSTOM';
|
|
482
|
+
/**
|
|
483
|
+
* Subscription start date
|
|
484
|
+
*/
|
|
485
|
+
startDate: string;
|
|
486
|
+
/**
|
|
487
|
+
* Subscription status
|
|
488
|
+
*/
|
|
489
|
+
status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
|
|
490
|
+
addons?: Array<SubscriptionListResponse.Addon>;
|
|
491
|
+
/**
|
|
492
|
+
* Billing cycle anchor date
|
|
493
|
+
*/
|
|
494
|
+
billingCycleAnchor?: string | null;
|
|
495
|
+
/**
|
|
496
|
+
* Budget configuration
|
|
497
|
+
*/
|
|
498
|
+
budget?: SubscriptionListResponse.Budget | null;
|
|
499
|
+
/**
|
|
500
|
+
* Subscription cancellation date
|
|
501
|
+
*/
|
|
502
|
+
cancellationDate?: string | null;
|
|
503
|
+
/**
|
|
504
|
+
* Subscription cancel reason
|
|
505
|
+
*/
|
|
506
|
+
cancelReason?: 'UPGRADE_OR_DOWNGRADE' | 'CANCELLED_BY_BILLING' | 'EXPIRED' | 'DETACH_BILLING' | 'TRIAL_ENDED' | 'Immediate' | 'TRIAL_CONVERTED' | 'PENDING_PAYMENT_EXPIRED' | 'ScheduledCancellation' | 'CustomerArchived' | 'AutoCancellationRule' | null;
|
|
507
|
+
/**
|
|
508
|
+
* Coupons applied to the subscription
|
|
509
|
+
*/
|
|
510
|
+
coupons?: Array<SubscriptionListResponse.Coupon>;
|
|
511
|
+
/**
|
|
512
|
+
* End of the current billing period
|
|
513
|
+
*/
|
|
514
|
+
currentBillingPeriodEnd?: string | null;
|
|
515
|
+
/**
|
|
516
|
+
* Start of the current billing period
|
|
517
|
+
*/
|
|
518
|
+
currentBillingPeriodStart?: string | null;
|
|
519
|
+
/**
|
|
520
|
+
* Subscription effective end date
|
|
521
|
+
*/
|
|
522
|
+
effectiveEndDate?: string | null;
|
|
523
|
+
/**
|
|
524
|
+
* Subscription end date
|
|
525
|
+
*/
|
|
526
|
+
endDate?: string | null;
|
|
527
|
+
/**
|
|
528
|
+
* Scheduled future updates for the subscription
|
|
529
|
+
*/
|
|
530
|
+
futureUpdates?: Array<SubscriptionListResponse.FutureUpdate>;
|
|
531
|
+
/**
|
|
532
|
+
* Latest invoice for the subscription
|
|
533
|
+
*/
|
|
534
|
+
latestInvoice?: SubscriptionListResponse.LatestInvoice | null;
|
|
535
|
+
/**
|
|
536
|
+
* Additional metadata for the subscription
|
|
537
|
+
*/
|
|
538
|
+
metadata?: {
|
|
539
|
+
[key: string]: string;
|
|
540
|
+
};
|
|
541
|
+
/**
|
|
542
|
+
* Minimum spend configuration
|
|
543
|
+
*/
|
|
544
|
+
minimumSpend?: SubscriptionListResponse.MinimumSpend | null;
|
|
545
|
+
/**
|
|
546
|
+
* Paying customer ID for delegated billing
|
|
547
|
+
*/
|
|
548
|
+
payingCustomerId?: string | null;
|
|
549
|
+
/**
|
|
550
|
+
* The method used to collect payments for a subscription
|
|
551
|
+
*/
|
|
552
|
+
paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
|
|
553
|
+
prices?: Array<SubscriptionListResponse.Price>;
|
|
554
|
+
/**
|
|
555
|
+
* Resource ID
|
|
556
|
+
*/
|
|
557
|
+
resourceId?: string | null;
|
|
558
|
+
/**
|
|
559
|
+
* Entitlements associated with the subscription
|
|
560
|
+
*/
|
|
561
|
+
subscriptionEntitlements?: Array<SubscriptionListResponse.SubscriptionEntitlement>;
|
|
562
|
+
/**
|
|
563
|
+
* Trial configuration
|
|
564
|
+
*/
|
|
565
|
+
trial?: SubscriptionListResponse.Trial | null;
|
|
566
|
+
/**
|
|
567
|
+
* Subscription trial end date
|
|
568
|
+
*/
|
|
569
|
+
trialEndDate?: string | null;
|
|
570
|
+
}
|
|
571
|
+
export declare namespace SubscriptionListResponse {
|
|
572
|
+
/**
|
|
573
|
+
* Addon configuration
|
|
574
|
+
*/
|
|
575
|
+
interface Addon {
|
|
576
|
+
/**
|
|
577
|
+
* Addon ID
|
|
578
|
+
*/
|
|
579
|
+
id: string;
|
|
580
|
+
/**
|
|
581
|
+
* Number of addon instances
|
|
582
|
+
*/
|
|
583
|
+
quantity: number;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Budget configuration
|
|
587
|
+
*/
|
|
588
|
+
interface Budget {
|
|
589
|
+
/**
|
|
590
|
+
* Whether the budget is a soft limit
|
|
591
|
+
*/
|
|
592
|
+
hasSoftLimit: boolean;
|
|
593
|
+
/**
|
|
594
|
+
* Maximum spending limit
|
|
595
|
+
*/
|
|
596
|
+
limit: number;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Coupon applied to a subscription
|
|
600
|
+
*/
|
|
601
|
+
interface Coupon {
|
|
602
|
+
/**
|
|
603
|
+
* Coupon ID
|
|
604
|
+
*/
|
|
605
|
+
id: string;
|
|
606
|
+
/**
|
|
607
|
+
* Coupon name
|
|
608
|
+
*/
|
|
609
|
+
name: string;
|
|
610
|
+
/**
|
|
611
|
+
* Coupon status
|
|
612
|
+
*/
|
|
613
|
+
status: 'ACTIVE' | 'EXPIRED' | 'REMOVED';
|
|
614
|
+
/**
|
|
615
|
+
* Fixed amount discounts by currency
|
|
616
|
+
*/
|
|
617
|
+
amountsOff?: Array<Coupon.AmountsOff> | null;
|
|
618
|
+
/**
|
|
619
|
+
* Percentage discount
|
|
620
|
+
*/
|
|
621
|
+
percentOff?: number | null;
|
|
622
|
+
}
|
|
623
|
+
namespace Coupon {
|
|
624
|
+
interface AmountsOff {
|
|
625
|
+
/**
|
|
626
|
+
* The price amount
|
|
627
|
+
*/
|
|
628
|
+
amount?: number;
|
|
629
|
+
/**
|
|
630
|
+
* The price currency
|
|
631
|
+
*/
|
|
632
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Scheduled subscription update
|
|
637
|
+
*/
|
|
638
|
+
interface FutureUpdate {
|
|
639
|
+
/**
|
|
640
|
+
* Scheduled execution time
|
|
641
|
+
*/
|
|
642
|
+
scheduledExecutionTime: string;
|
|
643
|
+
/**
|
|
644
|
+
* Status of the scheduled update
|
|
645
|
+
*/
|
|
646
|
+
scheduleStatus: 'PENDING_PAYMENT' | 'SCHEDULED' | 'CANCELED' | 'DONE' | 'FAILED';
|
|
647
|
+
/**
|
|
648
|
+
* Type of scheduled change
|
|
649
|
+
*/
|
|
650
|
+
subscriptionScheduleType: 'DOWNGRADE' | 'PLAN' | 'BILLING_PERIOD' | 'UNIT_AMOUNT' | 'RECURRING_CREDITS' | 'PRICE_OVERRIDE' | 'ADDON' | 'COUPON' | 'MIGRATE_TO_LATEST' | 'ADDITIONAL_META_DATA' | 'BILLING_INFO_METADATA';
|
|
651
|
+
/**
|
|
652
|
+
* Target package for the update
|
|
653
|
+
*/
|
|
654
|
+
targetPackage?: FutureUpdate.TargetPackage | null;
|
|
655
|
+
}
|
|
656
|
+
namespace FutureUpdate {
|
|
657
|
+
/**
|
|
658
|
+
* Target package for the update
|
|
659
|
+
*/
|
|
660
|
+
interface TargetPackage {
|
|
661
|
+
/**
|
|
662
|
+
* Target package for the update
|
|
663
|
+
*/
|
|
664
|
+
id: string;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Latest invoice for the subscription
|
|
669
|
+
*/
|
|
670
|
+
interface LatestInvoice {
|
|
671
|
+
/**
|
|
672
|
+
* Invoice billing ID
|
|
673
|
+
*/
|
|
674
|
+
billingId: string;
|
|
675
|
+
/**
|
|
676
|
+
* Invoice creation date
|
|
677
|
+
*/
|
|
678
|
+
createdAt: string;
|
|
679
|
+
/**
|
|
680
|
+
* Whether payment requires action
|
|
681
|
+
*/
|
|
682
|
+
requiresAction: boolean;
|
|
683
|
+
/**
|
|
684
|
+
* Invoice status
|
|
685
|
+
*/
|
|
686
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
687
|
+
/**
|
|
688
|
+
* Amount due
|
|
689
|
+
*/
|
|
690
|
+
amountDue?: number | null;
|
|
691
|
+
/**
|
|
692
|
+
* Billing reason
|
|
693
|
+
*/
|
|
694
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
695
|
+
/**
|
|
696
|
+
* Invoice currency
|
|
697
|
+
*/
|
|
698
|
+
currency?: string | null;
|
|
699
|
+
/**
|
|
700
|
+
* Invoice PDF URL
|
|
701
|
+
*/
|
|
702
|
+
pdfUrl?: string | null;
|
|
703
|
+
/**
|
|
704
|
+
* Total amount
|
|
705
|
+
*/
|
|
706
|
+
total?: number | null;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Minimum spend configuration
|
|
710
|
+
*/
|
|
711
|
+
interface MinimumSpend {
|
|
712
|
+
/**
|
|
713
|
+
* The price amount
|
|
714
|
+
*/
|
|
715
|
+
amount?: number;
|
|
716
|
+
/**
|
|
717
|
+
* The price currency
|
|
718
|
+
*/
|
|
719
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
720
|
+
}
|
|
721
|
+
interface Price {
|
|
722
|
+
/**
|
|
723
|
+
* Addon identifier for the price override
|
|
724
|
+
*/
|
|
725
|
+
addonId?: string | null;
|
|
726
|
+
/**
|
|
727
|
+
* The price amount
|
|
728
|
+
*/
|
|
729
|
+
amount?: number;
|
|
730
|
+
/**
|
|
731
|
+
* Whether this is a base charge override
|
|
732
|
+
*/
|
|
733
|
+
baseCharge?: boolean;
|
|
734
|
+
/**
|
|
735
|
+
* The billing country code of the price
|
|
736
|
+
*/
|
|
737
|
+
billingCountryCode?: string;
|
|
738
|
+
/**
|
|
739
|
+
* Block size for pricing
|
|
740
|
+
*/
|
|
741
|
+
blockSize?: number;
|
|
742
|
+
/**
|
|
743
|
+
* The price currency
|
|
744
|
+
*/
|
|
745
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
746
|
+
/**
|
|
747
|
+
* Feature identifier for the price override
|
|
748
|
+
*/
|
|
749
|
+
featureId?: string | null;
|
|
750
|
+
/**
|
|
751
|
+
* Pricing tiers configuration
|
|
752
|
+
*/
|
|
753
|
+
tiers?: Array<Price.Tier>;
|
|
754
|
+
}
|
|
755
|
+
namespace Price {
|
|
756
|
+
interface Tier {
|
|
757
|
+
/**
|
|
758
|
+
* The flat fee price of the price tier
|
|
759
|
+
*/
|
|
760
|
+
flatPrice?: Tier.FlatPrice;
|
|
761
|
+
/**
|
|
762
|
+
* The unit price of the price tier
|
|
763
|
+
*/
|
|
764
|
+
unitPrice?: Tier.UnitPrice;
|
|
765
|
+
/**
|
|
766
|
+
* The up to quantity of the price tier
|
|
767
|
+
*/
|
|
768
|
+
upTo?: number;
|
|
769
|
+
}
|
|
770
|
+
namespace Tier {
|
|
771
|
+
/**
|
|
772
|
+
* The flat fee price of the price tier
|
|
773
|
+
*/
|
|
774
|
+
interface FlatPrice {
|
|
775
|
+
/**
|
|
776
|
+
* The price amount
|
|
777
|
+
*/
|
|
778
|
+
amount: number;
|
|
779
|
+
/**
|
|
780
|
+
* The price currency
|
|
781
|
+
*/
|
|
782
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* The unit price of the price tier
|
|
786
|
+
*/
|
|
787
|
+
interface UnitPrice {
|
|
788
|
+
/**
|
|
789
|
+
* The price amount
|
|
790
|
+
*/
|
|
791
|
+
amount: number;
|
|
792
|
+
/**
|
|
793
|
+
* The price currency
|
|
794
|
+
*/
|
|
795
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Subscription entitlement reference
|
|
801
|
+
*/
|
|
802
|
+
interface SubscriptionEntitlement {
|
|
803
|
+
/**
|
|
804
|
+
* Feature ID or currency ID
|
|
805
|
+
*/
|
|
806
|
+
id: string;
|
|
807
|
+
/**
|
|
808
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
809
|
+
*/
|
|
810
|
+
type: 'FEATURE' | 'CREDIT';
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Trial configuration
|
|
814
|
+
*/
|
|
815
|
+
interface Trial {
|
|
816
|
+
/**
|
|
817
|
+
* Behavior when the trial ends
|
|
818
|
+
*/
|
|
819
|
+
trialEndBehavior: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Response object
|
|
824
|
+
*/
|
|
825
|
+
export interface SubscriptionImportResponse {
|
|
826
|
+
data: SubscriptionImportResponse.Data;
|
|
827
|
+
}
|
|
828
|
+
export declare namespace SubscriptionImportResponse {
|
|
829
|
+
interface Data {
|
|
830
|
+
/**
|
|
831
|
+
* Unique identifier for the import task
|
|
832
|
+
*/
|
|
833
|
+
taskId: string;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Response object
|
|
838
|
+
*/
|
|
839
|
+
export interface SubscriptionPreviewResponse {
|
|
840
|
+
/**
|
|
841
|
+
* Pricing preview with invoices
|
|
842
|
+
*/
|
|
843
|
+
data: SubscriptionPreviewResponse.Data;
|
|
844
|
+
}
|
|
845
|
+
export declare namespace SubscriptionPreviewResponse {
|
|
846
|
+
/**
|
|
847
|
+
* Pricing preview with invoices
|
|
848
|
+
*/
|
|
849
|
+
interface Data {
|
|
850
|
+
/**
|
|
851
|
+
* Invoice due immediately
|
|
852
|
+
*/
|
|
853
|
+
immediateInvoice: Data.ImmediateInvoice;
|
|
854
|
+
/**
|
|
855
|
+
* Billing period range
|
|
856
|
+
*/
|
|
857
|
+
billingPeriodRange?: Data.BillingPeriodRange;
|
|
858
|
+
/**
|
|
859
|
+
* Free items included
|
|
860
|
+
*/
|
|
861
|
+
freeItems?: Array<Data.FreeItem>;
|
|
862
|
+
/**
|
|
863
|
+
* Whether updates are scheduled
|
|
864
|
+
*/
|
|
865
|
+
hasScheduledUpdates?: boolean;
|
|
866
|
+
/**
|
|
867
|
+
* Whether this is a downgrade
|
|
868
|
+
*/
|
|
869
|
+
isPlanDowngrade?: boolean;
|
|
870
|
+
/**
|
|
871
|
+
* Recurring invoice preview
|
|
872
|
+
*/
|
|
873
|
+
recurringInvoice?: Data.RecurringInvoice;
|
|
874
|
+
}
|
|
875
|
+
namespace Data {
|
|
876
|
+
/**
|
|
877
|
+
* Invoice due immediately
|
|
878
|
+
*/
|
|
879
|
+
interface ImmediateInvoice {
|
|
880
|
+
/**
|
|
881
|
+
* Subtotal before discounts
|
|
882
|
+
*/
|
|
883
|
+
subTotal: number;
|
|
884
|
+
/**
|
|
885
|
+
* Invoice total
|
|
886
|
+
*/
|
|
887
|
+
total: number;
|
|
888
|
+
/**
|
|
889
|
+
* Billing period covered
|
|
890
|
+
*/
|
|
891
|
+
billingPeriodRange?: ImmediateInvoice.BillingPeriodRange;
|
|
892
|
+
/**
|
|
893
|
+
* Currency code
|
|
894
|
+
*/
|
|
895
|
+
currency?: string | null;
|
|
896
|
+
/**
|
|
897
|
+
* Total discount amount
|
|
898
|
+
*/
|
|
899
|
+
discount?: number;
|
|
900
|
+
/**
|
|
901
|
+
* Discount breakdown
|
|
902
|
+
*/
|
|
903
|
+
discountDetails?: ImmediateInvoice.DiscountDetails;
|
|
904
|
+
/**
|
|
905
|
+
* Applied discounts
|
|
906
|
+
*/
|
|
907
|
+
discounts?: Array<ImmediateInvoice.Discount>;
|
|
908
|
+
/**
|
|
909
|
+
* Line items
|
|
910
|
+
*/
|
|
911
|
+
lines?: Array<ImmediateInvoice.Line>;
|
|
912
|
+
/**
|
|
913
|
+
* Tax amount
|
|
914
|
+
*/
|
|
915
|
+
tax?: number;
|
|
916
|
+
}
|
|
917
|
+
namespace ImmediateInvoice {
|
|
918
|
+
/**
|
|
919
|
+
* Billing period covered
|
|
920
|
+
*/
|
|
921
|
+
interface BillingPeriodRange {
|
|
922
|
+
/**
|
|
923
|
+
* Billing period end date
|
|
924
|
+
*/
|
|
925
|
+
end: string;
|
|
926
|
+
/**
|
|
927
|
+
* Billing period start date
|
|
928
|
+
*/
|
|
929
|
+
start: string;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Discount breakdown
|
|
933
|
+
*/
|
|
934
|
+
interface DiscountDetails {
|
|
935
|
+
/**
|
|
936
|
+
* Promo code used
|
|
937
|
+
*/
|
|
938
|
+
code?: string;
|
|
939
|
+
/**
|
|
940
|
+
* Fixed discount amount
|
|
941
|
+
*/
|
|
942
|
+
fixedAmount?: number;
|
|
943
|
+
/**
|
|
944
|
+
* Percentage discount
|
|
945
|
+
*/
|
|
946
|
+
percentage?: number;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Applied discount amount
|
|
950
|
+
*/
|
|
951
|
+
interface Discount {
|
|
952
|
+
/**
|
|
953
|
+
* Discount amount
|
|
954
|
+
*/
|
|
955
|
+
amount: number;
|
|
956
|
+
/**
|
|
957
|
+
* Currency code
|
|
958
|
+
*/
|
|
959
|
+
currency: string;
|
|
960
|
+
/**
|
|
961
|
+
* Discount description
|
|
962
|
+
*/
|
|
963
|
+
description: string;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Invoice line item
|
|
967
|
+
*/
|
|
968
|
+
interface Line {
|
|
969
|
+
/**
|
|
970
|
+
* Currency code
|
|
971
|
+
*/
|
|
972
|
+
currency: string;
|
|
973
|
+
/**
|
|
974
|
+
* Line item description
|
|
975
|
+
*/
|
|
976
|
+
description: string;
|
|
977
|
+
/**
|
|
978
|
+
* Line subtotal
|
|
979
|
+
*/
|
|
980
|
+
subTotal: number;
|
|
981
|
+
/**
|
|
982
|
+
* Price per unit
|
|
983
|
+
*/
|
|
984
|
+
unitPrice: number;
|
|
985
|
+
/**
|
|
986
|
+
* Quantity
|
|
987
|
+
*/
|
|
988
|
+
quantity?: number;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Billing period range
|
|
993
|
+
*/
|
|
994
|
+
interface BillingPeriodRange {
|
|
995
|
+
/**
|
|
996
|
+
* Billing period end date
|
|
997
|
+
*/
|
|
998
|
+
end?: string;
|
|
999
|
+
/**
|
|
1000
|
+
* Billing period start date
|
|
1001
|
+
*/
|
|
1002
|
+
start?: string;
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Addon configuration
|
|
1006
|
+
*/
|
|
1007
|
+
interface FreeItem {
|
|
1008
|
+
/**
|
|
1009
|
+
* Addon ID
|
|
1010
|
+
*/
|
|
1011
|
+
id: string;
|
|
1012
|
+
/**
|
|
1013
|
+
* Number of addon instances
|
|
1014
|
+
*/
|
|
1015
|
+
quantity: number;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Recurring invoice preview
|
|
1019
|
+
*/
|
|
1020
|
+
interface RecurringInvoice {
|
|
1021
|
+
/**
|
|
1022
|
+
* Subtotal before discounts
|
|
1023
|
+
*/
|
|
1024
|
+
subTotal: number;
|
|
1025
|
+
/**
|
|
1026
|
+
* Invoice total
|
|
1027
|
+
*/
|
|
1028
|
+
total: number;
|
|
1029
|
+
/**
|
|
1030
|
+
* Billing period covered
|
|
1031
|
+
*/
|
|
1032
|
+
billingPeriodRange?: RecurringInvoice.BillingPeriodRange;
|
|
1033
|
+
/**
|
|
1034
|
+
* Currency code
|
|
1035
|
+
*/
|
|
1036
|
+
currency?: string | null;
|
|
1037
|
+
/**
|
|
1038
|
+
* Total discount amount
|
|
1039
|
+
*/
|
|
1040
|
+
discount?: number;
|
|
1041
|
+
/**
|
|
1042
|
+
* Discount breakdown
|
|
1043
|
+
*/
|
|
1044
|
+
discountDetails?: RecurringInvoice.DiscountDetails;
|
|
1045
|
+
/**
|
|
1046
|
+
* Applied discounts
|
|
1047
|
+
*/
|
|
1048
|
+
discounts?: Array<RecurringInvoice.Discount>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Line items
|
|
1051
|
+
*/
|
|
1052
|
+
lines?: Array<RecurringInvoice.Line>;
|
|
1053
|
+
/**
|
|
1054
|
+
* Tax amount
|
|
1055
|
+
*/
|
|
1056
|
+
tax?: number;
|
|
1057
|
+
}
|
|
1058
|
+
namespace RecurringInvoice {
|
|
1059
|
+
/**
|
|
1060
|
+
* Billing period covered
|
|
1061
|
+
*/
|
|
1062
|
+
interface BillingPeriodRange {
|
|
1063
|
+
/**
|
|
1064
|
+
* Billing period end date
|
|
1065
|
+
*/
|
|
1066
|
+
end: string;
|
|
1067
|
+
/**
|
|
1068
|
+
* Billing period start date
|
|
1069
|
+
*/
|
|
1070
|
+
start: string;
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Discount breakdown
|
|
1074
|
+
*/
|
|
1075
|
+
interface DiscountDetails {
|
|
1076
|
+
/**
|
|
1077
|
+
* Promo code used
|
|
1078
|
+
*/
|
|
1079
|
+
code?: string;
|
|
1080
|
+
/**
|
|
1081
|
+
* Fixed discount amount
|
|
1082
|
+
*/
|
|
1083
|
+
fixedAmount?: number;
|
|
1084
|
+
/**
|
|
1085
|
+
* Percentage discount
|
|
1086
|
+
*/
|
|
1087
|
+
percentage?: number;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Applied discount amount
|
|
1091
|
+
*/
|
|
1092
|
+
interface Discount {
|
|
1093
|
+
/**
|
|
1094
|
+
* Discount amount
|
|
1095
|
+
*/
|
|
1096
|
+
amount: number;
|
|
1097
|
+
/**
|
|
1098
|
+
* Currency code
|
|
1099
|
+
*/
|
|
1100
|
+
currency: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* Discount description
|
|
1103
|
+
*/
|
|
1104
|
+
description: string;
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Invoice line item
|
|
1108
|
+
*/
|
|
1109
|
+
interface Line {
|
|
1110
|
+
/**
|
|
1111
|
+
* Currency code
|
|
1112
|
+
*/
|
|
1113
|
+
currency: string;
|
|
1114
|
+
/**
|
|
1115
|
+
* Line item description
|
|
1116
|
+
*/
|
|
1117
|
+
description: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Line subtotal
|
|
1120
|
+
*/
|
|
1121
|
+
subTotal: number;
|
|
1122
|
+
/**
|
|
1123
|
+
* Price per unit
|
|
1124
|
+
*/
|
|
1125
|
+
unitPrice: number;
|
|
1126
|
+
/**
|
|
1127
|
+
* Quantity
|
|
1128
|
+
*/
|
|
1129
|
+
quantity?: number;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Response object
|
|
1136
|
+
*/
|
|
1137
|
+
export interface SubscriptionProvisionResponse {
|
|
1138
|
+
/**
|
|
1139
|
+
* Provisioning result with status and subscription or checkout URL.
|
|
1140
|
+
*/
|
|
1141
|
+
data: SubscriptionProvisionResponse.Data;
|
|
1142
|
+
}
|
|
1143
|
+
export declare namespace SubscriptionProvisionResponse {
|
|
1144
|
+
/**
|
|
1145
|
+
* Provisioning result with status and subscription or checkout URL.
|
|
1146
|
+
*/
|
|
1147
|
+
interface Data {
|
|
1148
|
+
/**
|
|
1149
|
+
* Unique identifier for the provisioned subscription
|
|
1150
|
+
*/
|
|
1151
|
+
id: string;
|
|
1152
|
+
entitlements: Array<Data.UnionObjectVariant0 | Data.UnionObjectVariant1> | null;
|
|
1153
|
+
/**
|
|
1154
|
+
* Provision status: SUCCESS or PAYMENT_REQUIRED
|
|
1155
|
+
*/
|
|
1156
|
+
status: 'SUCCESS' | 'PAYMENT_REQUIRED';
|
|
1157
|
+
/**
|
|
1158
|
+
* Created subscription (when status is SUCCESS)
|
|
1159
|
+
*/
|
|
1160
|
+
subscription: Data.Subscription | null;
|
|
1161
|
+
/**
|
|
1162
|
+
* Checkout billing ID when payment is required
|
|
1163
|
+
*/
|
|
1164
|
+
checkoutBillingId?: string;
|
|
1165
|
+
/**
|
|
1166
|
+
* URL to complete payment when PAYMENT_REQUIRED
|
|
1167
|
+
*/
|
|
1168
|
+
checkoutUrl?: string;
|
|
1169
|
+
/**
|
|
1170
|
+
* Whether the subscription is scheduled for future activation
|
|
1171
|
+
*/
|
|
1172
|
+
isScheduled?: boolean;
|
|
1173
|
+
}
|
|
1174
|
+
namespace Data {
|
|
1175
|
+
interface UnionObjectVariant0 {
|
|
1176
|
+
accessDeniedReason: 'FeatureNotFound' | 'CustomerNotFound' | 'CustomerIsArchived' | 'CustomerResourceNotFound' | 'NoActiveSubscription' | 'NoFeatureEntitlementInSubscription' | 'RequestedUsageExceedingLimit' | 'RequestedValuesMismatch' | 'BudgetExceeded' | 'Unknown' | 'FeatureTypeMismatch' | 'Revoked' | 'InsufficientCredits' | 'EntitlementNotFound' | null;
|
|
1177
|
+
isGranted: boolean;
|
|
1178
|
+
type: 'FEATURE';
|
|
1179
|
+
currentUsage?: number;
|
|
1180
|
+
/**
|
|
1181
|
+
* Timestamp of the last update to the entitlement grant or configuration.
|
|
1182
|
+
*/
|
|
1183
|
+
entitlementUpdatedAt?: string;
|
|
1184
|
+
feature?: UnionObjectVariant0.Feature;
|
|
1185
|
+
hasUnlimitedUsage?: boolean;
|
|
1186
|
+
resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
|
|
1187
|
+
usageLimit?: number | null;
|
|
1188
|
+
/**
|
|
1189
|
+
* The anchor for calculating the usage period for metered entitlements with a
|
|
1190
|
+
* reset period configured
|
|
1191
|
+
*/
|
|
1192
|
+
usagePeriodAnchor?: string;
|
|
1193
|
+
/**
|
|
1194
|
+
* The end date of the usage period for metered entitlements with a reset period
|
|
1195
|
+
* configured
|
|
1196
|
+
*/
|
|
1197
|
+
usagePeriodEnd?: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* The start date of the usage period for metered entitlements with a reset period
|
|
1200
|
+
* configured
|
|
1201
|
+
*/
|
|
1202
|
+
usagePeriodStart?: string;
|
|
1203
|
+
/**
|
|
1204
|
+
* The next time the entitlement should be recalculated
|
|
1205
|
+
*/
|
|
1206
|
+
validUntil?: string;
|
|
1207
|
+
}
|
|
1208
|
+
namespace UnionObjectVariant0 {
|
|
1209
|
+
interface Feature {
|
|
1210
|
+
/**
|
|
1211
|
+
* The human-readable name of the entitlement, shown in UI elements.
|
|
1212
|
+
*/
|
|
1213
|
+
displayName: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* The current status of the feature.
|
|
1216
|
+
*/
|
|
1217
|
+
featureStatus: 'NEW' | 'SUSPENDED' | 'ACTIVE';
|
|
1218
|
+
/**
|
|
1219
|
+
* The type of feature associated with the entitlement.
|
|
1220
|
+
*/
|
|
1221
|
+
featureType: 'BOOLEAN' | 'NUMBER' | 'ENUM';
|
|
1222
|
+
/**
|
|
1223
|
+
* The unique reference ID of the entitlement.
|
|
1224
|
+
*/
|
|
1225
|
+
refId: string;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
interface UnionObjectVariant1 {
|
|
1229
|
+
accessDeniedReason: 'FeatureNotFound' | 'CustomerNotFound' | 'CustomerIsArchived' | 'CustomerResourceNotFound' | 'NoActiveSubscription' | 'NoFeatureEntitlementInSubscription' | 'RequestedUsageExceedingLimit' | 'RequestedValuesMismatch' | 'BudgetExceeded' | 'Unknown' | 'FeatureTypeMismatch' | 'Revoked' | 'InsufficientCredits' | 'EntitlementNotFound' | null;
|
|
1230
|
+
/**
|
|
1231
|
+
* The currency associated with a credit entitlement.
|
|
1232
|
+
*/
|
|
1233
|
+
currency: UnionObjectVariant1.Currency;
|
|
1234
|
+
currentUsage: number;
|
|
1235
|
+
isGranted: boolean;
|
|
1236
|
+
type: 'CREDIT';
|
|
1237
|
+
usageLimit: number;
|
|
1238
|
+
/**
|
|
1239
|
+
* Timestamp of the last update to the credit usage.
|
|
1240
|
+
*/
|
|
1241
|
+
usageUpdatedAt: string;
|
|
1242
|
+
/**
|
|
1243
|
+
* Timestamp of the last update to the entitlement grant or configuration.
|
|
1244
|
+
*/
|
|
1245
|
+
entitlementUpdatedAt?: string;
|
|
1246
|
+
/**
|
|
1247
|
+
* The end date of the current billing period for recurring credit grants.
|
|
1248
|
+
*/
|
|
1249
|
+
usagePeriodEnd?: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* The next time the entitlement should be recalculated
|
|
1252
|
+
*/
|
|
1253
|
+
validUntil?: string;
|
|
1254
|
+
}
|
|
1255
|
+
namespace UnionObjectVariant1 {
|
|
1256
|
+
/**
|
|
1257
|
+
* The currency associated with a credit entitlement.
|
|
1258
|
+
*/
|
|
1259
|
+
interface Currency {
|
|
1260
|
+
/**
|
|
1261
|
+
* The unique identifier of the custom currency.
|
|
1262
|
+
*/
|
|
1263
|
+
currencyId: string;
|
|
1264
|
+
/**
|
|
1265
|
+
* The display name of the currency.
|
|
1266
|
+
*/
|
|
1267
|
+
displayName: string;
|
|
1268
|
+
/**
|
|
1269
|
+
* Additional metadata associated with the currency.
|
|
1270
|
+
*/
|
|
1271
|
+
additionalMetaData?: unknown;
|
|
1272
|
+
/**
|
|
1273
|
+
* A description of the currency.
|
|
1274
|
+
*/
|
|
1275
|
+
description?: string | null;
|
|
1276
|
+
/**
|
|
1277
|
+
* The plural form of the currency unit.
|
|
1278
|
+
*/
|
|
1279
|
+
unitPlural?: string | null;
|
|
1280
|
+
/**
|
|
1281
|
+
* The singular form of the currency unit.
|
|
1282
|
+
*/
|
|
1283
|
+
unitSingular?: string | null;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Created subscription (when status is SUCCESS)
|
|
1288
|
+
*/
|
|
1289
|
+
interface Subscription {
|
|
1290
|
+
/**
|
|
1291
|
+
* Subscription ID
|
|
1292
|
+
*/
|
|
1293
|
+
id: string;
|
|
1294
|
+
/**
|
|
1295
|
+
* Billing ID
|
|
1296
|
+
*/
|
|
1297
|
+
billingId: string | null;
|
|
1298
|
+
/**
|
|
1299
|
+
* Created at
|
|
1300
|
+
*/
|
|
1301
|
+
createdAt: string;
|
|
1302
|
+
/**
|
|
1303
|
+
* Customer ID
|
|
1304
|
+
*/
|
|
1305
|
+
customerId: string;
|
|
1306
|
+
/**
|
|
1307
|
+
* Payment collection
|
|
1308
|
+
*/
|
|
1309
|
+
paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
|
|
1310
|
+
/**
|
|
1311
|
+
* Plan ID
|
|
1312
|
+
*/
|
|
1313
|
+
planId: string;
|
|
1314
|
+
/**
|
|
1315
|
+
* Pricing type
|
|
1316
|
+
*/
|
|
1317
|
+
pricingType: 'FREE' | 'PAID' | 'CUSTOM';
|
|
1318
|
+
/**
|
|
1319
|
+
* Subscription start date
|
|
1320
|
+
*/
|
|
1321
|
+
startDate: string;
|
|
1322
|
+
/**
|
|
1323
|
+
* Subscription status
|
|
1324
|
+
*/
|
|
1325
|
+
status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
|
|
1326
|
+
addons?: Array<Subscription.Addon>;
|
|
1327
|
+
/**
|
|
1328
|
+
* Billing cycle anchor date
|
|
1329
|
+
*/
|
|
1330
|
+
billingCycleAnchor?: string | null;
|
|
1331
|
+
/**
|
|
1332
|
+
* Budget configuration
|
|
1333
|
+
*/
|
|
1334
|
+
budget?: Subscription.Budget | null;
|
|
1335
|
+
/**
|
|
1336
|
+
* Subscription cancellation date
|
|
1337
|
+
*/
|
|
1338
|
+
cancellationDate?: string | null;
|
|
1339
|
+
/**
|
|
1340
|
+
* Subscription cancel reason
|
|
1341
|
+
*/
|
|
1342
|
+
cancelReason?: 'UPGRADE_OR_DOWNGRADE' | 'CANCELLED_BY_BILLING' | 'EXPIRED' | 'DETACH_BILLING' | 'TRIAL_ENDED' | 'Immediate' | 'TRIAL_CONVERTED' | 'PENDING_PAYMENT_EXPIRED' | 'ScheduledCancellation' | 'CustomerArchived' | 'AutoCancellationRule' | null;
|
|
1343
|
+
/**
|
|
1344
|
+
* Coupons applied to the subscription
|
|
1345
|
+
*/
|
|
1346
|
+
coupons?: Array<Subscription.Coupon>;
|
|
1347
|
+
/**
|
|
1348
|
+
* End of the current billing period
|
|
1349
|
+
*/
|
|
1350
|
+
currentBillingPeriodEnd?: string | null;
|
|
1351
|
+
/**
|
|
1352
|
+
* Start of the current billing period
|
|
1353
|
+
*/
|
|
1354
|
+
currentBillingPeriodStart?: string | null;
|
|
1355
|
+
/**
|
|
1356
|
+
* Subscription effective end date
|
|
1357
|
+
*/
|
|
1358
|
+
effectiveEndDate?: string | null;
|
|
1359
|
+
/**
|
|
1360
|
+
* Subscription end date
|
|
1361
|
+
*/
|
|
1362
|
+
endDate?: string | null;
|
|
1363
|
+
/**
|
|
1364
|
+
* Scheduled future updates for the subscription
|
|
1365
|
+
*/
|
|
1366
|
+
futureUpdates?: Array<Subscription.FutureUpdate>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Latest invoice for the subscription
|
|
1369
|
+
*/
|
|
1370
|
+
latestInvoice?: Subscription.LatestInvoice | null;
|
|
1371
|
+
/**
|
|
1372
|
+
* Additional metadata for the subscription
|
|
1373
|
+
*/
|
|
1374
|
+
metadata?: {
|
|
1375
|
+
[key: string]: string;
|
|
1376
|
+
};
|
|
1377
|
+
/**
|
|
1378
|
+
* Minimum spend configuration
|
|
1379
|
+
*/
|
|
1380
|
+
minimumSpend?: Subscription.MinimumSpend | null;
|
|
1381
|
+
/**
|
|
1382
|
+
* Paying customer ID for delegated billing
|
|
1383
|
+
*/
|
|
1384
|
+
payingCustomerId?: string | null;
|
|
1385
|
+
/**
|
|
1386
|
+
* The method used to collect payments for a subscription
|
|
1387
|
+
*/
|
|
1388
|
+
paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
|
|
1389
|
+
prices?: Array<Subscription.Price>;
|
|
1390
|
+
/**
|
|
1391
|
+
* Resource ID
|
|
1392
|
+
*/
|
|
1393
|
+
resourceId?: string | null;
|
|
1394
|
+
/**
|
|
1395
|
+
* Entitlements associated with the subscription
|
|
1396
|
+
*/
|
|
1397
|
+
subscriptionEntitlements?: Array<Subscription.SubscriptionEntitlement>;
|
|
1398
|
+
/**
|
|
1399
|
+
* Trial configuration
|
|
1400
|
+
*/
|
|
1401
|
+
trial?: Subscription.Trial | null;
|
|
1402
|
+
/**
|
|
1403
|
+
* Subscription trial end date
|
|
1404
|
+
*/
|
|
1405
|
+
trialEndDate?: string | null;
|
|
1406
|
+
}
|
|
1407
|
+
namespace Subscription {
|
|
1408
|
+
/**
|
|
1409
|
+
* Addon configuration
|
|
1410
|
+
*/
|
|
1411
|
+
interface Addon {
|
|
1412
|
+
/**
|
|
1413
|
+
* Addon ID
|
|
1414
|
+
*/
|
|
1415
|
+
id: string;
|
|
1416
|
+
/**
|
|
1417
|
+
* Number of addon instances
|
|
1418
|
+
*/
|
|
1419
|
+
quantity: number;
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Budget configuration
|
|
1423
|
+
*/
|
|
1424
|
+
interface Budget {
|
|
1425
|
+
/**
|
|
1426
|
+
* Whether the budget is a soft limit
|
|
1427
|
+
*/
|
|
1428
|
+
hasSoftLimit: boolean;
|
|
1429
|
+
/**
|
|
1430
|
+
* Maximum spending limit
|
|
1431
|
+
*/
|
|
1432
|
+
limit: number;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Coupon applied to a subscription
|
|
1436
|
+
*/
|
|
1437
|
+
interface Coupon {
|
|
1438
|
+
/**
|
|
1439
|
+
* Coupon ID
|
|
1440
|
+
*/
|
|
1441
|
+
id: string;
|
|
1442
|
+
/**
|
|
1443
|
+
* Coupon name
|
|
1444
|
+
*/
|
|
1445
|
+
name: string;
|
|
1446
|
+
/**
|
|
1447
|
+
* Coupon status
|
|
1448
|
+
*/
|
|
1449
|
+
status: 'ACTIVE' | 'EXPIRED' | 'REMOVED';
|
|
1450
|
+
/**
|
|
1451
|
+
* Fixed amount discounts by currency
|
|
1452
|
+
*/
|
|
1453
|
+
amountsOff?: Array<Coupon.AmountsOff> | null;
|
|
1454
|
+
/**
|
|
1455
|
+
* Percentage discount
|
|
1456
|
+
*/
|
|
1457
|
+
percentOff?: number | null;
|
|
1458
|
+
}
|
|
1459
|
+
namespace Coupon {
|
|
1460
|
+
interface AmountsOff {
|
|
1461
|
+
/**
|
|
1462
|
+
* The price amount
|
|
1463
|
+
*/
|
|
1464
|
+
amount?: number;
|
|
1465
|
+
/**
|
|
1466
|
+
* The price currency
|
|
1467
|
+
*/
|
|
1468
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1472
|
+
* Scheduled subscription update
|
|
1473
|
+
*/
|
|
1474
|
+
interface FutureUpdate {
|
|
1475
|
+
/**
|
|
1476
|
+
* Scheduled execution time
|
|
1477
|
+
*/
|
|
1478
|
+
scheduledExecutionTime: string;
|
|
1479
|
+
/**
|
|
1480
|
+
* Status of the scheduled update
|
|
1481
|
+
*/
|
|
1482
|
+
scheduleStatus: 'PENDING_PAYMENT' | 'SCHEDULED' | 'CANCELED' | 'DONE' | 'FAILED';
|
|
1483
|
+
/**
|
|
1484
|
+
* Type of scheduled change
|
|
1485
|
+
*/
|
|
1486
|
+
subscriptionScheduleType: 'DOWNGRADE' | 'PLAN' | 'BILLING_PERIOD' | 'UNIT_AMOUNT' | 'RECURRING_CREDITS' | 'PRICE_OVERRIDE' | 'ADDON' | 'COUPON' | 'MIGRATE_TO_LATEST' | 'ADDITIONAL_META_DATA' | 'BILLING_INFO_METADATA';
|
|
1487
|
+
/**
|
|
1488
|
+
* Target package for the update
|
|
1489
|
+
*/
|
|
1490
|
+
targetPackage?: FutureUpdate.TargetPackage | null;
|
|
1491
|
+
}
|
|
1492
|
+
namespace FutureUpdate {
|
|
1493
|
+
/**
|
|
1494
|
+
* Target package for the update
|
|
1495
|
+
*/
|
|
1496
|
+
interface TargetPackage {
|
|
1497
|
+
/**
|
|
1498
|
+
* Target package for the update
|
|
1499
|
+
*/
|
|
1500
|
+
id: string;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Latest invoice for the subscription
|
|
1505
|
+
*/
|
|
1506
|
+
interface LatestInvoice {
|
|
1507
|
+
/**
|
|
1508
|
+
* Invoice billing ID
|
|
1509
|
+
*/
|
|
1510
|
+
billingId: string;
|
|
1511
|
+
/**
|
|
1512
|
+
* Invoice creation date
|
|
1513
|
+
*/
|
|
1514
|
+
createdAt: string;
|
|
1515
|
+
/**
|
|
1516
|
+
* Whether payment requires action
|
|
1517
|
+
*/
|
|
1518
|
+
requiresAction: boolean;
|
|
1519
|
+
/**
|
|
1520
|
+
* Invoice status
|
|
1521
|
+
*/
|
|
1522
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
1523
|
+
/**
|
|
1524
|
+
* Amount due
|
|
1525
|
+
*/
|
|
1526
|
+
amountDue?: number | null;
|
|
1527
|
+
/**
|
|
1528
|
+
* Billing reason
|
|
1529
|
+
*/
|
|
1530
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
1531
|
+
/**
|
|
1532
|
+
* Invoice currency
|
|
1533
|
+
*/
|
|
1534
|
+
currency?: string | null;
|
|
1535
|
+
/**
|
|
1536
|
+
* Invoice PDF URL
|
|
1537
|
+
*/
|
|
1538
|
+
pdfUrl?: string | null;
|
|
1539
|
+
/**
|
|
1540
|
+
* Total amount
|
|
1541
|
+
*/
|
|
1542
|
+
total?: number | null;
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Minimum spend configuration
|
|
1546
|
+
*/
|
|
1547
|
+
interface MinimumSpend {
|
|
1548
|
+
/**
|
|
1549
|
+
* The price amount
|
|
1550
|
+
*/
|
|
1551
|
+
amount?: number;
|
|
1552
|
+
/**
|
|
1553
|
+
* The price currency
|
|
1554
|
+
*/
|
|
1555
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1556
|
+
}
|
|
1557
|
+
interface Price {
|
|
1558
|
+
/**
|
|
1559
|
+
* Addon identifier for the price override
|
|
1560
|
+
*/
|
|
1561
|
+
addonId?: string | null;
|
|
1562
|
+
/**
|
|
1563
|
+
* The price amount
|
|
1564
|
+
*/
|
|
1565
|
+
amount?: number;
|
|
1566
|
+
/**
|
|
1567
|
+
* Whether this is a base charge override
|
|
1568
|
+
*/
|
|
1569
|
+
baseCharge?: boolean;
|
|
1570
|
+
/**
|
|
1571
|
+
* The billing country code of the price
|
|
1572
|
+
*/
|
|
1573
|
+
billingCountryCode?: string;
|
|
1574
|
+
/**
|
|
1575
|
+
* Block size for pricing
|
|
1576
|
+
*/
|
|
1577
|
+
blockSize?: number;
|
|
1578
|
+
/**
|
|
1579
|
+
* The price currency
|
|
1580
|
+
*/
|
|
1581
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1582
|
+
/**
|
|
1583
|
+
* Feature identifier for the price override
|
|
1584
|
+
*/
|
|
1585
|
+
featureId?: string | null;
|
|
1586
|
+
/**
|
|
1587
|
+
* Pricing tiers configuration
|
|
1588
|
+
*/
|
|
1589
|
+
tiers?: Array<Price.Tier>;
|
|
1590
|
+
}
|
|
1591
|
+
namespace Price {
|
|
1592
|
+
interface Tier {
|
|
1593
|
+
/**
|
|
1594
|
+
* The flat fee price of the price tier
|
|
1595
|
+
*/
|
|
1596
|
+
flatPrice?: Tier.FlatPrice;
|
|
1597
|
+
/**
|
|
1598
|
+
* The unit price of the price tier
|
|
1599
|
+
*/
|
|
1600
|
+
unitPrice?: Tier.UnitPrice;
|
|
1601
|
+
/**
|
|
1602
|
+
* The up to quantity of the price tier
|
|
1603
|
+
*/
|
|
1604
|
+
upTo?: number;
|
|
1605
|
+
}
|
|
1606
|
+
namespace Tier {
|
|
1607
|
+
/**
|
|
1608
|
+
* The flat fee price of the price tier
|
|
1609
|
+
*/
|
|
1610
|
+
interface FlatPrice {
|
|
1611
|
+
/**
|
|
1612
|
+
* The price amount
|
|
1613
|
+
*/
|
|
1614
|
+
amount: number;
|
|
1615
|
+
/**
|
|
1616
|
+
* The price currency
|
|
1617
|
+
*/
|
|
1618
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* The unit price of the price tier
|
|
1622
|
+
*/
|
|
1623
|
+
interface UnitPrice {
|
|
1624
|
+
/**
|
|
1625
|
+
* The price amount
|
|
1626
|
+
*/
|
|
1627
|
+
amount: number;
|
|
1628
|
+
/**
|
|
1629
|
+
* The price currency
|
|
1630
|
+
*/
|
|
1631
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* Subscription entitlement reference
|
|
1637
|
+
*/
|
|
1638
|
+
interface SubscriptionEntitlement {
|
|
1639
|
+
/**
|
|
1640
|
+
* Feature ID or currency ID
|
|
1641
|
+
*/
|
|
1642
|
+
id: string;
|
|
1643
|
+
/**
|
|
1644
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
1645
|
+
*/
|
|
1646
|
+
type: 'FEATURE' | 'CREDIT';
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Trial configuration
|
|
1650
|
+
*/
|
|
1651
|
+
interface Trial {
|
|
1652
|
+
/**
|
|
1653
|
+
* Behavior when the trial ends
|
|
1654
|
+
*/
|
|
1655
|
+
trialEndBehavior: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
export interface SubscriptionUpdateParams {
|
|
1661
|
+
addons?: Array<SubscriptionUpdateParams.Addon>;
|
|
1662
|
+
appliedCoupon?: SubscriptionUpdateParams.AppliedCoupon;
|
|
1663
|
+
awaitPaymentConfirmation?: boolean;
|
|
1664
|
+
billingCycleAnchor?: 'UNCHANGED' | 'NOW';
|
|
1665
|
+
billingInformation?: SubscriptionUpdateParams.BillingInformation;
|
|
1666
|
+
billingPeriod?: 'MONTHLY' | 'ANNUALLY';
|
|
1667
|
+
budget?: SubscriptionUpdateParams.Budget | null;
|
|
1668
|
+
charges?: Array<SubscriptionUpdateParams.Charge>;
|
|
1669
|
+
entitlements?: Array<SubscriptionUpdateParams.Feature | SubscriptionUpdateParams.Credit>;
|
|
1670
|
+
/**
|
|
1671
|
+
* Additional metadata for the subscription
|
|
1672
|
+
*/
|
|
1673
|
+
metadata?: {
|
|
1674
|
+
[key: string]: string;
|
|
1675
|
+
};
|
|
1676
|
+
/**
|
|
1677
|
+
* Minimum spend amount
|
|
1678
|
+
*/
|
|
1679
|
+
minimumSpend?: SubscriptionUpdateParams.MinimumSpend | null;
|
|
1680
|
+
priceOverrides?: Array<SubscriptionUpdateParams.PriceOverride>;
|
|
1681
|
+
promotionCode?: string;
|
|
1682
|
+
scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
|
|
1683
|
+
/**
|
|
1684
|
+
* Subscription trial end date
|
|
1685
|
+
*/
|
|
1686
|
+
trialEndDate?: string;
|
|
1687
|
+
}
|
|
1688
|
+
export declare namespace SubscriptionUpdateParams {
|
|
1689
|
+
/**
|
|
1690
|
+
* Addon configuration
|
|
1691
|
+
*/
|
|
1692
|
+
interface Addon {
|
|
1693
|
+
/**
|
|
1694
|
+
* Addon ID
|
|
361
1695
|
*/
|
|
362
|
-
|
|
1696
|
+
id: string;
|
|
363
1697
|
/**
|
|
364
|
-
*
|
|
1698
|
+
* Number of addon instances
|
|
365
1699
|
*/
|
|
366
|
-
|
|
1700
|
+
quantity: number;
|
|
1701
|
+
}
|
|
1702
|
+
interface AppliedCoupon {
|
|
1703
|
+
billingCouponId?: string;
|
|
1704
|
+
configuration?: AppliedCoupon.Configuration;
|
|
1705
|
+
couponId?: string;
|
|
1706
|
+
discount?: AppliedCoupon.Discount;
|
|
1707
|
+
promotionCode?: string | null;
|
|
1708
|
+
}
|
|
1709
|
+
namespace AppliedCoupon {
|
|
1710
|
+
interface Configuration {
|
|
1711
|
+
/**
|
|
1712
|
+
* Coupon start date
|
|
1713
|
+
*/
|
|
1714
|
+
startDate?: string;
|
|
1715
|
+
}
|
|
1716
|
+
interface Discount {
|
|
1717
|
+
amountsOff?: Array<Discount.AmountsOff> | null;
|
|
1718
|
+
description?: string;
|
|
1719
|
+
durationInMonths?: number;
|
|
1720
|
+
name?: string;
|
|
1721
|
+
percentOff?: number;
|
|
1722
|
+
}
|
|
1723
|
+
namespace Discount {
|
|
1724
|
+
/**
|
|
1725
|
+
* Monetary amount with currency
|
|
1726
|
+
*/
|
|
1727
|
+
interface AmountsOff {
|
|
1728
|
+
/**
|
|
1729
|
+
* The price amount
|
|
1730
|
+
*/
|
|
1731
|
+
amount: number;
|
|
1732
|
+
/**
|
|
1733
|
+
* The price currency
|
|
1734
|
+
*/
|
|
1735
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
interface BillingInformation {
|
|
367
1740
|
/**
|
|
368
|
-
*
|
|
1741
|
+
* Physical address
|
|
369
1742
|
*/
|
|
370
|
-
|
|
1743
|
+
billingAddress?: BillingInformation.BillingAddress;
|
|
1744
|
+
chargeOnBehalfOfAccount?: string;
|
|
1745
|
+
couponId?: string;
|
|
1746
|
+
integrationId?: string;
|
|
1747
|
+
invoiceDaysUntilDue?: number;
|
|
1748
|
+
isBackdated?: boolean;
|
|
1749
|
+
isInvoicePaid?: boolean;
|
|
371
1750
|
/**
|
|
372
|
-
*
|
|
1751
|
+
* Additional metadata for the subscription
|
|
373
1752
|
*/
|
|
374
|
-
|
|
1753
|
+
metadata?: {
|
|
1754
|
+
[key: string]: unknown;
|
|
1755
|
+
};
|
|
1756
|
+
prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
|
|
1757
|
+
taxIds?: Array<BillingInformation.TaxID>;
|
|
1758
|
+
taxPercentage?: number;
|
|
1759
|
+
taxRateIds?: Array<string>;
|
|
1760
|
+
}
|
|
1761
|
+
namespace BillingInformation {
|
|
375
1762
|
/**
|
|
376
|
-
*
|
|
1763
|
+
* Physical address
|
|
377
1764
|
*/
|
|
378
|
-
|
|
1765
|
+
interface BillingAddress {
|
|
1766
|
+
/**
|
|
1767
|
+
* City name
|
|
1768
|
+
*/
|
|
1769
|
+
city?: string;
|
|
1770
|
+
/**
|
|
1771
|
+
* Country code or name
|
|
1772
|
+
*/
|
|
1773
|
+
country?: string;
|
|
1774
|
+
/**
|
|
1775
|
+
* Street address line 1
|
|
1776
|
+
*/
|
|
1777
|
+
line1?: string;
|
|
1778
|
+
/**
|
|
1779
|
+
* Street address line 2
|
|
1780
|
+
*/
|
|
1781
|
+
line2?: string;
|
|
1782
|
+
/**
|
|
1783
|
+
* Postal or ZIP code
|
|
1784
|
+
*/
|
|
1785
|
+
postalCode?: string;
|
|
1786
|
+
/**
|
|
1787
|
+
* State or province
|
|
1788
|
+
*/
|
|
1789
|
+
state?: string;
|
|
1790
|
+
}
|
|
1791
|
+
interface TaxID {
|
|
1792
|
+
type: string;
|
|
1793
|
+
value: string;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
interface Budget {
|
|
379
1797
|
/**
|
|
380
|
-
*
|
|
1798
|
+
* Whether the budget is a soft limit
|
|
381
1799
|
*/
|
|
382
|
-
|
|
1800
|
+
hasSoftLimit: boolean;
|
|
383
1801
|
/**
|
|
384
|
-
*
|
|
1802
|
+
* Maximum spending limit
|
|
385
1803
|
*/
|
|
386
|
-
|
|
1804
|
+
limit: number;
|
|
1805
|
+
}
|
|
1806
|
+
interface Charge {
|
|
387
1807
|
/**
|
|
388
|
-
*
|
|
1808
|
+
* Charge ID
|
|
389
1809
|
*/
|
|
390
|
-
|
|
1810
|
+
id: string;
|
|
1811
|
+
quantity: number;
|
|
1812
|
+
type: 'FEATURE' | 'CREDIT';
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* Feature entitlement configuration for a subscription
|
|
1816
|
+
*/
|
|
1817
|
+
interface Feature {
|
|
391
1818
|
/**
|
|
392
|
-
*
|
|
1819
|
+
* The feature ID to attach the entitlement to
|
|
393
1820
|
*/
|
|
394
|
-
|
|
395
|
-
[key: string]: string;
|
|
396
|
-
};
|
|
1821
|
+
id: string;
|
|
397
1822
|
/**
|
|
398
|
-
*
|
|
1823
|
+
* SubscriptionFeatureEntitlementRequest
|
|
399
1824
|
*/
|
|
400
|
-
|
|
1825
|
+
type: 'FEATURE';
|
|
1826
|
+
/**
|
|
1827
|
+
* Whether the usage limit is a soft limit
|
|
1828
|
+
*/
|
|
1829
|
+
hasSoftLimit?: boolean;
|
|
1830
|
+
/**
|
|
1831
|
+
* Whether usage is unlimited
|
|
1832
|
+
*/
|
|
1833
|
+
hasUnlimitedUsage?: boolean;
|
|
1834
|
+
/**
|
|
1835
|
+
* Configuration for monthly reset period
|
|
1836
|
+
*/
|
|
1837
|
+
monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
|
|
1838
|
+
/**
|
|
1839
|
+
* Period at which usage resets
|
|
1840
|
+
*/
|
|
1841
|
+
resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
|
|
1842
|
+
/**
|
|
1843
|
+
* Maximum allowed usage for the feature
|
|
1844
|
+
*/
|
|
1845
|
+
usageLimit?: number;
|
|
1846
|
+
/**
|
|
1847
|
+
* Configuration for weekly reset period
|
|
1848
|
+
*/
|
|
1849
|
+
weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
|
|
1850
|
+
/**
|
|
1851
|
+
* Configuration for yearly reset period
|
|
1852
|
+
*/
|
|
1853
|
+
yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
|
|
1854
|
+
}
|
|
1855
|
+
namespace Feature {
|
|
1856
|
+
/**
|
|
1857
|
+
* Configuration for monthly reset period
|
|
1858
|
+
*/
|
|
1859
|
+
interface MonthlyResetPeriodConfiguration {
|
|
1860
|
+
/**
|
|
1861
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
1862
|
+
*/
|
|
1863
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Configuration for weekly reset period
|
|
1867
|
+
*/
|
|
1868
|
+
interface WeeklyResetPeriodConfiguration {
|
|
1869
|
+
/**
|
|
1870
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
1871
|
+
*/
|
|
1872
|
+
accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* Configuration for yearly reset period
|
|
1876
|
+
*/
|
|
1877
|
+
interface YearlyResetPeriodConfiguration {
|
|
1878
|
+
/**
|
|
1879
|
+
* Reset anchor (SubscriptionStart)
|
|
1880
|
+
*/
|
|
1881
|
+
accordingTo: 'SubscriptionStart';
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* Credit entitlement configuration for a subscription
|
|
1886
|
+
*/
|
|
1887
|
+
interface Credit {
|
|
1888
|
+
/**
|
|
1889
|
+
* The custom currency ID for the credit entitlement
|
|
1890
|
+
*/
|
|
1891
|
+
id: string;
|
|
1892
|
+
/**
|
|
1893
|
+
* Credit grant amount
|
|
1894
|
+
*/
|
|
1895
|
+
amount: number;
|
|
1896
|
+
/**
|
|
1897
|
+
* Credit grant cadence (MONTH or YEAR)
|
|
1898
|
+
*/
|
|
1899
|
+
cadence: 'MONTH' | 'YEAR';
|
|
1900
|
+
/**
|
|
1901
|
+
* SubscriptionCreditEntitlementRequest
|
|
1902
|
+
*/
|
|
1903
|
+
type: 'CREDIT';
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Minimum spend amount
|
|
1907
|
+
*/
|
|
1908
|
+
interface MinimumSpend {
|
|
401
1909
|
/**
|
|
402
|
-
* The
|
|
1910
|
+
* The price amount
|
|
403
1911
|
*/
|
|
404
|
-
|
|
1912
|
+
amount?: number;
|
|
405
1913
|
/**
|
|
406
|
-
*
|
|
1914
|
+
* The price currency
|
|
407
1915
|
*/
|
|
408
|
-
|
|
1916
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1917
|
+
}
|
|
1918
|
+
interface PriceOverride {
|
|
409
1919
|
/**
|
|
410
|
-
*
|
|
1920
|
+
* Addon ID
|
|
411
1921
|
*/
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
export interface SubscriptionMigrateResponse {
|
|
416
|
-
data: SubscriptionMigrateResponse.Data;
|
|
417
|
-
}
|
|
418
|
-
export declare namespace SubscriptionMigrateResponse {
|
|
419
|
-
interface Data {
|
|
1922
|
+
addonId?: string;
|
|
420
1923
|
/**
|
|
421
|
-
*
|
|
1924
|
+
* The price amount
|
|
422
1925
|
*/
|
|
423
|
-
|
|
1926
|
+
amount?: number;
|
|
424
1927
|
/**
|
|
425
|
-
*
|
|
1928
|
+
* Whether this is a base charge override
|
|
426
1929
|
*/
|
|
427
|
-
|
|
1930
|
+
baseCharge?: boolean;
|
|
428
1931
|
/**
|
|
429
|
-
*
|
|
1932
|
+
* The price currency
|
|
430
1933
|
*/
|
|
431
|
-
|
|
1934
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
432
1935
|
/**
|
|
433
|
-
*
|
|
1936
|
+
* The corresponding custom currency id of the recurring credits price
|
|
434
1937
|
*/
|
|
435
|
-
|
|
1938
|
+
currencyId?: string;
|
|
436
1939
|
/**
|
|
437
|
-
*
|
|
1940
|
+
* Feature ID
|
|
438
1941
|
*/
|
|
439
|
-
|
|
1942
|
+
featureId?: string;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
export interface SubscriptionListParams extends MyCursorIDPageParams {
|
|
1946
|
+
/**
|
|
1947
|
+
* Filter by creation date using range operators: gt, gte, lt, lte
|
|
1948
|
+
*/
|
|
1949
|
+
createdAt?: SubscriptionListParams.CreatedAt;
|
|
1950
|
+
/**
|
|
1951
|
+
* Filter by customer ID
|
|
1952
|
+
*/
|
|
1953
|
+
customerId?: string;
|
|
1954
|
+
/**
|
|
1955
|
+
* Filter by plan ID
|
|
1956
|
+
*/
|
|
1957
|
+
planId?: string;
|
|
1958
|
+
/**
|
|
1959
|
+
* Filter by pricing type. Supports comma-separated values for multiple types
|
|
1960
|
+
*/
|
|
1961
|
+
pricingType?: string;
|
|
1962
|
+
/**
|
|
1963
|
+
* Filter by resource ID
|
|
1964
|
+
*/
|
|
1965
|
+
resourceId?: string;
|
|
1966
|
+
/**
|
|
1967
|
+
* Filter by subscription status. Supports comma-separated values for multiple
|
|
1968
|
+
* statuses
|
|
1969
|
+
*/
|
|
1970
|
+
status?: string;
|
|
1971
|
+
}
|
|
1972
|
+
export declare namespace SubscriptionListParams {
|
|
1973
|
+
/**
|
|
1974
|
+
* Filter by creation date using range operators: gt, gte, lt, lte
|
|
1975
|
+
*/
|
|
1976
|
+
interface CreatedAt {
|
|
440
1977
|
/**
|
|
441
|
-
*
|
|
1978
|
+
* Greater than the specified createdAt value
|
|
442
1979
|
*/
|
|
443
|
-
|
|
1980
|
+
gt?: string;
|
|
444
1981
|
/**
|
|
445
|
-
*
|
|
1982
|
+
* Greater than or equal to the specified createdAt value
|
|
446
1983
|
*/
|
|
447
|
-
|
|
1984
|
+
gte?: string;
|
|
448
1985
|
/**
|
|
449
|
-
*
|
|
1986
|
+
* Less than the specified createdAt value
|
|
450
1987
|
*/
|
|
451
|
-
|
|
1988
|
+
lt?: string;
|
|
452
1989
|
/**
|
|
453
|
-
*
|
|
1990
|
+
* Less than or equal to the specified createdAt value
|
|
454
1991
|
*/
|
|
455
|
-
|
|
1992
|
+
lte?: string;
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
export interface SubscriptionCancelParams {
|
|
1996
|
+
/**
|
|
1997
|
+
* Action on cancellation (downgrade or revoke)
|
|
1998
|
+
*/
|
|
1999
|
+
cancellationAction?: 'DEFAULT' | 'REVOKE_ENTITLEMENTS';
|
|
2000
|
+
/**
|
|
2001
|
+
* When to cancel (immediate, period end, or date)
|
|
2002
|
+
*/
|
|
2003
|
+
cancellationTime?: 'END_OF_BILLING_PERIOD' | 'IMMEDIATE' | 'SPECIFIC_DATE';
|
|
2004
|
+
/**
|
|
2005
|
+
* Subscription end date
|
|
2006
|
+
*/
|
|
2007
|
+
endDate?: string;
|
|
2008
|
+
/**
|
|
2009
|
+
* If set, enables or disables prorating of credits on subscription cancellation.
|
|
2010
|
+
*/
|
|
2011
|
+
prorate?: boolean;
|
|
2012
|
+
}
|
|
2013
|
+
export interface SubscriptionDelegateParams {
|
|
2014
|
+
/**
|
|
2015
|
+
* The unique identifier of the customer who will assume payment responsibility for
|
|
2016
|
+
* this subscription. This customer must already exist in your Stigg account and
|
|
2017
|
+
* have a valid payment method if the subscription requires payment.
|
|
2018
|
+
*/
|
|
2019
|
+
targetCustomerId: string;
|
|
2020
|
+
}
|
|
2021
|
+
export interface SubscriptionImportParams {
|
|
2022
|
+
/**
|
|
2023
|
+
* List of subscription objects to import
|
|
2024
|
+
*/
|
|
2025
|
+
subscriptions: Array<SubscriptionImportParams.Subscription>;
|
|
2026
|
+
/**
|
|
2027
|
+
* Integration ID to use for importing subscriptions
|
|
2028
|
+
*/
|
|
2029
|
+
integrationId?: string | null;
|
|
2030
|
+
}
|
|
2031
|
+
export declare namespace SubscriptionImportParams {
|
|
2032
|
+
interface Subscription {
|
|
456
2033
|
/**
|
|
457
|
-
* Subscription
|
|
2034
|
+
* Subscription ID
|
|
458
2035
|
*/
|
|
459
|
-
|
|
2036
|
+
id: string;
|
|
460
2037
|
/**
|
|
461
|
-
*
|
|
2038
|
+
* Customer ID
|
|
462
2039
|
*/
|
|
463
|
-
|
|
2040
|
+
customerId: string;
|
|
464
2041
|
/**
|
|
465
|
-
*
|
|
2042
|
+
* Plan ID
|
|
466
2043
|
*/
|
|
467
|
-
|
|
2044
|
+
planId: string;
|
|
2045
|
+
addons?: Array<Subscription.Addon>;
|
|
468
2046
|
/**
|
|
469
|
-
*
|
|
2047
|
+
* Billing ID
|
|
470
2048
|
*/
|
|
471
|
-
|
|
2049
|
+
billingId?: string | null;
|
|
472
2050
|
/**
|
|
473
|
-
*
|
|
2051
|
+
* Billing period (MONTHLY or ANNUALLY)
|
|
474
2052
|
*/
|
|
475
|
-
|
|
2053
|
+
billingPeriod?: 'MONTHLY' | 'ANNUALLY';
|
|
2054
|
+
charges?: Array<Subscription.Charge>;
|
|
476
2055
|
/**
|
|
477
2056
|
* Subscription end date
|
|
478
2057
|
*/
|
|
@@ -484,222 +2063,330 @@ export declare namespace SubscriptionMigrateResponse {
|
|
|
484
2063
|
[key: string]: string;
|
|
485
2064
|
};
|
|
486
2065
|
/**
|
|
487
|
-
*
|
|
2066
|
+
* Resource ID
|
|
488
2067
|
*/
|
|
489
|
-
|
|
2068
|
+
resourceId?: string | null;
|
|
490
2069
|
/**
|
|
491
|
-
*
|
|
2070
|
+
* Subscription start date
|
|
492
2071
|
*/
|
|
493
|
-
|
|
2072
|
+
startDate?: string;
|
|
2073
|
+
}
|
|
2074
|
+
namespace Subscription {
|
|
494
2075
|
/**
|
|
495
|
-
*
|
|
2076
|
+
* Addon configuration
|
|
496
2077
|
*/
|
|
497
|
-
|
|
2078
|
+
interface Addon {
|
|
2079
|
+
/**
|
|
2080
|
+
* Addon ID
|
|
2081
|
+
*/
|
|
2082
|
+
id: string;
|
|
2083
|
+
/**
|
|
2084
|
+
* Number of addon instances
|
|
2085
|
+
*/
|
|
2086
|
+
quantity: number;
|
|
2087
|
+
}
|
|
498
2088
|
/**
|
|
499
|
-
*
|
|
2089
|
+
* Charge item
|
|
500
2090
|
*/
|
|
501
|
-
|
|
2091
|
+
interface Charge {
|
|
2092
|
+
/**
|
|
2093
|
+
* Charge ID
|
|
2094
|
+
*/
|
|
2095
|
+
id: string;
|
|
2096
|
+
/**
|
|
2097
|
+
* Charge quantity
|
|
2098
|
+
*/
|
|
2099
|
+
quantity: number;
|
|
2100
|
+
/**
|
|
2101
|
+
* Charge type
|
|
2102
|
+
*/
|
|
2103
|
+
type: 'FEATURE' | 'CREDIT';
|
|
2104
|
+
}
|
|
502
2105
|
}
|
|
503
2106
|
}
|
|
504
|
-
export interface
|
|
505
|
-
|
|
2107
|
+
export interface SubscriptionMigrateParams {
|
|
2108
|
+
/**
|
|
2109
|
+
* When to migrate (immediate or period end)
|
|
2110
|
+
*/
|
|
2111
|
+
subscriptionMigrationTime?: 'END_OF_BILLING_PERIOD' | 'IMMEDIATE';
|
|
506
2112
|
}
|
|
507
|
-
export
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
2113
|
+
export interface SubscriptionPreviewParams {
|
|
2114
|
+
/**
|
|
2115
|
+
* Customer ID
|
|
2116
|
+
*/
|
|
2117
|
+
customerId: string;
|
|
2118
|
+
/**
|
|
2119
|
+
* Plan ID
|
|
2120
|
+
*/
|
|
2121
|
+
planId: string;
|
|
2122
|
+
/**
|
|
2123
|
+
* Addons to include
|
|
2124
|
+
*/
|
|
2125
|
+
addons?: Array<SubscriptionPreviewParams.Addon>;
|
|
2126
|
+
/**
|
|
2127
|
+
* Coupon or discount to apply
|
|
2128
|
+
*/
|
|
2129
|
+
appliedCoupon?: SubscriptionPreviewParams.AppliedCoupon;
|
|
2130
|
+
/**
|
|
2131
|
+
* Billable features with quantities
|
|
2132
|
+
*/
|
|
2133
|
+
billableFeatures?: Array<SubscriptionPreviewParams.BillableFeature>;
|
|
2134
|
+
/**
|
|
2135
|
+
* ISO 3166-1 country code for localization
|
|
2136
|
+
*/
|
|
2137
|
+
billingCountryCode?: string;
|
|
2138
|
+
/**
|
|
2139
|
+
* Billing cycle anchor behavior for the subscription
|
|
2140
|
+
*/
|
|
2141
|
+
billingCycleAnchor?: 'UNCHANGED' | 'NOW';
|
|
2142
|
+
/**
|
|
2143
|
+
* Billing and tax configuration
|
|
2144
|
+
*/
|
|
2145
|
+
billingInformation?: SubscriptionPreviewParams.BillingInformation;
|
|
2146
|
+
/**
|
|
2147
|
+
* Billing period (MONTHLY or ANNUALLY)
|
|
2148
|
+
*/
|
|
2149
|
+
billingPeriod?: 'MONTHLY' | 'ANNUALLY';
|
|
2150
|
+
/**
|
|
2151
|
+
* One-time or recurring charges
|
|
2152
|
+
*/
|
|
2153
|
+
charges?: Array<SubscriptionPreviewParams.Charge>;
|
|
2154
|
+
/**
|
|
2155
|
+
* Paying customer ID for delegated billing
|
|
2156
|
+
*/
|
|
2157
|
+
payingCustomerId?: string;
|
|
2158
|
+
/**
|
|
2159
|
+
* Resource ID for multi-instance subscriptions
|
|
2160
|
+
*/
|
|
2161
|
+
resourceId?: string;
|
|
2162
|
+
/**
|
|
2163
|
+
* When to apply subscription changes
|
|
2164
|
+
*/
|
|
2165
|
+
scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
|
|
2166
|
+
/**
|
|
2167
|
+
* Subscription start date
|
|
2168
|
+
*/
|
|
2169
|
+
startDate?: string;
|
|
2170
|
+
/**
|
|
2171
|
+
* Trial period override settings
|
|
2172
|
+
*/
|
|
2173
|
+
trialOverrideConfiguration?: SubscriptionPreviewParams.TrialOverrideConfiguration;
|
|
2174
|
+
/**
|
|
2175
|
+
* Unit quantity for per-unit pricing
|
|
2176
|
+
*/
|
|
2177
|
+
unitQuantity?: number;
|
|
2178
|
+
}
|
|
2179
|
+
export declare namespace SubscriptionPreviewParams {
|
|
2180
|
+
/**
|
|
2181
|
+
* Addon configuration
|
|
2182
|
+
*/
|
|
2183
|
+
interface Addon {
|
|
2184
|
+
/**
|
|
2185
|
+
* Addon ID
|
|
2186
|
+
*/
|
|
2187
|
+
id: string;
|
|
2188
|
+
/**
|
|
2189
|
+
* Number of addon instances
|
|
2190
|
+
*/
|
|
2191
|
+
quantity: number;
|
|
515
2192
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
currency: string;
|
|
551
|
-
description: string;
|
|
552
|
-
subTotal: number;
|
|
553
|
-
unitPrice: number;
|
|
554
|
-
quantity?: number;
|
|
555
|
-
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Coupon or discount to apply
|
|
2195
|
+
*/
|
|
2196
|
+
interface AppliedCoupon {
|
|
2197
|
+
/**
|
|
2198
|
+
* Billing provider coupon ID
|
|
2199
|
+
*/
|
|
2200
|
+
billingCouponId?: string;
|
|
2201
|
+
/**
|
|
2202
|
+
* Coupon timing configuration
|
|
2203
|
+
*/
|
|
2204
|
+
configuration?: AppliedCoupon.Configuration;
|
|
2205
|
+
/**
|
|
2206
|
+
* Stigg coupon ID
|
|
2207
|
+
*/
|
|
2208
|
+
couponId?: string;
|
|
2209
|
+
/**
|
|
2210
|
+
* Ad-hoc discount configuration
|
|
2211
|
+
*/
|
|
2212
|
+
discount?: AppliedCoupon.Discount;
|
|
2213
|
+
/**
|
|
2214
|
+
* Promotion code to apply
|
|
2215
|
+
*/
|
|
2216
|
+
promotionCode?: string;
|
|
2217
|
+
}
|
|
2218
|
+
namespace AppliedCoupon {
|
|
2219
|
+
/**
|
|
2220
|
+
* Coupon timing configuration
|
|
2221
|
+
*/
|
|
2222
|
+
interface Configuration {
|
|
2223
|
+
/**
|
|
2224
|
+
* Coupon start date
|
|
2225
|
+
*/
|
|
2226
|
+
startDate?: string;
|
|
556
2227
|
}
|
|
557
|
-
|
|
2228
|
+
/**
|
|
2229
|
+
* Ad-hoc discount configuration
|
|
2230
|
+
*/
|
|
2231
|
+
interface Discount {
|
|
558
2232
|
/**
|
|
559
|
-
*
|
|
2233
|
+
* Fixed amounts off by currency
|
|
560
2234
|
*/
|
|
561
|
-
|
|
2235
|
+
amountsOff?: Array<Discount.AmountsOff> | null;
|
|
562
2236
|
/**
|
|
563
|
-
*
|
|
2237
|
+
* Ad-hoc discount
|
|
564
2238
|
*/
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
discounts?: Array<RecurringInvoice.Discount>;
|
|
579
|
-
lines?: Array<RecurringInvoice.Line>;
|
|
580
|
-
tax?: number;
|
|
2239
|
+
description?: string;
|
|
2240
|
+
/**
|
|
2241
|
+
* Duration in months
|
|
2242
|
+
*/
|
|
2243
|
+
durationInMonths?: number;
|
|
2244
|
+
/**
|
|
2245
|
+
* Discount name
|
|
2246
|
+
*/
|
|
2247
|
+
name?: string;
|
|
2248
|
+
/**
|
|
2249
|
+
* Percentage discount
|
|
2250
|
+
*/
|
|
2251
|
+
percentOff?: number;
|
|
581
2252
|
}
|
|
582
|
-
namespace
|
|
583
|
-
interface
|
|
2253
|
+
namespace Discount {
|
|
2254
|
+
interface AmountsOff {
|
|
584
2255
|
/**
|
|
585
|
-
*
|
|
2256
|
+
* The price amount
|
|
586
2257
|
*/
|
|
587
|
-
|
|
2258
|
+
amount: number;
|
|
588
2259
|
/**
|
|
589
|
-
*
|
|
2260
|
+
* The price currency
|
|
590
2261
|
*/
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
interface DiscountDetails {
|
|
594
|
-
code?: string;
|
|
595
|
-
fixedAmount?: number;
|
|
596
|
-
percentage?: number;
|
|
597
|
-
}
|
|
598
|
-
interface Discount {
|
|
599
|
-
amount: number;
|
|
600
|
-
currency: string;
|
|
601
|
-
description: string;
|
|
602
|
-
}
|
|
603
|
-
interface Line {
|
|
604
|
-
currency: string;
|
|
605
|
-
description: string;
|
|
606
|
-
subTotal: number;
|
|
607
|
-
unitPrice: number;
|
|
608
|
-
quantity?: number;
|
|
2262
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
609
2263
|
}
|
|
610
2264
|
}
|
|
611
2265
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
export declare namespace SubscriptionTransferResponse {
|
|
617
|
-
interface Data {
|
|
2266
|
+
/**
|
|
2267
|
+
* Feature with quantity
|
|
2268
|
+
*/
|
|
2269
|
+
interface BillableFeature {
|
|
618
2270
|
/**
|
|
619
|
-
*
|
|
2271
|
+
* Feature ID
|
|
620
2272
|
*/
|
|
621
|
-
|
|
2273
|
+
featureId: string;
|
|
622
2274
|
/**
|
|
623
|
-
*
|
|
2275
|
+
* Quantity of feature units
|
|
624
2276
|
*/
|
|
625
|
-
|
|
2277
|
+
quantity: number;
|
|
2278
|
+
}
|
|
2279
|
+
/**
|
|
2280
|
+
* Billing and tax configuration
|
|
2281
|
+
*/
|
|
2282
|
+
interface BillingInformation {
|
|
626
2283
|
/**
|
|
627
|
-
*
|
|
2284
|
+
* Billing address
|
|
628
2285
|
*/
|
|
629
|
-
|
|
2286
|
+
billingAddress?: BillingInformation.BillingAddress;
|
|
630
2287
|
/**
|
|
631
|
-
*
|
|
2288
|
+
* Connected account ID for platform billing
|
|
632
2289
|
*/
|
|
633
|
-
|
|
2290
|
+
chargeOnBehalfOfAccount?: string;
|
|
634
2291
|
/**
|
|
635
|
-
*
|
|
2292
|
+
* Billing integration ID
|
|
636
2293
|
*/
|
|
637
|
-
|
|
2294
|
+
integrationId?: string;
|
|
638
2295
|
/**
|
|
639
|
-
*
|
|
2296
|
+
* Days until invoice is due
|
|
640
2297
|
*/
|
|
641
|
-
|
|
2298
|
+
invoiceDaysUntilDue?: number;
|
|
642
2299
|
/**
|
|
643
|
-
*
|
|
2300
|
+
* Whether subscription is backdated
|
|
644
2301
|
*/
|
|
645
|
-
|
|
2302
|
+
isBackdated?: boolean;
|
|
646
2303
|
/**
|
|
647
|
-
*
|
|
2304
|
+
* Whether invoice is already paid
|
|
648
2305
|
*/
|
|
649
|
-
|
|
2306
|
+
isInvoicePaid?: boolean;
|
|
650
2307
|
/**
|
|
651
|
-
*
|
|
2308
|
+
* Additional billing metadata
|
|
652
2309
|
*/
|
|
653
|
-
|
|
2310
|
+
metadata?: unknown;
|
|
654
2311
|
/**
|
|
655
|
-
*
|
|
2312
|
+
* Proration behavior
|
|
656
2313
|
*/
|
|
657
|
-
|
|
2314
|
+
prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
|
|
658
2315
|
/**
|
|
659
|
-
*
|
|
2316
|
+
* Customer tax IDs
|
|
660
2317
|
*/
|
|
661
|
-
|
|
2318
|
+
taxIds?: Array<BillingInformation.TaxID>;
|
|
662
2319
|
/**
|
|
663
|
-
*
|
|
2320
|
+
* Tax percentage to apply
|
|
664
2321
|
*/
|
|
665
|
-
|
|
2322
|
+
taxPercentage?: number;
|
|
666
2323
|
/**
|
|
667
|
-
*
|
|
2324
|
+
* Tax rate IDs from billing provider
|
|
668
2325
|
*/
|
|
669
|
-
|
|
2326
|
+
taxRateIds?: Array<string>;
|
|
2327
|
+
}
|
|
2328
|
+
namespace BillingInformation {
|
|
670
2329
|
/**
|
|
671
|
-
*
|
|
2330
|
+
* Billing address
|
|
672
2331
|
*/
|
|
673
|
-
|
|
2332
|
+
interface BillingAddress {
|
|
2333
|
+
city?: string;
|
|
2334
|
+
country?: string;
|
|
2335
|
+
line1?: string;
|
|
2336
|
+
line2?: string;
|
|
2337
|
+
postalCode?: string;
|
|
2338
|
+
state?: string;
|
|
2339
|
+
}
|
|
674
2340
|
/**
|
|
675
|
-
*
|
|
2341
|
+
* Tax exemption identifier
|
|
676
2342
|
*/
|
|
677
|
-
|
|
2343
|
+
interface TaxID {
|
|
2344
|
+
/**
|
|
2345
|
+
* Tax exemption type (e.g., vat, gst)
|
|
2346
|
+
*/
|
|
2347
|
+
type: string;
|
|
2348
|
+
/**
|
|
2349
|
+
* Tax exemption identifier value
|
|
2350
|
+
*/
|
|
2351
|
+
value: string;
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
/**
|
|
2355
|
+
* Charge item
|
|
2356
|
+
*/
|
|
2357
|
+
interface Charge {
|
|
678
2358
|
/**
|
|
679
|
-
*
|
|
2359
|
+
* Charge ID
|
|
680
2360
|
*/
|
|
681
|
-
|
|
682
|
-
[key: string]: string;
|
|
683
|
-
};
|
|
2361
|
+
id: string;
|
|
684
2362
|
/**
|
|
685
|
-
*
|
|
2363
|
+
* Charge quantity
|
|
686
2364
|
*/
|
|
687
|
-
|
|
2365
|
+
quantity: number;
|
|
688
2366
|
/**
|
|
689
|
-
*
|
|
2367
|
+
* Charge type
|
|
690
2368
|
*/
|
|
691
|
-
|
|
2369
|
+
type: 'FEATURE' | 'CREDIT';
|
|
2370
|
+
}
|
|
2371
|
+
/**
|
|
2372
|
+
* Trial period override settings
|
|
2373
|
+
*/
|
|
2374
|
+
interface TrialOverrideConfiguration {
|
|
692
2375
|
/**
|
|
693
|
-
*
|
|
2376
|
+
* Whether to start as trial
|
|
694
2377
|
*/
|
|
695
|
-
|
|
2378
|
+
isTrial: boolean;
|
|
696
2379
|
/**
|
|
697
|
-
*
|
|
2380
|
+
* Behavior when trial ends
|
|
698
2381
|
*/
|
|
699
|
-
|
|
2382
|
+
trialEndBehavior?: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
|
|
2383
|
+
/**
|
|
2384
|
+
* Trial end date
|
|
2385
|
+
*/
|
|
2386
|
+
trialEndDate?: string;
|
|
700
2387
|
}
|
|
701
2388
|
}
|
|
702
|
-
export interface
|
|
2389
|
+
export interface SubscriptionProvisionParams {
|
|
703
2390
|
/**
|
|
704
2391
|
* Customer ID to provision the subscription for
|
|
705
2392
|
*/
|
|
@@ -711,151 +2398,153 @@ export interface SubscriptionCreateParams {
|
|
|
711
2398
|
/**
|
|
712
2399
|
* Unique identifier for the subscription
|
|
713
2400
|
*/
|
|
714
|
-
id?: string
|
|
2401
|
+
id?: string;
|
|
2402
|
+
addons?: Array<SubscriptionProvisionParams.Addon>;
|
|
2403
|
+
/**
|
|
2404
|
+
* Coupon configuration
|
|
2405
|
+
*/
|
|
2406
|
+
appliedCoupon?: SubscriptionProvisionParams.AppliedCoupon;
|
|
715
2407
|
/**
|
|
716
2408
|
* Whether to wait for payment confirmation before returning the subscription
|
|
717
2409
|
*/
|
|
718
2410
|
awaitPaymentConfirmation?: boolean;
|
|
719
|
-
billingPeriod?: 'MONTHLY' | 'ANNUALLY';
|
|
720
|
-
checkoutOptions?: SubscriptionCreateParams.CheckoutOptions;
|
|
721
2411
|
/**
|
|
722
|
-
*
|
|
2412
|
+
* The ISO 3166-1 alpha-2 country code for billing
|
|
723
2413
|
*/
|
|
724
|
-
|
|
725
|
-
[key: string]: string;
|
|
726
|
-
};
|
|
2414
|
+
billingCountryCode?: string | null;
|
|
727
2415
|
/**
|
|
728
|
-
*
|
|
2416
|
+
* Billing cycle anchor behavior for the subscription
|
|
729
2417
|
*/
|
|
730
|
-
|
|
2418
|
+
billingCycleAnchor?: 'UNCHANGED' | 'NOW';
|
|
731
2419
|
/**
|
|
732
|
-
*
|
|
2420
|
+
* External billing system identifier
|
|
733
2421
|
*/
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}
|
|
737
|
-
export declare namespace SubscriptionCreateParams {
|
|
738
|
-
interface CheckoutOptions {
|
|
739
|
-
/**
|
|
740
|
-
* URL to redirect to if checkout is canceled
|
|
741
|
-
*/
|
|
742
|
-
cancelUrl: string;
|
|
743
|
-
/**
|
|
744
|
-
* URL to redirect to after successful checkout
|
|
745
|
-
*/
|
|
746
|
-
successUrl: string;
|
|
747
|
-
/**
|
|
748
|
-
* Allow promotional codes during checkout
|
|
749
|
-
*/
|
|
750
|
-
allowPromoCodes?: boolean;
|
|
751
|
-
/**
|
|
752
|
-
* Allow tax ID collection during checkout
|
|
753
|
-
*/
|
|
754
|
-
allowTaxIdCollection?: boolean;
|
|
755
|
-
/**
|
|
756
|
-
* Collect billing address during checkout
|
|
757
|
-
*/
|
|
758
|
-
collectBillingAddress?: boolean;
|
|
759
|
-
/**
|
|
760
|
-
* Collect phone number during checkout
|
|
761
|
-
*/
|
|
762
|
-
collectPhoneNumber?: boolean;
|
|
763
|
-
/**
|
|
764
|
-
* Optional reference ID for the checkout session
|
|
765
|
-
*/
|
|
766
|
-
referenceId?: string | null;
|
|
767
|
-
}
|
|
768
|
-
interface TrialOverrideConfiguration {
|
|
769
|
-
/**
|
|
770
|
-
* Whether the subscription should start with a trial period
|
|
771
|
-
*/
|
|
772
|
-
isTrial: boolean;
|
|
773
|
-
/**
|
|
774
|
-
* Behavior when trial ends: CONVERT_TO_PAID or CANCEL_SUBSCRIPTION
|
|
775
|
-
*/
|
|
776
|
-
trialEndBehavior?: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
|
|
777
|
-
/**
|
|
778
|
-
* Custom trial end date
|
|
779
|
-
*/
|
|
780
|
-
trialEndDate?: string;
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
export interface SubscriptionListParams extends MyCursorIDPageParams {
|
|
2422
|
+
billingId?: string | null;
|
|
2423
|
+
billingInformation?: SubscriptionProvisionParams.BillingInformation;
|
|
784
2424
|
/**
|
|
785
|
-
*
|
|
2425
|
+
* Billing period (MONTHLY or ANNUALLY)
|
|
786
2426
|
*/
|
|
787
|
-
|
|
2427
|
+
billingPeriod?: 'MONTHLY' | 'ANNUALLY';
|
|
2428
|
+
budget?: SubscriptionProvisionParams.Budget | null;
|
|
2429
|
+
charges?: Array<SubscriptionProvisionParams.Charge>;
|
|
788
2430
|
/**
|
|
789
|
-
*
|
|
790
|
-
* ACTIVE,IN_TRIAL)
|
|
2431
|
+
* Checkout page configuration for payment collection
|
|
791
2432
|
*/
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
export interface SubscriptionDelegateParams {
|
|
2433
|
+
checkoutOptions?: SubscriptionProvisionParams.CheckoutOptions;
|
|
2434
|
+
entitlements?: Array<SubscriptionProvisionParams.Feature | SubscriptionProvisionParams.Credit>;
|
|
795
2435
|
/**
|
|
796
|
-
*
|
|
2436
|
+
* Additional metadata for the subscription
|
|
797
2437
|
*/
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
2438
|
+
metadata?: {
|
|
2439
|
+
[key: string]: string;
|
|
2440
|
+
};
|
|
801
2441
|
/**
|
|
802
|
-
*
|
|
2442
|
+
* Minimum spend amount
|
|
803
2443
|
*/
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
2444
|
+
minimumSpend?: SubscriptionProvisionParams.MinimumSpend | null;
|
|
2445
|
+
/**
|
|
2446
|
+
* Optional paying customer ID for split billing scenarios
|
|
2447
|
+
*/
|
|
2448
|
+
payingCustomerId?: string | null;
|
|
2449
|
+
/**
|
|
2450
|
+
* How payments should be collected for this subscription
|
|
2451
|
+
*/
|
|
2452
|
+
paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE';
|
|
2453
|
+
priceOverrides?: Array<SubscriptionProvisionParams.PriceOverride>;
|
|
2454
|
+
/**
|
|
2455
|
+
* Optional resource ID for multi-instance subscriptions
|
|
2456
|
+
*/
|
|
2457
|
+
resourceId?: string | null;
|
|
807
2458
|
/**
|
|
808
|
-
*
|
|
2459
|
+
* Salesforce ID
|
|
809
2460
|
*/
|
|
810
|
-
|
|
2461
|
+
salesforceId?: string | null;
|
|
811
2462
|
/**
|
|
812
|
-
*
|
|
2463
|
+
* Strategy for scheduling subscription changes
|
|
813
2464
|
*/
|
|
814
|
-
planId: string;
|
|
815
|
-
addons?: Array<SubscriptionPreviewParams.Addon>;
|
|
816
|
-
appliedCoupon?: SubscriptionPreviewParams.AppliedCoupon;
|
|
817
|
-
billableFeatures?: Array<SubscriptionPreviewParams.BillableFeature>;
|
|
818
|
-
billingCountryCode?: string;
|
|
819
|
-
billingInformation?: SubscriptionPreviewParams.BillingInformation;
|
|
820
|
-
billingPeriod?: 'MONTHLY' | 'ANNUALLY';
|
|
821
|
-
charges?: Array<SubscriptionPreviewParams.Charge>;
|
|
822
|
-
payingCustomerId?: string;
|
|
823
|
-
resourceId?: string;
|
|
824
2465
|
scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
|
|
825
2466
|
/**
|
|
826
2467
|
* Subscription start date
|
|
827
2468
|
*/
|
|
828
2469
|
startDate?: string;
|
|
829
|
-
|
|
2470
|
+
/**
|
|
2471
|
+
* Trial period override settings
|
|
2472
|
+
*/
|
|
2473
|
+
trialOverrideConfiguration?: SubscriptionProvisionParams.TrialOverrideConfiguration;
|
|
830
2474
|
unitQuantity?: number;
|
|
831
2475
|
}
|
|
832
|
-
export declare namespace
|
|
2476
|
+
export declare namespace SubscriptionProvisionParams {
|
|
2477
|
+
/**
|
|
2478
|
+
* Addon configuration
|
|
2479
|
+
*/
|
|
833
2480
|
interface Addon {
|
|
834
2481
|
/**
|
|
835
2482
|
* Addon ID
|
|
836
2483
|
*/
|
|
837
|
-
|
|
838
|
-
|
|
2484
|
+
id: string;
|
|
2485
|
+
/**
|
|
2486
|
+
* Number of addon instances
|
|
2487
|
+
*/
|
|
2488
|
+
quantity: number;
|
|
839
2489
|
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Coupon configuration
|
|
2492
|
+
*/
|
|
840
2493
|
interface AppliedCoupon {
|
|
2494
|
+
/**
|
|
2495
|
+
* Billing provider coupon ID
|
|
2496
|
+
*/
|
|
841
2497
|
billingCouponId?: string;
|
|
2498
|
+
/**
|
|
2499
|
+
* Coupon timing configuration
|
|
2500
|
+
*/
|
|
842
2501
|
configuration?: AppliedCoupon.Configuration;
|
|
2502
|
+
/**
|
|
2503
|
+
* Stigg coupon ID
|
|
2504
|
+
*/
|
|
843
2505
|
couponId?: string;
|
|
2506
|
+
/**
|
|
2507
|
+
* Ad-hoc discount configuration
|
|
2508
|
+
*/
|
|
844
2509
|
discount?: AppliedCoupon.Discount;
|
|
2510
|
+
/**
|
|
2511
|
+
* Promotion code to apply
|
|
2512
|
+
*/
|
|
845
2513
|
promotionCode?: string;
|
|
846
2514
|
}
|
|
847
2515
|
namespace AppliedCoupon {
|
|
2516
|
+
/**
|
|
2517
|
+
* Coupon timing configuration
|
|
2518
|
+
*/
|
|
848
2519
|
interface Configuration {
|
|
849
2520
|
/**
|
|
850
2521
|
* Coupon start date
|
|
851
2522
|
*/
|
|
852
2523
|
startDate?: string;
|
|
853
2524
|
}
|
|
2525
|
+
/**
|
|
2526
|
+
* Ad-hoc discount configuration
|
|
2527
|
+
*/
|
|
854
2528
|
interface Discount {
|
|
2529
|
+
/**
|
|
2530
|
+
* Fixed amounts off by currency
|
|
2531
|
+
*/
|
|
855
2532
|
amountsOff?: Array<Discount.AmountsOff> | null;
|
|
2533
|
+
/**
|
|
2534
|
+
* Ad-hoc discount
|
|
2535
|
+
*/
|
|
856
2536
|
description?: string;
|
|
2537
|
+
/**
|
|
2538
|
+
* Duration in months
|
|
2539
|
+
*/
|
|
857
2540
|
durationInMonths?: number;
|
|
2541
|
+
/**
|
|
2542
|
+
* Discount name
|
|
2543
|
+
*/
|
|
858
2544
|
name?: string;
|
|
2545
|
+
/**
|
|
2546
|
+
* Percentage discount
|
|
2547
|
+
*/
|
|
859
2548
|
percentOff?: number;
|
|
860
2549
|
}
|
|
861
2550
|
namespace Discount {
|
|
@@ -871,27 +2560,58 @@ export declare namespace SubscriptionPreviewParams {
|
|
|
871
2560
|
}
|
|
872
2561
|
}
|
|
873
2562
|
}
|
|
874
|
-
interface
|
|
2563
|
+
interface BillingInformation {
|
|
875
2564
|
/**
|
|
876
|
-
*
|
|
2565
|
+
* Billing address for the subscription
|
|
877
2566
|
*/
|
|
878
|
-
featureId: string;
|
|
879
|
-
quantity: number;
|
|
880
|
-
}
|
|
881
|
-
interface BillingInformation {
|
|
882
2567
|
billingAddress?: BillingInformation.BillingAddress;
|
|
883
|
-
|
|
884
|
-
|
|
2568
|
+
/**
|
|
2569
|
+
* Stripe Connect account to charge on behalf of
|
|
2570
|
+
*/
|
|
2571
|
+
chargeOnBehalfOfAccount?: string | null;
|
|
2572
|
+
/**
|
|
2573
|
+
* Billing integration identifier
|
|
2574
|
+
*/
|
|
2575
|
+
integrationId?: string | null;
|
|
2576
|
+
/**
|
|
2577
|
+
* Number of days until invoice is due
|
|
2578
|
+
*/
|
|
885
2579
|
invoiceDaysUntilDue?: number;
|
|
2580
|
+
/**
|
|
2581
|
+
* Whether the subscription is backdated
|
|
2582
|
+
*/
|
|
886
2583
|
isBackdated?: boolean;
|
|
2584
|
+
/**
|
|
2585
|
+
* Whether the invoice is marked as paid
|
|
2586
|
+
*/
|
|
887
2587
|
isInvoicePaid?: boolean;
|
|
888
|
-
|
|
2588
|
+
/**
|
|
2589
|
+
* Additional metadata for the subscription
|
|
2590
|
+
*/
|
|
2591
|
+
metadata?: {
|
|
2592
|
+
[key: string]: string;
|
|
2593
|
+
};
|
|
2594
|
+
/**
|
|
2595
|
+
* How to handle proration for billing changes
|
|
2596
|
+
*/
|
|
889
2597
|
prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
|
|
2598
|
+
/**
|
|
2599
|
+
* Customer tax identification numbers
|
|
2600
|
+
*/
|
|
890
2601
|
taxIds?: Array<BillingInformation.TaxID>;
|
|
2602
|
+
/**
|
|
2603
|
+
* Tax percentage (0-100)
|
|
2604
|
+
*/
|
|
891
2605
|
taxPercentage?: number;
|
|
2606
|
+
/**
|
|
2607
|
+
* Tax rate identifiers to apply
|
|
2608
|
+
*/
|
|
892
2609
|
taxRateIds?: Array<string>;
|
|
893
2610
|
}
|
|
894
2611
|
namespace BillingInformation {
|
|
2612
|
+
/**
|
|
2613
|
+
* Billing address for the subscription
|
|
2614
|
+
*/
|
|
895
2615
|
interface BillingAddress {
|
|
896
2616
|
city?: string;
|
|
897
2617
|
country?: string;
|
|
@@ -901,36 +2621,302 @@ export declare namespace SubscriptionPreviewParams {
|
|
|
901
2621
|
state?: string;
|
|
902
2622
|
}
|
|
903
2623
|
interface TaxID {
|
|
2624
|
+
/**
|
|
2625
|
+
* The type of tax exemption identifier, such as VAT.
|
|
2626
|
+
*/
|
|
904
2627
|
type: string;
|
|
2628
|
+
/**
|
|
2629
|
+
* The actual tax identifier value
|
|
2630
|
+
*/
|
|
905
2631
|
value: string;
|
|
906
2632
|
}
|
|
907
2633
|
}
|
|
2634
|
+
interface Budget {
|
|
2635
|
+
/**
|
|
2636
|
+
* Whether the budget is a soft limit
|
|
2637
|
+
*/
|
|
2638
|
+
hasSoftLimit: boolean;
|
|
2639
|
+
/**
|
|
2640
|
+
* Maximum spending limit
|
|
2641
|
+
*/
|
|
2642
|
+
limit: number;
|
|
2643
|
+
}
|
|
2644
|
+
/**
|
|
2645
|
+
* Charge item
|
|
2646
|
+
*/
|
|
908
2647
|
interface Charge {
|
|
909
2648
|
/**
|
|
910
2649
|
* Charge ID
|
|
911
2650
|
*/
|
|
912
2651
|
id: string;
|
|
2652
|
+
/**
|
|
2653
|
+
* Charge quantity
|
|
2654
|
+
*/
|
|
913
2655
|
quantity: number;
|
|
2656
|
+
/**
|
|
2657
|
+
* Charge type
|
|
2658
|
+
*/
|
|
914
2659
|
type: 'FEATURE' | 'CREDIT';
|
|
915
2660
|
}
|
|
2661
|
+
/**
|
|
2662
|
+
* Checkout page configuration for payment collection
|
|
2663
|
+
*/
|
|
2664
|
+
interface CheckoutOptions {
|
|
2665
|
+
/**
|
|
2666
|
+
* URL to redirect to if checkout is canceled
|
|
2667
|
+
*/
|
|
2668
|
+
cancelUrl: string;
|
|
2669
|
+
/**
|
|
2670
|
+
* URL to redirect to after successful checkout
|
|
2671
|
+
*/
|
|
2672
|
+
successUrl: string;
|
|
2673
|
+
/**
|
|
2674
|
+
* Allow promotional codes during checkout
|
|
2675
|
+
*/
|
|
2676
|
+
allowPromoCodes?: boolean;
|
|
2677
|
+
/**
|
|
2678
|
+
* Allow tax ID collection during checkout
|
|
2679
|
+
*/
|
|
2680
|
+
allowTaxIdCollection?: boolean;
|
|
2681
|
+
/**
|
|
2682
|
+
* Collect billing address during checkout
|
|
2683
|
+
*/
|
|
2684
|
+
collectBillingAddress?: boolean;
|
|
2685
|
+
/**
|
|
2686
|
+
* Collect phone number during checkout
|
|
2687
|
+
*/
|
|
2688
|
+
collectPhoneNumber?: boolean;
|
|
2689
|
+
/**
|
|
2690
|
+
* Optional reference ID for the checkout session
|
|
2691
|
+
*/
|
|
2692
|
+
referenceId?: string | null;
|
|
2693
|
+
}
|
|
2694
|
+
/**
|
|
2695
|
+
* Feature entitlement configuration for a subscription
|
|
2696
|
+
*/
|
|
2697
|
+
interface Feature {
|
|
2698
|
+
/**
|
|
2699
|
+
* The feature ID to attach the entitlement to
|
|
2700
|
+
*/
|
|
2701
|
+
id: string;
|
|
2702
|
+
/**
|
|
2703
|
+
* SubscriptionFeatureEntitlementRequest
|
|
2704
|
+
*/
|
|
2705
|
+
type: 'FEATURE';
|
|
2706
|
+
/**
|
|
2707
|
+
* Whether the usage limit is a soft limit
|
|
2708
|
+
*/
|
|
2709
|
+
hasSoftLimit?: boolean;
|
|
2710
|
+
/**
|
|
2711
|
+
* Whether usage is unlimited
|
|
2712
|
+
*/
|
|
2713
|
+
hasUnlimitedUsage?: boolean;
|
|
2714
|
+
/**
|
|
2715
|
+
* Configuration for monthly reset period
|
|
2716
|
+
*/
|
|
2717
|
+
monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
|
|
2718
|
+
/**
|
|
2719
|
+
* Period at which usage resets
|
|
2720
|
+
*/
|
|
2721
|
+
resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
|
|
2722
|
+
/**
|
|
2723
|
+
* Maximum allowed usage for the feature
|
|
2724
|
+
*/
|
|
2725
|
+
usageLimit?: number;
|
|
2726
|
+
/**
|
|
2727
|
+
* Configuration for weekly reset period
|
|
2728
|
+
*/
|
|
2729
|
+
weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
|
|
2730
|
+
/**
|
|
2731
|
+
* Configuration for yearly reset period
|
|
2732
|
+
*/
|
|
2733
|
+
yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
|
|
2734
|
+
}
|
|
2735
|
+
namespace Feature {
|
|
2736
|
+
/**
|
|
2737
|
+
* Configuration for monthly reset period
|
|
2738
|
+
*/
|
|
2739
|
+
interface MonthlyResetPeriodConfiguration {
|
|
2740
|
+
/**
|
|
2741
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
2742
|
+
*/
|
|
2743
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Configuration for weekly reset period
|
|
2747
|
+
*/
|
|
2748
|
+
interface WeeklyResetPeriodConfiguration {
|
|
2749
|
+
/**
|
|
2750
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
2751
|
+
*/
|
|
2752
|
+
accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
|
|
2753
|
+
}
|
|
2754
|
+
/**
|
|
2755
|
+
* Configuration for yearly reset period
|
|
2756
|
+
*/
|
|
2757
|
+
interface YearlyResetPeriodConfiguration {
|
|
2758
|
+
/**
|
|
2759
|
+
* Reset anchor (SubscriptionStart)
|
|
2760
|
+
*/
|
|
2761
|
+
accordingTo: 'SubscriptionStart';
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
/**
|
|
2765
|
+
* Credit entitlement configuration for a subscription
|
|
2766
|
+
*/
|
|
2767
|
+
interface Credit {
|
|
2768
|
+
/**
|
|
2769
|
+
* The custom currency ID for the credit entitlement
|
|
2770
|
+
*/
|
|
2771
|
+
id: string;
|
|
2772
|
+
/**
|
|
2773
|
+
* Credit grant amount
|
|
2774
|
+
*/
|
|
2775
|
+
amount: number;
|
|
2776
|
+
/**
|
|
2777
|
+
* Credit grant cadence (MONTH or YEAR)
|
|
2778
|
+
*/
|
|
2779
|
+
cadence: 'MONTH' | 'YEAR';
|
|
2780
|
+
/**
|
|
2781
|
+
* SubscriptionCreditEntitlementRequest
|
|
2782
|
+
*/
|
|
2783
|
+
type: 'CREDIT';
|
|
2784
|
+
}
|
|
2785
|
+
/**
|
|
2786
|
+
* Minimum spend amount
|
|
2787
|
+
*/
|
|
2788
|
+
interface MinimumSpend {
|
|
2789
|
+
/**
|
|
2790
|
+
* The price amount
|
|
2791
|
+
*/
|
|
2792
|
+
amount?: number;
|
|
2793
|
+
/**
|
|
2794
|
+
* The price currency
|
|
2795
|
+
*/
|
|
2796
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
2797
|
+
}
|
|
2798
|
+
interface PriceOverride {
|
|
2799
|
+
/**
|
|
2800
|
+
* Addon identifier for the price override
|
|
2801
|
+
*/
|
|
2802
|
+
addonId?: string | null;
|
|
2803
|
+
/**
|
|
2804
|
+
* The price amount
|
|
2805
|
+
*/
|
|
2806
|
+
amount?: number;
|
|
2807
|
+
/**
|
|
2808
|
+
* Whether this is a base charge override
|
|
2809
|
+
*/
|
|
2810
|
+
baseCharge?: boolean;
|
|
2811
|
+
/**
|
|
2812
|
+
* The billing country code of the price
|
|
2813
|
+
*/
|
|
2814
|
+
billingCountryCode?: string;
|
|
2815
|
+
/**
|
|
2816
|
+
* Block size for pricing
|
|
2817
|
+
*/
|
|
2818
|
+
blockSize?: number;
|
|
2819
|
+
creditGrantCadence?: 'BEGINNING_OF_BILLING_PERIOD' | 'MONTHLY';
|
|
2820
|
+
creditRate?: PriceOverride.CreditRate;
|
|
2821
|
+
/**
|
|
2822
|
+
* The price currency
|
|
2823
|
+
*/
|
|
2824
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
2825
|
+
/**
|
|
2826
|
+
* Feature identifier for the price override
|
|
2827
|
+
*/
|
|
2828
|
+
featureId?: string | null;
|
|
2829
|
+
/**
|
|
2830
|
+
* Pricing tiers configuration
|
|
2831
|
+
*/
|
|
2832
|
+
tiers?: Array<PriceOverride.Tier>;
|
|
2833
|
+
}
|
|
2834
|
+
namespace PriceOverride {
|
|
2835
|
+
interface CreditRate {
|
|
2836
|
+
/**
|
|
2837
|
+
* The credit rate amount
|
|
2838
|
+
*/
|
|
2839
|
+
amount: number;
|
|
2840
|
+
/**
|
|
2841
|
+
* The custom currency refId for the credit rate
|
|
2842
|
+
*/
|
|
2843
|
+
currencyId: string;
|
|
2844
|
+
/**
|
|
2845
|
+
* A custom formula for calculating cost based on single event dimensions
|
|
2846
|
+
*/
|
|
2847
|
+
costFormula?: string | null;
|
|
2848
|
+
}
|
|
2849
|
+
interface Tier {
|
|
2850
|
+
/**
|
|
2851
|
+
* The flat fee price of the price tier
|
|
2852
|
+
*/
|
|
2853
|
+
flatPrice?: Tier.FlatPrice;
|
|
2854
|
+
/**
|
|
2855
|
+
* The unit price of the price tier
|
|
2856
|
+
*/
|
|
2857
|
+
unitPrice?: Tier.UnitPrice;
|
|
2858
|
+
/**
|
|
2859
|
+
* The up to quantity of the price tier
|
|
2860
|
+
*/
|
|
2861
|
+
upTo?: number;
|
|
2862
|
+
}
|
|
2863
|
+
namespace Tier {
|
|
2864
|
+
/**
|
|
2865
|
+
* The flat fee price of the price tier
|
|
2866
|
+
*/
|
|
2867
|
+
interface FlatPrice {
|
|
2868
|
+
/**
|
|
2869
|
+
* The price amount
|
|
2870
|
+
*/
|
|
2871
|
+
amount: number;
|
|
2872
|
+
/**
|
|
2873
|
+
* The price currency
|
|
2874
|
+
*/
|
|
2875
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
2876
|
+
}
|
|
2877
|
+
/**
|
|
2878
|
+
* The unit price of the price tier
|
|
2879
|
+
*/
|
|
2880
|
+
interface UnitPrice {
|
|
2881
|
+
/**
|
|
2882
|
+
* The price amount
|
|
2883
|
+
*/
|
|
2884
|
+
amount: number;
|
|
2885
|
+
/**
|
|
2886
|
+
* The price currency
|
|
2887
|
+
*/
|
|
2888
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
/**
|
|
2893
|
+
* Trial period override settings
|
|
2894
|
+
*/
|
|
916
2895
|
interface TrialOverrideConfiguration {
|
|
2896
|
+
/**
|
|
2897
|
+
* Whether the subscription should start with a trial period
|
|
2898
|
+
*/
|
|
917
2899
|
isTrial: boolean;
|
|
2900
|
+
/**
|
|
2901
|
+
* Behavior when trial ends: CONVERT_TO_PAID or CANCEL_SUBSCRIPTION
|
|
2902
|
+
*/
|
|
918
2903
|
trialEndBehavior?: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
|
|
919
2904
|
/**
|
|
920
|
-
*
|
|
2905
|
+
* Custom trial end date
|
|
921
2906
|
*/
|
|
922
2907
|
trialEndDate?: string;
|
|
923
2908
|
}
|
|
924
2909
|
}
|
|
925
2910
|
export interface SubscriptionTransferParams {
|
|
926
2911
|
/**
|
|
927
|
-
*
|
|
928
|
-
* belong to the same customer.
|
|
2912
|
+
* Resource ID to transfer the subscription to
|
|
929
2913
|
*/
|
|
930
2914
|
destinationResourceId: string;
|
|
931
2915
|
}
|
|
932
2916
|
export declare namespace Subscriptions {
|
|
933
|
-
export { type
|
|
934
|
-
export {
|
|
2917
|
+
export { type Subscription as Subscription, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionImportResponse as SubscriptionImportResponse, type SubscriptionPreviewResponse as SubscriptionPreviewResponse, type SubscriptionProvisionResponse as SubscriptionProvisionResponse, type SubscriptionListResponsesMyCursorIDPage as SubscriptionListResponsesMyCursorIDPage, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionDelegateParams as SubscriptionDelegateParams, type SubscriptionImportParams as SubscriptionImportParams, type SubscriptionMigrateParams as SubscriptionMigrateParams, type SubscriptionPreviewParams as SubscriptionPreviewParams, type SubscriptionProvisionParams as SubscriptionProvisionParams, type SubscriptionTransferParams as SubscriptionTransferParams, };
|
|
2918
|
+
export { FutureUpdateAPIFutureUpdate as FutureUpdate, type CancelSubscription as CancelSubscription };
|
|
2919
|
+
export { Usage as Usage, type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, };
|
|
2920
|
+
export { Invoice as Invoice, type InvoiceMarkAsPaidResponse as InvoiceMarkAsPaidResponse };
|
|
935
2921
|
}
|
|
936
2922
|
//# sourceMappingURL=subscriptions.d.mts.map
|