chargebee 2.28.0 → 2.29.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 (51) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +6 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  5. package/.github/workflows/greeting.yml +47 -0
  6. package/CHANGELOG.md +47 -0
  7. package/SECURITY.md +8 -0
  8. package/lib/chargebee.js +1 -1
  9. package/lib/resources/api_endpoints.js +0 -7
  10. package/package.json +1 -1
  11. package/types/core.d.ts +4 -4
  12. package/types/resources/AttachedItem.d.ts +88 -88
  13. package/types/resources/Card.d.ts +68 -68
  14. package/types/resources/Comment.d.ts +50 -44
  15. package/types/resources/Coupon.d.ts +242 -207
  16. package/types/resources/CouponSet.d.ts +72 -68
  17. package/types/resources/CreditNote.d.ts +612 -236
  18. package/types/resources/Customer.d.ts +655 -513
  19. package/types/resources/DifferentialPrice.d.ts +99 -74
  20. package/types/resources/EntitlementOverride.d.ts +27 -12
  21. package/types/resources/Estimate.d.ts +450 -450
  22. package/types/resources/Event.d.ts +30 -12
  23. package/types/resources/Export.d.ts +200 -200
  24. package/types/resources/Feature.d.ts +66 -35
  25. package/types/resources/Gift.d.ts +54 -44
  26. package/types/resources/HostedPage.d.ts +381 -381
  27. package/types/resources/InAppSubscription.d.ts +94 -90
  28. package/types/resources/Invoice.d.ts +1242 -660
  29. package/types/resources/Item.d.ts +148 -142
  30. package/types/resources/ItemEntitlement.d.ts +36 -36
  31. package/types/resources/ItemFamily.d.ts +45 -45
  32. package/types/resources/ItemPrice.d.ts +317 -273
  33. package/types/resources/PaymentIntent.d.ts +60 -60
  34. package/types/resources/PaymentVoucher.d.ts +74 -59
  35. package/types/resources/PortalSession.d.ts +45 -20
  36. package/types/resources/PromotionalCredit.d.ts +68 -68
  37. package/types/resources/Purchase.d.ts +3 -3
  38. package/types/resources/Quote.d.ts +652 -363
  39. package/types/resources/QuoteLineGroup.d.ts +245 -0
  40. package/types/resources/QuotedCharge.d.ts +170 -0
  41. package/types/resources/QuotedSubscription.d.ts +219 -0
  42. package/types/resources/SiteMigrationDetail.d.ts +7 -7
  43. package/types/resources/Subscription.d.ts +1219 -932
  44. package/types/resources/SubscriptionEntitlement.d.ts +33 -12
  45. package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
  46. package/types/resources/TimeMachine.d.ts +15 -15
  47. package/types/resources/Token.d.ts +23 -23
  48. package/types/resources/Transaction.d.ts +229 -112
  49. package/types/resources/UnbilledCharge.d.ts +112 -67
  50. package/types/resources/Usage.d.ts +46 -47
  51. package/types/resources/VirtualBankAccount.d.ts +66 -66
@@ -60,29 +60,6 @@ declare module 'chargebee' {
60
60
  }
