chargebee 2.47.0 → 2.49.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 +149 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +16 -2
- package/package.json +1 -1
- package/types/core.d.ts +5 -4
- package/types/index.d.ts +6 -0
- package/types/resources/Addon.d.ts +440 -0
- package/types/resources/CreditNote.d.ts +40 -1
- package/types/resources/CreditNoteEstimate.d.ts +8 -2
- package/types/resources/DifferentialPrice.d.ts +6 -2
- package/types/resources/Estimate.d.ts +6 -4
- package/types/resources/HostedPage.d.ts +227 -893
- package/types/resources/Invoice.d.ts +44 -5
- package/types/resources/InvoiceEstimate.d.ts +40 -1
- package/types/resources/Item.d.ts +4 -0
- package/types/resources/ItemPrice.d.ts +6 -2
- package/types/resources/OmnichannelSubscription.d.ts +5 -5
- package/types/resources/OmnichannelSubscriptionItem.d.ts +42 -1
- package/types/resources/OmnichannelSubscriptionItemScheduledChange.d.ts +36 -0
- package/types/resources/OmnichannelTransaction.d.ts +4 -4
- package/types/resources/PaymentSource.d.ts +7 -0
- package/types/resources/Plan.d.ts +554 -0
- package/types/resources/Purchase.d.ts +13 -258
- package/types/resources/Quote.d.ts +18 -12
- package/types/resources/QuoteLineGroup.d.ts +12 -322
- package/types/resources/QuotedCharge.d.ts +23 -219
- package/types/resources/QuotedSubscription.d.ts +4 -0
- package/types/resources/Ramp.d.ts +48 -542
- package/types/resources/RecordedPurchase.d.ts +5 -3
- package/types/resources/Subscription.d.ts +7 -3
- package/types/resources/Transaction.d.ts +1 -1
- package/types/resources/UnbilledCharge.d.ts +31 -25
|
@@ -1,285 +1,89 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface QuotedCharge {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description Provides details of all the ad-hoc charges [added to the quote](/docs/api/quotes?prod_cat_ver=2#create_a_quote_for_charge_and_charge_items).
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
charges?:QuotedCharge.Charge[];
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description Details of individual [item prices](/docs/api/item_prices?prod_cat_ver=2) that are part of this subscription
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
invoice_items?:QuotedCharge.
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description The pricing details of `subscription_items` which have `pricing_model` as `tiered`, `volume` or `stairstep`. [Learn more](https://www.chargebee.com/docs/plans.html#pricing-models) about pricing models.
|
|
9
|
+
addons?:QuotedCharge.Addon[];
|
|
10
|
+
|
|
11
|
+
invoice_items?:QuotedCharge.InvoiceItem[];
|
|
21
12
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
13
|
item_tiers?:QuotedCharge.ItemTier[];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description List of coupons for this charge
|
|
28
14
|
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
15
|
coupons?:QuotedCharge.Coupon[];
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description List of discounts for the charges in this quote.
|
|
35
16
|
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
discounts?:QuotedCharge.Discount[];
|
|
39
17
|
}
|
|
40
18
|
export namespace QuotedCharge {
|
|
41
19
|
|
|
42
20
|
|
|
43
21
|
export interface Charge {
|
|
44
|
-
/**
|
|
45
|
-
* @description The amount to be charged. The unit depends on the [type of currency](/docs/api?prod_cat_ver=1#md_disabled).
|
|
46
|
-
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
22
|
amount?:number;
|
|
50
23
|
|
|
51
|
-
/**
|
|
52
|
-
* @description The decimal representation of the amount for the one-time charge. The value is in [major units of the currency](/docs/api#md_enabled). Applicable only when multi-decimal pricing is enabled.
|
|
53
|
-
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
24
|
amount_in_decimal?:string;
|
|
57
25
|
|
|
58
|
-
/**
|
|
59
|
-
* @description Description for this charge
|
|
60
|
-
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
26
|
description?:string;
|
|
64
27
|
|
|
65
|
-
/**
|
|
66
|
-
* @description Specifies the service period of the charge in days. When the quote is converted, the [invoice.line_item.date_from](/docs/api/invoices#invoice_line_items) is set to current date/time and `invoice.line_item.date_to` is set to `service_period_in_days` ahead of `date_from`.
|
|
67
|
-
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
28
|
service_period_in_days?:number;
|
|
71
29
|
|
|
72
|
-
|
|
73
|
-
* @description Indicates the type of sale carried out. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. \* wholesale - Transaction is a sale to another company that will resell your product or service to another consumer \* retail - Transaction is a sale to an end user \* consumed - Transaction is for an item that is consumed directly \* vendor_use - Transaction is for an item that is subject to vendor use tax
|
|
74
|
-
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
avalara_sale_type?:'consumed' | 'wholesale' | 'vendor_use' | 'retail';
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @description Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
81
|
-
|
|
82
|
-
*/
|
|
30
|
+
avalara_sale_type?:'wholesale' | 'retail' | 'consumed' | 'vendor_use';
|
|
83
31
|
|
|
84
32
|
avalara_transaction_type?:number;
|
|
85
33
|
|
|
86
|
-
/**
|
|
87
|
-
* @description Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
88
|
-
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
34
|
avalara_service_type?:number;
|
|
92
35
|
}
|
|
93
|
-
export interface
|
|
94
|
-
|
|
95
|
-
* @description A unique ID for your system to identify the item price.
|
|
96
|
-
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
item_price_id:string;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @description Item price quantity
|
|
103
|
-
|
|
104
|
-
*/
|
|
36
|
+
export interface Addon {
|
|
37
|
+
id:string;
|
|
105
38
|
|
|
106
39
|
quantity?:number;
|
|
107
40
|
|
|
108
|
-
|
|
109
|
-
* @description The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
110
|
-
|
|
111
|
-
*/
|
|
41
|
+
unit_price?:number;
|
|
112
42
|
|
|
113
43
|
quantity_in_decimal?:string;
|
|
114
44
|
|
|
115
|
-
|
|
116
|
-
* @description The price or per-unit-price of the item price. By default, it is the [value set](/docs/api/item_prices#item_price_price) for the `item_price`. This is only applicable when the `pricing_model` of the `item_price` is `flat_fee` or `per_unit`. The value depends on the [type of currency](/docs/api/#handling_currency_units).
|
|
117
|
-
|
|
118
|
-
*/
|
|
45
|
+
unit_price_in_decimal?:string;
|
|
119
46
|
|
|
120
|
-
|
|
47
|
+
proration_type?:'full_term' | 'partial_term' | 'none';
|
|
121
48
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
49
|
+
service_period?:number;
|
|
50
|
+
}
|
|
51
|
+
export interface InvoiceItem {
|
|
52
|
+
item_price_id:string;
|
|
126
53
|
|
|
127
|
-
|
|
54
|
+
quantity?:number;
|
|
128
55
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
56
|
+
quantity_in_decimal?:string;
|
|
57
|
+
|
|
58
|
+
unit_price?:number;
|
|
59
|
+
|
|
60
|
+
unit_price_in_decimal?:string;
|
|
133
61
|
|
|
134
62
|
service_period_days?:number;
|
|
135
63
|
}
|
|
136
64
|
export interface ItemTier {
|
|
137
|
-
/**
|
|
138
|
-
* @description The id of the item price to which this tier belongs.
|
|
139
|
-
|
|
140
|
-
*/
|
|
141
|
-
|
|
142
65
|
item_price_id:string;
|
|
143
66
|
|
|
144
|
-
/**
|
|
145
|
-
* @description The lowest value in the quantity tier.
|
|
146
|
-
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
67
|
starting_unit:number;
|
|
150
68
|
|
|
151
|
-
/**
|
|
152
|
-
* @description The highest value in the quantity tier.
|
|
153
|
-
|
|
154
|
-
*/
|
|
155
|
-
|
|
156
69
|
ending_unit?:number;
|
|
157
70
|
|
|
158
|
-
/**
|
|
159
|
-
* @description The per-unit price for the tier when the `pricing_model` is `tiered` or `volume`. The total cost for the item price when the `pricing_model` is `stairstep`. The value is in the minor unit of the currency.
|
|
160
|
-
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
71
|
price:number;
|
|
164
72
|
|
|
165
|
-
/**
|
|
166
|
-
* @description The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as `ending_unit_in_decimal` of the next lower tier. Returned only when the pricing_model is `tiered`, `volume` or `stairstep` and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
167
|
-
|
|
168
|
-
*/
|
|
169
|
-
|
|
170
73
|
starting_unit_in_decimal?:string;
|
|
171
74
|
|
|
172
|
-
/**
|
|
173
|
-
* @description The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the `starting_unit_in_decimal` of the next higher tier. Returned only when the pricing_model is `tiered`, `volume` or `stairstep` and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
174
|
-
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
75
|
ending_unit_in_decimal?:string;
|
|
178
76
|
|
|
179
|
-
/**
|
|
180
|
-
* @description The decimal representation of the per-unit price for the tier when the `pricing_model` is `tiered` or `volume`. When the `pricing_model` is `stairstep`, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
181
|
-
|
|
182
|
-
*/
|
|
183
|
-
|
|
184
77
|
price_in_decimal?:string;
|
|
185
78
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*/
|
|
79
|
+
pricing_type?:'per_unit' | 'flat_fee' | 'package';
|
|
80
|
+
|
|
81
|
+
package_size?:number;
|
|
190
82
|
|
|
191
83
|
index:number;
|
|
192
84
|
}
|
|
193
85
|
export interface Coupon {
|
|
194
|
-
/**
|
|
195
|
-
* @description Used to uniquely identify the coupon
|
|
196
|
-
|
|
197
|
-
*/
|
|
198
|
-
|
|
199
86
|
coupon_id:string;
|
|
200
87
|
}
|
|
201
|
-
export interface Discount {
|
|
202
|
-
/**
|
|
203
|
-
* @description An immutable unique id for the discount. It is always auto-generated.
|
|
204
|
-
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
id:string;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* @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`.
|
|
211
|
-
|
|
212
|
-
*/
|
|
213
|
-
|
|
214
|
-
invoice_name?:string;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* @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.
|
|
218
|
-
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
type:'fixed_amount' | 'percentage';
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* @description The percentage of the original amount that should be deducted from it. Only applicable when `discount.type` is percentage.
|
|
225
|
-
|
|
226
|
-
*/
|
|
227
|
-
|
|
228
|
-
percentage?:number;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @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`.
|
|
232
|
-
|
|
233
|
-
*/
|
|
234
|
-
|
|
235
|
-
amount?:number;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* @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`.
|
|
239
|
-
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
currency_code?:string;
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* @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`.
|
|
246
|
-
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
apply_on:'specific_item_price' | 'invoice_amount';
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* @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`.
|
|
253
|
-
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
|
-
item_price_id?:string;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* @description Timestamp indicating when this discount is created.
|
|
260
|
-
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
created_at:number;
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
267
|
-
**Note:**
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
271
|
-
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
272
|
-
|
|
273
|
-
*/
|
|
274
|
-
|
|
275
|
-
coupon_id:string;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* @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.
|
|
279
|
-
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
|
-
index:number;
|
|
283
|
-
}
|
|
284
88
|
}
|
|
285
89
|
}
|