chargebee 2.26.0 → 2.26.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 +4 -0
- package/lib/chargebee.js +1 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +245 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +305 -13
- package/types/resources/Card.d.ts +485 -13
- package/types/resources/Comment.d.ts +177 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +665 -20
- package/types/resources/CouponCode.d.ts +56 -5
- package/types/resources/CouponSet.d.ts +224 -17
- package/types/resources/CreditNote.d.ts +1202 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +2132 -73
- package/types/resources/DifferentialPrice.d.ts +266 -15
- package/types/resources/Discount.d.ts +107 -0
- package/types/resources/Download.d.ts +18 -0
- package/types/resources/EntitlementOverride.d.ts +101 -7
- package/types/resources/Estimate.d.ts +1181 -27
- package/types/resources/Event.d.ts +145 -8
- package/types/resources/Export.d.ts +703 -32
- package/types/resources/Feature.d.ts +356 -22
- package/types/resources/Gift.d.ts +351 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1212 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +636 -9
- package/types/resources/Invoice.d.ts +2293 -93
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +542 -16
- package/types/resources/ItemEntitlement.d.ts +172 -13
- package/types/resources/ItemFamily.d.ts +173 -15
- package/types/resources/ItemPrice.d.ts +971 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +51 -3
- package/types/resources/Order.d.ts +1224 -32
- package/types/resources/PaymentIntent.d.ts +318 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +1259 -55
- package/types/resources/PaymentVoucher.d.ts +262 -14
- package/types/resources/PortalSession.d.ts +187 -10
- package/types/resources/PromotionalCredit.d.ts +351 -16
- package/types/resources/Purchase.d.ts +274 -5
- package/types/resources/Quote.d.ts +1595 -62
- package/types/resources/QuoteLineGroup.d.ts +134 -5
- package/types/resources/QuotedCharge.d.ts +63 -5
- package/types/resources/QuotedSubscription.d.ts +192 -5
- package/types/resources/ResourceMigration.d.ts +73 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +3462 -137
- package/types/resources/SubscriptionEntitlement.d.ts +116 -8
- package/types/resources/SubscriptionEstimate.d.ts +36 -2
- package/types/resources/TaxWithheld.d.ts +32 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
- package/types/resources/TimeMachine.d.ts +99 -7
- package/types/resources/Token.d.ts +179 -7
- package/types/resources/Transaction.d.ts +597 -25
- package/types/resources/UnbilledCharge.d.ts +355 -14
- package/types/resources/Usage.d.ts +259 -13
- package/types/resources/VirtualBankAccount.d.ts +255 -17
|
@@ -1,146 +1,791 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface Coupon {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
7
|
+
**Note:**
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
11
|
+
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
12
|
+
|
|
13
|
+
*/
|
|
14
|
+
|
|
4
15
|
id:string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @description The display name used in web interface for identifying the coupon.
|
|
19
|
+
**Note:**
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
When the name of the coupon set contains a special character; for example: `#`, the API returns an error.
|
|
23
|
+
Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
|
|
24
|
+
|
|
25
|
+
*/
|
|
26
|
+
|
|
5
27
|
name:string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @description Display name used in invoice. If it is not configured then name is used in invoice.
|
|
31
|
+
|
|
32
|
+
*/
|
|
33
|
+
|
|
6
34
|
invoice_name?:string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @description The type of deduction \* percentage - The specified percentage will be deducted. \* fixed_amount - The specified amount will be deducted.
|
|
38
|
+
|
|
39
|
+
*/
|
|
40
|
+
|
|
7
41
|
discount_type:'fixed_amount' | 'percentage';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @description The percentage of the original amount that should be deducted from it.
|
|
45
|
+
|
|
46
|
+
*/
|
|
47
|
+
|
|
8
48
|
discount_percentage?:number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
52
|
+
|
|
53
|
+
*/
|
|
54
|
+
|
|
9
55
|
discount_amount?:number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
|
|
59
|
+
|
|
60
|
+
*/
|
|
61
|
+
|
|
10
62
|
currency_code?:string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @description Specifies the time duration for which this coupon is attached to the subscription. \* forever - The coupon is attached to the subscription and applied on the invoices until explicitly removed. \* one_time - The coupon stays attached to the subscription till it is applied on an invoice **once** . It is removed after that from the subscription. \* limited_period - The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by `period` and `period_unit`.
|
|
66
|
+
|
|
67
|
+
*/
|
|
68
|
+
|
|
11
69
|
duration_type:'limited_period' | 'one_time' | 'forever';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @description Date upto which the coupon can be applied to new subscriptions.
|
|
73
|
+
|
|
74
|
+
*/
|
|
75
|
+
|
|
12
76
|
valid_till?:number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @description Maximum number of times this coupon can be redeemed.
|
|
80
|
+
**Note:**
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
If not specified, the coupon can be redeemed an indefinite number of times.
|
|
84
|
+
|
|
85
|
+
*/
|
|
86
|
+
|
|
13
87
|
max_redemptions?:number;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @description Status of the coupon. \* expired - Cannot be applied to a subscription. A coupon may expire due to exceeding [max_redemptions](/docs/api/coupons?#coupon_max_redemptions) or [valid_till](/docs/api/coupons?#coupon_valid_till) date is past. Existing associations remain unaffected. \* archived - Cannot be applied to a subscription. Existing associations remain unaffected. \* active - Can be applied to a subscription. \* deleted - Indicates the coupon has been deleted.
|
|
91
|
+
|
|
92
|
+
*/
|
|
93
|
+
|
|
14
94
|
status?:'archived' | 'expired' | 'deleted' | 'active';
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @description The amount on the invoice to which the coupon is applied. \* invoice_amount - The coupon is applied to the invoice `sub_total`. \* each_specified_item - The coupon is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id`.
|
|
98
|
+
|
|
99
|
+
*/
|
|
100
|
+
|
|
15
101
|
apply_on:'invoice_amount' | 'each_specified_item';
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @description Timestamp indicating when this coupon is created.
|
|
105
|
+
|
|
106
|
+
*/
|
|
107
|
+
|
|
16
108
|
created_at:number;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @description Timestamp indicating when this coupon was archived.
|
|
112
|
+
|
|
113
|
+
*/
|
|
114
|
+
|
|
17
115
|
archived_at?:number;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @description The version number of this resource. For every change made to the resource, `resource_version` is updated with a new timestamp in milliseconds.
|
|
119
|
+
|
|
120
|
+
*/
|
|
121
|
+
|
|
18
122
|
resource_version?:number;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @description Timestamp indicating when this coupon was last updated.
|
|
126
|
+
Note that this does not change when the [redemptions](/docs/api/coupons?#coupon_redemptions) attribute is changed. This attribute will be present only if the resource has been updated after 2016-11-09.
|
|
127
|
+
|
|
128
|
+
*/
|
|
129
|
+
|
|
19
130
|
updated_at?:number;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @description The duration of time for which the coupon is attached to the subscription, in `period_units`. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type).
|
|
134
|
+
|
|
135
|
+
*/
|
|
136
|
+
|
|
20
137
|
period?:number;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @description The unit of time for period. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type). \* month - A period of 1 calendar month. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours.
|
|
141
|
+
|
|
142
|
+
*/
|
|
143
|
+
|
|
21
144
|
period_unit?:PeriodUnit;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @description The number of times this coupon has been redeemed.
|
|
148
|
+
|
|
149
|
+
*/
|
|
150
|
+
|
|
22
151
|
redemptions?:number;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @description A customer-facing note added to all invoices associated with this API resource. This note becomes one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
|
|
155
|
+
|
|
156
|
+
*/
|
|
157
|
+
|
|
23
158
|
invoice_notes?:string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @description The list of item constraints.
|
|
162
|
+
|
|
163
|
+
*/
|
|
164
|
+
|
|
24
165
|
item_constraints?:Coupon.ItemConstraint[];
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @description The list of item constraint criteria.
|
|
169
|
+
|
|
170
|
+
*/
|
|
171
|
+
|
|
25
172
|
item_constraint_criteria?:Coupon.ItemConstraintCriteria[];
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @description List of constraints applicable on the redemption of this coupon.
|
|
176
|
+
|
|
177
|
+
*/
|
|
178
|
+
|
|
26
179
|
coupon_constraints?:Coupon.CouponConstraint[];
|
|
27
180
|
}
|
|
28
181
|
export namespace Coupon {
|
|
29
|
-
export class CouponResource {
|
|
182
|
+
export class CouponResource {
|
|
183
|
+
/**
|
|
184
|
+
* @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
|
|
185
|
+
|
|
186
|
+
*/
|
|
187
|
+
|
|
30
188
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @description This API updates a coupon that is created for a specific promotion or offers.
|
|
192
|
+
|
|
193
|
+
*/
|
|
194
|
+
|
|
31
195
|
update_for_items(coupon_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @description This API unarchives a specific coupon using the coupon ID.
|
|
199
|
+
|
|
200
|
+
*/
|
|
201
|
+
|
|
32
202
|
unarchive(coupon_id:string):ChargebeeRequest<UnarchiveResponse>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @description If no Subscriptions/Invoices are linked to this Coupon, the Coupon will be deleted from your Chargebee site. This action cannot be undone.
|
|
206
|
+
|
|
207
|
+
To ensure that existing Subscriptions/Invoices are not affected, Coupons associated with them will not be deleted, but moved to "Archived" state. Once a Coupon has been archived, it cannot be edited or used again unless [unarchived](coupons#unarchive_a_coupon). Unused Coupons codes are deleted.
|
|
208
|
+
|
|
209
|
+
*/
|
|
210
|
+
|
|
33
211
|
delete(coupon_id:string):ChargebeeRequest<DeleteResponse>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @description Copies a coupon over from one site to another. Copying of [archived](./coupons?prod_cat_ver=2#coupon_status) coupons is not supported.
|
|
215
|
+
|
|
216
|
+
The item prices that are linked to the coupon in the source site are also linked to the coupon in the destination site. However, this will only work if those item prices exist and with the same [ids](./item_prices?prod_cat_ver=2#item_price_id), in the destination site. Hence, it is recommended that the item prices be copied over before copying the coupons.
|
|
217
|
+
|
|
218
|
+
The value for [redemptions](./coupons?prod_cat_ver=2#coupon_redemptions) is not copied. It is set to `0` for the newly created coupon. Hence, if such a coupon had `expired` in the source site due to `redemptions` having reached [max_redemptions](./coupons?prod_cat_ver=2#coupon_max_redemptions), it's [status](./coupons?prod_cat_ver=2#coupon_status) would be `active` in the destination site.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
*/
|
|
222
|
+
|
|
34
223
|
copy(input:CopyInputParam):ChargebeeRequest<CopyResponse>;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @description This API retrieves a specific coupon using the coupon ID.
|
|
227
|
+
|
|
228
|
+
*/
|
|
229
|
+
|
|
35
230
|
retrieve(coupon_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @description This API creates a new coupon for a specific promotion or offers.
|
|
234
|
+
|
|
235
|
+
*/
|
|
236
|
+
|
|
36
237
|
create_for_items(input:CreateForItemsInputParam):ChargebeeRequest<CreateForItemsResponse>;
|
|
37
238
|
}
|
|
38
|
-
export interface ListResponse {
|
|
39
|
-
|
|
40
|
-
|
|
239
|
+
export interface ListResponse {
|
|
240
|
+
/**
|
|
241
|
+
* @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
|
|
242
|
+
|
|
243
|
+
*/
|
|
244
|
+
|
|
245
|
+
list:{coupon:Coupon}[];
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
|
|
249
|
+
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
next_offset?:string;
|
|
41
253
|
}
|
|
42
254
|
export interface ListInputParam {
|
|
43
|
-
[key : string]: any;
|
|
255
|
+
[key : string]: any;
|
|
256
|
+
/**
|
|
257
|
+
* @description The number of resources to be returned.
|
|
258
|
+
|
|
259
|
+
*/
|
|
260
|
+
|
|
44
261
|
limit?:number;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* @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.
|
|
265
|
+
|
|
266
|
+
*/
|
|
267
|
+
|
|
45
268
|
offset?:string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
272
|
+
**Note:**
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
276
|
+
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
277
|
+
|
|
278
|
+
*/
|
|
279
|
+
|
|
46
280
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @description The display name used in web interface for identifying the coupon.
|
|
284
|
+
**Note:**
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
When the name of the coupon set contains a special character; for example: `#`, the API returns an error.
|
|
288
|
+
Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
|
|
289
|
+
|
|
290
|
+
*/
|
|
291
|
+
|
|
47
292
|
name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @description The type of deduction
|
|
296
|
+
|
|
297
|
+
*/
|
|
298
|
+
|
|
48
299
|
discount_type?:{in?:string,is?:'fixed_amount' | 'percentage',is_not?:'fixed_amount' | 'percentage',not_in?:string};
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @description Specifies the time duration for which this coupon is attached to the subscription.
|
|
303
|
+
|
|
304
|
+
*/
|
|
305
|
+
|
|
49
306
|
duration_type?:{in?:string,is?:'limited_period' | 'one_time' | 'forever',is_not?:'limited_period' | 'one_time' | 'forever',not_in?:string};
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @description Status of the coupon.
|
|
310
|
+
|
|
311
|
+
*/
|
|
312
|
+
|
|
50
313
|
status?:{in?:string,is?:'archived' | 'expired' | 'deleted' | 'active',is_not?:'archived' | 'expired' | 'deleted' | 'active',not_in?:string};
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @description The amount on the invoice to which the coupon is applied.
|
|
317
|
+
|
|
318
|
+
*/
|
|
319
|
+
|
|
51
320
|
apply_on?:{in?:string,is?:'invoice_amount' | 'each_specified_item',is_not?:'invoice_amount' | 'each_specified_item',not_in?:string};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @description Timestamp indicating when this coupon is created.
|
|
324
|
+
|
|
325
|
+
*/
|
|
326
|
+
|
|
52
327
|
created_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @description To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-11-09.
|
|
331
|
+
|
|
332
|
+
*/
|
|
333
|
+
|
|
53
334
|
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
|
|
338
|
+
|
|
339
|
+
*/
|
|
340
|
+
|
|
54
341
|
sort_by?:{asc?:'created_at',desc?:'created_at'};
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
|
|
345
|
+
|
|
346
|
+
*/
|
|
347
|
+
|
|
55
348
|
currency_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @description Parameters for addon
|
|
352
|
+
|
|
353
|
+
*/
|
|
354
|
+
|
|
56
355
|
addon?:{};
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @description Parameters for plan
|
|
359
|
+
|
|
360
|
+
*/
|
|
361
|
+
|
|
57
362
|
plan?:{};
|
|
58
363
|
}
|
|
59
|
-
export interface UpdateForItemsResponse {
|
|
60
|
-
|
|
364
|
+
export interface UpdateForItemsResponse {
|
|
365
|
+
/**
|
|
366
|
+
* @description This API updates a coupon that is created for a specific promotion or offers.
|
|
367
|
+
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
coupon:Coupon;
|
|
61
371
|
}
|
|
62
372
|
export interface UpdateForItemsInputParam {
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* @description The display name used in web interface for identifying the coupon.
|
|
376
|
+
**Note:**
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
When the name of the coupon set contains a special character; for example: `#`, the API returns an error.
|
|
380
|
+
Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
|
|
381
|
+
.
|
|
382
|
+
|
|
383
|
+
*/
|
|
384
|
+
|
|
63
385
|
name?:string;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @description Display name used in invoice. If it is not configured then name is used in invoice.
|
|
389
|
+
|
|
390
|
+
*/
|
|
391
|
+
|
|
64
392
|
invoice_name?:string;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* @description The type of deduction. \* percentage - The specified percentage will be deducted. \* fixed_amount - The specified amount will be deducted. \* offer_quantity - The specified units will be offered for free.
|
|
396
|
+
|
|
397
|
+
*/
|
|
398
|
+
|
|
65
399
|
discount_type?:'fixed_amount' | 'percentage';
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
403
|
+
|
|
404
|
+
*/
|
|
405
|
+
|
|
66
406
|
discount_amount?:number;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/2.0/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
|
|
410
|
+
|
|
411
|
+
*/
|
|
412
|
+
|
|
67
413
|
currency_code?:string;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* @description The percentage of the original amount that should be deducted from it.
|
|
417
|
+
|
|
418
|
+
*/
|
|
419
|
+
|
|
68
420
|
discount_percentage?:number;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @description The amount on the invoice to which the coupon is applied. \* invoice_amount - The coupon is applied to the invoice `sub_total`. \* each_unit_of_specified_items - Discount will be applied to each unit of plan and addon items specified. \* each_specified_item - The coupon is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id`. \* specified_items_total - Discount will be applied to the total of plan and addon items specified.
|
|
424
|
+
|
|
425
|
+
*/
|
|
426
|
+
|
|
69
427
|
apply_on?:'invoice_amount' | 'each_specified_item';
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @description Specifies the time duration for which this coupon is attached to the subscription. \* forever - The coupon is attached to the subscription and applied on the invoices until explicitly removed. \* one_time - The coupon stays attached to the subscription till it is applied on an invoice **once** . It is removed after that from the subscription. \* limited_period - The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by `period` and `period_unit`.
|
|
431
|
+
|
|
432
|
+
*/
|
|
433
|
+
|
|
70
434
|
duration_type?:'limited_period' | 'one_time' | 'forever';
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* @description **(Deprecated)** The duration of time in months for which the coupon is attached to the subscription. Applicable only when `duration_type` is `limited_period`.
|
|
438
|
+
**Note:** This parameter has been deprecated. Use `period` and `period_unit` instead.
|
|
439
|
+
|
|
440
|
+
*/
|
|
441
|
+
|
|
71
442
|
duration_month?:number;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* @description Date upto which the coupon can be applied to new subscriptions.
|
|
446
|
+
|
|
447
|
+
*/
|
|
448
|
+
|
|
72
449
|
valid_till?:number;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* @description Maximum number of times this coupon can be redeemed.
|
|
453
|
+
**Note:**
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
If not specified, the coupon can be redeemed an indefinite number of times.
|
|
457
|
+
.
|
|
458
|
+
|
|
459
|
+
*/
|
|
460
|
+
|
|
73
461
|
max_redemptions?:number;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @description A customer-facing note added to all invoices associated with this API resource. This note becomes one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
|
|
465
|
+
|
|
466
|
+
*/
|
|
467
|
+
|
|
74
468
|
invoice_notes?:string;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* @description A set of key-value pairs stored as additional information for the coupon. [Learn more](./#meta_data).
|
|
472
|
+
|
|
473
|
+
*/
|
|
474
|
+
|
|
75
475
|
meta_data?:object;
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* @description The coupon is included in MRR calculations for your site. This attribute is only applicable for coupons of `duration_type = one_time` and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude one-time coupons from MRR calculations, this value is always returned `false`.
|
|
479
|
+
|
|
480
|
+
*/
|
|
481
|
+
|
|
76
482
|
included_in_mrr?:boolean;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* @description The duration of time for which the coupon is attached to the subscription, in `period_units`. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type).
|
|
486
|
+
|
|
487
|
+
*/
|
|
488
|
+
|
|
77
489
|
period?:number;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* @description The unit of time for period. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type). \* month - A period of 1 calendar month. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours.
|
|
493
|
+
|
|
494
|
+
*/
|
|
495
|
+
|
|
78
496
|
period_unit?:PeriodUnit;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* @description Parameters for item_constraints
|
|
500
|
+
|
|
501
|
+
*/
|
|
502
|
+
|
|
79
503
|
item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* @description Parameters for item_constraint_criteria
|
|
507
|
+
|
|
508
|
+
*/
|
|
509
|
+
|
|
80
510
|
item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @description Parameters for `coupon_constraints`. Multiple `coupon_constraints` can be passed by specifying unique indices.
|
|
514
|
+
|
|
515
|
+
*/
|
|
516
|
+
|
|
81
517
|
coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
|
|
82
518
|
}
|
|
83
|
-
export interface UnarchiveResponse {
|
|
84
|
-
|
|
519
|
+
export interface UnarchiveResponse {
|
|
520
|
+
/**
|
|
521
|
+
* @description This API unarchives a specific coupon using the coupon ID.
|
|
522
|
+
|
|
523
|
+
*/
|
|
524
|
+
|
|
525
|
+
coupon:Coupon;
|
|
85
526
|
}
|
|
86
527
|
|
|
87
|
-
export interface DeleteResponse {
|
|
88
|
-
|
|
528
|
+
export interface DeleteResponse {
|
|
529
|
+
/**
|
|
530
|
+
* @description If no Subscriptions/Invoices are linked to this Coupon, the Coupon will be deleted from your Chargebee site. This action cannot be undone.
|
|
531
|
+
|
|
532
|
+
To ensure that existing Subscriptions/Invoices are not affected, Coupons associated with them will not be deleted, but moved to "Archived" state. Once a Coupon has been archived, it cannot be edited or used again unless [unarchived](coupons#unarchive_a_coupon). Unused Coupons codes are deleted.
|
|
533
|
+
|
|
534
|
+
*/
|
|
535
|
+
|
|
536
|
+
coupon:Coupon;
|
|
89
537
|
}
|
|
90
538
|
|
|
91
|
-
export interface CopyResponse {
|
|
92
|
-
|
|
539
|
+
export interface CopyResponse {
|
|
540
|
+
/**
|
|
541
|
+
* @description Copies a coupon over from one site to another. Copying of [archived](./coupons?prod_cat_ver=2#coupon_status) coupons is not supported.
|
|
542
|
+
|
|
543
|
+
The item prices that are linked to the coupon in the source site are also linked to the coupon in the destination site. However, this will only work if those item prices exist and with the same [ids](./item_prices?prod_cat_ver=2#item_price_id), in the destination site. Hence, it is recommended that the item prices be copied over before copying the coupons.
|
|
544
|
+
|
|
545
|
+
The value for [redemptions](./coupons?prod_cat_ver=2#coupon_redemptions) is not copied. It is set to `0` for the newly created coupon. Hence, if such a coupon had `expired` in the source site due to `redemptions` having reached [max_redemptions](./coupons?prod_cat_ver=2#coupon_max_redemptions), it's [status](./coupons?prod_cat_ver=2#coupon_status) would be `active` in the destination site.
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
*/
|
|
549
|
+
|
|
550
|
+
coupon:Coupon;
|
|
93
551
|
}
|
|
94
552
|
export interface CopyInputParam {
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* @description Your Chargebee site name having the coupon to be copied.
|
|
556
|
+
**Note:** Unless you are copying from a twin site (acme \& acme-test are twin sites), [contact support](https://chargebee.freshdesk.com/support/home) to have this allow-listed.
|
|
557
|
+
|
|
558
|
+
*/
|
|
559
|
+
|
|
95
560
|
from_site:string;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* @description Id of the coupon to be copied. The new coupon created in this site will have the same Id.
|
|
564
|
+
|
|
565
|
+
*/
|
|
566
|
+
|
|
96
567
|
id_at_from_site:string;
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* @description Id of copied coupon in this site.
|
|
571
|
+
|
|
572
|
+
*/
|
|
573
|
+
|
|
97
574
|
id?:string;
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* @description If copy action is performed as part of Chargebee site merge action, pass the value as true.
|
|
578
|
+
**Note:** If this parameter is passed true coupon state, redemptions, coupon set and coupon codes associated with this coupon will be copied.
|
|
579
|
+
|
|
580
|
+
*/
|
|
581
|
+
|
|
98
582
|
for_site_merging?:boolean;
|
|
99
583
|
}
|
|
100
|
-
export interface RetrieveResponse {
|
|
101
|
-
|
|
584
|
+
export interface RetrieveResponse {
|
|
585
|
+
/**
|
|
586
|
+
* @description This API retrieves a specific coupon using the coupon ID.
|
|
587
|
+
|
|
588
|
+
*/
|
|
589
|
+
|
|
590
|
+
coupon:Coupon;
|
|
102
591
|
}
|
|
103
592
|
|
|
104
|
-
export interface CreateForItemsResponse {
|
|
105
|
-
|
|
593
|
+
export interface CreateForItemsResponse {
|
|
594
|
+
/**
|
|
595
|
+
* @description This API creates a new coupon for a specific promotion or offers.
|
|
596
|
+
|
|
597
|
+
*/
|
|
598
|
+
|
|
599
|
+
coupon:Coupon;
|
|
106
600
|
}
|
|
107
601
|
export interface CreateForItemsInputParam {
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
605
|
+
**Note:**
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
609
|
+
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
610
|
+
.
|
|
611
|
+
|
|
612
|
+
*/
|
|
613
|
+
|
|
108
614
|
id:string;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* @description The display name used in web interface for identifying the coupon.
|
|
618
|
+
**Note:**
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
When the name of the coupon set contains a special character; for example: `#`, the API returns an error.
|
|
622
|
+
Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
|
|
623
|
+
.
|
|
624
|
+
|
|
625
|
+
*/
|
|
626
|
+
|
|
109
627
|
name:string;
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* @description Display name used in invoice. If it is not configured then name is used in invoice.
|
|
631
|
+
|
|
632
|
+
*/
|
|
633
|
+
|
|
110
634
|
invoice_name?:string;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* @description The type of deduction. \* percentage - The specified percentage will be deducted. \* fixed_amount - The specified amount will be deducted. \* offer_quantity - The specified units will be offered for free.
|
|
638
|
+
|
|
639
|
+
*/
|
|
640
|
+
|
|
111
641
|
discount_type:'fixed_amount' | 'percentage';
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
645
|
+
|
|
646
|
+
*/
|
|
647
|
+
|
|
112
648
|
discount_amount?:number;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/2.0/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
|
|
652
|
+
|
|
653
|
+
*/
|
|
654
|
+
|
|
113
655
|
currency_code?:string;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* @description The percentage of the original amount that should be deducted from it.
|
|
659
|
+
|
|
660
|
+
*/
|
|
661
|
+
|
|
114
662
|
discount_percentage?:number;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* @description The amount on the invoice to which the coupon is applied. \* invoice_amount - The coupon is applied to the invoice `sub_total`. \* each_unit_of_specified_items - Discount will be applied to each unit of plan and addon items specified. \* each_specified_item - The coupon is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id`. \* specified_items_total - Discount will be applied to the total of plan and addon items specified.
|
|
666
|
+
|
|
667
|
+
*/
|
|
668
|
+
|
|
115
669
|
apply_on:'invoice_amount' | 'each_specified_item';
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* @description Specifies the time duration for which this coupon is attached to the subscription. \* forever - The coupon is attached to the subscription and applied on the invoices until explicitly removed. \* one_time - The coupon stays attached to the subscription till it is applied on an invoice **once** . It is removed after that from the subscription. \* limited_period - The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by `period` and `period_unit`.
|
|
673
|
+
|
|
674
|
+
*/
|
|
675
|
+
|
|
116
676
|
duration_type:'limited_period' | 'one_time' | 'forever';
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* @description **(Deprecated)** The duration of time in months for which the coupon is attached to the subscription. Applicable only when `duration_type` is `limited_period`.
|
|
680
|
+
**Note:** This parameter has been deprecated. Use `period` and `period_unit` instead.
|
|
681
|
+
|
|
682
|
+
*/
|
|
683
|
+
|
|
117
684
|
duration_month?:number;
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* @description Date upto which the coupon can be applied to new subscriptions.
|
|
688
|
+
|
|
689
|
+
*/
|
|
690
|
+
|
|
118
691
|
valid_till?:number;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* @description Maximum number of times this coupon can be redeemed.
|
|
695
|
+
**Note:**
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
If not specified, the coupon can be redeemed an indefinite number of times.
|
|
699
|
+
.
|
|
700
|
+
|
|
701
|
+
*/
|
|
702
|
+
|
|
119
703
|
max_redemptions?:number;
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* @description A customer-facing note added to all invoices associated with this API resource. This note becomes one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
|
|
707
|
+
|
|
708
|
+
*/
|
|
709
|
+
|
|
120
710
|
invoice_notes?:string;
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* @description A set of key-value pairs stored as additional information for the coupon. [Learn more](./#meta_data).
|
|
714
|
+
|
|
715
|
+
*/
|
|
716
|
+
|
|
121
717
|
meta_data?:object;
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* @description The coupon is included in MRR calculations for your site. This attribute is only applicable for coupons of `duration_type = one_time` and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude one-time coupons from MRR calculations, this value is always returned `false`.
|
|
721
|
+
|
|
722
|
+
*/
|
|
723
|
+
|
|
122
724
|
included_in_mrr?:boolean;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* @description The duration of time for which the coupon is attached to the subscription, in `period_units`. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type).
|
|
728
|
+
|
|
729
|
+
*/
|
|
730
|
+
|
|
123
731
|
period?:number;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* @description The unit of time for period. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type). \* month - A period of 1 calendar month. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours.
|
|
735
|
+
|
|
736
|
+
*/
|
|
737
|
+
|
|
124
738
|
period_unit?:PeriodUnit;
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* @description Status of the coupon. \* expired - Cannot be applied to a subscription. A coupon may expire due to exceeding [max_redemptions](/docs/api/coupons?#coupon_max_redemptions) or [valid_till](/docs/api/coupons?#coupon_valid_till) date is past. Existing associations remain unaffected. \* archived - Cannot be applied to a subscription. Existing associations remain unaffected. \* active - Can be applied to a subscription. \* deleted - Indicates the coupon has been deleted.
|
|
742
|
+
|
|
743
|
+
*/
|
|
744
|
+
|
|
125
745
|
status?:'archived' | 'active';
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* @description Parameters for item_constraints
|
|
749
|
+
|
|
750
|
+
*/
|
|
751
|
+
|
|
126
752
|
item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* @description Parameters for item_constraint_criteria
|
|
756
|
+
|
|
757
|
+
*/
|
|
758
|
+
|
|
127
759
|
item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* @description Parameters for `coupon_constraints`. Multiple `coupon_constraints` can be passed by specifying unique indices.
|
|
763
|
+
|
|
764
|
+
*/
|
|
765
|
+
|
|
128
766
|
coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
|
|
129
767
|
}
|
|
130
|
-
export interface ItemConstraint {
|
|
768
|
+
export interface ItemConstraint {
|
|
131
769
|
item_type?:'charge' | 'addon' | 'plan';
|
|
770
|
+
|
|
132
771
|
constraint?:'all' | 'criteria' | 'none' | 'specific';
|
|
772
|
+
|
|
133
773
|
item_price_ids?:any[];
|
|
134
774
|
}
|
|
135
|
-
export interface ItemConstraintCriteria {
|
|
775
|
+
export interface ItemConstraintCriteria {
|
|
136
776
|
item_type?:'charge' | 'addon' | 'plan';
|
|
777
|
+
|
|
137
778
|
currencies?:any[];
|
|
779
|
+
|
|
138
780
|
item_family_ids?:any[];
|
|
781
|
+
|
|
139
782
|
item_price_periods?:any[];
|
|
140
783
|
}
|
|
141
|
-
export interface CouponConstraint {
|
|
784
|
+
export interface CouponConstraint {
|
|
142
785
|
entity_type?:'customer';
|
|
786
|
+
|
|
143
787
|
type?:'max_redemptions' | 'unique_by';
|
|
788
|
+
|
|
144
789
|
value?:string;
|
|
145
790
|
}
|
|
146
791
|
}
|