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.
Files changed (98) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/package.json +1 -1
  3. package/resources/alerts.d.ts +5 -8
  4. package/resources/alerts.d.ts.map +1 -1
  5. package/resources/alerts.js +2 -4
  6. package/resources/alerts.js.map +1 -1
  7. package/resources/alerts.mjs +2 -4
  8. package/resources/alerts.mjs.map +1 -1
  9. package/resources/coupons/coupons.d.ts +0 -34
  10. package/resources/coupons/coupons.d.ts.map +1 -1
  11. package/resources/coupons/coupons.js.map +1 -1
  12. package/resources/coupons/coupons.mjs.map +1 -1
  13. package/resources/coupons/subscriptions.d.ts +3 -3
  14. package/resources/credit-notes.d.ts +5 -5
  15. package/resources/credit-notes.js +3 -3
  16. package/resources/credit-notes.mjs +3 -3
  17. package/resources/customers/costs.d.ts +12 -454
  18. package/resources/customers/costs.d.ts.map +1 -1
  19. package/resources/customers/credits/ledger.d.ts +14 -14
  20. package/resources/customers/customers.d.ts +19 -19
  21. package/resources/customers/customers.d.ts.map +1 -1
  22. package/resources/customers/customers.js +14 -12
  23. package/resources/customers/customers.js.map +1 -1
  24. package/resources/customers/customers.mjs +14 -12
  25. package/resources/customers/customers.mjs.map +1 -1
  26. package/resources/events/backfills.d.ts +18 -18
  27. package/resources/events/backfills.js +3 -3
  28. package/resources/events/backfills.mjs +3 -3
  29. package/resources/events/events.d.ts +6 -7
  30. package/resources/events/events.d.ts.map +1 -1
  31. package/resources/events/events.js +3 -3
  32. package/resources/events/events.js.map +1 -1
  33. package/resources/events/events.mjs +3 -3
  34. package/resources/events/events.mjs.map +1 -1
  35. package/resources/events/volume.d.ts +5 -5
  36. package/resources/events/volume.js +5 -5
  37. package/resources/events/volume.mjs +5 -5
  38. package/resources/invoice-line-items.d.ts +2 -223
  39. package/resources/invoice-line-items.d.ts.map +1 -1
  40. package/resources/invoices.d.ts +14 -456
  41. package/resources/invoices.d.ts.map +1 -1
  42. package/resources/invoices.js +3 -3
  43. package/resources/invoices.js.map +1 -1
  44. package/resources/invoices.mjs +3 -3
  45. package/resources/invoices.mjs.map +1 -1
  46. package/resources/items.d.ts +1 -1
  47. package/resources/items.js +1 -1
  48. package/resources/items.mjs +1 -1
  49. package/resources/metrics.d.ts +6 -7
  50. package/resources/metrics.d.ts.map +1 -1
  51. package/resources/metrics.js +3 -4
  52. package/resources/metrics.js.map +1 -1
  53. package/resources/metrics.mjs +3 -4
  54. package/resources/metrics.mjs.map +1 -1
  55. package/resources/plans/external-plan-id.d.ts +6 -6
  56. package/resources/plans/external-plan-id.js +6 -6
  57. package/resources/plans/external-plan-id.mjs +6 -6
  58. package/resources/plans/plans.d.ts +15 -15
  59. package/resources/plans/plans.js +6 -6
  60. package/resources/plans/plans.mjs +6 -6
  61. package/resources/prices/external-price-id.d.ts +2 -2
  62. package/resources/prices/external-price-id.js +2 -2
  63. package/resources/prices/external-price-id.mjs +2 -2
  64. package/resources/prices/prices.d.ts +14 -235
  65. package/resources/prices/prices.d.ts.map +1 -1
  66. package/resources/prices/prices.js +7 -7
  67. package/resources/prices/prices.js.map +1 -1
  68. package/resources/prices/prices.mjs +7 -7
  69. package/resources/prices/prices.mjs.map +1 -1
  70. package/resources/subscriptions.d.ts +172 -2831
  71. package/resources/subscriptions.d.ts.map +1 -1
  72. package/resources/subscriptions.js +53 -49
  73. package/resources/subscriptions.js.map +1 -1
  74. package/resources/subscriptions.mjs +53 -49
  75. package/resources/subscriptions.mjs.map +1 -1
  76. package/src/resources/alerts.ts +5 -8
  77. package/src/resources/coupons/coupons.ts +0 -34
  78. package/src/resources/coupons/subscriptions.ts +3 -3
  79. package/src/resources/credit-notes.ts +5 -5
  80. package/src/resources/customers/costs.ts +12 -454
  81. package/src/resources/customers/credits/ledger.ts +14 -14
  82. package/src/resources/customers/customers.ts +19 -19
  83. package/src/resources/events/backfills.ts +18 -18
  84. package/src/resources/events/events.ts +6 -7
  85. package/src/resources/events/volume.ts +5 -5
  86. package/src/resources/invoice-line-items.ts +2 -223
  87. package/src/resources/invoices.ts +14 -456
  88. package/src/resources/items.ts +1 -1
  89. package/src/resources/metrics.ts +6 -7
  90. package/src/resources/plans/external-plan-id.ts +6 -6
  91. package/src/resources/plans/plans.ts +15 -15
  92. package/src/resources/prices/external-price-id.ts +2 -2
  93. package/src/resources/prices/prices.ts +14 -235
  94. package/src/resources/subscriptions.ts +172 -2831
  95. package/src/version.ts +1 -1
  96. package/version.d.ts +1 -1
  97. package/version.js +1 -1
  98. package/version.mjs +1 -1
