chargebee 2.41.0 → 3.0.0-beta.2
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 +11 -15
- package/LICENSE +1 -1
- package/README.md +90 -170
- package/cjs/RequestWrapper.js +84 -0
- package/cjs/asyncApiSupport.js +39 -0
- package/cjs/chargebee.cjs.js +13 -0
- package/cjs/chargebee.cjs.worker.js +9 -0
- package/cjs/chargebeeError.js +17 -0
- package/cjs/coreCommon.js +72 -0
- package/cjs/createChargebee.js +92 -0
- package/cjs/environment.js +18 -0
- package/cjs/filter.js +1 -0
- package/cjs/net/ClientInterface.js +40 -0
- package/cjs/net/FetchClient.js +86 -0
- package/cjs/net/NodeClient.js +61 -0
- package/cjs/package.json +1 -0
- package/cjs/resources/api_endpoints.js +1086 -0
- package/cjs/util.js +218 -0
- package/esm/RequestWrapper.js +80 -0
- package/esm/asyncApiSupport.js +35 -0
- package/esm/chargebee.esm.js +9 -0
- package/esm/chargebee.esm.worker.js +5 -0
- package/esm/chargebeeError.js +13 -0
- package/esm/coreCommon.js +67 -0
- package/esm/createChargebee.js +88 -0
- package/esm/environment.js +15 -0
- package/esm/filter.js +1 -0
- package/esm/net/ClientInterface.js +35 -0
- package/esm/net/FetchClient.js +81 -0
- package/esm/net/NodeClient.js +56 -0
- package/esm/package.json +1 -0
- package/esm/resources/api_endpoints.js +1083 -0
- package/esm/util.js +202 -0
- package/package.json +69 -38
- package/types/core.d.ts +558 -89
- package/types/index.d.ts +90 -55
- package/types/resources/Address.d.ts +57 -272
- package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
- package/types/resources/AttachedItem.d.ts +91 -329
- package/types/resources/Attribute.d.ts +5 -5
- package/types/resources/BusinessEntity.d.ts +49 -69
- package/types/resources/BusinessEntityTransfer.d.ts +11 -17
- package/types/resources/Card.d.ts +146 -424
- package/types/resources/Comment.d.ts +72 -189
- package/types/resources/Contact.d.ts +12 -64
- package/types/resources/ContractTerm.d.ts +15 -96
- package/types/resources/Coupon.d.ts +282 -758
- package/types/resources/CouponCode.d.ts +56 -52
- package/types/resources/CouponSet.d.ts +92 -234
- package/types/resources/CreditNote.d.ts +588 -1758
- package/types/resources/CreditNoteEstimate.d.ts +131 -157
- package/types/resources/Currency.d.ts +75 -62
- package/types/resources/Customer.d.ts +892 -835
- package/types/resources/CustomerEntitlement.d.ts +24 -35
- package/types/resources/DifferentialPrice.d.ts +116 -314
- package/types/resources/Discount.d.ts +20 -125
- package/types/resources/Download.d.ts +6 -22
- package/types/resources/Entitlement.d.ts +51 -160
- package/types/resources/EntitlementOverride.d.ts +58 -139
- package/types/resources/Estimate.d.ts +1178 -527
- package/types/resources/Event.d.ts +67 -178
- package/types/resources/Export.d.ts +563 -723
- package/types/resources/Feature.d.ts +117 -433
- package/types/resources/GatewayErrorDetail.d.ts +16 -72
- package/types/resources/Gift.d.ts +265 -432
- package/types/resources/Hierarchy.d.ts +8 -36
- package/types/resources/HostedPage.d.ts +1017 -1153
- package/types/resources/ImpactedItem.d.ts +13 -50
- package/types/resources/ImpactedItemPrice.d.ts +13 -15
- package/types/resources/ImpactedSubscription.d.ts +13 -45
- package/types/resources/InAppSubscription.d.ts +93 -389
- package/types/resources/Installment.d.ts +35 -110
- package/types/resources/InstallmentConfig.d.ts +54 -155
- package/types/resources/InstallmentDetail.d.ts +19 -27
- package/types/resources/Invoice.d.ts +1574 -3157
- package/types/resources/InvoiceEstimate.d.ts +131 -161
- package/types/resources/Item.d.ts +133 -611
- package/types/resources/ItemEntitlement.d.ts +78 -215
- package/types/resources/ItemFamily.d.ts +69 -178
- package/types/resources/ItemPrice.d.ts +291 -1203
- package/types/resources/Metadata.d.ts +3 -5
- package/types/resources/Order.d.ts +538 -1471
- package/types/resources/PaymentIntent.d.ts +163 -347
- package/types/resources/PaymentReferenceNumber.d.ts +7 -29
- package/types/resources/PaymentSource.d.ts +476 -1272
- package/types/resources/PaymentVoucher.d.ts +87 -306
- package/types/resources/PortalSession.d.ts +71 -207
- package/types/resources/PriceVariant.d.ts +91 -279
- package/types/resources/PricingPageSession.d.ts +92 -41
- package/types/resources/PromotionalCredit.d.ts +90 -346
- package/types/resources/Purchase.d.ts +185 -315
- package/types/resources/Quote.d.ts +1406 -887
- package/types/resources/QuoteLineGroup.d.ts +125 -452
- package/types/resources/QuotedCharge.d.ts +45 -274
- package/types/resources/QuotedSubscription.d.ts +100 -488
- package/types/resources/Ramp.d.ts +230 -747
- package/types/resources/ResourceMigration.d.ts +25 -80
- package/types/resources/SiteMigrationDetail.d.ts +34 -112
- package/types/resources/Subscription.d.ts +2390 -4336
- package/types/resources/SubscriptionEntitlement.d.ts +59 -160
- package/types/resources/SubscriptionEstimate.d.ts +51 -75
- package/types/resources/TaxWithheld.d.ts +15 -40
- package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
- package/types/resources/TimeMachine.d.ts +43 -97
- package/types/resources/Token.d.ts +15 -85
- package/types/resources/Transaction.d.ts +276 -911
- package/types/resources/UnbilledCharge.d.ts +189 -164
- package/types/resources/Usage.d.ts +89 -279
- package/types/resources/VirtualBankAccount.d.ts +103 -255
- package/types/resources/filter.d.ts +52 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
- package/.github/ISSUE_TEMPLATE/config.yml +0 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/lib/chargebee.js +0 -512
- package/lib/resources/api_endpoints.js +0 -2935
- package/types/resources/NonSubscription.d.ts +0 -30
- package/types/resources/Session.d.ts +0 -41
|
@@ -1,790 +1,314 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
2
4
|
declare module 'chargebee' {
|
|
3
5
|
export interface Coupon {
|
|
4
|
-
[key
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
-
apply_on:'invoice_amount' | 'each_specified_item';
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @description Timestamp indicating when this coupon is created.
|
|
105
|
-
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
created_at:number;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @description Timestamp indicating when this coupon was archived.
|
|
112
|
-
|
|
113
|
-
*/
|
|
114
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
144
|
-
period_unit?:PeriodUnit;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @description The number of times this coupon has been redeemed.
|
|
148
|
-
|
|
149
|
-
*/
|
|
150
|
-
|
|
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
|
-
|
|
158
|
-
invoice_notes?:string;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* @description The list of item constraints.
|
|
162
|
-
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
item_constraints?:Coupon.ItemConstraint[];
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* @description The list of item constraint criteria.
|
|
169
|
-
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
item_constraint_criteria?:Coupon.ItemConstraintCriteria[];
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* @description List of constraints applicable on the redemption of this coupon.
|
|
176
|
-
|
|
177
|
-
*/
|
|
178
|
-
|
|
179
|
-
coupon_constraints?:Coupon.CouponConstraint[];
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
invoice_name?: string;
|
|
10
|
+
discount_type: 'fixed_amount' | 'percentage';
|
|
11
|
+
discount_percentage?: number;
|
|
12
|
+
discount_amount?: number;
|
|
13
|
+
discount_quantity?: number;
|
|
14
|
+
currency_code?: string;
|
|
15
|
+
duration_type: 'one_time' | 'forever' | 'limited_period';
|
|
16
|
+
duration_month?: number;
|
|
17
|
+
valid_till?: number;
|
|
18
|
+
max_redemptions?: number;
|
|
19
|
+
status?: 'active' | 'expired' | 'archived' | 'deleted';
|
|
20
|
+
apply_discount_on:
|
|
21
|
+
| 'plans'
|
|
22
|
+
| 'plans_and_addons'
|
|
23
|
+
| 'plans_with_quantity'
|
|
24
|
+
| 'not_applicable';
|
|
25
|
+
apply_on: 'invoice_amount' | 'each_specified_item';
|
|
26
|
+
plan_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
|
|
27
|
+
addon_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
|
|
28
|
+
created_at: number;
|
|
29
|
+
archived_at?: number;
|
|
30
|
+
resource_version?: number;
|
|
31
|
+
updated_at?: number;
|
|
32
|
+
included_in_mrr?: boolean;
|
|
33
|
+
period?: number;
|
|
34
|
+
period_unit?: PeriodUnit;
|
|
35
|
+
plan_ids?: string[];
|
|
36
|
+
addon_ids?: string[];
|
|
37
|
+
item_constraints?: Coupon.ItemConstraint[];
|
|
38
|
+
item_constraint_criteria?: Coupon.ItemConstraintCriteria[];
|
|
39
|
+
redemptions?: number;
|
|
40
|
+
invoice_notes?: string;
|
|
41
|
+
meta_data?: any;
|
|
42
|
+
coupon_constraints?: Coupon.CouponConstraint[];
|
|
180
43
|
}
|
|
181
|
-
export namespace Coupon {
|
|
182
|
-
export class CouponResource {
|
|
183
|
-
/**
|
|
184
|
-
* @description This API creates a new coupon for a specific promotion or offers.
|
|
185
44
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
45
|
+
export namespace Coupon {
|
|
46
|
+
export class CouponResource {
|
|
47
|
+
create(
|
|
48
|
+
input: CreateInputParam,
|
|
49
|
+
headers?: ChargebeeRequestHeader,
|
|
50
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
51
|
+
|
|
52
|
+
createForItems(
|
|
53
|
+
input: CreateForItemsInputParam,
|
|
54
|
+
headers?: ChargebeeRequestHeader,
|
|
55
|
+
): Promise<ChargebeeResponse<CreateForItemsResponse>>;
|
|
56
|
+
|
|
57
|
+
updateForItems(
|
|
58
|
+
coupon_id: string,
|
|
59
|
+
input: UpdateForItemsInputParam,
|
|
60
|
+
headers?: ChargebeeRequestHeader,
|
|
61
|
+
): Promise<ChargebeeResponse<UpdateForItemsResponse>>;
|
|
62
|
+
|
|
63
|
+
list(
|
|
64
|
+
input?: ListInputParam,
|
|
65
|
+
headers?: ChargebeeRequestHeader,
|
|
66
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
67
|
+
|
|
68
|
+
retrieve(
|
|
69
|
+
coupon_id: string,
|
|
70
|
+
headers?: ChargebeeRequestHeader,
|
|
71
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
72
|
+
|
|
73
|
+
update(
|
|
74
|
+
coupon_id: string,
|
|
75
|
+
input?: UpdateInputParam,
|
|
76
|
+
headers?: ChargebeeRequestHeader,
|
|
77
|
+
): Promise<ChargebeeResponse<UpdateResponse>>;
|
|
78
|
+
|
|
79
|
+
delete(
|
|
80
|
+
coupon_id: string,
|
|
81
|
+
headers?: ChargebeeRequestHeader,
|
|
82
|
+
): Promise<ChargebeeResponse<DeleteResponse>>;
|
|
83
|
+
|
|
84
|
+
copy(
|
|
85
|
+
input: CopyInputParam,
|
|
86
|
+
headers?: ChargebeeRequestHeader,
|
|
87
|
+
): Promise<ChargebeeResponse<CopyResponse>>;
|
|
88
|
+
|
|
89
|
+
unarchive(
|
|
90
|
+
coupon_id: string,
|
|
91
|
+
headers?: ChargebeeRequestHeader,
|
|
92
|
+
): Promise<ChargebeeResponse<UnarchiveResponse>>;
|
|
93
|
+
}
|
|
192
94
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
/**
|
|
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.
|
|
95
|
+
export interface CreateResponse {
|
|
96
|
+
coupon: Coupon;
|
|
97
|
+
}
|
|
199
98
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* @description This API retrieves a specific coupon using the coupon ID.
|
|
99
|
+
export interface CreateForItemsResponse {
|
|
100
|
+
coupon: Coupon;
|
|
101
|
+
}
|
|
206
102
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
/**
|
|
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.
|
|
103
|
+
export interface UpdateForItemsResponse {
|
|
104
|
+
coupon: Coupon;
|
|
105
|
+
}
|
|
213
106
|
|
|
214
|
-
|
|
107
|
+
export interface ListResponse {
|
|
108
|
+
list: { coupon: Coupon }[];
|
|
109
|
+
next_offset?: string;
|
|
110
|
+
}
|
|
215
111
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @description Copies a coupon over from one site to another. Copying of [archived](./coupons?prod_cat_ver=2#coupon_status) coupons is not supported.
|
|
112
|
+
export interface RetrieveResponse {
|
|
113
|
+
coupon: Coupon;
|
|
114
|
+
}
|
|
222
115
|
|
|
223
|
-
|
|
116
|
+
export interface UpdateResponse {
|
|
117
|
+
coupon: Coupon;
|
|
118
|
+
}
|
|
224
119
|
|
|
225
|
-
|
|
120
|
+
export interface DeleteResponse {
|
|
121
|
+
coupon: Coupon;
|
|
122
|
+
}
|
|
226
123
|
|
|
124
|
+
export interface CopyResponse {
|
|
125
|
+
coupon: Coupon;
|
|
126
|
+
}
|
|
227
127
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @description This API unarchives a specific coupon using the coupon ID.
|
|
128
|
+
export interface UnarchiveResponse {
|
|
129
|
+
coupon: Coupon;
|
|
130
|
+
}
|
|
234
131
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
132
|
+
export interface ItemConstraint {
|
|
133
|
+
item_type: 'plan' | 'addon' | 'charge';
|
|
134
|
+
constraint: 'none' | 'all' | 'specific' | 'criteria';
|
|
135
|
+
item_price_ids?: any[];
|
|
238
136
|
}
|
|
239
|
-
export interface
|
|
240
|
-
|
|
137
|
+
export interface ItemConstraintCriteria {
|
|
138
|
+
item_type: 'plan' | 'addon' | 'charge';
|
|
139
|
+
currencies?: any[];
|
|
140
|
+
item_family_ids?: any[];
|
|
141
|
+
item_price_periods?: any[];
|
|
241
142
|
}
|
|
242
|
-
export interface
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
-
.
|
|
252
|
-
|
|
253
|
-
*/
|
|
254
|
-
|
|
255
|
-
id:string;
|
|
256
|
-
|
|
257
|
-
/**
|
|
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
|
-
.
|
|
265
|
-
|
|
266
|
-
*/
|
|
267
|
-
|
|
268
|
-
name:string;
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* @description Display name used in invoice. If it is not configured then name is used in invoice.
|
|
272
|
-
|
|
273
|
-
*/
|
|
274
|
-
|
|
275
|
-
invoice_name?:string;
|
|
276
|
-
|
|
277
|
-
/**
|
|
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.
|
|
279
|
-
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
|
-
discount_type?:'fixed_amount' | 'percentage';
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
286
|
-
|
|
287
|
-
*/
|
|
288
|
-
|
|
289
|
-
discount_amount?:number;
|
|
290
|
-
|
|
291
|
-
/**
|
|
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.
|
|
293
|
-
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
currency_code?:string;
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* @description The percentage of the original amount that should be deducted from it.
|
|
300
|
-
|
|
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.
|
|
307
|
-
|
|
308
|
-
*/
|
|
309
|
-
|
|
310
|
-
apply_on:'invoice_amount' | 'each_specified_item';
|
|
311
|
-
|
|
312
|
-
/**
|
|
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`.
|
|
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.
|
|
322
|
-
|
|
323
|
-
*/
|
|
324
|
-
|
|
325
|
-
duration_month?:number;
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* @description Date upto which the coupon can be applied to new subscriptions.
|
|
329
|
-
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
valid_till?:number;
|
|
333
|
-
|
|
334
|
-
/**
|
|
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
|
-
.
|
|
341
|
-
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
max_redemptions?:number;
|
|
345
|
-
|
|
346
|
-
/**
|
|
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.
|
|
348
|
-
|
|
349
|
-
*/
|
|
350
|
-
|
|
351
|
-
invoice_notes?:string;
|
|
352
|
-
|
|
353
|
-
/**
|
|
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).
|
|
357
|
-
|
|
358
|
-
*/
|
|
359
|
-
|
|
360
|
-
meta_data?:object;
|
|
361
|
-
|
|
362
|
-
/**
|
|
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`.
|
|
364
|
-
|
|
365
|
-
*/
|
|
366
|
-
|
|
367
|
-
included_in_mrr?:boolean;
|
|
368
|
-
|
|
369
|
-
/**
|
|
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).
|
|
371
|
-
|
|
372
|
-
*/
|
|
373
|
-
|
|
374
|
-
period?:number;
|
|
375
|
-
|
|
376
|
-
/**
|
|
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.
|
|
378
|
-
|
|
379
|
-
*/
|
|
380
|
-
|
|
381
|
-
period_unit?:PeriodUnit;
|
|
382
|
-
|
|
383
|
-
/**
|
|
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.
|
|
385
|
-
|
|
386
|
-
*/
|
|
387
|
-
|
|
388
|
-
status?:'archived' | 'active';
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* @description Parameters for item_constraints
|
|
392
|
-
|
|
393
|
-
*/
|
|
394
|
-
|
|
395
|
-
item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* @description Parameters for item_constraint_criteria
|
|
399
|
-
|
|
400
|
-
*/
|
|
401
|
-
|
|
402
|
-
item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* @description Parameters for `coupon_constraints`. Multiple `coupon_constraints` can be passed by specifying unique indices.
|
|
406
|
-
|
|
407
|
-
*/
|
|
408
|
-
|
|
409
|
-
coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
|
|
143
|
+
export interface CouponConstraint {
|
|
144
|
+
entity_type: 'customer';
|
|
145
|
+
type: 'max_redemptions' | 'unique_by';
|
|
146
|
+
value?: string;
|
|
410
147
|
}
|
|
411
|
-
|
|
412
|
-
|
|
148
|
+
// REQUEST PARAMS
|
|
149
|
+
//---------------
|
|
150
|
+
|
|
151
|
+
export interface CreateInputParam {
|
|
152
|
+
id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
invoice_name?: string;
|
|
155
|
+
discount_type?: 'fixed_amount' | 'percentage';
|
|
156
|
+
discount_amount?: number;
|
|
157
|
+
currency_code?: string;
|
|
158
|
+
discount_percentage?: number /**
|
|
159
|
+
* @deprecated Please refer API docs to use other attributes
|
|
160
|
+
*/;
|
|
161
|
+
|
|
162
|
+
discount_quantity?: number;
|
|
163
|
+
apply_on: 'invoice_amount' | 'each_specified_item';
|
|
164
|
+
duration_type?: 'one_time' | 'forever' | 'limited_period';
|
|
165
|
+
duration_month?: number;
|
|
166
|
+
valid_till?: number;
|
|
167
|
+
max_redemptions?: number;
|
|
168
|
+
invoice_notes?: string;
|
|
169
|
+
meta_data?: any;
|
|
170
|
+
included_in_mrr?: boolean;
|
|
171
|
+
period?: number;
|
|
172
|
+
period_unit?: PeriodUnit;
|
|
173
|
+
plan_constraint?: 'none' | 'all' | 'specific';
|
|
174
|
+
addon_constraint?: 'none' | 'all' | 'specific';
|
|
175
|
+
plan_ids?: string[];
|
|
176
|
+
addon_ids?: string[];
|
|
177
|
+
status?: 'active' | 'archived';
|
|
413
178
|
}
|
|
414
|
-
export interface
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
discount_type?:'fixed_amount' | 'percentage';
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
445
|
-
|
|
446
|
-
*/
|
|
447
|
-
|
|
448
|
-
discount_amount?:number;
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* @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.
|
|
452
|
-
|
|
453
|
-
*/
|
|
454
|
-
|
|
455
|
-
currency_code?:string;
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* @description The percentage of the original amount that should be deducted from it.
|
|
459
|
-
|
|
460
|
-
*/
|
|
461
|
-
|
|
462
|
-
discount_percentage?:number;
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* @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.
|
|
466
|
-
|
|
467
|
-
*/
|
|
468
|
-
|
|
469
|
-
apply_on?:'invoice_amount' | 'each_specified_item';
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* @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`.
|
|
473
|
-
|
|
474
|
-
*/
|
|
475
|
-
|
|
476
|
-
duration_type?:'limited_period' | 'one_time' | 'forever';
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* @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`.
|
|
480
|
-
**Note:** This parameter has been deprecated. Use `period` and `period_unit` instead.
|
|
481
|
-
|
|
482
|
-
*/
|
|
483
|
-
|
|
484
|
-
duration_month?:number;
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* @description Date upto which the coupon can be applied to new subscriptions.
|
|
488
|
-
|
|
489
|
-
*/
|
|
490
|
-
|
|
491
|
-
valid_till?:number;
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* @description Maximum number of times this coupon can be redeemed.
|
|
495
|
-
**Note:**
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
If not specified, the coupon can be redeemed an indefinite number of times.
|
|
499
|
-
.
|
|
500
|
-
|
|
501
|
-
*/
|
|
502
|
-
|
|
503
|
-
max_redemptions?:number;
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* @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.
|
|
507
|
-
|
|
508
|
-
*/
|
|
509
|
-
|
|
510
|
-
invoice_notes?:string;
|
|
511
|
-
|
|
512
|
-
/**
|
|
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).
|
|
516
|
-
|
|
517
|
-
*/
|
|
518
|
-
|
|
519
|
-
meta_data?:object;
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* @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`.
|
|
523
|
-
|
|
524
|
-
*/
|
|
525
|
-
|
|
526
|
-
included_in_mrr?:boolean;
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* @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).
|
|
530
|
-
|
|
531
|
-
*/
|
|
532
|
-
|
|
533
|
-
period?:number;
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* @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.
|
|
537
|
-
|
|
538
|
-
*/
|
|
539
|
-
|
|
540
|
-
period_unit?:PeriodUnit;
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* @description Parameters for item_constraints
|
|
544
|
-
|
|
545
|
-
*/
|
|
546
|
-
|
|
547
|
-
item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* @description Parameters for item_constraint_criteria
|
|
551
|
-
|
|
552
|
-
*/
|
|
553
|
-
|
|
554
|
-
item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* @description Parameters for `coupon_constraints`. Multiple `coupon_constraints` can be passed by specifying unique indices.
|
|
558
|
-
|
|
559
|
-
*/
|
|
560
|
-
|
|
561
|
-
coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
|
|
179
|
+
export interface CreateForItemsInputParam {
|
|
180
|
+
id: string;
|
|
181
|
+
name: string;
|
|
182
|
+
invoice_name?: string;
|
|
183
|
+
discount_type?: 'fixed_amount' | 'percentage';
|
|
184
|
+
discount_amount?: number;
|
|
185
|
+
currency_code?: string;
|
|
186
|
+
discount_percentage?: number /**
|
|
187
|
+
* @deprecated Please refer API docs to use other attributes
|
|
188
|
+
*/;
|
|
189
|
+
|
|
190
|
+
discount_quantity?: number;
|
|
191
|
+
apply_on: 'invoice_amount' | 'each_specified_item';
|
|
192
|
+
duration_type?: 'one_time' | 'forever' | 'limited_period';
|
|
193
|
+
duration_month?: number;
|
|
194
|
+
valid_till?: number;
|
|
195
|
+
max_redemptions?: number;
|
|
196
|
+
invoice_notes?: string;
|
|
197
|
+
meta_data?: any;
|
|
198
|
+
included_in_mrr?: boolean;
|
|
199
|
+
period?: number;
|
|
200
|
+
period_unit?: PeriodUnit;
|
|
201
|
+
status?: 'active' | 'archived';
|
|
202
|
+
item_constraints?: ItemConstraintsCreateForItemsInputParam[];
|
|
203
|
+
item_constraint_criteria?: ItemConstraintCriteriaCreateForItemsInputParam[];
|
|
204
|
+
coupon_constraints?: CouponConstraintsCreateForItemsInputParam[];
|
|
205
|
+
[key: string]: unknown;
|
|
562
206
|
}
|
|
563
|
-
export interface
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
207
|
+
export interface UpdateForItemsInputParam {
|
|
208
|
+
name?: string;
|
|
209
|
+
invoice_name?: string;
|
|
210
|
+
discount_type?: 'fixed_amount' | 'percentage';
|
|
211
|
+
discount_amount?: number;
|
|
212
|
+
currency_code?: string;
|
|
213
|
+
discount_percentage?: number /**
|
|
214
|
+
* @deprecated Please refer API docs to use other attributes
|
|
215
|
+
*/;
|
|
216
|
+
|
|
217
|
+
discount_quantity?: number;
|
|
218
|
+
apply_on?: 'invoice_amount' | 'each_specified_item';
|
|
219
|
+
duration_type?: 'one_time' | 'forever' | 'limited_period';
|
|
220
|
+
duration_month?: number;
|
|
221
|
+
valid_till?: number;
|
|
222
|
+
max_redemptions?: number;
|
|
223
|
+
invoice_notes?: string;
|
|
224
|
+
meta_data?: any;
|
|
225
|
+
included_in_mrr?: boolean;
|
|
226
|
+
period?: number;
|
|
227
|
+
period_unit?: PeriodUnit;
|
|
228
|
+
item_constraints?: ItemConstraintsUpdateForItemsInputParam[];
|
|
229
|
+
item_constraint_criteria?: ItemConstraintCriteriaUpdateForItemsInputParam[];
|
|
230
|
+
coupon_constraints?: CouponConstraintsUpdateForItemsInputParam[];
|
|
231
|
+
[key: string]: unknown;
|
|
577
232
|
}
|
|
578
233
|
export interface ListInputParam {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
/**
|
|
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.
|
|
596
|
-
|
|
597
|
-
*/
|
|
598
|
-
|
|
599
|
-
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
600
|
-
|
|
601
|
-
/**
|
|
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.
|
|
603
|
-
|
|
604
|
-
*/
|
|
605
|
-
|
|
606
|
-
name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
607
|
-
|
|
608
|
-
/**
|
|
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.
|
|
610
|
-
|
|
611
|
-
*/
|
|
612
|
-
|
|
613
|
-
discount_type?:{in?:string,is?:'fixed_amount' | 'percentage',is_not?:'fixed_amount' | 'percentage',not_in?:string};
|
|
614
|
-
|
|
615
|
-
/**
|
|
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.
|
|
617
|
-
|
|
618
|
-
*/
|
|
619
|
-
|
|
620
|
-
duration_type?:{in?:string,is?:'limited_period' | 'one_time' | 'forever',is_not?:'limited_period' | 'one_time' | 'forever',not_in?:string};
|
|
621
|
-
|
|
622
|
-
/**
|
|
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.
|
|
624
|
-
|
|
625
|
-
*/
|
|
626
|
-
|
|
627
|
-
status?:{in?:string,is?:'archived' | 'expired' | 'deleted' | 'active',is_not?:'archived' | 'expired' | 'deleted' | 'active',not_in?:string};
|
|
628
|
-
|
|
629
|
-
/**
|
|
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.
|
|
631
|
-
|
|
632
|
-
*/
|
|
633
|
-
|
|
634
|
-
apply_on?:{in?:string,is?:'invoice_amount' | 'each_specified_item',is_not?:'invoice_amount' | 'each_specified_item',not_in?:string};
|
|
635
|
-
|
|
636
|
-
/**
|
|
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.
|
|
638
|
-
|
|
639
|
-
*/
|
|
640
|
-
|
|
641
|
-
created_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
642
|
-
|
|
643
|
-
/**
|
|
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.
|
|
645
|
-
|
|
646
|
-
*/
|
|
647
|
-
|
|
648
|
-
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
649
|
-
|
|
650
|
-
/**
|
|
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.
|
|
652
|
-
|
|
653
|
-
*/
|
|
654
|
-
|
|
655
|
-
sort_by?:{asc?:'created_at',desc?:'created_at'};
|
|
656
|
-
|
|
657
|
-
/**
|
|
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.
|
|
659
|
-
|
|
660
|
-
*/
|
|
661
|
-
|
|
662
|
-
currency_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
234
|
+
limit?: number;
|
|
235
|
+
offset?: string;
|
|
236
|
+
id?: filter.String;
|
|
237
|
+
name?: filter.String;
|
|
238
|
+
discount_type?: filter.Enum;
|
|
239
|
+
duration_type?: filter.Enum;
|
|
240
|
+
status?: filter.Enum;
|
|
241
|
+
apply_on?: filter.Enum;
|
|
242
|
+
created_at?: filter.Timestamp;
|
|
243
|
+
updated_at?: filter.Timestamp;
|
|
244
|
+
currency_code?: filter.String;
|
|
245
|
+
'sort_by[asc]'?: string;
|
|
246
|
+
'sort_by[desc]'?: string;
|
|
247
|
+
[key: string]: unknown;
|
|
663
248
|
}
|
|
664
|
-
export interface
|
|
665
|
-
|
|
249
|
+
export interface UpdateInputParam {
|
|
250
|
+
name?: string;
|
|
251
|
+
invoice_name?: string;
|
|
252
|
+
discount_type?: 'fixed_amount' | 'percentage';
|
|
253
|
+
discount_amount?: number;
|
|
254
|
+
currency_code?: string;
|
|
255
|
+
discount_percentage?: number /**
|
|
256
|
+
* @deprecated Please refer API docs to use other attributes
|
|
257
|
+
*/;
|
|
258
|
+
|
|
259
|
+
discount_quantity?: number;
|
|
260
|
+
apply_on?: 'invoice_amount' | 'each_specified_item';
|
|
261
|
+
duration_type?: 'one_time' | 'forever' | 'limited_period';
|
|
262
|
+
duration_month?: number;
|
|
263
|
+
valid_till?: number;
|
|
264
|
+
max_redemptions?: number;
|
|
265
|
+
invoice_notes?: string;
|
|
266
|
+
meta_data?: any;
|
|
267
|
+
included_in_mrr?: boolean;
|
|
268
|
+
period?: number;
|
|
269
|
+
period_unit?: PeriodUnit;
|
|
270
|
+
plan_constraint?: 'none' | 'all' | 'specific';
|
|
271
|
+
addon_constraint?: 'none' | 'all' | 'specific';
|
|
272
|
+
plan_ids?: string[];
|
|
273
|
+
addon_ids?: string[];
|
|
666
274
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
275
|
+
export interface CopyInputParam {
|
|
276
|
+
from_site: string;
|
|
277
|
+
id_at_from_site: string;
|
|
278
|
+
id?: string;
|
|
279
|
+
for_site_merging?: boolean;
|
|
670
280
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
281
|
+
export interface ItemConstraintCriteriaCreateForItemsInputParam {
|
|
282
|
+
item_type?: 'plan' | 'addon' | 'charge';
|
|
283
|
+
item_family_ids?: any;
|
|
284
|
+
currencies?: any;
|
|
285
|
+
item_price_periods?: any;
|
|
674
286
|
}
|
|
675
|
-
export interface
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
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.
|
|
680
|
-
|
|
681
|
-
*/
|
|
682
|
-
|
|
683
|
-
from_site:string;
|
|
684
|
-
|
|
685
|
-
/**
|
|
686
|
-
* @description Id of the coupon to be copied. The new coupon created in this site will have the same Id.
|
|
687
|
-
|
|
688
|
-
*/
|
|
689
|
-
|
|
690
|
-
id_at_from_site:string;
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* @description Id of copied coupon in this site.
|
|
694
|
-
|
|
695
|
-
*/
|
|
696
|
-
|
|
697
|
-
id?:string;
|
|
698
|
-
|
|
699
|
-
/**
|
|
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.
|
|
702
|
-
|
|
703
|
-
*/
|
|
704
|
-
|
|
705
|
-
for_site_merging?:boolean;
|
|
287
|
+
export interface CouponConstraintsCreateForItemsInputParam {
|
|
288
|
+
entity_type: 'customer';
|
|
289
|
+
type: 'max_redemptions' | 'unique_by';
|
|
290
|
+
value?: string;
|
|
706
291
|
}
|
|
707
|
-
export interface
|
|
708
|
-
|
|
292
|
+
export interface ItemConstraintsCreateForItemsInputParam {
|
|
293
|
+
constraint: 'none' | 'all' | 'specific' | 'criteria';
|
|
294
|
+
item_type: 'plan' | 'addon' | 'charge';
|
|
295
|
+
item_price_ids?: any;
|
|
709
296
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
*/
|
|
716
|
-
|
|
717
|
-
item_type:'charge' | 'addon' | 'plan';
|
|
718
|
-
|
|
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.
|
|
721
|
-
|
|
722
|
-
*/
|
|
723
|
-
|
|
724
|
-
constraint:'all' | 'criteria' | 'none' | 'specific';
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* @description List of item price ids for which this coupon is applicable.
|
|
728
|
-
|
|
729
|
-
*/
|
|
730
|
-
|
|
731
|
-
item_price_ids?:any[];
|
|
297
|
+
export interface ItemConstraintCriteriaUpdateForItemsInputParam {
|
|
298
|
+
item_type?: 'plan' | 'addon' | 'charge';
|
|
299
|
+
item_family_ids?: any;
|
|
300
|
+
currencies?: any;
|
|
301
|
+
item_price_periods?: any;
|
|
732
302
|
}
|
|
733
|
-
export interface
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
*/
|
|
738
|
-
|
|
739
|
-
item_type:'charge' | 'addon' | 'plan';
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* @description List of currencies ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) for which this coupon is applicable.
|
|
743
|
-
|
|
744
|
-
*/
|
|
745
|
-
|
|
746
|
-
currencies?:any[];
|
|
747
|
-
|
|
748
|
-
/**
|
|
749
|
-
* @description List of families for which this coupon is applicable.
|
|
750
|
-
|
|
751
|
-
*/
|
|
752
|
-
|
|
753
|
-
item_family_ids?:any[];
|
|
754
|
-
|
|
755
|
-
/**
|
|
756
|
-
* @description List of frequencies for which this coupon is applicable. Allowed frequencies are \[day, week, month, year\].
|
|
757
|
-
|
|
758
|
-
*/
|
|
759
|
-
|
|
760
|
-
item_price_periods?:any[];
|
|
303
|
+
export interface CouponConstraintsUpdateForItemsInputParam {
|
|
304
|
+
entity_type: 'customer';
|
|
305
|
+
type: 'max_redemptions' | 'unique_by';
|
|
306
|
+
value?: string;
|
|
761
307
|
}
|
|
762
|
-
export interface
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
*/
|
|
767
|
-
|
|
768
|
-
entity_type:'customer';
|
|
769
|
-
|
|
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
|
-
*/
|
|
774
|
-
|
|
775
|
-
type:'max_redemptions' | 'unique_by';
|
|
776
|
-
|
|
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
|
-
*/
|
|
786
|
-
|
|
787
|
-
value?:string;
|
|
308
|
+
export interface ItemConstraintsUpdateForItemsInputParam {
|
|
309
|
+
constraint: 'none' | 'all' | 'specific' | 'criteria';
|
|
310
|
+
item_type: 'plan' | 'addon' | 'charge';
|
|
311
|
+
item_price_ids?: any;
|
|
788
312
|
}
|
|
789
313
|
}
|
|
790
|
-
}
|
|
314
|
+
}
|