chargebee 2.25.3 → 2.26.1

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 (65) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +55 -49
  3. package/lib/chargebee.js +1 -1
  4. package/package.json +1 -1
  5. package/types/core.d.ts +1 -0
  6. package/types/resources/Address.d.ts +245 -5
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  8. package/types/resources/AttachedItem.d.ts +305 -13
  9. package/types/resources/Card.d.ts +485 -13
  10. package/types/resources/Comment.d.ts +177 -11
  11. package/types/resources/Contact.d.ts +54 -0
  12. package/types/resources/ContractTerm.d.ts +83 -0
  13. package/types/resources/Coupon.d.ts +665 -20
  14. package/types/resources/CouponCode.d.ts +56 -5
  15. package/types/resources/CouponSet.d.ts +224 -17
  16. package/types/resources/CreditNote.d.ts +1202 -44
  17. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  18. package/types/resources/Customer.d.ts +2132 -73
  19. package/types/resources/DifferentialPrice.d.ts +266 -15
  20. package/types/resources/Discount.d.ts +107 -0
  21. package/types/resources/Download.d.ts +18 -0
  22. package/types/resources/EntitlementOverride.d.ts +101 -7
  23. package/types/resources/Estimate.d.ts +1181 -27
  24. package/types/resources/Event.d.ts +145 -8
  25. package/types/resources/Export.d.ts +703 -32
  26. package/types/resources/Feature.d.ts +356 -22
  27. package/types/resources/Gift.d.ts +351 -24
  28. package/types/resources/Hierarchy.d.ts +30 -0
  29. package/types/resources/HostedPage.d.ts +1212 -37
  30. package/types/resources/ImpactedItem.d.ts +41 -1
  31. package/types/resources/ImpactedSubscription.d.ts +36 -1
  32. package/types/resources/InAppSubscription.d.ts +636 -9
  33. package/types/resources/Invoice.d.ts +2293 -93
  34. package/types/resources/InvoiceEstimate.d.ts +75 -6
  35. package/types/resources/Item.d.ts +542 -16
  36. package/types/resources/ItemEntitlement.d.ts +172 -13
  37. package/types/resources/ItemFamily.d.ts +173 -15
  38. package/types/resources/ItemPrice.d.ts +971 -26
  39. package/types/resources/Media.d.ts +24 -0
  40. package/types/resources/NonSubscription.d.ts +51 -3
  41. package/types/resources/Order.d.ts +1224 -32
  42. package/types/resources/PaymentIntent.d.ts +318 -8
  43. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  44. package/types/resources/PaymentSource.d.ts +1259 -55
  45. package/types/resources/PaymentVoucher.d.ts +262 -14
  46. package/types/resources/PortalSession.d.ts +187 -10
  47. package/types/resources/PromotionalCredit.d.ts +351 -16
  48. package/types/resources/Purchase.d.ts +274 -5
  49. package/types/resources/Quote.d.ts +1595 -62
  50. package/types/resources/QuoteLineGroup.d.ts +134 -5
  51. package/types/resources/QuotedCharge.d.ts +63 -5
  52. package/types/resources/QuotedSubscription.d.ts +192 -5
  53. package/types/resources/ResourceMigration.d.ts +73 -3
  54. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  55. package/types/resources/Subscription.d.ts +3462 -137
  56. package/types/resources/SubscriptionEntitlement.d.ts +116 -8
  57. package/types/resources/SubscriptionEstimate.d.ts +36 -2
  58. package/types/resources/TaxWithheld.d.ts +32 -0
  59. package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
  60. package/types/resources/TimeMachine.d.ts +99 -7
  61. package/types/resources/Token.d.ts +179 -7
  62. package/types/resources/Transaction.d.ts +597 -25
  63. package/types/resources/UnbilledCharge.d.ts +355 -14
  64. package/types/resources/Usage.d.ts +259 -13
  65. package/types/resources/VirtualBankAccount.d.ts +255 -17
@@ -1,200 +1,1354 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface Estimate {
4
+
5
+ /**
6
+ * @description The time at which this estimate got generated
7
+
8
+ */
9
+
4
10
  created_at:number;
11
+
12
+ /**
13
+ * @description Represents the subscription details when the &#x27;estimate&#x27; operations are invoked.
14
+
15
+ */
16
+
5
17
  subscription_estimate?:SubscriptionEstimate;
18
+
19
+ /**
20
+ * @description Is a list of estimated subscriptions i.e., an array of *subscription_estimate* objects. It is generated when &#x27;Create an estimate for purchase&#x27; operation is invoked
21
+
22
+ */
23
+
6
24
  subscription_estimates?:SubscriptionEstimate[];
25
+
26
+ /**
27
+ * @description Represents the preview of the invoice generated immediately when the &#x27;estimate&#x27; operations are invoked.
28
+
29
+ */
30
+
7
31
  invoice_estimate?:InvoiceEstimate;
32
+
33
+ /**
34
+ * @description Is a list of estimated invoices i.e., an array of *invoice_estimate* objects. It is generated when &#x27;Create an estimate for unbilled charges&#x27; operation is invoked
35
+
36
+ */
37
+
8
38
  invoice_estimates?:InvoiceEstimate[];
39
+
40
+ /**
41
+ * @description Represents the preview of the invoice generated at term end when the &#x27;estimate&#x27; operations are invoked.
42
+
43
+ */
44
+
9
45
  next_invoice_estimate?:InvoiceEstimate;
46
+
47
+ /**
48
+ * @description Represents the preview of the credit-notes generated during &#x27;estimate&#x27; operation. Currently applicable only for the &#x27;Update Subscription Estimate&#x27; operation.
49
+
50
+ */
51
+
10
52
  credit_note_estimates?:CreditNoteEstimate[];
53
+
54
+ /**
55
+ * @description Represents the preview of the unbilled charges generated during &#x27;estimate&#x27; operation. Currently not applicable for the &#x27;Subscription renewal estimate&#x27; operation.
56
+
57
+ */
58
+
11
59
  unbilled_charge_estimates?:UnbilledCharge[];
12
60
  }
