orb-billing 4.49.0 → 4.50.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 +8 -0
- package/package.json +1 -1
- package/resources/alerts.d.ts +5 -8
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +2 -4
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +2 -4
- package/resources/alerts.mjs.map +1 -1
- package/resources/coupons/coupons.d.ts +0 -34
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts +3 -3
- package/resources/credit-notes.d.ts +5 -5
- package/resources/credit-notes.js +3 -3
- package/resources/credit-notes.mjs +3 -3
- package/resources/customers/costs.d.ts +12 -454
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/credits/ledger.d.ts +14 -14
- package/resources/customers/customers.d.ts +16 -18
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +11 -11
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +11 -11
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/events/backfills.d.ts +19 -19
- package/resources/events/backfills.js +4 -4
- package/resources/events/backfills.mjs +4 -4
- package/resources/events/events.d.ts +6 -7
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +3 -3
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +3 -3
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/volume.d.ts +5 -5
- package/resources/events/volume.js +5 -5
- package/resources/events/volume.mjs +5 -5
- package/resources/invoice-line-items.d.ts +2 -223
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoices.d.ts +12 -454
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +3 -3
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +3 -3
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +1 -1
- package/resources/items.js +1 -1
- package/resources/items.mjs +1 -1
- package/resources/metrics.d.ts +6 -7
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +3 -4
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +3 -4
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +6 -6
- package/resources/plans/external-plan-id.js +6 -6
- package/resources/plans/external-plan-id.mjs +6 -6
- package/resources/plans/plans.d.ts +15 -109
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +6 -6
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +6 -6
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +2 -2
- package/resources/prices/external-price-id.js +2 -2
- package/resources/prices/external-price-id.mjs +2 -2
- package/resources/prices/prices.d.ts +16 -404
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +7 -7
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +7 -7
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/subscriptions.d.ts +154 -2907
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +53 -49
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +53 -49
- package/resources/subscriptions.mjs.map +1 -1
- package/src/resources/alerts.ts +5 -8
- package/src/resources/coupons/coupons.ts +0 -34
- package/src/resources/coupons/subscriptions.ts +3 -3
- package/src/resources/credit-notes.ts +5 -5
- package/src/resources/customers/costs.ts +12 -454
- package/src/resources/customers/credits/ledger.ts +14 -14
- package/src/resources/customers/customers.ts +16 -18
- package/src/resources/events/backfills.ts +19 -19
- package/src/resources/events/events.ts +6 -7
- package/src/resources/events/volume.ts +5 -5
- package/src/resources/invoice-line-items.ts +2 -223
- package/src/resources/invoices.ts +12 -454
- package/src/resources/items.ts +1 -1
- package/src/resources/metrics.ts +6 -7
- package/src/resources/plans/external-plan-id.ts +6 -6
- package/src/resources/plans/plans.ts +14 -128
- package/src/resources/prices/external-price-id.ts +2 -2
- package/src/resources/prices/prices.ts +15 -460
- package/src/resources/subscriptions.ts +153 -2926
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -10,9 +10,9 @@ import { type PageParams } from '../../pagination';
|
|
|
10
10
|
export class Subscriptions extends APIResource {
|
|
11
11
|
/**
|
|
12
12
|
* This endpoint returns a list of all subscriptions that have redeemed a given
|
|
13
|
-
* coupon as a [paginated](
|
|
14
|
-
* most recently created subscription. For a full discussion of the
|
|
15
|
-
* resource, see [Subscription](
|
|
13
|
+
* coupon as a [paginated](/api-reference/pagination) list, ordered starting from
|
|
14
|
+
* the most recently created subscription. For a full discussion of the
|
|
15
|
+
* subscription resource, see [Subscription](/core-concepts#subscription).
|
|
16
16
|
*/
|
|
17
17
|
list(
|
|
18
18
|
couponId: string,
|
|
@@ -8,7 +8,7 @@ import { Page, type PageParams } from '../pagination';
|
|
|
8
8
|
export class CreditNotes extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* This endpoint is used to create a single
|
|
11
|
-
* [`Credit Note`](
|
|
11
|
+
* [`Credit Note`](/invoicing/credit-notes).
|
|
12
12
|
*/
|
|
13
13
|
create(body: CreditNoteCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreditNote> {
|
|
14
14
|
return this._client.post('/credit_notes', { body, ...options });
|
|
@@ -35,8 +35,8 @@ export class CreditNotes extends APIResource {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* This endpoint is used to fetch a single
|
|
39
|
-
*
|
|
38
|
+
* This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes)
|
|
39
|
+
* given an identifier.
|
|
40
40
|
*/
|
|
41
41
|
fetch(creditNoteId: string, options?: Core.RequestOptions): Core.APIPromise<CreditNote> {
|
|
42
42
|
return this._client.get(`/credit_notes/${creditNoteId}`, options);
|
|
@@ -46,8 +46,8 @@ export class CreditNotes extends APIResource {
|
|
|
46
46
|
export class CreditNotesPage extends Page<CreditNote> {}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* The [Credit Note](/
|
|
50
|
-
*
|
|
49
|
+
* The [Credit Note](/invoicing/credit-notes) resource represents a credit that has
|
|
50
|
+
* been applied to a particular invoice.
|
|
51
51
|
*/
|
|
52
52
|
export interface CreditNote {
|
|
53
53
|
/**
|
|
@@ -9,8 +9,8 @@ export class Costs extends APIResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* This endpoint is used to fetch a day-by-day snapshot of a customer's costs in
|
|
11
11
|
* Orb, calculated by applying pricing information to the underlying usage (see the
|
|
12
|
-
* [subscription usage endpoint](fetch-subscription-usage
|
|
13
|
-
* per metric, in usage units rather than a currency).
|
|
12
|
+
* [subscription usage endpoint](/api-reference/subscription/fetch-subscription-usage)
|
|
13
|
+
* to fetch usage per metric, in usage units rather than a currency).
|
|
14
14
|
*
|
|
15
15
|
* This endpoint can be leveraged for internal tooling and to provide a more
|
|
16
16
|
* transparent billing experience for your end users:
|
|
@@ -19,8 +19,8 @@ export class Costs extends APIResource {
|
|
|
19
19
|
* the current billing period.
|
|
20
20
|
* 2. Provide customer visibility into how different services are contributing to
|
|
21
21
|
* the overall invoice with a per-day timeseries (as compared to the
|
|
22
|
-
* [upcoming invoice](fetch-upcoming-invoice) resource,
|
|
23
|
-
* snapshot for the current period).
|
|
22
|
+
* [upcoming invoice](/api-reference/invoice/fetch-upcoming-invoice) resource,
|
|
23
|
+
* which represents a snapshot for the current period).
|
|
24
24
|
* 3. Assess how minimums and discounts affect your customers by teasing apart
|
|
25
25
|
* costs directly as a result of usage, as opposed to minimums and discounts at
|
|
26
26
|
* the plan and price level.
|
|
@@ -145,8 +145,8 @@ export class Costs extends APIResource {
|
|
|
145
145
|
/**
|
|
146
146
|
* This endpoint is used to fetch a day-by-day snapshot of a customer's costs in
|
|
147
147
|
* Orb, calculated by applying pricing information to the underlying usage (see the
|
|
148
|
-
* [subscription usage endpoint](fetch-subscription-usage
|
|
149
|
-
* per metric, in usage units rather than a currency).
|
|
148
|
+
* [subscription usage endpoint](/api-reference/subscription/fetch-subscription-usage)
|
|
149
|
+
* to fetch usage per metric, in usage units rather than a currency).
|
|
150
150
|
*
|
|
151
151
|
* This endpoint can be leveraged for internal tooling and to provide a more
|
|
152
152
|
* transparent billing experience for your end users:
|
|
@@ -155,8 +155,8 @@ export class Costs extends APIResource {
|
|
|
155
155
|
* the current billing period.
|
|
156
156
|
* 2. Provide customer visibility into how different services are contributing to
|
|
157
157
|
* the overall invoice with a per-day timeseries (as compared to the
|
|
158
|
-
* [upcoming invoice](fetch-upcoming-invoice) resource,
|
|
159
|
-
* snapshot for the current period).
|
|
158
|
+
* [upcoming invoice](/api-reference/invoice/fetch-upcoming-invoice) resource,
|
|
159
|
+
* which represents a snapshot for the current period).
|
|
160
160
|
* 3. Assess how minimums and discounts affect your customers by teasing apart
|
|
161
161
|
* costs directly as a result of usage, as opposed to minimums and discounts at
|
|
162
162
|
* the plan and price level.
|
|
@@ -319,229 +319,8 @@ export namespace CostListResponse {
|
|
|
319
319
|
* is serialized differently in a given Price object. The model_type field
|
|
320
320
|
* determines the key for the configuration object that is present.
|
|
321
321
|
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* With unit pricing, each unit costs a fixed amount.
|
|
325
|
-
*
|
|
326
|
-
* ```json
|
|
327
|
-
* {
|
|
328
|
-
* ...
|
|
329
|
-
* "model_type": "unit",
|
|
330
|
-
* "unit_config": {
|
|
331
|
-
* "unit_amount": "0.50"
|
|
332
|
-
* }
|
|
333
|
-
* ...
|
|
334
|
-
* }
|
|
335
|
-
* ```
|
|
336
|
-
*
|
|
337
|
-
* ## Tiered pricing
|
|
338
|
-
*
|
|
339
|
-
* In tiered pricing, the cost of a given unit depends on the tier range that it
|
|
340
|
-
* falls into, where each tier range is defined by an upper and lower bound. For
|
|
341
|
-
* example, the first ten units may cost $0.50 each and all units thereafter may
|
|
342
|
-
* cost $0.10 each.
|
|
343
|
-
*
|
|
344
|
-
* ```json
|
|
345
|
-
* {
|
|
346
|
-
* ...
|
|
347
|
-
* "model_type": "tiered",
|
|
348
|
-
* "tiered_config": {
|
|
349
|
-
* "tiers": [
|
|
350
|
-
* {
|
|
351
|
-
* "first_unit": 1,
|
|
352
|
-
* "last_unit": 10,
|
|
353
|
-
* "unit_amount": "0.50"
|
|
354
|
-
* },
|
|
355
|
-
* {
|
|
356
|
-
* "first_unit": 11,
|
|
357
|
-
* "last_unit": null,
|
|
358
|
-
* "unit_amount": "0.10"
|
|
359
|
-
* }
|
|
360
|
-
* ]
|
|
361
|
-
* }
|
|
362
|
-
* ...
|
|
363
|
-
* ```
|
|
364
|
-
*
|
|
365
|
-
* ## Bulk pricing
|
|
366
|
-
*
|
|
367
|
-
* Bulk pricing applies when the number of units determine the cost of all units.
|
|
368
|
-
* For example, if you've bought less than 10 units, they may each be $0.50 for a
|
|
369
|
-
* total of $5.00. Once you've bought more than 10 units, all units may now be
|
|
370
|
-
* priced at $0.40 (i.e. 101 units total would be $40.40).
|
|
371
|
-
*
|
|
372
|
-
* ```json
|
|
373
|
-
* {
|
|
374
|
-
* ...
|
|
375
|
-
* "model_type": "bulk",
|
|
376
|
-
* "bulk_config": {
|
|
377
|
-
* "tiers": [
|
|
378
|
-
* {
|
|
379
|
-
* "maximum_units": 10,
|
|
380
|
-
* "unit_amount": "0.50"
|
|
381
|
-
* },
|
|
382
|
-
* {
|
|
383
|
-
* "maximum_units": 1000,
|
|
384
|
-
* "unit_amount": "0.40"
|
|
385
|
-
* }
|
|
386
|
-
* ]
|
|
387
|
-
* }
|
|
388
|
-
* ...
|
|
389
|
-
* }
|
|
390
|
-
* ```
|
|
391
|
-
*
|
|
392
|
-
* ## Package pricing
|
|
393
|
-
*
|
|
394
|
-
* Package pricing defines the size or granularity of a unit for billing purposes.
|
|
395
|
-
* For example, if the package size is set to 5, then 4 units will be billed as 5
|
|
396
|
-
* and 6 units will be billed at 10.
|
|
397
|
-
*
|
|
398
|
-
* ```json
|
|
399
|
-
* {
|
|
400
|
-
* ...
|
|
401
|
-
* "model_type": "package",
|
|
402
|
-
* "package_config": {
|
|
403
|
-
* "package_amount": "0.80",
|
|
404
|
-
* "package_size": 10
|
|
405
|
-
* }
|
|
406
|
-
* ...
|
|
407
|
-
* }
|
|
408
|
-
* ```
|
|
409
|
-
*
|
|
410
|
-
* ## BPS pricing
|
|
411
|
-
*
|
|
412
|
-
* BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
|
|
413
|
-
* percent (the number of basis points to charge), as well as a cap per event to
|
|
414
|
-
* assess. For example, this would allow you to assess a fee of 0.25% on every
|
|
415
|
-
* payment you process, with a maximum charge of $25 per payment.
|
|
416
|
-
*
|
|
417
|
-
* ```json
|
|
418
|
-
* {
|
|
419
|
-
* ...
|
|
420
|
-
* "model_type": "bps",
|
|
421
|
-
* "bps_config": {
|
|
422
|
-
* "bps": 125,
|
|
423
|
-
* "per_unit_maximum": "11.00"
|
|
424
|
-
* }
|
|
425
|
-
* ...
|
|
426
|
-
* }
|
|
427
|
-
* ```
|
|
428
|
-
*
|
|
429
|
-
* ## Bulk BPS pricing
|
|
430
|
-
*
|
|
431
|
-
* Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
|
|
432
|
-
* total quantity across all events. Similar to bulk pricing, the BPS parameters of
|
|
433
|
-
* a given event depends on the tier range that the billing period falls into. Each
|
|
434
|
-
* tier range is defined by an upper bound. For example, after $1.5M of payment
|
|
435
|
-
* volume is reached, each individual payment may have a lower cap or a smaller
|
|
436
|
-
* take-rate.
|
|
437
|
-
*
|
|
438
|
-
* ```json
|
|
439
|
-
* ...
|
|
440
|
-
* "model_type": "bulk_bps",
|
|
441
|
-
* "bulk_bps_config": {
|
|
442
|
-
* "tiers": [
|
|
443
|
-
* {
|
|
444
|
-
* "maximum_amount": "1000000.00",
|
|
445
|
-
* "bps": 125,
|
|
446
|
-
* "per_unit_maximum": "19.00"
|
|
447
|
-
* },
|
|
448
|
-
* {
|
|
449
|
-
* "maximum_amount": null,
|
|
450
|
-
* "bps": 115,
|
|
451
|
-
* "per_unit_maximum": "4.00"
|
|
452
|
-
* }
|
|
453
|
-
* ]
|
|
454
|
-
* }
|
|
455
|
-
* ...
|
|
456
|
-
* }
|
|
457
|
-
* ```
|
|
458
|
-
*
|
|
459
|
-
* ## Tiered BPS pricing
|
|
460
|
-
*
|
|
461
|
-
* Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
|
|
462
|
-
* event's applicable parameter is a function of its marginal addition to the
|
|
463
|
-
* period total. Similar to tiered pricing, the BPS parameters of a given event
|
|
464
|
-
* depends on the tier range that it falls into, where each tier range is defined
|
|
465
|
-
* by an upper and lower bound. For example, the first few payments may have a 0.8
|
|
466
|
-
* BPS take-rate and all payments after a specific volume may incur a take-rate of
|
|
467
|
-
* 0.5 BPS each.
|
|
468
|
-
*
|
|
469
|
-
* ```json
|
|
470
|
-
* ...
|
|
471
|
-
* "model_type": "tiered_bps",
|
|
472
|
-
* "tiered_bps_config": {
|
|
473
|
-
* "tiers": [
|
|
474
|
-
* {
|
|
475
|
-
* "minimum_amount": "0",
|
|
476
|
-
* "maximum_amount": "1000000.00",
|
|
477
|
-
* "bps": 125,
|
|
478
|
-
* "per_unit_maximum": "19.00"
|
|
479
|
-
* },
|
|
480
|
-
* {
|
|
481
|
-
* "minimum_amount": "1000000.00",
|
|
482
|
-
* "maximum_amount": null,
|
|
483
|
-
* "bps": 115,
|
|
484
|
-
* "per_unit_maximum": "4.00"
|
|
485
|
-
* }
|
|
486
|
-
* ]
|
|
487
|
-
* }
|
|
488
|
-
* ...
|
|
489
|
-
* }
|
|
490
|
-
* ```
|
|
491
|
-
*
|
|
492
|
-
* ## Matrix pricing
|
|
493
|
-
*
|
|
494
|
-
* Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
|
|
495
|
-
* `dimensions` defines the two event property values evaluated in this pricing
|
|
496
|
-
* model. In a one-dimensional matrix, the second value is `null`. Every
|
|
497
|
-
* configuration has a list of `matrix_values` which give the unit prices for
|
|
498
|
-
* specified property values. In a one-dimensional matrix, the matrix values will
|
|
499
|
-
* have `dimension_values` where the second value of the pair is null. If an event
|
|
500
|
-
* does not match any of the dimension values in the matrix, it will resort to the
|
|
501
|
-
* `default_unit_amount`.
|
|
502
|
-
*
|
|
503
|
-
* ```json
|
|
504
|
-
* {
|
|
505
|
-
* "model_type": "matrix"
|
|
506
|
-
* "matrix_config": {
|
|
507
|
-
* "default_unit_amount": "3.00",
|
|
508
|
-
* "dimensions": [
|
|
509
|
-
* "cluster_name",
|
|
510
|
-
* "region"
|
|
511
|
-
* ],
|
|
512
|
-
* "matrix_values": [
|
|
513
|
-
* {
|
|
514
|
-
* "dimension_values": [
|
|
515
|
-
* "alpha",
|
|
516
|
-
* "west"
|
|
517
|
-
* ],
|
|
518
|
-
* "unit_amount": "2.00"
|
|
519
|
-
* },
|
|
520
|
-
* ...
|
|
521
|
-
* ]
|
|
522
|
-
* }
|
|
523
|
-
* }
|
|
524
|
-
* ```
|
|
525
|
-
*
|
|
526
|
-
* ## Fixed fees
|
|
527
|
-
*
|
|
528
|
-
* Fixed fees are prices that are applied independent of usage quantities, and
|
|
529
|
-
* follow unit pricing. They also have an additional parameter
|
|
530
|
-
* `fixed_price_quantity`. If the Price represents a fixed cost, this represents
|
|
531
|
-
* the quantity of units applied.
|
|
532
|
-
*
|
|
533
|
-
* ```json
|
|
534
|
-
* {
|
|
535
|
-
* ...
|
|
536
|
-
* "id": "price_id",
|
|
537
|
-
* "model_type": "unit",
|
|
538
|
-
* "unit_config": {
|
|
539
|
-
* "unit_amount": "2.00"
|
|
540
|
-
* },
|
|
541
|
-
* "fixed_price_quantity": 3.0
|
|
542
|
-
* ...
|
|
543
|
-
* }
|
|
544
|
-
* ```
|
|
322
|
+
* For more on the types of prices, see
|
|
323
|
+
* [the core concepts documentation](/core-concepts#plan-and-price)
|
|
545
324
|
*/
|
|
546
325
|
price: PricesAPI.Price;
|
|
547
326
|
|
|
@@ -597,229 +376,8 @@ export namespace CostListByExternalIDResponse {
|
|
|
597
376
|
* is serialized differently in a given Price object. The model_type field
|
|
598
377
|
* determines the key for the configuration object that is present.
|
|
599
378
|
*
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
* With unit pricing, each unit costs a fixed amount.
|
|
603
|
-
*
|
|
604
|
-
* ```json
|
|
605
|
-
* {
|
|
606
|
-
* ...
|
|
607
|
-
* "model_type": "unit",
|
|
608
|
-
* "unit_config": {
|
|
609
|
-
* "unit_amount": "0.50"
|
|
610
|
-
* }
|
|
611
|
-
* ...
|
|
612
|
-
* }
|
|
613
|
-
* ```
|
|
614
|
-
*
|
|
615
|
-
* ## Tiered pricing
|
|
616
|
-
*
|
|
617
|
-
* In tiered pricing, the cost of a given unit depends on the tier range that it
|
|
618
|
-
* falls into, where each tier range is defined by an upper and lower bound. For
|
|
619
|
-
* example, the first ten units may cost $0.50 each and all units thereafter may
|
|
620
|
-
* cost $0.10 each.
|
|
621
|
-
*
|
|
622
|
-
* ```json
|
|
623
|
-
* {
|
|
624
|
-
* ...
|
|
625
|
-
* "model_type": "tiered",
|
|
626
|
-
* "tiered_config": {
|
|
627
|
-
* "tiers": [
|
|
628
|
-
* {
|
|
629
|
-
* "first_unit": 1,
|
|
630
|
-
* "last_unit": 10,
|
|
631
|
-
* "unit_amount": "0.50"
|
|
632
|
-
* },
|
|
633
|
-
* {
|
|
634
|
-
* "first_unit": 11,
|
|
635
|
-
* "last_unit": null,
|
|
636
|
-
* "unit_amount": "0.10"
|
|
637
|
-
* }
|
|
638
|
-
* ]
|
|
639
|
-
* }
|
|
640
|
-
* ...
|
|
641
|
-
* ```
|
|
642
|
-
*
|
|
643
|
-
* ## Bulk pricing
|
|
644
|
-
*
|
|
645
|
-
* Bulk pricing applies when the number of units determine the cost of all units.
|
|
646
|
-
* For example, if you've bought less than 10 units, they may each be $0.50 for a
|
|
647
|
-
* total of $5.00. Once you've bought more than 10 units, all units may now be
|
|
648
|
-
* priced at $0.40 (i.e. 101 units total would be $40.40).
|
|
649
|
-
*
|
|
650
|
-
* ```json
|
|
651
|
-
* {
|
|
652
|
-
* ...
|
|
653
|
-
* "model_type": "bulk",
|
|
654
|
-
* "bulk_config": {
|
|
655
|
-
* "tiers": [
|
|
656
|
-
* {
|
|
657
|
-
* "maximum_units": 10,
|
|
658
|
-
* "unit_amount": "0.50"
|
|
659
|
-
* },
|
|
660
|
-
* {
|
|
661
|
-
* "maximum_units": 1000,
|
|
662
|
-
* "unit_amount": "0.40"
|
|
663
|
-
* }
|
|
664
|
-
* ]
|
|
665
|
-
* }
|
|
666
|
-
* ...
|
|
667
|
-
* }
|
|
668
|
-
* ```
|
|
669
|
-
*
|
|
670
|
-
* ## Package pricing
|
|
671
|
-
*
|
|
672
|
-
* Package pricing defines the size or granularity of a unit for billing purposes.
|
|
673
|
-
* For example, if the package size is set to 5, then 4 units will be billed as 5
|
|
674
|
-
* and 6 units will be billed at 10.
|
|
675
|
-
*
|
|
676
|
-
* ```json
|
|
677
|
-
* {
|
|
678
|
-
* ...
|
|
679
|
-
* "model_type": "package",
|
|
680
|
-
* "package_config": {
|
|
681
|
-
* "package_amount": "0.80",
|
|
682
|
-
* "package_size": 10
|
|
683
|
-
* }
|
|
684
|
-
* ...
|
|
685
|
-
* }
|
|
686
|
-
* ```
|
|
687
|
-
*
|
|
688
|
-
* ## BPS pricing
|
|
689
|
-
*
|
|
690
|
-
* BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
|
|
691
|
-
* percent (the number of basis points to charge), as well as a cap per event to
|
|
692
|
-
* assess. For example, this would allow you to assess a fee of 0.25% on every
|
|
693
|
-
* payment you process, with a maximum charge of $25 per payment.
|
|
694
|
-
*
|
|
695
|
-
* ```json
|
|
696
|
-
* {
|
|
697
|
-
* ...
|
|
698
|
-
* "model_type": "bps",
|
|
699
|
-
* "bps_config": {
|
|
700
|
-
* "bps": 125,
|
|
701
|
-
* "per_unit_maximum": "11.00"
|
|
702
|
-
* }
|
|
703
|
-
* ...
|
|
704
|
-
* }
|
|
705
|
-
* ```
|
|
706
|
-
*
|
|
707
|
-
* ## Bulk BPS pricing
|
|
708
|
-
*
|
|
709
|
-
* Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
|
|
710
|
-
* total quantity across all events. Similar to bulk pricing, the BPS parameters of
|
|
711
|
-
* a given event depends on the tier range that the billing period falls into. Each
|
|
712
|
-
* tier range is defined by an upper bound. For example, after $1.5M of payment
|
|
713
|
-
* volume is reached, each individual payment may have a lower cap or a smaller
|
|
714
|
-
* take-rate.
|
|
715
|
-
*
|
|
716
|
-
* ```json
|
|
717
|
-
* ...
|
|
718
|
-
* "model_type": "bulk_bps",
|
|
719
|
-
* "bulk_bps_config": {
|
|
720
|
-
* "tiers": [
|
|
721
|
-
* {
|
|
722
|
-
* "maximum_amount": "1000000.00",
|
|
723
|
-
* "bps": 125,
|
|
724
|
-
* "per_unit_maximum": "19.00"
|
|
725
|
-
* },
|
|
726
|
-
* {
|
|
727
|
-
* "maximum_amount": null,
|
|
728
|
-
* "bps": 115,
|
|
729
|
-
* "per_unit_maximum": "4.00"
|
|
730
|
-
* }
|
|
731
|
-
* ]
|
|
732
|
-
* }
|
|
733
|
-
* ...
|
|
734
|
-
* }
|
|
735
|
-
* ```
|
|
736
|
-
*
|
|
737
|
-
* ## Tiered BPS pricing
|
|
738
|
-
*
|
|
739
|
-
* Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
|
|
740
|
-
* event's applicable parameter is a function of its marginal addition to the
|
|
741
|
-
* period total. Similar to tiered pricing, the BPS parameters of a given event
|
|
742
|
-
* depends on the tier range that it falls into, where each tier range is defined
|
|
743
|
-
* by an upper and lower bound. For example, the first few payments may have a 0.8
|
|
744
|
-
* BPS take-rate and all payments after a specific volume may incur a take-rate of
|
|
745
|
-
* 0.5 BPS each.
|
|
746
|
-
*
|
|
747
|
-
* ```json
|
|
748
|
-
* ...
|
|
749
|
-
* "model_type": "tiered_bps",
|
|
750
|
-
* "tiered_bps_config": {
|
|
751
|
-
* "tiers": [
|
|
752
|
-
* {
|
|
753
|
-
* "minimum_amount": "0",
|
|
754
|
-
* "maximum_amount": "1000000.00",
|
|
755
|
-
* "bps": 125,
|
|
756
|
-
* "per_unit_maximum": "19.00"
|
|
757
|
-
* },
|
|
758
|
-
* {
|
|
759
|
-
* "minimum_amount": "1000000.00",
|
|
760
|
-
* "maximum_amount": null,
|
|
761
|
-
* "bps": 115,
|
|
762
|
-
* "per_unit_maximum": "4.00"
|
|
763
|
-
* }
|
|
764
|
-
* ]
|
|
765
|
-
* }
|
|
766
|
-
* ...
|
|
767
|
-
* }
|
|
768
|
-
* ```
|
|
769
|
-
*
|
|
770
|
-
* ## Matrix pricing
|
|
771
|
-
*
|
|
772
|
-
* Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
|
|
773
|
-
* `dimensions` defines the two event property values evaluated in this pricing
|
|
774
|
-
* model. In a one-dimensional matrix, the second value is `null`. Every
|
|
775
|
-
* configuration has a list of `matrix_values` which give the unit prices for
|
|
776
|
-
* specified property values. In a one-dimensional matrix, the matrix values will
|
|
777
|
-
* have `dimension_values` where the second value of the pair is null. If an event
|
|
778
|
-
* does not match any of the dimension values in the matrix, it will resort to the
|
|
779
|
-
* `default_unit_amount`.
|
|
780
|
-
*
|
|
781
|
-
* ```json
|
|
782
|
-
* {
|
|
783
|
-
* "model_type": "matrix"
|
|
784
|
-
* "matrix_config": {
|
|
785
|
-
* "default_unit_amount": "3.00",
|
|
786
|
-
* "dimensions": [
|
|
787
|
-
* "cluster_name",
|
|
788
|
-
* "region"
|
|
789
|
-
* ],
|
|
790
|
-
* "matrix_values": [
|
|
791
|
-
* {
|
|
792
|
-
* "dimension_values": [
|
|
793
|
-
* "alpha",
|
|
794
|
-
* "west"
|
|
795
|
-
* ],
|
|
796
|
-
* "unit_amount": "2.00"
|
|
797
|
-
* },
|
|
798
|
-
* ...
|
|
799
|
-
* ]
|
|
800
|
-
* }
|
|
801
|
-
* }
|
|
802
|
-
* ```
|
|
803
|
-
*
|
|
804
|
-
* ## Fixed fees
|
|
805
|
-
*
|
|
806
|
-
* Fixed fees are prices that are applied independent of usage quantities, and
|
|
807
|
-
* follow unit pricing. They also have an additional parameter
|
|
808
|
-
* `fixed_price_quantity`. If the Price represents a fixed cost, this represents
|
|
809
|
-
* the quantity of units applied.
|
|
810
|
-
*
|
|
811
|
-
* ```json
|
|
812
|
-
* {
|
|
813
|
-
* ...
|
|
814
|
-
* "id": "price_id",
|
|
815
|
-
* "model_type": "unit",
|
|
816
|
-
* "unit_config": {
|
|
817
|
-
* "unit_amount": "2.00"
|
|
818
|
-
* },
|
|
819
|
-
* "fixed_price_quantity": 3.0
|
|
820
|
-
* ...
|
|
821
|
-
* }
|
|
822
|
-
* ```
|
|
379
|
+
* For more on the types of prices, see
|
|
380
|
+
* [the core concepts documentation](/core-concepts#plan-and-price)
|
|
823
381
|
*/
|
|
824
382
|
price: PricesAPI.Price;
|
|
825
383
|
|
|
@@ -9,11 +9,11 @@ export class Ledger extends APIResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* The credits ledger provides _auditing_ functionality over Orb's credits system
|
|
11
11
|
* with a list of actions that have taken place to modify a customer's credit
|
|
12
|
-
* balance. This [paginated endpoint](
|
|
13
|
-
* starting from the most recent ledger entry.
|
|
12
|
+
* balance. This [paginated endpoint](/api-reference/pagination) lists these
|
|
13
|
+
* entries, starting from the most recent ledger entry.
|
|
14
14
|
*
|
|
15
15
|
* More details on using Orb's real-time credit feature are
|
|
16
|
-
* [here](
|
|
16
|
+
* [here](/product-catalog/prepurchase).
|
|
17
17
|
*
|
|
18
18
|
* There are four major types of modifications to credit balance, detailed below.
|
|
19
19
|
*
|
|
@@ -358,11 +358,11 @@ export class Ledger extends APIResource {
|
|
|
358
358
|
/**
|
|
359
359
|
* The credits ledger provides _auditing_ functionality over Orb's credits system
|
|
360
360
|
* with a list of actions that have taken place to modify a customer's credit
|
|
361
|
-
* balance. This [paginated endpoint](
|
|
362
|
-
* starting from the most recent ledger entry.
|
|
361
|
+
* balance. This [paginated endpoint](/api-reference/pagination) lists these
|
|
362
|
+
* entries, starting from the most recent ledger entry.
|
|
363
363
|
*
|
|
364
364
|
* More details on using Orb's real-time credit feature are
|
|
365
|
-
* [here](
|
|
365
|
+
* [here](/product-catalog/prepurchase).
|
|
366
366
|
*
|
|
367
367
|
* There are four major types of modifications to credit balance, detailed below.
|
|
368
368
|
*
|
|
@@ -468,8 +468,8 @@ export class LedgerListResponsesPage extends Page<LedgerListResponse> {}
|
|
|
468
468
|
export class LedgerListByExternalIDResponsesPage extends Page<LedgerListByExternalIDResponse> {}
|
|
469
469
|
|
|
470
470
|
/**
|
|
471
|
-
* The [Credit Ledger Entry resource](/
|
|
472
|
-
*
|
|
471
|
+
* The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
|
|
472
|
+
* credits within Orb.
|
|
473
473
|
*/
|
|
474
474
|
export type LedgerListResponse =
|
|
475
475
|
| LedgerListResponse.IncrementLedgerEntry
|
|
@@ -851,8 +851,8 @@ export namespace LedgerListResponse {
|
|
|
851
851
|
}
|
|
852
852
|
|
|
853
853
|
/**
|
|
854
|
-
* The [Credit Ledger Entry resource](/
|
|
855
|
-
*
|
|
854
|
+
* The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
|
|
855
|
+
* credits within Orb.
|
|
856
856
|
*/
|
|
857
857
|
export type LedgerCreateEntryResponse =
|
|
858
858
|
| LedgerCreateEntryResponse.IncrementLedgerEntry
|
|
@@ -1234,8 +1234,8 @@ export namespace LedgerCreateEntryResponse {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
|
|
1236
1236
|
/**
|
|
1237
|
-
* The [Credit Ledger Entry resource](/
|
|
1238
|
-
*
|
|
1237
|
+
* The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
|
|
1238
|
+
* credits within Orb.
|
|
1239
1239
|
*/
|
|
1240
1240
|
export type LedgerCreateEntryByExternalIDResponse =
|
|
1241
1241
|
| LedgerCreateEntryByExternalIDResponse.IncrementLedgerEntry
|
|
@@ -1617,8 +1617,8 @@ export namespace LedgerCreateEntryByExternalIDResponse {
|
|
|
1617
1617
|
}
|
|
1618
1618
|
|
|
1619
1619
|
/**
|
|
1620
|
-
* The [Credit Ledger Entry resource](/
|
|
1621
|
-
*
|
|
1620
|
+
* The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
|
|
1621
|
+
* credits within Orb.
|
|
1622
1622
|
*/
|
|
1623
1623
|
export type LedgerListByExternalIDResponse =
|
|
1624
1624
|
| LedgerListByExternalIDResponse.IncrementLedgerEntry
|