61
61
  export namespace Estimate {
62
62
  export class EstimateResource {
63
- /**
64
- * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
65
-
66
- In the response,
67
-
68
- * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
69
- * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
70
-
71
- The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
72
-
73
- To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify 'false' for the parameter *include_delayed_charges*.
74
-
75
- **Note:**
76
-
77
- * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
78
- * For 'Non Renewing' subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
79
- * This API is not supported for 'Cancelled' subscriptions.
80
- * Only the subscription's charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
81
-
82
- */
83
-
84
- renewal_estimate(subscription_id:string, input?:RenewalEstimateInputParam):ChargebeeRequest<RenewalEstimateResponse>;
85
-
86
63
  /**
87
64
  * @description Generates an estimate for creating a subscription when the customer does not exist in Chargebee. This estimate API can be called when the customer has not yet signed up and you want to preview how a new subscription would look like for them.
88
65
 
@@ -106,43 +83,14 @@ The response contains one or more of the following objects:
106
83
  create_sub_item_estimate(input?:CreateSubItemEstimateInputParam):ChargebeeRequest<CreateSubItemEstimateResponse>;
107
84
 
108
85
  /**
109
- * @description This creates an estimate for canceling a subscription without actually canceling it. Estimate details include canceling date, unbilled charge options, refund credit handling, the amount to be credited after cancellation, and so on.
110
-
111
- */
112
-
113
- cancel_subscription_for_items(subscription_id:string, input?:CancelSubscriptionForItemsInputParam):ChargebeeRequest<CancelSubscriptionForItemsResponse>;
114
-
115
- /**
116
- * @description Generates an estimate for the &#x27;resume subscription&#x27; operation. This is similar to the [Resume a subscription](/docs/api/subscriptions#resume_a_subscription) API, but the subscription will not be resumed. Only an estimate for this operation is created.
117
-
118
- In the response,
119
-
120
- * **estimate.subscription_estimate** has the subscription details.
121
- * **estimate.invoice_estimate** has details of the invoice that will be generated immediately. This will not be present if no immediate invoice is generated for this operation. This will happen for in-term resumption^++^.
122
-
123
- **^++^What is an &quot;in-term resumption&quot;?**
124
- An &quot;in-term resumption&quot; is when the resumption happens within the billing term of the subscription.
125
- * **estimate.next_invoice_estimate** has details of the invoice that will be generated during the next billing date of this subscription. This will be present only if no immediate invoice is generated during this operation (scenario mentioned above) and this subscription has next billing.
126
-
127
- The generated invoice_estimate/next_invoice_estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any.
128
-
129
- */
130
-
131
- resume_subscription(subscription_id:string, input?:ResumeSubscriptionInputParam):ChargebeeRequest<ResumeSubscriptionResponse>;
132
-
133
- /**
134
- * @description This endpoint creates an invoice estimate for non-recurring items.
86
+ * @description Generates an estimate without creating a subscription. This endpoint can be called when you want to preview details of a new subscription before actually creating one.
87
+ **See also**
135
88
 
136
- */
137
-
138
- create_invoice_for_items(input?:CreateInvoiceForItemsInputParam):ChargebeeRequest<CreateInvoiceForItemsResponse>;
139
-
140
- /**
141
- * @description This endpoint generates an estimate for a subscription that is intended to be a gift. The estimate provides details about the gift sender, gift recipient, address details of the recipient, and the type and details of subscription items included in the gift.
89
+ * [Estimate a purchase](https://apidocs.chargebee.com/docs/api/purchases#estimates_for_purchase): an operation that estimates a &#x60;purchase&#x60; representing multiple subscriptions bought together by a customer.
142
90
 
143
91
  */
144
92
 
145
- gift_subscription_for_items(input?:GiftSubscriptionForItemsInputParam):ChargebeeRequest<GiftSubscriptionForItemsResponse>;
93
+ create_sub_item_for_customer_estimate(customer_id:string, input?:CreateSubItemForCustomerEstimateInputParam):ChargebeeRequest<CreateSubItemForCustomerEstimateResponse>;
146
94
 
147
95
  /**
148
96
  * @description Returns an estimate for updating a subscription.
@@ -164,17 +112,34 @@ In the response,
164
112
  update_subscription_for_items(input?:UpdateSubscriptionForItemsInputParam):ChargebeeRequest<UpdateSubscriptionForItemsResponse>;
165
113
 
166
114
  /**
167
- * @description Estimate of the upcoming scheduled invoices (subscription activations, renewals etc) of a customer. For now preview of the invoices generated on the immediate upcoming date is supported. Say a customer has couple of subscription renewals scheduled on *Jan,10th* and another subscription renewal scheduled on *Jan,15th* . This API gives the preview of all the invoices scheduled to be generated on *Jan,10th* (immediate upcoming date).
115
+ * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
168
116
 
169
- In the response:
117
+ In the response,
170
118
 
171
- * **estimate.invoice_estimates\[\]** has details of the invoices scheduled to be generated.
119
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
120
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
172
121
 
173
- **Note:** If *consolidated invoicing* is enabled you may use this API to test whether upcoming renewals are consolidated.
122
+ The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
123
+
124
+ To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
125
+
126
+ **Note:**
127
+
128
+ * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
129
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
130
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
131
+ * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
174
132
 
175
133
  */
176
134
 
177
- upcoming_invoices_estimate(customer_id:string):ChargebeeRequest<UpcomingInvoicesEstimateResponse>;
135
+ renewal_estimate(subscription_id:string, input?:RenewalEstimateInputParam):ChargebeeRequest<RenewalEstimateResponse>;
136
+
137
+ /**
138
+ * @description This API is used to generate an invoice estimate for preview. Estimate details include the number of billing cycles to be invoiced in advance, the number of billing cycles in one interval, advance invoicing schedules, and so on.
139
+
140
+ */
141
+
142
+ advance_invoice_estimate(subscription_id:string, input?:AdvanceInvoiceEstimateInputParam):ChargebeeRequest<AdvanceInvoiceEstimateResponse>;
178
143
 
179
144
  /**
180
145
  * @description Regenerates the invoice for the current term of the subscription. The subscription must have &#x60;status&#x60; as &#x60;active&#x60; or &#x60;non_renewing&#x60;. This operation is not allowed when any of the following conditions hold true for the subscription:
@@ -200,14 +165,17 @@ Returns an &#x60;estimate&#x60; object with one of the following components depe
200
165
  regenerate_invoice_estimate(subscription_id:string, input?:RegenerateInvoiceEstimateInputParam):ChargebeeRequest<RegenerateInvoiceEstimateResponse>;
201
166
 
202
167
  /**
203
- * @description Generates an estimate without creating a subscription. This endpoint can be called when you want to preview details of a new subscription before actually creating one.
204
- **See also**
168
+ * @description Estimate of the upcoming scheduled invoices (subscription activations, renewals etc) of a customer. For now preview of the invoices generated on the immediate upcoming date is supported. Say a customer has couple of subscription renewals scheduled on *Jan,10th* and another subscription renewal scheduled on *Jan,15th* . This API gives the preview of all the invoices scheduled to be generated on *Jan,10th* (immediate upcoming date).
205
169
 
206
- * [Estimate a purchase](https://apidocs.chargebee.com/docs/api/purchases#estimates_for_purchase): an operation that estimates a &#x60;purchase&#x60; representing multiple subscriptions bought together by a customer.
170
+ In the response:
171
+
172
+ * **estimate.invoice_estimates\[\]** has details of the invoices scheduled to be generated.
173
+
174
+ **Note:** If *consolidated invoicing* is enabled you may use this API to test whether upcoming renewals are consolidated.
207
175
 
208
176
  */
209
177
 
210
- create_sub_item_for_customer_estimate(customer_id:string, input?:CreateSubItemForCustomerEstimateInputParam):ChargebeeRequest<CreateSubItemForCustomerEstimateResponse>;
178
+ upcoming_invoices_estimate(customer_id:string):ChargebeeRequest<UpcomingInvoicesEstimateResponse>;
211
179
 
212
180
  /**
213
181
  * @description Generates an estimate for the &#x27;change term end&#x27; operation. This is similar to the [Change term end](/docs/api/subscriptions#change_term_end) API but the subscription&#x27;s term end will not be changed, only an estimate for this operation is created. This is applicable only for subscriptions in &#x27;in-trial&#x27;, &#x27;active&#x27; and &#x27;non-renewing&#x27; states.
@@ -226,6 +194,13 @@ In the response,
226
194
 
227
195
  change_term_end(subscription_id:string, input:ChangeTermEndInputParam):ChargebeeRequest<ChangeTermEndResponse>;
228
196
 
197
+ /**
198
+ * @description This creates an estimate for canceling a subscription without actually canceling it. Estimate details include canceling date, unbilled charge options, refund credit handling, the amount to be credited after cancellation, and so on.
199
+
200
+ */
201
+
202
+ cancel_subscription_for_items(subscription_id:string, input?:CancelSubscriptionForItemsInputParam):ChargebeeRequest<CancelSubscriptionForItemsResponse>;
203
+
229
204
  /**
230
205
  * @description This API provides an estimate of the details pertaining to the [pause_subscription](/docs/api/subscriptions#pause_a_subscription) operation. It returns attributes such as [pause_date](/docs/api/estimates#estimate_subscription_estimate_pause_date) and [resume_date](/docs/api/estimates#estimate_subscription_estimate_resume_date). This is similar to the [Pause a subscription](/docs/api/subscriptions#pause_a_subscription) API with the exception that the subscription is not paused. Only an estimate for this operation is created.
231
206
 
@@ -240,108 +215,36 @@ In the response,
240
215
  pause_subscription(subscription_id:string, input?:PauseSubscriptionInputParam):ChargebeeRequest<PauseSubscriptionResponse>;
241
216
 
242
217
  /**
243
- * @description This API is used to generate an invoice estimate for preview. Estimate details include the number of billing cycles to be invoiced in advance, the number of billing cycles in one interval, advance invoicing schedules, and so on.
244
-
245
- */
246
-
247
- advance_invoice_estimate(subscription_id:string, input?:AdvanceInvoiceEstimateInputParam):ChargebeeRequest<AdvanceInvoiceEstimateResponse>;
248
- }
249
- export interface RenewalEstimateResponse {
250
- estimate:Estimate;
251
- }
252
- export interface RenewalEstimateInputParam {
253
-
254
- /**
255
- * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
256
-
257
- In the response,
258
-
259
- * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
260
- * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
261
-
262
- The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
263
-
264
- To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
265
-
266
- **Note:**
267
-
268
- * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
269
- * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
270
- * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
271
- * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
272
-
273
- */
274
-
275
- include_delayed_charges?:boolean;
276
-
277
- /**
278
- * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
218
+ * @description Generates an estimate for the &#x27;resume subscription&#x27; operation. This is similar to the [Resume a subscription](/docs/api/subscriptions#resume_a_subscription) API, but the subscription will not be resumed. Only an estimate for this operation is created.
279
219
 
280
220
  In the response,
281
221
 
282
- * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
283
- * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
284
-
285
- The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
286
-
287
- To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
222
+ * **estimate.subscription_estimate** has the subscription details.
223
+ * **estimate.invoice_estimate** has details of the invoice that will be generated immediately. This will not be present if no immediate invoice is generated for this operation. This will happen for in-term resumption^++^.
288
224
 
289
- **Note:**
225
+ **^++^What is an &quot;in-term resumption&quot;?**
226
+ An &quot;in-term resumption&quot; is when the resumption happens within the billing term of the subscription.
227
+ * **estimate.next_invoice_estimate** has details of the invoice that will be generated during the next billing date of this subscription. This will be present only if no immediate invoice is generated during this operation (scenario mentioned above) and this subscription has next billing.
290
228
 
291
- * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
292
- * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
293
- * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
294
- * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
229
+ The generated invoice_estimate/next_invoice_estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any.
295
230
 
296
231
  */
297
-
298
- use_existing_balances?:boolean;
232
+
233
+ resume_subscription(subscription_id:string, input?:ResumeSubscriptionInputParam):ChargebeeRequest<ResumeSubscriptionResponse>;
299
234
 
300
235
  /**
301
- * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
302
-
303
- In the response,
304
-
305
- * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
306
- * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
307
-
308
- The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
309
-
310
- To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
311
-
312
- **Note:**
313
-
314
- * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
315
- * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
316
- * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
317
- * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
236
+ * @description This endpoint generates an estimate for a subscription that is intended to be a gift. The estimate provides details about the gift sender, gift recipient, address details of the recipient, and the type and details of subscription items included in the gift.
318
237
 
319
238
  */
320
-
321
- ignore_scheduled_cancellation?:boolean;
239
+
240
+ gift_subscription_for_items(input?:GiftSubscriptionForItemsInputParam):ChargebeeRequest<GiftSubscriptionForItemsResponse>;
322
241
 
323
242
  /**
324
- * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
325
-
326
- In the response,
327
-
328
- * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
329
- * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
330
-
331
- The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
332
-
333
- To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
334
-
335
- **Note:**
336
-
337
- * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
338
- * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
339
- * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
340
- * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
243
+ * @description This endpoint creates an invoice estimate for non-recurring items.
341
244
 
342
245
  */
343
-
344
- ignore_scheduled_changes?:boolean;
246
+
247
+ create_invoice_for_items(input?:CreateInvoiceForItemsInputParam):ChargebeeRequest<CreateInvoiceForItemsResponse>;
345
248
  }
346
249
  export interface CreateSubItemEstimateResponse {
347
250
  estimate:Estimate;
@@ -461,291 +364,109 @@ In the response,
461
364
 
462
365
  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}[];
463
366
  }
