orb-billing 4.32.0 → 4.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -0
- package/LICENSE +1 -1
- package/README.md +12 -3
- package/core.d.ts +4 -5
- package/core.d.ts.map +1 -1
- package/core.js +16 -11
- package/core.js.map +1 -1
- package/core.mjs +16 -11
- package/core.mjs.map +1 -1
- package/error.d.ts +30 -36
- package/error.d.ts.map +1 -1
- package/error.js +24 -43
- package/error.js.map +1 -1
- package/error.mjs +24 -43
- package/error.mjs.map +1 -1
- package/index.d.mts +43 -109
- package/index.d.ts +43 -109
- package/index.d.ts.map +1 -1
- package/index.js +71 -33
- package/index.js.map +1 -1
- package/index.mjs +43 -32
- package/index.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/alerts.d.ts +58 -19
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +19 -37
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +19 -14
- package/resources/alerts.mjs.map +1 -1
- package/resources/coupons/coupons.d.ts +3 -7
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +3 -5
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +3 -5
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/index.d.ts +2 -2
- package/resources/coupons/index.d.ts.map +1 -1
- package/resources/coupons/index.js.map +1 -1
- package/resources/coupons/index.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts +1 -2
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js +0 -2
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +0 -2
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-notes.d.ts +29 -4
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +8 -27
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +8 -4
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.d.ts +1 -6
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js +1 -27
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +1 -4
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.ts +1 -5
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js +0 -2
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +0 -2
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts +15 -31
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js +10 -11
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +10 -11
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/index.d.ts +3 -3
- package/resources/customers/credits/index.d.ts.map +1 -1
- package/resources/customers/credits/index.js.map +1 -1
- package/resources/customers/credits/index.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +15 -23
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +12 -36
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +12 -13
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.ts +1 -11
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js +2 -28
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +2 -5
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.d.ts +9 -29
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +25 -18
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +25 -18
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.ts +4 -4
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +90 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.js +73 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs +45 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +10 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +15 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +11 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -0
- package/resources/dimensional-price-groups/index.d.ts +3 -0
- package/resources/dimensional-price-groups/index.d.ts.map +1 -0
- package/resources/dimensional-price-groups/index.js +9 -0
- package/resources/dimensional-price-groups/index.js.map +1 -0
- package/resources/dimensional-price-groups/index.mjs +4 -0
- package/resources/dimensional-price-groups/index.mjs.map +1 -0
- package/resources/events/backfills.d.ts +5 -11
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js +5 -29
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +5 -6
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.ts +7 -22
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +7 -7
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +7 -7
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/index.d.ts +3 -3
- package/resources/events/index.d.ts.map +1 -1
- package/resources/events/index.js.map +1 -1
- package/resources/events/index.mjs.map +1 -1
- package/resources/events/volume.d.ts +9 -12
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +16 -7
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +16 -7
- package/resources/events/volume.mjs.map +1 -1
- package/resources/index.d.ts +14 -13
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +10 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +8 -7
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +1 -3
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js +0 -2
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +0 -2
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +81 -18
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +22 -35
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +22 -12
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +2 -8
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +5 -31
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +5 -8
- package/resources/items.mjs.map +1 -1
- package/resources/metrics.d.ts +2 -8
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +7 -31
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +7 -8
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +2 -4
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +7 -7
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +7 -7
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/index.d.ts +2 -2
- package/resources/plans/index.d.ts.map +1 -1
- package/resources/plans/index.js.map +1 -1
- package/resources/plans/index.mjs +1 -1
- package/resources/plans/index.mjs.map +1 -1
- package/resources/plans/plans.d.ts +332 -11
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +10 -9
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +10 -9
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +2 -4
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +6 -7
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +6 -7
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/index.d.ts +2 -2
- package/resources/prices/index.d.ts.map +1 -1
- package/resources/prices/index.js +3 -3
- package/resources/prices/index.js.map +1 -1
- package/resources/prices/index.mjs +1 -1
- package/resources/prices/index.mjs.map +1 -1
- package/resources/prices/prices.d.ts +340 -15
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +9 -9
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +9 -9
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/subscriptions.d.ts +7636 -200
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +348 -47
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +348 -24
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/top-level.d.ts +1 -2
- package/resources/top-level.d.ts.map +1 -1
- package/resources/top-level.js +0 -2
- package/resources/top-level.js.map +1 -1
- package/resources/top-level.mjs +0 -2
- package/resources/top-level.mjs.map +1 -1
- package/src/core.ts +23 -19
- package/src/error.ts +82 -125
- package/src/index.ts +334 -130
- package/src/resources/alerts.ts +117 -24
- package/src/resources/coupons/coupons.ts +13 -8
- package/src/resources/coupons/index.ts +2 -2
- package/src/resources/coupons/subscriptions.ts +2 -3
- package/src/resources/credit-notes.ts +45 -5
- package/src/resources/customers/balance-transactions.ts +10 -7
- package/src/resources/customers/costs.ts +7 -6
- package/src/resources/customers/credits/credits.ts +82 -32
- package/src/resources/customers/credits/index.ts +20 -20
- package/src/resources/customers/credits/ledger.ts +30 -24
- package/src/resources/customers/credits/top-ups.ts +16 -12
- package/src/resources/customers/customers.ts +70 -46
- package/src/resources/customers/index.ts +17 -17
- package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +146 -0
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +20 -0
- package/src/resources/dimensional-price-groups/index.ts +10 -0
- package/src/resources/events/backfills.ts +17 -12
- package/src/resources/events/events.ts +42 -23
- package/src/resources/events/index.ts +15 -15
- package/src/resources/events/volume.ts +11 -22
- package/src/resources/index.ts +113 -67
- package/src/resources/invoice-line-items.ts +5 -4
- package/src/resources/invoices.ts +111 -34
- package/src/resources/items.ts +11 -17
- package/src/resources/metrics.ts +11 -17
- package/src/resources/plans/external-plan-id.ts +3 -14
- package/src/resources/plans/index.ts +9 -2
- package/src/resources/plans/plans.ts +425 -19
- package/src/resources/prices/external-price-id.ts +3 -14
- package/src/resources/prices/index.ts +8 -8
- package/src/resources/prices/prices.ts +471 -24
- package/src/resources/subscriptions.ts +9238 -440
- package/src/resources/top-level.ts +2 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
4
|
import { isRequestOptions } from '../../core';
|
|
5
5
|
import * as Core from '../../core';
|
|
6
|
-
import * as PlansAPI from './plans';
|
|
7
6
|
import * as Shared from '../shared';
|
|
8
7
|
import * as ExternalPlanIDAPI from './external-plan-id';
|
|
8
|
+
import { ExternalPlanID, ExternalPlanIDUpdateParams } from './external-plan-id';
|
|
9
9
|
import * as PricesAPI from '../prices/prices';
|
|
10
10
|
import { Page, type PageParams } from '../../pagination';
|
|
11
11
|
|
|
@@ -25,16 +25,7 @@ export class Plans extends APIResource {
|
|
|
25
25
|
*
|
|
26
26
|
* Other fields on a customer are currently immutable.
|
|
27
27
|
*/
|
|
28
|
-
update(planId: string, body
|
|
29
|
-
update(planId: string, options?: Core.RequestOptions): Core.APIPromise<Plan>;
|
|
30
|
-
update(
|
|
31
|
-
planId: string,
|
|
32
|
-
body: PlanUpdateParams | Core.RequestOptions = {},
|
|
33
|
-
options?: Core.RequestOptions,
|
|
34
|
-
): Core.APIPromise<Plan> {
|
|
35
|
-
if (isRequestOptions(body)) {
|
|
36
|
-
return this.update(planId, {}, body);
|
|
37
|
-
}
|
|
28
|
+
update(planId: string, body: PlanUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Plan> {
|
|
38
29
|
return this._client.put(`/plans/${planId}`, { body, ...options });
|
|
39
30
|
}
|
|
40
31
|
|
|
@@ -92,6 +83,18 @@ export class PlansPage extends Page<Plan> {}
|
|
|
92
83
|
export interface Plan {
|
|
93
84
|
id: string;
|
|
94
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Adjustments for this plan. If the plan has phases, this includes adjustments
|
|
88
|
+
* across all phases of the plan.
|
|
89
|
+
*/
|
|
90
|
+
adjustments: Array<
|
|
91
|
+
| Plan.AmountDiscountAdjustment
|
|
92
|
+
| Plan.PercentageDiscountAdjustment
|
|
93
|
+
| Plan.UsageDiscountAdjustment
|
|
94
|
+
| Plan.MinimumAdjustment
|
|
95
|
+
| Plan.MaximumAdjustment
|
|
96
|
+
>;
|
|
97
|
+
|
|
95
98
|
base_plan: Plan.BasePlan | null;
|
|
96
99
|
|
|
97
100
|
/**
|
|
@@ -176,6 +179,176 @@ export interface Plan {
|
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
export namespace Plan {
|
|
182
|
+
export interface AmountDiscountAdjustment {
|
|
183
|
+
id: string;
|
|
184
|
+
|
|
185
|
+
adjustment_type: 'amount_discount';
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The amount by which to discount the prices this adjustment applies to in a given
|
|
189
|
+
* billing period.
|
|
190
|
+
*/
|
|
191
|
+
amount_discount: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The price IDs that this adjustment applies to.
|
|
195
|
+
*/
|
|
196
|
+
applies_to_price_ids: Array<string>;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* True for adjustments that apply to an entire invocice, false for adjustments
|
|
200
|
+
* that apply to only one price.
|
|
201
|
+
*/
|
|
202
|
+
is_invoice_level: boolean;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The plan phase in which this adjustment is active.
|
|
206
|
+
*/
|
|
207
|
+
plan_phase_order: number | null;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The reason for the adjustment.
|
|
211
|
+
*/
|
|
212
|
+
reason: string | null;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface PercentageDiscountAdjustment {
|
|
216
|
+
id: string;
|
|
217
|
+
|
|
218
|
+
adjustment_type: 'percentage_discount';
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The price IDs that this adjustment applies to.
|
|
222
|
+
*/
|
|
223
|
+
applies_to_price_ids: Array<string>;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* True for adjustments that apply to an entire invocice, false for adjustments
|
|
227
|
+
* that apply to only one price.
|
|
228
|
+
*/
|
|
229
|
+
is_invoice_level: boolean;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The percentage (as a value between 0 and 1) by which to discount the price
|
|
233
|
+
* intervals this adjustment applies to in a given billing period.
|
|
234
|
+
*/
|
|
235
|
+
percentage_discount: number;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* The plan phase in which this adjustment is active.
|
|
239
|
+
*/
|
|
240
|
+
plan_phase_order: number | null;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* The reason for the adjustment.
|
|
244
|
+
*/
|
|
245
|
+
reason: string | null;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface UsageDiscountAdjustment {
|
|
249
|
+
id: string;
|
|
250
|
+
|
|
251
|
+
adjustment_type: 'usage_discount';
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The price IDs that this adjustment applies to.
|
|
255
|
+
*/
|
|
256
|
+
applies_to_price_ids: Array<string>;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* True for adjustments that apply to an entire invocice, false for adjustments
|
|
260
|
+
* that apply to only one price.
|
|
261
|
+
*/
|
|
262
|
+
is_invoice_level: boolean;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The plan phase in which this adjustment is active.
|
|
266
|
+
*/
|
|
267
|
+
plan_phase_order: number | null;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The reason for the adjustment.
|
|
271
|
+
*/
|
|
272
|
+
reason: string | null;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* The number of usage units by which to discount the price this adjustment applies
|
|
276
|
+
* to in a given billing period.
|
|
277
|
+
*/
|
|
278
|
+
usage_discount: number;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface MinimumAdjustment {
|
|
282
|
+
id: string;
|
|
283
|
+
|
|
284
|
+
adjustment_type: 'minimum';
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The price IDs that this adjustment applies to.
|
|
288
|
+
*/
|
|
289
|
+
applies_to_price_ids: Array<string>;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* True for adjustments that apply to an entire invocice, false for adjustments
|
|
293
|
+
* that apply to only one price.
|
|
294
|
+
*/
|
|
295
|
+
is_invoice_level: boolean;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The item ID that revenue from this minimum will be attributed to.
|
|
299
|
+
*/
|
|
300
|
+
item_id: string;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* The minimum amount to charge in a given billing period for the prices this
|
|
304
|
+
* adjustment applies to.
|
|
305
|
+
*/
|
|
306
|
+
minimum_amount: string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* The plan phase in which this adjustment is active.
|
|
310
|
+
*/
|
|
311
|
+
plan_phase_order: number | null;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* The reason for the adjustment.
|
|
315
|
+
*/
|
|
316
|
+
reason: string | null;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface MaximumAdjustment {
|
|
320
|
+
id: string;
|
|
321
|
+
|
|
322
|
+
adjustment_type: 'maximum';
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The price IDs that this adjustment applies to.
|
|
326
|
+
*/
|
|
327
|
+
applies_to_price_ids: Array<string>;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* True for adjustments that apply to an entire invocice, false for adjustments
|
|
331
|
+
* that apply to only one price.
|
|
332
|
+
*/
|
|
333
|
+
is_invoice_level: boolean;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The maximum amount to charge in a given billing period for the prices this
|
|
337
|
+
* adjustment applies to.
|
|
338
|
+
*/
|
|
339
|
+
maximum_amount: string;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The plan phase in which this adjustment is active.
|
|
343
|
+
*/
|
|
344
|
+
plan_phase_order: number | null;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The reason for the adjustment.
|
|
348
|
+
*/
|
|
349
|
+
reason: string | null;
|
|
350
|
+
}
|
|
351
|
+
|
|
179
352
|
export interface BasePlan {
|
|
180
353
|
id: string | null;
|
|
181
354
|
|
|
@@ -321,7 +494,9 @@ export interface PlanCreateParams {
|
|
|
321
494
|
| PlanCreateParams.NewPlanGroupedAllocationPrice
|
|
322
495
|
| PlanCreateParams.NewPlanGroupedWithProratedMinimumPrice
|
|
323
496
|
| PlanCreateParams.NewPlanGroupedWithMeteredMinimumPrice
|
|
497
|
+
| PlanCreateParams.NewPlanMatrixWithDisplayNamePrice
|
|
324
498
|
| PlanCreateParams.NewPlanBulkWithProrationPrice
|
|
499
|
+
| PlanCreateParams.NewPlanGroupedTieredPackagePrice
|
|
325
500
|
>;
|
|
326
501
|
|
|
327
502
|
/**
|
|
@@ -2558,6 +2733,119 @@ export namespace PlanCreateParams {
|
|
|
2558
2733
|
}
|
|
2559
2734
|
}
|
|
2560
2735
|
|
|
2736
|
+
export interface NewPlanMatrixWithDisplayNamePrice {
|
|
2737
|
+
/**
|
|
2738
|
+
* The cadence to bill for this price on.
|
|
2739
|
+
*/
|
|
2740
|
+
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
|
|
2741
|
+
|
|
2742
|
+
/**
|
|
2743
|
+
* The id of the item the plan will be associated with.
|
|
2744
|
+
*/
|
|
2745
|
+
item_id: string;
|
|
2746
|
+
|
|
2747
|
+
matrix_with_display_name_config: Record<string, unknown>;
|
|
2748
|
+
|
|
2749
|
+
model_type: 'matrix_with_display_name';
|
|
2750
|
+
|
|
2751
|
+
/**
|
|
2752
|
+
* The name of the price.
|
|
2753
|
+
*/
|
|
2754
|
+
name: string;
|
|
2755
|
+
|
|
2756
|
+
/**
|
|
2757
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
2758
|
+
* usage-based.
|
|
2759
|
+
*/
|
|
2760
|
+
billable_metric_id?: string | null;
|
|
2761
|
+
|
|
2762
|
+
/**
|
|
2763
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
2764
|
+
* this is true, and in-arrears if this is false.
|
|
2765
|
+
*/
|
|
2766
|
+
billed_in_advance?: boolean | null;
|
|
2767
|
+
|
|
2768
|
+
/**
|
|
2769
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
2770
|
+
* months.
|
|
2771
|
+
*/
|
|
2772
|
+
billing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.BillingCycleConfiguration | null;
|
|
2773
|
+
|
|
2774
|
+
/**
|
|
2775
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
2776
|
+
*/
|
|
2777
|
+
conversion_rate?: number | null;
|
|
2778
|
+
|
|
2779
|
+
/**
|
|
2780
|
+
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
|
|
2781
|
+
* price is billed.
|
|
2782
|
+
*/
|
|
2783
|
+
currency?: string | null;
|
|
2784
|
+
|
|
2785
|
+
/**
|
|
2786
|
+
* An alias for the price.
|
|
2787
|
+
*/
|
|
2788
|
+
external_price_id?: string | null;
|
|
2789
|
+
|
|
2790
|
+
/**
|
|
2791
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
2792
|
+
* applied.
|
|
2793
|
+
*/
|
|
2794
|
+
fixed_price_quantity?: number | null;
|
|
2795
|
+
|
|
2796
|
+
/**
|
|
2797
|
+
* The property used to group this price on an invoice
|
|
2798
|
+
*/
|
|
2799
|
+
invoice_grouping_key?: string | null;
|
|
2800
|
+
|
|
2801
|
+
/**
|
|
2802
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
2803
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
2804
|
+
*/
|
|
2805
|
+
invoicing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null;
|
|
2806
|
+
|
|
2807
|
+
/**
|
|
2808
|
+
* User-specified key/value pairs for the resource. Individual keys can be removed
|
|
2809
|
+
* by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
2810
|
+
* by setting `metadata` to `null`.
|
|
2811
|
+
*/
|
|
2812
|
+
metadata?: Record<string, string | null> | null;
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
export namespace NewPlanMatrixWithDisplayNamePrice {
|
|
2816
|
+
/**
|
|
2817
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
2818
|
+
* months.
|
|
2819
|
+
*/
|
|
2820
|
+
export interface BillingCycleConfiguration {
|
|
2821
|
+
/**
|
|
2822
|
+
* The duration of the billing period.
|
|
2823
|
+
*/
|
|
2824
|
+
duration: number;
|
|
2825
|
+
|
|
2826
|
+
/**
|
|
2827
|
+
* The unit of billing period duration.
|
|
2828
|
+
*/
|
|
2829
|
+
duration_unit: 'day' | 'month';
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
/**
|
|
2833
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
2834
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
2835
|
+
*/
|
|
2836
|
+
export interface InvoicingCycleConfiguration {
|
|
2837
|
+
/**
|
|
2838
|
+
* The duration of the billing period.
|
|
2839
|
+
*/
|
|
2840
|
+
duration: number;
|
|
2841
|
+
|
|
2842
|
+
/**
|
|
2843
|
+
* The unit of billing period duration.
|
|
2844
|
+
*/
|
|
2845
|
+
duration_unit: 'day' | 'month';
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2561
2849
|
export interface NewPlanBulkWithProrationPrice {
|
|
2562
2850
|
bulk_with_proration_config: Record<string, unknown>;
|
|
2563
2851
|
|
|
@@ -2670,6 +2958,119 @@ export namespace PlanCreateParams {
|
|
|
2670
2958
|
duration_unit: 'day' | 'month';
|
|
2671
2959
|
}
|
|
2672
2960
|
}
|
|
2961
|
+
|
|
2962
|
+
export interface NewPlanGroupedTieredPackagePrice {
|
|
2963
|
+
/**
|
|
2964
|
+
* The cadence to bill for this price on.
|
|
2965
|
+
*/
|
|
2966
|
+
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
|
|
2967
|
+
|
|
2968
|
+
grouped_tiered_package_config: Record<string, unknown>;
|
|
2969
|
+
|
|
2970
|
+
/**
|
|
2971
|
+
* The id of the item the plan will be associated with.
|
|
2972
|
+
*/
|
|
2973
|
+
item_id: string;
|
|
2974
|
+
|
|
2975
|
+
model_type: 'grouped_tiered_package';
|
|
2976
|
+
|
|
2977
|
+
/**
|
|
2978
|
+
* The name of the price.
|
|
2979
|
+
*/
|
|
2980
|
+
name: string;
|
|
2981
|
+
|
|
2982
|
+
/**
|
|
2983
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
2984
|
+
* usage-based.
|
|
2985
|
+
*/
|
|
2986
|
+
billable_metric_id?: string | null;
|
|
2987
|
+
|
|
2988
|
+
/**
|
|
2989
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
2990
|
+
* this is true, and in-arrears if this is false.
|
|
2991
|
+
*/
|
|
2992
|
+
billed_in_advance?: boolean | null;
|
|
2993
|
+
|
|
2994
|
+
/**
|
|
2995
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
2996
|
+
* months.
|
|
2997
|
+
*/
|
|
2998
|
+
billing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.BillingCycleConfiguration | null;
|
|
2999
|
+
|
|
3000
|
+
/**
|
|
3001
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
3002
|
+
*/
|
|
3003
|
+
conversion_rate?: number | null;
|
|
3004
|
+
|
|
3005
|
+
/**
|
|
3006
|
+
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
|
|
3007
|
+
* price is billed.
|
|
3008
|
+
*/
|
|
3009
|
+
currency?: string | null;
|
|
3010
|
+
|
|
3011
|
+
/**
|
|
3012
|
+
* An alias for the price.
|
|
3013
|
+
*/
|
|
3014
|
+
external_price_id?: string | null;
|
|
3015
|
+
|
|
3016
|
+
/**
|
|
3017
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
3018
|
+
* applied.
|
|
3019
|
+
*/
|
|
3020
|
+
fixed_price_quantity?: number | null;
|
|
3021
|
+
|
|
3022
|
+
/**
|
|
3023
|
+
* The property used to group this price on an invoice
|
|
3024
|
+
*/
|
|
3025
|
+
invoice_grouping_key?: string | null;
|
|
3026
|
+
|
|
3027
|
+
/**
|
|
3028
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
3029
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
3030
|
+
*/
|
|
3031
|
+
invoicing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.InvoicingCycleConfiguration | null;
|
|
3032
|
+
|
|
3033
|
+
/**
|
|
3034
|
+
* User-specified key/value pairs for the resource. Individual keys can be removed
|
|
3035
|
+
* by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
3036
|
+
* by setting `metadata` to `null`.
|
|
3037
|
+
*/
|
|
3038
|
+
metadata?: Record<string, string | null> | null;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
export namespace NewPlanGroupedTieredPackagePrice {
|
|
3042
|
+
/**
|
|
3043
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
3044
|
+
* months.
|
|
3045
|
+
*/
|
|
3046
|
+
export interface BillingCycleConfiguration {
|
|
3047
|
+
/**
|
|
3048
|
+
* The duration of the billing period.
|
|
3049
|
+
*/
|
|
3050
|
+
duration: number;
|
|
3051
|
+
|
|
3052
|
+
/**
|
|
3053
|
+
* The unit of billing period duration.
|
|
3054
|
+
*/
|
|
3055
|
+
duration_unit: 'day' | 'month';
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
/**
|
|
3059
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
3060
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
3061
|
+
*/
|
|
3062
|
+
export interface InvoicingCycleConfiguration {
|
|
3063
|
+
/**
|
|
3064
|
+
* The duration of the billing period.
|
|
3065
|
+
*/
|
|
3066
|
+
duration: number;
|
|
3067
|
+
|
|
3068
|
+
/**
|
|
3069
|
+
* The unit of billing period duration.
|
|
3070
|
+
*/
|
|
3071
|
+
duration_unit: 'day' | 'month';
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
2673
3074
|
}
|
|
2674
3075
|
|
|
2675
3076
|
export interface PlanUpdateParams {
|
|
@@ -2703,12 +3104,17 @@ export interface PlanListParams extends PageParams {
|
|
|
2703
3104
|
status?: 'active' | 'archived' | 'draft';
|
|
2704
3105
|
}
|
|
2705
3106
|
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
export
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
3107
|
+
Plans.PlansPage = PlansPage;
|
|
3108
|
+
Plans.ExternalPlanID = ExternalPlanID;
|
|
3109
|
+
|
|
3110
|
+
export declare namespace Plans {
|
|
3111
|
+
export {
|
|
3112
|
+
type Plan as Plan,
|
|
3113
|
+
PlansPage as PlansPage,
|
|
3114
|
+
type PlanCreateParams as PlanCreateParams,
|
|
3115
|
+
type PlanUpdateParams as PlanUpdateParams,
|
|
3116
|
+
type PlanListParams as PlanListParams,
|
|
3117
|
+
};
|
|
3118
|
+
|
|
3119
|
+
export { ExternalPlanID as ExternalPlanID, type ExternalPlanIDUpdateParams as ExternalPlanIDUpdateParams };
|
|
2714
3120
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
|
-
import { isRequestOptions } from '../../core';
|
|
5
4
|
import * as Core from '../../core';
|
|
6
|
-
import * as ExternalPriceIDAPI from './external-price-id';
|
|
7
5
|
import * as PricesAPI from './prices';
|
|
8
6
|
|
|
9
7
|
export class ExternalPriceID extends APIResource {
|
|
@@ -14,18 +12,9 @@ export class ExternalPriceID extends APIResource {
|
|
|
14
12
|
*/
|
|
15
13
|
update(
|
|
16
14
|
externalPriceId: string,
|
|
17
|
-
body
|
|
18
|
-
options?: Core.RequestOptions,
|
|
19
|
-
): Core.APIPromise<PricesAPI.Price>;
|
|
20
|
-
update(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise<PricesAPI.Price>;
|
|
21
|
-
update(
|
|
22
|
-
externalPriceId: string,
|
|
23
|
-
body: ExternalPriceIDUpdateParams | Core.RequestOptions = {},
|
|
15
|
+
body: ExternalPriceIDUpdateParams,
|
|
24
16
|
options?: Core.RequestOptions,
|
|
25
17
|
): Core.APIPromise<PricesAPI.Price> {
|
|
26
|
-
if (isRequestOptions(body)) {
|
|
27
|
-
return this.update(externalPriceId, {}, body);
|
|
28
|
-
}
|
|
29
18
|
return this._client.put(`/prices/external_price_id/${externalPriceId}`, { body, ...options });
|
|
30
19
|
}
|
|
31
20
|
|
|
@@ -48,6 +37,6 @@ export interface ExternalPriceIDUpdateParams {
|
|
|
48
37
|
metadata?: Record<string, string | null> | null;
|
|
49
38
|
}
|
|
50
39
|
|
|
51
|
-
export namespace ExternalPriceID {
|
|
52
|
-
export
|
|
40
|
+
export declare namespace ExternalPriceID {
|
|
41
|
+
export { type ExternalPriceIDUpdateParams as ExternalPriceIDUpdateParams };
|
|
53
42
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export { ExternalPriceID, type ExternalPriceIDUpdateParams } from './external-price-id';
|
|
3
4
|
export {
|
|
4
|
-
EvaluatePriceGroup,
|
|
5
|
-
Price,
|
|
6
|
-
PriceEvaluateResponse,
|
|
7
|
-
PriceCreateParams,
|
|
8
|
-
PriceUpdateParams,
|
|
9
|
-
PriceListParams,
|
|
10
|
-
PriceEvaluateParams,
|
|
11
5
|
PricesPage,
|
|
12
6
|
Prices,
|
|
7
|
+
type EvaluatePriceGroup,
|
|
8
|
+
type Price,
|
|
9
|
+
type PriceEvaluateResponse,
|
|
10
|
+
type PriceCreateParams,
|
|
11
|
+
type PriceUpdateParams,
|
|
12
|
+
type PriceListParams,
|
|
13
|
+
type PriceEvaluateParams,
|
|
13
14
|
} from './prices';
|
|
14
|
-
export { ExternalPriceIDUpdateParams, ExternalPriceID } from './external-price-id';
|