orb-billing 4.48.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 +16 -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 +14 -14
- package/resources/plans/plans.js +6 -6
- package/resources/plans/plans.mjs +6 -6
- 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 +14 -235
- 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 +153 -2813
- 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 -14
- package/src/resources/prices/external-price-id.ts +2 -2
- package/src/resources/prices/prices.ts +14 -235
- package/src/resources/subscriptions.ts +153 -2813
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -40,17 +40,17 @@ export class Customers extends APIResource {
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* This operation is used to create an Orb customer, who is party to the core
|
|
43
|
-
* billing relationship. See [Customer](
|
|
44
|
-
*
|
|
43
|
+
* billing relationship. See [Customer](/core-concepts##customer) for an overview
|
|
44
|
+
* of the customer resource.
|
|
45
45
|
*
|
|
46
46
|
* This endpoint is critical in the following Orb functionality:
|
|
47
47
|
*
|
|
48
48
|
* - Automated charges can be configured by setting `payment_provider` and
|
|
49
49
|
* `payment_provider_id` to automatically issue invoices
|
|
50
|
-
* - [Customer ID Aliases](
|
|
51
|
-
*
|
|
52
|
-
* - [Timezone localization](
|
|
53
|
-
*
|
|
50
|
+
* - [Customer ID Aliases](/events-and-metrics/customer-aliases) can be configured
|
|
51
|
+
* by setting `external_customer_id`
|
|
52
|
+
* - [Timezone localization](/essentials/timezones) can be configured on a
|
|
53
|
+
* per-customer basis by setting the `timezone` parameter
|
|
54
54
|
*/
|
|
55
55
|
create(body: CustomerCreateParams, options?: Core.RequestOptions): Core.APIPromise<Customer> {
|
|
56
56
|
return this._client.post('/customers', { body, ...options });
|
|
@@ -75,10 +75,9 @@ export class Customers extends APIResource {
|
|
|
75
75
|
* This endpoint returns a list of all customers for an account. The list of
|
|
76
76
|
* customers is ordered starting from the most recently created customer. This
|
|
77
77
|
* endpoint follows Orb's
|
|
78
|
-
* [standardized pagination format](
|
|
78
|
+
* [standardized pagination format](/api-reference/pagination).
|
|
79
79
|
*
|
|
80
|
-
* See [Customer](
|
|
81
|
-
* model.
|
|
80
|
+
* See [Customer](/core-concepts##customer) for an overview of the customer model.
|
|
82
81
|
*/
|
|
83
82
|
list(query?: CustomerListParams, options?: Core.RequestOptions): Core.PagePromise<CustomersPage, Customer>;
|
|
84
83
|
list(options?: Core.RequestOptions): Core.PagePromise<CustomersPage, Customer>;
|
|
@@ -119,8 +118,8 @@ export class Customers extends APIResource {
|
|
|
119
118
|
* `Customer` is in the process of being deleted, only the properties `id` and
|
|
120
119
|
* `deleted: true` will be returned.
|
|
121
120
|
*
|
|
122
|
-
* See the [Customer resource](
|
|
123
|
-
*
|
|
121
|
+
* See the [Customer resource](/core-concepts#customer) for a full discussion of
|
|
122
|
+
* the Customer model.
|
|
124
123
|
*/
|
|
125
124
|
fetch(customerId: string, options?: Core.RequestOptions): Core.APIPromise<Customer> {
|
|
126
125
|
return this._client.get(`/customers/${customerId}`, options);
|
|
@@ -128,7 +127,7 @@ export class Customers extends APIResource {
|
|
|
128
127
|
|
|
129
128
|
/**
|
|
130
129
|
* This endpoint is used to fetch customer details given an `external_customer_id`
|
|
131
|
-
* (see [Customer ID Aliases](
|
|
130
|
+
* (see [Customer ID Aliases](/events-and-metrics/customer-aliases)).
|
|
132
131
|
*
|
|
133
132
|
* Note that the resource and semantics of this endpoint exactly mirror
|
|
134
133
|
* [Get Customer](fetch-customer).
|
|
@@ -139,8 +138,8 @@ export class Customers extends APIResource {
|
|
|
139
138
|
|
|
140
139
|
/**
|
|
141
140
|
* This endpoint is used to update customer details given an `external_customer_id`
|
|
142
|
-
* (see [Customer ID Aliases](
|
|
143
|
-
*
|
|
141
|
+
* (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the
|
|
142
|
+
* resource and semantics of this endpoint exactly mirror
|
|
144
143
|
* [Update Customer](update-customer).
|
|
145
144
|
*/
|
|
146
145
|
updateByExternalId(
|
|
@@ -162,7 +161,7 @@ export class CustomersPage extends Page<Customer> {}
|
|
|
162
161
|
* it's often desirable to have these match existing identifiers in your system. To
|
|
163
162
|
* avoid having to denormalize Orb ID information, you can pass in an
|
|
164
163
|
* `external_customer_id` with your own identifier. See
|
|
165
|
-
* [Customer ID Aliases](
|
|
164
|
+
* [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
|
|
166
165
|
* information about how these aliases work in Orb.
|
|
167
166
|
*
|
|
168
167
|
* In addition to having an identifier in your system, a customer may exist in a
|
|
@@ -171,9 +170,8 @@ export class CustomersPage extends Page<Customer> {}
|
|
|
171
170
|
*
|
|
172
171
|
* A customer also has a timezone (from the standard
|
|
173
172
|
* [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
|
|
174
|
-
* your account's timezone. See
|
|
175
|
-
*
|
|
176
|
-
* on what this timezone parameter influences within Orb.
|
|
173
|
+
* your account's timezone. See [Timezone localization](/essentials/timezones) for
|
|
174
|
+
* information on what this timezone parameter influences within Orb.
|
|
177
175
|
*/
|
|
178
176
|
export interface Customer {
|
|
179
177
|
id: string;
|
|
@@ -38,12 +38,12 @@ export class Backfills extends APIResource {
|
|
|
38
38
|
* affect all customers.
|
|
39
39
|
*
|
|
40
40
|
* When `replace_existing_events` is `true`, this indicates that existing events in
|
|
41
|
-
* the timeframe should no longer be
|
|
41
|
+
* the timeframe should no longer be counter towards invoiced usage. In this
|
|
42
42
|
* scenario, the parameter `filter` can be optionally added which enables filtering
|
|
43
43
|
* using
|
|
44
|
-
* [computed properties](
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* [computed properties](/extensibility/advanced-metrics#computed-properties). The
|
|
45
|
+
* expressiveness of computed properties allows you to deprecate existing events
|
|
46
|
+
* based on both a period of time and specific property values.
|
|
47
47
|
*/
|
|
48
48
|
create(body: BackfillCreateParams, options?: Core.RequestOptions): Core.APIPromise<BackfillCreateResponse> {
|
|
49
49
|
return this._client.post('/events/backfills', { body, ...options });
|
|
@@ -54,9 +54,9 @@ export class Backfills extends APIResource {
|
|
|
54
54
|
*
|
|
55
55
|
* The list of backfills is ordered starting from the most recently created
|
|
56
56
|
* backfill. The response also includes
|
|
57
|
-
* [`pagination_metadata`](
|
|
58
|
-
* the next page of results if they exist. More information about
|
|
59
|
-
* found in the [Pagination-metadata schema](pagination).
|
|
57
|
+
* [`pagination_metadata`](/api-reference/pagination), which lets the caller
|
|
58
|
+
* retrieve the next page of results if they exist. More information about
|
|
59
|
+
* pagination can be found in the [Pagination-metadata schema](pagination).
|
|
60
60
|
*/
|
|
61
61
|
list(
|
|
62
62
|
query?: BackfillListParams,
|
|
@@ -148,8 +148,8 @@ export interface BackfillCreateResponse {
|
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
150
|
* A boolean
|
|
151
|
-
* [computed property](
|
|
152
|
-
*
|
|
151
|
+
* [computed property](/extensibility/advanced-metrics#computed-properties) used to
|
|
152
|
+
* filter the set of events to deprecate
|
|
153
153
|
*/
|
|
154
154
|
deprecation_filter?: string | null;
|
|
155
155
|
}
|
|
@@ -196,8 +196,8 @@ export interface BackfillListResponse {
|
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
198
|
* A boolean
|
|
199
|
-
* [computed property](
|
|
200
|
-
*
|
|
199
|
+
* [computed property](/extensibility/advanced-metrics#computed-properties) used to
|
|
200
|
+
* filter the set of events to deprecate
|
|
201
201
|
*/
|
|
202
202
|
deprecation_filter?: string | null;
|
|
203
203
|
}
|
|
@@ -244,8 +244,8 @@ export interface BackfillCloseResponse {
|
|
|
244
244
|
|
|
245
245
|
/**
|
|
246
246
|
* A boolean
|
|
247
|
-
* [computed property](
|
|
248
|
-
*
|
|
247
|
+
* [computed property](/extensibility/advanced-metrics#computed-properties) used to
|
|
248
|
+
* filter the set of events to deprecate
|
|
249
249
|
*/
|
|
250
250
|
deprecation_filter?: string | null;
|
|
251
251
|
}
|
|
@@ -292,8 +292,8 @@ export interface BackfillFetchResponse {
|
|
|
292
292
|
|
|
293
293
|
/**
|
|
294
294
|
* A boolean
|
|
295
|
-
* [computed property](
|
|
296
|
-
*
|
|
295
|
+
* [computed property](/extensibility/advanced-metrics#computed-properties) used to
|
|
296
|
+
* filter the set of events to deprecate
|
|
297
297
|
*/
|
|
298
298
|
deprecation_filter?: string | null;
|
|
299
299
|
}
|
|
@@ -340,8 +340,8 @@ export interface BackfillRevertResponse {
|
|
|
340
340
|
|
|
341
341
|
/**
|
|
342
342
|
* A boolean
|
|
343
|
-
* [computed property](
|
|
344
|
-
*
|
|
343
|
+
* [computed property](/extensibility/advanced-metrics#computed-properties) used to
|
|
344
|
+
* filter the set of events to deprecate
|
|
345
345
|
*/
|
|
346
346
|
deprecation_filter?: string | null;
|
|
347
347
|
}
|
|
@@ -372,8 +372,8 @@ export interface BackfillCreateParams {
|
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
374
|
* A boolean
|
|
375
|
-
* [computed property](
|
|
376
|
-
*
|
|
375
|
+
* [computed property](/extensibility/advanced-metrics#computed-properties) used to
|
|
376
|
+
* filter the set of events to deprecate
|
|
377
377
|
*/
|
|
378
378
|
deprecation_filter?: string | null;
|
|
379
379
|
|
|
@@ -299,8 +299,8 @@ export class Events extends APIResource {
|
|
|
299
299
|
*
|
|
300
300
|
* If `debug=true` is not specified, the response will only contain
|
|
301
301
|
* `validation_failed`. Orb will still honor the idempotency guarantees set
|
|
302
|
-
* [here](
|
|
303
|
-
*
|
|
302
|
+
* [here](/events-and-metrics/event-ingestion#event-volume-and-concurrency) in all
|
|
303
|
+
* cases.
|
|
304
304
|
*
|
|
305
305
|
* We strongly recommend that you only use debug mode as part of testing your
|
|
306
306
|
* initial Orb integration. Once you're ready to switch to production, disable
|
|
@@ -333,7 +333,7 @@ export class Events extends APIResource {
|
|
|
333
333
|
|
|
334
334
|
/**
|
|
335
335
|
* This endpoint returns a filtered set of events for an account in a
|
|
336
|
-
* [paginated list format](
|
|
336
|
+
* [paginated list format](/api-reference/pagination).
|
|
337
337
|
*
|
|
338
338
|
* Note that this is a `POST` endpoint rather than a `GET` endpoint because it
|
|
339
339
|
* employs a JSON body for search criteria rather than query parameters, allowing
|
|
@@ -412,10 +412,9 @@ export interface EventSearchResponse {
|
|
|
412
412
|
|
|
413
413
|
export namespace EventSearchResponse {
|
|
414
414
|
/**
|
|
415
|
-
* The [Event](
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* period.
|
|
415
|
+
* The [Event](/core-concepts#event) resource represents a usage event that has
|
|
416
|
+
* been created for a customer. Events are the core of Orb's usage-based billing
|
|
417
|
+
* model, and are used to calculate the usage charges for a given billing period.
|
|
419
418
|
*/
|
|
420
419
|
export interface Data {
|
|
421
420
|
/**
|
|
@@ -6,13 +6,13 @@ import * as Core from '../../core';
|
|
|
6
6
|
export class Volume extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* This endpoint returns the event volume for an account in a
|
|
9
|
-
* [paginated list format](
|
|
9
|
+
* [paginated list format](/api-reference/pagination).
|
|
10
10
|
*
|
|
11
11
|
* The event volume is aggregated by the hour and the
|
|
12
|
-
* [timestamp](
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* [timestamp](/api-reference/event/ingest-events) field is used to determine which
|
|
13
|
+
* hour an event is associated with. Note, this means that late-arriving events
|
|
14
|
+
* increment the volume count for the hour window the timestamp is in, not the
|
|
15
|
+
* latest hour window.
|
|
16
16
|
*
|
|
17
17
|
* Each item in the response contains the count of events aggregated by the hour
|
|
18
18
|
* where the start and end time are hour-aligned and in UTC. When a specific
|
|
@@ -65,229 +65,8 @@ export interface InvoiceLineItemCreateResponse {
|
|
|
65
65
|
* is serialized differently in a given Price object. The model_type field
|
|
66
66
|
* determines the key for the configuration object that is present.
|
|
67
67
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* With unit pricing, each unit costs a fixed amount.
|
|
71
|
-
*
|
|
72
|
-
* ```json
|
|
73
|
-
* {
|
|
74
|
-
* ...
|
|
75
|
-
* "model_type": "unit",
|
|
76
|
-
* "unit_config": {
|
|
77
|
-
* "unit_amount": "0.50"
|
|
78
|
-
* }
|
|
79
|
-
* ...
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* ## Tiered pricing
|
|
84
|
-
*
|
|
85
|
-
* In tiered pricing, the cost of a given unit depends on the tier range that it
|
|
86
|
-
* falls into, where each tier range is defined by an upper and lower bound. For
|
|
87
|
-
* example, the first ten units may cost $0.50 each and all units thereafter may
|
|
88
|
-
* cost $0.10 each.
|
|
89
|
-
*
|
|
90
|
-
* ```json
|
|
91
|
-
* {
|
|
92
|
-
* ...
|
|
93
|
-
* "model_type": "tiered",
|
|
94
|
-
* "tiered_config": {
|
|
95
|
-
* "tiers": [
|
|
96
|
-
* {
|
|
97
|
-
* "first_unit": 1,
|
|
98
|
-
* "last_unit": 10,
|
|
99
|
-
* "unit_amount": "0.50"
|
|
100
|
-
* },
|
|
101
|
-
* {
|
|
102
|
-
* "first_unit": 11,
|
|
103
|
-
* "last_unit": null,
|
|
104
|
-
* "unit_amount": "0.10"
|
|
105
|
-
* }
|
|
106
|
-
* ]
|
|
107
|
-
* }
|
|
108
|
-
* ...
|
|
109
|
-
* ```
|
|
110
|
-
*
|
|
111
|
-
* ## Bulk pricing
|
|
112
|
-
*
|
|
113
|
-
* Bulk pricing applies when the number of units determine the cost of all units.
|
|
114
|
-
* For example, if you've bought less than 10 units, they may each be $0.50 for a
|
|
115
|
-
* total of $5.00. Once you've bought more than 10 units, all units may now be
|
|
116
|
-
* priced at $0.40 (i.e. 101 units total would be $40.40).
|
|
117
|
-
*
|
|
118
|
-
* ```json
|
|
119
|
-
* {
|
|
120
|
-
* ...
|
|
121
|
-
* "model_type": "bulk",
|
|
122
|
-
* "bulk_config": {
|
|
123
|
-
* "tiers": [
|
|
124
|
-
* {
|
|
125
|
-
* "maximum_units": 10,
|
|
126
|
-
* "unit_amount": "0.50"
|
|
127
|
-
* },
|
|
128
|
-
* {
|
|
129
|
-
* "maximum_units": 1000,
|
|
130
|
-
* "unit_amount": "0.40"
|
|
131
|
-
* }
|
|
132
|
-
* ]
|
|
133
|
-
* }
|
|
134
|
-
* ...
|
|
135
|
-
* }
|
|
136
|
-
* ```
|
|
137
|
-
*
|
|
138
|
-
* ## Package pricing
|
|
139
|
-
*
|
|
140
|
-
* Package pricing defines the size or granularity of a unit for billing purposes.
|
|
141
|
-
* For example, if the package size is set to 5, then 4 units will be billed as 5
|
|
142
|
-
* and 6 units will be billed at 10.
|
|
143
|
-
*
|
|
144
|
-
* ```json
|
|
145
|
-
* {
|
|
146
|
-
* ...
|
|
147
|
-
* "model_type": "package",
|
|
148
|
-
* "package_config": {
|
|
149
|
-
* "package_amount": "0.80",
|
|
150
|
-
* "package_size": 10
|
|
151
|
-
* }
|
|
152
|
-
* ...
|
|
153
|
-
* }
|
|
154
|
-
* ```
|
|
155
|
-
*
|
|
156
|
-
* ## BPS pricing
|
|
157
|
-
*
|
|
158
|
-
* BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
|
|
159
|
-
* percent (the number of basis points to charge), as well as a cap per event to
|
|
160
|
-
* assess. For example, this would allow you to assess a fee of 0.25% on every
|
|
161
|
-
* payment you process, with a maximum charge of $25 per payment.
|
|
162
|
-
*
|
|
163
|
-
* ```json
|
|
164
|
-
* {
|
|
165
|
-
* ...
|
|
166
|
-
* "model_type": "bps",
|
|
167
|
-
* "bps_config": {
|
|
168
|
-
* "bps": 125,
|
|
169
|
-
* "per_unit_maximum": "11.00"
|
|
170
|
-
* }
|
|
171
|
-
* ...
|
|
172
|
-
* }
|
|
173
|
-
* ```
|
|
174
|
-
*
|
|
175
|
-
* ## Bulk BPS pricing
|
|
176
|
-
*
|
|
177
|
-
* Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
|
|
178
|
-
* total quantity across all events. Similar to bulk pricing, the BPS parameters of
|
|
179
|
-
* a given event depends on the tier range that the billing period falls into. Each
|
|
180
|
-
* tier range is defined by an upper bound. For example, after $1.5M of payment
|
|
181
|
-
* volume is reached, each individual payment may have a lower cap or a smaller
|
|
182
|
-
* take-rate.
|
|
183
|
-
*
|
|
184
|
-
* ```json
|
|
185
|
-
* ...
|
|
186
|
-
* "model_type": "bulk_bps",
|
|
187
|
-
* "bulk_bps_config": {
|
|
188
|
-
* "tiers": [
|
|
189
|
-
* {
|
|
190
|
-
* "maximum_amount": "1000000.00",
|
|
191
|
-
* "bps": 125,
|
|
192
|
-
* "per_unit_maximum": "19.00"
|
|
193
|
-
* },
|
|
194
|
-
* {
|
|
195
|
-
* "maximum_amount": null,
|
|
196
|
-
* "bps": 115,
|
|
197
|
-
* "per_unit_maximum": "4.00"
|
|
198
|
-
* }
|
|
199
|
-
* ]
|
|
200
|
-
* }
|
|
201
|
-
* ...
|
|
202
|
-
* }
|
|
203
|
-
* ```
|
|
204
|
-
*
|
|
205
|
-
* ## Tiered BPS pricing
|
|
206
|
-
*
|
|
207
|
-
* Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
|
|
208
|
-
* event's applicable parameter is a function of its marginal addition to the
|
|
209
|
-
* period total. Similar to tiered pricing, the BPS parameters of a given event
|
|
210
|
-
* depends on the tier range that it falls into, where each tier range is defined
|
|
211
|
-
* by an upper and lower bound. For example, the first few payments may have a 0.8
|
|
212
|
-
* BPS take-rate and all payments after a specific volume may incur a take-rate of
|
|
213
|
-
* 0.5 BPS each.
|
|
214
|
-
*
|
|
215
|
-
* ```json
|
|
216
|
-
* ...
|
|
217
|
-
* "model_type": "tiered_bps",
|
|
218
|
-
* "tiered_bps_config": {
|
|
219
|
-
* "tiers": [
|
|
220
|
-
* {
|
|
221
|
-
* "minimum_amount": "0",
|
|
222
|
-
* "maximum_amount": "1000000.00",
|
|
223
|
-
* "bps": 125,
|
|
224
|
-
* "per_unit_maximum": "19.00"
|
|
225
|
-
* },
|
|
226
|
-
* {
|
|
227
|
-
* "minimum_amount": "1000000.00",
|
|
228
|
-
* "maximum_amount": null,
|
|
229
|
-
* "bps": 115,
|
|
230
|
-
* "per_unit_maximum": "4.00"
|
|
231
|
-
* }
|
|
232
|
-
* ]
|
|
233
|
-
* }
|
|
234
|
-
* ...
|
|
235
|
-
* }
|
|
236
|
-
* ```
|
|
237
|
-
*
|
|
238
|
-
* ## Matrix pricing
|
|
239
|
-
*
|
|
240
|
-
* Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
|
|
241
|
-
* `dimensions` defines the two event property values evaluated in this pricing
|
|
242
|
-
* model. In a one-dimensional matrix, the second value is `null`. Every
|
|
243
|
-
* configuration has a list of `matrix_values` which give the unit prices for
|
|
244
|
-
* specified property values. In a one-dimensional matrix, the matrix values will
|
|
245
|
-
* have `dimension_values` where the second value of the pair is null. If an event
|
|
246
|
-
* does not match any of the dimension values in the matrix, it will resort to the
|
|
247
|
-
* `default_unit_amount`.
|
|
248
|
-
*
|
|
249
|
-
* ```json
|
|
250
|
-
* {
|
|
251
|
-
* "model_type": "matrix"
|
|
252
|
-
* "matrix_config": {
|
|
253
|
-
* "default_unit_amount": "3.00",
|
|
254
|
-
* "dimensions": [
|
|
255
|
-
* "cluster_name",
|
|
256
|
-
* "region"
|
|
257
|
-
* ],
|
|
258
|
-
* "matrix_values": [
|
|
259
|
-
* {
|
|
260
|
-
* "dimension_values": [
|
|
261
|
-
* "alpha",
|
|
262
|
-
* "west"
|
|
263
|
-
* ],
|
|
264
|
-
* "unit_amount": "2.00"
|
|
265
|
-
* },
|
|
266
|
-
* ...
|
|
267
|
-
* ]
|
|
268
|
-
* }
|
|
269
|
-
* }
|
|
270
|
-
* ```
|
|
271
|
-
*
|
|
272
|
-
* ## Fixed fees
|
|
273
|
-
*
|
|
274
|
-
* Fixed fees are prices that are applied independent of usage quantities, and
|
|
275
|
-
* follow unit pricing. They also have an additional parameter
|
|
276
|
-
* `fixed_price_quantity`. If the Price represents a fixed cost, this represents
|
|
277
|
-
* the quantity of units applied.
|
|
278
|
-
*
|
|
279
|
-
* ```json
|
|
280
|
-
* {
|
|
281
|
-
* ...
|
|
282
|
-
* "id": "price_id",
|
|
283
|
-
* "model_type": "unit",
|
|
284
|
-
* "unit_config": {
|
|
285
|
-
* "unit_amount": "2.00"
|
|
286
|
-
* },
|
|
287
|
-
* "fixed_price_quantity": 3.0
|
|
288
|
-
* ...
|
|
289
|
-
* }
|
|
290
|
-
* ```
|
|
68
|
+
* For more on the types of prices, see
|
|
69
|
+
* [the core concepts documentation](/core-concepts#plan-and-price)
|
|
291
70
|
*/
|
|
292
71
|
price: PricesAPI.Price | null;
|
|
293
72
|
|