464
- export interface CancelSubscriptionForItemsResponse {
367
+ export interface CreateSubItemForCustomerEstimateResponse {
465
368
  estimate:Estimate;
466
369
  }
467
- export interface CancelSubscriptionForItemsInputParam {
370
+ export interface CreateSubItemForCustomerEstimateInputParam {
468
371
 
469
372
  /**
470
- * @description Set this to &#x60;true&#x60; if you want to cancel the subscription at the end of the current subscription billing cycle. The subscription &#x60;status&#x60; changes to &#x60;non_renewing&#x60;.
373
+ * @description The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
471
374
 
472
375
  */
473
376
 
474
- end_of_term?:boolean;
377
+ use_existing_balances?:boolean;
475
378
 
476
379
  /**
477
- * @description Specify the date/time at which you want to cancel the subscription. This parameter should not be provided when &#x60;end_of_term&#x60; is passed as &#x60;true&#x60;. &#x60;cancel_at&#x60; can be set to a value in the past. This is called backdating. Use backdating when the subscription has been canceled already but its billing has been delayed. The following prerequisites must be met to allow backdating:
478
-
479
- * Backdating must be enabled for subscription cancellation.
480
- * The current day of the month does not exceed the limit set in Chargebee for backdating subscription cancellation. This limit is typically the day of the month by which the accounting for the previous month must be closed.
481
- * The date is on or after &#x60;current_term_start&#x60;.
482
- * The date is on or after the last date/time any of the following changes were made:
483
- * Changes in the recurring items or their prices.
484
- * Addition of non-recurring items.
485
- * The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription&#x27;s plan is 2 months and today is 14th April, &#x60;changes_scheduled_at&#x60; cannot be earlier than 14th February.
486
- .
380
+ * @description If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html). The default value is as per the [site settings](https://www.chargebee.com/docs/unbilled-charges.html#configuration).
381
+ **Note:** &#x60;invoice_immediately&#x60; only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter. .
487
382
 
488
383
  */
489
384
 
490
- cancel_at?:number;
385
+ invoice_immediately?:boolean;
491
386
 
492
387
  /**
493
- * @description For immediate cancellation (&#x60;end_of_term&#x60; &#x3D; &#x60;false&#x60;), specify how to provide credits for current term charges. When not provided, the [site default](https://www.chargebee.com/docs/cancellations.html#configure-subscription-cancellation) is considered. \* none - No credits notes are created. \* full - Credits are issues for the full value of the current term charges. \* prorate - Prorated credits are issued.
388
+ * @description The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles [set for the plan-item price](https://apidocs.chargebee.com/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_billing_cycles) is used.
494
389
 
495
390
  */
496
391
 
497
- credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
392
+ billing_cycles?:number;
498
393
 
499
394
  /**
500
- * @description For immediate cancellation (&#x60;end_of_term&#x60; &#x3D; &#x60;false&#x60;), specify how to handle any unbilled charges. When not provided, the [site default](https://www.chargebee.com/docs/cancellations.html#configure-subscription-cancellation) is considered. \* invoice - An invoice is generated immediately with the unbilled charges. \* delete - The unbilled charges are deleted.
395
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
501
396
 
502
397
  */
503
398
 
504
- unbilled_charges_option?:UnbilledChargesOption;
399
+ mandatory_items_to_remove?:string[];
505
400
 
506
401
  /**
507
- * @description Applicable when the subscription has past due invoices. Specify this if you want to close the due invoices of the subscription. If specified as schedule_payment_collection/write_off, the due invoices of the subscription will be qualified for the selected operation after the remaining refundable credits and excess payments are applied. **Note:** The payment collection attempt will be asynchronous. Not applicable when &#x27;end_of_term&#x27; is true. \* no_action - No action is taken. \* write_off - The amount due in the invoices will be written-off. Credit notes created due to write-off will not be sent in the response. \* schedule_payment_collection - An automatic charge for the due amount of the past invoices will be attempted on the payment method available, if customer&#x27;s auto-collection property is &#x27;ON&#x27;.
402
+ * @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
508
403
 
509
404
  */
510
405
 
511
- account_receivables_handling?:AccountReceivablesHandling;
406
+ terms_to_charge?:number;
512
407
 
513
408
  /**
514
- * @description Applicable when the customer has remaining refundable credits(issued against online payments). If specified as schedule_refund, the refund will be initiated for these credits after they are applied against the subscription&#x27;s past due invoices if any. **Note:** The refunds initiated will be asynchronous. Not applicable when &#x27;end_of_term&#x27; is true. \* schedule_refund - Initiates refund of the remaining credits. \* no_action - No action is taken.
409
+ * @description Override the [billing alignment mode](https://www.chargebee.com/docs/calendar-billing.html#alignment-of-billing-date) for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site. \* delayed - Subscription period will be aligned with the configured billing date at the next renewal. \* immediate - Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..
515
410
 
516
411
  */
517
412
 
518
- refundable_credits_handling?:RefundableCreditsHandling;
413
+ billing_alignment_mode?:BillingAlignmentMode;
519
414
 
520
415
  /**
521
- * @description Cancels the current contract term.
522
-
523
- * &#x60;terminate_immediately&#x60; immediately does the following:
524
- * sets the contract term [&#x60;status&#x60;](contract_terms#contract_term_status) to &#x60;terminated&#x60;.
525
- * Cancels the subscription.
526
- * Collects any [termination fee](contract_terms#termintation_fee).
527
- * &#x60;end_of_contract_term&#x60; Sets the [&#x60;contract_term[action_at_term_end]&#x60;](contract_terms#contract_term_action_at_term_end) to &#x60;cancel&#x60;. In other words, the contract term is not renewed and the subscription is canceled at the end of the contract term.
528
- . \* terminate_immediately - Terminate immediately \* end_of_contract_term - End of contract term
416
+ * @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
529
417
 
530
418
  */
531
419
 
532
- contract_term_cancel_option?:ContractTermCancelOption;
420
+ invoice_date?:number;
533
421
 
534
422
  /**
535
- * @description The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if &#x60;create_pending_invoices&#x60; is &#x60;true&#x60;, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the &#x60;tax&#x60; configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
536
-
537
- * &#x60;invoice_date&#x60; must be in the past.
538
- * &#x60;invoice_date&#x60; is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
539
- * It is not earlier than &#x60;cancel_at&#x60;.
540
- .
541
-
542
- */
543
-
544
- invoice_date?:number;
545
-
546
- /**
547
- * @description Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Subscriptions \&gt; Subscription Cancellation**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
548
-
549
- */
550
-
551
- cancel_reason_code?:string;
552
-
553
- /**
554
- * @description Parameters for subscription_items
555
-
556
- */
557
-
558
- subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
559
- }
560
- export interface ResumeSubscriptionResponse {
561
- estimate:Estimate;
562
- }
563
- export interface ResumeSubscriptionInputParam {
564
-
565
- /**
566
- * @description List of options to resume the subscription. \* immediately - Resume immediately \* specific_date - Resume on a specific date
567
-
568
- */
569
-
570
- resume_option?:ResumeOption;
571
-
572
- /**
573
- * @description Applicable when charges get added during this operation and **resume_option** is set as &#x27;immediately&#x27;. Allows to raise invoice immediately or add them to unbilled charges. \* add_to_unbilled_charges - Add to unbilled charges \* invoice_immediately - Invoice immediately
574
-
575
- */
576
-
577
- charges_handling?:ChargesHandling;
578
-
579
- /**
580
- * @description Parameters for subscription
581
-
582
- */
583
-
584
- subscription?:{resume_date?:number};
585
- }
586
- export interface CreateInvoiceForItemsResponse {
587
- estimate:Estimate;
588
- }
589
- export interface CreateInvoiceForItemsInputParam {
590
-
591
- /**
592
- * @description The currency code (ISO 4217 format) of the invoice amount.
593
-
594
- */
595
-
596
- currency_code?:string;
597
-
598
- /**
599
- * @description A note for this particular invoice. This, and [all other notes](/docs/api/invoices#invoice_notes) for the invoice are displayed on the PDF invoice sent to the customer.
600
-
601
- */
602
-
603
- invoice_note?:string;
604
-
605
- /**
606
- * @description Set as &#x60;true&#x60; to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
607
-
608
- */
609
-
610
- remove_general_note?:boolean;
611
-
612
- /**
613
- * @description List of Coupons to be added.
423
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
614
424
 
615
425
  */
616
426
 
617
427
  coupon_ids?:string[];
618
428
 
619
429
  /**
620
- * @description Authorization transaction to be captured.
621
-
622
- */
623
-
624
- authorization_transaction_id?:string;
625
-
626
- /**
627
- * @description Payment source to be used for this payment.
628
-
629
- */
630
-
631
- payment_source_id?:string;
632
-
633
- /**
634
- * @description The customer level auto collection will be override if specified. \* on - Whenever an invoice is created, an automatic attempt will be made to charge. \* off - Whenever an invoice is created as payment due.
635
-
636
- */
637
-
638
- auto_collection?:AutoCollection;
639
-
640
- /**
641
- * @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
642
-
643
- */
644
-
645
- invoice_date?:number;
646
-
647
- /**
648
- * @description Parameters for invoice
430
+ * @description Parameters for subscription
649
431
 
650
432
  */
651
433
 
652
- invoice?:{customer_id?:string,po_number?:string,subscription_id?:string};
434
+ subscription?:{contract_term_billing_cycle_on_renewal?:number,free_period?:number,free_period_unit?:FreePeriodUnit,id?:string,start_date?:number,trial_end?:number,trial_end_action?:TrialEndAction};
653
435
 
654
436
  /**
655
437
  * @description Parameters for shipping_address
656
438
 
657
439
  */
658
440
 
659
- shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
660
-
661
- /**
662
- * @description Parameters for item_prices
663
-
664
- */
665
-
666
- 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}[];
667
-
668
- /**
669
- * @description Parameters for item_tiers
670
-
671
- */
672
-
673
- 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}[];
441
+ shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
674
442
 
675
443
  /**
676
- * @description Parameters for charges
444
+ * @description Parameters for contract_term
677
445
 
678
446
  */
679
447
 
680
- 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}[];
448
+ contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
681
449
 
