chargebee 2.40.0 → 3.0.0-beta.1
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 +10 -1
- package/LICENSE +1 -1
- package/README.md +90 -172
- package/cjs/RequestWrapper.js +81 -0
- package/cjs/asyncApiSupport.js +39 -0
- package/cjs/chargebee.cjs.js +13 -0
- package/cjs/chargebee.cjs.worker.js +9 -0
- package/cjs/chargebeeError.js +17 -0
- package/cjs/coreCommon.js +72 -0
- package/cjs/createChargebee.js +92 -0
- package/cjs/environment.js +18 -0
- package/cjs/filter.js +1 -0
- package/cjs/net/ClientInterface.js +40 -0
- package/cjs/net/FetchClient.js +86 -0
- package/cjs/net/NodeClient.js +61 -0
- package/cjs/package.json +1 -0
- package/cjs/resources/api_endpoints.js +1086 -0
- package/cjs/util.js +218 -0
- package/esm/RequestWrapper.js +77 -0
- package/esm/asyncApiSupport.js +35 -0
- package/esm/chargebee.esm.js +9 -0
- package/esm/chargebee.esm.worker.js +5 -0
- package/esm/chargebeeError.js +13 -0
- package/esm/coreCommon.js +67 -0
- package/esm/createChargebee.js +88 -0
- package/esm/environment.js +15 -0
- package/esm/filter.js +1 -0
- package/esm/net/ClientInterface.js +35 -0
- package/esm/net/FetchClient.js +81 -0
- package/esm/net/NodeClient.js +56 -0
- package/esm/package.json +1 -0
- package/esm/resources/api_endpoints.js +1083 -0
- package/esm/util.js +202 -0
- package/package.json +69 -38
- package/types/core.d.ts +558 -89
- package/types/index.d.ts +91 -54
- package/types/resources/Address.d.ts +57 -272
- package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
- package/types/resources/AttachedItem.d.ts +91 -329
- package/types/resources/Attribute.d.ts +5 -5
- package/types/resources/BusinessEntity.d.ts +49 -69
- package/types/resources/BusinessEntityTransfer.d.ts +11 -17
- package/types/resources/Card.d.ts +146 -424
- package/types/resources/Comment.d.ts +72 -189
- package/types/resources/Contact.d.ts +12 -64
- package/types/resources/ContractTerm.d.ts +15 -96
- package/types/resources/Coupon.d.ts +282 -758
- package/types/resources/CouponCode.d.ts +56 -52
- package/types/resources/CouponSet.d.ts +92 -234
- package/types/resources/CreditNote.d.ts +588 -1758
- package/types/resources/CreditNoteEstimate.d.ts +131 -157
- package/types/resources/Currency.d.ts +75 -62
- package/types/resources/Customer.d.ts +892 -835
- package/types/resources/CustomerEntitlement.d.ts +36 -0
- package/types/resources/DifferentialPrice.d.ts +116 -314
- package/types/resources/Discount.d.ts +20 -125
- package/types/resources/Download.d.ts +6 -22
- package/types/resources/Entitlement.d.ts +51 -160
- package/types/resources/EntitlementOverride.d.ts +58 -139
- package/types/resources/Estimate.d.ts +1178 -527
- package/types/resources/Event.d.ts +67 -178
- package/types/resources/Export.d.ts +563 -723
- package/types/resources/Feature.d.ts +117 -433
- package/types/resources/GatewayErrorDetail.d.ts +16 -72
- package/types/resources/Gift.d.ts +265 -432
- package/types/resources/Hierarchy.d.ts +8 -36
- package/types/resources/HostedPage.d.ts +1017 -1153
- package/types/resources/ImpactedItem.d.ts +13 -50
- package/types/resources/ImpactedItemPrice.d.ts +13 -15
- package/types/resources/ImpactedSubscription.d.ts +13 -45
- package/types/resources/InAppSubscription.d.ts +93 -389
- package/types/resources/Installment.d.ts +35 -110
- package/types/resources/InstallmentConfig.d.ts +54 -155
- package/types/resources/InstallmentDetail.d.ts +19 -27
- package/types/resources/Invoice.d.ts +1574 -3157
- package/types/resources/InvoiceEstimate.d.ts +131 -161
- package/types/resources/Item.d.ts +133 -611
- package/types/resources/ItemEntitlement.d.ts +78 -215
- package/types/resources/ItemFamily.d.ts +69 -178
- package/types/resources/ItemPrice.d.ts +291 -1203
- package/types/resources/Metadata.d.ts +3 -5
- package/types/resources/Order.d.ts +538 -1471
- package/types/resources/PaymentIntent.d.ts +163 -347
- package/types/resources/PaymentReferenceNumber.d.ts +7 -29
- package/types/resources/PaymentSource.d.ts +476 -1272
- package/types/resources/PaymentVoucher.d.ts +87 -306
- package/types/resources/PortalSession.d.ts +71 -207
- package/types/resources/PriceVariant.d.ts +91 -279
- package/types/resources/PricingPageSession.d.ts +92 -41
- package/types/resources/PromotionalCredit.d.ts +90 -346
- package/types/resources/Purchase.d.ts +185 -315
- package/types/resources/Quote.d.ts +1406 -887
- package/types/resources/QuoteLineGroup.d.ts +125 -452
- package/types/resources/QuotedCharge.d.ts +45 -274
- package/types/resources/QuotedSubscription.d.ts +100 -488
- package/types/resources/Ramp.d.ts +233 -724
- package/types/resources/ResourceMigration.d.ts +25 -80
- package/types/resources/SiteMigrationDetail.d.ts +34 -112
- package/types/resources/Subscription.d.ts +2390 -4335
- package/types/resources/SubscriptionEntitlement.d.ts +59 -160
- package/types/resources/SubscriptionEstimate.d.ts +51 -75
- package/types/resources/TaxWithheld.d.ts +15 -40
- package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
- package/types/resources/TimeMachine.d.ts +43 -97
- package/types/resources/Token.d.ts +15 -85
- package/types/resources/Transaction.d.ts +278 -900
- package/types/resources/UnbilledCharge.d.ts +189 -164
- package/types/resources/Usage.d.ts +89 -279
- package/types/resources/VirtualBankAccount.d.ts +103 -255
- package/types/resources/filter.d.ts +52 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
- package/.github/ISSUE_TEMPLATE/config.yml +0 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/lib/chargebee.js +0 -512
- package/lib/resources/api_endpoints.js +0 -2912
- package/types/resources/NonSubscription.d.ts +0 -30
- package/types/resources/Session.d.ts +0 -41
|
@@ -1,285 +1,56 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
2
4
|
declare module 'chargebee' {
|
|
3
5
|
export interface QuotedCharge {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
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
|
-
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
invoice_items?:QuotedCharge.ItemPrice[];
|
|
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.
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
item_tiers?:QuotedCharge.ItemTier[];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description List of coupons for this charge
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
coupons?:QuotedCharge.Coupon[];
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description List of discounts for the charges in this quote.
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
discounts?:QuotedCharge.Discount[];
|
|
6
|
+
charges?: QuotedCharge.Charge[];
|
|
7
|
+
addons?: QuotedCharge.Addon[];
|
|
8
|
+
invoice_items?: QuotedCharge.InvoiceItem[];
|
|
9
|
+
item_tiers?: QuotedCharge.ItemTier[];
|
|
10
|
+
coupons?: QuotedCharge.Coupon[];
|
|
39
11
|
}
|
|
40
|
-
export namespace QuotedCharge {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
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
|
-
amount?:number;
|
|
50
|
-
|
|
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
|
-
amount_in_decimal?:string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @description Description for this charge
|
|
60
|
-
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
description?:string;
|
|
64
|
-
|
|
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
|
-
service_period_in_days?:number;
|
|
71
|
-
|
|
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
12
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
avalara_transaction_type?:number;
|
|
85
|
-
|
|
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
|
-
avalara_service_type?:number;
|
|
13
|
+
export namespace QuotedCharge {
|
|
14
|
+
export interface Charge {
|
|
15
|
+
amount?: number;
|
|
16
|
+
amount_in_decimal?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
service_period_in_days?: number;
|
|
19
|
+
avalara_sale_type?: 'wholesale' | 'retail' | 'consumed' | 'vendor_use';
|
|
20
|
+
avalara_transaction_type?: number;
|
|
21
|
+
avalara_service_type?: number;
|
|
92
22
|
}
|
|
93
|
-
export interface
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @description Item price quantity
|
|
103
|
-
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
quantity?:number;
|
|
107
|
-
|
|
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
|
-
*/
|
|
112
|
-
|
|
113
|
-
quantity_in_decimal?:string;
|
|
114
|
-
|
|
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
|
-
*/
|
|
119
|
-
|
|
120
|
-
unit_price?:number;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* @description The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
124
|
-
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
|
-
unit_price_in_decimal?:string;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @description Defines service period of the item in days from the day of charge.
|
|
131
|
-
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
service_period_days?:number;
|
|
23
|
+
export interface Addon {
|
|
24
|
+
id: string;
|
|
25
|
+
quantity?: number;
|
|
26
|
+
unit_price?: number;
|
|
27
|
+
quantity_in_decimal?: string;
|
|
28
|
+
unit_price_in_decimal?: string;
|
|
29
|
+
proration_type?: 'full_term' | 'partial_term' | 'none';
|
|
30
|
+
service_period?: number;
|
|
135
31
|
}
|
|
136
|
-
export interface
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @description The lowest value in the quantity tier.
|
|
146
|
-
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
starting_unit:number;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* @description The highest value in the quantity tier.
|
|
153
|
-
|
|
154
|
-
*/
|
|
155
|
-
|
|
156
|
-
ending_unit?:number;
|
|
157
|
-
|
|
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
|
-
price:number;
|
|
164
|
-
|
|
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
|
-
starting_unit_in_decimal?:string;
|
|
171
|
-
|
|
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
|
-
ending_unit_in_decimal?:string;
|
|
178
|
-
|
|
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
|
-
price_in_decimal?:string;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* @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.
|
|
188
|
-
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
index:number;
|
|
32
|
+
export interface InvoiceItem {
|
|
33
|
+
item_price_id: string;
|
|
34
|
+
quantity?: number;
|
|
35
|
+
quantity_in_decimal?: string;
|
|
36
|
+
unit_price?: number;
|
|
37
|
+
unit_price_in_decimal?: string;
|
|
38
|
+
service_period_days?: number;
|
|
192
39
|
}
|
|
193
|
-
export interface
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
40
|
+
export interface ItemTier {
|
|
41
|
+
item_price_id: string;
|
|
42
|
+
starting_unit: number;
|
|
43
|
+
ending_unit?: number;
|
|
44
|
+
price: number;
|
|
45
|
+
starting_unit_in_decimal?: string;
|
|
46
|
+
ending_unit_in_decimal?: string;
|
|
47
|
+
price_in_decimal?: string;
|
|
48
|
+
index: number;
|
|
200
49
|
}
|
|
201
|
-
export interface
|
|
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;
|
|
50
|
+
export interface Coupon {
|
|
51
|
+
coupon_id: string;
|
|
283
52
|
}
|
|
53
|
+
// REQUEST PARAMS
|
|
54
|
+
//---------------
|
|
284
55
|
}
|
|
285
|
-
}
|
|
56
|
+
}
|