orb-billing 4.33.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 +175 -0
- package/LICENSE +1 -1
- package/README.md +10 -1
- 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 +1 -1
- 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 +7 -25
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +10 -10
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +10 -10
- 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 +1 -3
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +0 -2
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +0 -2
- 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 +78 -13
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +8 -27
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +8 -4
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +1 -6
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +1 -27
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +1 -4
- package/resources/items.mjs.map +1 -1
- package/resources/metrics.d.ts +1 -6
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +1 -27
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +1 -4
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +1 -2
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +0 -2
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +0 -2
- 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 +331 -9
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +3 -5
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +3 -5
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +1 -2
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +0 -2
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +0 -2
- 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 +339 -13
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +3 -5
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +3 -5
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/subscriptions.d.ts +7629 -191
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +2 -29
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +2 -6
- 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 +68 -26
- 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 +2 -4
- package/src/resources/index.ts +113 -67
- package/src/resources/invoice-line-items.ts +5 -4
- package/src/resources/invoices.ts +108 -14
- package/src/resources/items.ts +10 -7
- package/src/resources/metrics.ts +10 -7
- package/src/resources/plans/external-plan-id.ts +2 -3
- package/src/resources/plans/index.ts +9 -2
- package/src/resources/plans/plans.ts +424 -9
- package/src/resources/prices/external-price-id.ts +2 -3
- package/src/resources/prices/index.ts +8 -8
- package/src/resources/prices/prices.ts +470 -14
- package/src/resources/subscriptions.ts +9231 -400
- 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
|
|
|
@@ -83,6 +83,18 @@ export class PlansPage extends Page<Plan> {}
|
|
|
83
83
|
export interface Plan {
|
|
84
84
|
id: string;
|
|
85
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
|
+
|
|
86
98
|
base_plan: Plan.BasePlan | null;
|
|
87
99
|
|
|
88
100
|
/**
|
|
@@ -167,6 +179,176 @@ export interface Plan {
|
|
|
167
179
|
}
|
|
168
180
|
|
|
169
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
|
+
|
|
170
352
|
export interface BasePlan {
|
|
171
353
|
id: string | null;
|
|
172
354
|
|
|
@@ -312,7 +494,9 @@ export interface PlanCreateParams {
|
|
|
312
494
|
| PlanCreateParams.NewPlanGroupedAllocationPrice
|
|
313
495
|
| PlanCreateParams.NewPlanGroupedWithProratedMinimumPrice
|
|
314
496
|
| PlanCreateParams.NewPlanGroupedWithMeteredMinimumPrice
|
|
497
|
+
| PlanCreateParams.NewPlanMatrixWithDisplayNamePrice
|
|
315
498
|
| PlanCreateParams.NewPlanBulkWithProrationPrice
|
|
499
|
+
| PlanCreateParams.NewPlanGroupedTieredPackagePrice
|
|
316
500
|
>;
|
|
317
501
|
|
|
318
502
|
/**
|
|
@@ -2549,6 +2733,119 @@ export namespace PlanCreateParams {
|
|
|
2549
2733
|
}
|
|
2550
2734
|
}
|
|
2551
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
|
+
|
|
2552
2849
|
export interface NewPlanBulkWithProrationPrice {
|
|
2553
2850
|
bulk_with_proration_config: Record<string, unknown>;
|
|
2554
2851
|
|
|
@@ -2661,6 +2958,119 @@ export namespace PlanCreateParams {
|
|
|
2661
2958
|
duration_unit: 'day' | 'month';
|
|
2662
2959
|
}
|
|
2663
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
|
+
}
|
|
2664
3074
|
}
|
|
2665
3075
|
|
|
2666
3076
|
export interface PlanUpdateParams {
|
|
@@ -2694,12 +3104,17 @@ export interface PlanListParams extends PageParams {
|
|
|
2694
3104
|
status?: 'active' | 'archived' | 'draft';
|
|
2695
3105
|
}
|
|
2696
3106
|
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
export
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
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 };
|
|
2705
3120
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
4
|
import * as Core from '../../core';
|
|
5
|
-
import * as ExternalPriceIDAPI from './external-price-id';
|
|
6
5
|
import * as PricesAPI from './prices';
|
|
7
6
|
|
|
8
7
|
export class ExternalPriceID extends APIResource {
|
|
@@ -38,6 +37,6 @@ export interface ExternalPriceIDUpdateParams {
|
|
|
38
37
|
metadata?: Record<string, string | null> | null;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
export namespace ExternalPriceID {
|
|
42
|
-
export
|
|
40
|
+
export declare namespace ExternalPriceID {
|
|
41
|
+
export { type ExternalPriceIDUpdateParams as ExternalPriceIDUpdateParams };
|
|
43
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';
|