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
|
@@ -17,7 +17,7 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
17
17
|
*
|
|
18
18
|
* The default configuration for subscriptions in Orb is **In-advance billing** and
|
|
19
19
|
* **Beginning of month alignment** (see
|
|
20
|
-
* [Subscription](
|
|
20
|
+
* [Subscription](/core-concepts##subscription) for more details).
|
|
21
21
|
*
|
|
22
22
|
* In order to change the alignment behavior, Orb also supports billing
|
|
23
23
|
* subscriptions on the day of the month they are created. If
|
|
@@ -42,9 +42,10 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
42
42
|
* subscription being created. This is useful when a customer has prices that
|
|
43
43
|
* differ from the default prices for a specific plan.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
46
|
-
* Subscription Overrides Version 2. You can find your
|
|
47
|
-
* Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
45
|
+
* <Note>
|
|
46
|
+
* This feature is only available for accounts that have migrated to Subscription Overrides Version 2. You can find your
|
|
47
|
+
* Subscription Overrides Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
48
|
+
* </Note>
|
|
48
49
|
*
|
|
49
50
|
* ### Adding Prices
|
|
50
51
|
*
|
|
@@ -52,17 +53,17 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
52
53
|
* the list must specify an existing add-on price with a `price_id` or
|
|
53
54
|
* `external_price_id` field, or create a new add-on price by including an object
|
|
54
55
|
* with the key `price`, identical to what would be used in the request body for
|
|
55
|
-
* the [create price endpoint](
|
|
56
|
-
* [Price resource](
|
|
57
|
-
* model configurations possible in this object.
|
|
56
|
+
* the [create price endpoint](/api-reference/price/create-price). See the
|
|
57
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
58
|
+
* different price model configurations possible in this object.
|
|
58
59
|
*
|
|
59
60
|
* If the plan has phases, each object in the list must include a number with
|
|
60
61
|
* `plan_phase_order` key to indicate which phase the price should be added to.
|
|
61
62
|
*
|
|
62
63
|
* An object in the list can specify an optional `start_date` and optional
|
|
63
64
|
* `end_date`. This is equivalent to creating a price interval with the
|
|
64
|
-
* [add/edit price intervals endpoint](
|
|
65
|
-
* unspecified, the start or end date of the phase or subscription will be used.
|
|
65
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
66
|
+
* If unspecified, the start or end date of the phase or subscription will be used.
|
|
66
67
|
*
|
|
67
68
|
* An object in the list can specify an optional `minimum_amount`,
|
|
68
69
|
* `maximum_amount`, or `discounts`. This will create adjustments which apply only
|
|
@@ -87,14 +88,15 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
87
88
|
* either referencing an existing add-on price with a `price_id` or
|
|
88
89
|
* `external_price_id` field, or by creating a new add-on price by including an
|
|
89
90
|
* object with the key `price`, identical to what would be used in the request body
|
|
90
|
-
* for the [create price endpoint](
|
|
91
|
-
* [Price resource](
|
|
92
|
-
* model configurations possible in this object.
|
|
91
|
+
* for the [create price endpoint](/api-reference/price/create-price). See the
|
|
92
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
93
|
+
* different price model configurations possible in this object.
|
|
93
94
|
*
|
|
94
95
|
* For fixed fees, an object in the list can supply a `fixed_price_quantity`
|
|
95
96
|
* instead of a `price`, `price_id`, or `external_price_id` field. This will update
|
|
96
97
|
* only the quantity for the price, similar to the
|
|
97
|
-
* [Update price quantity](
|
|
98
|
+
* [Update price quantity](/api-reference/subscription/update-price-quantity)
|
|
99
|
+
* endpoint.
|
|
98
100
|
*
|
|
99
101
|
* The replacement price will have the same phase, if applicable, and the same
|
|
100
102
|
* start and end dates as the price it replaces.
|
|
@@ -113,7 +115,7 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
113
115
|
* To add adjustments, provide a list of objects with the key `add_adjustments`. An
|
|
114
116
|
* object in the list must include an object with the key `adjustment`, identical
|
|
115
117
|
* to the adjustment object in the
|
|
116
|
-
* [add/edit price intervals endpoint](
|
|
118
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
117
119
|
*
|
|
118
120
|
* If the plan has phases, each object in the list must include a number with
|
|
119
121
|
* `plan_phase_order` key to indicate which phase the adjustment should be added
|
|
@@ -136,17 +138,17 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
136
138
|
* replace with the `replaces_adjustment_id` key, and it must specify an adjustment
|
|
137
139
|
* to replace it with by including an object with the key `adjustment`, identical
|
|
138
140
|
* to the adjustment object in the
|
|
139
|
-
* [add/edit price intervals endpoint](
|
|
141
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
140
142
|
*
|
|
141
143
|
* The replacement adjustment will have the same phase, if applicable, and the same
|
|
142
144
|
* start and end dates as the adjustment it replaces.
|
|
143
145
|
*
|
|
144
146
|
* ## Price overrides (DEPRECATED)
|
|
145
147
|
*
|
|
146
|
-
*
|
|
147
|
-
* prices. (See
|
|
148
|
-
* [Customize your customer's subscriptions](
|
|
149
|
-
*
|
|
148
|
+
* <Note>
|
|
149
|
+
* Price overrides are being phased out in favor adding/removing/replacing prices. (See
|
|
150
|
+
* [Customize your customer's subscriptions](/api-reference/subscription/create-subscription))
|
|
151
|
+
* </Note>
|
|
150
152
|
*
|
|
151
153
|
* Price overrides are used to update some or all prices in a plan for the specific
|
|
152
154
|
* subscription being created. This is useful when a new customer has negotiated a
|
|
@@ -155,9 +157,9 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
155
157
|
* To override prices, provide a list of objects with the key `price_overrides`.
|
|
156
158
|
* The price object in the list of overrides is expected to contain the existing
|
|
157
159
|
* price id, the `model_type` and configuration. (See the
|
|
158
|
-
* [Price resource](
|
|
159
|
-
* model configurations.) The numerical values can be updated, but
|
|
160
|
-
* metric, cadence, type, and name of a price can not be overridden.
|
|
160
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
161
|
+
* different price model configurations.) The numerical values can be updated, but
|
|
162
|
+
* the billable metric, cadence, type, and name of a price can not be overridden.
|
|
161
163
|
*
|
|
162
164
|
* ### Maximums and Minimums
|
|
163
165
|
*
|
|
@@ -340,13 +342,13 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
340
342
|
* current period. If the cancellation is before the most recently issued invoice,
|
|
341
343
|
* Orb will void the intervening invoice and generate a new one based on the new
|
|
342
344
|
* dates for the subscription. See the section on
|
|
343
|
-
* [cancellation behaviors](
|
|
345
|
+
* [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors).
|
|
344
346
|
*/
|
|
345
347
|
cancel(subscriptionId, body, options) {
|
|
346
348
|
return this._client.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options });
|
|
347
349
|
}
|
|
348
350
|
/**
|
|
349
|
-
* This endpoint is used to fetch a [Subscription](
|
|
351
|
+
* This endpoint is used to fetch a [Subscription](/core-concepts##subscription)
|
|
350
352
|
* given an identifier.
|
|
351
353
|
*/
|
|
352
354
|
fetch(subscriptionId, options) {
|
|
@@ -372,9 +374,9 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
372
374
|
}
|
|
373
375
|
/**
|
|
374
376
|
* This endpoint is used to add and edit subscription
|
|
375
|
-
* [price intervals](
|
|
376
|
-
* subscription’s price intervals, you can
|
|
377
|
-
* [flexibly and atomically control the billing behavior of a subscription](
|
|
377
|
+
* [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By
|
|
378
|
+
* making modifications to a subscription’s price intervals, you can
|
|
379
|
+
* [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions).
|
|
378
380
|
*
|
|
379
381
|
* ## Adding price intervals
|
|
380
382
|
*
|
|
@@ -492,9 +494,10 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
492
494
|
* subscription when you schedule the plan change. This is useful when a customer
|
|
493
495
|
* has prices that differ from the default prices for a specific plan.
|
|
494
496
|
*
|
|
495
|
-
*
|
|
496
|
-
* Subscription Overrides Version 2. You can find your
|
|
497
|
-
* Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
497
|
+
* <Note>
|
|
498
|
+
* This feature is only available for accounts that have migrated to Subscription Overrides Version 2. You can find your
|
|
499
|
+
* Subscription Overrides Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
500
|
+
* </Note>
|
|
498
501
|
*
|
|
499
502
|
* ### Adding Prices
|
|
500
503
|
*
|
|
@@ -502,17 +505,17 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
502
505
|
* the list must specify an existing add-on price with a `price_id` or
|
|
503
506
|
* `external_price_id` field, or create a new add-on price by including an object
|
|
504
507
|
* with the key `price`, identical to what would be used in the request body for
|
|
505
|
-
* the [create price endpoint](
|
|
506
|
-
* [Price resource](
|
|
507
|
-
* model configurations possible in this object.
|
|
508
|
+
* the [create price endpoint](/api-reference/price/create-price). See the
|
|
509
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
510
|
+
* different price model configurations possible in this object.
|
|
508
511
|
*
|
|
509
512
|
* If the plan has phases, each object in the list must include a number with
|
|
510
513
|
* `plan_phase_order` key to indicate which phase the price should be added to.
|
|
511
514
|
*
|
|
512
515
|
* An object in the list can specify an optional `start_date` and optional
|
|
513
516
|
* `end_date`. This is equivalent to creating a price interval with the
|
|
514
|
-
* [add/edit price intervals endpoint](
|
|
515
|
-
* unspecified, the start or end date of the phase or subscription will be used.
|
|
517
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
518
|
+
* If unspecified, the start or end date of the phase or subscription will be used.
|
|
516
519
|
*
|
|
517
520
|
* An object in the list can specify an optional `minimum_amount`,
|
|
518
521
|
* `maximum_amount`, or `discounts`. This will create adjustments which apply only
|
|
@@ -537,14 +540,15 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
537
540
|
* either referencing an existing add-on price with a `price_id` or
|
|
538
541
|
* `external_price_id` field, or by creating a new add-on price by including an
|
|
539
542
|
* object with the key `price`, identical to what would be used in the request body
|
|
540
|
-
* for the [create price endpoint](
|
|
541
|
-
* [Price resource](
|
|
542
|
-
* model configurations possible in this object.
|
|
543
|
+
* for the [create price endpoint](/api-reference/price/create-price). See the
|
|
544
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
545
|
+
* different price model configurations possible in this object.
|
|
543
546
|
*
|
|
544
547
|
* For fixed fees, an object in the list can supply a `fixed_price_quantity`
|
|
545
548
|
* instead of a `price`, `price_id`, or `external_price_id` field. This will update
|
|
546
549
|
* only the quantity for the price, similar to the
|
|
547
|
-
* [Update price quantity](
|
|
550
|
+
* [Update price quantity](/api-reference/subscription/update-price-quantity)
|
|
551
|
+
* endpoint.
|
|
548
552
|
*
|
|
549
553
|
* The replacement price will have the same phase, if applicable, and the same
|
|
550
554
|
* start and end dates as the price it replaces.
|
|
@@ -563,7 +567,7 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
563
567
|
* To add adjustments, provide a list of objects with the key `add_adjustments`. An
|
|
564
568
|
* object in the list must include an object with the key `adjustment`, identical
|
|
565
569
|
* to the adjustment object in the
|
|
566
|
-
* [add/edit price intervals endpoint](
|
|
570
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
567
571
|
*
|
|
568
572
|
* If the plan has phases, each object in the list must include a number with
|
|
569
573
|
* `plan_phase_order` key to indicate which phase the adjustment should be added
|
|
@@ -586,17 +590,17 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
586
590
|
* replace with the `replaces_adjustment_id` key, and it must specify an adjustment
|
|
587
591
|
* to replace it with by including an object with the key `adjustment`, identical
|
|
588
592
|
* to the adjustment object in the
|
|
589
|
-
* [add/edit price intervals endpoint](
|
|
593
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
590
594
|
*
|
|
591
595
|
* The replacement adjustment will have the same phase, if applicable, and the same
|
|
592
596
|
* start and end dates as the adjustment it replaces.
|
|
593
597
|
*
|
|
594
598
|
* ## Price overrides (DEPRECATED)
|
|
595
599
|
*
|
|
596
|
-
*
|
|
597
|
-
* prices. (See
|
|
598
|
-
* [Customize your customer's subscriptions](
|
|
599
|
-
*
|
|
600
|
+
* <Note>
|
|
601
|
+
* Price overrides are being phased out in favor adding/removing/replacing prices. (See
|
|
602
|
+
* [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change))
|
|
603
|
+
* </Note>
|
|
600
604
|
*
|
|
601
605
|
* Price overrides are used to update some or all prices in a plan for the specific
|
|
602
606
|
* subscription being created. This is useful when a new customer has negotiated a
|
|
@@ -605,9 +609,9 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
605
609
|
* To override prices, provide a list of objects with the key `price_overrides`.
|
|
606
610
|
* The price object in the list of overrides is expected to contain the existing
|
|
607
611
|
* price id, the `model_type` and configuration. (See the
|
|
608
|
-
* [Price resource](
|
|
609
|
-
* model configurations.) The numerical values can be updated, but
|
|
610
|
-
* metric, cadence, type, and name of a price can not be overridden.
|
|
612
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
613
|
+
* different price model configurations.) The numerical values can be updated, but
|
|
614
|
+
* the billable metric, cadence, type, and name of a price can not be overridden.
|
|
611
615
|
*
|
|
612
616
|
* ### Maximums, and minimums
|
|
613
617
|
*
|
|
@@ -627,7 +631,7 @@ class Subscriptions extends resource_1.APIResource {
|
|
|
627
631
|
* By default, Orb calculates the prorated difference in any fixed fees when making
|
|
628
632
|
* a plan change, adjusting the customer balance as needed. For details on this
|
|
629
633
|
* behavior, see
|
|
630
|
-
* [Modifying subscriptions](
|
|
634
|
+
* [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees).
|
|
631
635
|
*/
|
|
632
636
|
schedulePlanChange(subscriptionId, body, options) {
|
|
633
637
|
return this._client.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAM3C,iDAAsD;AAEtD,MAAa,aAAc,SAAQ,sBAAW;IAC5C
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAM3C,iDAAsD;AAEtD,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiQG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,cAAsB,EACtB,IAA8B,EAC9B,OAA6B;QAE7B,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,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAA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aAAa,CAAC,sCAAsC,GAAG,sCAAsC,CAAC"}
|
|
@@ -14,7 +14,7 @@ export class Subscriptions extends APIResource {
|
|
|
14
14
|
*
|
|
15
15
|
* The default configuration for subscriptions in Orb is **In-advance billing** and
|
|
16
16
|
* **Beginning of month alignment** (see
|
|
17
|
-
* [Subscription](
|
|
17
|
+
* [Subscription](/core-concepts##subscription) for more details).
|
|
18
18
|
*
|
|
19
19
|
* In order to change the alignment behavior, Orb also supports billing
|
|
20
20
|
* subscriptions on the day of the month they are created. If
|
|
@@ -39,9 +39,10 @@ export class Subscriptions extends APIResource {
|
|
|
39
39
|
* subscription being created. This is useful when a customer has prices that
|
|
40
40
|
* differ from the default prices for a specific plan.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
* Subscription Overrides Version 2. You can find your
|
|
44
|
-
* Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
42
|
+
* <Note>
|
|
43
|
+
* This feature is only available for accounts that have migrated to Subscription Overrides Version 2. You can find your
|
|
44
|
+
* Subscription Overrides Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
45
|
+
* </Note>
|
|
45
46
|
*
|
|
46
47
|
* ### Adding Prices
|
|
47
48
|
*
|
|
@@ -49,17 +50,17 @@ export class Subscriptions extends APIResource {
|
|
|
49
50
|
* the list must specify an existing add-on price with a `price_id` or
|
|
50
51
|
* `external_price_id` field, or create a new add-on price by including an object
|
|
51
52
|
* with the key `price`, identical to what would be used in the request body for
|
|
52
|
-
* the [create price endpoint](
|
|
53
|
-
* [Price resource](
|
|
54
|
-
* model configurations possible in this object.
|
|
53
|
+
* the [create price endpoint](/api-reference/price/create-price). See the
|
|
54
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
55
|
+
* different price model configurations possible in this object.
|
|
55
56
|
*
|
|
56
57
|
* If the plan has phases, each object in the list must include a number with
|
|
57
58
|
* `plan_phase_order` key to indicate which phase the price should be added to.
|
|
58
59
|
*
|
|
59
60
|
* An object in the list can specify an optional `start_date` and optional
|
|
60
61
|
* `end_date`. This is equivalent to creating a price interval with the
|
|
61
|
-
* [add/edit price intervals endpoint](
|
|
62
|
-
* unspecified, the start or end date of the phase or subscription will be used.
|
|
62
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
63
|
+
* If unspecified, the start or end date of the phase or subscription will be used.
|
|
63
64
|
*
|
|
64
65
|
* An object in the list can specify an optional `minimum_amount`,
|
|
65
66
|
* `maximum_amount`, or `discounts`. This will create adjustments which apply only
|
|
@@ -84,14 +85,15 @@ export class Subscriptions extends APIResource {
|
|
|
84
85
|
* either referencing an existing add-on price with a `price_id` or
|
|
85
86
|
* `external_price_id` field, or by creating a new add-on price by including an
|
|
86
87
|
* object with the key `price`, identical to what would be used in the request body
|
|
87
|
-
* for the [create price endpoint](
|
|
88
|
-
* [Price resource](
|
|
89
|
-
* model configurations possible in this object.
|
|
88
|
+
* for the [create price endpoint](/api-reference/price/create-price). See the
|
|
89
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
90
|
+
* different price model configurations possible in this object.
|
|
90
91
|
*
|
|
91
92
|
* For fixed fees, an object in the list can supply a `fixed_price_quantity`
|
|
92
93
|
* instead of a `price`, `price_id`, or `external_price_id` field. This will update
|
|
93
94
|
* only the quantity for the price, similar to the
|
|
94
|
-
* [Update price quantity](
|
|
95
|
+
* [Update price quantity](/api-reference/subscription/update-price-quantity)
|
|
96
|
+
* endpoint.
|
|
95
97
|
*
|
|
96
98
|
* The replacement price will have the same phase, if applicable, and the same
|
|
97
99
|
* start and end dates as the price it replaces.
|
|
@@ -110,7 +112,7 @@ export class Subscriptions extends APIResource {
|
|
|
110
112
|
* To add adjustments, provide a list of objects with the key `add_adjustments`. An
|
|
111
113
|
* object in the list must include an object with the key `adjustment`, identical
|
|
112
114
|
* to the adjustment object in the
|
|
113
|
-
* [add/edit price intervals endpoint](
|
|
115
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
114
116
|
*
|
|
115
117
|
* If the plan has phases, each object in the list must include a number with
|
|
116
118
|
* `plan_phase_order` key to indicate which phase the adjustment should be added
|
|
@@ -133,17 +135,17 @@ export class Subscriptions extends APIResource {
|
|
|
133
135
|
* replace with the `replaces_adjustment_id` key, and it must specify an adjustment
|
|
134
136
|
* to replace it with by including an object with the key `adjustment`, identical
|
|
135
137
|
* to the adjustment object in the
|
|
136
|
-
* [add/edit price intervals endpoint](
|
|
138
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
137
139
|
*
|
|
138
140
|
* The replacement adjustment will have the same phase, if applicable, and the same
|
|
139
141
|
* start and end dates as the adjustment it replaces.
|
|
140
142
|
*
|
|
141
143
|
* ## Price overrides (DEPRECATED)
|
|
142
144
|
*
|
|
143
|
-
*
|
|
144
|
-
* prices. (See
|
|
145
|
-
* [Customize your customer's subscriptions](
|
|
146
|
-
*
|
|
145
|
+
* <Note>
|
|
146
|
+
* Price overrides are being phased out in favor adding/removing/replacing prices. (See
|
|
147
|
+
* [Customize your customer's subscriptions](/api-reference/subscription/create-subscription))
|
|
148
|
+
* </Note>
|
|
147
149
|
*
|
|
148
150
|
* Price overrides are used to update some or all prices in a plan for the specific
|
|
149
151
|
* subscription being created. This is useful when a new customer has negotiated a
|
|
@@ -152,9 +154,9 @@ export class Subscriptions extends APIResource {
|
|
|
152
154
|
* To override prices, provide a list of objects with the key `price_overrides`.
|
|
153
155
|
* The price object in the list of overrides is expected to contain the existing
|
|
154
156
|
* price id, the `model_type` and configuration. (See the
|
|
155
|
-
* [Price resource](
|
|
156
|
-
* model configurations.) The numerical values can be updated, but
|
|
157
|
-
* metric, cadence, type, and name of a price can not be overridden.
|
|
157
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
158
|
+
* different price model configurations.) The numerical values can be updated, but
|
|
159
|
+
* the billable metric, cadence, type, and name of a price can not be overridden.
|
|
158
160
|
*
|
|
159
161
|
* ### Maximums and Minimums
|
|
160
162
|
*
|
|
@@ -337,13 +339,13 @@ export class Subscriptions extends APIResource {
|
|
|
337
339
|
* current period. If the cancellation is before the most recently issued invoice,
|
|
338
340
|
* Orb will void the intervening invoice and generate a new one based on the new
|
|
339
341
|
* dates for the subscription. See the section on
|
|
340
|
-
* [cancellation behaviors](
|
|
342
|
+
* [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors).
|
|
341
343
|
*/
|
|
342
344
|
cancel(subscriptionId, body, options) {
|
|
343
345
|
return this._client.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options });
|
|
344
346
|
}
|
|
345
347
|
/**
|
|
346
|
-
* This endpoint is used to fetch a [Subscription](
|
|
348
|
+
* This endpoint is used to fetch a [Subscription](/core-concepts##subscription)
|
|
347
349
|
* given an identifier.
|
|
348
350
|
*/
|
|
349
351
|
fetch(subscriptionId, options) {
|
|
@@ -369,9 +371,9 @@ export class Subscriptions extends APIResource {
|
|
|
369
371
|
}
|
|
370
372
|
/**
|
|
371
373
|
* This endpoint is used to add and edit subscription
|
|
372
|
-
* [price intervals](
|
|
373
|
-
* subscription’s price intervals, you can
|
|
374
|
-
* [flexibly and atomically control the billing behavior of a subscription](
|
|
374
|
+
* [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By
|
|
375
|
+
* making modifications to a subscription’s price intervals, you can
|
|
376
|
+
* [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions).
|
|
375
377
|
*
|
|
376
378
|
* ## Adding price intervals
|
|
377
379
|
*
|
|
@@ -489,9 +491,10 @@ export class Subscriptions extends APIResource {
|
|
|
489
491
|
* subscription when you schedule the plan change. This is useful when a customer
|
|
490
492
|
* has prices that differ from the default prices for a specific plan.
|
|
491
493
|
*
|
|
492
|
-
*
|
|
493
|
-
* Subscription Overrides Version 2. You can find your
|
|
494
|
-
* Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
494
|
+
* <Note>
|
|
495
|
+
* This feature is only available for accounts that have migrated to Subscription Overrides Version 2. You can find your
|
|
496
|
+
* Subscription Overrides Version at the bottom of your [Plans page](https://app.withorb.com/plans)
|
|
497
|
+
* </Note>
|
|
495
498
|
*
|
|
496
499
|
* ### Adding Prices
|
|
497
500
|
*
|
|
@@ -499,17 +502,17 @@ export class Subscriptions extends APIResource {
|
|
|
499
502
|
* the list must specify an existing add-on price with a `price_id` or
|
|
500
503
|
* `external_price_id` field, or create a new add-on price by including an object
|
|
501
504
|
* with the key `price`, identical to what would be used in the request body for
|
|
502
|
-
* the [create price endpoint](
|
|
503
|
-
* [Price resource](
|
|
504
|
-
* model configurations possible in this object.
|
|
505
|
+
* the [create price endpoint](/api-reference/price/create-price). See the
|
|
506
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
507
|
+
* different price model configurations possible in this object.
|
|
505
508
|
*
|
|
506
509
|
* If the plan has phases, each object in the list must include a number with
|
|
507
510
|
* `plan_phase_order` key to indicate which phase the price should be added to.
|
|
508
511
|
*
|
|
509
512
|
* An object in the list can specify an optional `start_date` and optional
|
|
510
513
|
* `end_date`. This is equivalent to creating a price interval with the
|
|
511
|
-
* [add/edit price intervals endpoint](
|
|
512
|
-
* unspecified, the start or end date of the phase or subscription will be used.
|
|
514
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
515
|
+
* If unspecified, the start or end date of the phase or subscription will be used.
|
|
513
516
|
*
|
|
514
517
|
* An object in the list can specify an optional `minimum_amount`,
|
|
515
518
|
* `maximum_amount`, or `discounts`. This will create adjustments which apply only
|
|
@@ -534,14 +537,15 @@ export class Subscriptions extends APIResource {
|
|
|
534
537
|
* either referencing an existing add-on price with a `price_id` or
|
|
535
538
|
* `external_price_id` field, or by creating a new add-on price by including an
|
|
536
539
|
* object with the key `price`, identical to what would be used in the request body
|
|
537
|
-
* for the [create price endpoint](
|
|
538
|
-
* [Price resource](
|
|
539
|
-
* model configurations possible in this object.
|
|
540
|
+
* for the [create price endpoint](/api-reference/price/create-price). See the
|
|
541
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
542
|
+
* different price model configurations possible in this object.
|
|
540
543
|
*
|
|
541
544
|
* For fixed fees, an object in the list can supply a `fixed_price_quantity`
|
|
542
545
|
* instead of a `price`, `price_id`, or `external_price_id` field. This will update
|
|
543
546
|
* only the quantity for the price, similar to the
|
|
544
|
-
* [Update price quantity](
|
|
547
|
+
* [Update price quantity](/api-reference/subscription/update-price-quantity)
|
|
548
|
+
* endpoint.
|
|
545
549
|
*
|
|
546
550
|
* The replacement price will have the same phase, if applicable, and the same
|
|
547
551
|
* start and end dates as the price it replaces.
|
|
@@ -560,7 +564,7 @@ export class Subscriptions extends APIResource {
|
|
|
560
564
|
* To add adjustments, provide a list of objects with the key `add_adjustments`. An
|
|
561
565
|
* object in the list must include an object with the key `adjustment`, identical
|
|
562
566
|
* to the adjustment object in the
|
|
563
|
-
* [add/edit price intervals endpoint](
|
|
567
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
564
568
|
*
|
|
565
569
|
* If the plan has phases, each object in the list must include a number with
|
|
566
570
|
* `plan_phase_order` key to indicate which phase the adjustment should be added
|
|
@@ -583,17 +587,17 @@ export class Subscriptions extends APIResource {
|
|
|
583
587
|
* replace with the `replaces_adjustment_id` key, and it must specify an adjustment
|
|
584
588
|
* to replace it with by including an object with the key `adjustment`, identical
|
|
585
589
|
* to the adjustment object in the
|
|
586
|
-
* [add/edit price intervals endpoint](
|
|
590
|
+
* [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
|
|
587
591
|
*
|
|
588
592
|
* The replacement adjustment will have the same phase, if applicable, and the same
|
|
589
593
|
* start and end dates as the adjustment it replaces.
|
|
590
594
|
*
|
|
591
595
|
* ## Price overrides (DEPRECATED)
|
|
592
596
|
*
|
|
593
|
-
*
|
|
594
|
-
* prices. (See
|
|
595
|
-
* [Customize your customer's subscriptions](
|
|
596
|
-
*
|
|
597
|
+
* <Note>
|
|
598
|
+
* Price overrides are being phased out in favor adding/removing/replacing prices. (See
|
|
599
|
+
* [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change))
|
|
600
|
+
* </Note>
|
|
597
601
|
*
|
|
598
602
|
* Price overrides are used to update some or all prices in a plan for the specific
|
|
599
603
|
* subscription being created. This is useful when a new customer has negotiated a
|
|
@@ -602,9 +606,9 @@ export class Subscriptions extends APIResource {
|
|
|
602
606
|
* To override prices, provide a list of objects with the key `price_overrides`.
|
|
603
607
|
* The price object in the list of overrides is expected to contain the existing
|
|
604
608
|
* price id, the `model_type` and configuration. (See the
|
|
605
|
-
* [Price resource](
|
|
606
|
-
* model configurations.) The numerical values can be updated, but
|
|
607
|
-
* metric, cadence, type, and name of a price can not be overridden.
|
|
609
|
+
* [Price resource](/product-catalog/price-configuration) for the specification of
|
|
610
|
+
* different price model configurations.) The numerical values can be updated, but
|
|
611
|
+
* the billable metric, cadence, type, and name of a price can not be overridden.
|
|
608
612
|
*
|
|
609
613
|
* ### Maximums, and minimums
|
|
610
614
|
*
|
|
@@ -624,7 +628,7 @@ export class Subscriptions extends APIResource {
|
|
|
624
628
|
* By default, Orb calculates the prorated difference in any fixed fees when making
|
|
625
629
|
* a plan change, adjusting the customer balance as needed. For details on this
|
|
626
630
|
* behavior, see
|
|
627
|
-
* [Modifying subscriptions](
|
|
631
|
+
* [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees).
|
|
628
632
|
*/
|
|
629
633
|
schedulePlanChange(subscriptionId, body, options) {
|
|
630
634
|
return this._client.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
|
|
@@ -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;OAMpB,EAAE,IAAI,EAAmB;AAEhC,MAA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AA0B,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;OAMG;IACH,iCAAiC,CAC/B,cAAsB,EACtB,IAAyD,EACzD,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,cAAc,wCAAwC,EAAE;YACjG,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,4BAA4B,CAC1B,cAAsB,EACtB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,cAAc,kCAAkC,EAAE,OAAO,CAAC,CAAC;IACxG,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,sBAAsB,CACpB,cAAsB,EACtB,IAA8C,EAC9C,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,cAAc,4BAA4B,EAAE;YACrF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CACT,cAAsB,EACtB,IAAmC,EACnC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,cAAc,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,IAAkB;CAAG;AAE5D,MAAM,OAAO,sCAAuC,SAAQ,IAAuC;CAAG;AAywoBtG,aAAa,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AACpD,aAAa,CAAC,sCAAsC,GAAG,sCAAsC,CAAC"}
|
package/src/resources/alerts.ts
CHANGED
|
@@ -35,7 +35,7 @@ export class Alerts extends APIResource {
|
|
|
35
35
|
*
|
|
36
36
|
* The list of alerts is ordered starting from the most recently created alert.
|
|
37
37
|
* This endpoint follows Orb's
|
|
38
|
-
* [standardized pagination format](
|
|
38
|
+
* [standardized pagination format](/api-reference/pagination).
|
|
39
39
|
*/
|
|
40
40
|
list(query?: AlertListParams, options?: Core.RequestOptions): Core.PagePromise<AlertsPage, Alert>;
|
|
41
41
|
list(options?: Core.RequestOptions): Core.PagePromise<AlertsPage, Alert>;
|
|
@@ -54,8 +54,7 @@ export class Alerts extends APIResource {
|
|
|
54
54
|
* are three types of alerts that can be scoped to customers:
|
|
55
55
|
* `credit_balance_depleted`, `credit_balance_dropped`, and
|
|
56
56
|
* `credit_balance_recovered`. Customers can have a maximum of one of each type of
|
|
57
|
-
* alert per
|
|
58
|
-
* [credit balance currency](https://docs.withorb.com/guides/product-catalog/prepurchase).
|
|
57
|
+
* alert per [credit balance currency](/product-catalog/prepurchase).
|
|
59
58
|
* `credit_balance_dropped` alerts require a list of thresholds to be provided
|
|
60
59
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
61
60
|
* require thresholds.
|
|
@@ -73,8 +72,7 @@ export class Alerts extends APIResource {
|
|
|
73
72
|
* are three types of alerts that can be scoped to customers:
|
|
74
73
|
* `credit_balance_depleted`, `credit_balance_dropped`, and
|
|
75
74
|
* `credit_balance_recovered`. Customers can have a maximum of one of each type of
|
|
76
|
-
* alert per
|
|
77
|
-
* [credit balance currency](https://docs.withorb.com/guides/product-catalog/prepurchase).
|
|
75
|
+
* alert per [credit balance currency](/product-catalog/prepurchase).
|
|
78
76
|
* `credit_balance_dropped` alerts require a list of thresholds to be provided
|
|
79
77
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
80
78
|
* require thresholds.
|
|
@@ -164,9 +162,8 @@ export class Alerts extends APIResource {
|
|
|
164
162
|
export class AlertsPage extends Page<Alert> {}
|
|
165
163
|
|
|
166
164
|
/**
|
|
167
|
-
* [Alerts within Orb](
|
|
168
|
-
*
|
|
169
|
-
* is exceeded.
|
|
165
|
+
* [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
|
|
166
|
+
* usage, or credit balance and trigger webhooks when a threshold is exceeded.
|
|
170
167
|
*
|
|
171
168
|
* Alerts created through the API can be scoped to either customers or
|
|
172
169
|
* subscriptions.
|
|
@@ -66,40 +66,6 @@ export class CouponsPage extends Page<Coupon> {}
|
|
|
66
66
|
* activated using a redemption code, which applies the discount to a subscription
|
|
67
67
|
* or invoice. The duration of a coupon determines how long it remains available
|
|
68
68
|
* for use by end users.
|
|
69
|
-
*
|
|
70
|
-
* ## How to use coupons
|
|
71
|
-
*
|
|
72
|
-
* Coupons can be created using the Orb dashboard or programmatically through the
|
|
73
|
-
* API. Once a coupon is created, it can be managed and applied programmatically
|
|
74
|
-
* via the API. To redeem a coupon, use the `redemption_code` property when
|
|
75
|
-
* [creating a subscription](create-subscription.api.mdx) or when scheduling a
|
|
76
|
-
* [plan change](schedule-plan-change.api.mdx).
|
|
77
|
-
*
|
|
78
|
-
* ## When to use coupons
|
|
79
|
-
*
|
|
80
|
-
* A common use case for coupons is through self-serve signup or upgrade flows in
|
|
81
|
-
* your checkout experience or billing portal. Coupons can also be used as one-off
|
|
82
|
-
* to incentivize use for custom agreements.
|
|
83
|
-
*
|
|
84
|
-
* Coupons are effective when launching new features and encouraging existing users
|
|
85
|
-
* to upgrade to a higher tier. For example, you could create a coupon code
|
|
86
|
-
* "UPGRADE20" that offers a 20% discount on the first month of the new plan. This
|
|
87
|
-
* code can be applied during the upgrade process in your billing portal, making it
|
|
88
|
-
* straightforward for users to benefit from the new features at a reduced cost.
|
|
89
|
-
*
|
|
90
|
-
* ## Coupon scoping
|
|
91
|
-
*
|
|
92
|
-
* When a coupon is applied on a subscription, it creates a discount adjustment
|
|
93
|
-
* that applies to all of the prices on the subscription at the time of the coupon
|
|
94
|
-
* application. Notably, coupons do not scope in new price additions to a
|
|
95
|
-
* subscription automatically — if a new price is added to the subscription with a
|
|
96
|
-
* subscription edit or plan version migration, the discount created with the
|
|
97
|
-
* coupon will not apply to it automatically. If you'd like the coupon to apply to
|
|
98
|
-
* newly added prices, you can
|
|
99
|
-
* [edit the adjustment intervals](add-edit-price-intervals.api.mdx) to end the
|
|
100
|
-
* discount interval created by the coupon at the time of the migration and add a
|
|
101
|
-
* new one starting at the time of the migration that includes the newly added
|
|
102
|
-
* prices you'd like the coupon to apply to.
|
|
103
69
|
*/
|
|
104
70
|
export interface Coupon {
|
|
105
71
|
/**
|