13
61
  export namespace Estimate {
14
- export class EstimateResource {
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&#x27;t want these balances to be included you can specify &#x27;false&#x27; 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 &#x27;false&#x27; 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 &#x27;Non Renewing&#x27; 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 &#x27;Cancelled&#x27; subscriptions.
80
+ * 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.
81
+
82
+ */
83
+
15
84
  renewal_estimate(subscription_id:string, input?:RenewalEstimateInputParam):ChargebeeRequest<RenewalEstimateResponse>;
85
+
86
+ /**
87
+ * @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
+
89
+ **Note:** Estimate operations do not make any changes in Chargebee; hence this API does not create an actual &#x60;customer&#x60; or &#x60;subscription&#x60; record.
90
+ **See also**
91
+
92
+ * [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.
93
+
94
+ The response contains one or more of the following objects:
95
+
96
+ * &#x60;subscription_estimate&#x60;: The subscription details like the status of the subscription (such as &#x60;in_trial&#x60; or &#x60;active&#x60;), next billing date, and so on.
97
+ * &#x60;invoice_estimate&#x60;:The details of the immediate invoice, if there is one. If the subscription is created in &#x60;trial&#x60;/&#x60;future&#x60; states, &#x60;invoice_estimate&#x60; is unavailable as no immediate invoice is generated.
98
+ * &#x60;next_invoice_estimate&#x60;:This is returned when an immediate invoice is not generated. It contains the details of the invoice that will be generated on the next billing date of the subscription.
99
+ * &#x60;unbilled_charge_estimates&#x60;: This contains the details of charges that have not been invoiced. This is returned only if the &#x60;invoice_immediately&#x60; parameter is set to &#x60;false&#x60;.
100
+
101
+
102
+
103
+
104
+ */
105
+
16
106
  create_sub_item_estimate(input?:CreateSubItemEstimateInputParam):ChargebeeRequest<CreateSubItemEstimateResponse>;
107
+
108
+ /**
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
+
17
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
+
18
131
  resume_subscription(subscription_id:string, input?:ResumeSubscriptionInputParam):ChargebeeRequest<ResumeSubscriptionResponse>;
132
+
133
+ /**
134
+ * @description This endpoint creates an invoice estimate for non-recurring items.
135
+
136
+ */
137
+
19
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.
142
+
143
+ */
144
+
20
145
  gift_subscription_for_items(input?:GiftSubscriptionForItemsInputParam):ChargebeeRequest<GiftSubscriptionForItemsResponse>;
146
+
147
+ /**
148
+ * @description Returns an estimate for updating a subscription.
149
+
150
+ In the response,
151
+
152
+ * [subscription_estimate](/docs/api/estimates#subscription_estimate_attributes): The details of the changed subscription such as &#x60;status&#x60;, next billing date, and so on.
153
+ * [invoice_estimate](/docs/api/estimates#invoice_estimate_attributes):The details of the immediate invoice, if it is generated. An immediate invoice is not generated when:
154
+ * &#x60;end_of_term&#x60; parameter is true
155
+ * &#x60;prorate&#x60; parameter is &#x60;false&#x60;
156
+ * No changes are made to the plan item prices or addon item prices in &#x60;subscription_items&#x60;.
157
+ * For changes such as [quantity downgrades](https://www.chargebee.com/docs/proration.html#proration-mechanism_plan-quantity-downgrade-paid-invoice).
158
+ * [next_invoice_estimate](/docs/api/estimates#next_invoice_estimate_attributes):The details of the invoice to be generated later (if any) on the occasion that no immediate invoice has been generated.
159
+ * [credit_note_estimates](/docs/api/estimates#credit_note_estimate_attributes):The list of credit notes (if any) generated during this operation.
160
+ * [unbilled_charge_estimates](/docs/api/estimates#unbilled_charge_estimate_attributes): The details of charges that have not been invoiced. This is returned only if the &#x60;invoice_immediately&#x60; parameter is set to &#x60;false&#x60;.
161
+
162
+ */
163
+
21
164
  update_subscription_for_items(input?:UpdateSubscriptionForItemsInputParam):ChargebeeRequest<UpdateSubscriptionForItemsResponse>;
165
+
166
+ /**
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).
168
+
169
+ In the response:
170
+
171
+ * **estimate.invoice_estimates\[\]** has details of the invoices scheduled to be generated.
172
+
173
+ **Note:** If *consolidated invoicing* is enabled you may use this API to test whether upcoming renewals are consolidated.
174
+
175
+ */
176
+
22
177
  upcoming_invoices_estimate(customer_id:string):ChargebeeRequest<UpcomingInvoicesEstimateResponse>;
178
+
179
+ /**
180
+ * @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:
181
+
182
+ * An invoice exists for the current term and its &#x60;status&#x60; is not &#x60;voided&#x60;.
183
+ * There are [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html) for the current term.
184
+ * The subscription has an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html).
185
+
186
+
187
+
188
+ #### Response
189
+
190
+ Returns an &#x60;estimate&#x60; object with one of the following components depending on the value of &#x60;invoice_immediately&#x60;.
191
+
192
+ * If the value is &#x60;true&#x60;: an &#x60;invoice_estimate&#x60; object that corresponds to the regenerated invoice.
193
+ * If the value is &#x60;false&#x60;: a list of &#x60;unbilled_charge_estimate&#x60; objects corresponding to all the unbilled charges created for the current term of the subscription.
194
+
195
+
196
+
197
+
198
+ */
199
+
23
200
  regenerate_invoice_estimate(subscription_id:string, input?:RegenerateInvoiceEstimateInputParam):ChargebeeRequest<RegenerateInvoiceEstimateResponse>;
201
+
202
+ /**
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**
205
+
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.
207
+
208
+ */
209
+
24
210
  create_sub_item_for_customer_estimate(customer_id:string, input?:CreateSubItemForCustomerEstimateInputParam):ChargebeeRequest<CreateSubItemForCustomerEstimateResponse>;
211
+
212
+ /**
213
+ * @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.
214
+
215
+ In the response,
216
+
217
+ * **estimate.subscription_estimate** has the subscription details like the status of the subscription (in_trial, active, etc.), next billing date, and so on.
218
+ * **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 when
219
+ * *prorate* parameter is false, or
220
+ * *invoice_immediately* parameter is false, or
221
+ * subscription is in *in-trial* state
222
+ * **estimate.credit_note_estimates\[\]** has details of the credit-notes that will get generated during this operation. This list will be empty if no credit-note gets generated during this operation.
223
+ * **estimate.unbilled_charge_estimates\[\]** has details of the unbilled charges. This is returned only if *invoice_immediately* is set as false.
224
+
225
+ */
226
+
25
227
  change_term_end(subscription_id:string, input:ChangeTermEndInputParam):ChargebeeRequest<ChangeTermEndResponse>;
228
+
229
+ /**
230
+ * @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
+
232
+ In the response,
233
+
234
+ * **estimate.subscription_estimate** has the subscription details.
235
+ * **estimate.invoice_estimate** has details of the invoice that are generated immediately. This is not present if no immediate invoices are generated for this operation.
236
+ * **estimate.credit_note_estimates\[\]** has details of the credit notes that are generated during this operation. This list is empty if no credit notes are generated.
237
+
238
+ */
239
+
26
240
  pause_subscription(subscription_id:string, input?:PauseSubscriptionInputParam):ChargebeeRequest<PauseSubscriptionResponse>;
241
+
242
+ /**
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
+
27
247
  advance_invoice_estimate(subscription_id:string, input?:AdvanceInvoiceEstimateInputParam):ChargebeeRequest<AdvanceInvoiceEstimateResponse>;
28
248
  }
29
- export interface RenewalEstimateResponse {
30
- estimate:Estimate;
249
+ export interface RenewalEstimateResponse {
250
+ /**
251
+ * @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.
252
+
253
+ In the response,
254
+
255
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
256
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
257
+
258
+ 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*.
259
+
260
+ 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*.
261
+
262
+ **Note:**
263
+
264
+ * 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.
265
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
266
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
267
+ * 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.
268
+
269
+ */
270
+
271
+ estimate:Estimate;
31
272
  }
32
273
  export interface RenewalEstimateInputParam {
274
+
275
+ /**
276
+ * @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.
277
+
278
+ In the response,
279
+
280
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
281
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
282
+
283
+ 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*.
284
+
285
+ 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*.
286
+
287
+ **Note:**
288
+
289
+ * 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.
290
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
291
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
292
+ * 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.
293
+
294
+ */
295
+
33
296
  include_delayed_charges?:boolean;
297
+
298
+ /**
299
+ * @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.
300
+
301
+ In the response,
302
+
303
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
304
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
305
+
306
+ 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*.
307
+
308
+ 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*.
309
+
310
+ **Note:**
311
+
312
+ * 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.
313
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
314
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
315
+ * 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.
316
+
317
+ */
318
+
34
319
  use_existing_balances?:boolean;
320
+
321
+ /**
322
+ * @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.
323
+
324
+ In the response,
325
+
326
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
327
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
328
+
329
+ 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*.
330
+
331
+ 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*.
332
+
333
+ **Note:**
334
+
335
+ * 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.
336
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
337
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
338
+ * 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.
339
+
340
+ */
341
+
35
342
  ignore_scheduled_cancellation?:boolean;
343
+
344
+ /**
345
+ * @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.
346
+
347
+ In the response,
348
+
349
+ * **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
350
+ * **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
351
+
352
+ 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*.
353
+
354
+ 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*.
355
+
356
+ **Note:**
357
+
358
+ * 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.
359
+ * For &#x27;Non Renewing&#x27; subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
360
+ * This API is not supported for &#x27;Cancelled&#x27; subscriptions.
361
+ * 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.
362
+
363
+ */
364
+
36
365
  ignore_scheduled_changes?:boolean;
37
366
  }
38
- export interface CreateSubItemEstimateResponse {
39
- estimate:Estimate;
367
+ export interface CreateSubItemEstimateResponse {
368
+ /**
369
+ * @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.
370
+
371
+ **Note:** Estimate operations do not make any changes in Chargebee; hence this API does not create an actual &#x60;customer&#x60; or &#x60;subscription&#x60; record.
372
+ **See also**
373
+
374
+ * [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.
375
+
376
+ The response contains one or more of the following objects:
377
+
378
+ * &#x60;subscription_estimate&#x60;: The subscription details like the status of the subscription (such as &#x60;in_trial&#x60; or &#x60;active&#x60;), next billing date, and so on.
379
+ * &#x60;invoice_estimate&#x60;:The details of the immediate invoice, if there is one. If the subscription is created in &#x60;trial&#x60;/&#x60;future&#x60; states, &#x60;invoice_estimate&#x60; is unavailable as no immediate invoice is generated.
380
+ * &#x60;next_invoice_estimate&#x60;:This is returned when an immediate invoice is not generated. It contains the details of the invoice that will be generated on the next billing date of the subscription.
381
+ * &#x60;unbilled_charge_estimates&#x60;: This contains the details of charges that have not been invoiced. This is returned only if the &#x60;invoice_immediately&#x60; parameter is set to &#x60;false&#x60;.
382
+
383
+
384
+
385
+
386
+ */
387
+
388
+ estimate:Estimate;
40
389
  }
41
390
  export interface CreateSubItemEstimateInputParam {
391
+
392
+ /**
393
+ * @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.
394
+
395
+ */
396
+
42
397
  billing_cycles?:number;
398
+
399
+ /**
400
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
401
+
402
+ */
403
+
43
404
  mandatory_items_to_remove?:string[];
405
+
406
+ /**
407
+ * @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
408
+
409
+ */
410
+
44
411
  terms_to_charge?:number;
412
+
413
+ /**
414
+ * @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. \* immediate - Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly.. \* delayed - Subscription period will be aligned with the configured billing date at the next renewal.
415
+
416
+ */
417
+
45
418
  billing_alignment_mode?:BillingAlignmentMode;
419
+
420
+ /**
421
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
422
+
423
+ */
424
+
46
425
  coupon_ids?:string[];
426
+
427
+ /**
428
+ * @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).
429
+ **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. .
430
+
431
+ */
432
+
47
433
  invoice_immediately?:boolean;
434
+
435
+ /**
436
+ * @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.
437
+
438
+ */
439
+
48
440
  invoice_date?:number;
441
+
442
+ /**
443
+ * @description Indicates the Client profile id for the customer. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
444
+
445
+ */
446
+
49
447
  client_profile_id?:string;
448
+
449
+ /**
450
+ * @description Parameters for subscription
451
+
452
+ */
453
+
50
454
  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};
455
+
456
+ /**
457
+ * @description Parameters for billing_address
458
+
459
+ */
460
+
51
461
  billing_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
462
+
463
+ /**
464
+ * @description Parameters for shipping_address
465
+
466
+ */
467
+
52
468
  shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
469
+
470
+ /**
471
+ * @description Parameters for customer
472
+
473
+ */
474
+
53
475
  customer?:{customer_type?:CustomerType,entity_code?:EntityCode,exempt_number?:string,exemption_details?:any[],registered_for_gst?:boolean,taxability?:Taxability,vat_number?:string,vat_number_prefix?:string};
476
+
477
+ /**
478
+ * @description Parameters for contract_term
479
+
480
+ */
481
+
54
482
  contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
483
+
484
+ /**
485
+ * @description Parameters for subscription_items
486
+
487
+ */
488
+
55
489
  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}[];
490
+
491
+ /**
492
+ * @description Parameters for discounts
493
+
494
+ */
495
+
56
496
  discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
497
+
498
+ /**
499
+ * @description Parameters for item_tiers
500
+
501
+ */
502
+
57
503
  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}[];
