chargebee 2.28.0 → 2.30.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/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
- package/.github/ISSUE_TEMPLATE/config.yml +6 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- package/.github/workflows/greeting.yml +47 -0
- package/CHANGELOG.md +59 -0
- package/SECURITY.md +8 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +0 -14
- package/package.json +1 -1
- package/types/core.d.ts +4 -4
- package/types/resources/AttachedItem.d.ts +88 -88
- package/types/resources/Card.d.ts +68 -68
- package/types/resources/Comment.d.ts +50 -44
- package/types/resources/Coupon.d.ts +242 -207
- package/types/resources/CouponSet.d.ts +72 -68
- package/types/resources/CreditNote.d.ts +612 -236
- package/types/resources/Customer.d.ts +655 -513
- package/types/resources/DifferentialPrice.d.ts +99 -74
- package/types/resources/EntitlementOverride.d.ts +27 -12
- package/types/resources/Estimate.d.ts +450 -450
- package/types/resources/Event.d.ts +30 -12
- package/types/resources/Export.d.ts +200 -200
- package/types/resources/Feature.d.ts +66 -35
- package/types/resources/Gift.d.ts +54 -44
- package/types/resources/HostedPage.d.ts +381 -381
- package/types/resources/InAppSubscription.d.ts +94 -90
- package/types/resources/Invoice.d.ts +1242 -660
- package/types/resources/Item.d.ts +148 -142
- package/types/resources/ItemEntitlement.d.ts +36 -36
- package/types/resources/ItemFamily.d.ts +45 -45
- package/types/resources/ItemPrice.d.ts +317 -273
- package/types/resources/PaymentIntent.d.ts +60 -60
- package/types/resources/PaymentReferenceNumber.d.ts +1 -1
- package/types/resources/PaymentVoucher.d.ts +74 -59
- package/types/resources/PortalSession.d.ts +45 -20
- package/types/resources/PromotionalCredit.d.ts +68 -68
- package/types/resources/Purchase.d.ts +3 -3
- package/types/resources/Quote.d.ts +655 -366
- package/types/resources/QuoteLineGroup.d.ts +245 -0
- package/types/resources/QuotedCharge.d.ts +170 -0
- package/types/resources/QuotedSubscription.d.ts +219 -0
- package/types/resources/SiteMigrationDetail.d.ts +7 -7
- package/types/resources/Subscription.d.ts +1219 -932
- package/types/resources/SubscriptionEntitlement.d.ts +33 -12
- package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
- package/types/resources/TimeMachine.d.ts +15 -15
- package/types/resources/Token.d.ts +0 -116
- package/types/resources/Transaction.d.ts +229 -112
- package/types/resources/UnbilledCharge.d.ts +112 -67
- package/types/resources/Usage.d.ts +46 -47
- package/types/resources/VirtualBankAccount.d.ts +66 -66
- package/types/resources/Media.d.ts +0 -33
- package/types/resources/NonSubscription.d.ts +0 -65
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface Coupon {
|
|
4
|
-
|
|
4
|
+
[key : string] : any;
|
|
5
5
|
/**
|
|
6
6
|
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
7
7
|
**Note:**
|
|
@@ -181,11 +181,11 @@ Note that this does not change when the [redemptions](/docs/api/coupons?#coupon_
|
|
|
181
181
|
export namespace Coupon {
|
|
182
182
|
export class CouponResource {
|
|
183
183
|
/**
|
|
184
|
-
* @description
|
|
184
|
+
* @description This API creates a new coupon for a specific promotion or offers.
|
|
185
185
|
|
|
186
186
|
*/
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
create_for_items(input:CreateForItemsInputParam):ChargebeeRequest<CreateForItemsResponse>;
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* @description This API updates a coupon that is created for a specific promotion or offers.
|
|
@@ -195,11 +195,18 @@ Note that this does not change when the [redemptions](/docs/api/coupons?#coupon_
|
|
|
195
195
|
update_for_items(coupon_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
* @description
|
|
198
|
+
* @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.
|
|
199
199
|
|
|
200
200
|
*/
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @description This API retrieves a specific coupon using the coupon ID.
|
|
206
|
+
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
retrieve(coupon_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
203
210
|
|
|
204
211
|
/**
|
|
205
212
|
* @description If no Subscriptions/Invoices are linked to this Coupon, the Coupon will be deleted from your Chargebee site. This action cannot be undone.
|
|
@@ -223,149 +230,189 @@ The value for [redemptions](./coupons?prod_cat_ver=2#coupon_redemptions) is
|
|
|
223
230
|
copy(input:CopyInputParam):ChargebeeRequest<CopyResponse>;
|
|
224
231
|
|
|
225
232
|
/**
|
|
226
|
-
* @description This API
|
|
233
|
+
* @description This API unarchives a specific coupon using the coupon ID.
|
|
227
234
|
|
|
228
235
|
*/
|
|
229
236
|
|
|
230
|
-
|
|
231
|
-
|
|
237
|
+
unarchive(coupon_id:string):ChargebeeRequest<UnarchiveResponse>;
|
|
238
|
+
}
|
|
239
|
+
export interface CreateForItemsResponse {
|
|
240
|
+
coupon:Coupon;
|
|
241
|
+
}
|
|
242
|
+
export interface CreateForItemsInputParam {
|
|
243
|
+
[key : string] : any;
|
|
232
244
|
/**
|
|
233
|
-
* @description
|
|
245
|
+
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
246
|
+
**Note:**
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
250
|
+
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
251
|
+
.
|
|
234
252
|
|
|
235
253
|
*/
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
export interface ListResponse {
|
|
254
|
+
|
|
255
|
+
id:string;
|
|
256
|
+
|
|
240
257
|
/**
|
|
241
|
-
* @description
|
|
258
|
+
* @description The display name used in web interface for identifying the coupon.
|
|
259
|
+
**Note:**
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
When the name of the coupon set contains a special character; for example: `#`, the API returns an error.
|
|
263
|
+
Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
|
|
264
|
+
.
|
|
242
265
|
|
|
243
266
|
*/
|
|
244
267
|
|
|
245
|
-
|
|
268
|
+
name:string;
|
|
246
269
|
|
|
247
270
|
/**
|
|
248
|
-
* @description
|
|
271
|
+
* @description Display name used in invoice. If it is not configured then name is used in invoice.
|
|
249
272
|
|
|
250
273
|
*/
|
|
251
274
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
export interface ListInputParam {
|
|
255
|
-
[key : string]: any;
|
|
275
|
+
invoice_name?:string;
|
|
276
|
+
|
|
256
277
|
/**
|
|
257
|
-
* @description The
|
|
278
|
+
* @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.
|
|
258
279
|
|
|
259
280
|
*/
|
|
260
|
-
|
|
261
|
-
|
|
281
|
+
|
|
282
|
+
discount_type?:'fixed_amount' | 'percentage';
|
|
262
283
|
|
|
263
284
|
/**
|
|
264
|
-
* @description
|
|
285
|
+
* @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
265
286
|
|
|
266
287
|
*/
|
|
267
|
-
|
|
268
|
-
|
|
288
|
+
|
|
289
|
+
discount_amount?:number;
|
|
269
290
|
|
|
270
291
|
/**
|
|
271
|
-
* @description
|
|
272
|
-
**Note:**
|
|
292
|
+
* @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.
|
|
273
293
|
|
|
294
|
+
*/
|
|
295
|
+
|
|
296
|
+
currency_code?:string;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @description The percentage of the original amount that should be deducted from it.
|
|
274
300
|
|
|
275
|
-
|
|
276
|
-
|
|
301
|
+
*/
|
|
302
|
+
|
|
303
|
+
discount_percentage?:number;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @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.
|
|
277
307
|
|
|
278
308
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
309
|
+
|
|
310
|
+
apply_on:'invoice_amount' | 'each_specified_item';
|
|
281
311
|
|
|
282
312
|
/**
|
|
283
|
-
* @description The
|
|
284
|
-
**Note:**
|
|
313
|
+
* @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`.
|
|
285
314
|
|
|
315
|
+
*/
|
|
316
|
+
|
|
317
|
+
duration_type?:'limited_period' | 'one_time' | 'forever';
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @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`.
|
|
321
|
+
**Note:** This parameter has been deprecated. Use `period` and `period_unit` instead.
|
|
286
322
|
|
|
287
|
-
|
|
288
|
-
|
|
323
|
+
*/
|
|
324
|
+
|
|
325
|
+
duration_month?:number;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @description Date upto which the coupon can be applied to new subscriptions.
|
|
289
329
|
|
|
290
330
|
*/
|
|
291
|
-
|
|
292
|
-
|
|
331
|
+
|
|
332
|
+
valid_till?:number;
|
|
293
333
|
|
|
294
334
|
/**
|
|
295
|
-
* @description
|
|
335
|
+
* @description Maximum number of times this coupon can be redeemed.
|
|
336
|
+
**Note:**
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
If not specified, the coupon can be redeemed an indefinite number of times.
|
|
340
|
+
.
|
|
296
341
|
|
|
297
342
|
*/
|
|
298
|
-
|
|
299
|
-
|
|
343
|
+
|
|
344
|
+
max_redemptions?:number;
|
|
300
345
|
|
|
301
346
|
/**
|
|
302
|
-
* @description
|
|
347
|
+
* @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.
|
|
303
348
|
|
|
304
349
|
*/
|
|
305
|
-
|
|
306
|
-
|
|
350
|
+
|
|
351
|
+
invoice_notes?:string;
|
|
307
352
|
|
|
308
353
|
/**
|
|
309
|
-
* @description
|
|
354
|
+
* @description A collection of key-value pairs that provides extra information about the coupon.
|
|
355
|
+
**Note:** There's a character limit of 65,535.
|
|
356
|
+
[Learn more](advanced-features?prod_cat_ver=2#metadata).
|
|
310
357
|
|
|
311
358
|
*/
|
|
312
|
-
|
|
313
|
-
|
|
359
|
+
|
|
360
|
+
meta_data?:object;
|
|
314
361
|
|
|
315
362
|
/**
|
|
316
|
-
* @description The
|
|
363
|
+
* @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`.
|
|
317
364
|
|
|
318
365
|
*/
|
|
319
|
-
|
|
320
|
-
|
|
366
|
+
|
|
367
|
+
included_in_mrr?:boolean;
|
|
321
368
|
|
|
322
369
|
/**
|
|
323
|
-
* @description
|
|
370
|
+
* @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).
|
|
324
371
|
|
|
325
372
|
*/
|
|
326
|
-
|
|
327
|
-
|
|
373
|
+
|
|
374
|
+
period?:number;
|
|
328
375
|
|
|
329
376
|
/**
|
|
330
|
-
* @description
|
|
377
|
+
* @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.
|
|
331
378
|
|
|
332
379
|
*/
|
|
333
|
-
|
|
334
|
-
|
|
380
|
+
|
|
381
|
+
period_unit?:PeriodUnit;
|
|
335
382
|
|
|
336
383
|
/**
|
|
337
|
-
* @description
|
|
384
|
+
* @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.
|
|
338
385
|
|
|
339
386
|
*/
|
|
340
|
-
|
|
341
|
-
|
|
387
|
+
|
|
388
|
+
status?:'archived' | 'active';
|
|
342
389
|
|
|
343
390
|
/**
|
|
344
|
-
* @description
|
|
391
|
+
* @description Parameters for item_constraints
|
|
345
392
|
|
|
346
393
|
*/
|
|
347
|
-
|
|
348
|
-
|
|
394
|
+
|
|
395
|
+
item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
|
|
349
396
|
|
|
350
397
|
/**
|
|
351
|
-
* @description Parameters for
|
|
398
|
+
* @description Parameters for item_constraint_criteria
|
|
352
399
|
|
|
353
400
|
*/
|
|
354
|
-
|
|
355
|
-
|
|
401
|
+
|
|
402
|
+
item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
|
|
356
403
|
|
|
357
404
|
/**
|
|
358
|
-
* @description Parameters for
|
|
405
|
+
* @description Parameters for `coupon_constraints`. Multiple `coupon_constraints` can be passed by specifying unique indices.
|
|
359
406
|
|
|
360
407
|
*/
|
|
361
|
-
|
|
362
|
-
|
|
408
|
+
|
|
409
|
+
coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
|
|
363
410
|
}
|
|
364
411
|
export interface UpdateForItemsResponse {
|
|
365
412
|
coupon:Coupon;
|
|
366
413
|
}
|
|
367
414
|
export interface UpdateForItemsInputParam {
|
|
368
|
-
|
|
415
|
+
[key : string] : any;
|
|
369
416
|
/**
|
|
370
417
|
* @description The display name used in web interface for identifying the coupon.
|
|
371
418
|
**Note:**
|
|
@@ -463,7 +510,9 @@ If not specified, the coupon can be redeemed an indefinite number of times.
|
|
|
463
510
|
invoice_notes?:string;
|
|
464
511
|
|
|
465
512
|
/**
|
|
466
|
-
* @description A
|
|
513
|
+
* @description A collection of key-value pairs that provides extra information about the coupon.
|
|
514
|
+
**Note:** There's a character limit of 65,535.
|
|
515
|
+
[Learn more](advanced-features?prod_cat_ver=2#metadata).
|
|
467
516
|
|
|
468
517
|
*/
|
|
469
518
|
|
|
@@ -511,243 +560,229 @@ If not specified, the coupon can be redeemed an indefinite number of times.
|
|
|
511
560
|
|
|
512
561
|
coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
|
|
513
562
|
}
|
|
514
|
-
export interface
|
|
515
|
-
coupon:Coupon;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
export interface DeleteResponse {
|
|
519
|
-
coupon:Coupon;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
export interface CopyResponse {
|
|
523
|
-
coupon:Coupon;
|
|
524
|
-
}
|
|
525
|
-
export interface CopyInputParam {
|
|
526
|
-
|
|
563
|
+
export interface ListResponse {
|
|
527
564
|
/**
|
|
528
|
-
* @description
|
|
529
|
-
**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.
|
|
565
|
+
* @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.
|
|
530
566
|
|
|
531
567
|
*/
|
|
532
568
|
|
|
533
|
-
|
|
569
|
+
list:{coupon:Coupon}[];
|
|
534
570
|
|
|
535
571
|
/**
|
|
536
|
-
* @description
|
|
572
|
+
* @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.
|
|
537
573
|
|
|
538
574
|
*/
|
|
539
575
|
|
|
540
|
-
|
|
541
|
-
|
|
576
|
+
next_offset?:string;
|
|
577
|
+
}
|
|
578
|
+
export interface ListInputParam {
|
|
579
|
+
[key : string]: any;
|
|
542
580
|
/**
|
|
543
|
-
* @description
|
|
581
|
+
* @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.
|
|
544
582
|
|
|
545
583
|
*/
|
|
546
|
-
|
|
547
|
-
|
|
584
|
+
|
|
585
|
+
limit?:number;
|
|
548
586
|
|
|
549
587
|
/**
|
|
550
|
-
* @description
|
|
551
|
-
**Note:** If this parameter is passed true coupon state, redemptions, coupon set and coupon codes associated with this coupon will be copied.
|
|
588
|
+
* @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.
|
|
552
589
|
|
|
553
590
|
*/
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
export interface RetrieveResponse {
|
|
558
|
-
coupon:Coupon;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
export interface CreateForItemsResponse {
|
|
562
|
-
coupon:Coupon;
|
|
563
|
-
}
|
|
564
|
-
export interface CreateForItemsInputParam {
|
|
591
|
+
|
|
592
|
+
offset?:string;
|
|
565
593
|
|
|
566
594
|
/**
|
|
567
|
-
* @description
|
|
568
|
-
**Note:**
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
572
|
-
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
573
|
-
.
|
|
595
|
+
* @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.
|
|
574
596
|
|
|
575
597
|
*/
|
|
576
|
-
|
|
577
|
-
id
|
|
598
|
+
|
|
599
|
+
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
578
600
|
|
|
579
601
|
/**
|
|
580
|
-
* @description
|
|
581
|
-
**Note:**
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
When the name of the coupon set contains a special character; for example: `#`, the API returns an error.
|
|
585
|
-
Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
|
|
586
|
-
.
|
|
602
|
+
* @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.
|
|
587
603
|
|
|
588
604
|
*/
|
|
589
|
-
|
|
590
|
-
name
|
|
605
|
+
|
|
606
|
+
name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
591
607
|
|
|
592
608
|
/**
|
|
593
|
-
* @description
|
|
609
|
+
* @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.
|
|
594
610
|
|
|
595
611
|
*/
|
|
596
|
-
|
|
597
|
-
|
|
612
|
+
|
|
613
|
+
discount_type?:{in?:string,is?:'fixed_amount' | 'percentage',is_not?:'fixed_amount' | 'percentage',not_in?:string};
|
|
598
614
|
|
|
599
615
|
/**
|
|
600
|
-
* @description
|
|
616
|
+
* @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.
|
|
601
617
|
|
|
602
618
|
*/
|
|
603
|
-
|
|
604
|
-
|
|
619
|
+
|
|
620
|
+
duration_type?:{in?:string,is?:'limited_period' | 'one_time' | 'forever',is_not?:'limited_period' | 'one_time' | 'forever',not_in?:string};
|
|
605
621
|
|
|
606
622
|
/**
|
|
607
|
-
* @description
|
|
623
|
+
* @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.
|
|
608
624
|
|
|
609
625
|
*/
|
|
610
|
-
|
|
611
|
-
|
|
626
|
+
|
|
627
|
+
status?:{in?:string,is?:'archived' | 'expired' | 'deleted' | 'active',is_not?:'archived' | 'expired' | 'deleted' | 'active',not_in?:string};
|
|
612
628
|
|
|
613
629
|
/**
|
|
614
|
-
* @description
|
|
630
|
+
* @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.
|
|
615
631
|
|
|
616
632
|
*/
|
|
617
|
-
|
|
618
|
-
|
|
633
|
+
|
|
634
|
+
apply_on?:{in?:string,is?:'invoice_amount' | 'each_specified_item',is_not?:'invoice_amount' | 'each_specified_item',not_in?:string};
|
|
619
635
|
|
|
620
636
|
/**
|
|
621
|
-
* @description
|
|
637
|
+
* @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.
|
|
622
638
|
|
|
623
639
|
*/
|
|
624
|
-
|
|
625
|
-
|
|
640
|
+
|
|
641
|
+
created_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
626
642
|
|
|
627
643
|
/**
|
|
628
|
-
* @description
|
|
644
|
+
* @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.
|
|
629
645
|
|
|
630
646
|
*/
|
|
631
|
-
|
|
632
|
-
|
|
647
|
+
|
|
648
|
+
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
633
649
|
|
|
634
650
|
/**
|
|
635
|
-
* @description
|
|
651
|
+
* @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.
|
|
636
652
|
|
|
637
653
|
*/
|
|
638
|
-
|
|
639
|
-
|
|
654
|
+
|
|
655
|
+
sort_by?:{asc?:'created_at',desc?:'created_at'};
|
|
640
656
|
|
|
641
657
|
/**
|
|
642
|
-
* @description
|
|
643
|
-
**Note:** This parameter has been deprecated. Use `period` and `period_unit` instead.
|
|
658
|
+
* @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.
|
|
644
659
|
|
|
645
660
|
*/
|
|
646
|
-
|
|
647
|
-
|
|
661
|
+
|
|
662
|
+
currency_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
663
|
+
}
|
|
664
|
+
export interface RetrieveResponse {
|
|
665
|
+
coupon:Coupon;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export interface DeleteResponse {
|
|
669
|
+
coupon:Coupon;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export interface CopyResponse {
|
|
673
|
+
coupon:Coupon;
|
|
674
|
+
}
|
|
675
|
+
export interface CopyInputParam {
|
|
648
676
|
|
|
649
677
|
/**
|
|
650
|
-
* @description
|
|
678
|
+
* @description Your Chargebee site name having the coupon to be copied.
|
|
679
|
+
**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.
|
|
651
680
|
|
|
652
681
|
*/
|
|
653
682
|
|
|
654
|
-
|
|
683
|
+
from_site:string;
|
|
655
684
|
|
|
656
685
|
/**
|
|
657
|
-
* @description
|
|
658
|
-
**Note:**
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
If not specified, the coupon can be redeemed an indefinite number of times.
|
|
662
|
-
.
|
|
686
|
+
* @description Id of the coupon to be copied. The new coupon created in this site will have the same Id.
|
|
663
687
|
|
|
664
688
|
*/
|
|
665
689
|
|
|
666
|
-
|
|
690
|
+
id_at_from_site:string;
|
|
667
691
|
|
|
668
692
|
/**
|
|
669
|
-
* @description
|
|
693
|
+
* @description Id of copied coupon in this site.
|
|
670
694
|
|
|
671
695
|
*/
|
|
672
696
|
|
|
673
|
-
|
|
697
|
+
id?:string;
|
|
674
698
|
|
|
675
699
|
/**
|
|
676
|
-
* @description
|
|
700
|
+
* @description If copy action is performed as part of Chargebee site merge action, pass the value as true.
|
|
701
|
+
**Note:** If this parameter is passed true coupon state, redemptions, coupon set and coupon codes associated with this coupon will be copied.
|
|
677
702
|
|
|
678
703
|
*/
|
|
679
704
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
705
|
+
for_site_merging?:boolean;
|
|
706
|
+
}
|
|
707
|
+
export interface UnarchiveResponse {
|
|
708
|
+
coupon:Coupon;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export interface ItemConstraint {
|
|
712
|
+
/**
|
|
713
|
+
* @description Item type for which this criteria is applicable for. \* charge - Charge \* plan - Plan \* addon - Addon
|
|
684
714
|
|
|
685
|
-
|
|
715
|
+
*/
|
|
686
716
|
|
|
687
|
-
|
|
717
|
+
item_type:'charge' | 'addon' | 'plan';
|
|
688
718
|
|
|
689
|
-
|
|
690
|
-
|
|
719
|
+
/**
|
|
720
|
+
* @description Constraint applicable for the item \* specific - Coupon applicable to specific items. \* all - Coupon applicable to all items. \* criteria - Coupon applicable based on criteria. \* none - Coupon not applicable to any items.
|
|
691
721
|
|
|
692
|
-
|
|
722
|
+
*/
|
|
693
723
|
|
|
694
|
-
|
|
724
|
+
constraint:'all' | 'criteria' | 'none' | 'specific';
|
|
695
725
|
|
|
696
|
-
|
|
697
|
-
|
|
726
|
+
/**
|
|
727
|
+
* @description List of item price ids for which this coupon is applicable.
|
|
698
728
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
period_unit?:PeriodUnit;
|
|
729
|
+
*/
|
|
702
730
|
|
|
703
|
-
|
|
704
|
-
|
|
731
|
+
item_price_ids?:any[];
|
|
732
|
+
}
|
|
733
|
+
export interface ItemConstraintCriteria {
|
|
734
|
+
/**
|
|
735
|
+
* @description Item type for which this criteria is applicable for. \* charge - Charge is a type of item \* plan - Plan is a type of item \* addon - Addon is a type of item
|
|
705
736
|
|
|
706
|
-
|
|
737
|
+
*/
|
|
707
738
|
|
|
708
|
-
|
|
739
|
+
item_type:'charge' | 'addon' | 'plan';
|
|
709
740
|
|
|
710
|
-
|
|
711
|
-
|
|
741
|
+
/**
|
|
742
|
+
* @description List of currencies ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) for which this coupon is applicable.
|
|
712
743
|
|
|
713
|
-
|
|
744
|
+
*/
|
|
714
745
|
|
|
715
|
-
|
|
746
|
+
currencies?:any[];
|
|
716
747
|
|
|
717
|
-
|
|
718
|
-
|
|
748
|
+
/**
|
|
749
|
+
* @description List of families for which this coupon is applicable.
|
|
719
750
|
|
|
720
|
-
|
|
751
|
+
*/
|
|
721
752
|
|
|
722
|
-
|
|
753
|
+
item_family_ids?:any[];
|
|
723
754
|
|
|
724
|
-
|
|
725
|
-
|
|
755
|
+
/**
|
|
756
|
+
* @description List of frequencies for which this coupon is applicable. Allowed frequencies are \[day, week, month, year\].
|
|
726
757
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
|
|
730
|
-
}
|
|
731
|
-
export interface ItemConstraint {
|
|
732
|
-
item_type?:'charge' | 'addon' | 'plan';
|
|
733
|
-
|
|
734
|
-
constraint?:'all' | 'criteria' | 'none' | 'specific';
|
|
758
|
+
*/
|
|
735
759
|
|
|
736
|
-
|
|
760
|
+
item_price_periods?:any[];
|
|
737
761
|
}
|
|
738
|
-
export interface
|
|
739
|
-
|
|
762
|
+
export interface CouponConstraint {
|
|
763
|
+
/**
|
|
764
|
+
* @description The resource type for the constraint. This, along with `type` and `value`, helps define the specific rule applied. \* customer - The constraint is based on `customer` records.
|
|
765
|
+
|
|
766
|
+
*/
|
|
740
767
|
|
|
741
|
-
|
|
768
|
+
entity_type:'customer';
|
|
742
769
|
|
|
743
|
-
|
|
770
|
+
/**
|
|
771
|
+
* @description Type of coupon constraints \* unique_by - Indicates - when `entity_type` is `customer` - that the coupon can be redeemed only once for every unique value of a specified `customer` attribute. The `customer` attribute is specified using `value`. For example, if `value` is `email`, then the coupon can be redeemed only once for every unique value of `customer.email`. In other words, when there are multiple `customer` records with the same value for `email`, once the coupon has been redeemed for one of those customer records, no further redemptions of the coupon are allowed for any of those `customer` records. \* max_redemptions - The coupon can be redeemed up to a set number of times for a specific resource type. The maximum redemptions are specified using `value`, and the resource type is specified using `entity_type`. For example, if `entity_type` is `customer` and `value` is `10` then the coupon can only be redeemed up to 10 times for any particular `customer` record.
|
|
772
|
+
|
|
773
|
+
*/
|
|
744
774
|
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
export interface CouponConstraint {
|
|
748
|
-
entity_type?:'customer';
|
|
775
|
+
type:'max_redemptions' | 'unique_by';
|
|
749
776
|
|
|
750
|
-
|
|
777
|
+
/**
|
|
778
|
+
* @description The value of the coupon constraint. The possible values depend on the value of `constraints[type]`:
|
|
779
|
+
|
|
780
|
+
* When `type` is `unique_by`, then `value` can be `email` or `id`.
|
|
781
|
+
|
|
782
|
+
* When `type` is `max_redemptions`, then `value` can be any integer in the range `1` `coupon.max_redemptions`, inclusive.
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
*/
|
|
751
786
|
|
|
752
787
|
value?:string;
|
|
753
788
|
}
|