682
450
  /**
683
- * @description Parameters for notes_to_remove
451
+ * @description Parameters for subscription_items
684
452
 
685
453
  */
686
454
 
687
- notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
455
+ subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
688
456
 
689
457
  /**
690
458
  * @description Parameters for discounts
691
459
 
692
460
  */
693
461
 
694
- discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
695
- }
696
- export interface GiftSubscriptionForItemsResponse {
697
- estimate:Estimate;
698
- }
699
- export interface GiftSubscriptionForItemsInputParam {
700
-
701
- /**
702
- * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
703
-
704
- */
705
-
706
- coupon_ids?:string[];
707
-
708
- /**
709
- * @description Parameters for gift
710
-
711
- */
712
-
713
- gift?:{auto_claim?:boolean,claim_expiry_date?:number,no_expiry?:boolean,scheduled_at?:number};
714
-
715
- /**
716
- * @description Parameters for gifter
717
-
718
- */
719
-
720
- gifter?:{customer_id:string,note?:string,payment_src_id?:string,signature:string};
721
-
722
- /**
723
- * @description Parameters for gift_receiver
724
-
725
- */
726
-
727
- gift_receiver?:{customer_id:string,email:string,first_name:string,last_name:string};
728
-
729
- /**
730
- * @description Parameters for payment_intent
731
-
732
- */
733
-
734
- payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'sofort' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'card',reference_id?:string};
735
-
736
- /**
737
- * @description Parameters for shipping_address
738
-
739
- */
740
-
741
- shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
462
+ discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
742
463
 