58
504
  }
59
- export interface CancelSubscriptionForItemsResponse {
60
- estimate:Estimate;
505
+ export interface CancelSubscriptionForItemsResponse {
506
+ /**
507
+ * @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.
508
+
509
+ */
510
+
511
+ estimate:Estimate;
61
512
  }
62
513
  export interface CancelSubscriptionForItemsInputParam {
514
+
515
+ /**
516
+ * @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;.
517
+
518
+ */
519
+
63
520
  end_of_term?:boolean;
521
+
522
+ /**
523
+ * @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:
524
+
525
+ * Backdating must be enabled for subscription cancellation.
526
+ * 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.
527
+ * The date is on or after &#x60;current_term_start&#x60;.
528
+ * The date is on or after the last date/time any of the following changes were made:
529
+ * Changes in the recurring items or their prices.
530
+ * Addition of non-recurring items.
531
+ * 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.
532
+ .
533
+
534
+ */
535
+
64
536
  cancel_at?:number;
537
+
538
+ /**
539
+ * @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.
540
+
541
+ */
542
+
65
543
  credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
544
+
545
+ /**
546
+ * @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.
547
+
548
+ */
549
+
66
550
  unbilled_charges_option?:UnbilledChargesOption;
551
+
552
+ /**
553
+ * @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;.
554
+
555
+ */
556
+
67
557
  account_receivables_handling?:AccountReceivablesHandling;
558
+
559
+ /**
560
+ * @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.
561
+
562
+ */
563
+
68
564
  refundable_credits_handling?:RefundableCreditsHandling;
565
+
566
+ /**
567
+ * @description Cancels the current contract term.
568
+
569
+ * &#x60;terminate_immediately&#x60; immediately does the following:
570
+ * sets the contract term [&#x60;status&#x60;](contract_terms#contract_term_status) to &#x60;terminated&#x60;.
571
+ * Cancels the subscription.
572
+ * Collects any [termination fee](contract_terms#termintation_fee).
573
+ * &#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.
574
+ . \* terminate_immediately - Terminate immediately \* end_of_contract_term - End of contract term
575
+
576
+ */
577
+
69
578
  contract_term_cancel_option?:ContractTermCancelOption;
579
+
580
+ /**
581
+ * @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:
582
+
583
+ * &#x60;invoice_date&#x60; must be in the past.
584
+ * &#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.
585
+ * It is not earlier than &#x60;cancel_at&#x60;.
586
+ .
587
+
588
+ */
589
+
70
590
  invoice_date?:number;
591
+
592
+ /**
593
+ * @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.
594
+
595
+ */
596
+
71
597
  cancel_reason_code?:string;
598
+
599
+ /**
600
+ * @description Parameters for subscription_items
601
+
602
+ */
603
+
72
604
  subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
73
605
  }
74
- export interface ResumeSubscriptionResponse {
75
- estimate:Estimate;
606
+ export interface ResumeSubscriptionResponse {
607
+ /**
608
+ * @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.
609
+
610
+ In the response,
611
+
612
+ * **estimate.subscription_estimate** has the subscription details.
613
+ * **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^++^.
614
+
615
+ **^++^What is an &quot;in-term resumption&quot;?**
616
+ An &quot;in-term resumption&quot; is when the resumption happens within the billing term of the subscription.
617
+ * **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.
618
+
619
+ 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.
620
+
621
+ */
622
+
623
+ estimate:Estimate;
76
624
  }
77
625
  export interface ResumeSubscriptionInputParam {
626
+
627
+ /**
628
+ * @description List of options to resume the subscription. \* immediately - Resume immediately \* specific_date - Resume on a specific date
629
+
630
+ */
631
+
78
632
  resume_option?:ResumeOption;
633
+
634
+ /**
635
+ * @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
636
+
637
+ */
638
+
79
639
  charges_handling?:ChargesHandling;
640
+
641
+ /**
642
+ * @description Parameters for subscription
643
+
644
+ */
645
+
80
646
  subscription?:{resume_date?:number};
81
647
  }
82
- export interface CreateInvoiceForItemsResponse {
83
- estimate:Estimate;
648
+ export interface CreateInvoiceForItemsResponse {
649
+ /**
650
+ * @description This endpoint creates an invoice estimate for non-recurring items.
651
+
652
+ */
653
+
654
+ estimate:Estimate;
84
655
  }
85
656
  export interface CreateInvoiceForItemsInputParam {
657
+
658
+ /**
659
+ * @description The currency code (ISO 4217 format) of the invoice amount.
660
+
661
+ */
662
+
86
663
  currency_code?:string;
664
+
665
+ /**
666
+ * @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.
667
+
668
+ */
669
+
87
670
  invoice_note?:string;
671
+
672
+ /**
673
+ * @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.
674
+
675
+ */
676
+
88
677
  remove_general_note?:boolean;
678
+
679
+ /**
680
+ * @description List of Coupons to be added.
681
+
682
+ */
683
+
89
684
  coupon_ids?:string[];
685
+
686
+ /**
687
+ * @description Authorization transaction to be captured.
688
+
689
+ */
690
+
90
691
  authorization_transaction_id?:string;
692
+
693
+ /**
694
+ * @description Payment source to be used for this payment.
695
+
696
+ */
697
+
91
698
  payment_source_id?:string;
699
+
700
+ /**
701
+ * @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.
702
+
703
+ */
704
+
92
705
  auto_collection?:AutoCollection;
706
+
707
+ /**
708
+ * @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.
709
+
710
+ */
711
+
93
712
  invoice_date?:number;
713
+
714
+ /**
715
+ * @description Parameters for invoice
716
+
717
+ */
718
+
94
719
  invoice?:{customer_id?:string,po_number?:string,subscription_id?:string};
720
+
721
+ /**
722
+ * @description Parameters for shipping_address
723
+
724
+ */
725
+
95
726
  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};
727
+
728
+ /**
729
+ * @description Parameters for item_prices
730
+
731
+ */
732
+
96
733
  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}[];
734
+
735
+ /**
736
+ * @description Parameters for item_tiers
737
+
738
+ */
739
+
97
740
  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}[];
741
+
742
+ /**
743
+ * @description Parameters for charges
744
+
745
+ */
746
+
98
747
  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}[];
