chargebee 3.0.1 → 3.1.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +16 -0
  4. package/esm/environment.js +1 -1
  5. package/esm/resources/api_endpoints.js +16 -0
  6. package/package.json +1 -1
  7. package/types/core.d.ts +588 -0
  8. package/types/index.d.ts +172 -0
  9. package/types/resources/Address.d.ts +71 -0
  10. package/types/resources/AdvanceInvoiceSchedule.d.ts +29 -0
  11. package/types/resources/AttachedItem.d.ts +116 -0
  12. package/types/resources/Attribute.d.ts +9 -0
  13. package/types/resources/BusinessEntity.d.ts +64 -0
  14. package/types/resources/BusinessEntityTransfer.d.ts +15 -0
  15. package/types/resources/Card.d.ts +172 -0
  16. package/types/resources/Comment.d.ts +92 -0
  17. package/types/resources/Contact.d.ts +16 -0
  18. package/types/resources/ContractTerm.d.ts +19 -0
  19. package/types/resources/Coupon.d.ts +329 -0
  20. package/types/resources/CouponCode.d.ts +70 -0
  21. package/types/resources/CouponSet.d.ts +111 -0
  22. package/types/resources/CreditNote.d.ts +629 -0
  23. package/types/resources/CreditNoteEstimate.d.ts +143 -0
  24. package/types/resources/Currency.d.ts +91 -0
  25. package/types/resources/Customer.d.ts +964 -0
  26. package/types/resources/CustomerEntitlement.d.ts +36 -0
  27. package/types/resources/DifferentialPrice.d.ts +144 -0
  28. package/types/resources/Discount.d.ts +24 -0
  29. package/types/resources/Download.d.ts +10 -0
  30. package/types/resources/Entitlement.d.ts +66 -0
  31. package/types/resources/EntitlementOverride.d.ts +76 -0
  32. package/types/resources/Estimate.d.ts +1237 -0
  33. package/types/resources/Event.d.ts +81 -0
  34. package/types/resources/Export.d.ts +615 -0
  35. package/types/resources/Feature.d.ts +142 -0
  36. package/types/resources/GatewayErrorDetail.d.ts +20 -0
  37. package/types/resources/Gift.d.ts +296 -0
  38. package/types/resources/Hierarchy.d.ts +12 -0
  39. package/types/resources/HostedPage.d.ts +1112 -0
  40. package/types/resources/ImpactedItem.d.ts +20 -0
  41. package/types/resources/ImpactedItemPrice.d.ts +20 -0
  42. package/types/resources/ImpactedSubscription.d.ts +20 -0
  43. package/types/resources/InAppSubscription.d.ts +116 -0
  44. package/types/resources/Invoice.d.ts +1695 -0
  45. package/types/resources/InvoiceEstimate.d.ts +143 -0
  46. package/types/resources/Item.d.ts +208 -0
  47. package/types/resources/ItemEntitlement.d.ts +103 -0
  48. package/types/resources/ItemFamily.d.ts +93 -0
  49. package/types/resources/ItemPrice.d.ts +332 -0
  50. package/types/resources/Metadata.d.ts +8 -0
  51. package/types/resources/NonSubscription.d.ts +48 -0
  52. package/types/resources/OmnichannelSubscription.d.ts +75 -0
  53. package/types/resources/OmnichannelTransaction.d.ts +16 -0
  54. package/types/resources/Order.d.ts +586 -0
  55. package/types/resources/PaymentIntent.d.ts +178 -0
  56. package/types/resources/PaymentReferenceNumber.d.ts +11 -0
  57. package/types/resources/PaymentSchedule.d.ts +28 -0
  58. package/types/resources/PaymentScheduleEstimate.d.ts +25 -0
  59. package/types/resources/PaymentScheduleScheme.d.ts +67 -0
  60. package/types/resources/PaymentSource.d.ts +530 -0
  61. package/types/resources/PaymentVoucher.d.ts +107 -0
  62. package/types/resources/PortalSession.d.ts +88 -0
  63. package/types/resources/PriceVariant.d.ts +116 -0
  64. package/types/resources/PricingPageSession.d.ts +130 -0
  65. package/types/resources/PromotionalCredit.d.ts +111 -0
  66. package/types/resources/Purchase.d.ts +202 -0
  67. package/types/resources/Quote.d.ts +1467 -0
  68. package/types/resources/QuoteLineGroup.d.ts +136 -0
  69. package/types/resources/QuotedCharge.d.ts +56 -0
  70. package/types/resources/QuotedSubscription.d.ts +114 -0
  71. package/types/resources/Ramp.d.ts +260 -0
  72. package/types/resources/RecordedPurchase.d.ts +60 -0
  73. package/types/resources/ResourceMigration.d.ts +36 -0
  74. package/types/resources/SiteMigrationDetail.d.ts +46 -0
  75. package/types/resources/Subscription.d.ts +2447 -0
  76. package/types/resources/SubscriptionEntitlement.d.ts +79 -0
  77. package/types/resources/SubscriptionEstimate.d.ts +59 -0
  78. package/types/resources/TaxWithheld.d.ts +19 -0
  79. package/types/resources/ThirdPartyPaymentMethod.d.ts +11 -0
  80. package/types/resources/TimeMachine.d.ts +57 -0
  81. package/types/resources/Token.d.ts +19 -0
  82. package/types/resources/Transaction.d.ts +316 -0
  83. package/types/resources/UnbilledCharge.d.ts +209 -0
  84. package/types/resources/Usage.d.ts +113 -0
  85. package/types/resources/VirtualBankAccount.d.ts +125 -0
  86. package/types/resources/filter.d.ts +52 -0