743
464
  /**
744
- * @description Parameters for subscription_items
465
+ * @description Parameters for item_tiers
745
466
 
746
467
  */
747
468
 
748
- subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string}[];
469
+ 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}[];
749
470
  }
750
471
  export interface UpdateSubscriptionForItemsResponse {
751
472
  estimate:Estimate;
@@ -940,147 +661,182 @@ An immediate previous change was made
940
661
 
941
662
  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}[];
942
663
  }
943
- export interface UpcomingInvoicesEstimateResponse {
944
- estimate:Estimate;
945
- }
946
-
947
- export interface RegenerateInvoiceEstimateResponse {
664
+ export interface RenewalEstimateResponse {
948
665
  estimate:Estimate;
949
666
  }
950
- export interface RegenerateInvoiceEstimateInputParam {
667
+ export interface RenewalEstimateInputParam {
951
668
 
952
669
  /**
953
- * @description The start date of the period being invoiced. The default value is [current_term_start](https://apidocs.chargebee.com/docs/api/subscriptions#subscription_current_term_start ).
670
+ * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
954
671
 
955
- */
956
-
957
- date_from?:number;
958
-
959
- /**
960
- * @description The end date of the period being invoiced. The default value is [current_term_end](https://apidocs.chargebee.com/docs/api/subscriptions#subscription_current_term_end ).
672
+ In the response,
961
673
 
962
- */
963
-
964
- date_to?:number;
965
-
966
- /**
967
- * @description Whether the charges should be prorated according to the term specified by &#x60;date_from&#x60; and &#x60;date_to&#x60;. Should not be passed without &#x60;date_from&#x60; and &#x60;date_to&#x60;.
674
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
675
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
968
676
 
969
- */
970
-
971
- prorate?:boolean;
972
-
973
- /**
974
- * @description Only applicable when [Consolidated Invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html ) is enabled for the customer. Set to &#x60;false&#x60; to leave the current term charge for the subscription as [unbilled](https://www.chargebee.com/docs/unbilled-charges.html ). Once you have done this for all suitable subscriptions of the customer, call [Create an invoice for unbilled charges](https://apidocs.chargebee.com/docs/api/unbilled_charges#create_an_invoice_for_unbilled_charges ) to invoice them.
677
+ The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
975
678
 
976
- */
977
-
978
- invoice_immediately?:boolean;
979
- }
980
- export interface CreateSubItemForCustomerEstimateResponse {
981
- estimate:Estimate;
982
- }
983
- export interface CreateSubItemForCustomerEstimateInputParam {
984
-
985
- /**
986
- * @description The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
679
+ To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
987
680
 
988
- */
989
-
990
- use_existing_balances?:boolean;
991
-
992
- /**
993
- * @description If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html). The default value is as per the [site settings](https://www.chargebee.com/docs/unbilled-charges.html#configuration).
994
- **Note:** &#x60;invoice_immediately&#x60; only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter. .
681
+ **Note:**
995
682
 
996
- */
997
-
998
- invoice_immediately?:boolean;
999
-
1000
- /**
1001
- * @description The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles [set for the plan-item price](https://apidocs.chargebee.com/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_billing_cycles) is used.
683
+ * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
684
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
685
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
686
+ * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
1002
687
 
1003
688
  */
1004
-
1005
- billing_cycles?:number;
689
+
690
+ include_delayed_charges?:boolean;
1006
691
 
1007
692
  /**
1008
- * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
693
+ * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
694
+
695
+ In the response,
696
+
697
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
698
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
699
+
700
+ The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
701
+
702
+ To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
703
+
704
+ **Note:**
705
+
706
+ * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
707
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
708
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
709
+ * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
1009
710
 
1010
711
  */
1011
-
1012
- mandatory_items_to_remove?:string[];
712
+
713
+ use_existing_balances?:boolean;
1013
714
 
1014
715
  /**
1015
- * @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
716
+ * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
717
+
718
+ In the response,
719
+
720
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
721
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
722
+
723
+ The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
724
+
725
+ To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
726
+
727
+ **Note:**
728
+
729
+ * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
730
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
731
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
732
+ * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
1016
733
 
1017
734
  */
735
+
736
+ ignore_scheduled_cancellation?:boolean;
1018
737
 
1019
- terms_to_charge?:number;
738
+ /**
739
+ * @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
740
+
741
+ In the response,
742
+
743
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
744
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
745
+
746
+ The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don&#x27;t want these balances to be included you can specify &#x27;false&#x27; for the parameter *use_existing_balances*.
747
+
748
+ To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify &#x27;false&#x27; for the parameter *include_delayed_charges*.
749
+
750
+ **Note:**
751
+
752
+ * This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
753
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
754
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
755
+ * Only the subscription&#x27;s charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
756
+
757
+ */
758
+
759
+ ignore_scheduled_changes?:boolean;
760
+ }
761
+ export interface AdvanceInvoiceEstimateResponse {
762
+ estimate:Estimate;
763
+ }
764
+ export interface AdvanceInvoiceEstimateInputParam {
1020
765
 
1021
766
  /**
1022
- * @description Override the [billing alignment mode](https://www.chargebee.com/docs/calendar-billing.html#alignment-of-billing-date) for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site. \* delayed - Subscription period will be aligned with the configured billing date at the next renewal. \* immediate - Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..
767
+ * @description * For &#x60;schedule_type &#x3D; immediate&#x60;: the number of future billing cycles to be invoiced in advance. The invoicing is done for the [&#x60;remaining_billing_cycles&#x60;](subscriptions#subscription_remaining_billing_cycles) of the subscription if that is less than &#x60;terms_to_charge&#x60;.
768
+ * For &#x60;schedule_type &#x3D; fixed_intervals&#x60;: The number of future billing cycles in one [interval](advance_invoice_schedules#fixed_interval_schedule). The schedule is created such that the total number of billing cycles in the schedule does not exceed the [remaining_billing_cycles](subscriptions#subscription_remaining_billing_cycles) of the subscription.
769
+ .
1023
770
 
1024
771
  */
1025
772
 
1026
- billing_alignment_mode?:BillingAlignmentMode;
773
+ terms_to_charge?:number;
1027
774
 
1028
775
  /**
1029
- * @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
776
+ * @description Whether the charge should be invoiced immediately or added to [&#x60;unbilled_charges&#x60;](unbilled_charges). Applicable only when [&#x60;schedule_type&#x60;](subscriptions#charge_future_renewals_schedule_type) is &#x60;immediate&#x60;.
1030
777
 
1031
778
  */
1032
779
 
1033
- invoice_date?:number;
780
+ invoice_immediately?:boolean;
1034
781
 
1035
782
  /**
1036
- * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
783
+ * @description The type of advance invoice or advance invoicing schedule. \* immediate - Charge immediately for the number of billing cycles specified by [&#x60;terms_to_charge&#x60;](subscriptions#charge_future_renewals_terms_to_charge). \* specific_dates - Charge on [specific dates](subscriptions#charge_future_renewals_specific_dates_schedule_date). For each date, specify the [number of billing cycles](subscriptions#charge_future_renewals_specific_dates_schedule_terms_to_charge) to charge for. Up to 5 dates can be configured. \* fixed_intervals - Charge at fixed intervals of time. Specify the [number of billing cycles](subscriptions#charge_future_renewals_terms_to_charge) that constitute an interval and the number of [days before each interval](subscriptions#charge_future_renewals_fixed_interval_schedule_days_before_renewal) that the invoice should be generated. Also specify [when the schedule should end](subscriptions#charge_future_renewals_fixed_interval_schedule_end_schedule_on).
1037
784
 
1038
785
  */
1039
786
 
1040
- coupon_ids?:string[];
787
+ schedule_type?:ScheduleType;
1041
788
 
1042
789
  /**
1043
- * @description Parameters for subscription
790
+ * @description Parameters for fixed_interval_schedule
1044
791
 
1045
792
  */
1046
793
 
1047
- subscription?:{contract_term_billing_cycle_on_renewal?:number,free_period?:number,free_period_unit?:FreePeriodUnit,id?:string,start_date?:number,trial_end?:number,trial_end_action?:TrialEndAction};
794
+ fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
1048
795
 
1049
796
  /**
1050
- * @description Parameters for shipping_address
797
+ * @description Parameters for specific_dates_schedule
1051
798
 
1052
799
  */
1053
800
 
1054
- shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
801
+ specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
802
+ }
803
+ export interface RegenerateInvoiceEstimateResponse {
804
+ estimate:Estimate;
805
+ }
806
+ export interface RegenerateInvoiceEstimateInputParam {
1055
807
 
1056
808
  /**
1057
- * @description Parameters for contract_term
809
+ * @description The start date of the period being invoiced. The default value is [current_term_start](https://apidocs.chargebee.com/docs/api/subscriptions#subscription_current_term_start ).
1058
810
 
1059
811
  */
1060
812
 
1061
- contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
813
+ date_from?:number;
1062
814
 
1063
815
  /**
1064
- * @description Parameters for subscription_items
816
+ * @description The end date of the period being invoiced. The default value is [current_term_end](https://apidocs.chargebee.com/docs/api/subscriptions#subscription_current_term_end ).
1065
817
 
1066
818
  */
1067
819
 
1068
- subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
820
+ date_to?:number;
1069
821
 
1070
822
  /**
1071
- * @description Parameters for discounts
823
+ * @description Whether the charges should be prorated according to the term specified by &#x60;date_from&#x60; and &#x60;date_to&#x60;. Should not be passed without &#x60;date_from&#x60; and &#x60;date_to&#x60;.
1072
824
 
1073
825
  */
1074
826
 
1075
- discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
827
+ prorate?:boolean;
1076
828
 
1077
829
  /**
1078
- * @description Parameters for item_tiers
830
+ * @description Only applicable when [Consolidated Invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html ) is enabled for the customer. Set to &#x60;false&#x60; to leave the current term charge for the subscription as [unbilled](https://www.chargebee.com/docs/unbilled-charges.html ). Once you have done this for all suitable subscriptions of the customer, call [Create an invoice for unbilled charges](https://apidocs.chargebee.com/docs/api/unbilled_charges#create_an_invoice_for_unbilled_charges ) to invoice them.
1079
831
 
1080
832
  */
1081
833
 
1082
- 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}[];
834
+ invoice_immediately?:boolean;
835
+ }
836
+ export interface UpcomingInvoicesEstimateResponse {
837
+ estimate:Estimate;
1083
838
  }
839
+
1084
840
  export interface ChangeTermEndResponse {
1085
841
  estimate:Estimate;
1086
842
  }
@@ -1108,6 +864,102 @@ An immediate previous change was made
1108
864
 
1109
865
  invoice_immediately?:boolean;
1110
866
  }
