chargebee 2.26.0 → 2.27.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 +24 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +8 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +235 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +285 -13
- package/types/resources/Card.d.ts +375 -13
- package/types/resources/Comment.d.ts +160 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +628 -20
- package/types/resources/CouponCode.d.ts +46 -5
- package/types/resources/CouponSet.d.ts +194 -17
- package/types/resources/CreditNote.d.ts +1100 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +1819 -73
- package/types/resources/DifferentialPrice.d.ts +246 -15
- package/types/resources/Discount.d.ts +107 -0
- package/types/resources/Download.d.ts +18 -0
- package/types/resources/EntitlementOverride.d.ts +101 -7
- package/types/resources/Estimate.d.ts +1021 -27
- package/types/resources/Event.d.ts +138 -8
- package/types/resources/Export.d.ts +622 -32
- package/types/resources/Feature.d.ts +287 -22
- package/types/resources/Gift.d.ts +296 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1046 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +369 -9
- package/types/resources/Invoice.d.ts +1942 -92
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +522 -16
- package/types/resources/ItemEntitlement.d.ts +162 -13
- package/types/resources/ItemFamily.d.ts +153 -15
- package/types/resources/ItemPrice.d.ts +951 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +46 -3
- package/types/resources/Order.d.ts +1172 -32
- package/types/resources/PaymentIntent.d.ts +293 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +984 -55
- package/types/resources/PaymentVoucher.d.ts +252 -14
- package/types/resources/PortalSession.d.ts +154 -10
- package/types/resources/PromotionalCredit.d.ts +300 -16
- package/types/resources/Purchase.d.ts +206 -5
- package/types/resources/Quote.d.ts +1430 -62
- package/types/resources/QuoteLineGroup.d.ts +134 -5
- package/types/resources/QuotedCharge.d.ts +63 -5
- package/types/resources/QuotedSubscription.d.ts +192 -5
- package/types/resources/ResourceMigration.d.ts +68 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +2564 -137
- package/types/resources/SubscriptionEntitlement.d.ts +116 -8
- package/types/resources/SubscriptionEstimate.d.ts +36 -2
- package/types/resources/TaxWithheld.d.ts +32 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
- package/types/resources/TimeMachine.d.ts +82 -7
- package/types/resources/Token.d.ts +164 -7
- package/types/resources/Transaction.d.ts +567 -25
- package/types/resources/UnbilledCharge.d.ts +309 -14
- package/types/resources/Usage.d.ts +237 -13
- package/types/resources/VirtualBankAccount.d.ts +220 -17
|
@@ -1,83 +1,314 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface DifferentialPrice {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description A unique and immutable ID for the differential price. It is auto-generated when the differential price is created.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
id:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description The ID of the item price (`addon` or `charge`) whose price should change according to the plan-item it is applied to.
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
item_price_id:string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description The ID of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the *Standard* or *Enterprise* plans-items mentioned in the [examples above](./differential_prices?prod_cat_ver=2).
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
parent_item_id:string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description The differential price. If the pricing model of the `item_price_id` is `tiered`, `volume`, or `stairstep`, pass `tiers` instead of this.
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
price?:number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description The price of the item when the pricing_model is `flat_fee`. When the pricing model is `per_unit`, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
8
38
|
price_in_decimal?:string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @description The item family state. \* active - New items can be created with the item family. \* deleted - No items allowed for the item family.
|
|
42
|
+
|
|
43
|
+
*/
|
|
44
|
+
|
|
9
45
|
status?:'deleted' | 'active';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
|
|
49
|
+
|
|
50
|
+
*/
|
|
51
|
+
|
|
10
52
|
resource_version?:number;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @description Timestamp when this differential price was last updated.
|
|
56
|
+
|
|
57
|
+
*/
|
|
58
|
+
|
|
11
59
|
updated_at?:number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @description Timestamp at which this differential price was created.
|
|
63
|
+
|
|
64
|
+
*/
|
|
65
|
+
|
|
12
66
|
created_at:number;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @description Timestamp at which this differential price was last modified.
|
|
70
|
+
|
|
71
|
+
*/
|
|
72
|
+
|
|
13
73
|
modified_at:number;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @description The currency code (ISO 4217 format) of the plan
|
|
77
|
+
|
|
78
|
+
*/
|
|
79
|
+
|
|
14
80
|
currency_code:string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @description List of quantity-based pricing tiers for the differential price. Applicable only for `tiered`, `volume`, and `stairstep` `pricing_model` s. The tiers are exactly the same as those set for the item price. Only the `price` attribute for the various tiers can be overridden for the differential price.
|
|
84
|
+
|
|
85
|
+
*/
|
|
86
|
+
|
|
15
87
|
tiers?:DifferentialPrice.Tier[];
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @description When `item_price_id` is a charge-item, you can specify the plan period for which the price applies. Although an array, currently you can specify only one period. In other words, only index `0` is allowed. Create another differential price to specify another period. Is permitted only when `item_price_id` is a charge-item.
|
|
91
|
+
|
|
92
|
+
*/
|
|
93
|
+
|
|
16
94
|
parent_periods?:DifferentialPrice.ParentPeriod[];
|
|
17
95
|
}
|
|
18
96
|
export namespace DifferentialPrice {
|
|
19
|
-
export class DifferentialPriceResource {
|
|
97
|
+
export class DifferentialPriceResource {
|
|
98
|
+
/**
|
|
99
|
+
* @description Delete a differential price using a `differential_price_id` and `item_price_id`.
|
|
100
|
+
|
|
101
|
+
*/
|
|
102
|
+
|
|
20
103
|
delete(differential_price_id:string, input:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @description Create a differential price for addon item price, addon item price with tiered pricing, or charge item price.
|
|
107
|
+
|
|
108
|
+
*/
|
|
109
|
+
|
|
21
110
|
create(item_price_id:string, input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
114
|
+
|
|
115
|
+
*/
|
|
116
|
+
|
|
22
117
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @description Retrieve a differential price using a `differential_price_id` and `item_price_id`.
|
|
121
|
+
|
|
122
|
+
*/
|
|
123
|
+
|
|
23
124
|
retrieve(differential_price_id:string, input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @description Update a differential price using a `differential_price_id` and `item_price_id`.
|
|
128
|
+
|
|
129
|
+
*/
|
|
130
|
+
|
|
24
131
|
update(differential_price_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
|
|
25
132
|
}
|
|
26
|
-
export interface DeleteResponse {
|
|
27
|
-
|
|
133
|
+
export interface DeleteResponse {
|
|
134
|
+
differential_price:DifferentialPrice;
|
|
28
135
|
}
|
|
29
136
|
export interface DeleteInputParam {
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @description The id of the item price (`addon` or `charge`) whose price should change according to the plan-item it is applied to.
|
|
140
|
+
|
|
141
|
+
*/
|
|
142
|
+
|
|
30
143
|
item_price_id:string;
|
|
31
144
|
}
|
|
32
|
-
export interface CreateResponse {
|
|
33
|
-
|
|
145
|
+
export interface CreateResponse {
|
|
146
|
+
differential_price:DifferentialPrice;
|
|
34
147
|
}
|
|
35
148
|
export interface CreateInputParam {
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @description The id of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the *Standard* or *Enterprise* plans-items mentioned in the [examples above](./differential_prices?prod_cat_ver=2).
|
|
152
|
+
|
|
153
|
+
*/
|
|
154
|
+
|
|
36
155
|
parent_item_id:string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @description The differential price. If the pricing model of the `item_price_id` is `tiered`, `volume`, or `stairstep`, pass `tiers` instead of this.
|
|
159
|
+
|
|
160
|
+
*/
|
|
161
|
+
|
|
37
162
|
price?:number;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @description The price of the item when the pricing_model is `flat_fee`. When the pricing model is `per_unit`, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
166
|
+
|
|
167
|
+
*/
|
|
168
|
+
|
|
38
169
|
price_in_decimal?:string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @description Parameters for parent_periods
|
|
173
|
+
|
|
174
|
+
*/
|
|
175
|
+
|
|
39
176
|
parent_periods?:{period?:any[],period_unit:'week' | 'month' | 'year' | 'day'}[];
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @description Parameters for tiers
|
|
180
|
+
|
|
181
|
+
*/
|
|
182
|
+
|
|
40
183
|
tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
|
|
41
184
|
}
|
|
42
|
-
export interface ListResponse {
|
|
43
|
-
|
|
44
|
-
|
|
185
|
+
export interface ListResponse {
|
|
186
|
+
/**
|
|
187
|
+
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
188
|
+
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
list:{differential_price:DifferentialPrice}[];
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
195
|
+
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
next_offset?:string;
|
|
45
199
|
}
|
|
46
200
|
export interface ListInputParam {
|
|
47
|
-
[key : string]: any;
|
|
201
|
+
[key : string]: any;
|
|
202
|
+
/**
|
|
203
|
+
* @description The number of resources to be returned.
|
|
204
|
+
|
|
205
|
+
*/
|
|
206
|
+
|
|
48
207
|
limit?:number;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
|
|
211
|
+
|
|
212
|
+
*/
|
|
213
|
+
|
|
49
214
|
offset?:string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @description The id of the item price (`addon` or `charge`) whose price should change according to the plan-item it is applied to.
|
|
218
|
+
|
|
219
|
+
*/
|
|
220
|
+
|
|
50
221
|
item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @description Item Id of Addon / Charge item price for which differential pricing is applied to
|
|
225
|
+
|
|
226
|
+
*/
|
|
227
|
+
|
|
51
228
|
item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* @description A unique and immutable id for the differential price. It is auto-generated when the differential price is created.
|
|
232
|
+
|
|
233
|
+
*/
|
|
234
|
+
|
|
52
235
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @description The id of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the *Standard* or *Enterprise* plans-items mentioned in the [examples above](./differential_prices?prod_cat_ver=2).
|
|
239
|
+
|
|
240
|
+
*/
|
|
241
|
+
|
|
53
242
|
parent_item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
54
243
|
}
|
|
55
|
-
export interface RetrieveResponse {
|
|
56
|
-
|
|
244
|
+
export interface RetrieveResponse {
|
|
245
|
+
differential_price:DifferentialPrice;
|
|
57
246
|
}
|
|
58
247
|
export interface RetrieveInputParam {
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @description Retrieve a differential price using a `differential_price_id` and `item_price_id`.
|
|
251
|
+
|
|
252
|
+
*/
|
|
253
|
+
|
|
59
254
|
item_price_id:string;
|
|
60
255
|
}
|
|
61
|
-
export interface UpdateResponse {
|
|
62
|
-
|
|
256
|
+
export interface UpdateResponse {
|
|
257
|
+
differential_price:DifferentialPrice;
|
|
63
258
|
}
|
|
64
259
|
export interface UpdateInputParam {
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @description The id of the item price (`addon` or `charge`) whose price should change according to the plan-item it is applied to.
|
|
263
|
+
|
|
264
|
+
*/
|
|
265
|
+
|
|
65
266
|
item_price_id:string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @description The differential price. If the pricing model of the `item_price_id` is `tiered`, `volume`, or `stairstep`, pass `tiers` instead of this.
|
|
270
|
+
|
|
271
|
+
*/
|
|
272
|
+
|
|
66
273
|
price?:number;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @description The price of the item when the pricing_model is `flat_fee`. When the pricing model is `per_unit`, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
277
|
+
|
|
278
|
+
*/
|
|
279
|
+
|
|
67
280
|
price_in_decimal?:string;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @description Parameters for parent_periods
|
|
284
|
+
|
|
285
|
+
*/
|
|
286
|
+
|
|
68
287
|
parent_periods?:{period?:any[],period_unit:'week' | 'month' | 'year' | 'day'}[];
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @description Parameters for tiers
|
|
291
|
+
|
|
292
|
+
*/
|
|
293
|
+
|
|
69
294
|
tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
|
|
70
295
|
}
|
|
71
|
-
export interface Tier {
|
|
296
|
+
export interface Tier {
|
|
72
297
|
starting_unit?:number;
|
|
298
|
+
|
|
73
299
|
ending_unit?:number;
|
|
300
|
+
|
|
74
301
|
price?:number;
|
|
302
|
+
|
|
75
303
|
starting_unit_in_decimal?:string;
|
|
304
|
+
|
|
76
305
|
ending_unit_in_decimal?:string;
|
|
306
|
+
|
|
77
307
|
price_in_decimal?:string;
|
|
78
308
|
}
|
|
79
|
-
export interface ParentPeriod {
|
|
309
|
+
export interface ParentPeriod {
|
|
80
310
|
period_unit?:'week' | 'month' | 'year' | 'day';
|
|
311
|
+
|
|
81
312
|
period?:any[];
|
|
82
313
|
}
|
|
83
314
|
}
|
|
@@ -1,22 +1,129 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface Discount {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description An immutable unique id for the discount. It is always auto-generated.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
id:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description The name of the discount as it should appear on customer-facing pages and documents such as [invoices](/docs/api/invoices?prod_cat_ver=2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver=2). This is auto-generated based on the `type`, `amount`, and `currency_code` of the discount. For example, it can be `10% off` or `10$ off`.
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
invoice_name?:string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description The type of discount. Possible value are: \* percentage - The specified percentage will be given as discount. \* fixed_amount - The specified amount will be given as discount.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
type:'fixed_amount' | 'percentage';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description The percentage of the original amount that should be deducted from it. Only applicable when `discount.type` is percentage.
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
percentage?:number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description The value of the discount. [The format of this value](https://apidocs.chargebee.com/docs/api?prod_cat_ver=2#currencies) depends on the kind of currency. This is only applicable when `discount.type` is `fixed_amount`.
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
8
38
|
amount?:number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the discount. This is only applicable when `discount.type` is `fixed_amount`.
|
|
42
|
+
|
|
43
|
+
*/
|
|
44
|
+
|
|
9
45
|
currency_code?:string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description Specifies the time duration for which this discount is attached to the subscription. \* forever - The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions?prod_cat_ver=2#update_subscription_for_items_discounts_operation_type). \* limited_period - The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by `period` and `period_unit`. \* one_time - The discount stays attached to the subscription till it is applied on an invoice **once**. It is removed after that from the subscription.
|
|
49
|
+
|
|
50
|
+
*/
|
|
51
|
+
|
|
10
52
|
duration_type:DurationType;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @description The duration of time for which the discount is attached to the subscription, in `period_units`. Applicable only when `duration_type` is `limited_period`.
|
|
56
|
+
|
|
57
|
+
*/
|
|
58
|
+
|
|
11
59
|
period?:number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @description The unit of time for `period`. Applicable only when `duration_type` is `limited_period`. \* year - A period of 1 calendar year. \* month - A period of 1 calendar month. \* week - A period of 7 days. \* day - A period of 24 hours.
|
|
63
|
+
|
|
64
|
+
*/
|
|
65
|
+
|
|
12
66
|
period_unit?:PeriodUnit;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @description The discount is included in MRR calculations for your site. This attribute is only applicable when `duration_type` is `one_time` and when the [feature is enabled](https://www.chargebee.com/docs/reporting.html#dashboards_flexible-mrr-calculation) in Chargebee. Also, If the [site-level setting](https://www.chargebee.com/docs/reporting.html#chart_flexible-mrr-calculation) is to exclude one-time discounts from MRR calculations, this value is always returned `false`.
|
|
70
|
+
|
|
71
|
+
*/
|
|
72
|
+
|
|
13
73
|
included_in_mrr:boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice `sub_total`. \* specific_item_price - The discount is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id`.
|
|
77
|
+
|
|
78
|
+
*/
|
|
79
|
+
|
|
14
80
|
apply_on:ApplyOn;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @description The [id of the item price](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when `apply_on` = `specific_item_price`.
|
|
84
|
+
|
|
85
|
+
*/
|
|
86
|
+
|
|
15
87
|
item_price_id?:string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @description Timestamp indicating when this discount is created.
|
|
91
|
+
|
|
92
|
+
*/
|
|
93
|
+
|
|
16
94
|
created_at:number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @description Specifies till when the limited period discount is applicable. This attribute will be sent in the response only for `limited_period` duration type discount.
|
|
98
|
+
|
|
99
|
+
*/
|
|
100
|
+
|
|
17
101
|
apply_till?:number;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @description Specifies the number of times the discount has been applied.
|
|
105
|
+
|
|
106
|
+
*/
|
|
107
|
+
|
|
18
108
|
applied_count?:number;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
112
|
+
**Note:**
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
116
|
+
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
117
|
+
|
|
118
|
+
*/
|
|
119
|
+
|
|
19
120
|
coupon_id:string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @description The index number of the subscription to which the item price is added. Provide a unique number between `0` and `4` (inclusive) for each subscription that is to be created.
|
|
124
|
+
|
|
125
|
+
*/
|
|
126
|
+
|
|
20
127
|
index:number;
|
|
21
128
|
}
|
|
22
129
|
}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface Download {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description The URL at which the file is available for download.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
download_url:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description The time until which the `download_url` is valid.
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
valid_till:number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
mime_type?:string;
|
|
7
25
|
}
|
|
8
26
|
}
|
|
@@ -1,34 +1,128 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface EntitlementOverride {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description Unique identifier for the entitlement override. This is always auto-generated.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
id:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description The `id` of the subscription to which this entitlement override belongs.
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
entity_id?:string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description The name of Chargebee resource that this entitlement override is associated with. The value is always `subscription`.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
entity_type?:string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description The `id` of the `feature` towards which this entitlement override has been granted.
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
feature_id?:string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description The `name` of the `feature` towards which this entitlement override has been granted.
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
8
38
|
feature_name?:string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @description The level of entitlement that the item has towards the feature. The possible values depend on the value of `feature.type`:
|
|
42
|
+
|
|
43
|
+
* When `feature.type` is `quantity` and:
|
|
44
|
+
* If `feature.levels[is_unlimited]` is not `true` for any one of `feature.levels[]`, then the value can be any one of `feature.levels[value][]`.
|
|
45
|
+
* If `feature.levels[is_unlimited]` is `true` for one of the `feature.levels[]`, then the value can also be:
|
|
46
|
+
* any one of `feature.levels[value][]`
|
|
47
|
+
* or it can be `unlimited` (case-insensitive), indicating unlimited entitlement.
|
|
48
|
+
* When `type` is `range` and:
|
|
49
|
+
* If `feature.levels[is_unlimited]` is not `true` for any one of `feature.levels[]`, then the value can be any whole number between `levels[value][0]` and `levels[value][1]` (inclusive).
|
|
50
|
+
* If `feature.levels[is_unlimited]` is `true` for one of the `feature.levels[]`, then the value can be:
|
|
51
|
+
* any whole number equal to or greater than `levels[value][0]`
|
|
52
|
+
* or it can be `unlimited` (case-insensitive), indicating unlimited entitlement.
|
|
53
|
+
* When `type` is `custom`, then the value can be any one of `feature.levels[value][]`.
|
|
54
|
+
* When `type` is `switch`, then the value is set as `true` if the feature is available; it is set as `false` when the feature is unavailable.
|
|
55
|
+
|
|
56
|
+
*/
|
|
57
|
+
|
|
9
58
|
value?:string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @description The display name for the entitlement level. The default values are auto-generated based on `feature.type` as follows:
|
|
62
|
+
|
|
63
|
+
* When `feature.type` is `quantity` or `range`, then `name` is the space-separated concatenation of `value` and the pluralized version of `feature.unit`. For example, if `value` is `20` and `feature.unit` is `user`, then `name` becomes `20 users`.
|
|
64
|
+
* When `feature.type` is `custom`, then `name` is the same as `value`
|
|
65
|
+
|
|
66
|
+
*/
|
|
67
|
+
|
|
10
68
|
name?:string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @description The expiry date for the `entitlement_override`. Once expired, the `entitlement_override` object is no longer returned.
|
|
72
|
+
|
|
73
|
+
*/
|
|
74
|
+
|
|
11
75
|
expires_at?:number;
|
|
12
76
|
}
|
|
13
77
|
export namespace EntitlementOverride {
|
|
14
|
-
export class EntitlementOverrideResource {
|
|
78
|
+
export class EntitlementOverrideResource {
|
|
79
|
+
/**
|
|
80
|
+
* @description Retrieve the list of entitlement overrides for a subscription.
|
|
81
|
+
|
|
82
|
+
*/
|
|
83
|
+
|
|
15
84
|
list_entitlement_override_for_subscription(subscription_id:string, input?:ListEntitlementOverrideForSubscriptionInputParam):ChargebeeRequest<ListEntitlementOverrideForSubscriptionResponse>;
|
|
85
|
+
|
|
16
86
|
add_entitlement_override_for_subscription(subscription_id:string, input?:AddEntitlementOverrideForSubscriptionInputParam):ChargebeeRequest<AddEntitlementOverrideForSubscriptionResponse>;
|
|
17
87
|
}
|
|
18
|
-
export interface ListEntitlementOverrideForSubscriptionResponse {
|
|
19
|
-
|
|
20
|
-
|
|
88
|
+
export interface ListEntitlementOverrideForSubscriptionResponse {
|
|
89
|
+
/**
|
|
90
|
+
* @description Retrieve the list of entitlement overrides for a subscription.
|
|
91
|
+
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
list:{entitlement_override:EntitlementOverride}[];
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @description Retrieve the list of entitlement overrides for a subscription.
|
|
98
|
+
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
next_offset?:string;
|
|
21
102
|
}
|
|
22
103
|
export interface ListEntitlementOverrideForSubscriptionInputParam {
|
|
23
|
-
[key : string]: any;
|
|
104
|
+
[key : string]: any;
|
|
105
|
+
/**
|
|
106
|
+
* @description The number of resources to be returned.
|
|
107
|
+
|
|
108
|
+
*/
|
|
109
|
+
|
|
24
110
|
limit?:number;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
|
|
114
|
+
|
|
115
|
+
*/
|
|
116
|
+
|
|
25
117
|
offset?:string;
|
|
26
118
|
}
|
|
27
|
-
export interface AddEntitlementOverrideForSubscriptionResponse {
|
|
28
|
-
|
|
119
|
+
export interface AddEntitlementOverrideForSubscriptionResponse {
|
|
120
|
+
entitlement_override:EntitlementOverride;
|
|
29
121
|
}
|
|
30
122
|
export interface AddEntitlementOverrideForSubscriptionInputParam {
|
|
123
|
+
|
|
31
124
|
action?:Action;
|
|
125
|
+
|
|
32
126
|
entitlement_overrides?:{expires_at?:number,feature_id:string,value?:string}[];
|
|
33
127
|
}
|
|
34
128
|
|