orb-billing 4.32.0 → 4.33.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 (77) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +2 -2
  3. package/package.json +2 -2
  4. package/resources/customers/customers.d.ts +2 -4
  5. package/resources/customers/customers.d.ts.map +1 -1
  6. package/resources/customers/customers.js +15 -8
  7. package/resources/customers/customers.js.map +1 -1
  8. package/resources/customers/customers.mjs +15 -8
  9. package/resources/customers/customers.mjs.map +1 -1
  10. package/resources/events/volume.d.ts +8 -9
  11. package/resources/events/volume.d.ts.map +1 -1
  12. package/resources/events/volume.js +16 -5
  13. package/resources/events/volume.js.map +1 -1
  14. package/resources/events/volume.mjs +16 -5
  15. package/resources/events/volume.mjs.map +1 -1
  16. package/resources/invoices.d.ts +3 -5
  17. package/resources/invoices.d.ts.map +1 -1
  18. package/resources/invoices.js +14 -8
  19. package/resources/invoices.js.map +1 -1
  20. package/resources/invoices.mjs +14 -8
  21. package/resources/invoices.mjs.map +1 -1
  22. package/resources/items.d.ts +1 -2
  23. package/resources/items.d.ts.map +1 -1
  24. package/resources/items.js +4 -4
  25. package/resources/items.js.map +1 -1
  26. package/resources/items.mjs +4 -4
  27. package/resources/items.mjs.map +1 -1
  28. package/resources/metrics.d.ts +1 -2
  29. package/resources/metrics.d.ts.map +1 -1
  30. package/resources/metrics.js +6 -4
  31. package/resources/metrics.js.map +1 -1
  32. package/resources/metrics.mjs +6 -4
  33. package/resources/metrics.mjs.map +1 -1
  34. package/resources/plans/external-plan-id.d.ts +1 -2
  35. package/resources/plans/external-plan-id.d.ts.map +1 -1
  36. package/resources/plans/external-plan-id.js +7 -5
  37. package/resources/plans/external-plan-id.js.map +1 -1
  38. package/resources/plans/external-plan-id.mjs +7 -5
  39. package/resources/plans/external-plan-id.mjs.map +1 -1
  40. package/resources/plans/plans.d.ts +1 -2
  41. package/resources/plans/plans.d.ts.map +1 -1
  42. package/resources/plans/plans.js +7 -4
  43. package/resources/plans/plans.js.map +1 -1
  44. package/resources/plans/plans.mjs +7 -4
  45. package/resources/plans/plans.mjs.map +1 -1
  46. package/resources/prices/external-price-id.d.ts +1 -2
  47. package/resources/prices/external-price-id.d.ts.map +1 -1
  48. package/resources/prices/external-price-id.js +6 -5
  49. package/resources/prices/external-price-id.js.map +1 -1
  50. package/resources/prices/external-price-id.mjs +6 -5
  51. package/resources/prices/external-price-id.mjs.map +1 -1
  52. package/resources/prices/prices.d.ts +1 -2
  53. package/resources/prices/prices.d.ts.map +1 -1
  54. package/resources/prices/prices.js +6 -4
  55. package/resources/prices/prices.js.map +1 -1
  56. package/resources/prices/prices.mjs +6 -4
  57. package/resources/prices/prices.mjs.map +1 -1
  58. package/resources/subscriptions.d.ts +10 -12
  59. package/resources/subscriptions.d.ts.map +1 -1
  60. package/resources/subscriptions.js +346 -18
  61. package/resources/subscriptions.js.map +1 -1
  62. package/resources/subscriptions.mjs +346 -18
  63. package/resources/subscriptions.mjs.map +1 -1
  64. package/src/resources/customers/customers.ts +2 -20
  65. package/src/resources/events/volume.ts +9 -18
  66. package/src/resources/invoices.ts +3 -20
  67. package/src/resources/items.ts +1 -10
  68. package/src/resources/metrics.ts +1 -10
  69. package/src/resources/plans/external-plan-id.ts +1 -11
  70. package/src/resources/plans/plans.ts +1 -10
  71. package/src/resources/prices/external-price-id.ts +1 -11
  72. package/src/resources/prices/prices.ts +1 -10
  73. package/src/resources/subscriptions.ts +10 -43
  74. package/src/version.ts +1 -1
  75. package/version.d.ts +1 -1
  76. package/version.js +1 -1
  77. package/version.mjs +1 -1
