chargebee 2.33.1 → 2.34.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 +53 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +55 -0
- package/package.json +1 -1
- package/types/core.d.ts +5 -5
- package/types/index.d.ts +6 -0
- package/types/resources/Attribute.d.ts +9 -0
- package/types/resources/Customer.d.ts +2 -2
- package/types/resources/Estimate.d.ts +304 -1
- package/types/resources/Export.d.ts +1 -1
- package/types/resources/Gift.d.ts +87 -1
- package/types/resources/ImpactedItemPrice.d.ts +22 -0
- package/types/resources/Installment.d.ts +121 -0
- package/types/resources/InstallmentConfig.d.ts +162 -0
- package/types/resources/Invoice.d.ts +200 -1
- package/types/resources/ItemPrice.d.ts +0 -7
- package/types/resources/PaymentIntent.d.ts +4 -4
- package/types/resources/PaymentSource.d.ts +2 -2
- package/types/resources/Purchase.d.ts +91 -5
- package/types/resources/Subscription.d.ts +1252 -209
- package/types/resources/Transaction.d.ts +1 -1
|
@@ -56,7 +56,7 @@ declare module 'chargebee' {
|
|
|
56
56
|
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
|
-
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
59
|
+
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* @description The URL the customer will be directed to once 3DS verification is successful. Applicable only when `payment_method_type` is `ideal`, `sofort`, `dotpay` or `giropay`.
|
|
@@ -226,7 +226,7 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
226
226
|
|
|
227
227
|
*/
|
|
228
228
|
|
|
229
|
-
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
229
|
+
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
232
|
* @description The URL the customer will be directed to once 3DS verification is successful. Applicable only when `payment_method_type` is `ideal`, `sofort`, `dotpay` or `giropay`.
|
|
@@ -273,7 +273,7 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
273
273
|
|
|
274
274
|
*/
|
|
275
275
|
|
|
276
|
-
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
276
|
+
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
277
277
|
|
|
278
278
|
/**
|
|
279
279
|
* @description The URL the customer will be directed to once 3DS verification is successful. Applicable only when `payment_method_type` is `ideal`, `sofort`, `dotpay` or `giropay`.
|
|
@@ -313,7 +313,7 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
313
313
|
|
|
314
314
|
*/
|
|
315
315
|
|
|
316
|
-
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
316
|
+
payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card';
|
|
317
317
|
|
|
318
318
|
/**
|
|
319
319
|
* @description Reference of PaymentIntent at gateway
|
|
@@ -646,7 +646,7 @@ Currently, the `skip_retrieval` value as `true` is only supp
|
|
|
646
646
|
|
|
647
647
|
*/
|
|
648
648
|
|
|
649
|
-
payment_intent?:{additional_info?:object,additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
649
|
+
payment_intent?:{additional_info?:object,additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
650
650
|
}
|
|
651
651
|
export interface CreateVoucherPaymentSourceResponse {
|
|
652
652
|
customer:Customer;
|
|
@@ -847,7 +847,7 @@ Currently, the `skip_retrieval` value as `true` is only supp
|
|
|
847
847
|
|
|
848
848
|
*/
|
|
849
849
|
|
|
850
|
-
type?:{in?:string,is?:'giropay' | 'alipay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'unionpay' | 'direct_debit' | 'faster_payments' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'venmo' | 'apple_pay' | 'bancontact' | 'automated_bank_transfer' | 'paypal_express_checkout' | 'wechat_pay' | 'pay_to' | 'card',is_not?:'giropay' | 'alipay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'unionpay' | 'direct_debit' | 'faster_payments' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'venmo' | 'apple_pay' | 'bancontact' | 'automated_bank_transfer' | 'paypal_express_checkout' | 'wechat_pay' | 'pay_to' | 'card',not_in?:string};
|
|
850
|
+
type?:{in?:string,is?:'giropay' | 'alipay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'unionpay' | 'direct_debit' | 'faster_payments' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'venmo' | 'apple_pay' | 'bancontact' | 'automated_bank_transfer' | 'paypal_express_checkout' | 'wechat_pay' | 'pay_to' | 'card',is_not?:'giropay' | 'alipay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'unionpay' | 'direct_debit' | 'faster_payments' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'venmo' | 'apple_pay' | 'bancontact' | 'automated_bank_transfer' | 'paypal_express_checkout' | 'wechat_pay' | 'pay_to' | 'card',not_in?:string};
|
|
851
851
|
|
|
852
852
|
/**
|
|
853
853
|
* @description Lists all the payment sources
|
|
@@ -73,7 +73,7 @@ The following subsections describe the types of groups in detail.
|
|
|
73
73
|
|
|
74
74
|
You can specify up to 10 groups,
|
|
75
75
|
|
|
76
|
-
* with a recommended subscription group of 5. To increase this limit to a maximum of 8, contact
|
|
76
|
+
* with a recommended subscription group of 5. To increase this limit to a maximum of 8, contact eap@chargebee.com.
|
|
77
77
|
* with a maximum of 10 one-time charge groups by default.
|
|
78
78
|
|
|
79
79
|
The total limit for group items for a single purchase is 60.
|
|
@@ -83,7 +83,7 @@ The total limit for group items for a single purchase is 60.
|
|
|
83
83
|
To create a subscription, specify a *subscription group* . A subscription [group](#groups) is a group of item prices that contains exactly one item price of `type` `plan`. To create multiple subscriptions, provide multiple subscription groups.
|
|
84
84
|
**Note**
|
|
85
85
|
|
|
86
|
-
A subscription group can have up to 20 non-plan item prices. To increase this limit to a maximum of 60, contact
|
|
86
|
+
A subscription group can have up to 20 non-plan item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
|
|
87
87
|
|
|
88
88
|
#### Custom Fields {#custom-fields}
|
|
89
89
|
|
|
@@ -94,7 +94,7 @@ Purchase API supports custom fields of Subscriptions, use the following format t
|
|
|
94
94
|
A one-time charge [group](#groups) is a group of charge item prices (i.e. item prices belonging to items of `type` `charge`). Charge item prices can be added to subscription groups as well. The charges within and across each one-time group must be unique.
|
|
95
95
|
**Note**
|
|
96
96
|
|
|
97
|
-
* A one-time charge group can have up to 20 item prices. To increase this limit to a maximum of 60, contact
|
|
97
|
+
* A one-time charge group can have up to 20 item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
|
|
98
98
|
* A charge item price can only be added to a single one-time charge group. However, it can be part of multiple [subscription groups](#subscription).
|
|
99
99
|
|
|
100
100
|
### Applying discounts {#discounts}
|
|
@@ -130,6 +130,13 @@ Discounts, both [manual discounts](discounts) and <coupons>, can be applie
|
|
|
130
130
|
|
|
131
131
|
customer_id:string;
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* @description Payment source attached to this purchase. If present, the customer's payment sources won't be used to collect any payment for this purchase.
|
|
135
|
+
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
payment_source_id?:string;
|
|
139
|
+
|
|
133
140
|
/**
|
|
134
141
|
* @description Parameters for invoice_info
|
|
135
142
|
|
|
@@ -137,6 +144,13 @@ Discounts, both [manual discounts](discounts) and <coupons>, can be applie
|
|
|
137
144
|
|
|
138
145
|
invoice_info?:{notes?:string,po_number?:string};
|
|
139
146
|
|
|
147
|
+
/**
|
|
148
|
+
* @description Parameters for installment_info
|
|
149
|
+
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
installment_info?:{amount?:number,config_id?:string};
|
|
153
|
+
|
|
140
154
|
/**
|
|
141
155
|
* @description Parameters for purchase_items
|
|
142
156
|
|
|
@@ -170,7 +184,72 @@ Discounts, both [manual discounts](discounts) and <coupons>, can be applie
|
|
|
170
184
|
|
|
171
185
|
*/
|
|
172
186
|
|
|
173
|
-
subscription_info:{billing_cycles?:number,index:number,meta_data?:object,subscription_id?:string}[];
|
|
187
|
+
subscription_info:{billing_cycles?:number,contract_term_billing_cycle_on_renewal?:number,index:number,meta_data?:object,subscription_id?:string}[];
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @description Creates a `purchase` resource. A purchase can contain one or more of the following:
|
|
191
|
+
|
|
192
|
+
* subscriptions (a [subscription](subscriptions) resource consists of item prices such that at least one of the item prices belongs to an [item](items) of `type` `plan`.)
|
|
193
|
+
* group of one-time charges (aka [charge item prices](item_prices#types))
|
|
194
|
+
|
|
195
|
+
When you call this API, the invoices for the subscription(s) and one-time charge(s) are created immediately and not left [unbilled](subscriptions?prod_cat_ver=2#create_subscription_for_items_invoice_immediately).
|
|
196
|
+
**Note**
|
|
197
|
+
|
|
198
|
+
Providing `shipping_addresses[]` is required when the [Orders feature](https://www.chargebee.com/docs/2.0/orders.html#configuration_step-1-configure-site-wide-settings) has been enabled.
|
|
199
|
+
|
|
200
|
+
### Specifying `purchase_item` groups {#groups}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
When creating a purchase, you must specify the *group* or `index` to which each item price belongs. You can do this by setting the `purchase_items[index]` for each item price. Item prices with the same `purchase_items[index]` belong to the same group.
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
The grouping of item prices allows you to specify the `discounts[]` applicable for each group and indicate which item prices should be added to any subscriptions you want to create. Groups can be one of two types:
|
|
207
|
+
|
|
208
|
+
* Subscription groups
|
|
209
|
+
* One-time charge groups
|
|
210
|
+
|
|
211
|
+
The following subsections describe the types of groups in detail.
|
|
212
|
+
**Note**
|
|
213
|
+
|
|
214
|
+
You can specify up to 10 groups,
|
|
215
|
+
|
|
216
|
+
* with a recommended subscription group of 5. To increase this limit to a maximum of 8, contact eap@chargebee.com.
|
|
217
|
+
* with a maximum of 10 one-time charge groups by default.
|
|
218
|
+
|
|
219
|
+
The total limit for group items for a single purchase is 60.
|
|
220
|
+
|
|
221
|
+
#### Subscription groups {#subscription}
|
|
222
|
+
|
|
223
|
+
To create a subscription, specify a *subscription group* . A subscription [group](#groups) is a group of item prices that contains exactly one item price of `type` `plan`. To create multiple subscriptions, provide multiple subscription groups.
|
|
224
|
+
**Note**
|
|
225
|
+
|
|
226
|
+
A subscription group can have up to 20 non-plan item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
|
|
227
|
+
|
|
228
|
+
#### Custom Fields {#custom-fields}
|
|
229
|
+
|
|
230
|
+
Purchase API supports custom fields of Subscriptions, use the following format to specify custom fields in Purchase API: **`subscription_info[custom_field]`**.
|
|
231
|
+
|
|
232
|
+
#### One-time charge groups {#one-time}
|
|
233
|
+
|
|
234
|
+
A one-time charge [group](#groups) is a group of charge item prices (i.e. item prices belonging to items of `type` `charge`). Charge item prices can be added to subscription groups as well. The charges within and across each one-time group must be unique.
|
|
235
|
+
**Note**
|
|
236
|
+
|
|
237
|
+
* A one-time charge group can have up to 20 item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
|
|
238
|
+
* A charge item price can only be added to a single one-time charge group. However, it can be part of multiple [subscription groups](#subscription).
|
|
239
|
+
|
|
240
|
+
### Applying discounts {#discounts}
|
|
241
|
+
|
|
242
|
+
Discounts, both [manual discounts](discounts) and <coupons>, can be applied to groups by specifying the `discounts[]` array. The following table describes the method of application based on whether `discounts[index][i]` is provided:
|
|
243
|
+
|
|
244
|
+
| | **`discounts[index][i]` is provided** | **`discounts[index][i]` is not provided** |
|
|
245
|
+
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
246
|
+
| **Coupons** | * The coupon is applied exclusively to the invoice for group `i`. * The coupon is applied exclusively to the invoice created immediately upon invoking this API. * If group `i` is a [subscription group](#subscription), then the coupon is applied to invoices for subscription renewals based on coupon attributes such as `duration_type` and `max_redemptions`. | * The coupon is applied to all the invoices immediately generated upon invoking this API. * The coupon is not applied to subsequent invoices, such as those generated upon subscription renewal. |
|
|
247
|
+
| **Manual discounts** | * The manual discount is applied exclusively to the invoice for group `i`. * The manual discount is applied exclusively to the invoice created immediately upon invoking this API. * The manual discount is not applied to subsequent invoices, such as those generated upon subscription renewal. | * The manual discount is applied to all the invoices immediately generated upon invoking this API. * The manual discount is not applied to subsequent invoices, such as those generated upon subscription renewal. |
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
contract_terms:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number,index:number}[];
|
|
174
253
|
}
|
|
175
254
|
export interface EstimateResponse {
|
|
176
255
|
estimate:Estimate;
|
|
@@ -238,7 +317,14 @@ Discounts, both [manual discounts](discounts) and <coupons>, can be applie
|
|
|
238
317
|
|
|
239
318
|
*/
|
|
240
319
|
|
|
241
|
-
subscription_info:{billing_cycles?:number,index:number,subscription_id?:string}[];
|
|
320
|
+
subscription_info:{billing_cycles?:number,contract_term_billing_cycle_on_renewal?:number,index:number,subscription_id?:string}[];
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @description Returns an estimate for creating a `purchase` resource. The operation works exactly like [Create a purchase](purchases#create_a_purchase), except that only an [estimate](estimates) resource is returned without an actual `purchase` resource being created.
|
|
324
|
+
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
contract_terms:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number,index:number}[];
|
|
242
328
|
}
|
|
243
329
|
|
|
244
330
|
}
|