748
+
749
+ /**
750
+ * @description Parameters for notes_to_remove
751
+
752
+ */
753
+
99
754
  notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
755
+
756
+ /**
757
+ * @description Parameters for discounts
758
+
759
+ */
760
+
100
761
  discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
101
762
  }
102
- export interface GiftSubscriptionForItemsResponse {
103
- estimate:Estimate;
763
+ export interface GiftSubscriptionForItemsResponse {
764
+ /**
765
+ * @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.
766
+
767
+ */
768
+
769
+ estimate:Estimate;
104
770
  }
105
771
  export interface GiftSubscriptionForItemsInputParam {
772
+
773
+ /**
774
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
775
+
776
+ */
777
+
106
778
  coupon_ids?:string[];
779
+
780
+ /**
781
+ * @description Parameters for gift
782
+
783
+ */
784
+
107
785
  gift?:{auto_claim?:boolean,claim_expiry_date?:number,no_expiry?:boolean,scheduled_at?:number};
786
+
787
+ /**
788
+ * @description Parameters for gifter
789
+
790
+ */
791
+
108
792
  gifter?:{customer_id:string,note?:string,payment_src_id?:string,signature:string};
793
+
794
+ /**
795
+ * @description Parameters for gift_receiver
796
+
797
+ */
798
+
109
799
  gift_receiver?:{customer_id:string,email:string,first_name:string,last_name:string};
800
+
801
+ /**
802
+ * @description Parameters for payment_intent
803
+
804
+ */
805
+
110
806
  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};
807
+
808
+ /**
809
+ * @description Parameters for shipping_address
810
+
811
+ */
812
+
111
813
  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};
