chargebee 2.51.0 → 2.53.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 +83 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +103 -5
- package/package.json +1 -1
- package/types/core.d.ts +6 -6
- package/types/index.d.ts +10 -0
- package/types/resources/Addon.d.ts +3 -3
- package/types/resources/Address.d.ts +2 -194
- package/types/resources/AdvanceInvoiceSchedule.d.ts +5 -67
- package/types/resources/AttachedItem.d.ts +1 -1
- package/types/resources/Attribute.d.ts +4 -1
- package/types/resources/BillingConfiguration.d.ts +21 -0
- package/types/resources/Brand.d.ts +12 -0
- package/types/resources/BusinessEntity.d.ts +10 -8
- package/types/resources/BusinessEntityTransfer.d.ts +10 -7
- package/types/resources/Card.d.ts +11 -311
- package/types/resources/Comment.d.ts +10 -125
- package/types/resources/Contact.d.ts +2 -44
- package/types/resources/ContractTerm.d.ts +4 -72
- package/types/resources/Coupon.d.ts +4 -41
- package/types/resources/CouponCode.d.ts +67 -35
- package/types/resources/CouponSet.d.ts +12 -121
- package/types/resources/CreditNote.d.ts +89 -95
- package/types/resources/Currency.d.ts +8 -5
- package/types/resources/Customer.d.ts +96 -95
- package/types/resources/CustomerEntitlement.d.ts +3 -1
- package/types/resources/DifferentialPrice.d.ts +1 -1
- package/types/resources/Discount.d.ts +5 -90
- package/types/resources/Download.d.ts +2 -14
- package/types/resources/Entitlement.d.ts +15 -103
- package/types/resources/EntitlementOverride.d.ts +4 -89
- package/types/resources/Estimate.d.ts +6 -14
- package/types/resources/Event.d.ts +24 -109
- package/types/resources/Export.d.ts +116 -432
- package/types/resources/Feature.d.ts +19 -321
- package/types/resources/GatewayErrorDetail.d.ts +6 -48
- package/types/resources/Gift.d.ts +34 -294
- package/types/resources/Hierarchy.d.ts +4 -24
- package/types/resources/HostedPage.d.ts +4 -4
- package/types/resources/ImpactedCustomer.d.ts +23 -0
- package/types/resources/ImpactedItem.d.ts +4 -36
- package/types/resources/ImpactedItemPrice.d.ts +5 -2
- package/types/resources/ImpactedSubscription.d.ts +3 -30
- package/types/resources/InAppSubscription.d.ts +13 -355
- package/types/resources/Invoice.d.ts +112 -126
- package/types/resources/InvoiceEstimate.d.ts +1 -1
- package/types/resources/Item.d.ts +4 -11
- package/types/resources/ItemEntitlement.d.ts +15 -155
- package/types/resources/ItemFamily.d.ts +3 -3
- package/types/resources/ItemPrice.d.ts +7 -7
- package/types/resources/NonSubscription.d.ts +9 -6
- package/types/resources/OmnichannelOneTimeOrder.d.ts +90 -0
- package/types/resources/OmnichannelOneTimeOrderItem.d.ts +24 -0
- package/types/resources/OmnichannelSubscription.d.ts +2 -2
- package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -1
- package/types/resources/OmnichannelSubscriptionItemScheduledChange.d.ts +1 -1
- package/types/resources/Order.d.ts +3 -3
- package/types/resources/PaymentIntent.d.ts +9 -255
- package/types/resources/PaymentReferenceNumber.d.ts +3 -20
- package/types/resources/PaymentSource.d.ts +4 -4
- package/types/resources/PaymentVoucher.d.ts +22 -205
- package/types/resources/Plan.d.ts +3 -3
- package/types/resources/PortalSession.d.ts +4 -146
- package/types/resources/PriceVariant.d.ts +2 -2
- package/types/resources/PricingPageSession.d.ts +2 -2
- package/types/resources/PromotionalCredit.d.ts +12 -215
- package/types/resources/Purchase.d.ts +5 -3
- package/types/resources/Quote.d.ts +32 -14
- package/types/resources/QuotedCharge.d.ts +7 -0
- package/types/resources/QuotedRamp.d.ts +11 -16
- package/types/resources/Ramp.d.ts +7 -7
- package/types/resources/RecordedPurchase.d.ts +8 -1
- package/types/resources/ResourceMigration.d.ts +2 -54
- package/types/resources/SiteMigrationDetail.d.ts +13 -55
- package/types/resources/Subscription.d.ts +33 -29
- package/types/resources/SubscriptionEntitlement.d.ts +6 -106
- package/types/resources/SubscriptionEntitlementsCreatedDetail.d.ts +12 -0
- package/types/resources/SubscriptionEntitlementsUpdatedDetail.d.ts +12 -0
- package/types/resources/SubscriptionEstimate.d.ts +14 -11
- package/types/resources/TaxWithheld.d.ts +14 -26
- package/types/resources/ThirdPartyPaymentMethod.d.ts +2 -19
- package/types/resources/TimeMachine.d.ts +3 -64
- package/types/resources/Token.d.ts +3 -60
- package/types/resources/Transaction.d.ts +8 -8
- package/types/resources/UnbilledCharge.d.ts +1 -1
- package/types/resources/Usage.d.ts +21 -165
- package/types/resources/UsageFile.d.ts +5 -5
- package/types/resources/VirtualBankAccount.d.ts +1 -1
- package/types/resources/WebhookEndpoint.d.ts +117 -0
|
@@ -1,68 +1,26 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface Contact {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description Unique reference ID provided for the contact.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description First name of the contact.
|
|
14
8
|
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
first_name?:string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description Last name of the contact.
|
|
21
10
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
11
|
last_name?:string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description Email of the contact.
|
|
28
12
|
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
13
|
email:string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description Phone number of the contact.
|
|
35
14
|
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
15
|
phone?:string;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description Label/Tag provided for contact.
|
|
42
16
|
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
17
|
label?:string;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description Contact enabled / disabled
|
|
49
18
|
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
19
|
enabled:boolean;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description Whether Account Emails option is enabled for the contact.
|
|
56
20
|
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
21
|
send_account_email:boolean;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @description Whether Billing Emails option is enabled for the contact.
|
|
63
22
|
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
23
|
send_billing_email:boolean;
|
|
24
|
+
|
|
67
25
|
}
|
|
68
26
|
}
|
|
@@ -1,100 +1,32 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface ContractTerm {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description Id that uniquely identifies the contract term in the site.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description Current status of contract \* active - An actively running contract term. \* cancelled - The contract term was ended because:
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
* the subscription was cancelled due to non-payment.
|
|
17
|
-
\* terminated - The contract term was terminated ahead of completion. \* completed - The contract term has run its full duration.
|
|
9
|
+
status:'active' | 'completed' | 'cancelled' | 'terminated';
|
|
18
10
|
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
status:'active' | 'cancelled' | 'completed' | 'terminated';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @description The start date of the contract term
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
11
|
contract_start:number;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @description The end date of the contract term
|
|
32
12
|
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
13
|
contract_end:number;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @description The number of billing cycles of the subscription that the contract term is for.
|
|
39
14
|
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
15
|
billing_cycle:number;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @description Action to be taken when the contract term completes. \* renew -
|
|
46
|
-
* Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
|
|
47
|
-
* The `action_at_term_end` for the new contract term is set to `renew`.
|
|
48
|
-
\* evergreen - Contract term completes and the subscription renews. \* renew_once - Used when you want to renew the contract term just once. Does the following:
|
|
49
|
-
* Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
|
|
50
|
-
* The `action_at_term_end` for the new contract term is set to `cancel`.
|
|
51
|
-
\* cancel - Contract term completes and subscription is canceled.
|
|
52
|
-
|
|
53
16
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
action_at_term_end:'cancel' | 'renew_once' | 'renew' | 'evergreen';
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @description The sum of the [totals](invoices#invoice_total) of all the invoices raised as part of the contract term. For `active` contract terms, this is a predicted value. The value depends on the [type of currency](./#handling_currency_units). If the subscription was [imported](#import_a_subscription) with the contract term, then this value includes the value passed for `total_amount_raised`.
|
|
17
|
+
action_at_term_end:'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
60
18
|
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
19
|
total_contract_value:number;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @description It refers to the total amount of revenue that is expected to be generated from a specific contract term, calculated as the sum of all invoices raised during the term, regardless of payment status. It is based on past performance and the specified currency in the contract. If the subscription was imported, the value for `total_amount_raised_before_tax` is included in the calculation of the total contract value before tax. It's important to note that this value excludes any applicable taxes.
|
|
67
20
|
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
21
|
total_contract_value_before_tax:number;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @description The number of days before [`contract_end`](contract_terms#contract_term_contract_end), during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
|
|
74
22
|
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
23
|
cancellation_cutoff_period?:number;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @description The date when the contract term was created.
|
|
81
24
|
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
25
|
created_at:number;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @description The [Id](subscriptions#subscription_id) of the subscription that this contract term is for.
|
|
88
26
|
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
27
|
subscription_id:string;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @description The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for `active` contract terms.
|
|
95
28
|
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
29
|
remaining_billing_cycles?:number;
|
|
30
|
+
|
|
99
31
|
}
|
|
100
32
|
}
|
|
@@ -148,7 +148,7 @@ declare module 'chargebee' {
|
|
|
148
148
|
coupon:Coupon;
|
|
149
149
|
}
|
|
150
150
|
export interface CreateForItemsInputParam {
|
|
151
|
-
|
|
151
|
+
|
|
152
152
|
item_constraints:{constraint:'none' | 'all' | 'specific' | 'criteria',item_price_ids?:any[],item_type:'plan' | 'addon' | 'charge'}[];
|
|
153
153
|
|
|
154
154
|
item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'plan' | 'addon' | 'charge'}[];
|
|
@@ -199,7 +199,7 @@ declare module 'chargebee' {
|
|
|
199
199
|
coupon:Coupon;
|
|
200
200
|
}
|
|
201
201
|
export interface UpdateForItemsInputParam {
|
|
202
|
-
|
|
202
|
+
|
|
203
203
|
item_constraints:{constraint:'none' | 'all' | 'specific' | 'criteria',item_price_ids?:any[],item_type:'plan' | 'addon' | 'charge'}[];
|
|
204
204
|
|
|
205
205
|
item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'plan' | 'addon' | 'charge'}[];
|
|
@@ -257,26 +257,12 @@ declare module 'chargebee' {
|
|
|
257
257
|
limit?:number;
|
|
258
258
|
|
|
259
259
|
/**
|
|
260
|
-
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set
|
|
260
|
+
* @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.
|
|
261
261
|
|
|
262
262
|
*/
|
|
263
263
|
|
|
264
264
|
offset?:string;
|
|
265
265
|
|
|
266
|
-
/**
|
|
267
|
-
* @description Parameters for addon
|
|
268
|
-
|
|
269
|
-
*/
|
|
270
|
-
|
|
271
|
-
addon?:{};
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* @description Parameters for plan
|
|
275
|
-
|
|
276
|
-
*/
|
|
277
|
-
|
|
278
|
-
plan?:{};
|
|
279
|
-
|
|
280
266
|
/**
|
|
281
267
|
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
282
268
|
**Note:**
|
|
@@ -343,21 +329,7 @@ Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon
|
|
|
343
329
|
|
|
344
330
|
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
345
331
|
|
|
346
|
-
|
|
347
|
-
* @description Plans the coupon can be applied to.
|
|
348
|
-
|
|
349
|
-
*/
|
|
350
|
-
|
|
351
|
-
plan_constraint?:{in?:string,is?:'none' | 'all' | 'specific' | 'not_applicable',is_not?:'none' | 'all' | 'specific' | 'not_applicable',not_in?:string};
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* @description Addons the coupon can be applied to.
|
|
355
|
-
|
|
356
|
-
*/
|
|
357
|
-
|
|
358
|
-
addon_constraint?:{in?:string,is?:'none' | 'all' | 'specific' | 'not_applicable',is_not?:'none' | 'all' | 'specific' | 'not_applicable',not_in?:string};
|
|
359
|
-
|
|
360
|
-
sort_by?:{asc?:'created_at',desc?:'created_at'};
|
|
332
|
+
sort_by?:object;
|
|
361
333
|
|
|
362
334
|
/**
|
|
363
335
|
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
|
|
@@ -365,15 +337,6 @@ Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon
|
|
|
365
337
|
*/
|
|
366
338
|
|
|
367
339
|
currency_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* @description Item families for which this coupon is applicable.
|
|
371
|
-
|
|
372
|
-
*/
|
|
373
|
-
|
|
374
|
-
item_family?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
375
|
-
|
|
376
|
-
include_discounts?:boolean;
|
|
377
340
|
}
|
|
378
341
|
export interface RetrieveResponse {
|
|
379
342
|
coupon:Coupon;
|
|
@@ -1,62 +1,94 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface CouponCode {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description Unique coupon code that can be redeemed only once.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
code:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description Status of the coupon code. \* not_redeemed - Can be applied to a subscription. \* redeemed - Cannot be applied to a subscription as the coupon code has been already used. \* archived - Cannot be applied to a subscription as it has been made inactive.
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
status:'archived' | 'redeemed' | 'not_redeemed';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description Id of the main coupon resource.
|
|
9
|
+
status:'not_redeemed' | 'redeemed' | 'archived';
|
|
21
10
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
11
|
coupon_id:string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description Uniquely identifies a coupon_set
|
|
28
12
|
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
13
|
coupon_set_id:string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description Coupon set name to which this coupon code would be grouped under. If the coupon set with the passed name is not present, a new coupon set will be created.
|
|
35
14
|
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
15
|
coupon_set_name:string;
|
|
16
|
+
|
|
39
17
|
}
|
|
40
18
|
export namespace CouponCode {
|
|
41
19
|
export class CouponCodeResource {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*/
|
|
46
|
-
|
|
20
|
+
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
21
|
+
|
|
47
22
|
retrieve(coupon_code_code:string):ChargebeeRequest<RetrieveResponse>;
|
|
48
23
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*/
|
|
53
|
-
|
|
24
|
+
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
25
|
+
|
|
54
26
|
archive(coupon_code_code:string):ChargebeeRequest<ArchiveResponse>;
|
|
55
27
|
}
|
|
28
|
+
export interface CreateResponse {
|
|
29
|
+
coupon_code:CouponCode;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateInputParam {
|
|
32
|
+
|
|
33
|
+
coupon_id:string;
|
|
34
|
+
|
|
35
|
+
coupon_set_name:string;
|
|
36
|
+
|
|
37
|
+
code:string;
|
|
38
|
+
}
|
|
56
39
|
export interface RetrieveResponse {
|
|
57
40
|
coupon_code:CouponCode;
|
|
58
41
|
}
|
|
59
42
|
|
|
43
|
+
export interface ListResponse {
|
|
44
|
+
list:{coupon_code:CouponCode}[];
|
|
45
|
+
|
|
46
|
+
next_offset?:string;
|
|
47
|
+
}
|
|
48
|
+
export interface ListInputParam {
|
|
49
|
+
[key : string]: any;
|
|
50
|
+
/**
|
|
51
|
+
* @description The number of resources to be returned.
|
|
52
|
+
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
limit?:number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @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.
|
|
59
|
+
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
offset?:string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @description Unique coupon code that can be redeemed only once.
|
|
66
|
+
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @description Id of the main coupon resource.
|
|
73
|
+
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
coupon_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @description Coupon set name to which this coupon code would be grouped under. If the coupon set with the passed name is not present, a new coupon set will be created.
|
|
80
|
+
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
coupon_set_name?:{is?:string,is_not?:string,starts_with?:string};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @description Status of the coupon code.
|
|
87
|
+
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
status?:{in?:string,is?:'not_redeemed' | 'redeemed' | 'archived',is_not?:'not_redeemed' | 'redeemed' | 'archived',not_in?:string};
|
|
91
|
+
}
|
|
60
92
|
export interface ArchiveResponse {
|
|
61
93
|
coupon_code:CouponCode;
|
|
62
94
|
}
|
|
@@ -1,98 +1,38 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface CouponSet {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description Uniquely identifies a coupon_set
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description Coupon id linked to coupon set
|
|
14
8
|
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
coupon_id:string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description Name of the coupon set
|
|
21
10
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
11
|
name:string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description No of coupon codes present in coupon set
|
|
28
12
|
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
13
|
total_count?:number;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description No of redeemed codes
|
|
35
14
|
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
15
|
redeemed_count?:number;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description No of archived codes
|
|
42
16
|
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
17
|
archived_count?:number;
|
|
18
|
+
|
|
19
|
+
meta_data?:object;
|
|
20
|
+
|
|
46
21
|
}
|
|
47
22
|
export namespace CouponSet {
|
|
48
23
|
export class CouponSetResource {
|
|
49
|
-
/**
|
|
50
|
-
* @description Create a coupon set with a coupon code compatible to your product offers and promotional discounts
|
|
51
|
-
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
24
|
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
55
25
|
|
|
56
|
-
/**
|
|
57
|
-
* @description This API add coupon codes to an existing coupon set.
|
|
58
|
-
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
26
|
add_coupon_codes(coupon_set_id:string, input?:AddCouponCodesInputParam):ChargebeeRequest<AddCouponCodesResponse>;
|
|
62
27
|
|
|
63
|
-
/**
|
|
64
|
-
* @description Use this API to get the list of all the coupon sets.
|
|
65
|
-
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
28
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
69
29
|
|
|
70
|
-
/**
|
|
71
|
-
* @description Use this API to retrieve a specific coupon set.
|
|
72
|
-
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
30
|
retrieve(coupon_set_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
76
31
|
|
|
77
|
-
/**
|
|
78
|
-
* @description Use this API to update a specific coupon set by updating its `name` and the `meta_data`.
|
|
79
|
-
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
32
|
update(coupon_set_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
|
|
83
33
|
|
|
84
|
-
/**
|
|
85
|
-
* @description Use this endpoint to delete a specific coupon set
|
|
86
|
-
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
34
|
delete(coupon_set_id:string):ChargebeeRequest<DeleteResponse>;
|
|
90
35
|
|
|
91
|
-
/**
|
|
92
|
-
* @description Use this API to delete all the unutilised coupon codes from a specific coupon set.
|
|
93
|
-
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
36
|
delete_unused_coupon_codes(coupon_set_id:string):ChargebeeRequest<DeleteUnusedCouponCodesResponse>;
|
|
97
37
|
}
|
|
98
38
|
export interface CreateResponse {
|
|
@@ -100,34 +40,12 @@ declare module 'chargebee' {
|
|
|
100
40
|
}
|
|
101
41
|
export interface CreateInputParam {
|
|
102
42
|
|
|
103
|
-
/**
|
|
104
|
-
* @description Coupon id linked to coupon set.
|
|
105
|
-
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
43
|
coupon_id:string;
|
|
109
44
|
|
|
110
|
-
/**
|
|
111
|
-
* @description Name of the coupon set.
|
|
112
|
-
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
45
|
name:string;
|
|
116
46
|
|
|
117
|
-
/**
|
|
118
|
-
* @description Uniquely identifies a coupon_set.
|
|
119
|
-
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
47
|
id:string;
|
|
123
48
|
|
|
124
|
-
/**
|
|
125
|
-
* @description A collection of key-value pairs that provides extra information about the coupon set.
|
|
126
|
-
**Note:** There's a character limit of 65,535.
|
|
127
|
-
[Learn more](advanced-features?prod_cat_ver=2#metadata).
|
|
128
|
-
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
49
|
meta_data?:object;
|
|
132
50
|
}
|
|
133
51
|
export interface AddCouponCodesResponse {
|
|
@@ -135,81 +53,66 @@ declare module 'chargebee' {
|
|
|
135
53
|
}
|
|
136
54
|
export interface AddCouponCodesInputParam {
|
|
137
55
|
|
|
138
|
-
/**
|
|
139
|
-
* @description You can pass up to 100 values per API call. You can also use the Chargebee UI to pass up to 1000 codes per operation. There is no limit on the total number of coupon codes that can be included in a coupon set.
|
|
140
|
-
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
56
|
code?:string[];
|
|
144
57
|
}
|
|
145
58
|
export interface ListResponse {
|
|
146
|
-
/**
|
|
147
|
-
* @description Use this API to get the list of all the coupon sets.
|
|
148
|
-
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
59
|
list:{coupon_set:CouponSet}[];
|
|
152
60
|
|
|
153
|
-
/**
|
|
154
|
-
* @description Use this API to get the list of all the coupon sets.
|
|
155
|
-
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
61
|
next_offset?:string;
|
|
159
62
|
}
|
|
160
63
|
export interface ListInputParam {
|
|
161
64
|
[key : string]: any;
|
|
162
65
|
/**
|
|
163
|
-
* @description
|
|
66
|
+
* @description The number of resources to be returned.
|
|
164
67
|
|
|
165
68
|
*/
|
|
166
69
|
|
|
167
70
|
limit?:number;
|
|
168
71
|
|
|
169
72
|
/**
|
|
170
|
-
* @description
|
|
73
|
+
* @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.
|
|
171
74
|
|
|
172
75
|
*/
|
|
173
76
|
|
|
174
77
|
offset?:string;
|
|
175
78
|
|
|
176
79
|
/**
|
|
177
|
-
* @description
|
|
80
|
+
* @description Uniquely identifies a coupon_set
|
|
178
81
|
|
|
179
82
|
*/
|
|
180
83
|
|
|
181
84
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
182
85
|
|
|
183
86
|
/**
|
|
184
|
-
* @description
|
|
87
|
+
* @description Name of the coupon set
|
|
185
88
|
|
|
186
89
|
*/
|
|
187
90
|
|
|
188
91
|
name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
189
92
|
|
|
190
93
|
/**
|
|
191
|
-
* @description
|
|
94
|
+
* @description Coupon id linked to coupon set
|
|
192
95
|
|
|
193
96
|
*/
|
|
194
97
|
|
|
195
98
|
coupon_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
196
99
|
|
|
197
100
|
/**
|
|
198
|
-
* @description
|
|
101
|
+
* @description No of coupon codes present in coupon set
|
|
199
102
|
|
|
200
103
|
*/
|
|
201
104
|
|
|
202
105
|
total_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
203
106
|
|
|
204
107
|
/**
|
|
205
|
-
* @description
|
|
108
|
+
* @description No of redeemed codes
|
|
206
109
|
|
|
207
110
|
*/
|
|
208
111
|
|
|
209
112
|
redeemed_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
210
113
|
|
|
211
114
|
/**
|
|
212
|
-
* @description
|
|
115
|
+
* @description No of archived codes
|
|
213
116
|
|
|
214
117
|
*/
|
|
215
118
|
|
|
@@ -224,20 +127,8 @@ declare module 'chargebee' {
|
|
|
224
127
|
}
|
|
225
128
|
export interface UpdateInputParam {
|
|
226
129
|
|
|
227
|
-
/**
|
|
228
|
-
* @description Name of the coupon set.
|
|
229
|
-
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
130
|
name?:string;
|
|
233
131
|
|
|
234
|
-
/**
|
|
235
|
-
* @description A collection of key-value pairs that provides extra information about the coupon set.
|
|
236
|
-
**Note:** There's a character limit of 65,535.
|
|
237
|
-
[Learn more](advanced-features?prod_cat_ver=2#metadata).
|
|
238
|
-
|
|
239
|
-
*/
|
|
240
|
-
|
|
241
132
|
meta_data?:object;
|
|
242
133
|
}
|
|
243
134
|
export interface DeleteResponse {
|