orb-billing 4.49.0 → 4.51.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 +26 -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 +19 -19
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +14 -12
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +14 -12
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/events/backfills.d.ts +18 -18
- package/resources/events/backfills.js +3 -3
- package/resources/events/backfills.mjs +3 -3
- 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 +14 -456
- 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 -15
- 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 +172 -2831
- 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 +19 -19
- package/src/resources/events/backfills.ts +18 -18
- 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 +14 -456
- 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 +15 -15
- package/src/resources/prices/external-price-id.ts +2 -2
- package/src/resources/prices/prices.ts +14 -235
- package/src/resources/subscriptions.ts +172 -2831
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -7,16 +7,16 @@ import { Page, type PageParams } from "../../pagination.js";
|
|
|
7
7
|
export declare class Prices extends APIResource {
|
|
8
8
|
externalPriceId: ExternalPriceIDAPI.ExternalPriceID;
|
|
9
9
|
/**
|
|
10
|
-
* This endpoint is used to create a [price](
|
|
11
|
-
* using this endpoint is always an add-on, meaning that it’s not
|
|
12
|
-
* specific plan and can instead be individually added to
|
|
13
|
-
* subscriptions on different plans.
|
|
10
|
+
* This endpoint is used to create a [price](/product-catalog/price-configuration).
|
|
11
|
+
* A price created using this endpoint is always an add-on, meaning that it’s not
|
|
12
|
+
* associated with a specific plan and can instead be individually added to
|
|
13
|
+
* subscriptions, including subscriptions on different plans.
|
|
14
14
|
*
|
|
15
15
|
* An `external_price_id` can be optionally specified as an alias to allow
|
|
16
16
|
* ergonomic interaction with prices in the Orb API.
|
|
17
17
|
*
|
|
18
|
-
* See the [Price resource](
|
|
19
|
-
* price model configurations possible in this endpoint.
|
|
18
|
+
* See the [Price resource](/product-catalog/price-configuration) for the
|
|
19
|
+
* specification of different price model configurations possible in this endpoint.
|
|
20
20
|
*/
|
|
21
21
|
create(body: PriceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Price>;
|
|
22
22
|
/**
|
|
@@ -27,14 +27,14 @@ export declare class Prices extends APIResource {
|
|
|
27
27
|
update(priceId: string, body: PriceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Price>;
|
|
28
28
|
/**
|
|
29
29
|
* This endpoint is used to list all add-on prices created using the
|
|
30
|
-
* [price creation endpoint](
|
|
30
|
+
* [price creation endpoint](/api-reference/price/create-price).
|
|
31
31
|
*/
|
|
32
32
|
list(query?: PriceListParams, options?: Core.RequestOptions): Core.PagePromise<PricesPage, Price>;
|
|
33
33
|
list(options?: Core.RequestOptions): Core.PagePromise<PricesPage, Price>;
|
|
34
34
|
/**
|
|
35
35
|
* This endpoint is used to evaluate the output of a price for a given customer and
|
|
36
36
|
* time range. It enables filtering and grouping the output using
|
|
37
|
-
* [computed properties](
|
|
37
|
+
* [computed properties](/extensibility/advanced-metrics#computed-properties),
|
|
38
38
|
* supporting the following workflows:
|
|
39
39
|
*
|
|
40
40
|
* 1. Showing detailed usage and costs to the end customer.
|
|
@@ -85,229 +85,8 @@ export interface EvaluatePriceGroup {
|
|
|
85
85
|
* is serialized differently in a given Price object. The model_type field
|
|
86
86
|
* determines the key for the configuration object that is present.
|
|
87
87
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* With unit pricing, each unit costs a fixed amount.
|
|
91
|
-
*
|
|
92
|
-
* ```json
|
|
93
|
-
* {
|
|
94
|
-
* ...
|
|
95
|
-
* "model_type": "unit",
|
|
96
|
-
* "unit_config": {
|
|
97
|
-
* "unit_amount": "0.50"
|
|
98
|
-
* }
|
|
99
|
-
* ...
|
|
100
|
-
* }
|
|
101
|
-
* ```
|
|
102
|
-
*
|
|
103
|
-
* ## Tiered pricing
|
|
104
|
-
*
|
|
105
|
-
* In tiered pricing, the cost of a given unit depends on the tier range that it
|
|
106
|
-
* falls into, where each tier range is defined by an upper and lower bound. For
|
|
107
|
-
* example, the first ten units may cost $0.50 each and all units thereafter may
|
|
108
|
-
* cost $0.10 each.
|
|
109
|
-
*
|
|
110
|
-
* ```json
|
|
111
|
-
* {
|
|
112
|
-
* ...
|
|
113
|
-
* "model_type": "tiered",
|
|
114
|
-
* "tiered_config": {
|
|
115
|
-
* "tiers": [
|
|
116
|
-
* {
|
|
117
|
-
* "first_unit": 1,
|
|
118
|
-
* "last_unit": 10,
|
|
119
|
-
* "unit_amount": "0.50"
|
|
120
|
-
* },
|
|
121
|
-
* {
|
|
122
|
-
* "first_unit": 11,
|
|
123
|
-
* "last_unit": null,
|
|
124
|
-
* "unit_amount": "0.10"
|
|
125
|
-
* }
|
|
126
|
-
* ]
|
|
127
|
-
* }
|
|
128
|
-
* ...
|
|
129
|
-
* ```
|
|
130
|
-
*
|
|
131
|
-
* ## Bulk pricing
|
|
132
|
-
*
|
|
133
|
-
* Bulk pricing applies when the number of units determine the cost of all units.
|
|
134
|
-
* For example, if you've bought less than 10 units, they may each be $0.50 for a
|
|
135
|
-
* total of $5.00. Once you've bought more than 10 units, all units may now be
|
|
136
|
-
* priced at $0.40 (i.e. 101 units total would be $40.40).
|
|
137
|
-
*
|
|
138
|
-
* ```json
|
|
139
|
-
* {
|
|
140
|
-
* ...
|
|
141
|
-
* "model_type": "bulk",
|
|
142
|
-
* "bulk_config": {
|
|
143
|
-
* "tiers": [
|
|
144
|
-
* {
|
|
145
|
-
* "maximum_units": 10,
|
|
146
|
-
* "unit_amount": "0.50"
|
|
147
|
-
* },
|
|
148
|
-
* {
|
|
149
|
-
* "maximum_units": 1000,
|
|
150
|
-
* "unit_amount": "0.40"
|
|
151
|
-
* }
|
|
152
|
-
* ]
|
|
153
|
-
* }
|
|
154
|
-
* ...
|
|
155
|
-
* }
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* ## Package pricing
|
|
159
|
-
*
|
|
160
|
-
* Package pricing defines the size or granularity of a unit for billing purposes.
|
|
161
|
-
* For example, if the package size is set to 5, then 4 units will be billed as 5
|
|
162
|
-
* and 6 units will be billed at 10.
|
|
163
|
-
*
|
|
164
|
-
* ```json
|
|
165
|
-
* {
|
|
166
|
-
* ...
|
|
167
|
-
* "model_type": "package",
|
|
168
|
-
* "package_config": {
|
|
169
|
-
* "package_amount": "0.80",
|
|
170
|
-
* "package_size": 10
|
|
171
|
-
* }
|
|
172
|
-
* ...
|
|
173
|
-
* }
|
|
174
|
-
* ```
|
|
175
|
-
*
|
|
176
|
-
* ## BPS pricing
|
|
177
|
-
*
|
|
178
|
-
* BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
|
|
179
|
-
* percent (the number of basis points to charge), as well as a cap per event to
|
|
180
|
-
* assess. For example, this would allow you to assess a fee of 0.25% on every
|
|
181
|
-
* payment you process, with a maximum charge of $25 per payment.
|
|
182
|
-
*
|
|
183
|
-
* ```json
|
|
184
|
-
* {
|
|
185
|
-
* ...
|
|
186
|
-
* "model_type": "bps",
|
|
187
|
-
* "bps_config": {
|
|
188
|
-
* "bps": 125,
|
|
189
|
-
* "per_unit_maximum": "11.00"
|
|
190
|
-
* }
|
|
191
|
-
* ...
|
|
192
|
-
* }
|
|
193
|
-
* ```
|
|
194
|
-
*
|
|
195
|
-
* ## Bulk BPS pricing
|
|
196
|
-
*
|
|
197
|
-
* Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
|
|
198
|
-
* total quantity across all events. Similar to bulk pricing, the BPS parameters of
|
|
199
|
-
* a given event depends on the tier range that the billing period falls into. Each
|
|
200
|
-
* tier range is defined by an upper bound. For example, after $1.5M of payment
|
|
201
|
-
* volume is reached, each individual payment may have a lower cap or a smaller
|
|
202
|
-
* take-rate.
|
|
203
|
-
*
|
|
204
|
-
* ```json
|
|
205
|
-
* ...
|
|
206
|
-
* "model_type": "bulk_bps",
|
|
207
|
-
* "bulk_bps_config": {
|
|
208
|
-
* "tiers": [
|
|
209
|
-
* {
|
|
210
|
-
* "maximum_amount": "1000000.00",
|
|
211
|
-
* "bps": 125,
|
|
212
|
-
* "per_unit_maximum": "19.00"
|
|
213
|
-
* },
|
|
214
|
-
* {
|
|
215
|
-
* "maximum_amount": null,
|
|
216
|
-
* "bps": 115,
|
|
217
|
-
* "per_unit_maximum": "4.00"
|
|
218
|
-
* }
|
|
219
|
-
* ]
|
|
220
|
-
* }
|
|
221
|
-
* ...
|
|
222
|
-
* }
|
|
223
|
-
* ```
|
|
224
|
-
*
|
|
225
|
-
* ## Tiered BPS pricing
|
|
226
|
-
*
|
|
227
|
-
* Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
|
|
228
|
-
* event's applicable parameter is a function of its marginal addition to the
|
|
229
|
-
* period total. Similar to tiered pricing, the BPS parameters of a given event
|
|
230
|
-
* depends on the tier range that it falls into, where each tier range is defined
|
|
231
|
-
* by an upper and lower bound. For example, the first few payments may have a 0.8
|
|
232
|
-
* BPS take-rate and all payments after a specific volume may incur a take-rate of
|
|
233
|
-
* 0.5 BPS each.
|
|
234
|
-
*
|
|
235
|
-
* ```json
|
|
236
|
-
* ...
|
|
237
|
-
* "model_type": "tiered_bps",
|
|
238
|
-
* "tiered_bps_config": {
|
|
239
|
-
* "tiers": [
|
|
240
|
-
* {
|
|
241
|
-
* "minimum_amount": "0",
|
|
242
|
-
* "maximum_amount": "1000000.00",
|
|
243
|
-
* "bps": 125,
|
|
244
|
-
* "per_unit_maximum": "19.00"
|
|
245
|
-
* },
|
|
246
|
-
* {
|
|
247
|
-
* "minimum_amount": "1000000.00",
|
|
248
|
-
* "maximum_amount": null,
|
|
249
|
-
* "bps": 115,
|
|
250
|
-
* "per_unit_maximum": "4.00"
|
|
251
|
-
* }
|
|
252
|
-
* ]
|
|
253
|
-
* }
|
|
254
|
-
* ...
|
|
255
|
-
* }
|
|
256
|
-
* ```
|
|
257
|
-
*
|
|
258
|
-
* ## Matrix pricing
|
|
259
|
-
*
|
|
260
|
-
* Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
|
|
261
|
-
* `dimensions` defines the two event property values evaluated in this pricing
|
|
262
|
-
* model. In a one-dimensional matrix, the second value is `null`. Every
|
|
263
|
-
* configuration has a list of `matrix_values` which give the unit prices for
|
|
264
|
-
* specified property values. In a one-dimensional matrix, the matrix values will
|
|
265
|
-
* have `dimension_values` where the second value of the pair is null. If an event
|
|
266
|
-
* does not match any of the dimension values in the matrix, it will resort to the
|
|
267
|
-
* `default_unit_amount`.
|
|
268
|
-
*
|
|
269
|
-
* ```json
|
|
270
|
-
* {
|
|
271
|
-
* "model_type": "matrix"
|
|
272
|
-
* "matrix_config": {
|
|
273
|
-
* "default_unit_amount": "3.00",
|
|
274
|
-
* "dimensions": [
|
|
275
|
-
* "cluster_name",
|
|
276
|
-
* "region"
|
|
277
|
-
* ],
|
|
278
|
-
* "matrix_values": [
|
|
279
|
-
* {
|
|
280
|
-
* "dimension_values": [
|
|
281
|
-
* "alpha",
|
|
282
|
-
* "west"
|
|
283
|
-
* ],
|
|
284
|
-
* "unit_amount": "2.00"
|
|
285
|
-
* },
|
|
286
|
-
* ...
|
|
287
|
-
* ]
|
|
288
|
-
* }
|
|
289
|
-
* }
|
|
290
|
-
* ```
|
|
291
|
-
*
|
|
292
|
-
* ## Fixed fees
|
|
293
|
-
*
|
|
294
|
-
* Fixed fees are prices that are applied independent of usage quantities, and
|
|
295
|
-
* follow unit pricing. They also have an additional parameter
|
|
296
|
-
* `fixed_price_quantity`. If the Price represents a fixed cost, this represents
|
|
297
|
-
* the quantity of units applied.
|
|
298
|
-
*
|
|
299
|
-
* ```json
|
|
300
|
-
* {
|
|
301
|
-
* ...
|
|
302
|
-
* "id": "price_id",
|
|
303
|
-
* "model_type": "unit",
|
|
304
|
-
* "unit_config": {
|
|
305
|
-
* "unit_amount": "2.00"
|
|
306
|
-
* },
|
|
307
|
-
* "fixed_price_quantity": 3.0
|
|
308
|
-
* ...
|
|
309
|
-
* }
|
|
310
|
-
* ```
|
|
88
|
+
* For more on the types of prices, see
|
|
89
|
+
* [the core concepts documentation](/core-concepts#plan-and-price)
|
|
311
90
|
*/
|
|
312
91
|
export type Price = Price.UnitPrice | Price.PackagePrice | Price.MatrixPrice | Price.TieredPrice | Price.TieredBpsPrice | Price.BpsPrice | Price.BulkBpsPrice | Price.BulkPrice | Price.ThresholdTotalAmountPrice | Price.TieredPackagePrice | Price.GroupedTieredPrice | Price.TieredWithMinimumPrice | Price.TieredPackageWithMinimumPrice | Price.PackageWithAllocationPrice | Price.UnitWithPercentPrice | Price.MatrixWithAllocationPrice | Price.TieredWithProrationPrice | Price.UnitWithProrationPrice | Price.GroupedAllocationPrice | Price.GroupedWithProratedMinimumPrice | Price.GroupedWithMeteredMinimumPrice | Price.MatrixWithDisplayNamePrice | Price.BulkWithProrationPrice | Price.GroupedTieredPackagePrice | Price.MaxGroupTieredPrice;
|
|
313
92
|
export declare namespace Price {
|
|
@@ -4876,14 +4655,14 @@ export interface PriceEvaluateParams {
|
|
|
4876
4655
|
external_customer_id?: string | null;
|
|
4877
4656
|
/**
|
|
4878
4657
|
* A boolean
|
|
4879
|
-
* [computed property](
|
|
4880
|
-
*
|
|
4658
|
+
* [computed property](/extensibility/advanced-metrics#computed-properties) used to
|
|
4659
|
+
* filter the underlying billable metric
|
|
4881
4660
|
*/
|
|
4882
4661
|
filter?: string | null;
|
|
4883
4662
|
/**
|
|
4884
4663
|
* Properties (or
|
|
4885
|
-
* [computed properties](
|
|
4886
|
-
*
|
|
4664
|
+
* [computed properties](/extensibility/advanced-metrics#computed-properties)) used
|
|
4665
|
+
* to group the underlying billable metric
|
|
4887
4666
|
*/
|
|
4888
4667
|
grouping_keys?: Array<string>;
|
|
4889
4668
|
}
|