orb-billing 4.21.0 → 4.23.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 +17 -0
- package/core.d.ts +3 -1
- package/core.d.ts.map +1 -1
- package/core.js +7 -5
- package/core.js.map +1 -1
- package/core.mjs +7 -5
- package/core.mjs.map +1 -1
- package/index.d.mts +4 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/coupons/coupons.d.ts +2 -30
- 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/customers/costs.d.ts +0 -34
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/customers.d.ts +31 -0
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/invoices.d.ts +10 -186
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs.map +1 -1
- package/resources/plans/plans.d.ts +95 -1
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/prices.d.ts +169 -2
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +46 -45
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscriptions.d.ts +5062 -981
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/core.ts +12 -4
- package/src/index.ts +4 -0
- package/src/resources/coupons/coupons.ts +2 -38
- package/src/resources/customers/costs.ts +0 -34
- package/src/resources/customers/customers.ts +59 -0
- package/src/resources/invoices.ts +10 -246
- package/src/resources/plans/plans.ts +114 -0
- package/src/resources/prices/prices.ts +224 -0
- package/src/resources/shared.ts +57 -59
- package/src/resources/subscriptions.ts +6022 -1059
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/index.ts
CHANGED
|
@@ -342,9 +342,13 @@ export namespace Orb {
|
|
|
342
342
|
export import AlertCreateForExternalCustomerParams = API.AlertCreateForExternalCustomerParams;
|
|
343
343
|
export import AlertCreateForSubscriptionParams = API.AlertCreateForSubscriptionParams;
|
|
344
344
|
|
|
345
|
+
export import AmountDiscount = API.AmountDiscount;
|
|
345
346
|
export import BillingCycleRelativeDate = API.BillingCycleRelativeDate;
|
|
346
347
|
export import Discount = API.Discount;
|
|
348
|
+
export import InvoiceLevelDiscount = API.InvoiceLevelDiscount;
|
|
347
349
|
export import PaginationMetadata = API.PaginationMetadata;
|
|
350
|
+
export import PercentageDiscount = API.PercentageDiscount;
|
|
351
|
+
export import TrialDiscount = API.TrialDiscount;
|
|
348
352
|
}
|
|
349
353
|
|
|
350
354
|
export default Orb;
|
|
@@ -4,6 +4,7 @@ import { APIResource } from '../../resource';
|
|
|
4
4
|
import { isRequestOptions } from '../../core';
|
|
5
5
|
import * as Core from '../../core';
|
|
6
6
|
import * as CouponsAPI from './coupons';
|
|
7
|
+
import * as Shared from '../shared';
|
|
7
8
|
import * as SubscriptionsAPI from './subscriptions';
|
|
8
9
|
import { Page, type PageParams } from '../../pagination';
|
|
9
10
|
|
|
@@ -112,7 +113,7 @@ export interface Coupon {
|
|
|
112
113
|
*/
|
|
113
114
|
archived_at: string | null;
|
|
114
115
|
|
|
115
|
-
discount:
|
|
116
|
+
discount: Shared.PercentageDiscount | Shared.AmountDiscount;
|
|
116
117
|
|
|
117
118
|
/**
|
|
118
119
|
* This allows for a coupon's discount to apply for a limited time (determined in
|
|
@@ -137,43 +138,6 @@ export interface Coupon {
|
|
|
137
138
|
times_redeemed: number;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
export namespace Coupon {
|
|
141
|
-
export interface PercentageDiscount {
|
|
142
|
-
/**
|
|
143
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
144
|
-
* this can be a subset of prices.
|
|
145
|
-
*/
|
|
146
|
-
applies_to_price_ids: Array<string>;
|
|
147
|
-
|
|
148
|
-
discount_type: 'percentage';
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Only available if discount_type is `percentage`. This is a number between 0
|
|
152
|
-
* and 1.
|
|
153
|
-
*/
|
|
154
|
-
percentage_discount: number;
|
|
155
|
-
|
|
156
|
-
reason?: string | null;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export interface AmountDiscount {
|
|
160
|
-
/**
|
|
161
|
-
* Only available if discount_type is `amount`.
|
|
162
|
-
*/
|
|
163
|
-
amount_discount: string;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
167
|
-
* this can be a subset of prices.
|
|
168
|
-
*/
|
|
169
|
-
applies_to_price_ids: Array<string>;
|
|
170
|
-
|
|
171
|
-
discount_type: 'amount';
|
|
172
|
-
|
|
173
|
-
reason?: string | null;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
141
|
export interface CouponCreateParams {
|
|
178
142
|
discount: CouponCreateParams.NewCouponPercentageDiscount | CouponCreateParams.NewCouponAmountDiscount;
|
|
179
143
|
|
|
@@ -119,23 +119,6 @@ export class Costs extends APIResource {
|
|
|
119
119
|
* You can see this sliced timeframe visualized
|
|
120
120
|
* [here](https://i.imgur.com/TXhYgme.png).
|
|
121
121
|
*
|
|
122
|
-
* ## Grouping by custom attributes
|
|
123
|
-
*
|
|
124
|
-
* In order to view costs grouped by a specific _attribute_ that each event is
|
|
125
|
-
* tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The
|
|
126
|
-
* `group_by` key denotes the event property on which to group.
|
|
127
|
-
*
|
|
128
|
-
* When returning grouped costs, a separate `price_group` object in the
|
|
129
|
-
* `per_price_costs` array is returned for each value of the `group_by` key present
|
|
130
|
-
* in your events. The `subtotal` value of the `per_price_costs` object is the sum
|
|
131
|
-
* of each `price_group`'s total.
|
|
132
|
-
*
|
|
133
|
-
* Orb expects events will contain values in the `properties` dictionary that
|
|
134
|
-
* correspond to the `group_by` key specified. By default, Orb will return a `null`
|
|
135
|
-
* group (i.e. events that match the metric but do not have the key set).
|
|
136
|
-
* Currently, it is only possible to view costs grouped by a single attribute at a
|
|
137
|
-
* time.
|
|
138
|
-
*
|
|
139
122
|
* ### Matrix prices
|
|
140
123
|
*
|
|
141
124
|
* When a price uses matrix pricing, it's important to view costs grouped by those
|
|
@@ -272,23 +255,6 @@ export class Costs extends APIResource {
|
|
|
272
255
|
* You can see this sliced timeframe visualized
|
|
273
256
|
* [here](https://i.imgur.com/TXhYgme.png).
|
|
274
257
|
*
|
|
275
|
-
* ## Grouping by custom attributes
|
|
276
|
-
*
|
|
277
|
-
* In order to view costs grouped by a specific _attribute_ that each event is
|
|
278
|
-
* tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The
|
|
279
|
-
* `group_by` key denotes the event property on which to group.
|
|
280
|
-
*
|
|
281
|
-
* When returning grouped costs, a separate `price_group` object in the
|
|
282
|
-
* `per_price_costs` array is returned for each value of the `group_by` key present
|
|
283
|
-
* in your events. The `subtotal` value of the `per_price_costs` object is the sum
|
|
284
|
-
* of each `price_group`'s total.
|
|
285
|
-
*
|
|
286
|
-
* Orb expects events will contain values in the `properties` dictionary that
|
|
287
|
-
* correspond to the `group_by` key specified. By default, Orb will return a `null`
|
|
288
|
-
* group (i.e. events that match the metric but do not have the key set).
|
|
289
|
-
* Currently, it is only possible to view costs grouped by a single attribute at a
|
|
290
|
-
* time.
|
|
291
|
-
*
|
|
292
258
|
* ### Matrix prices
|
|
293
259
|
*
|
|
294
260
|
* When a price uses matrix pricing, it's important to view costs grouped by those
|
|
@@ -197,6 +197,8 @@ export interface Customer {
|
|
|
197
197
|
|
|
198
198
|
email_delivery: boolean;
|
|
199
199
|
|
|
200
|
+
exempt_from_automated_tax: boolean | null;
|
|
201
|
+
|
|
200
202
|
/**
|
|
201
203
|
* An optional user-defined ID for this customer resource, used throughout the
|
|
202
204
|
* system as an alias for this Customer. Use this field to identify a customer by
|
|
@@ -736,6 +738,11 @@ export interface CustomerCreateParams {
|
|
|
736
738
|
|
|
737
739
|
shipping_address?: CustomerCreateParams.ShippingAddress | null;
|
|
738
740
|
|
|
741
|
+
tax_configuration?:
|
|
742
|
+
| CustomerCreateParams.NewAvalaraTaxConfiguration
|
|
743
|
+
| CustomerCreateParams.NewTaxJarConfiguration
|
|
744
|
+
| null;
|
|
745
|
+
|
|
739
746
|
/**
|
|
740
747
|
* Tax IDs are commonly required to be displayed on customer invoices, which are
|
|
741
748
|
* added to the headers of invoices.
|
|
@@ -900,6 +907,20 @@ export namespace CustomerCreateParams {
|
|
|
900
907
|
state?: string | null;
|
|
901
908
|
}
|
|
902
909
|
|
|
910
|
+
export interface NewAvalaraTaxConfiguration {
|
|
911
|
+
tax_exempt: boolean;
|
|
912
|
+
|
|
913
|
+
tax_provider: 'avalara';
|
|
914
|
+
|
|
915
|
+
tax_exemption_code?: string | null;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
export interface NewTaxJarConfiguration {
|
|
919
|
+
tax_exempt: boolean;
|
|
920
|
+
|
|
921
|
+
tax_provider: 'taxjar';
|
|
922
|
+
}
|
|
923
|
+
|
|
903
924
|
/**
|
|
904
925
|
* Tax IDs are commonly required to be displayed on customer invoices, which are
|
|
905
926
|
* added to the headers of invoices.
|
|
@@ -1235,6 +1256,11 @@ export interface CustomerUpdateParams {
|
|
|
1235
1256
|
|
|
1236
1257
|
shipping_address?: CustomerUpdateParams.ShippingAddress | null;
|
|
1237
1258
|
|
|
1259
|
+
tax_configuration?:
|
|
1260
|
+
| CustomerUpdateParams.NewAvalaraTaxConfiguration
|
|
1261
|
+
| CustomerUpdateParams.NewTaxJarConfiguration
|
|
1262
|
+
| null;
|
|
1263
|
+
|
|
1238
1264
|
/**
|
|
1239
1265
|
* Tax IDs are commonly required to be displayed on customer invoices, which are
|
|
1240
1266
|
* added to the headers of invoices.
|
|
@@ -1392,6 +1418,20 @@ export namespace CustomerUpdateParams {
|
|
|
1392
1418
|
state?: string | null;
|
|
1393
1419
|
}
|
|
1394
1420
|
|
|
1421
|
+
export interface NewAvalaraTaxConfiguration {
|
|
1422
|
+
tax_exempt: boolean;
|
|
1423
|
+
|
|
1424
|
+
tax_provider: 'avalara';
|
|
1425
|
+
|
|
1426
|
+
tax_exemption_code?: string | null;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
export interface NewTaxJarConfiguration {
|
|
1430
|
+
tax_exempt: boolean;
|
|
1431
|
+
|
|
1432
|
+
tax_provider: 'taxjar';
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1395
1435
|
/**
|
|
1396
1436
|
* Tax IDs are commonly required to be displayed on customer invoices, which are
|
|
1397
1437
|
* added to the headers of invoices.
|
|
@@ -1737,6 +1777,11 @@ export interface CustomerUpdateByExternalIDParams {
|
|
|
1737
1777
|
|
|
1738
1778
|
shipping_address?: CustomerUpdateByExternalIDParams.ShippingAddress | null;
|
|
1739
1779
|
|
|
1780
|
+
tax_configuration?:
|
|
1781
|
+
| CustomerUpdateByExternalIDParams.NewAvalaraTaxConfiguration
|
|
1782
|
+
| CustomerUpdateByExternalIDParams.NewTaxJarConfiguration
|
|
1783
|
+
| null;
|
|
1784
|
+
|
|
1740
1785
|
/**
|
|
1741
1786
|
* Tax IDs are commonly required to be displayed on customer invoices, which are
|
|
1742
1787
|
* added to the headers of invoices.
|
|
@@ -1894,6 +1939,20 @@ export namespace CustomerUpdateByExternalIDParams {
|
|
|
1894
1939
|
state?: string | null;
|
|
1895
1940
|
}
|
|
1896
1941
|
|
|
1942
|
+
export interface NewAvalaraTaxConfiguration {
|
|
1943
|
+
tax_exempt: boolean;
|
|
1944
|
+
|
|
1945
|
+
tax_provider: 'avalara';
|
|
1946
|
+
|
|
1947
|
+
tax_exemption_code?: string | null;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
export interface NewTaxJarConfiguration {
|
|
1951
|
+
tax_exempt: boolean;
|
|
1952
|
+
|
|
1953
|
+
tax_provider: 'taxjar';
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1897
1956
|
/**
|
|
1898
1957
|
* Tax IDs are commonly required to be displayed on customer invoices, which are
|
|
1899
1958
|
* added to the headers of invoices.
|
|
@@ -284,13 +284,13 @@ export interface Invoice {
|
|
|
284
284
|
customer_tax_id: Invoice.CustomerTaxID | null;
|
|
285
285
|
|
|
286
286
|
/**
|
|
287
|
-
* This field is deprecated in favor of `discounts`. If a `discounts`
|
|
288
|
-
* provided, the first discount in the list will be returned. If the list
|
|
289
|
-
* `None` will be returned.
|
|
287
|
+
* @deprecated: This field is deprecated in favor of `discounts`. If a `discounts`
|
|
288
|
+
* list is provided, the first discount in the list will be returned. If the list
|
|
289
|
+
* is empty, `None` will be returned.
|
|
290
290
|
*/
|
|
291
|
-
discount:
|
|
291
|
+
discount: Shared.InvoiceLevelDiscount | null;
|
|
292
292
|
|
|
293
|
-
discounts: Array<
|
|
293
|
+
discounts: Array<Shared.InvoiceLevelDiscount>;
|
|
294
294
|
|
|
295
295
|
/**
|
|
296
296
|
* When the invoice payment is due.
|
|
@@ -831,120 +831,6 @@ export namespace Invoice {
|
|
|
831
831
|
value: string;
|
|
832
832
|
}
|
|
833
833
|
|
|
834
|
-
export interface PercentageDiscount {
|
|
835
|
-
/**
|
|
836
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
837
|
-
* this can be a subset of prices.
|
|
838
|
-
*/
|
|
839
|
-
applies_to_price_ids: Array<string>;
|
|
840
|
-
|
|
841
|
-
discount_type: 'percentage';
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* Only available if discount_type is `percentage`. This is a number between 0
|
|
845
|
-
* and 1.
|
|
846
|
-
*/
|
|
847
|
-
percentage_discount: number;
|
|
848
|
-
|
|
849
|
-
reason?: string | null;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
export interface AmountDiscount {
|
|
853
|
-
/**
|
|
854
|
-
* Only available if discount_type is `amount`.
|
|
855
|
-
*/
|
|
856
|
-
amount_discount: string;
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
860
|
-
* this can be a subset of prices.
|
|
861
|
-
*/
|
|
862
|
-
applies_to_price_ids: Array<string>;
|
|
863
|
-
|
|
864
|
-
discount_type: 'amount';
|
|
865
|
-
|
|
866
|
-
reason?: string | null;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
export interface TrialDiscount {
|
|
870
|
-
/**
|
|
871
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
872
|
-
* this can be a subset of prices.
|
|
873
|
-
*/
|
|
874
|
-
applies_to_price_ids: Array<string>;
|
|
875
|
-
|
|
876
|
-
discount_type: 'trial';
|
|
877
|
-
|
|
878
|
-
reason?: string | null;
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* Only available if discount_type is `trial`
|
|
882
|
-
*/
|
|
883
|
-
trial_amount_discount?: string | null;
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* Only available if discount_type is `trial`
|
|
887
|
-
*/
|
|
888
|
-
trial_percentage_discount?: number | null;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
export interface PercentageDiscount {
|
|
892
|
-
/**
|
|
893
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
894
|
-
* this can be a subset of prices.
|
|
895
|
-
*/
|
|
896
|
-
applies_to_price_ids: Array<string>;
|
|
897
|
-
|
|
898
|
-
discount_type: 'percentage';
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* Only available if discount_type is `percentage`. This is a number between 0
|
|
902
|
-
* and 1.
|
|
903
|
-
*/
|
|
904
|
-
percentage_discount: number;
|
|
905
|
-
|
|
906
|
-
reason?: string | null;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
export interface AmountDiscount {
|
|
910
|
-
/**
|
|
911
|
-
* Only available if discount_type is `amount`.
|
|
912
|
-
*/
|
|
913
|
-
amount_discount: string;
|
|
914
|
-
|
|
915
|
-
/**
|
|
916
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
917
|
-
* this can be a subset of prices.
|
|
918
|
-
*/
|
|
919
|
-
applies_to_price_ids: Array<string>;
|
|
920
|
-
|
|
921
|
-
discount_type: 'amount';
|
|
922
|
-
|
|
923
|
-
reason?: string | null;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
export interface TrialDiscount {
|
|
927
|
-
/**
|
|
928
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
929
|
-
* this can be a subset of prices.
|
|
930
|
-
*/
|
|
931
|
-
applies_to_price_ids: Array<string>;
|
|
932
|
-
|
|
933
|
-
discount_type: 'trial';
|
|
934
|
-
|
|
935
|
-
reason?: string | null;
|
|
936
|
-
|
|
937
|
-
/**
|
|
938
|
-
* Only available if discount_type is `trial`
|
|
939
|
-
*/
|
|
940
|
-
trial_amount_discount?: string | null;
|
|
941
|
-
|
|
942
|
-
/**
|
|
943
|
-
* Only available if discount_type is `trial`
|
|
944
|
-
*/
|
|
945
|
-
trial_percentage_discount?: number | null;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
834
|
export interface LineItem {
|
|
949
835
|
/**
|
|
950
836
|
* A unique ID for this line item.
|
|
@@ -1572,21 +1458,13 @@ export interface InvoiceFetchUpcomingResponse {
|
|
|
1572
1458
|
customer_tax_id: InvoiceFetchUpcomingResponse.CustomerTaxID | null;
|
|
1573
1459
|
|
|
1574
1460
|
/**
|
|
1575
|
-
* This field is deprecated in favor of `discounts`. If a `discounts`
|
|
1576
|
-
* provided, the first discount in the list will be returned. If the list
|
|
1577
|
-
* `None` will be returned.
|
|
1461
|
+
* @deprecated: This field is deprecated in favor of `discounts`. If a `discounts`
|
|
1462
|
+
* list is provided, the first discount in the list will be returned. If the list
|
|
1463
|
+
* is empty, `None` will be returned.
|
|
1578
1464
|
*/
|
|
1579
|
-
discount:
|
|
1580
|
-
| InvoiceFetchUpcomingResponse.PercentageDiscount
|
|
1581
|
-
| InvoiceFetchUpcomingResponse.AmountDiscount
|
|
1582
|
-
| InvoiceFetchUpcomingResponse.TrialDiscount
|
|
1583
|
-
| null;
|
|
1465
|
+
discount: Shared.InvoiceLevelDiscount | null;
|
|
1584
1466
|
|
|
1585
|
-
discounts: Array<
|
|
1586
|
-
| InvoiceFetchUpcomingResponse.PercentageDiscount
|
|
1587
|
-
| InvoiceFetchUpcomingResponse.AmountDiscount
|
|
1588
|
-
| InvoiceFetchUpcomingResponse.TrialDiscount
|
|
1589
|
-
>;
|
|
1467
|
+
discounts: Array<Shared.InvoiceLevelDiscount>;
|
|
1590
1468
|
|
|
1591
1469
|
/**
|
|
1592
1470
|
* When the invoice payment is due.
|
|
@@ -2127,120 +2005,6 @@ export namespace InvoiceFetchUpcomingResponse {
|
|
|
2127
2005
|
value: string;
|
|
2128
2006
|
}
|
|
2129
2007
|
|
|
2130
|
-
export interface PercentageDiscount {
|
|
2131
|
-
/**
|
|
2132
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
2133
|
-
* this can be a subset of prices.
|
|
2134
|
-
*/
|
|
2135
|
-
applies_to_price_ids: Array<string>;
|
|
2136
|
-
|
|
2137
|
-
discount_type: 'percentage';
|
|
2138
|
-
|
|
2139
|
-
/**
|
|
2140
|
-
* Only available if discount_type is `percentage`. This is a number between 0
|
|
2141
|
-
* and 1.
|
|
2142
|
-
*/
|
|
2143
|
-
percentage_discount: number;
|
|
2144
|
-
|
|
2145
|
-
reason?: string | null;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
export interface AmountDiscount {
|
|
2149
|
-
/**
|
|
2150
|
-
* Only available if discount_type is `amount`.
|
|
2151
|
-
*/
|
|
2152
|
-
amount_discount: string;
|
|
2153
|
-
|
|
2154
|
-
/**
|
|
2155
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
2156
|
-
* this can be a subset of prices.
|
|
2157
|
-
*/
|
|
2158
|
-
applies_to_price_ids: Array<string>;
|
|
2159
|
-
|
|
2160
|
-
discount_type: 'amount';
|
|
2161
|
-
|
|
2162
|
-
reason?: string | null;
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
export interface TrialDiscount {
|
|
2166
|
-
/**
|
|
2167
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
2168
|
-
* this can be a subset of prices.
|
|
2169
|
-
*/
|
|
2170
|
-
applies_to_price_ids: Array<string>;
|
|
2171
|
-
|
|
2172
|
-
discount_type: 'trial';
|
|
2173
|
-
|
|
2174
|
-
reason?: string | null;
|
|
2175
|
-
|
|
2176
|
-
/**
|
|
2177
|
-
* Only available if discount_type is `trial`
|
|
2178
|
-
*/
|
|
2179
|
-
trial_amount_discount?: string | null;
|
|
2180
|
-
|
|
2181
|
-
/**
|
|
2182
|
-
* Only available if discount_type is `trial`
|
|
2183
|
-
*/
|
|
2184
|
-
trial_percentage_discount?: number | null;
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
export interface PercentageDiscount {
|
|
2188
|
-
/**
|
|
2189
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
2190
|
-
* this can be a subset of prices.
|
|
2191
|
-
*/
|
|
2192
|
-
applies_to_price_ids: Array<string>;
|
|
2193
|
-
|
|
2194
|
-
discount_type: 'percentage';
|
|
2195
|
-
|
|
2196
|
-
/**
|
|
2197
|
-
* Only available if discount_type is `percentage`. This is a number between 0
|
|
2198
|
-
* and 1.
|
|
2199
|
-
*/
|
|
2200
|
-
percentage_discount: number;
|
|
2201
|
-
|
|
2202
|
-
reason?: string | null;
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
export interface AmountDiscount {
|
|
2206
|
-
/**
|
|
2207
|
-
* Only available if discount_type is `amount`.
|
|
2208
|
-
*/
|
|
2209
|
-
amount_discount: string;
|
|
2210
|
-
|
|
2211
|
-
/**
|
|
2212
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
2213
|
-
* this can be a subset of prices.
|
|
2214
|
-
*/
|
|
2215
|
-
applies_to_price_ids: Array<string>;
|
|
2216
|
-
|
|
2217
|
-
discount_type: 'amount';
|
|
2218
|
-
|
|
2219
|
-
reason?: string | null;
|
|
2220
|
-
}
|
|
2221
|
-
|
|
2222
|
-
export interface TrialDiscount {
|
|
2223
|
-
/**
|
|
2224
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
2225
|
-
* this can be a subset of prices.
|
|
2226
|
-
*/
|
|
2227
|
-
applies_to_price_ids: Array<string>;
|
|
2228
|
-
|
|
2229
|
-
discount_type: 'trial';
|
|
2230
|
-
|
|
2231
|
-
reason?: string | null;
|
|
2232
|
-
|
|
2233
|
-
/**
|
|
2234
|
-
* Only available if discount_type is `trial`
|
|
2235
|
-
*/
|
|
2236
|
-
trial_amount_discount?: string | null;
|
|
2237
|
-
|
|
2238
|
-
/**
|
|
2239
|
-
* Only available if discount_type is `trial`
|
|
2240
|
-
*/
|
|
2241
|
-
trial_percentage_discount?: number | null;
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
2008
|
export interface LineItem {
|
|
2245
2009
|
/**
|
|
2246
2010
|
* A unique ID for this line item.
|
|
@@ -320,6 +320,7 @@ export interface PlanCreateParams {
|
|
|
320
320
|
| PlanCreateParams.NewPlanUnitWithProrationPrice
|
|
321
321
|
| PlanCreateParams.NewPlanGroupedAllocationPrice
|
|
322
322
|
| PlanCreateParams.NewPlanGroupedWithProratedMinimumPrice
|
|
323
|
+
| PlanCreateParams.NewPlanGroupedWithMeteredMinimumPrice
|
|
323
324
|
| PlanCreateParams.NewPlanBulkWithProrationPrice
|
|
324
325
|
>;
|
|
325
326
|
|
|
@@ -2444,6 +2445,119 @@ export namespace PlanCreateParams {
|
|
|
2444
2445
|
}
|
|
2445
2446
|
}
|
|
2446
2447
|
|
|
2448
|
+
export interface NewPlanGroupedWithMeteredMinimumPrice {
|
|
2449
|
+
/**
|
|
2450
|
+
* The cadence to bill for this price on.
|
|
2451
|
+
*/
|
|
2452
|
+
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
|
|
2453
|
+
|
|
2454
|
+
grouped_with_metered_minimum_config: Record<string, unknown>;
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* The id of the item the plan will be associated with.
|
|
2458
|
+
*/
|
|
2459
|
+
item_id: string;
|
|
2460
|
+
|
|
2461
|
+
model_type: 'grouped_with_metered_minimum';
|
|
2462
|
+
|
|
2463
|
+
/**
|
|
2464
|
+
* The name of the price.
|
|
2465
|
+
*/
|
|
2466
|
+
name: string;
|
|
2467
|
+
|
|
2468
|
+
/**
|
|
2469
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
2470
|
+
* usage-based.
|
|
2471
|
+
*/
|
|
2472
|
+
billable_metric_id?: string | null;
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
2476
|
+
* this is true, and in-arrears if this is false.
|
|
2477
|
+
*/
|
|
2478
|
+
billed_in_advance?: boolean | null;
|
|
2479
|
+
|
|
2480
|
+
/**
|
|
2481
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
2482
|
+
* months.
|
|
2483
|
+
*/
|
|
2484
|
+
billing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null;
|
|
2485
|
+
|
|
2486
|
+
/**
|
|
2487
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
2488
|
+
*/
|
|
2489
|
+
conversion_rate?: number | null;
|
|
2490
|
+
|
|
2491
|
+
/**
|
|
2492
|
+
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
|
|
2493
|
+
* price is billed.
|
|
2494
|
+
*/
|
|
2495
|
+
currency?: string | null;
|
|
2496
|
+
|
|
2497
|
+
/**
|
|
2498
|
+
* An alias for the price.
|
|
2499
|
+
*/
|
|
2500
|
+
external_price_id?: string | null;
|
|
2501
|
+
|
|
2502
|
+
/**
|
|
2503
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
2504
|
+
* applied.
|
|
2505
|
+
*/
|
|
2506
|
+
fixed_price_quantity?: number | null;
|
|
2507
|
+
|
|
2508
|
+
/**
|
|
2509
|
+
* The property used to group this price on an invoice
|
|
2510
|
+
*/
|
|
2511
|
+
invoice_grouping_key?: string | null;
|
|
2512
|
+
|
|
2513
|
+
/**
|
|
2514
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
2515
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
2516
|
+
*/
|
|
2517
|
+
invoicing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* User-specified key/value pairs for the resource. Individual keys can be removed
|
|
2521
|
+
* by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
2522
|
+
* by setting `metadata` to `null`.
|
|
2523
|
+
*/
|
|
2524
|
+
metadata?: Record<string, string | null> | null;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
export namespace NewPlanGroupedWithMeteredMinimumPrice {
|
|
2528
|
+
/**
|
|
2529
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
2530
|
+
* months.
|
|
2531
|
+
*/
|
|
2532
|
+
export interface BillingCycleConfiguration {
|
|
2533
|
+
/**
|
|
2534
|
+
* The duration of the billing period.
|
|
2535
|
+
*/
|
|
2536
|
+
duration: number;
|
|
2537
|
+
|
|
2538
|
+
/**
|
|
2539
|
+
* The unit of billing period duration.
|
|
2540
|
+
*/
|
|
2541
|
+
duration_unit: 'day' | 'month';
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
/**
|
|
2545
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
2546
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
2547
|
+
*/
|
|
2548
|
+
export interface InvoicingCycleConfiguration {
|
|
2549
|
+
/**
|
|
2550
|
+
* The duration of the billing period.
|
|
2551
|
+
*/
|
|
2552
|
+
duration: number;
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* The unit of billing period duration.
|
|
2556
|
+
*/
|
|
2557
|
+
duration_unit: 'day' | 'month';
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2447
2561
|
export interface NewPlanBulkWithProrationPrice {
|
|
2448
2562
|
bulk_with_proration_config: Record<string, unknown>;
|
|
2449
2563
|
|