chargebee 2.50.0 → 2.52.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 +92 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +37 -1
- package/package.json +1 -1
- package/types/core.d.ts +8 -5
- package/types/index.d.ts +3 -0
- package/types/resources/Address.d.ts +2 -194
- package/types/resources/AdvanceInvoiceSchedule.d.ts +5 -67
- 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 +8 -6
- package/types/resources/BusinessEntityTransfer.d.ts +10 -7
- package/types/resources/Card.d.ts +11 -311
- package/types/resources/Comment.d.ts +7 -124
- package/types/resources/Configuration.d.ts +2 -0
- package/types/resources/Contact.d.ts +2 -44
- package/types/resources/ContractTerm.d.ts +4 -72
- package/types/resources/Coupon.d.ts +0 -37
- package/types/resources/CouponCode.d.ts +67 -35
- package/types/resources/CouponSet.d.ts +12 -121
- package/types/resources/CreditNote.d.ts +2 -6
- package/types/resources/CreditNoteEstimate.d.ts +1 -1
- package/types/resources/Currency.d.ts +8 -5
- package/types/resources/Customer.d.ts +90 -89
- package/types/resources/Discount.d.ts +2 -89
- 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 -10
- package/types/resources/Event.d.ts +23 -108
- package/types/resources/Export.d.ts +116 -432
- package/types/resources/Feature.d.ts +17 -319
- 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/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 +26 -18
- package/types/resources/InvoiceEstimate.d.ts +1 -1
- package/types/resources/Item.d.ts +4 -9
- package/types/resources/ItemEntitlement.d.ts +15 -155
- package/types/resources/NonSubscription.d.ts +9 -6
- package/types/resources/OmnichannelSubscriptionItem.d.ts +9 -0
- package/types/resources/PaymentIntent.d.ts +9 -255
- package/types/resources/PaymentReferenceNumber.d.ts +3 -20
- package/types/resources/PaymentSource.d.ts +2 -2
- package/types/resources/PaymentVoucher.d.ts +20 -203
- package/types/resources/PortalSession.d.ts +4 -146
- package/types/resources/PromotionalCredit.d.ts +10 -215
- package/types/resources/Purchase.d.ts +3 -1
- package/types/resources/Quote.d.ts +68 -18
- package/types/resources/QuoteLineGroup.d.ts +1 -1
- package/types/resources/QuotedRamp.d.ts +142 -0
- package/types/resources/RecordedPurchase.d.ts +2 -0
- package/types/resources/ResourceMigration.d.ts +2 -54
- package/types/resources/SiteMigrationDetail.d.ts +13 -55
- package/types/resources/Subscription.d.ts +13 -9
- package/types/resources/SubscriptionEntitlement.d.ts +6 -106
- 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 +2 -2
- package/types/resources/Usage.d.ts +21 -165
|
@@ -1,88 +1,32 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface Comment {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description Unique identifier for the comment.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description Type of the entity this comment generated for \* item - Entity that represents item \* invoice - Invoice description \* product - Entity that represents product \* plan - Entity that represents a subscription plan \* item_family - Entity that represents item family \* transaction - Entity that represents a transaction. \* quote - Entity that represents a quote \* order - Entity that represents an order \* item_price - Entity that represents item price \* customer - Entity that represents a customer \* variant - Entity that represents product variants \* business_entity - Entity that represents item of type business entity \* coupon - Entity that represents a discount coupon \* subscription - Entity that represents a subscription of a customer \* addon - Entity that represents an addon \* credit_note - Credit note description
|
|
14
8
|
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
entity_type:EntityType;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description The user who created the comment. If created via API, this contains the name given for the API key used.
|
|
21
10
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
11
|
added_by?:string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description Actual notes for the comment.
|
|
28
12
|
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
13
|
notes:string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description The time at which this comment was created
|
|
35
14
|
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
15
|
created_at:number;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description Type of comment this is. \* system - Comment generated by Chargebee when any backend changes happen for an entity \* user - Comment generated by user either via API or Admin console.
|
|
42
16
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
type:'system' | 'user';
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description Unique identifier of the entity.
|
|
17
|
+
type:'user' | 'system';
|
|
49
18
|
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
19
|
entity_id:string;
|
|
20
|
+
|
|
53
21
|
}
|
|
54
22
|
export namespace Comment {
|
|
55
23
|
export class CommentResource {
|
|
56
|
-
/**
|
|
57
|
-
* @description Create a new comment for an entity. The newly added comment will be shown in the web interface as well.
|
|
58
|
-
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
24
|
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
62
25
|
|
|
63
|
-
/**
|
|
64
|
-
* @description Retrieve a comment for an entity identified by comment ID.
|
|
65
|
-
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
26
|
retrieve(comment_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
69
27
|
|
|
70
|
-
/**
|
|
71
|
-
* @description Retrieve the list of comments sorted by the recent ones on the top.
|
|
72
|
-
|
|
73
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
74
|
-
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
28
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
78
29
|
|
|
79
|
-
/**
|
|
80
|
-
* @description Delete a comment for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#create_a_comment_entity_type) identified by comment ID.
|
|
81
|
-
|
|
82
|
-
Only the comments that are added via Admin console and API can be deleted. Chargebee generated "System" comments cannot be deleted.
|
|
83
|
-
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
30
|
delete(comment_id:string):ChargebeeRequest<DeleteResponse>;
|
|
87
31
|
}
|
|
88
32
|
export interface CreateResponse {
|
|
@@ -90,32 +34,12 @@ Only the comments that are added via Admin console and API can be deleted. Charg
|
|
|
90
34
|
}
|
|
91
35
|
export interface CreateInputParam {
|
|
92
36
|
|
|
93
|
-
/**
|
|
94
|
-
* @description Type of the entity to create the comment for. \* item - Entity that represents item \* order - Entity that represents an order \* item_price - Entity that represents item price \* customer - Entity that represents a customer \* variant - Entity that represents product variants \* invoice - Invoice description \* product - Entity that represents product \* business_entity - Entity that represents item of type business entity \* plan - Entity that represents a subscription plan \* coupon - Entity that represents a discount coupon \* subscription - Entity that represents a subscription of a customer \* item_family - Entity that represents item family \* transaction - Entity that represents a transaction. \* addon - Entity that represents an addon \* credit_note - Credit note description \* quote - Entity that represents a quote
|
|
95
|
-
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
37
|
entity_type:EntityType;
|
|
99
38
|
|
|
100
|
-
/**
|
|
101
|
-
* @description Unique identifier of the entity.
|
|
102
|
-
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
39
|
entity_id:string;
|
|
106
40
|
|
|
107
|
-
/**
|
|
108
|
-
* @description Actual notes for the comment.
|
|
109
|
-
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
41
|
notes:string;
|
|
113
42
|
|
|
114
|
-
/**
|
|
115
|
-
* @description The user who created the comment. If created via API, this contains the name given for the API key used.
|
|
116
|
-
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
43
|
added_by?:string;
|
|
120
44
|
}
|
|
121
45
|
export interface RetrieveResponse {
|
|
@@ -123,78 +47,37 @@ Only the comments that are added via Admin console and API can be deleted. Charg
|
|
|
123
47
|
}
|
|
124
48
|
|
|
125
49
|
export interface ListResponse {
|
|
126
|
-
/**
|
|
127
|
-
* @description Retrieve the list of comments sorted by the recent ones on the top.
|
|
128
|
-
|
|
129
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
130
|
-
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
50
|
list:{comment:Comment}[];
|
|
134
51
|
|
|
135
|
-
/**
|
|
136
|
-
* @description Retrieve the list of comments sorted by the recent ones on the top.
|
|
137
|
-
|
|
138
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
139
|
-
|
|
140
|
-
*/
|
|
141
|
-
|
|
142
52
|
next_offset?:string;
|
|
143
53
|
}
|
|
144
54
|
export interface ListInputParam {
|
|
145
55
|
[key : string]: any;
|
|
146
56
|
/**
|
|
147
|
-
* @description
|
|
148
|
-
|
|
149
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
57
|
+
* @description The number of resources to be returned.
|
|
150
58
|
|
|
151
59
|
*/
|
|
152
60
|
|
|
153
61
|
limit?:number;
|
|
154
62
|
|
|
155
63
|
/**
|
|
156
|
-
* @description
|
|
157
|
-
|
|
158
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
64
|
+
* @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.
|
|
159
65
|
|
|
160
66
|
*/
|
|
161
67
|
|
|
162
68
|
offset?:string;
|
|
163
69
|
|
|
164
|
-
|
|
165
|
-
* @description Retrieve the list of comments sorted by the recent ones on the top.
|
|
166
|
-
|
|
167
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
168
|
-
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
entity_type?:'item' | 'product' | 'coupon' | 'addon' | 'item_price' | 'business_entity' | 'subscription' | 'item_family' | 'credit_note' | 'quote' | 'variant' | 'invoice' | 'plan' | 'transaction' | 'customer' | 'order';
|
|
70
|
+
entity_type?:'customer' | 'subscription' | 'invoice' | 'quote' | 'credit_note' | 'transaction' | 'plan' | 'addon' | 'coupon' | 'order' | 'business_entity' | 'omnichannel_subscription' | 'omnichannel_subscription_item' | 'omnichannel_transaction' | 'recorded_purchase' | 'omnichannel_subscription_item_scheduled_change' | 'sales_order' | 'item_family' | 'item' | 'item_price' | 'price_variant';
|
|
172
71
|
|
|
173
|
-
/**
|
|
174
|
-
* @description Retrieve the list of comments sorted by the recent ones on the top.
|
|
175
|
-
|
|
176
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
177
|
-
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
72
|
entity_id?:string;
|
|
181
73
|
|
|
182
74
|
/**
|
|
183
|
-
* @description
|
|
184
|
-
|
|
185
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
75
|
+
* @description The time at which this comment was created
|
|
186
76
|
|
|
187
77
|
*/
|
|
188
78
|
|
|
189
79
|
created_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
190
80
|
|
|
191
|
-
/**
|
|
192
|
-
* @description Retrieve the list of comments sorted by the recent ones on the top.
|
|
193
|
-
|
|
194
|
-
If you want to retrieve the list of comments for an [entity](https://apidocs.chargebee.com/docs/api/v1/comments?prod_cat_ver=1#list_comments_entity_type), for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
|
|
195
|
-
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
81
|
sort_by?:{asc?:'created_at',desc?:'created_at'};
|
|
199
82
|
}
|
|
200
83
|
export interface DeleteResponse {
|
|
@@ -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
|
}
|
|
@@ -263,20 +263,6 @@ declare module 'chargebee' {
|
|
|
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,20 +329,6 @@ 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
332
|
sort_by?:{asc?:'created_at',desc?:'created_at'};
|
|
361
333
|
|
|
362
334
|
/**
|
|
@@ -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
|
}
|