@@ -0,0 +1,92 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface Comment {
6
+ id: string;
7
+ entity_type: EntityTypeEnum;
8
+ added_by?: string;
9
+ notes: string;
10
+ created_at: number;
11
+ type: 'user' | 'system';
12
+ entity_id: string;
13
+ }
14
+
15
+ export namespace Comment {
16
+ export class CommentResource {
17
+ create(
18
+ input: CreateInputParam,
19
+ headers?: ChargebeeRequestHeader,
20
+ ): Promise<ChargebeeResponse<CreateResponse>>;
21
+
22
+ retrieve(
23
+ comment_id: string,
24
+ headers?: ChargebeeRequestHeader,
25
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
26
+
27
+ list(
28
+ input?: ListInputParam,
29
+ headers?: ChargebeeRequestHeader,
30
+ ): Promise<ChargebeeResponse<ListResponse>>;
31
+
32
+ delete(
33
+ comment_id: string,
34
+ headers?: ChargebeeRequestHeader,
35
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
36
+ }
37
+
38
+ export interface CreateResponse {
39
+ comment: Comment;
40
+ }
41
+
42
+ export interface RetrieveResponse {
43
+ comment: Comment;
44
+ }
45
+
46
+ export interface ListResponse {
47
+ list: { comment: Comment }[];
48
+ next_offset?: string;
49
+ }
50
+
51
+ export interface DeleteResponse {
52
+ comment: Comment;
53
+ }
54
+
55
+ // REQUEST PARAMS
56
+ //---------------
57
+
58
+ export interface CreateInputParam {
59
+ entity_type: EntityTypeEnum;
60
+ entity_id: string;
61
+ notes: string;
62
+ added_by?: string;
63
+ }
64
+ export interface ListInputParam {
65
+ limit?: number;
66
+ offset?: string;
67
+ entity_type?:
68
+ | 'customer'
69
+ | 'subscription'
70
+ | 'invoice'
71
+ | 'quote'
72
+ | 'credit_note'
73
+ | 'transaction'
74
+ | 'plan'
75
+ | 'addon'
76
+ | 'coupon'
77
+ | 'order'
78
+ | 'business_entity'
79
+ | 'omnichannel_subscription'
80
+ | 'omnichannel_subscription_item'
81
+ | 'omnichannel_transaction'
82
+ | 'item_family'
83
+ | 'item'
84
+ | 'item_price'
85
+ | 'price_variant';
86
+ entity_id?: string;
87
+ created_at?: filter.Timestamp;
88
+ 'sort_by[asc]'?: string;
89
+ 'sort_by[desc]'?: string;
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,16 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface Contact {
6
+ id: string;
7
+ first_name?: string;
8
+ last_name?: string;
9
+ email: string;
10
+ phone?: string;
11
+ label?: string;
12
+ enabled: boolean;
13
+ send_account_email: boolean;
14
+ send_billing_email: boolean;
15
+ }
16
+ }
@@ -0,0 +1,19 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface ContractTerm {
6
+ id: string;
7
+ status: 'active' | 'completed' | 'cancelled' | 'terminated';
8
+ contract_start: number;
9
+ contract_end: number;
10
+ billing_cycle: number;
11
+ action_at_term_end: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
12
+ total_contract_value: number;
13
+ total_contract_value_before_tax: number;
14
+ cancellation_cutoff_period?: number;
15
+ created_at: number;
16
+ subscription_id: string;
17
+ remaining_billing_cycles?: number;
18
+ }
19
+ }
@@ -0,0 +1,329 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface Coupon {
6
+ [key: string]: unknown;
7
+ id: string;
8
+ name: string;
9
+ invoice_name?: string;
10
+ discount_type: 'fixed_amount' | 'percentage' | 'offer_quantity';
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_from?: number;
18
+ valid_till?: number;
19
+ max_redemptions?: number;
20
+ status?: 'active' | 'expired' | 'archived' | 'deleted' | 'future';
21
+ apply_discount_on:
22
+ | 'plans'
23
+ | 'plans_and_addons'
24
+ | 'plans_with_quantity'
25
+ | 'not_applicable';
26
+ apply_on: 'invoice_amount' | 'each_specified_item';
27
+ plan_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
28
+ addon_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
29
+ created_at: number;
30
+ archived_at?: number;
31
+ resource_version?: number;
32
+ updated_at?: number;
33
+ included_in_mrr?: boolean;
34
+ period?: number;
35
+ period_unit?: PeriodUnitEnum;
36
+ plan_ids?: string[];
37
+ addon_ids?: string[];
38
+ item_constraints?: Coupon.ItemConstraint[];
39
+ item_constraint_criteria?: Coupon.ItemConstraintCriteria[];
40
+ redemptions?: number;
41
+ invoice_notes?: string;
42
+ meta_data?: any;
43
+ coupon_constraints?: Coupon.CouponConstraint[];
44
+ }
45
+
46
+ export namespace Coupon {
47
+ export class CouponResource {
48
+ create(
49
+ input: CreateInputParam,
50
+ headers?: ChargebeeRequestHeader,
51
+ ): Promise<ChargebeeResponse<CreateResponse>>;
52
+
53
+ createForItems(
54
+ input: CreateForItemsInputParam,
55
+ headers?: ChargebeeRequestHeader,
56
+ ): Promise<ChargebeeResponse<CreateForItemsResponse>>;
57
+
58
+ updateForItems(
59
+ coupon_id: string,
60
+ input: UpdateForItemsInputParam,
61
+ headers?: ChargebeeRequestHeader,
62
+ ): Promise<ChargebeeResponse<UpdateForItemsResponse>>;
63
+
64
+ list(
65
+ input?: ListInputParam,
66
+ headers?: ChargebeeRequestHeader,
67
+ ): Promise<ChargebeeResponse<ListResponse>>;
68
+
69
+ retrieve(
70
+ coupon_id: string,
71
+ headers?: ChargebeeRequestHeader,
72
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
73
+
74
+ update(
75
+ coupon_id: string,
76
+ input?: UpdateInputParam,
77
+ headers?: ChargebeeRequestHeader,
78
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
79
+
80
+ delete(
81
+ coupon_id: string,
82
+ headers?: ChargebeeRequestHeader,
83
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
84
+
85
+ copy(
86
+ input: CopyInputParam,
87
+ headers?: ChargebeeRequestHeader,
88
+ ): Promise<ChargebeeResponse<CopyResponse>>;
89
+
90
+ unarchive(
91
+ coupon_id: string,
92
+ headers?: ChargebeeRequestHeader,
93
+ ): Promise<ChargebeeResponse<UnarchiveResponse>>;
94
+ }
95
+
96
+ export interface CreateResponse {
97
+ coupon: Coupon;
98
+ }
99
+
100
+ export interface CreateForItemsResponse {
101
+ coupon: Coupon;
102
+ }
103
+
104
+ export interface UpdateForItemsResponse {
105
+ coupon: Coupon;
106
+ }
107
+
108
+ export interface ListResponse {
109
+ list: { coupon: Coupon }[];
110
+ next_offset?: string;
111
+ }
112
+
113
+ export interface RetrieveResponse {
114
+ coupon: Coupon;
115
+ }
116
+
117
+ export interface UpdateResponse {
118
+ coupon: Coupon;
119
+ }
120
+
121
+ export interface DeleteResponse {
122
+ coupon: Coupon;
123
+ }
124
+
125
+ export interface CopyResponse {
126
+ coupon: Coupon;
127
+ }
128
+
129
+ export interface UnarchiveResponse {
130
+ coupon: Coupon;
131
+ }
132
+
133
+ export interface ItemConstraint {
134
+ item_type: 'plan' | 'addon' | 'charge';
135
+ constraint: 'none' | 'all' | 'specific' | 'criteria';
136
+ item_price_ids?: any[];
137
+ }
138
+ export interface ItemConstraintCriteria {
139
+ item_type: 'plan' | 'addon' | 'charge';
140
+ currencies?: any[];
141
+ item_family_ids?: any[];
142
+ item_price_periods?: any[];
143
+ }
144
+ export interface CouponConstraint {
145
+ entity_type: 'customer';
146
+ type:
147
+ | 'max_redemptions'
148
+ | 'unique_by'
149
+ | 'existing_customer'
150
+ | 'new_customer';
151
+ value?: string;
152
+ }
153
+ // REQUEST PARAMS
154
+ //---------------
155
+
156
+ export interface CreateInputParam {
157
+ id: string;
158
+ name: string;
159
+ invoice_name?: string;
160
+ discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
161
+ discount_amount?: number;
162
+ currency_code?: string;
163
+ discount_percentage?: number /**
164
+ * @deprecated Please refer API docs to use other attributes
165
+ */;
166
+
167
+ discount_quantity?: number;
168
+ apply_on: 'invoice_amount' | 'each_specified_item';
169
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
170
+ duration_month?: number;
171
+ valid_till?: number;
172
+ max_redemptions?: number;
173
+ invoice_notes?: string;
174
+ meta_data?: any;
175
+ included_in_mrr?: boolean;
176
+ period?: number;
177
+ period_unit?: PeriodUnitEnum;
178
+ plan_constraint?: 'none' | 'all' | 'specific';
179
+ addon_constraint?: 'none' | 'all' | 'specific';
180
+ plan_ids?: string[];
181
+ addon_ids?: string[];
182
+ status?: 'active' | 'archived';
183
+ }
184
+ export interface CreateForItemsInputParam {
185
+ id: string;
186
+ name: string;
187
+ invoice_name?: string;
188
+ discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
189
+ discount_amount?: number;
190
+ currency_code?: string;
191
+ discount_percentage?: number /**
192
+ * @deprecated Please refer API docs to use other attributes
193
+ */;
194
+
195
+ discount_quantity?: number;
196
+ apply_on: 'invoice_amount' | 'each_specified_item';
197
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
198
+ duration_month?: number;
199
+ valid_from?: number;
200
+ valid_till?: number;
201
+ max_redemptions?: number;
202
+ invoice_notes?: string;
203
+ meta_data?: any;
204
+ included_in_mrr?: boolean;
205
+ period?: number;
206
+ period_unit?: PeriodUnitEnum;
207
+ status?: 'active' | 'archived';
208
+ item_constraints?: ItemConstraintsCreateForItemsInputParam[];
209
+ item_constraint_criteria?: ItemConstraintCriteriaCreateForItemsInputParam[];
210
+ coupon_constraints?: CouponConstraintsCreateForItemsInputParam[];
211
+ [key: `cf_${string}`]: unknown;
212
+ }
213
+ export interface UpdateForItemsInputParam {
214
+ name?: string;
215
+ invoice_name?: string;
216
+ discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
217
+ discount_amount?: number;
218
+ currency_code?: string;
219
+ discount_percentage?: number /**
220
+ * @deprecated Please refer API docs to use other attributes
221
+ */;
222
+
223
+ discount_quantity?: number;
224
+ apply_on?: 'invoice_amount' | 'each_specified_item';
225
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
226
+ duration_month?: number;
227
+ valid_from?: number;
228
+ valid_till?: number;
229
+ max_redemptions?: number;
230
+ invoice_notes?: string;
231
+ meta_data?: any;
232
+ included_in_mrr?: boolean;
233
+ period?: number;
234
+ period_unit?: PeriodUnitEnum;
235
+ item_constraints?: ItemConstraintsUpdateForItemsInputParam[];
236
+ item_constraint_criteria?: ItemConstraintCriteriaUpdateForItemsInputParam[];
237
+ coupon_constraints?: CouponConstraintsUpdateForItemsInputParam[];
238
+ [key: `cf_${string}`]: unknown;
239
+ }
240
+ export interface ListInputParam {
241
+ limit?: number;
242
+ offset?: string;
243
+ id?: filter.String;
244
+ name?: filter.String;
245
+ discount_type?: filter.Enum;
246
+ duration_type?: filter.Enum;
247
+ status?: filter.Enum;
248
+ apply_on?: filter.Enum;
249
+ created_at?: filter.Timestamp;
250
+ updated_at?: filter.Timestamp;
251
+ currency_code?: filter.String;
252
+ 'sort_by[asc]'?: string;
253
+ 'sort_by[desc]'?: string;
254
+ [key: `cf_${string}`]: unknown;
255
+ }
256
+ export interface UpdateInputParam {
257
+ name?: string;
258
+ invoice_name?: string;
259
+ discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
260
+ discount_amount?: number;
261
+ currency_code?: string;
262
+ discount_percentage?: number /**
263
+ * @deprecated Please refer API docs to use other attributes
264
+ */;
265
+
266
+ discount_quantity?: number;
267
+ apply_on?: 'invoice_amount' | 'each_specified_item';
268
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
269
+ duration_month?: number;
270
+ valid_till?: number;
271
+ max_redemptions?: number;
272
+ invoice_notes?: string;
273
+ meta_data?: any;
274
+ included_in_mrr?: boolean;
275
+ period?: number;
276
+ period_unit?: PeriodUnitEnum;
277
+ plan_constraint?: 'none' | 'all' | 'specific';
278
+ addon_constraint?: 'none' | 'all' | 'specific';
279
+ plan_ids?: string[];
280
+ addon_ids?: string[];
281
+ }
282
+ export interface CopyInputParam {
283
+ from_site: string;
284
+ id_at_from_site: string;
285
+ id?: string;
286
+ for_site_merging?: boolean;
287
+ }
288
+ export interface ItemConstraintCriteriaCreateForItemsInputParam {
289
+ item_type?: 'plan' | 'addon' | 'charge';
290
+ item_family_ids?: any;
291
+ currencies?: any;
292
+ item_price_periods?: any;
293
+ }
294
+ export interface CouponConstraintsCreateForItemsInputParam {
295
+ entity_type: 'customer';
296
+ type:
297
+ | 'max_redemptions'
298
+ | 'unique_by'
299
+ | 'existing_customer'
300
+ | 'new_customer';
301
+ value?: string;
302
+ }
303
+ export interface ItemConstraintsCreateForItemsInputParam {
304
+ constraint: 'none' | 'all' | 'specific' | 'criteria';
305
+ item_type: 'plan' | 'addon' | 'charge';
306
+ item_price_ids?: any;
307
+ }
308
+ export interface ItemConstraintCriteriaUpdateForItemsInputParam {
309
+ item_type?: 'plan' | 'addon' | 'charge';
310
+ item_family_ids?: any;
311
+ currencies?: any;
312
+ item_price_periods?: any;
313
+ }
314
+ export interface CouponConstraintsUpdateForItemsInputParam {
315
+ entity_type: 'customer';
316
+ type:
317
+ | 'max_redemptions'
318
+ | 'unique_by'
319
+ | 'existing_customer'
320
+ | 'new_customer';
321
+ value?: string;
322
+ }
323
+ export interface ItemConstraintsUpdateForItemsInputParam {
324
+ constraint: 'none' | 'all' | 'specific' | 'criteria';
325
+ item_type: 'plan' | 'addon' | 'charge';
326
+ item_price_ids?: any;
327
+ }
328
+ }
329
+ }
@@ -0,0 +1,70 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface CouponCode {
6
+ code: string;
7
+ status: 'not_redeemed' | 'redeemed' | 'archived';
8
+ coupon_id: string;
9
+ coupon_set_id: string;
10
+ coupon_set_name: string;
11
+ }
12
+
13
+ export namespace CouponCode {
14
+ export class CouponCodeResource {
15
+ create(
16
+ input: CreateInputParam,
17
+ headers?: ChargebeeRequestHeader,
18
+ ): Promise<ChargebeeResponse<CreateResponse>>;
19
+
20
+ retrieve(
21
+ coupon_code_code: string,
22
+ headers?: ChargebeeRequestHeader,
23
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
24
+
25
+ list(
26
+ input?: ListInputParam,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<ListResponse>>;
29
+
30
+ archive(
31
+ coupon_code_code: string,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<ArchiveResponse>>;
34
+ }
35
+
36
+ export interface CreateResponse {
37
+ coupon_code: CouponCode;
38
+ }
39
+
40
+ export interface RetrieveResponse {
41
+ coupon_code: CouponCode;
42
+ }
43
+
44
+ export interface ListResponse {
45
+ list: { coupon_code: CouponCode }[];
46
+ next_offset?: string;
47
+ }
48
+
49
+ export interface ArchiveResponse {
50
+ coupon_code: CouponCode;
51
+ }
52
+
53
+ // REQUEST PARAMS
54
+ //---------------
55
+
56
+ export interface CreateInputParam {
57
+ coupon_id: string;
58
+ coupon_set_name: string;
59
+ code: string;
60
+ }
61
+ export interface ListInputParam {
62
+ limit?: number;
63
+ offset?: string;
64
+ code?: filter.String;
65
+ coupon_id?: filter.String;
66
+ coupon_set_name?: filter.String;
67
+ status?: filter.Enum;
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,111 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface CouponSet {
6
+ id: string;
7
+ coupon_id: string;
8
+ name: string;
9
+ total_count?: number;
10
+ redeemed_count?: number;
11
+ archived_count?: number;
12
+ meta_data?: any;
13
+ }
14
+
15
+ export namespace CouponSet {
16
+ export class CouponSetResource {
17
+ create(
18
+ input: CreateInputParam,
19
+ headers?: ChargebeeRequestHeader,
20
+ ): Promise<ChargebeeResponse<CreateResponse>>;
21
+
22
+ addCouponCodes(
23
+ coupon_set_id: string,
24
+ input?: AddCouponCodesInputParam,
25
+ headers?: ChargebeeRequestHeader,
26
+ ): Promise<ChargebeeResponse<AddCouponCodesResponse>>;
27
+
28
+ list(
29
+ input?: ListInputParam,
30
+ headers?: ChargebeeRequestHeader,
31
+ ): Promise<ChargebeeResponse<ListResponse>>;
32
+
33
+ retrieve(
34
+ coupon_set_id: string,
35
+ headers?: ChargebeeRequestHeader,
36
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
37
+
38
+ update(
39
+ coupon_set_id: string,
40
+ input?: UpdateInputParam,
41
+ headers?: ChargebeeRequestHeader,
42
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
43
+
44
+ delete(
45
+ coupon_set_id: string,
46
+ headers?: ChargebeeRequestHeader,
47
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
48
+
49
+ deleteUnusedCouponCodes(
50
+ coupon_set_id: string,
51
+ headers?: ChargebeeRequestHeader,
52
+ ): Promise<ChargebeeResponse<DeleteUnusedCouponCodesResponse>>;
53
+ }
54
+
55
+ export interface CreateResponse {
56
+ coupon_set: CouponSet;
57
+ }
58
+
59
+ export interface AddCouponCodesResponse {
60
+ coupon_set: CouponSet;
61
+ }
62
+
63
+ export interface ListResponse {
64
+ list: { coupon_set: CouponSet }[];
65
+ next_offset?: string;
66
+ }
67
+
68
+ export interface RetrieveResponse {
69
+ coupon_set: CouponSet;
70
+ }
71
+
72
+ export interface UpdateResponse {
73
+ coupon_set: CouponSet;
74
+ }
75
+
76
+ export interface DeleteResponse {
77
+ coupon_set: CouponSet;
78
+ }
79
+
80
+ export interface DeleteUnusedCouponCodesResponse {
81
+ coupon_set: CouponSet;
82
+ }
83
+
84
+ // REQUEST PARAMS
85
+ //---------------
86
+
87
+ export interface CreateInputParam {
88
+ coupon_id: string;
89
+ name: string;
90
+ id: string;
91
+ meta_data?: any;
92
+ }
93
+ export interface AddCouponCodesInputParam {
94
+ code?: string[];
95
+ }
96
+ export interface ListInputParam {
97
+ limit?: number;
98
+ offset?: string;
99
+ id?: filter.String;
100
+ name?: filter.String;
101
+ coupon_id?: filter.String;
102
+ total_count?: filter.Number;
103
+ redeemed_count?: filter.Number;
104
+ archived_count?: filter.Number;
105
+ }
106
+ export interface UpdateInputParam {
107
+ name?: string;
108
+ meta_data?: any;
109
+ }
110
+ }
111
+ }