orb-billing 4.15.0 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/_shims/README.md +0 -0
- package/_shims/auto/types.d.ts +0 -0
- package/_shims/auto/types.js +0 -0
- package/_shims/auto/types.mjs +0 -0
- package/_shims/index.d.ts +0 -0
- package/_shims/index.js +0 -0
- package/_shims/index.mjs +0 -0
- package/_shims/manual-types.d.ts +0 -0
- package/_shims/manual-types.js +0 -0
- package/_shims/manual-types.mjs +0 -0
- package/_shims/node-types.d.ts +0 -0
- package/_shims/node-types.js +0 -0
- package/_shims/node-types.mjs +0 -0
- package/_shims/web-types.d.ts +0 -0
- package/_shims/web-types.js +0 -0
- package/_shims/web-types.mjs +0 -0
- package/package.json +2 -2
- package/resources/subscriptions.d.ts +246 -2
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/_shims/MultipartBody.ts +0 -0
- package/src/_shims/README.md +0 -0
- package/src/_shims/auto/runtime-bun.ts +0 -0
- package/src/_shims/auto/runtime-node.ts +0 -0
- package/src/_shims/auto/runtime.ts +0 -0
- package/src/_shims/auto/types-node.ts +0 -0
- package/src/_shims/auto/types.d.ts +0 -0
- package/src/_shims/auto/types.js +0 -0
- package/src/_shims/auto/types.mjs +0 -0
- package/src/_shims/bun-runtime.ts +0 -0
- package/src/_shims/index.d.ts +0 -0
- package/src/_shims/index.js +0 -0
- package/src/_shims/index.mjs +0 -0
- package/src/_shims/manual-types.d.ts +0 -0
- package/src/_shims/manual-types.js +0 -0
- package/src/_shims/manual-types.mjs +0 -0
- package/src/_shims/node-runtime.ts +0 -0
- package/src/_shims/node-types.d.ts +0 -0
- package/src/_shims/node-types.js +0 -0
- package/src/_shims/node-types.mjs +0 -0
- package/src/_shims/registry.ts +0 -0
- package/src/_shims/web-runtime.ts +0 -0
- package/src/_shims/web-types.d.ts +0 -0
- package/src/_shims/web-types.js +0 -0
- package/src/_shims/web-types.mjs +0 -0
- package/src/core.ts +0 -0
- package/src/error.ts +0 -0
- package/src/index.ts +0 -0
- package/src/lib/.keep +0 -0
- package/src/pagination.ts +0 -0
- package/src/resource.ts +0 -0
- package/src/resources/alerts.ts +0 -0
- package/src/resources/coupons/coupons.ts +0 -0
- package/src/resources/coupons/index.ts +0 -0
- package/src/resources/coupons/subscriptions.ts +0 -0
- package/src/resources/credit-notes.ts +0 -0
- package/src/resources/customers/balance-transactions.ts +0 -0
- package/src/resources/customers/costs.ts +0 -0
- package/src/resources/customers/credits/credits.ts +0 -0
- package/src/resources/customers/credits/index.ts +0 -0
- package/src/resources/customers/credits/ledger.ts +0 -0
- package/src/resources/customers/credits/top-ups.ts +0 -0
- package/src/resources/customers/customers.ts +0 -0
- package/src/resources/customers/index.ts +0 -0
- package/src/resources/events/backfills.ts +0 -0
- package/src/resources/events/events.ts +0 -0
- package/src/resources/events/index.ts +0 -0
- package/src/resources/index.ts +0 -0
- package/src/resources/invoice-line-items.ts +0 -0
- package/src/resources/invoices.ts +0 -0
- package/src/resources/items.ts +0 -0
- package/src/resources/metrics.ts +0 -0
- package/src/resources/plans/external-plan-id.ts +0 -0
- package/src/resources/plans/index.ts +0 -0
- package/src/resources/plans/plans.ts +0 -0
- package/src/resources/prices/external-price-id.ts +0 -0
- package/src/resources/prices/index.ts +0 -0
- package/src/resources/prices/prices.ts +0 -0
- package/src/resources/shared.ts +0 -0
- package/src/resources/subscriptions.ts +308 -0
- package/src/resources/top-level.ts +0 -0
- package/src/shims/node.ts +0 -0
- package/src/shims/web.ts +0 -0
- package/src/tsconfig.json +0 -0
- package/src/uploads.ts +11 -4
- package/src/version.ts +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js +10 -4
- package/uploads.js.map +1 -1
- package/uploads.mjs +10 -4
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.16.0 (2024-09-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.15.1...v4.16.0](https://github.com/orbcorp/orb-node/compare/v4.15.1...v4.16.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** OpenAPI spec update via Stainless API ([#308](https://github.com/orbcorp/orb-node/issues/308)) ([6ff542e](https://github.com/orbcorp/orb-node/commit/6ff542e1e1f36fad4d9c92c891872113bcb50e63))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **uploads:** avoid making redundant memory copies ([#309](https://github.com/orbcorp/orb-node/issues/309)) ([f626def](https://github.com/orbcorp/orb-node/commit/f626deff3d2af5dc08d0d9d44f9e91924750c0c6))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Chores
|
|
18
|
+
|
|
19
|
+
* **internal:** dependency updates ([#305](https://github.com/orbcorp/orb-node/issues/305)) ([b647ed0](https://github.com/orbcorp/orb-node/commit/b647ed07527e9b40d86c6262cd042f906b33abe4))
|
|
20
|
+
* **internal:** minor bump qs version ([#307](https://github.com/orbcorp/orb-node/issues/307)) ([e69ddaf](https://github.com/orbcorp/orb-node/commit/e69ddafc73d93581b55f05c0d86d521ecf030125))
|
|
21
|
+
|
|
22
|
+
## 4.15.1 (2024-09-05)
|
|
23
|
+
|
|
24
|
+
Full Changelog: [v4.15.0...v4.15.1](https://github.com/orbcorp/orb-node/compare/v4.15.0...v4.15.1)
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **client:** correct File construction from node-fetch Responses ([#302](https://github.com/orbcorp/orb-node/issues/302)) ([839e3d5](https://github.com/orbcorp/orb-node/commit/839e3d5923ca3da60dd92231326847f53562980d))
|
|
29
|
+
|
|
3
30
|
## 4.15.0 (2024-09-05)
|
|
4
31
|
|
|
5
32
|
Full Changelog: [v4.14.0...v4.15.0](https://github.com/orbcorp/orb-node/compare/v4.14.0...v4.15.0)
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/_shims/README.md
CHANGED
|
File without changes
|
package/_shims/auto/types.d.ts
CHANGED
|
File without changes
|
package/_shims/auto/types.js
CHANGED
|
File without changes
|
package/_shims/auto/types.mjs
CHANGED
|
File without changes
|
package/_shims/index.d.ts
CHANGED
|
File without changes
|
package/_shims/index.js
CHANGED
|
File without changes
|
package/_shims/index.mjs
CHANGED
|
File without changes
|
package/_shims/manual-types.d.ts
CHANGED
|
File without changes
|
package/_shims/manual-types.js
CHANGED
|
File without changes
|
package/_shims/manual-types.mjs
CHANGED
|
File without changes
|
package/_shims/node-types.d.ts
CHANGED
|
File without changes
|
package/_shims/node-types.js
CHANGED
|
File without changes
|
package/_shims/node-types.mjs
CHANGED
|
File without changes
|
package/_shims/web-types.d.ts
CHANGED
|
File without changes
|
package/_shims/web-types.js
CHANGED
|
File without changes
|
package/_shims/web-types.mjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orb-billing",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.0",
|
|
4
4
|
"description": "The official TypeScript library for the Orb API",
|
|
5
5
|
"author": "Orb <team@withorb.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@types/node": "^18.11.18",
|
|
26
26
|
"@types/node-fetch": "^2.6.4",
|
|
27
|
-
"@types/qs": "^6.9.
|
|
27
|
+
"@types/qs": "^6.9.15",
|
|
28
28
|
"abort-controller": "^3.0.0",
|
|
29
29
|
"agentkeepalive": "^4.2.1",
|
|
30
30
|
"form-data-encoder": "1.7.2",
|
|
@@ -1959,7 +1959,7 @@ export interface SubscriptionCreateParams {
|
|
|
1959
1959
|
/**
|
|
1960
1960
|
* Optionally provide a list of overrides for prices on the plan
|
|
1961
1961
|
*/
|
|
1962
|
-
price_overrides?: Array<SubscriptionCreateParams.OverrideUnitPrice | SubscriptionCreateParams.OverridePackagePrice | SubscriptionCreateParams.OverrideMatrixPrice | SubscriptionCreateParams.OverrideTieredPrice | SubscriptionCreateParams.OverrideTieredBpsPrice | SubscriptionCreateParams.OverrideBpsPrice | SubscriptionCreateParams.OverrideBulkBpsPrice | SubscriptionCreateParams.OverrideBulkPrice | SubscriptionCreateParams.OverrideThresholdTotalAmountPrice | SubscriptionCreateParams.OverrideTieredPackagePrice | SubscriptionCreateParams.OverrideTieredWithMinimumPrice | SubscriptionCreateParams.OverridePackageWithAllocationPrice | SubscriptionCreateParams.OverrideUnitWithPercentPrice | SubscriptionCreateParams.OverrideGroupedAllocationPrice | SubscriptionCreateParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionCreateParams.OverrideBulkWithProrationPrice> | null;
|
|
1962
|
+
price_overrides?: Array<SubscriptionCreateParams.OverrideUnitPrice | SubscriptionCreateParams.OverridePackagePrice | SubscriptionCreateParams.OverrideMatrixPrice | SubscriptionCreateParams.OverrideTieredPrice | SubscriptionCreateParams.OverrideTieredBpsPrice | SubscriptionCreateParams.OverrideBpsPrice | SubscriptionCreateParams.OverrideBulkBpsPrice | SubscriptionCreateParams.OverrideBulkPrice | SubscriptionCreateParams.OverrideThresholdTotalAmountPrice | SubscriptionCreateParams.OverrideTieredPackagePrice | SubscriptionCreateParams.OverrideTieredWithMinimumPrice | SubscriptionCreateParams.OverridePackageWithAllocationPrice | SubscriptionCreateParams.OverrideUnitWithPercentPrice | SubscriptionCreateParams.OverrideGroupedAllocationPrice | SubscriptionCreateParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionCreateParams.OverrideBulkWithProrationPrice | SubscriptionCreateParams.OverrideUnitWithProrationPrice | SubscriptionCreateParams.OverrideTieredWithProrationPrice> | null;
|
|
1963
1963
|
start_date?: string | null;
|
|
1964
1964
|
}
|
|
1965
1965
|
export declare namespace SubscriptionCreateParams {
|
|
@@ -3104,6 +3104,128 @@ export declare namespace SubscriptionCreateParams {
|
|
|
3104
3104
|
usage_discount?: number | null;
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
|
+
interface OverrideUnitWithProrationPrice {
|
|
3108
|
+
id: string;
|
|
3109
|
+
model_type: 'unit_with_proration';
|
|
3110
|
+
unit_with_proration_config: Record<string, unknown>;
|
|
3111
|
+
/**
|
|
3112
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
3113
|
+
*/
|
|
3114
|
+
conversion_rate?: number | null;
|
|
3115
|
+
/**
|
|
3116
|
+
* The currency of the price. If not provided, the currency of the plan will be
|
|
3117
|
+
* used.
|
|
3118
|
+
*/
|
|
3119
|
+
currency?: string | null;
|
|
3120
|
+
/**
|
|
3121
|
+
* The subscription's override discount for the plan.
|
|
3122
|
+
*/
|
|
3123
|
+
discount?: OverrideUnitWithProrationPrice.Discount | null;
|
|
3124
|
+
/**
|
|
3125
|
+
* The starting quantity of the price, if the price is a fixed price.
|
|
3126
|
+
*/
|
|
3127
|
+
fixed_price_quantity?: number | null;
|
|
3128
|
+
/**
|
|
3129
|
+
* The subscription's override maximum amount for the plan.
|
|
3130
|
+
*/
|
|
3131
|
+
maximum_amount?: string | null;
|
|
3132
|
+
/**
|
|
3133
|
+
* The subscription's override minimum amount for the plan.
|
|
3134
|
+
*/
|
|
3135
|
+
minimum_amount?: string | null;
|
|
3136
|
+
}
|
|
3137
|
+
namespace OverrideUnitWithProrationPrice {
|
|
3138
|
+
/**
|
|
3139
|
+
* The subscription's override discount for the plan.
|
|
3140
|
+
*/
|
|
3141
|
+
interface Discount {
|
|
3142
|
+
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
|
|
3143
|
+
/**
|
|
3144
|
+
* Only available if discount_type is `amount`.
|
|
3145
|
+
*/
|
|
3146
|
+
amount_discount?: string | null;
|
|
3147
|
+
/**
|
|
3148
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
3149
|
+
* this can be a subset of prices.
|
|
3150
|
+
*/
|
|
3151
|
+
applies_to_price_ids?: Array<string> | null;
|
|
3152
|
+
/**
|
|
3153
|
+
* Only available if discount_type is `percentage`. This is a number between 0
|
|
3154
|
+
* and 1.
|
|
3155
|
+
*/
|
|
3156
|
+
percentage_discount?: number | null;
|
|
3157
|
+
/**
|
|
3158
|
+
* Only available if discount_type is `trial`
|
|
3159
|
+
*/
|
|
3160
|
+
trial_amount_discount?: string | null;
|
|
3161
|
+
/**
|
|
3162
|
+
* Only available if discount_type is `usage`. Number of usage units that this
|
|
3163
|
+
* discount is for
|
|
3164
|
+
*/
|
|
3165
|
+
usage_discount?: number | null;
|
|
3166
|
+
}
|
|
3167
|
+
}
|
|
3168
|
+
interface OverrideTieredWithProrationPrice {
|
|
3169
|
+
id: string;
|
|
3170
|
+
model_type: 'tiered_with_proration';
|
|
3171
|
+
tiered_with_proration_config: Record<string, unknown>;
|
|
3172
|
+
/**
|
|
3173
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
3174
|
+
*/
|
|
3175
|
+
conversion_rate?: number | null;
|
|
3176
|
+
/**
|
|
3177
|
+
* The currency of the price. If not provided, the currency of the plan will be
|
|
3178
|
+
* used.
|
|
3179
|
+
*/
|
|
3180
|
+
currency?: string | null;
|
|
3181
|
+
/**
|
|
3182
|
+
* The subscription's override discount for the plan.
|
|
3183
|
+
*/
|
|
3184
|
+
discount?: OverrideTieredWithProrationPrice.Discount | null;
|
|
3185
|
+
/**
|
|
3186
|
+
* The starting quantity of the price, if the price is a fixed price.
|
|
3187
|
+
*/
|
|
3188
|
+
fixed_price_quantity?: number | null;
|
|
3189
|
+
/**
|
|
3190
|
+
* The subscription's override maximum amount for the plan.
|
|
3191
|
+
*/
|
|
3192
|
+
maximum_amount?: string | null;
|
|
3193
|
+
/**
|
|
3194
|
+
* The subscription's override minimum amount for the plan.
|
|
3195
|
+
*/
|
|
3196
|
+
minimum_amount?: string | null;
|
|
3197
|
+
}
|
|
3198
|
+
namespace OverrideTieredWithProrationPrice {
|
|
3199
|
+
/**
|
|
3200
|
+
* The subscription's override discount for the plan.
|
|
3201
|
+
*/
|
|
3202
|
+
interface Discount {
|
|
3203
|
+
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
|
|
3204
|
+
/**
|
|
3205
|
+
* Only available if discount_type is `amount`.
|
|
3206
|
+
*/
|
|
3207
|
+
amount_discount?: string | null;
|
|
3208
|
+
/**
|
|
3209
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
3210
|
+
* this can be a subset of prices.
|
|
3211
|
+
*/
|
|
3212
|
+
applies_to_price_ids?: Array<string> | null;
|
|
3213
|
+
/**
|
|
3214
|
+
* Only available if discount_type is `percentage`. This is a number between 0
|
|
3215
|
+
* and 1.
|
|
3216
|
+
*/
|
|
3217
|
+
percentage_discount?: number | null;
|
|
3218
|
+
/**
|
|
3219
|
+
* Only available if discount_type is `trial`
|
|
3220
|
+
*/
|
|
3221
|
+
trial_amount_discount?: string | null;
|
|
3222
|
+
/**
|
|
3223
|
+
* Only available if discount_type is `usage`. Number of usage units that this
|
|
3224
|
+
* discount is for
|
|
3225
|
+
*/
|
|
3226
|
+
usage_discount?: number | null;
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3107
3229
|
}
|
|
3108
3230
|
export interface SubscriptionUpdateParams {
|
|
3109
3231
|
/**
|
|
@@ -5649,7 +5771,7 @@ export interface SubscriptionSchedulePlanChangeParams {
|
|
|
5649
5771
|
/**
|
|
5650
5772
|
* Optionally provide a list of overrides for prices on the plan
|
|
5651
5773
|
*/
|
|
5652
|
-
price_overrides?: Array<SubscriptionSchedulePlanChangeParams.OverrideUnitPrice | SubscriptionSchedulePlanChangeParams.OverridePackagePrice | SubscriptionSchedulePlanChangeParams.OverrideMatrixPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkPrice | SubscriptionSchedulePlanChangeParams.OverrideThresholdTotalAmountPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPackagePrice | SubscriptionSchedulePlanChangeParams.OverrideTieredWithMinimumPrice | SubscriptionSchedulePlanChangeParams.OverridePackageWithAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideUnitWithPercentPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkWithProrationPrice> | null;
|
|
5774
|
+
price_overrides?: Array<SubscriptionSchedulePlanChangeParams.OverrideUnitPrice | SubscriptionSchedulePlanChangeParams.OverridePackagePrice | SubscriptionSchedulePlanChangeParams.OverrideMatrixPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkPrice | SubscriptionSchedulePlanChangeParams.OverrideThresholdTotalAmountPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPackagePrice | SubscriptionSchedulePlanChangeParams.OverrideTieredWithMinimumPrice | SubscriptionSchedulePlanChangeParams.OverridePackageWithAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideUnitWithPercentPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkWithProrationPrice | SubscriptionSchedulePlanChangeParams.OverrideUnitWithProrationPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredWithProrationPrice> | null;
|
|
5653
5775
|
}
|
|
5654
5776
|
export declare namespace SubscriptionSchedulePlanChangeParams {
|
|
5655
5777
|
interface OverrideUnitPrice {
|
|
@@ -6773,6 +6895,128 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
|
|
|
6773
6895
|
usage_discount?: number | null;
|
|
6774
6896
|
}
|
|
6775
6897
|
}
|
|
6898
|
+
interface OverrideUnitWithProrationPrice {
|
|
6899
|
+
id: string;
|
|
6900
|
+
model_type: 'unit_with_proration';
|
|
6901
|
+
unit_with_proration_config: Record<string, unknown>;
|
|
6902
|
+
/**
|
|
6903
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
6904
|
+
*/
|
|
6905
|
+
conversion_rate?: number | null;
|
|
6906
|
+
/**
|
|
6907
|
+
* The currency of the price. If not provided, the currency of the plan will be
|
|
6908
|
+
* used.
|
|
6909
|
+
*/
|
|
6910
|
+
currency?: string | null;
|
|
6911
|
+
/**
|
|
6912
|
+
* The subscription's override discount for the plan.
|
|
6913
|
+
*/
|
|
6914
|
+
discount?: OverrideUnitWithProrationPrice.Discount | null;
|
|
6915
|
+
/**
|
|
6916
|
+
* The starting quantity of the price, if the price is a fixed price.
|
|
6917
|
+
*/
|
|
6918
|
+
fixed_price_quantity?: number | null;
|
|
6919
|
+
/**
|
|
6920
|
+
* The subscription's override maximum amount for the plan.
|
|
6921
|
+
*/
|
|
6922
|
+
maximum_amount?: string | null;
|
|
6923
|
+
/**
|
|
6924
|
+
* The subscription's override minimum amount for the plan.
|
|
6925
|
+
*/
|
|
6926
|
+
minimum_amount?: string | null;
|
|
6927
|
+
}
|
|
6928
|
+
namespace OverrideUnitWithProrationPrice {
|
|
6929
|
+
/**
|
|
6930
|
+
* The subscription's override discount for the plan.
|
|
6931
|
+
*/
|
|
6932
|
+
interface Discount {
|
|
6933
|
+
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
|
|
6934
|
+
/**
|
|
6935
|
+
* Only available if discount_type is `amount`.
|
|
6936
|
+
*/
|
|
6937
|
+
amount_discount?: string | null;
|
|
6938
|
+
/**
|
|
6939
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
6940
|
+
* this can be a subset of prices.
|
|
6941
|
+
*/
|
|
6942
|
+
applies_to_price_ids?: Array<string> | null;
|
|
6943
|
+
/**
|
|
6944
|
+
* Only available if discount_type is `percentage`. This is a number between 0
|
|
6945
|
+
* and 1.
|
|
6946
|
+
*/
|
|
6947
|
+
percentage_discount?: number | null;
|
|
6948
|
+
/**
|
|
6949
|
+
* Only available if discount_type is `trial`
|
|
6950
|
+
*/
|
|
6951
|
+
trial_amount_discount?: string | null;
|
|
6952
|
+
/**
|
|
6953
|
+
* Only available if discount_type is `usage`. Number of usage units that this
|
|
6954
|
+
* discount is for
|
|
6955
|
+
*/
|
|
6956
|
+
usage_discount?: number | null;
|
|
6957
|
+
}
|
|
6958
|
+
}
|
|
6959
|
+
interface OverrideTieredWithProrationPrice {
|
|
6960
|
+
id: string;
|
|
6961
|
+
model_type: 'tiered_with_proration';
|
|
6962
|
+
tiered_with_proration_config: Record<string, unknown>;
|
|
6963
|
+
/**
|
|
6964
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
6965
|
+
*/
|
|
6966
|
+
conversion_rate?: number | null;
|
|
6967
|
+
/**
|
|
6968
|
+
* The currency of the price. If not provided, the currency of the plan will be
|
|
6969
|
+
* used.
|
|
6970
|
+
*/
|
|
6971
|
+
currency?: string | null;
|
|
6972
|
+
/**
|
|
6973
|
+
* The subscription's override discount for the plan.
|
|
6974
|
+
*/
|
|
6975
|
+
discount?: OverrideTieredWithProrationPrice.Discount | null;
|
|
6976
|
+
/**
|
|
6977
|
+
* The starting quantity of the price, if the price is a fixed price.
|
|
6978
|
+
*/
|
|
6979
|
+
fixed_price_quantity?: number | null;
|
|
6980
|
+
/**
|
|
6981
|
+
* The subscription's override maximum amount for the plan.
|
|
6982
|
+
*/
|
|
6983
|
+
maximum_amount?: string | null;
|
|
6984
|
+
/**
|
|
6985
|
+
* The subscription's override minimum amount for the plan.
|
|
6986
|
+
*/
|
|
6987
|
+
minimum_amount?: string | null;
|
|
6988
|
+
}
|
|
6989
|
+
namespace OverrideTieredWithProrationPrice {
|
|
6990
|
+
/**
|
|
6991
|
+
* The subscription's override discount for the plan.
|
|
6992
|
+
*/
|
|
6993
|
+
interface Discount {
|
|
6994
|
+
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
|
|
6995
|
+
/**
|
|
6996
|
+
* Only available if discount_type is `amount`.
|
|
6997
|
+
*/
|
|
6998
|
+
amount_discount?: string | null;
|
|
6999
|
+
/**
|
|
7000
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
7001
|
+
* this can be a subset of prices.
|
|
7002
|
+
*/
|
|
7003
|
+
applies_to_price_ids?: Array<string> | null;
|
|
7004
|
+
/**
|
|
7005
|
+
* Only available if discount_type is `percentage`. This is a number between 0
|
|
7006
|
+
* and 1.
|
|
7007
|
+
*/
|
|
7008
|
+
percentage_discount?: number | null;
|
|
7009
|
+
/**
|
|
7010
|
+
* Only available if discount_type is `trial`
|
|
7011
|
+
*/
|
|
7012
|
+
trial_amount_discount?: string | null;
|
|
7013
|
+
/**
|
|
7014
|
+
* Only available if discount_type is `usage`. Number of usage units that this
|
|
7015
|
+
* discount is for
|
|
7016
|
+
*/
|
|
7017
|
+
usage_discount?: number | null;
|
|
7018
|
+
}
|
|
7019
|
+
}
|
|
6776
7020
|
}
|
|
6777
7021
|
export interface SubscriptionTriggerPhaseParams {
|
|
6778
7022
|
/**
|