867
+ export interface CancelSubscriptionForItemsResponse {
868
+ estimate:Estimate;
869
+ }
870
+ export interface CancelSubscriptionForItemsInputParam {
871
+
872
+ /**
873
+ * @description Set this to &#x60;true&#x60; if you want to cancel the subscription at the end of the current subscription billing cycle. The subscription &#x60;status&#x60; changes to &#x60;non_renewing&#x60;.
874
+
875
+ */
876
+
877
+ end_of_term?:boolean;
878
+
879
+ /**
880
+ * @description Specify the date/time at which you want to cancel the subscription. This parameter should not be provided when &#x60;end_of_term&#x60; is passed as &#x60;true&#x60;. &#x60;cancel_at&#x60; can be set to a value in the past. This is called backdating. Use backdating when the subscription has been canceled already but its billing has been delayed. The following prerequisites must be met to allow backdating:
881
+
882
+ * Backdating must be enabled for subscription cancellation.
883
+ * The current day of the month does not exceed the limit set in Chargebee for backdating subscription cancellation. This limit is typically the day of the month by which the accounting for the previous month must be closed.
884
+ * The date is on or after &#x60;current_term_start&#x60;.
885
+ * The date is on or after the last date/time any of the following changes were made:
886
+ * Changes in the recurring items or their prices.
887
+ * Addition of non-recurring items.
888
+ * The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription&#x27;s plan is 2 months and today is 14th April, &#x60;changes_scheduled_at&#x60; cannot be earlier than 14th February.
889
+ .
890
+
891
+ */
892
+
893
+ cancel_at?:number;
894
+
895
+ /**
896
+ * @description For immediate cancellation (&#x60;end_of_term&#x60; &#x3D; &#x60;false&#x60;), specify how to provide credits for current term charges. When not provided, the [site default](https://www.chargebee.com/docs/cancellations.html#configure-subscription-cancellation) is considered. \* none - No credits notes are created. \* full - Credits are issues for the full value of the current term charges. \* prorate - Prorated credits are issued.
897
+
898
+ */
899
+
900
+ credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
901
+
902
+ /**
903
+ * @description For immediate cancellation (&#x60;end_of_term&#x60; &#x3D; &#x60;false&#x60;), specify how to handle any unbilled charges. When not provided, the [site default](https://www.chargebee.com/docs/cancellations.html#configure-subscription-cancellation) is considered. \* invoice - An invoice is generated immediately with the unbilled charges. \* delete - The unbilled charges are deleted.
904
+
905
+ */
906
+
907
+ unbilled_charges_option?:UnbilledChargesOption;
908
+
909
+ /**
910
+ * @description Applicable when the subscription has past due invoices. Specify this if you want to close the due invoices of the subscription. If specified as schedule_payment_collection/write_off, the due invoices of the subscription will be qualified for the selected operation after the remaining refundable credits and excess payments are applied. **Note:** The payment collection attempt will be asynchronous. Not applicable when &#x27;end_of_term&#x27; is true. \* no_action - No action is taken. \* write_off - The amount due in the invoices will be written-off. Credit notes created due to write-off will not be sent in the response. \* schedule_payment_collection - An automatic charge for the due amount of the past invoices will be attempted on the payment method available, if customer&#x27;s auto-collection property is &#x27;ON&#x27;.
911
+
912
+ */
913
+
914
+ account_receivables_handling?:AccountReceivablesHandling;
915
+
916
+ /**
917
+ * @description Applicable when the customer has remaining refundable credits(issued against online payments). If specified as schedule_refund, the refund will be initiated for these credits after they are applied against the subscription&#x27;s past due invoices if any. **Note:** The refunds initiated will be asynchronous. Not applicable when &#x27;end_of_term&#x27; is true. \* schedule_refund - Initiates refund of the remaining credits. \* no_action - No action is taken.
918
+
919
+ */
920
+
921
+ refundable_credits_handling?:RefundableCreditsHandling;
922
+
923
+ /**
924
+ * @description Cancels the current contract term.
925
+
926
+ * &#x60;terminate_immediately&#x60; immediately does the following:
927
+ * sets the contract term [&#x60;status&#x60;](contract_terms#contract_term_status) to &#x60;terminated&#x60;.
928
+ * Cancels the subscription.
929
+ * Collects any [termination fee](contract_terms#termintation_fee).
930
+ * &#x60;end_of_contract_term&#x60; Sets the [&#x60;contract_term[action_at_term_end]&#x60;](contract_terms#contract_term_action_at_term_end) to &#x60;cancel&#x60;. In other words, the contract term is not renewed and the subscription is canceled at the end of the contract term.
931
+ . \* terminate_immediately - Terminate immediately \* end_of_contract_term - End of contract term
932
+
933
+ */
934
+
935
+ contract_term_cancel_option?:ContractTermCancelOption;
936
+
937
+ /**
938
+ * @description The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if &#x60;create_pending_invoices&#x60; is &#x60;true&#x60;, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the &#x60;tax&#x60; configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
939
+
940
+ * &#x60;invoice_date&#x60; must be in the past.
941
+ * &#x60;invoice_date&#x60; is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
942
+ * It is not earlier than &#x60;cancel_at&#x60;.
943
+ .
944
+
945
+ */
946
+
947
+ invoice_date?:number;
948
+
949
+ /**
950
+ * @description Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Subscriptions \&gt; Subscription Cancellation**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
951
+
952
+ */
953
+
954
+ cancel_reason_code?:string;
955
+
956
+ /**
957
+ * @description Parameters for subscription_items
958
+
959
+ */
960
+
961
+ subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
962
+ }
1111
963
  export interface PauseSubscriptionResponse {
1112
964
  estimate:Estimate;
1113
965
  }
