chargebee 2.35.1 → 2.36.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.
@@ -1113,6 +1113,8 @@ You can also use our [Hosted Pages](https://www.chargebee.com/docs/hosted_pages.
1113
1113
  */
1114
1114
 
1115
1115
  event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
1116
+ tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
1117
+
1116
1118
  }
1117
1119
  export interface CreateForCustomerResponse {
1118
1120
  subscription:Subscription;
@@ -2,289 +2,107 @@
2
2
  declare module 'chargebee' {
3
3
  export interface UnbilledCharge {
4
4
 
5
- /**
6
- * @description Uniquely identifies an unbilled charge.
7
-
8
- */
9
-
10
5
  id?:string;
11
6
 
12
- /**
13
- * @description A unique identifier for the customer being charged.
14
-
15
- */
16
-
17
7
  customer_id?:string;
18
8
 
19
- /**
20
- * @description A unique identifier for the subscription this charge belongs to.
21
-
22
- */
23
-
24
9
  subscription_id?:string;
25
10
 
26
- /**
27
- * @description Start date of this charge.
28
-
29
- */
30
-
31
11
  date_from?:number;
32
12
 
33
- /**
34
- * @description End date of this charge.
35
-
36
- */
37
-
38
13
  date_to?:number;
39
14
 
40
- /**
41
- * @description Unit amount of the charge item.
42
-
43
- */
44
-
45
15
  unit_amount?:number;
46
16
 
47
- /**
48
- * @description The pricing scheme for this line item. \* tiered - The per unit price is based on the tier that the total quantity falls in. \* per_unit - A fixed price per unit quantity. \* flat_fee - A fixed price that is not quantity-based. \* volume - There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers. \* stairstep - A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
49
-
50
- */
51
-
52
17
  pricing_model?:PricingModel;
53
18
 
54
- /**
55
- * @description Quantity of the item which is represented by this charge.
56
-
57
- */
58
-
59
19
  quantity?:number;
60
20
 
61
- /**
62
- * @description Total amount of this charge. Typically equals to unit amount x quantity.
63
-
64
- */
65
-
66
21
  amount?:number;
67
22
 
68
- /**
69
- * @description The currency code (ISO 4217 format) for the charge.
70
-
71
- */
72
-
73
23
  currency_code:string;
74
24
 
75
- /**
76
- * @description Total discounts for this charge.
77
-
78
- */
79
-
80
25
  discount_amount?:number;
81
26
 
82
- /**
83
- * @description Detailed description about this charge.
84
-
85
- */
86
-
87
27
  description?:string;
88
28
 
89
- /**
90
- * @description Specifies the modelled entity this line item is based on. \* plan_setup - Indicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the [plan](/docs/api/plans#plan_attributes) id \* plan - Indicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the [plan](/docs/api/plans#plan_attributes) id \* addon_item_price - Indicates that this line item is based on addon Item Price \* plan_item_price - Indicates that this line item is based on plan Item Price \* adhoc - Indicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case \* addon - Indicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the [addon](/docs/api/addons#addon_attributes) id \* charge_item_price - Indicates that this line item is based on charge Item Price
91
-
92
- */
93
-
94
- entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
95
-
96
- /**
97
- * @description The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type.
98
-
99
- */
29
+ entity_type:'plan_setup' | 'plan' | 'addon' | 'adhoc' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price';
100
30
 
101
31
  entity_id?:string;
102
32
 
103
- /**
104
- * @description Will be true if the charge has been voided. Usually the unbilled charge will be voided and revised to different charges(s) during proration.
105
-
106
- */
107
-
108
33
  is_voided:boolean;
109
34
 
110
- /**
111
- * @description Timestamp indicating the date and time this charge got voided.
112
-
113
- */
114
-
115
35
  voided_at?:number;
116
36
 
117
- /**
118
- * @description The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
119
-
120
- */
121
-
122
37
  unit_amount_in_decimal?:string;
123
38
 
124
- /**
125
- * @description The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
126
-
127
- */
128
-
129
39
  quantity_in_decimal?:string;
130
40
 
131
- /**
132
- * @description The decimal representation of the amount for the charge, in major units of the currency. Typically equals to `unit_amount_in_decimal` x `quantity_in_decimal`. Returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
133
-
134
- */
135
-
136
41
  amount_in_decimal?:string;
137
42
 
138
- /**
139
- * @description Timestamp indicating when the unbilled charge was last updated
140
-
141
- */
142
-
143
43
  updated_at:number;
144
44
 
145
- /**
146
- * @description The value of this parameter will be true if it is a recurring unbilled charge for a future term.
147
-
148
- */
45
+ tiers?:UnbilledCharge.LineItemTier[];
149
46
 
150
47
  is_advance_charge?:boolean;
151
48
 
152
49
  business_entity_id?:string;
153
50
 
154
- /**
155
- * @description Indicates that this resource has been deleted.
156
-
157
- */
158
-
159
51
  deleted:boolean;
160
-
161
- /**
162
- * @description The list of tiers applicable for this line item
163
-
164
- */
165
-
166
- tiers?:UnbilledCharge.LineItemTier[];
167
52
  }
168
53
  export namespace UnbilledCharge {
169
54
  export class UnbilledChargeResource {
170
- /**
171
- * @description This endpoint creates unbilled charges for a subscription.
172
-
173
- */
174
-
55
+ create_unbilled_charge(input:CreateUnbilledChargeInputParam):ChargebeeRequest<CreateUnbilledChargeResponse>;
56
+
175
57
  create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
176
58
 
177
- /**
178
- * @description Use this API to bill the [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html). Available Credits and Excess Payments will automatically be applied while creating the invoice.
179
-
180
- If the *Auto Collection* is turned on for the particular customer, the invoice will be created in payment_due state and the payment collection will be scheduled immediately.
181
-
182
- During invoice creation, the PO number for the line items will be filled from the subscription&#x27;s current PO number, if available.
183
-
184
- If no recurring item is present in the created invoice, the invoice will be marked as recurring&#x3D;false.
185
-
186
- If consolidated invoicing is enabled and the parameter &#x27;customer_id&#x27; is passed, multiple invoices can be created based on the following factors.
187
-
188
- * Currency
189
- * PO number if &#x27;Group by PO number&#x27; is enabled
190
- * Shipping address
191
- * Auto Collection
192
- * Payment method
193
-
194
- */
195
-
196
59
  invoice_unbilled_charges(input?:InvoiceUnbilledChargesInputParam):ChargebeeRequest<InvoiceUnbilledChargesResponse>;
197
60
 
198
- /**
199
- * @description Use this API to delete an unbilled charge by specifying the id of the charge.
200
-
201
- */
202
-
203
61
  delete(unbilled_charge_id:string):ChargebeeRequest<DeleteResponse>;
204
62
 
205
- /**
206
- * @description This endpoint lists all the unbilled charges.
207
-
208
- */
209
-
210
63
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
211
64
 
212
- /**
213
- * @description This is similar to the &quot;Create an invoice for unbilled charges&quot; API but no invoice will be created, only an estimate for this operation is created.
214
-
215
- In the estimate response,
216
-
217
- * **estimate.invoice_estimates** is an array of **estimate.invoice_estimate**. This has the details of the invoices that will be generated now.
218
-
219
- **Note:**
220
-
221
- * This API when invoked does not perform the actual operation. It just generates an estimate.
222
- * Both *subscription_id* and *customer_id* parameters should not be given at the same time.
223
-
224
-
225
-
226
-
227
- */
228
-
229
65
  invoice_now_estimate(input?:InvoiceNowEstimateInputParam):ChargebeeRequest<InvoiceNowEstimateResponse>;
230
66
  }
231
- export interface CreateResponse {
67
+ export interface CreateUnbilledChargeResponse {
232
68
  unbilled_charges:UnbilledCharge[];
233
69
  }
234
- export interface CreateInputParam {
70
+ export interface CreateUnbilledChargeInputParam {
235
71
 
236
- /**
237
- * @description Identifier of the subscription for which this unbilled charges needs to be created.
238
-
239
- */
72
+ addons?:{date_from?:number,date_to?:number,id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
240
73
 
241
- subscription_id:string;
74
+ charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
242
75
 
243
- /**
244
- * @description The currency code (ISO 4217 format) of the unbilled_charge.
245
-
246
- */
76
+ tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
247
77
 
248
- currency_code?:string;
78
+ subscription_id:string;
249
79
 
250
- /**
251
- * @description Parameters for item_prices
252
-
253
- */
80
+ currency_code?:string;
81
+ }
82
+ export interface CreateResponse {
83
+ unbilled_charges:UnbilledCharge[];
84
+ }
85
+ export interface CreateInputParam {
254
86
 
255
87
  item_prices?:{date_from?:number,date_to?:number,item_price_id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
256
88
 
257
- /**
258
- * @description Parameters for item_tiers
259
-
260
- */
261
-
262
89
  item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
263
90
 
264
- /**
265
- * @description Parameters for charges
266
-
267
- */
268
-
269
91
  charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
92
+
93
+ tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
94
+
95
+ subscription_id:string;
96
+
97
+ currency_code?:string;
270
98
  }
271
99
  export interface InvoiceUnbilledChargesResponse {
272
100
  invoices:Invoice[];
273
101
  }
274
102
  export interface InvoiceUnbilledChargesInputParam {
275
103
 
276
- /**
277
- * @description Identifier of the subscription for which this invoice needs to be created. Should be specified if &#x27;customer_id&#x27; is not specified.
278
-
279
- */
280
-
281
104
  subscription_id?:string;
282
105
 
283
- /**
284
- * @description Identifier of the customer for whom this invoice needs to be created. Should be specified if &#x27;subscription_id&#x27; is not specified. Applicable only if the consolidated invoicing is enabled. .
285
-
286
- */
287
-
288
106
  customer_id?:string;
289
107
  }
290
108
  export interface DeleteResponse {
@@ -292,59 +110,44 @@ In the estimate response,
292
110
  }
293
111
 
294
112
  export interface ListResponse {
295
- /**
296
- * @description This endpoint lists all the unbilled charges.
297
-
298
- */
299
-
300
113
  list:{unbilled_charge:UnbilledCharge}[];
301
114
 
302
- /**
303
- * @description This endpoint lists all the unbilled charges.
304
-
305
- */
306
-
307
115
  next_offset?:string;
308
116
  }
309
117
  export interface ListInputParam {
310
118
  [key : string]: any;
311
119
  /**
312
- * @description This endpoint lists all the unbilled charges.
120
+ * @description The number of resources to be returned.
313
121
 
314
122
  */
315
123
 
316
124
  limit?:number;
317
125
 
318
126
  /**
319
- * @description This endpoint lists all the unbilled charges.
127
+ * @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.
320
128
 
321
129
  */
322
130
 
323
131
  offset?:string;
324
132
 
325
133
  /**
326
- * @description This endpoint lists all the unbilled charges.
134
+ * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
327
135
 
328
136
  */
329
137
 
330
138
  include_deleted?:boolean;
331
139
 
332
- /**
333
- * @description This endpoint lists all the unbilled charges.
334
-
335
- */
336
-
337
140
  is_voided?:boolean;
338
141
 
339
142
  /**
340
- * @description This endpoint lists all the unbilled charges.
143
+ * @description A unique identifier for the subscription this charge belongs to.
341
144
 
342
145
  */
343
146
 
344
147
  subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
345
148
 
346
149
  /**
347
- * @description This endpoint lists all the unbilled charges.
150
+ * @description A unique identifier for the customer being charged.
348
151
 
349
152
  */
350
153
 
@@ -355,75 +158,25 @@ In the estimate response,
355
158
  }
356
159
  export interface InvoiceNowEstimateInputParam {
357
160
 
358
- /**
359
- * @description Identifier of the subscription for which this estimate needs to be created. Should be given if &#x27;customer_id&#x27; is not specified.
360
-
361
- */
362
-
363
161
  subscription_id?:string;
364
162
 
365
- /**
366
- * @description Identifier of the customer for whom this estimate is created. Is given if &#x27;subscription_id&#x27; is not specified. Applicable only if the &#x27;Consolidated Invoicing&#x27; is enabled. If &#x27;Consolidated Invoicing&#x27; is not enabled, an invoice will be generated for every subscription.
367
-
368
- */
369
-
370
163
  customer_id?:string;
371
164
  }
372
- export interface LineItemTier {
373
- /**
374
- * @description The lower limit of a range of units for the tier
375
-
376
- */
377
-
165
+ export interface Tier {
378
166
  starting_unit:number;
379
167
 
380
- /**
381
- * @description The upper limit of a range of units for the tier
382
-
383
- */
384
-
385
168
  ending_unit?:number;
386
169
 
387
- /**
388
- * @description The number of units purchased in a range.
389
-
390
- */
391
-
392
170
  quantity_used:number;
393
171
 
394
- /**
395
- * @description The price of the tier if the charge model is a &#x60;stairtstep&#x60; pricing , or the price of each unit in the tier if the charge model is &#x60;tiered&#x60;/&#x60;volume&#x60; pricing.
396
-
397
- */
398
-
399
172
  unit_amount:number;
400
173
 
401
- /**
402
- * @description The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as &#x60;ending_unit_in_decimal&#x60; of the next lower tier. Returned only when the &#x60;line_items.pricing_model&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
403
-
404
- */
405
-
406
174
  starting_unit_in_decimal?:string;
407
175
 
408
- /**
409
- * @description The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the &#x60;starting_unit_in_decimal&#x60; of the next higher tier. Returned only when the &#x60;line_items.pricing_model&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60; or stairstep and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
410
-
411
- */
412
-
413
176
  ending_unit_in_decimal?:string;
414
177
 
415
- /**
416
- * @description The decimal representation of the quantity purchased from this tier. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
417
-
418
- */
419
-
420
178
  quantity_used_in_decimal?:string;
421
179
 
422
- /**
423
- * @description The decimal representation of the per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. When the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;, it is the decimal representation of the total price for &#x60;line_item&#x60;. The value is in major units of the currency. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
424
-
425
- */
426
-
427
180
  unit_amount_in_decimal?:string;
428
181
  }
429
182
  }
@@ -1,47 +0,0 @@
1
- name: Greet New Contributors
2
-
3
- on:
4
- issues:
5
- types: [opened]
6
- pull_request:
7
- types: [opened]
8
-
9
- permissions:
10
- issues: write
11
- pull-requests: write
12
-
13
- jobs:
14
- build:
15
-
16
- runs-on: ubuntu-latest
17
-
18
- steps:
19
- - name: Greet for issue
20
- if: github.event_name == 'issues' && github.event.action == 'opened'
21
- uses: actions/github-script@v6
22
- with:
23
- script: |
24
- const issueComment = `
25
- Hello @${context.payload.sender.login}, thank you for raising the issue. Your contribution is greatly appreciated and we look forward to addressing it.
26
- `
27
- github.rest.issues.createComment({
28
- issue_number: context.payload.issue.number,
29
- owner: context.repo.owner,
30
- repo: context.repo.repo,
31
- body: issueComment,
32
- })
33
-
34
- - name: Greet for pull request
35
- if: github.event_name == 'pull_request' && github.event.action == 'opened'
36
- uses: actions/github-script@v6
37
- with:
38
- script: |
39
- const prComment = `
40
- Thank you, @${context.payload.sender.login}, for the pull request. We will take a look at it and get back to you shortly.
41
- `
42
- github.rest.issues.createComment({
43
- issue_number: context.payload.pull_request.number,
44
- owner: context.repo.owner,
45
- repo: context.repo.repo,
46
- body: prComment,
47
- })