@@ -12,16 +12,16 @@ export class Prices extends APIResource {
12
12
  externalPriceId: ExternalPriceIDAPI.ExternalPriceID = new ExternalPriceIDAPI.ExternalPriceID(this._client);
13
13
 
14
14
  /**
15
- * This endpoint is used to create a [price](../reference/price). A price created
16
- * using this endpoint is always an add-on, meaning that it’s not associated with a
17
- * specific plan and can instead be individually added to subscriptions, including
18
- * subscriptions on different plans.
15
+ * This endpoint is used to create a [price](/product-catalog/price-configuration).
16
+ * A price created using this endpoint is always an add-on, meaning that it’s not
17
+ * associated with a specific plan and can instead be individually added to
18
+ * subscriptions, including subscriptions on different plans.
19
19
  *
20
20
  * An `external_price_id` can be optionally specified as an alias to allow
21
21
  * ergonomic interaction with prices in the Orb API.
22
22
  *
23
- * See the [Price resource](../reference/price) for the specification of different
24
- * price model configurations possible in this endpoint.
23
+ * See the [Price resource](/product-catalog/price-configuration) for the
24
+ * specification of different price model configurations possible in this endpoint.
25
25
  */
26
26
  create(body: PriceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Price> {
27
27
  return this._client.post('/prices', { body, ...options });
@@ -38,7 +38,7 @@ export class Prices extends APIResource {
38
38
 
39
39
  /**
40
40
  * This endpoint is used to list all add-on prices created using the
41
- * [price creation endpoint](../reference/create-price).
41
+ * [price creation endpoint](/api-reference/price/create-price).
42
42
  */
43
43
  list(query?: PriceListParams, options?: Core.RequestOptions): Core.PagePromise<PricesPage, Price>;
44
44
  list(options?: Core.RequestOptions): Core.PagePromise<PricesPage, Price>;
@@ -55,7 +55,7 @@ export class Prices extends APIResource {
55
55
  /**
56
56
  * This endpoint is used to evaluate the output of a price for a given customer and
57
57
  * time range. It enables filtering and grouping the output using
58
- * [computed properties](../guides/extensibility/advanced-metrics#computed-properties),
58
+ * [computed properties](/extensibility/advanced-metrics#computed-properties),
59
59
  * supporting the following workflows:
60
60
  *
61
61
  * 1. Showing detailed usage and costs to the end customer.
@@ -119,229 +119,8 @@ export interface EvaluatePriceGroup {
119
119
  * is serialized differently in a given Price object. The model_type field
120
120
  * determines the key for the configuration object that is present.
121
121
  *
122
- * ## Unit pricing
123
- *
124
- * With unit pricing, each unit costs a fixed amount.
125
- *
126
- * ```json
127
- * {
128
- * ...
129
- * "model_type": "unit",
130
- * "unit_config": {
131
- * "unit_amount": "0.50"
132
- * }
133
- * ...
134
- * }
135
- * ```
136
- *
137
- * ## Tiered pricing
138
- *
139
- * In tiered pricing, the cost of a given unit depends on the tier range that it
140
- * falls into, where each tier range is defined by an upper and lower bound. For
141
- * example, the first ten units may cost $0.50 each and all units thereafter may
142
- * cost $0.10 each.
143
- *
144
- * ```json
145
- * {
146
- * ...
147
- * "model_type": "tiered",
148
- * "tiered_config": {
149
- * "tiers": [
150
- * {
151
- * "first_unit": 1,
152
- * "last_unit": 10,
153
- * "unit_amount": "0.50"
154
- * },
155
- * {
156
- * "first_unit": 11,
157
- * "last_unit": null,
158
- * "unit_amount": "0.10"
159
- * }
160
- * ]
161
- * }
162
- * ...
163
- * ```
164
- *
165
- * ## Bulk pricing
166
- *
167
- * Bulk pricing applies when the number of units determine the cost of all units.
168
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
169
- * total of $5.00. Once you've bought more than 10 units, all units may now be
170
- * priced at $0.40 (i.e. 101 units total would be $40.40).
171
- *
172
- * ```json
173
- * {
174
- * ...
175
- * "model_type": "bulk",
176
- * "bulk_config": {
177
- * "tiers": [
178
- * {
179
- * "maximum_units": 10,
180
- * "unit_amount": "0.50"
181
- * },
182
- * {
183
- * "maximum_units": 1000,
184
- * "unit_amount": "0.40"
185
- * }
186
- * ]
187
- * }
188
- * ...
189
- * }
190
- * ```
191
- *
192
- * ## Package pricing
193
- *
194
- * Package pricing defines the size or granularity of a unit for billing purposes.
195
- * For example, if the package size is set to 5, then 4 units will be billed as 5
196
- * and 6 units will be billed at 10.
197
- *
198
- * ```json
199
- * {
200
- * ...
201
- * "model_type": "package",
202
- * "package_config": {
203
- * "package_amount": "0.80",
204
- * "package_size": 10
205
- * }
206
- * ...
207
- * }
208
- * ```
209
- *
210
- * ## BPS pricing
211
- *
212
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
213
- * percent (the number of basis points to charge), as well as a cap per event to
214
- * assess. For example, this would allow you to assess a fee of 0.25% on every
215
- * payment you process, with a maximum charge of $25 per payment.
216
- *
217
- * ```json
218
- * {
219
- * ...
220
- * "model_type": "bps",
221
- * "bps_config": {
222
- * "bps": 125,
223
- * "per_unit_maximum": "11.00"
224
- * }
225
- * ...
226
- * }
227
- * ```
228
- *
229
- * ## Bulk BPS pricing
230
- *
231
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
232
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
233
- * a given event depends on the tier range that the billing period falls into. Each
234
- * tier range is defined by an upper bound. For example, after $1.5M of payment
235
- * volume is reached, each individual payment may have a lower cap or a smaller
236
- * take-rate.
237
- *
238
- * ```json
239
- * ...
240
- * "model_type": "bulk_bps",
241
- * "bulk_bps_config": {
242
- * "tiers": [
243
- * {
244
- * "maximum_amount": "1000000.00",
245
- * "bps": 125,
246
- * "per_unit_maximum": "19.00"
247
- * },
248
- * {
249
- * "maximum_amount": null,
250
- * "bps": 115,
251
- * "per_unit_maximum": "4.00"
252
- * }
253
- * ]
254
- * }
255
- * ...
256
- * }
257
- * ```
258
- *
259
- * ## Tiered BPS pricing
260
- *
261
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
262
- * event's applicable parameter is a function of its marginal addition to the
263
- * period total. Similar to tiered pricing, the BPS parameters of a given event
264
- * depends on the tier range that it falls into, where each tier range is defined
265
- * by an upper and lower bound. For example, the first few payments may have a 0.8
266
- * BPS take-rate and all payments after a specific volume may incur a take-rate of
267
- * 0.5 BPS each.
268
- *
269
- * ```json
270
- * ...
271
- * "model_type": "tiered_bps",
272
- * "tiered_bps_config": {
273
- * "tiers": [
274
- * {
275
- * "minimum_amount": "0",
276
- * "maximum_amount": "1000000.00",
277
- * "bps": 125,
278
- * "per_unit_maximum": "19.00"
279
- * },
280
- * {
281
- * "minimum_amount": "1000000.00",
282
- * "maximum_amount": null,
283
- * "bps": 115,
284
- * "per_unit_maximum": "4.00"
285
- * }
286
- * ]
287
- * }
288
- * ...
289
- * }
290
- * ```
291
- *
292
- * ## Matrix pricing
293
- *
294
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
295
- * `dimensions` defines the two event property values evaluated in this pricing
296
- * model. In a one-dimensional matrix, the second value is `null`. Every
297
- * configuration has a list of `matrix_values` which give the unit prices for
298
- * specified property values. In a one-dimensional matrix, the matrix values will
299
- * have `dimension_values` where the second value of the pair is null. If an event
300
- * does not match any of the dimension values in the matrix, it will resort to the
301
- * `default_unit_amount`.
302
- *
303
- * ```json
304
- * {
305
- * "model_type": "matrix"
306
- * "matrix_config": {
307
- * "default_unit_amount": "3.00",
308
- * "dimensions": [
309
- * "cluster_name",
310
- * "region"
311
- * ],
312
- * "matrix_values": [
313
- * {
314
- * "dimension_values": [
315
- * "alpha",
316
- * "west"
317
- * ],
318
- * "unit_amount": "2.00"
319
- * },
320
- * ...
321
- * ]
322
- * }
323
- * }
324
- * ```
325
- *
326
- * ## Fixed fees
327
- *
328
- * Fixed fees are prices that are applied independent of usage quantities, and
329
- * follow unit pricing. They also have an additional parameter
330
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents
331
- * the quantity of units applied.
332
- *
333
- * ```json
334
- * {
335
- * ...
336
- * "id": "price_id",
337
- * "model_type": "unit",
338
- * "unit_config": {
339
- * "unit_amount": "2.00"
340
- * },
341
- * "fixed_price_quantity": 3.0
342
- * ...
343
- * }
344
- * ```
122
+ * For more on the types of prices, see
123
+ * [the core concepts documentation](/core-concepts#plan-and-price)
345
124
  */
346
125
  export type Price =
347
126
  | Price.UnitPrice
@@ -6407,15 +6186,15 @@ export interface PriceEvaluateParams {
6407
6186
 
6408
6187
  /**
6409
6188
  * A boolean
6410
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties)
6411
- * used to filter the underlying billable metric
6189
+ * [computed property](/extensibility/advanced-metrics#computed-properties) used to
6190
+ * filter the underlying billable metric
6412
6191
  */
6413
6192
  filter?: string | null;
6414
6193
 
6415
6194
  /**
6416
6195
  * Properties (or
6417
- * [computed properties](../guides/extensibility/advanced-metrics#computed-properties))
6418
- * used to group the underlying billable metric
6196
+ * [computed properties](/extensibility/advanced-metrics#computed-properties)) used
6197
+ * to group the underlying billable metric
6419
6198
  */
6420
6199
  grouping_keys?: Array<string>;
6421
6200
  }