@@ -1149,47 +1001,195 @@ If &#x60;no_action&#x60; is chosen, charges are added to the resumption invoice.
1149
1001
 
1150
1002
  subscription?:{pause_date?:number,resume_date?:number,skip_billing_cycles?:number};
1151
1003
  }
1152
- export interface AdvanceInvoiceEstimateResponse {
1004
+ export interface ResumeSubscriptionResponse {
1153
1005
  estimate:Estimate;
1154
1006
  }
1155
- export interface AdvanceInvoiceEstimateInputParam {
1007
+ export interface ResumeSubscriptionInputParam {
1156
1008
 
1157
1009
  /**
1158
- * @description * For &#x60;schedule_type &#x3D; immediate&#x60;: the number of future billing cycles to be invoiced in advance. The invoicing is done for the [&#x60;remaining_billing_cycles&#x60;](subscriptions#subscription_remaining_billing_cycles) of the subscription if that is less than &#x60;terms_to_charge&#x60;.
1159
- * For &#x60;schedule_type &#x3D; fixed_intervals&#x60;: The number of future billing cycles in one [interval](advance_invoice_schedules#fixed_interval_schedule). The schedule is created such that the total number of billing cycles in the schedule does not exceed the [remaining_billing_cycles](subscriptions#subscription_remaining_billing_cycles) of the subscription.
1160
- .
1010
+ * @description List of options to resume the subscription. \* immediately - Resume immediately \* specific_date - Resume on a specific date
1161
1011
 
1162
1012
  */
1163
1013
 
1164
- terms_to_charge?:number;
1014
+ resume_option?:ResumeOption;
1165
1015
 
1166
1016
  /**
1167
- * @description Whether the charge should be invoiced immediately or added to [&#x60;unbilled_charges&#x60;](unbilled_charges). Applicable only when [&#x60;schedule_type&#x60;](subscriptions#charge_future_renewals_schedule_type) is &#x60;immediate&#x60;.
1017
+ * @description Applicable when charges get added during this operation and **resume_option** is set as &#x27;immediately&#x27;. Allows to raise invoice immediately or add them to unbilled charges. \* add_to_unbilled_charges - Add to unbilled charges \* invoice_immediately - Invoice immediately
1168
1018
 
1169
1019
  */
1170
1020
 
1171
- invoice_immediately?:boolean;
1021
+ charges_handling?:ChargesHandling;
1172
1022
 
1173
1023
  /**
1174
- * @description The type of advance invoice or advance invoicing schedule. \* immediate - Charge immediately for the number of billing cycles specified by [&#x60;terms_to_charge&#x60;](subscriptions#charge_future_renewals_terms_to_charge). \* specific_dates - Charge on [specific dates](subscriptions#charge_future_renewals_specific_dates_schedule_date). For each date, specify the [number of billing cycles](subscriptions#charge_future_renewals_specific_dates_schedule_terms_to_charge) to charge for. Up to 5 dates can be configured. \* fixed_intervals - Charge at fixed intervals of time. Specify the [number of billing cycles](subscriptions#charge_future_renewals_terms_to_charge) that constitute an interval and the number of [days before each interval](subscriptions#charge_future_renewals_fixed_interval_schedule_days_before_renewal) that the invoice should be generated. Also specify [when the schedule should end](subscriptions#charge_future_renewals_fixed_interval_schedule_end_schedule_on).
1024
+ * @description Parameters for subscription
1175
1025
 
1176
1026
  */
1177
1027
 
1178
- schedule_type?:ScheduleType;
1028
+ subscription?:{resume_date?:number};
1029
+ }
1030
+ export interface GiftSubscriptionForItemsResponse {
1031
+ estimate:Estimate;
1032
+ }
1033
+ export interface GiftSubscriptionForItemsInputParam {
1179
1034
 
1180
1035
  /**
1181
- * @description Parameters for fixed_interval_schedule
1036
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
1182
1037
 
1183
1038
  */
1184
1039
 
1185
- fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
1040
+ coupon_ids?:string[];
1186
1041
 
1187
1042
  /**
1188
- * @description Parameters for specific_dates_schedule
1043
+ * @description Parameters for gift
1189
1044
 
1190
1045
  */
1191
1046
 
1192
- specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
1047
+ gift?:{auto_claim?:boolean,claim_expiry_date?:number,no_expiry?:boolean,scheduled_at?:number};
1048
+
1049
+ /**
1050
+ * @description Parameters for gifter
1051
+
1052
+ */
1053
+
1054
+ gifter?:{customer_id:string,note?:string,payment_src_id?:string,signature:string};
1055
+
1056
+ /**
1057
+ * @description Parameters for gift_receiver
1058
+
1059
+ */
1060
+
1061
+ gift_receiver?:{customer_id:string,email:string,first_name:string,last_name:string};
1062
+
1063
+ /**
1064
+ * @description Parameters for payment_intent
1065
+
1066
+ */
1067
+
1068
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
1069
+
1070
+ /**
1071
+ * @description Parameters for shipping_address
1072
+
1073
+ */
1074
+
1075
+ shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
1076
+
1077
+ /**
1078
+ * @description Parameters for subscription_items
1079
+
1080
+ */
1081
+
1082
+ subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string}[];
1083
+ }
1084
+ export interface CreateInvoiceForItemsResponse {
1085
+ estimate:Estimate;
1086
+ }
1087
+ export interface CreateInvoiceForItemsInputParam {
1088
+
1089
+ /**
1090
+ * @description The currency code (ISO 4217 format) of the invoice amount.
1091
+
1092
+ */
1093
+
1094
+ currency_code?:string;
1095
+
1096
+ /**
1097
+ * @description A note for this particular invoice. This, and [all other notes](/docs/api/invoices#invoice_notes) for the invoice are displayed on the PDF invoice sent to the customer.
1098
+
1099
+ */
1100
+
1101
+ invoice_note?:string;
1102
+
1103
+ /**
1104
+ * @description Set as &#x60;true&#x60; to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
1105
+
1106
+ */
1107
+
1108
+ remove_general_note?:boolean;
1109
+
1110
+ /**
1111
+ * @description List of Coupons to be added.
1112
+
1113
+ */
1114
+
1115
+ coupon_ids?:string[];
1116
+
1117
+ /**
1118
+ * @description Authorization transaction to be captured.
1119
+
1120
+ */
1121
+
1122
+ authorization_transaction_id?:string;
1123
+
1124
+ /**
1125
+ * @description Payment source to be used for this payment.
1126
+
1127
+ */
1128
+
1129
+ payment_source_id?:string;
1130
+
1131
+ /**
1132
+ * @description The customer level auto collection will be override if specified. \* on - Whenever an invoice is created, an automatic attempt will be made to charge. \* off - Whenever an invoice is created as payment due.
1133
+
1134
+ */
1135
+
1136
+ auto_collection?:AutoCollection;
1137
+
1138
+ /**
1139
+ * @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
1140
+
1141
+ */
1142
+
1143
+ invoice_date?:number;
1144
+
1145
+ /**
1146
+ * @description Parameters for invoice
1147
+
1148
+ */
1149
+
1150
+ invoice?:{customer_id?:string,po_number?:string,subscription_id?:string};
1151
+
1152
+ /**
1153
+ * @description Parameters for shipping_address
1154
+
1155
+ */
1156
+
1157
+ shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
1158
+
1159
+ /**
1160
+ * @description Parameters for item_prices
1161
+
1162
+ */
1163
+
1164
+ 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}[];
1165
+
1166
+ /**
1167
+ * @description Parameters for item_tiers
1168
+
1169
+ */
1170
+
1171
+ 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}[];
1172
+
1173
+ /**
1174
+ * @description Parameters for charges
1175
+
1176
+ */
1177
+
1178
+ 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}[];
1179
+
1180
+ /**
1181
+ * @description Parameters for notes_to_remove
1182
+
1183
+ */
1184
+
1185
+ notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
1186
+
1187
+ /**
1188
+ * @description Parameters for discounts
1189
+
1190
+ */
1191
+
1192
+ discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
1193
1193
  }
1194
1194
 
1195
1195
  }