@@ -4,16 +4,271 @@ import { isRequestOptions } from "../core.mjs";
4
4
  import * as SubscriptionsAPI from "./subscriptions.mjs";
5
5
  import { Page } from "../pagination.mjs";
6
6
  export class Subscriptions extends APIResource {
7
- create(body = {}, options) {
8
- if (isRequestOptions(body)) {
9
- return this.create({}, body);
10
- }
7
+ /**
8
+ * A subscription represents the purchase of a plan by a customer. The customer is
9
+ * identified by either the `customer_id` or the `external_customer_id`, and
10
+ * exactly one of these fields must be provided.
11
+ *
12
+ * By default, subscriptions begin on the day that they're created and renew
13
+ * automatically for each billing cycle at the cadence that's configured in the
14
+ * plan definition.
15
+ *
16
+ * The default configuration for subscriptions in Orb is **In-advance billing** and
17
+ * **Beginning of month alignment** (see
18
+ * [Subscription](../guides/concepts#subscription) for more details).
19
+ *
20
+ * In order to change the alignment behavior, Orb also supports billing
21
+ * subscriptions on the day of the month they are created. If
22
+ * `align_billing_with_subscription_start_date = true` is specified, subscriptions
23
+ * have billing cycles that are aligned with their `start_date`. For example, a
24
+ * subscription that begins on January 15th will have a billing cycle from January
25
+ * 15th to February 15th. Every subsequent billing cycle will continue to start and
26
+ * invoice on the 15th.
27
+ *
28
+ * If the "day" value is greater than the number of days in the month, the next
29
+ * billing cycle will start at the end of the month. For example, if the start_date
30
+ * is January 31st, the next billing cycle will start on February 28th.
31
+ *
32
+ * If a customer was created with a currency, Orb only allows subscribing the
33
+ * customer to a plan with a matching `invoicing_currency`. If the customer does
34
+ * not have a currency set, on subscription creation, we set the customer's
35
+ * currency to be the `invoicing_currency` of the plan.
36
+ *
37
+ * ## Customize your customer's subscriptions
38
+ *
39
+ * Prices and adjustments in a plan can be added, removed, or replaced for the
40
+ * subscription being created. This is useful when a customer has prices that
41
+ * differ from the default prices for a specific plan.
42
+ *
43
+ * :::info This feature is only available for accounts that have migrated to
44
+ * Subscription Overrides Version 2. You can find your Subscription Overrides
45
+ * Version at the bottom of your [Plans page](https://app.withorb.com/plans) :::
46
+ *
47
+ * ### Adding Prices
48
+ *
49
+ * To add prices, provide a list of objects with the key `add_prices`. An object in
50
+ * the list must specify an existing add-on price with a `price_id` or
51
+ * `external_price_id` field, or create a new add-on price by including an object
52
+ * with the key `price`, identical to what would be used in the request body for
53
+ * the [create price endpoint](../reference/create-price). See the
54
+ * [Price resource](../reference/price) for the specification of different price
55
+ * model configurations possible in this object.
56
+ *
57
+ * If the plan has phases, each object in the list must include a number with
58
+ * `plan_phase_order` key to indicate which phase the price should be added to.
59
+ *
60
+ * An object in the list can specify an optional `start_date` and optional
61
+ * `end_date`. This is equivalent to creating a price interval with the
62
+ * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If
63
+ * unspecified, the start or end date of the phase or subscription will be used.
64
+ *
65
+ * An object in the list can specify an optional `minimum_amount`,
66
+ * `maximum_amount`, or `discounts`. This will create adjustments which apply only
67
+ * to this price.
68
+ *
69
+ * Additionally, an object in the list can specify an optional `reference_id`. This
70
+ * ID can be used to reference this price when
71
+ * [adding an adjustment](#adding-adjustments) in the same API call. However the ID
72
+ * is _transient_ and cannot be used to refer to the price in future API calls.
73
+ *
74
+ * ### Removing Prices
75
+ *
76
+ * To remove prices, provide a list of objects with the key `remove_prices`. An
77
+ * object in the list must specify a plan price with either a `price_id` or
78
+ * `external_price_id` field.
79
+ *
80
+ * ### Replacing Prices
81
+ *
82
+ * To replace prices, provide a list of objects with the key `replace_prices`. An
83
+ * object in the list must specify a plan price to replace with the
84
+ * `replaces_price_id` key, and it must specify a price to replace it with by
85
+ * either referencing an existing add-on price with a `price_id` or
86
+ * `external_price_id` field, or by creating a new add-on price by including an
87
+ * object with the key `price`, identical to what would be used in the request body
88
+ * for the [create price endpoint](../reference/create-price). See the
89
+ * [Price resource](../reference/price) for the specification of different price
90
+ * model configurations possible in this object.
91
+ *
92
+ * For fixed fees, an object in the list can supply a `fixed_price_quantity`
93
+ * instead of a `price`, `price_id`, or `external_price_id` field. This will update
94
+ * only the quantity for the price, similar to the
95
+ * [Update price quantity](../reference/update-fixed-fee-quantity) endpoint.
96
+ *
97
+ * The replacement price will have the same phase, if applicable, and the same
98
+ * start and end dates as the price it replaces.
99
+ *
100
+ * An object in the list can specify an optional `minimum_amount`,
101
+ * `maximum_amount`, or `discounts`. This will create adjustments which apply only
102
+ * to this price.
103
+ *
104
+ * Additionally, an object in the list can specify an optional `reference_id`. This
105
+ * ID can be used to reference the replacement price when
106
+ * [adding an adjustment](#adding-adjustments) in the same API call. However the ID
107
+ * is _transient_ and cannot be used to refer to the price in future API calls.
108
+ *
109
+ * ### Adding adjustments
110
+ *
111
+ * To add adjustments, provide a list of objects with the key `add_adjustments`. An
112
+ * object in the list must include an object with the key `adjustment`, identical
113
+ * to the adjustment object in the
114
+ * [add/edit price intervals endpoint](../reference/add-edit-price-intervals).
115
+ *
116
+ * If the plan has phases, each object in the list must include a number with
117
+ * `plan_phase_order` key to indicate which phase the adjustment should be added
118
+ * to.
119
+ *
120
+ * An object in the list can specify an optional `start_date` and optional
121
+ * `end_date`. If unspecified, the start or end date of the phase or subscription
122
+ * will be used.
123
+ *
124
+ * ### Removing adjustments
125
+ *
126
+ * To remove adjustments, provide a list of objects with the key
127
+ * `remove_adjustments`. An object in the list must include a key, `adjustment_id`,
128
+ * with the ID of the adjustment to be removed.
129
+ *
130
+ * ### Replacing adjustments
131
+ *
132
+ * To replace adjustments, provide a list of objects with the key
133
+ * `replace_adjustments`. An object in the list must specify a plan adjustment to
134
+ * replace with the `replaces_adjustment_id` key, and it must specify an adjustment
135
+ * to replace it with by including an object with the key `adjustment`, identical
136
+ * to the adjustment object in the
137
+ * [add/edit price intervals endpoint](../reference/add-edit-price-intervals).
138
+ *
139
+ * The replacement adjustment will have the same phase, if applicable, and the same
140
+ * start and end dates as the adjustment it replaces.
141
+ *
142
+ * ## Price overrides (DEPRECATED)
143
+ *
144
+ * :::info Price overrides are being phased out in favor adding/removing/replacing
145
+ * prices. (See
146
+ * [Customize your customer's subscriptions](../reference/create-subscription#customize-your-customers-subscriptions))
147
+ * :::
148
+ *
149
+ * Price overrides are used to update some or all prices in a plan for the specific
150
+ * subscription being created. This is useful when a new customer has negotiated a
151
+ * rate that is unique to the customer.
152
+ *
153
+ * To override prices, provide a list of objects with the key `price_overrides`.
154
+ * The price object in the list of overrides is expected to contain the existing
155
+ * price id, the `model_type` and configuration. (See the
156
+ * [Price resource](../reference/price) for the specification of different price
157
+ * model configurations.) The numerical values can be updated, but the billable
158
+ * metric, cadence, type, and name of a price can not be overridden.
159
+ *
160
+ * ### Maximums and Minimums
161
+ *
162
+ * Minimums and maximums, much like price overrides, can be useful when a new
163
+ * customer has negotiated a new or different minimum or maximum spend cap than the
164
+ * default for a given price. If one exists for a price and null is provided for
165
+ * the minimum/maximum override on creation, then there will be no minimum/maximum
166
+ * on the new subscription. If no value is provided, then the default price maximum
167
+ * or minimum is used.
168
+ *
169
+ * To add a minimum for a specific price, add `minimum_amount` to the specific
170
+ * price in the `price_overrides` object.
171
+ *
172
+ * To add a maximum for a specific price, add `maximum_amount` to the specific
173
+ * price in the `price_overrides` object.
174
+ *
175
+ * ### Minimum override example
176
+ *
177
+ * Price minimum override example:
178
+ *
179
+ * ```json
180
+ * {
181
+ * ...
182
+ * "id": "price_id",
183
+ * "model_type": "unit",
184
+ * "unit_config": {
185
+ * "unit_amount": "0.50"
186
+ * },
187
+ * "minimum_amount": "100.00"
188
+ * ...
189
+ * }
190
+ * ```
191
+ *
192
+ * Removing an existing minimum example
193
+ *
194
+ * ```json
195
+ * {
196
+ * ...
197
+ * "id": "price_id",
198
+ * "model_type": "unit",
199
+ * "unit_config": {
200
+ * "unit_amount": "0.50"
201
+ * },
202
+ * "minimum_amount": null
203
+ * ...
204
+ * }
205
+ * ```
206
+ *
207
+ * ### Discounts
208
+ *
209
+ * Discounts, like price overrides, can be useful when a new customer has
210
+ * negotiated a new or different discount than the default for a price. If a
211
+ * discount exists for a price and a null discount is provided on creation, then
212
+ * there will be no discount on the new subscription.
213
+ *
214
+ * To add a discount for a specific price, add `discount` to the price in the
215
+ * `price_overrides` object. Discount should be a dictionary of the format:
216
+ *
217
+ * ```ts
218
+ * {
219
+ * "discount_type": "amount" | "percentage" | "usage",
220
+ * "amount_discount": string,
221
+ * "percentage_discount": string,
222
+ * "usage_discount": string
223
+ * }
224
+ * ```
225
+ *
226
+ * where either `amount_discount`, `percentage_discount`, or `usage_discount` is
227
+ * provided.
228
+ *
229
+ * Price discount example
230
+ *
231
+ * ```json
232
+ * {
233
+ * ...
234
+ * "id": "price_id",
235
+ * "model_type": "unit",
236
+ * "unit_config": {
237
+ * "unit_amount": "0.50"
238
+ * },
239
+ * "discount": {"discount_type": "amount", "amount_discount": "175"},
240
+ * }
241
+ * ```
242
+ *
243
+ * Removing an existing discount example
244
+ *
245
+ * ```json
246
+ * {
247
+ * "customer_id": "customer_id",
248
+ * "plan_id": "plan_id",
249
+ * "discount": null,
250
+ * "price_overrides": [ ... ]
251
+ * ...
252
+ * }
253
+ * ```
254
+ *
255
+ * ## Threshold Billing
256
+ *
257
+ * Orb supports invoicing for a subscription when a preconfigured usage threshold
258
+ * is hit. To enable threshold billing, pass in an `invoicing_threshold`, which is
259
+ * specified in the subscription's invoicing currency, when creating a
260
+ * subscription. E.g. pass in `10.00` to issue an invoice when usage amounts hit
261
+ * $10.00 for a subscription that invoices in USD.
262
+ */
263
+ create(body, options) {
11
264
  return this._client.post('/subscriptions', { body, ...options });
12
265
  }
13
- update(subscriptionId, body = {}, options) {
14
- if (isRequestOptions(body)) {
15
- return this.update(subscriptionId, {}, body);
16
- }
266
+ /**
267
+ * This endpoint can be used to update the `metadata`, `net terms`,
268
+ * `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties
269
+ * on a subscription.
270
+ */
271
+ update(subscriptionId, body, options) {
17
272
  return this._client.put(`/subscriptions/${subscriptionId}`, { body, ...options });
18
273
  }
19
274
  list(query = {}, options) {
@@ -113,10 +368,81 @@ export class Subscriptions extends APIResource {
113
368
  }
114
369
  return this._client.get(`/subscriptions/${subscriptionId}/usage`, { query, ...options });
115
370
  }
116
- priceIntervals(subscriptionId, body = {}, options) {
117
- if (isRequestOptions(body)) {
118
- return this.priceIntervals(subscriptionId, {}, body);
119
- }
371
+ /**
372
+ * This endpoint is used to add and edit subscription
373
+ * [price intervals](../reference/price-interval). By making modifications to a
374
+ * subscription’s price intervals, you can
375
+ * [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions).
376
+ *
377
+ * ## Adding price intervals
378
+ *
379
+ * Prices can be added as price intervals to a subscription by specifying them in
380
+ * the `add` array. A `price_id` or `external_price_id` from an add-on price or
381
+ * previously removed plan price can be specified to reuse an existing price
382
+ * definition (however, please note that prices from other plans cannot be added to
383
+ * the subscription). Additionally, a new price can be specified using the `price`
384
+ * field — this price will be created automatically.
385
+ *
386
+ * A `start_date` must be specified for the price interval. This is the date when
387
+ * the price will start billing on the subscription, so this will notably result in
388
+ * an immediate charge at this time for any billed in advance fixed fees. The
389
+ * `end_date` will default to null, resulting in a price interval that will bill on
390
+ * a continually recurring basis. Both of these dates can be set in the past or the
391
+ * future and Orb will generate or modify invoices to ensure the subscription’s
392
+ * invoicing behavior is correct.
393
+ *
394
+ * Additionally, a discount, minimum, or maximum can be specified on the price
395
+ * interval. This will only apply to this price interval, not any other price
396
+ * intervals on the subscription.
397
+ *
398
+ * ## Adjustment intervals
399
+ *
400
+ * An adjustment interval represents the time period that a particular adjustment
401
+ * (a discount, minimum, or maximum) applies to the prices on a subscription.
402
+ * Adjustment intervals can be added to a subscription by specifying them in the
403
+ * `add_adjustments` array, or modified via the `edit_adjustments` array. When
404
+ * creating an adjustment interval, you'll need to provide the definition of the
405
+ * new adjustment (the type of adjustment, and which prices it applies to), as well
406
+ * as the start and end dates for the adjustment interval. The start and end dates
407
+ * of an existing adjustment interval can be edited via the `edit_adjustments`
408
+ * field (just like price intervals). (To "change" the amount of a discount,
409
+ * minimum, or maximum, then, you'll need to end the existing interval, and create
410
+ * a new adjustment interval with the new amount and a start date that matches the
411
+ * end date of the previous interval.)
412
+ *
413
+ * ## Editing price intervals
414
+ *
415
+ * Price intervals can be adjusted by specifying edits to make in the `edit` array.
416
+ * A `price_interval_id` to edit must be specified — this can be retrieved from the
417
+ * `price_intervals` field on the subscription.
418
+ *
419
+ * A new `start_date` or `end_date` can be specified to change the range of the
420
+ * price interval, which will modify past or future invoices to ensure correctness.
421
+ * If either of these dates are unspecified, they will default to the existing date
422
+ * on the price interval. To remove a price interval entirely from a subscription,
423
+ * set the `end_date` to be equivalent to the `start_date`.
424
+ *
425
+ * ## Fixed fee quantity transitions
426
+ *
427
+ * The fixed fee quantity transitions for a fixed fee price interval can also be
428
+ * specified when adding or editing by passing an array for
429
+ * `fixed_fee_quantity_transitions`. A fixed fee quantity transition must have a
430
+ * `quantity` and an `effective_date`, which is the date after which the new
431
+ * quantity will be used for billing. If a fixed fee quantity transition is
432
+ * scheduled at a billing period boundary, the full quantity will be billed on an
433
+ * invoice with the other prices on the subscription. If the fixed fee quantity
434
+ * transition is scheduled mid-billing period, the difference between the existing
435
+ * quantity and quantity specified in the transition will be prorated for the rest
436
+ * of the billing period and billed immediately, which will generate a new invoice.
437
+ *
438
+ * Notably, the list of fixed fee quantity transitions passed will overwrite the
439
+ * existing fixed fee quantity transitions on the price interval, so the entire
440
+ * list of transitions must be specified to add additional transitions. The
441
+ * existing list of transitions can be retrieved using the
442
+ * `fixed_fee_quantity_transitions` property on a subscription’s serialized price
443
+ * intervals.
444
+ */
445
+ priceIntervals(subscriptionId, body, options) {
120
446
  return this._client.post(`/subscriptions/${subscriptionId}/price_intervals`, { body, ...options });
121
447
  }
122
448
  /**
@@ -164,8 +490,9 @@ export class Subscriptions extends APIResource {
164
490
  * subscription when you schedule the plan change. This is useful when a customer
165
491
  * has prices that differ from the default prices for a specific plan.
166
492
  *
167
- * :::info This feature is only available for accounts that have migrated off of
168
- * legacy subscription overrides. :::
493
+ * :::info This feature is only available for accounts that have migrated to
494
+ * Subscription Overrides Version 2. You can find your Subscription Overrides
495
+ * Version at the bottom of your [Plans page](https://app.withorb.com/plans) :::
169
496
  *
170
497
  * ### Adding Prices
171
498
  *
@@ -303,10 +630,11 @@ export class Subscriptions extends APIResource {
303
630
  schedulePlanChange(subscriptionId, body, options) {
304
631
  return this._client.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
305
632
  }
306
- triggerPhase(subscriptionId, body = {}, options) {
307
- if (isRequestOptions(body)) {
308
- return this.triggerPhase(subscriptionId, {}, body);
309
- }
633
+ /**
634
+ * Manually trigger a phase, effective the given date (or the current time, if not
635
+ * specified).
636
+ */
637
+ triggerPhase(subscriptionId, body, options) {
310
638
  return this._client.post(`/subscriptions/${subscriptionId}/trigger_phase`, { body, ...options });
311
639
  }
312
640
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,gBAAgB;OAKrB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,aAAc,SAAQ,WAAW;IAkQ5C,MAAM,CACJ,OAAuD,EAAE,EACzD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAaD,MAAM,CACJ,cAAsB,EACtB,OAAuD,EAAE,EACzD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;SAC9C;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAkBD,IAAI,CACF,QAAsD,EAAE,EACxD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;S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AG,gBAAgB,CAAC,iBAAiB,CAAC;IACvD,oDAAsC,GAAG,gBAAgB,CAAC,sCAAsC,CAAC;AAcjH,CAAC,EArBgB,aAAa,KAAb,aAAa,QAqB7B"}
@@ -42,18 +42,9 @@ export class Customers extends APIResource {
42
42
  */
43
43
  update(
44
44
  customerId: string,
45
- body?: CustomerUpdateParams,
46
- options?: Core.RequestOptions,
47
- ): Core.APIPromise<Customer>;
48
- update(customerId: string, options?: Core.RequestOptions): Core.APIPromise<Customer>;
49
- update(
50
- customerId: string,
51
- body: CustomerUpdateParams | Core.RequestOptions = {},
45
+ body: CustomerUpdateParams,
52
46
  options?: Core.RequestOptions,
53
47
  ): Core.APIPromise<Customer> {
54
- if (isRequestOptions(body)) {
55
- return this.update(customerId, {}, body);
56
- }
57
48
  return this._client.put(`/customers/${customerId}`, { body, ...options });
58
49
  }
59
50
 
@@ -131,18 +122,9 @@ export class Customers extends APIResource {
131
122
  */
132
123
  updateByExternalId(
133
124
  id: string,
134
- body?: CustomerUpdateByExternalIDParams,
135
- options?: Core.RequestOptions,
136
- ): Core.APIPromise<Customer>;
137
- updateByExternalId(id: string, options?: Core.RequestOptions): Core.APIPromise<Customer>;
138
- updateByExternalId(
139
- id: string,
140
- body: CustomerUpdateByExternalIDParams | Core.RequestOptions = {},
125
+ body: CustomerUpdateByExternalIDParams,
141
126
  options?: Core.RequestOptions,
142
127
  ): Core.APIPromise<Customer> {
143
- if (isRequestOptions(body)) {
144
- return this.updateByExternalId(id, {}, body);
145
- }
146
128
  return this._client.put(`/customers/external_customer_id/${id}`, { body, ...options });
147
129
  }
148
130
  }
@@ -1,7 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../resource';
4
- import { isRequestOptions } from '../../core';
5
4
  import * as Core from '../../core';
6
5
  import * as VolumeAPI from './volume';
7
6
 
@@ -21,15 +20,7 @@ export class Volume extends APIResource {
21
20
  * timestamp is passed in for either start or end time, the response includes the
22
21
  * hours the timestamp falls in.
23
22
  */
24
- list(query?: VolumeListParams, options?: Core.RequestOptions): Core.APIPromise<EventVolumes>;
25
- list(options?: Core.RequestOptions): Core.APIPromise<EventVolumes>;
26
- list(
27
- query: VolumeListParams | Core.RequestOptions = {},
28
- options?: Core.RequestOptions,
29
- ): Core.APIPromise<EventVolumes> {
30
- if (isRequestOptions(query)) {
31
- return this.list({}, query);
32
- }
23
+ list(query: VolumeListParams, options?: Core.RequestOptions): Core.APIPromise<EventVolumes> {
33
24
  return this._client.get('/events/volume', { query, ...options });
34
25
  }
35
26
  }
@@ -56,6 +47,14 @@ export namespace EventVolumes {
56
47
  }
57
48
 
58
49
  export interface VolumeListParams {
50
+ /**
51
+ * The start of the timeframe, inclusive, in which to return event volume. All
52
+ * datetime values are converted to UTC time. If the specified time isn't
53
+ * hour-aligned, the response includes the event volume count for the hour the time
54
+ * falls in.
55
+ */
56
+ timeframe_start: string;
57
+
59
58
  /**
60
59
  * Cursor for pagination. This can be populated by the `next_cursor` value returned
61
60
  * from the initial request.
@@ -74,14 +73,6 @@ export interface VolumeListParams {
74
73
  * volumecount for the hour the time falls in.
75
74
  */
76
75
  timeframe_end?: string;
77
-
78
- /**
79
- * The start of the timeframe, inclusive, in which to return event volume. All
80
- * datetime values are converted to UTC time. If the specified time isn't
81
- * hour-aligned, the response includes the event volume count for the hour the time
82
- * falls in.
83
- */
84
- timeframe_start?: string;
85
76
  }
86
77
 
87
78
  export namespace Volume {
@@ -25,18 +25,9 @@ export class Invoices extends APIResource {
25
25
  */
26
26
  update(
27
27
  invoiceId: string,
28
- body?: InvoiceUpdateParams,
29
- options?: Core.RequestOptions,
30
- ): Core.APIPromise<Invoice>;
31
- update(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
32
- update(
33
- invoiceId: string,
34
- body: InvoiceUpdateParams | Core.RequestOptions = {},
28
+ body: InvoiceUpdateParams,
35
29
  options?: Core.RequestOptions,
36
30
  ): Core.APIPromise<Invoice> {
37
- if (isRequestOptions(body)) {
38
- return this.update(invoiceId, {}, body);
39
- }
40
31
  return this._client.put(`/invoices/${invoiceId}`, { body, ...options });
41
32
  }
42
33
 
@@ -81,17 +72,9 @@ export class Invoices extends APIResource {
81
72
  * subscription.
82
73
  */
83
74
  fetchUpcoming(
84
- query?: InvoiceFetchUpcomingParams,
85
- options?: Core.RequestOptions,
86
- ): Core.APIPromise<InvoiceFetchUpcomingResponse>;
87
- fetchUpcoming(options?: Core.RequestOptions): Core.APIPromise<InvoiceFetchUpcomingResponse>;
88
- fetchUpcoming(
89
- query: InvoiceFetchUpcomingParams | Core.RequestOptions = {},
75
+ query: InvoiceFetchUpcomingParams,
90
76
  options?: Core.RequestOptions,
91
77
  ): Core.APIPromise<InvoiceFetchUpcomingResponse> {
92
- if (isRequestOptions(query)) {
93
- return this.fetchUpcoming({}, query);
94
- }
95
78
  return this._client.get('/invoices/upcoming', { query, ...options });
96
79
  }
97
80
 
@@ -2647,7 +2630,7 @@ export interface InvoiceListParams extends PageParams {
2647
2630
  }
2648
2631
 
2649
2632
  export interface InvoiceFetchUpcomingParams {
2650
- subscription_id?: string;
2633
+ subscription_id: string;
2651
2634
  }
2652
2635
 
2653
2636
  export interface InvoiceIssueParams {
@@ -17,16 +17,7 @@ export class Items extends APIResource {
17
17
  /**
18
18
  * This endpoint can be used to update properties on the Item.
19
19
  */
20
- update(itemId: string, body?: ItemUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Item>;
21
- update(itemId: string, options?: Core.RequestOptions): Core.APIPromise<Item>;
22
- update(
23
- itemId: string,
24
- body: ItemUpdateParams | Core.RequestOptions = {},
25
- options?: Core.RequestOptions,
26
- ): Core.APIPromise<Item> {
27
- if (isRequestOptions(body)) {
28
- return this.update(itemId, {}, body);
29
- }
20
+ update(itemId: string, body: ItemUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Item> {
30
21
  return this._client.put(`/items/${itemId}`, { body, ...options });
31
22
  }
32
23
 
@@ -25,18 +25,9 @@ export class Metrics extends APIResource {
25
25
  */
26
26
  update(
27
27
  metricId: string,
28
- body?: MetricUpdateParams,
29
- options?: Core.RequestOptions,
30
- ): Core.APIPromise<BillableMetric>;
31
- update(metricId: string, options?: Core.RequestOptions): Core.APIPromise<BillableMetric>;
32
- update(
33
- metricId: string,
34
- body: MetricUpdateParams | Core.RequestOptions = {},
28
+ body: MetricUpdateParams,
35
29
  options?: Core.RequestOptions,
36
30
  ): Core.APIPromise<BillableMetric> {
37
- if (isRequestOptions(body)) {
38
- return this.update(metricId, {}, body);
39
- }
40
31
  return this._client.put(`/metrics/${metricId}`, { body, ...options });
41
32
  }
42
33
 
@@ -1,7 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../resource';
4
- import { isRequestOptions } from '../../core';
5
4
  import * as Core from '../../core';
6
5
  import * as ExternalPlanIDAPI from './external-plan-id';
7
6
  import * as PlansAPI from './plans';
@@ -15,18 +14,9 @@ export class ExternalPlanID extends APIResource {
15
14
  */
16
15
  update(
17
16
  otherExternalPlanId: string,
18
- body?: ExternalPlanIDUpdateParams,
19
- options?: Core.RequestOptions,
20
- ): Core.APIPromise<PlansAPI.Plan>;
21
- update(otherExternalPlanId: string, options?: Core.RequestOptions): Core.APIPromise<PlansAPI.Plan>;
22
- update(
23
- otherExternalPlanId: string,
24
- body: ExternalPlanIDUpdateParams | Core.RequestOptions = {},
17
+ body: ExternalPlanIDUpdateParams,
25
18
  options?: Core.RequestOptions,
26
19
  ): Core.APIPromise<PlansAPI.Plan> {
27
- if (isRequestOptions(body)) {
28
- return this.update(otherExternalPlanId, {}, body);
29
- }
30
20
  return this._client.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
31
21
  }
32
22
 
@@ -25,16 +25,7 @@ export class Plans extends APIResource {
25
25
  *
26
26
  * Other fields on a customer are currently immutable.
27
27
  */
28
- update(planId: string, body?: PlanUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Plan>;
29
- update(planId: string, options?: Core.RequestOptions): Core.APIPromise<Plan>;
30
- update(
31
- planId: string,
32
- body: PlanUpdateParams | Core.RequestOptions = {},
33
- options?: Core.RequestOptions,
34
- ): Core.APIPromise<Plan> {
35
- if (isRequestOptions(body)) {
36
- return this.update(planId, {}, body);
37
- }
28
+ update(planId: string, body: PlanUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Plan> {
38
29
  return this._client.put(`/plans/${planId}`, { body, ...options });
39
30
  }
40
31
 
@@ -1,7 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../resource';
4
- import { isRequestOptions } from '../../core';
5
4
  import * as Core from '../../core';
6
5
  import * as ExternalPriceIDAPI from './external-price-id';
7
6
  import * as PricesAPI from './prices';
@@ -14,18 +13,9 @@ export class ExternalPriceID extends APIResource {
14
13
  */
15
14
  update(
16
15
  externalPriceId: string,
17
- body?: ExternalPriceIDUpdateParams,
18
- options?: Core.RequestOptions,
19
- ): Core.APIPromise<PricesAPI.Price>;
20
- update(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise<PricesAPI.Price>;
21
- update(
22
- externalPriceId: string,
23
- body: ExternalPriceIDUpdateParams | Core.RequestOptions = {},
16
+ body: ExternalPriceIDUpdateParams,
24
17
  options?: Core.RequestOptions,
25
18
  ): Core.APIPromise<PricesAPI.Price> {
26
- if (isRequestOptions(body)) {
27
- return this.update(externalPriceId, {}, body);
28
- }
29
19
  return this._client.put(`/prices/external_price_id/${externalPriceId}`, { body, ...options });
30
20
  }
31
21