814
+
815
+ /**
816
+ * @description Parameters for subscription_items
817
+
818
+ */
819
+
112
820
  subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string}[];
113
821
  }
114
- export interface UpdateSubscriptionForItemsResponse {
115
- estimate:Estimate;
822
+ export interface UpdateSubscriptionForItemsResponse {
823
+ /**
824
+ * @description Returns an estimate for updating a subscription.
825
+
826
+ In the response,
827
+
828
+ * [subscription_estimate](/docs/api/estimates#subscription_estimate_attributes): The details of the changed subscription such as &#x60;status&#x60;, next billing date, and so on.
829
+ * [invoice_estimate](/docs/api/estimates#invoice_estimate_attributes):The details of the immediate invoice, if it is generated. An immediate invoice is not generated when:
830
+ * &#x60;end_of_term&#x60; parameter is true
831
+ * &#x60;prorate&#x60; parameter is &#x60;false&#x60;
832
+ * No changes are made to the plan item prices or addon item prices in &#x60;subscription_items&#x60;.
833
+ * For changes such as [quantity downgrades](https://www.chargebee.com/docs/proration.html#proration-mechanism_plan-quantity-downgrade-paid-invoice).
834
+ * [next_invoice_estimate](/docs/api/estimates#next_invoice_estimate_attributes):The details of the invoice to be generated later (if any) on the occasion that no immediate invoice has been generated.
835
+ * [credit_note_estimates](/docs/api/estimates#credit_note_estimate_attributes):The list of credit notes (if any) generated during this operation.
836
+ * [unbilled_charge_estimates](/docs/api/estimates#unbilled_charge_estimate_attributes): The details of charges that have not been invoiced. This is returned only if the &#x60;invoice_immediately&#x60; parameter is set to &#x60;false&#x60;.
837
+
838
+ */
839
+
840
+ estimate:Estimate;
116
841
  }
117
842
  export interface UpdateSubscriptionForItemsInputParam {
843
+
844
+ /**
845
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
846
+
847
+ */
848
+
118
849
  mandatory_items_to_remove?:string[];
850
+
851
+ /**
852
+ * @description If &#x60;true&#x60; then the existing &#x60;subscription_items&#x60; list for the subscription is replaced by the one provided. If &#x60;false&#x60; then the provided &#x60;subscription_items&#x60; list gets added to the existing list.
853
+
854
+ */
855
+
119
856
  replace_items_list?:boolean;
857
+
858
+ /**
859
+ * @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 set to &#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. taxes and line_item_taxes are computed based on the tax configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
860
+
861
+ * &#x60;invoice_date&#x60; must be in the past.
862
+ * &#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.
863
+ * It is not earlier than &#x60;changes_scheduled_at&#x60;, &#x60;reactivate_from&#x60;, or &#x60;trial_end&#x60;.
864
+ * &#x60;invoice_immediately&#x60; is &#x60;true&#x60;.
865
+ .
866
+
867
+ */
868
+
120
869
  invoice_date?:number;
870
+
871
+ /**
872
+ * @description Billing cycles set for plan-item price is used by default.
873
+
874
+ */
875
+
121
876
  billing_cycles?:number;
877
+
878
+ /**
879
+ * @description The number of subscription billing cycles to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html). If a new term is started for the subscription due to this API call, then &#x60;terms_to_charge&#x60; is inclusive of this new term. See description for the &#x60;force_term_reset&#x60; parameter to learn more about when a subscription term is reset.
880
+
881
+ */
882
+
122
883
  terms_to_charge?:number;
884
+
885
+ /**
886
+ * @description If the subscription &#x60;status&#x60; is &#x60;cancelled&#x60; and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated.
887
+ **Note:** It is recommended not to pass this parameter along with &#x60;changed_scheduled_at&#x60;. &#x60;reactivate_from&#x60; can be backdated (set to a value in the past). Use backdating when the subscription has been reactivated already but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
888
+
889
+ * Backdating must be enabled for subscription reactivation operations.
890
+ * The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
891
+ * The date is on or after the last date/time any of the product catalog items of the subscription were changed.
892
+ * 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 plan in the subscription is 2 months and today is 14th April, &#x60;changes_scheduled_at&#x60; cannot be earlier than 14th February.
893
+ .
894
+
895
+ */
896
+
123
897
  reactivate_from?:number;
898
+
899
+ /**
900
+ * @description Override the [billing alignment mode](https://www.chargebee.com/docs/calendar-billing.html#alignment-of-billing-date) chosen for the site for calendar billing. Only applicable when using calendar billing. \* immediate - Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly.. \* delayed - Subscription period will be aligned with the configured billing date at the next renewal.
901
+
902
+ */
903
+
124
904
  billing_alignment_mode?:BillingAlignmentMode;
905
+
906
+ /**
907
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or [coupon codes](https://apidocs.chargebee.com/docs/api/coupon_codes).
908
+
909
+ */
910
+
125
911
  coupon_ids?:string[];
912
+
913
+ /**
914
+ * @description If &#x60;true&#x60; then the existing &#x60;coupon_ids&#x60; list for the subscription is replaced by the one provided. If &#x60;false&#x60; then the provided list gets added to the existing &#x60;coupon_ids&#x60;.
915
+
916
+ */
917
+
126
918
  replace_coupon_list?:boolean;
919
+
920
+ /**
921
+ * @description * When &#x60;true&#x60;: [Prorated credits or charges](https://www.chargebee.com/docs/2.0/proration.html#proration-mechanism) are created as applicable for this change.
922
+ * When &#x60;false&#x60;: The subscription is changed without creating any credits or charges.
923
+ * When not provided, the value configured in the [site settings](https://www.chargebee.com/docs/2.0/proration.html#proration-for-subscription-change) is considered.
924
+
925
+ **Caveat**
926
+
927
+ For further changes within the same billing term, when &#x60;prorate&#x60; is set to &#x60;true&#x60;, **credits** are **not created** when **all** the conditions below hold true:
928
+
929
+ An immediate previous change was made
930
+
931
+ * with &#x60;prorate&#x60; set to &#x60;false&#x60; and
932
+ * no changes were made to the subscription&#x27;s billing term and
933
+ * a change was made to either the subscription&#x27;s items or their prices.
934
+
935
+ */
936
+
127
937
  prorate?:boolean;
938
+
939
+ /**
940
+ * @description Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
941
+
942
+ */
943
+
128
944
  end_of_term?:boolean;
945
+
946
+ /**
947
+ * @description Say the subscription has the renewal date as 28th of every month. When the plan-item price of the subscription is set to one that has the same billing period as the current plan-item price, the subscription change does not change the term. In other words, the subscription still renews on the 28th. Passing this parameter as &#x60;true&#x60; will have the subscription reset its term to the current date (provided &#x60;end_of_term&#x60; is false).
948
+ **Note**: When the new plan-item price has a billing period different from the current plan-item price of the subscription, the term is always reset, regardless of the value passed for this parameter.
949
+
950
+ */
951
+
129
952
  force_term_reset?:boolean;
953
+
954
+ /**
955
+ * @description Applicable only for &#x60;cancelled&#x60; subscriptions. When passed as &#x60;true&#x60;, the canceled subscription is activated; otherwise subscription changes are made without changing its &#x60;status&#x60;. If not passed, subscription will be activated only if &#x60;subscription_items&#x60; is passed.
956
+
957
+ */
958
+
130
959
  reactivate?:boolean;
960
+
961
+ /**
962
+ * @description If true, all the unbilled charges will be included for the invoice estimate.
963
+
964
+ */
965
+
131
966
  include_delayed_charges?:boolean;
967
+
968
+ /**
969
+ * @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*.
970
+
971
+ */
972
+
132
973
  use_existing_balances?:boolean;
974
+
975
+ /**
976
+ * @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).
977
+ **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. .
978
+
979
+ */
980
+
133
981
  invoice_immediately?:boolean;
982
+
983
+ /**
984
+ * @description Parameters for subscription
985
+
986
+ */
987
+
134
988
  subscription?:{auto_collection?:AutoCollection,free_period?:number,free_period_unit?:FreePeriodUnit,id:string,offline_payment_method?:OfflinePaymentMethod,start_date?:number,trial_end?:number,trial_end_action?:TrialEndAction};
989
+
990
+ /**
991
+ * @description Parameters for billing_address
992
+
993
+ */
994
+
135
995
  billing_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
996
+
997
+ /**
998
+ * @description Parameters for shipping_address
999
+
1000
+ */
1001
+
136
1002
  shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
1003
+
1004
+ /**
1005
+ * @description Parameters for customer
1006
+
1007
+ */
1008
+
137
1009
  customer?:{registered_for_gst?:boolean,vat_number?:string,vat_number_prefix?:string};
1010
+
1011
+ /**
1012
+ * @description Parameters for subscription_items
1013
+
1014
+ */
1015
+
138
1016
  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}[];
1017
+
1018
+ /**
1019
+ * @description Parameters for discounts
1020
+
1021
+ */
1022
+
139
1023
  discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,id?:string,included_in_mrr?:boolean,item_price_id?:string,operation_type:OperationType,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
1024
+
1025
+ /**
1026
+ * @description Parameters for item_tiers
1027
+
1028
+ */
1029
+
140
1030
  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}[];
