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.
Files changed (118) hide show
  1. package/CHANGELOG.md +11 -15
  2. package/LICENSE +1 -1
  3. package/README.md +90 -170
  4. package/cjs/RequestWrapper.js +84 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +80 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +90 -55
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +24 -35
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +230 -747
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4336
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +276 -911
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2935
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,47 +1,36 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
3
4
  declare module 'chargebee' {
4
5
  export interface CustomerEntitlement {
5
-
6
-
7
- customer_id:string;
8
-
9
- subscription_id?:string;
10
-
11
- feature_id?:string;
12
-
13
- value?:string;
14
-
15
- name?:string;
16
-
17
- is_enabled:boolean;
18
-
6
+ customer_id: string;
7
+ subscription_id?: string;
8
+ feature_id?: string;
9
+ value?: string;
10
+ name?: string;
11
+ is_enabled: boolean;
19
12
  }
13
+
20
14
  export namespace CustomerEntitlement {
21
- export class CustomerEntitlementResource {
22
- entitlements_for_customer(customer_id:string, input?:EntitlementsForCustomerInputParam):ChargebeeRequest<EntitlementsForCustomerResponse>;
15
+ export class CustomerEntitlementResource {
16
+ entitlementsForCustomer(
17
+ customer_id: string,
18
+ input?: EntitlementsForCustomerInputParam,
19
+ headers?: ChargebeeRequestHeader,
20
+ ): Promise<ChargebeeResponse<EntitlementsForCustomerResponse>>;
23
21
  }
24
- export interface EntitlementsForCustomerResponse {
25
- list:{customer_entitlement:CustomerEntitlement}[];
26
-
27
- next_offset?:string;
22
+
23
+ export interface EntitlementsForCustomerResponse {
24
+ list: { customer_entitlement: CustomerEntitlement }[];
25
+ next_offset?: string;
28
26
  }
29
- export interface EntitlementsForCustomerInputParam {
30
- [key : string]: any;
31
- /**
32
- * @description The number of resources to be returned.
33
27
 
34
- */
35
-
36
- limit?:number;
37
-
38
- /**
39
- * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
28
+ // REQUEST PARAMS
29
+ //---------------
40
30
 
41
- */
42
-
43
- offset?:string;
31
+ export interface EntitlementsForCustomerInputParam {
32
+ limit?: number;
33
+ offset?: string;
44
34
  }
45
-
46
35
  }
47
- }
36
+ }
@@ -1,340 +1,142 @@
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 DifferentialPrice {
4
-
5
- /**
6
- * @description A unique and immutable ID for the differential price. It is auto-generated when the differential price is created.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description The ID of the item price (&#x60;addon&#x60; or &#x60;charge&#x60;) whose price should change according to the plan-item it is applied to.
14
-
15
- */
16
-
17
- item_price_id:string;
18
-
19
- /**
20
- * @description The ID of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the *Standard* or *Enterprise* plans-items mentioned in the [examples above](./differential_prices?prod_cat_ver&#x3D;2).
21
-
22
- */
23
-
24
- parent_item_id:string;
25
-
26
- /**
27
- * @description The differential price. If the pricing model of the &#x60;item_price_id&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60;, or &#x60;stairstep&#x60;, pass &#x60;tiers&#x60; instead of this.
28
-
29
- */
30
-
31
- price?:number;
32
-
33
- /**
34
- * @description The price of the item when the pricing_model is &#x60;flat_fee&#x60;. When the pricing model is &#x60;per_unit&#x60;, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
35
-
36
- */
37
-
38
- price_in_decimal?:string;
39
-
40
- /**
41
- * @description The item family state. \* active - New items can be created with the item family. \* deleted - No items allowed for the item family.
42
-
43
- */
44
-
45
- status?:'deleted' | 'active';
46
-
47
- /**
48
- * @description Version number of this resource. The &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
49
-
50
- */
51
-
52
- resource_version?:number;
53
-
54
- /**
55
- * @description Timestamp when this differential price was last updated.
56
-
57
- */
58
-
59
- updated_at?:number;
60
-
61
- /**
62
- * @description Timestamp at which this differential price was created.
63
-
64
- */
65
-
66
- created_at:number;
67
-
68
- /**
69
- * @description Timestamp at which this differential price was last modified.
70
-
71
- */
72
-
73
- modified_at:number;
74
-
75
- /**
76
- * @description The currency code (ISO 4217 format) of the plan
77
-
78
- */
79
-
80
- currency_code:string;
81
-
82
- /**
83
- * @description List of quantity-based pricing tiers for the differential price. Applicable only for &#x60;tiered&#x60;, &#x60;volume&#x60;, and &#x60;stairstep&#x60; &#x60;pricing_model&#x60; s. The tiers are exactly the same as those set for the item price. Only the &#x60;price&#x60; attribute for the various tiers can be overridden for the differential price.
84
-
85
- */
86
-
87
- tiers?:DifferentialPrice.Tier[];
88
-
89
- /**
90
- * @description When &#x60;item_price_id&#x60; is a charge-item, you can specify the plan period for which the price applies. Although an array, currently you can specify only one period. In other words, only index &#x60;0&#x60; is allowed. Create another differential price to specify another period. Is permitted only when &#x60;item_price_id&#x60; is a charge-item.
91
-
92
- */
93
-
94
- parent_periods?:DifferentialPrice.ParentPeriod[];
6
+ id: string;
7
+ item_price_id: string;
8
+ parent_item_id: string;
9
+ price?: number;
10
+ price_in_decimal?: string;
11
+ status?: 'active' | 'deleted';
12
+ resource_version?: number;
13
+ updated_at?: number;
14
+ created_at: number;
15
+ modified_at: number;
16
+ tiers?: DifferentialPrice.Tier[];
17
+ currency_code: string;
18
+ parent_periods?: DifferentialPrice.ParentPeriod[];
95
19
  }
96
- export namespace DifferentialPrice {
97
- export class DifferentialPriceResource {
98
- /**
99
- * @description Create a differential price for addon item price, addon item price with tiered pricing, or charge item price.
100
-
101
- */
102
-
103
- create(item_price_id:string, input:CreateInputParam):ChargebeeRequest<CreateResponse>;
104
-
105
- /**
106
- * @description Retrieve a differential price using a &#x60;differential_price_id&#x60; and &#x60;item_price_id&#x60;.
107
-
108
- */
109
-
110
- retrieve(differential_price_id:string, input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
111
-
112
- /**
113
- * @description Update a differential price using a &#x60;differential_price_id&#x60; and &#x60;item_price_id&#x60;.
114
-
115
- */
116
-
117
- update(differential_price_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
118
-
119
- /**
120
- * @description Delete a differential price using a &#x60;differential_price_id&#x60; and &#x60;item_price_id&#x60;.
121
20
 
122
- */
123
-
124
- delete(differential_price_id:string, input:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
125
-
126
- /**
127
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
128
-
129
- */
130
-
131
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
21
+ export namespace DifferentialPrice {
22
+ export class DifferentialPriceResource {
23
+ create(
24
+ item_price_id: string,
25
+ input: CreateInputParam,
26
+ headers?: ChargebeeRequestHeader,
27
+ ): Promise<ChargebeeResponse<CreateResponse>>;
28
+
29
+ retrieve(
30
+ differential_price_id: string,
31
+ input: RetrieveInputParam,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
34
+
35
+ update(
36
+ differential_price_id: string,
37
+ input: UpdateInputParam,
38
+ headers?: ChargebeeRequestHeader,
39
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
40
+
41
+ delete(
42
+ differential_price_id: string,
43
+ input: DeleteInputParam,
44
+ headers?: ChargebeeRequestHeader,
45
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
46
+
47
+ list(
48
+ input?: ListInputParam,
49
+ headers?: ChargebeeRequestHeader,
50
+ ): Promise<ChargebeeResponse<ListResponse>>;
132
51
  }
133
- export interface CreateResponse {
134
- differential_price:DifferentialPrice;
52
+
53
+ export interface CreateResponse {
54
+ differential_price: DifferentialPrice;
135
55
  }
136
- export interface CreateInputParam {
137
-
138
- /**
139
- * @description The id of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the *Standard* or *Enterprise* plans-items mentioned in the [examples above](./differential_prices?prod_cat_ver&#x3D;2).
140
56
 
141
- */
142
-
143
- parent_item_id:string;
144
-
145
- /**
146
- * @description The differential price. If the pricing model of the &#x60;item_price_id&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60;, or &#x60;stairstep&#x60;, pass &#x60;tiers&#x60; instead of this.
57
+ export interface RetrieveResponse {
58
+ differential_price: DifferentialPrice;
59
+ }
147
60
 
148
- */
149
-
150
- price?:number;
151
-
152
- /**
153
- * @description The price of the item when the pricing_model is &#x60;flat_fee&#x60;. When the pricing model is &#x60;per_unit&#x60;, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
61
+ export interface UpdateResponse {
62
+ differential_price: DifferentialPrice;
63
+ }
154
64
 
155
- */
156
-
157
- price_in_decimal?:string;
158
-
159
- /**
160
- * @description Parameters for parent_periods
65
+ export interface DeleteResponse {
66
+ differential_price: DifferentialPrice;
67
+ }
161
68
 
162
- */
163
-
164
- parent_periods?:{period?:any[],period_unit:'week' | 'month' | 'year' | 'day'}[];
165
-
166
- /**
167
- * @description Parameters for tiers
69
+ export interface ListResponse {
70
+ list: { differential_price: DifferentialPrice }[];
71
+ next_offset?: string;
72
+ }
168
73
 
169
- */
170
-
171
- tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
74
+ export interface Tier {
75
+ starting_unit: number;
76
+ ending_unit?: number;
77
+ price: number;
78
+ starting_unit_in_decimal?: string;
79
+ ending_unit_in_decimal?: string;
80
+ price_in_decimal?: string;
172
81
  }
173
- export interface RetrieveResponse {
174
- differential_price:DifferentialPrice;
82
+ export interface ParentPeriod {
83
+ period_unit: 'day' | 'week' | 'month' | 'year';
84
+ period?: any[];
175
85
  }
176
- export interface RetrieveInputParam {
177
-
178
- /**
179
- * @description Retrieve a differential price using a &#x60;differential_price_id&#x60; and &#x60;item_price_id&#x60;.
86
+ // REQUEST PARAMS
87
+ //---------------
180
88
 
181
- */
182
-
183
- item_price_id:string;
89
+ export interface CreateInputParam {
90
+ parent_item_id: string;
91
+ price?: number;
92
+ price_in_decimal?: string;
93
+ parent_periods?: ParentPeriodsCreateInputParam[];
94
+ tiers?: TiersCreateInputParam[];
184
95
  }
185
- export interface UpdateResponse {
186
- differential_price:DifferentialPrice;
96
+ export interface RetrieveInputParam {
97
+ item_price_id: string;
187
98
  }
188
99
  export interface UpdateInputParam {
189
-
190
- /**
191
- * @description The id of the item price (&#x60;addon&#x60; or &#x60;charge&#x60;) whose price should change according to the plan-item it is applied to.
192
-
193
- */
194
-
195
- item_price_id:string;
196
-
197
- /**
198
- * @description The differential price. If the pricing model of the &#x60;item_price_id&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60;, or &#x60;stairstep&#x60;, pass &#x60;tiers&#x60; instead of this.
199
-
200
- */
201
-
202
- price?:number;
203
-
204
- /**
205
- * @description The price of the item when the pricing_model is &#x60;flat_fee&#x60;. When the pricing model is &#x60;per_unit&#x60;, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
206
-
207
- */
208
-
209
- price_in_decimal?:string;
210
-
211
- /**
212
- * @description Parameters for parent_periods
213
-
214
- */
215
-
216
- parent_periods?:{period?:any[],period_unit:'week' | 'month' | 'year' | 'day'}[];
217
-
218
- /**
219
- * @description Parameters for tiers
220
-
221
- */
222
-
223
- tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
224
- }
225
- export interface DeleteResponse {
226
- differential_price:DifferentialPrice;
100
+ item_price_id: string;
101
+ price?: number;
102
+ price_in_decimal?: string;
103
+ parent_periods?: ParentPeriodsUpdateInputParam[];
104
+ tiers?: TiersUpdateInputParam[];
227
105
  }
228
106
  export interface DeleteInputParam {
229
-
230
- /**
231
- * @description The id of the item price (&#x60;addon&#x60; or &#x60;charge&#x60;) whose price should change according to the plan-item it is applied to.
232
-
233
- */
234
-
235
- item_price_id:string;
236
- }
237
- export interface ListResponse {
238
- /**
239
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
240
-
241
- */
242
-
243
- list:{differential_price:DifferentialPrice}[];
244
-
245
- /**
246
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
247
-
248
- */
249
-
250
- next_offset?:string;
107
+ item_price_id: string;
251
108
  }
252
109
  export interface ListInputParam {
253
- [key : string]: any;
254
- /**
255
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
256
-
257
- */
258
-
259
- limit?:number;
260
-
261
- /**
262
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
263
-
264
- */
265
-
266
- offset?:string;
267
-
268
- /**
269
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
270
-
271
- */
272
-
273
- item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
274
-
275
- /**
276
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
277
-
278
- */
279
-
280
- item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
281
-
282
- /**
283
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
284
-
285
- */
286
-
287
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
288
-
289
- /**
290
- * @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
291
-
292
- */
293
-
294
- parent_item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
110
+ limit?: number;
111
+ offset?: string;
112
+ item_price_id?: filter.String;
113
+ item_id?: filter.String;
114
+ id?: filter.String;
115
+ parent_item_id?: filter.String;
295
116
  }
296
- export interface Tier {
297
- /**
298
- * @description The lower limit of a range of units for the tier
299
-
300
- */
301
-
302
- starting_unit:number;
303
-
304
- /**
305
- * @description The upper limit of a range of units for the tier
306
-
307
- */
308
-
309
- ending_unit?:number;
310
-
311
- /**
312
- * @description The per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;; the total cost for the item price when the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;. The value is in the [minor unit of the currency](https://apidocs.chargebee.com/docs/api#handling_currency_units).
313
-
314
- */
315
-
316
- price:number;
317
-
318
- starting_unit_in_decimal?:string;
319
-
320
- ending_unit_in_decimal?:string;
321
-
322
- price_in_decimal?:string;
117
+ export interface TiersCreateInputParam {
118
+ starting_unit?: number;
119
+ ending_unit?: number;
120
+ price?: number;
121
+ starting_unit_in_decimal?: string;
122
+ ending_unit_in_decimal?: string;
123
+ price_in_decimal?: string;
323
124
  }
324
- export interface ParentPeriod {
325
- /**
326
- * @description The unit of time for &#x60;period&#x60;. \* month - A period of 1 calendar month. \* day - A period of 24 hours. \* week - A period of 7 days. \* year - A period of 1 calendar year.
327
-
328
- */
329
-
330
- period_unit:'week' | 'month' | 'year' | 'day';
331
-
332
- /**
333
- * @description The billing period of the plan in &#x60;period_unit&#x60;s. For example, a 6 month plan has &#x60;period&#x60; as 6 and &#x60;period_unit&#x60; as &#x60;month&#x60;.
334
-
335
- */
336
-
337
- period?:any[];
125
+ export interface ParentPeriodsCreateInputParam {
126
+ period_unit: 'day' | 'week' | 'month' | 'year';
127
+ period?: any;
128
+ }
129
+ export interface TiersUpdateInputParam {
130
+ starting_unit?: number;
131
+ ending_unit?: number;
132
+ price?: number;
133
+ starting_unit_in_decimal?: string;
134
+ ending_unit_in_decimal?: string;
135
+ price_in_decimal?: string;
136
+ }
137
+ export interface ParentPeriodsUpdateInputParam {
138
+ period_unit: 'day' | 'week' | 'month' | 'year';
139
+ period?: any;
338
140
  }
339
141
  }
340
- }
142
+ }
@@ -1,129 +1,24 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface Discount {
4
-
5
- /**
6
- * @description An immutable unique id for the discount. It is always auto-generated.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description The name of the discount as it should appear on customer-facing pages and documents such as [invoices](/docs/api/invoices?prod_cat_ver&#x3D;2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver&#x3D;2). This is auto-generated based on the &#x60;type&#x60;, &#x60;amount&#x60;, and &#x60;currency_code&#x60; of the discount. For example, it can be &#x60;10% off&#x60; or &#x60;10$ off&#x60;.
14
-
15
- */
16
-
17
- invoice_name?:string;
18
-
19
- /**
20
- * @description The type of discount. Possible value are: \* percentage - The specified percentage will be given as discount. \* fixed_amount - The specified amount will be given as discount.
21
-
22
- */
23
-
24
- type:'fixed_amount' | 'percentage';
25
-
26
- /**
27
- * @description The percentage of the original amount that should be deducted from it. Only applicable when &#x60;discount.type&#x60; is percentage.
28
-
29
- */
30
-
31
- percentage?:number;
32
-
33
- /**
34
- * @description The value of the discount. [The format of this value](https://apidocs.chargebee.com/docs/api?prod_cat_ver&#x3D;2#currencies) depends on the kind of currency. This is only applicable when &#x60;discount.type&#x60; is &#x60;fixed_amount&#x60;.
35
-
36
- */
37
-
38
- amount?:number;
39
-
40
- /**
41
- * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the discount. This is only applicable when &#x60;discount.type&#x60; is &#x60;fixed_amount&#x60;.
42
-
43
- */
44
-
45
- currency_code?:string;
46
-
47
- /**
48
- * @description Specifies the time duration for which this discount is attached to the subscription. \* forever - The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions?prod_cat_ver&#x3D;2#update_subscription_for_items_discounts_operation_type). \* 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 &#x60;period&#x60; and &#x60;period_unit&#x60;. \* one_time - The discount stays attached to the subscription till it is applied on an invoice **once**. It is removed after that from the subscription.
49
-
50
- */
51
-
52
- duration_type:DurationType;
53
-
54
- /**
55
- * @description The duration of time for which the discount is attached to the subscription, in &#x60;period_units&#x60;. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;.
56
-
57
- */
58
-
59
- period?:number;
60
-
61
- /**
62
- * @description The unit of time for &#x60;period&#x60;. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;. \* year - A period of 1 calendar year. \* month - A period of 1 calendar month. \* week - A period of 7 days. \* day - A period of 24 hours.
63
-
64
- */
65
-
66
- period_unit?:PeriodUnit;
67
-
68
- /**
69
- * @description The discount is included in MRR calculations for your site. This attribute is only applicable when &#x60;duration_type&#x60; is &#x60;one_time&#x60; and when the [feature is enabled](https://www.chargebee.com/docs/reporting.html#dashboards_flexible-mrr-calculation) in Chargebee. Also, If the [site-level setting](https://www.chargebee.com/docs/reporting.html#chart_flexible-mrr-calculation) is to exclude one-time discounts from MRR calculations, this value is always returned &#x60;false&#x60;.
70
-
71
- */
72
-
73
- included_in_mrr:boolean;
74
-
75
- /**
76
- * @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice &#x60;sub_total&#x60;. \* specific_item_price - The discount is applied to the &#x60;invoice.line_item.amount&#x60; that corresponds to the item price specified by &#x60;item_price_id&#x60;.
77
-
78
- */
79
-
80
- apply_on:ApplyOn;
81
-
82
- /**
83
- * @description The [id of the item price](/docs/api/subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when &#x60;apply_on&#x60; &#x3D; &#x60;specific_item_price&#x60;.
84
-
85
- */
86
-
87
- item_price_id?:string;
88
-
89
- /**
90
- * @description Timestamp indicating when this discount is created.
91
-
92
- */
93
-
94
- created_at:number;
95
-
96
- /**
97
- * @description Specifies till when the limited period discount is applicable. This attribute will be sent in the response only for &#x60;limited_period&#x60; duration type discount.
98
-
99
- */
100
-
101
- apply_till?:number;
102
-
103
- /**
104
- * @description Specifies the number of times the discount has been applied.
105
-
106
- */
107
-
108
- applied_count?:number;
109
-
110
- /**
111
- * @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
112
- **Note:**
113
-
114
-
115
- When the coupon ID contains a special character; for example: &#x60;#&#x60;, the API returns an error.
116
- Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
117
-
118
- */
119
-
120
- coupon_id:string;
121
-
122
- /**
123
- * @description The index number of the subscription to which the item price is added. Provide a unique number between &#x60;0&#x60; and &#x60;4&#x60; (inclusive) for each subscription that is to be created.
124
-
125
- */
126
-
127
- index:number;
6
+ id: string;
7
+ invoice_name?: string;
8
+ type: 'fixed_amount' | 'percentage';
9
+ percentage?: number;
10
+ amount?: number;
11
+ currency_code?: string;
12
+ duration_type: DurationType;
13
+ period?: number;
14
+ period_unit?: PeriodUnit;
15
+ included_in_mrr: boolean;
16
+ apply_on: ApplyOn;
17
+ item_price_id?: string;
18
+ created_at: number;
19
+ apply_till?: number;
20
+ applied_count?: number;
21
+ coupon_id: string;
22
+ index: number;
128
23
  }
129
- }
24
+ }