141
1031
  }
142
- export interface UpcomingInvoicesEstimateResponse {
143
- estimate:Estimate;
1032
+ export interface UpcomingInvoicesEstimateResponse {
1033
+ /**
1034
+ * @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).
1035
+
1036
+ In the response:
1037
+
1038
+ * **estimate.invoice_estimates\[\]** has details of the invoices scheduled to be generated.
1039
+
1040
+ **Note:** If *consolidated invoicing* is enabled you may use this API to test whether upcoming renewals are consolidated.
1041
+
1042
+ */
1043
+
1044
+ estimate:Estimate;
144
1045
  }
145
1046
 
146
- export interface RegenerateInvoiceEstimateResponse {
147
- estimate:Estimate;
1047
+ export interface RegenerateInvoiceEstimateResponse {
1048
+ /**
1049
+ * @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:
1050
+
1051
+ * An invoice exists for the current term and its &#x60;status&#x60; is not &#x60;voided&#x60;.
1052
+ * There are [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html) for the current term.
1053
+ * The subscription has an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html).
1054
+
1055
+
1056
+
1057
+ #### Response
1058
+
1059
+ Returns an &#x60;estimate&#x60; object with one of the following components depending on the value of &#x60;invoice_immediately&#x60;.
1060
+
1061
+ * If the value is &#x60;true&#x60;: an &#x60;invoice_estimate&#x60; object that corresponds to the regenerated invoice.
1062
+ * If the value is &#x60;false&#x60;: a list of &#x60;unbilled_charge_estimate&#x60; objects corresponding to all the unbilled charges created for the current term of the subscription.
1063
+
1064
+
1065
+
1066
+
1067
+ */
1068
+
1069
+ estimate:Estimate;
148
1070
  }
149
1071
  export interface RegenerateInvoiceEstimateInputParam {
1072
+
1073
+ /**
1074
+ * @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 ).
1075
+
1076
+ */
1077
+
150
1078
  date_from?:number;
1079
+
1080
+ /**
1081
+ * @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 ).
1082
+
1083
+ */
1084
+
151
1085
  date_to?:number;
1086
+
1087
+ /**
1088
+ * @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;.
1089
+
1090
+ */
1091
+
152
1092
  prorate?:boolean;
1093
+
1094
+ /**
1095
+ * @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.
1096
+
1097
+ */
1098
+
153
1099
  invoice_immediately?:boolean;
154
1100
  }
155
- export interface CreateSubItemForCustomerEstimateResponse {
156
- estimate:Estimate;
1101
+ export interface CreateSubItemForCustomerEstimateResponse {
1102
+ /**
1103
+ * @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.
1104
+ **See also**
1105
+
1106
+ * [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.
1107
+
1108
+ */
1109
+
1110
+ estimate:Estimate;
157
1111
  }
158
1112
  export interface CreateSubItemForCustomerEstimateInputParam {
1113
+
1114
+ /**
1115
+ * @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*.
1116
+
1117
+ */
1118
+
159
1119
  use_existing_balances?:boolean;
1120
+
1121
+ /**
1122
+ * @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).
1123
+ **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. .
1124
+
1125
+ */
1126
+
160
1127
  invoice_immediately?:boolean;
1128
+
1129
+ /**
1130
+ * @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.
1131
+
1132
+ */
1133
+
161
1134
  billing_cycles?:number;
1135
+
1136
+ /**
1137
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
1138
+
1139
+ */
1140
+
162
1141
  mandatory_items_to_remove?:string[];
1142
+
1143
+ /**
1144
+ * @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
1145
+
1146
+ */
1147
+
163
1148
  terms_to_charge?:number;
1149
+
1150
+ /**
1151
+ * @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..
1152
+
1153
+ */
1154
+
164
1155
  billing_alignment_mode?:BillingAlignmentMode;
1156
+
1157
+ /**
1158
+ * @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.
1159
+
1160
+ */
1161
+
165
1162
  invoice_date?:number;
1163
+
1164
+ /**
1165
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
1166
+
1167
+ */
1168
+
166
1169
  coupon_ids?:string[];
1170
+
1171
+ /**
1172
+ * @description Parameters for subscription
1173
+
1174
+ */
1175
+
167
1176
  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};
1177
+
1178
+ /**
1179
+ * @description Parameters for shipping_address
1180
+
1181
+ */
1182
+
168
1183
  shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
1184
+
1185
+ /**
1186
+ * @description Parameters for contract_term
1187
+
1188
+ */
1189
+
169
1190
  contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1191
+
1192
+ /**
1193
+ * @description Parameters for subscription_items
1194
+
1195
+ */
1196
+
170
1197
  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}[];
1198
+
1199
+ /**
1200
+ * @description Parameters for discounts
1201
+
1202
+ */
1203
+
171
1204
  discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
1205
+
1206
+ /**
1207
+ * @description Parameters for item_tiers
1208
+
1209
+ */
1210
+
172
1211
  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}[];
173
1212
  }
174
- export interface ChangeTermEndResponse {
175
- estimate:Estimate;
1213
+ export interface ChangeTermEndResponse {
1214
+ /**
1215
+ * @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.
1216
+
1217
+ In the response,
1218
+
1219
+ * **estimate.subscription_estimate** has the subscription details like the status of the subscription (in_trial, active, etc.), next billing date, and so on.
1220
+ * **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 when
1221
+ * *prorate* parameter is false, or
1222
+ * *invoice_immediately* parameter is false, or
1223
+ * subscription is in *in-trial* state
1224
+ * **estimate.credit_note_estimates\[\]** has details of the credit-notes that will get generated during this operation. This list will be empty if no credit-note gets generated during this operation.
1225
+ * **estimate.unbilled_charge_estimates\[\]** has details of the unbilled charges. This is returned only if *invoice_immediately* is set as false.
1226
+
1227
+ */
1228
+
1229
+ estimate:Estimate;
176
1230
  }
177
1231
  export interface ChangeTermEndInputParam {
1232
+
1233
+ /**
1234
+ * @description The time at which the current term should end for this subscription.
1235
+
1236
+ */
1237
+
178
1238
  term_ends_at:number;
1239
+
1240
+ /**
1241
+ * @description Applicable for *active* / *non_renewing* subscriptions. If specified as *true* prorated charges / credits will be added during this operation.
1242
+
1243
+ */
1244
+
179
1245
  prorate?:boolean;
1246
+
1247
+ /**
1248
+ * @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).
1249
+ **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. .
1250
+
1251
+ */
1252
+
180
1253
  invoice_immediately?:boolean;
181
1254
  }
182
- export interface PauseSubscriptionResponse {
183
- estimate:Estimate;
1255
+ export interface PauseSubscriptionResponse {
1256
+ /**
1257
+ * @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.
1258
+
1259
+ In the response,
1260
+
1261
+ * **estimate.subscription_estimate** has the subscription details.
1262
+ * **estimate.invoice_estimate** has details of the invoice that are generated immediately. This is not present if no immediate invoices are generated for this operation.
1263
+ * **estimate.credit_note_estimates\[\]** has details of the credit notes that are generated during this operation. This list is empty if no credit notes are generated.
1264
+
1265
+ */
1266
+
1267
+ estimate:Estimate;
184
1268
  }
185
1269
  export interface PauseSubscriptionInputParam {
1270
+
1271
+ /**
1272
+ * @description List of options to pause the subscription. \* billing_cycles -
1273
+
1274
+ Pause at the end of the current term, and resume automatically after the number of billing cycles you specify in [skip_billing_cycles](/docs/api/estimates?prod_cat_ver&#x3D;2#pause_subscription_estimate_subscription_skip_billing_cycles)
1275
+ \* immediately - Pause immediately
1276
+ \* end_of_term - Pause at the end of current term
1277
+ \* specific_date - Pause on a specific date
1278
+
1279
+ */
1280
+
186
1281
  pause_option?:PauseOption;
1282
+
1283
+ /**
1284
+ * @description Applicable when unbilled charges are present for the subscription and [pause_option](/docs/api/estimates#pause_subscription_estimate_pause_option) is set as &#x60;immediately&#x60;. **Note:** On the invoice raised, an automatic charge is attempted on the payment method available, if customer&#x27;s auto-collection property is set to &#x60;on&#x60;.
1285
+ \* invoice -
1286
+
1287
+ Invoice charges
1288
+
1289
+ If &#x60;invoice&#x60; is chosen, an automatic charge is attempted on the payment method available if the customer has enabled auto-collection. If a payment collection fails or when auto-collection is not enabled, the invoice is closed as unpaid.
1290
+ \* no_action -
1291
+
1292
+ Retain as unbilled
1293
+
1294
+ If &#x60;no_action&#x60; is chosen, charges are added to the resumption invoice.
1295
+
1296
+ */
1297
+
187
1298
  unbilled_charges_handling?:UnbilledChargesHandling;
1299
+
1300
+ /**
1301
+ * @description Parameters for subscription
1302
+
1303
+ */
1304
+
188
1305
  subscription?:{pause_date?:number,resume_date?:number,skip_billing_cycles?:number};
189
1306
  }
190
- export interface AdvanceInvoiceEstimateResponse {
191
- estimate:Estimate;
1307
+ export interface AdvanceInvoiceEstimateResponse {
1308
+ /**
1309
+ * @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.
1310
+
1311
+ */
1312
+
1313
+ estimate:Estimate;
192
1314
  }
193
1315
  export interface AdvanceInvoiceEstimateInputParam {
1316
+
1317
+ /**
1318
+ * @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;.
1319
+ * 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.
1320
+ .
1321
+
1322
+ */
1323
+
194
1324
  terms_to_charge?:number;
1325
+
1326
+ /**
1327
+ * @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;.
1328
+
1329
+ */
1330
+
195
1331
  invoice_immediately?:boolean;
1332
+
1333
+ /**
1334
+ * @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).
1335
+
1336
+ */
1337
+
196
1338
  schedule_type?:ScheduleType;
1339
+
1340
+ /**
1341
+ * @description Parameters for fixed_interval_schedule
1342
+
1343
+ */
1344
+
197
1345
  fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
1346
+
1347
+ /**
1348
+ * @description Parameters for specific_dates_schedule
1349
+
1350
+ */
1351
+
198
1352
  specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
199
1353
  }
200
1354