chargebee 2.26.0 → 2.27.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 (65) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/chargebee.js +1 -1
  3. package/lib/resources/api_endpoints.js +8 -1
  4. package/package.json +1 -1
  5. package/types/core.d.ts +1 -0
  6. package/types/resources/Address.d.ts +235 -5
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  8. package/types/resources/AttachedItem.d.ts +285 -13
  9. package/types/resources/Card.d.ts +375 -13
  10. package/types/resources/Comment.d.ts +160 -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 +628 -20
  14. package/types/resources/CouponCode.d.ts +46 -5
  15. package/types/resources/CouponSet.d.ts +194 -17
  16. package/types/resources/CreditNote.d.ts +1100 -44
  17. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  18. package/types/resources/Customer.d.ts +1819 -73
  19. package/types/resources/DifferentialPrice.d.ts +246 -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 +1021 -27
  24. package/types/resources/Event.d.ts +138 -8
  25. package/types/resources/Export.d.ts +622 -32
  26. package/types/resources/Feature.d.ts +287 -22
  27. package/types/resources/Gift.d.ts +296 -24
  28. package/types/resources/Hierarchy.d.ts +30 -0
  29. package/types/resources/HostedPage.d.ts +1046 -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 +369 -9
  33. package/types/resources/Invoice.d.ts +1942 -92
  34. package/types/resources/InvoiceEstimate.d.ts +75 -6
  35. package/types/resources/Item.d.ts +522 -16
  36. package/types/resources/ItemEntitlement.d.ts +162 -13
  37. package/types/resources/ItemFamily.d.ts +153 -15
  38. package/types/resources/ItemPrice.d.ts +951 -26
  39. package/types/resources/Media.d.ts +24 -0
  40. package/types/resources/NonSubscription.d.ts +46 -3
  41. package/types/resources/Order.d.ts +1172 -32
  42. package/types/resources/PaymentIntent.d.ts +293 -8
  43. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  44. package/types/resources/PaymentSource.d.ts +984 -55
  45. package/types/resources/PaymentVoucher.d.ts +252 -14
  46. package/types/resources/PortalSession.d.ts +154 -10
  47. package/types/resources/PromotionalCredit.d.ts +300 -16
  48. package/types/resources/Purchase.d.ts +206 -5
  49. package/types/resources/Quote.d.ts +1430 -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 +68 -3
  54. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  55. package/types/resources/Subscription.d.ts +2564 -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 +82 -7
  61. package/types/resources/Token.d.ts +164 -7
  62. package/types/resources/Transaction.d.ts +567 -25
  63. package/types/resources/UnbilledCharge.d.ts +309 -14
  64. package/types/resources/Usage.d.ts +237 -13
  65. package/types/resources/VirtualBankAccount.d.ts +220 -17
@@ -2,603 +2,3030 @@
2
2
  declare module 'chargebee' {
3
3
  export interface Subscription {
4
4
  [key : string] : any;
5
+ /**
6
+ * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
7
+
8
+ */
9
+
5
10
  id:string;
11
+
12
+ /**
13
+ * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the subscription
14
+
15
+ */
16
+
6
17
  currency_code:string;
18
+
19
+ /**
20
+ * @description Applicable only for 'future' subscriptions. The scheduled start time of the subscription.
21
+
22
+ */
23
+
7
24
  start_date?:number;
25
+
26
+ /**
27
+ * @description End of the trial period for the subscription. Presence of this value for 'future' subscription implies the subscription will go into 'in_trial' state when it starts.
28
+
29
+ */
30
+
8
31
  trial_end?:number;
32
+
33
+ /**
34
+ * @description * When the subscription is not on a contract term: this value is the number of billing cycles remaining after the current cycle, at the end of which, the subscription cancels.
35
+ * When the subscription is on a [contract term](contract_terms): this value is the number of billing cycles remaining in the contract term after the current billing cycle.
36
+
37
+ */
38
+
9
39
  remaining_billing_cycles?:number;
40
+
41
+ /**
42
+ * @description Purchase order number for this subscription.
43
+
44
+ */
45
+
10
46
  po_number?:string;
47
+
48
+ /**
49
+ * @description The decimal representation of the quantity of the plan purchased. Returned for quantity-based plans when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
50
+
51
+ */
52
+
11
53
  plan_quantity_in_decimal?:string;
54
+
55
+ /**
56
+ * @description The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
57
+
58
+ */
59
+
12
60
  plan_unit_price_in_decimal?:string;
61
+
62
+ /**
63
+ * @description Identifier of the customer with whom this subscription is associated.
64
+
65
+ */
66
+
13
67
  customer_id:string;
68
+
69
+ /**
70
+ * @description Current state of the subscription \* future - The subscription is scheduled to start at a future date. \* non_renewing - The subscription will be canceled at the end of the current term. \* active - The subscription is active and will be charged for automatically based on the items in it. \* cancelled - The subscription has been canceled and is no longer in service. \* in_trial - The subscription is in trial. \* paused - The subscription is [paused](https://www.chargebee.com/docs/2.0/pause-subscription.html). The subscription will not renew while in this state.
71
+
72
+ */
73
+
14
74
  status:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing';
75
+
76
+ /**
77
+ * @description Start of the trial period for the subscription. Presence of this value for `future` subscription implies the subscription will go into `in_trial` state when it starts.
78
+
79
+ */
80
+
15
81
  trial_start?:number;
82
+
83
+ /**
84
+ * @description Applicable only when [End-of-trial Action](https://www.chargebee.com/docs/2.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) has been enabled for the site. Whenever the subscription has a trial period, this attribute (parameter) is returned (required) and specifies the operation to be carried out for the subscription once the trial ends. \* activate_subscription - The subscription activates and charges are raised for non-metered items. \* cancel_subscription - The subscription cancels. \* plan_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when `trial_end_action` is defined for the plan. \* site_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when `trial_end_action` is **not** defined for the plan.
85
+
86
+ */
87
+
16
88
  trial_end_action?:TrialEndAction;
89
+
90
+ /**
91
+ * @description Start of the current billing period of the subscription.
92
+
93
+ */
94
+
17
95
  current_term_start?:number;
96
+
97
+ /**
98
+ * @description End of the current billing period of the subscription. Subscription is renewed immediately after this
99
+
100
+ */
101
+
18
102
  current_term_end?:number;
103
+
104
+ /**
105
+ * @description The date/time at which the next billing for the subscription happens. This is usually right after `current_term_end` unless multiple subscription terms were invoiced in advance using the `terms_to_charge` parameter.
106
+
107
+ */
108
+
19
109
  next_billing_at?:number;
110
+
111
+ /**
112
+ * @description The time at which the subscription was created.
113
+
114
+ */
115
+
20
116
  created_at?:number;
117
+
118
+ /**
119
+ * @description Time at which the subscription was started. Is `null` for `future`subscriptions as it is yet to be started.
120
+
121
+ */
122
+
21
123
  started_at?:number;
124
+
125
+ /**
126
+ * @description Time at which the subscription `status` last changed to `active`. For example, this value is updated when an `in_trial` or `cancelled` subscription activates.
127
+
128
+ */
129
+
22
130
  activated_at?:number;
131
+
132
+ /**
133
+ * @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as `billing_cycles` or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
134
+
135
+ */
136
+
23
137
  contract_term_billing_cycle_on_renewal?:number;
138
+
139
+ /**
140
+ * @description If `true`, ignores the [hierarchy relationship](./customers?prod_cat_ver=2#customer_relationship) and uses customer as payment and invoice owner.
141
+
142
+ */
143
+
24
144
  override_relationship?:boolean;
145
+
146
+ /**
147
+ * @description When a pause has been scheduled, it is the date/time of scheduled pause. When the subscription is in the `paused` state, it is the date/time when the subscription was paused.
148
+
149
+ */
150
+
25
151
  pause_date?:number;
152
+
153
+ /**
154
+ * @description For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.
155
+
156
+ */
157
+
26
158
  resume_date?:number;
159
+
160
+ /**
161
+ * @description Time at which subscription was cancelled or is set to be cancelled.
162
+
163
+ */
164
+
27
165
  cancelled_at?:number;
166
+
167
+ /**
168
+ * @description The reason for canceling the subscription. Set by Chargebee automatically. \* no_card - No Card \* non_compliant_customer - Non Compliant Customer \* currency_incompatible_with_gateway - Currency incompatible with Gateway \* fraud_review_failed - Fraud Review Failed \* tax_calculation_failed - Tax Calculation Failed \* not_paid - Not Paid \* non_compliant_eu_customer - Non Compliant EU Customer
169
+
170
+ */
171
+
28
172
  cancel_reason?:'tax_calculation_failed' | 'fraud_review_failed' | 'currency_incompatible_with_gateway' | 'non_compliant_eu_customer' | 'non_compliant_customer' | 'not_paid' | 'no_card';
173
+
174
+ /**
175
+ * @description The IP address of the user. Used primarly in Refersion integration. Refersion uses this field to track/log affiliate subscription.
176
+
177
+ */
178
+
29
179
  created_from_ip?:string;
180
+
181
+ /**
182
+ * @description Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
183
+
184
+ */
185
+
30
186
  resource_version?:number;
187
+
188
+ /**
189
+ * @description Timestamp indicating when the item was last updated.
190
+
191
+ */
192
+
31
193
  updated_at?:number;
194
+
195
+ /**
196
+ * @description The subscription has an [advance invoicing schedule](advance_invoice_schedules).
197
+
198
+ */
199
+
32
200
  has_scheduled_advance_invoices:boolean;
201
+
202
+ /**
203
+ * @description If `true`, there are subscription changes scheduled on next renewal.
204
+
205
+ */
206
+
33
207
  has_scheduled_changes:boolean;
208
+
209
+ /**
210
+ * @description Payment source attached to this subscription. If present, customer's payment sources won't be used to collect any payment for this subscripiton.
211
+
212
+ */
213
+
34
214
  payment_source_id?:string;
215
+
216
+ /**
217
+ * @description The free_quantity_in_decimal as set for the plan. Returned for quantity-based plans when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
218
+
219
+ */
220
+
35
221
  plan_free_quantity_in_decimal?:string;
222
+
223
+ /**
224
+ * @description The decimal representation of the total amount for the plan, in major units of the currency. Always returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
225
+
226
+ */
227
+
36
228
  plan_amount_in_decimal?:string;
229
+
230
+ /**
231
+ * @description This is the date/time at which the most recent cancellation schedule for the subscription was created in Chargebee. Applicable only for `cancelled` subscriptions or subscriptions that are scheduled for cancellation.
232
+
233
+ */
234
+
37
235
  cancel_schedule_created_at?:number;
236
+
237
+ /**
238
+ * @description The subscription channel this object originated from and is maintained in. \* play_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed. \* web - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI. \* app_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.
239
+
240
+ */
241
+
38
242
  channel?:Channel;
243
+
244
+ /**
245
+ * @description The [Net D](https://www.chargebee.com/docs/net_d.html) value explicitly set for this subscription. Net D is the number of days within which any invoice raised for the subscription must be paid. When an invoice is raised, and this value is unavailable, the net_term_days defined at [the customer level](customers#customer_net_term_days) is considered.
246
+
247
+ */
248
+
39
249
  net_term_days?:number;
250
+
251
+ /**
252
+ * @description Total number of invoices that are due for payment against the subscription.
253
+ **Note:** Not supported if [consolidated invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html) is enabled, or when the subscription is for the customer who is in [hierarchy](./hierarchies), and the parent of this customer owns and pays for the invoices of the subscription. It is also worth noting that the consolidated invoice amount is not included in the calculation of `due_invoices_count`.
254
+
255
+ */
256
+
40
257
  due_invoices_count?:number;
258
+
259
+ /**
260
+ * @description Time since this subscription has unpaid invoices.
261
+ **Note:** Not supported if [consolidated invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html) is enabled, or when the subscription is for the customer who is in [hierarchy](./hierarchies), and the parent of this customer owns and pays for the invoices of the subscription.
262
+
263
+ */
264
+
41
265
  due_since?:number;
266
+
267
+ /**
268
+ * @description Total invoice due amount for this subscription. The value depends on the [type of currency](./#handling_currency_units).
269
+ **Note:** Not supported if [consolidated invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html) is enabled, or when the subscription is for the customer who is in [hierarchy](./hierarchies), and the parent of this customer owns and pays for the invoices of the subscription. It is also worth noting that the consolidated invoice amount is not included in the calculation of `total_dues`.
270
+
271
+ */
272
+
42
273
  total_dues?:number;
274
+
275
+ /**
276
+ * @description Monthly recurring revenue for the subscription. Updated asynchronously, this value catches up with changes to the subscription in less than a minute. The value depends on the [type of currency](./#handling_currency_units).
277
+ **Note:** This may not return accurate values since updated asynchronously.
278
+
279
+ */
280
+
43
281
  mrr?:number;
282
+
283
+ /**
284
+ * @description Exchange rate used for base currency conversion.This value is updated to the [rate configured](https://www.chargebee.com/docs/multi-currency-pricing.html#configuring-multicurrency) on your site each time any change is made to the subscription.
285
+
286
+ */
287
+
44
288
  exchange_rate?:number;
289
+
290
+ /**
291
+ * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the site's base currency.
292
+
293
+ */
294
+
45
295
  base_currency_code?:string;
296
+
297
+ /**
298
+ * @description A customer-facing note added to all invoices associated with this subscription. This note is one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
299
+
300
+ */
301
+
46
302
  invoice_notes?:string;
303
+
304
+ /**
305
+ * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./advanced-features#meta_data).
306
+
307
+ */
308
+
47
309
  metadata?:object;
310
+
311
+ /**
312
+ * @description Indicates that the subscription has been deleted. You can retrieve a deleted subscription using the [list operation](./subscriptions#list_subscriptions).
313
+
314
+ */
315
+
48
316
  deleted:boolean;
317
+
318
+ /**
319
+ * @description If a subscription change has been scheduled, this is the date/time when the change is set to take effect. **Note:** As a limitation, this attribute is not returned when the change is scheduled to happen at the end of the current term.
320
+
321
+ */
322
+
49
323
  changes_scheduled_at?:number;
324
+
325
+ /**
326
+ * @description Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Subscriptions \> Subscription Cancellation**. Must be passed if set as mandatory in the app. The codes are case-sensitive
327
+
328
+ */
329
+
50
330
  cancel_reason_code?:string;
331
+
332
+ /**
333
+ * @description The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit."
334
+
335
+ */
336
+
51
337
  free_period?:number;
338
+
339
+ /**
340
+ * @description Defines additional free period in association with the billing period. \* week - Charge based on week(s) \* month - Charge based on month(s) \* day - Charge based on day(s) \* year - Charge based on year(s)
341
+
342
+ */
343
+
52
344
  free_period_unit?:FreePeriodUnit;
345
+
346
+ /**
347
+ * @description Indicates whether the invoices for this subscription are generated with a `pending` `status`. This attribute is set to `true` automatically when the subscription has item prices that belong to `metered` items.
348
+
349
+ You can also set this to `true` explicitly using the [create](/docs/api/subscriptions#create_subscription_for_items_create_pending_invoices)/[update](/docs/api/subscriptions#update_subscription_for_items_create_pending_invoices) subscription operations. This is useful in the following scenarios:
350
+
351
+ * When tracking usages and calculating usage-based charges on your end. You can then add them to the subscription as a [one-time charge](https://www.chargebee.com/docs/charges.html) at the end of the billing term.
352
+ * When you need to inspect all charges before closing invoices for this subscription.
353
+
354
+ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_billing.html) is enabled for the site
355
+
356
+ */
357
+
53
358
  create_pending_invoices?:boolean;
359
+
360
+ /**
361
+ * @description Set to `false` to override for this subscription, the [site-level setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the [customer level](/docs/api/customers?prod_cat_ver=2#customer_auto_close_invoices).
362
+
363
+ */
364
+
54
365
  auto_close_invoices?:boolean;
366
+
367
+ /**
368
+ * @description The unique ID of the [business entity](/docs/api/advanced-features/?prod_cat_ver=2#mbe) of this subscription. This is always the same as the [business entity](/docs/api/subscriptions?prod_cat_ver=2#subscription_customer_id) of the customer.
369
+
370
+ */
371
+
55
372
  business_entity_id?:string;
373
+
374
+ /**
375
+ * @description Details of individual [item prices](/docs/api/item_prices?prod_cat_ver=2) that are part of this subscription.
376
+
377
+ */
378
+
56
379
  subscription_items?:Subscription.SubscriptionItem[];
380
+
381
+ /**
382
+ * @description The pricing details of `subscription_items` which have [pricing_model](/docs/api/item_prices?prod_cat_ver=2#item_price_pricing_model) as `tiered`, `volume` or `stairstep`.
383
+
384
+ */
385
+
57
386
  item_tiers?:Subscription.ItemTier[];
387
+
388
+ /**
389
+ * @description List of event based charge items that have already been charged.
390
+
391
+ */
392
+
58
393
  charged_items?:Subscription.ChargedItem[];
394
+
395
+ /**
396
+ * @description List of coupons for this subscription
397
+
398
+ */
399
+
59
400
  coupons?:Subscription.Coupon[];
401
+
402
+ /**
403
+ * @description Shipping address for the subscription.
404
+
405
+ */
406
+
60
407
  shipping_address?:Subscription.ShippingAddress;
408
+
409
+ /**
410
+ * @description Referral details if exists for the subscription
411
+
412
+ */
413
+
61
414
  referral_info?:Subscription.ReferralInfo;
415
+
416
+ /**
417
+ * @description Contract terms for this subscription
418
+
419
+ */
420
+
62
421
  contract_term?:Subscription.ContractTerm;
422
+
423
+ /**
424
+ * @description List of discounts for this subscription
425
+
426
+ */
427
+
63
428
  discounts?:Subscription.Discount[];
64
429
  }
65
430
  export namespace Subscription {
66
- export class SubscriptionResource {
431
+ export class SubscriptionResource {
432
+ /**
433
+ * @description Deletes an advance invoicing schedule. When *schedule_type = specific_dates*, you also have the option of deleting a part of the schedule.
434
+
435
+ */
436
+
67
437
  remove_advance_invoice_schedule(subscription_id:string, input?:RemoveAdvanceInvoiceScheduleInputParam):ChargebeeRequest<RemoveAdvanceInvoiceScheduleResponse>;
438
+
439
+ /**
440
+ * @description **Note:** This endpoint optionally supports 3DS. To use it, [create](./payment_intents?prod_cat_ver&#x3D;2#create_a_payment_intent) a &#x60;payment_intent&#x60; and provide it via this endpoint.
441
+
442
+ Updates the specified subscription by setting the parameters passed. Any parameters not provided are left unmodified. If an invoice is generated for this operation, any available [credits and excess payments](./customers?prod_cat_ver&#x3D;2#customer_balances) for the customer are automatically applied.
443
+
444
+ */
445
+
68
446
  update_for_items(subscription_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
447
+
448
+ /**
449
+ * @description Removes Coupons associated with the Subscription. If the param &#x27;coupon_ids&#x27; is not specified, all the Coupons linked to the Subscription will be removed.
450
+
451
+ */
452
+
69
453
  remove_coupons(subscription_id:string, input?:RemoveCouponsInputParam):ChargebeeRequest<RemoveCouponsResponse>;
454
+
455
+ /**
456
+ * @description **Note:** This operation optionally supports 3DS verification flow. To achieve the same, create the [Payment Intent](/docs/api/#3ds-implementation-guide) and pass it as input parameter to this API.
457
+
458
+ This API is used to resume a **paused** subscription. On resumption the subscription will be activated and any applicable charges will be initiated.
459
+
460
+ You could schedule the resumption by passing **specific_date** parameter in resume_option. If scheduled, the subscription will be resumed on the **specific_date** and moved to Active state.
461
+
462
+ For in-term resumption, unless there are scheduled changes, unbilled charges will not be charged.
463
+
464
+ **What is an &quot;in-term resumption&quot;?**
465
+ An &quot;in-term resumption&quot; is when the pause and resumption happens within the billing term of the subscription.
466
+
467
+ **Example :** A subscription was billed from 1st to 31st of a month. It was paused on the 20th and resumed before 31st. This is an in-term resumption.
468
+
469
+ #### UNPAID INVOICES
470
+
471
+ Specifying **unpaid_invoices** allows you to close invoices of the subscription which have amounts due. The invoices are chosen for payment collection after applying the available credits and excess payments.
472
+
473
+ If specified as **schedule_payment_collection**, payment collection for the amount due of past invoices will be attempted. The payment method available will be charged if auto-collection is enabled for the customer, and appropriate payment collection(payment succeeded or payment failed) events will be triggered. If the payment collection fails, no further retries will be made on the invoices.
474
+
475
+ **Note:** If the invoices of the subscription are consolidated, and any of the subscriptions in the consolidated invoice are cancelled, these invoices will not be selected for collection.
476
+
477
+ */
478
+
70
479
  resume(subscription_id:string, input?:ResumeInputParam):ChargebeeRequest<ResumeResponse>;
480
+
481
+ /**
482
+ * @description Cancels the subscription.
483
+
484
+ #### Canceling contract terms
485
+
486
+ * Subscriptions with contract terms can only be canceled by [terminating the contract term](/docs/api/subscriptions?prod_cat_ver&#x3D;2&amp;lang&#x3D;curl#cancel_subscription_for_items_contract_term_cancel_option).
487
+ * When canceling a contract term, the default value for the following parameters is taken from the [site settings for contract terms](https://www.chargebee.com/docs/2.0/contract-terms.html#configuring-contract-terms) instead of the [site settings for subscription cancellation](https://www.chargebee.com/docs/2.0/cancellations.html#configure-subscription-cancellation).
488
+ * &#x60;credit_option_for_current_term_charges&#x60;
489
+ * &#x60;unbilled_charges_option&#x60;
490
+ * &#x60;account_receivables_handling&#x60;
491
+ * &#x60;refundable_credits_handling&#x60;
492
+ * From among the parameters for this request, &#x60;end_of_term&#x60; or &#x60;cancel_at&#x60; should not be passed when using contract terms; use &#x60;contract_term_cancel_option&#x60; instead.
493
+ * The &#x60;subscription_items&#x60; parameter is used to override price or quantity for the termination fee. To use this parameter, the following two conditions must be met:
494
+ * &#x60;contract_term_cancel_option&#x60; must be set to &#x60;terminate_now&#x60;.
495
+ * the subscription must have a [subscription_items](/docs/api/subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items) attribute with &#x60;charge_on_event&#x60; set to &#x60;contract_term_termination&#x60;.
496
+
497
+ */
498
+
71
499
  cancel_for_items(subscription_id:string, input?:CancelForItemsInputParam):ChargebeeRequest<CancelForItemsResponse>;
500
+
501
+ /**
502
+ * @description Regenerates the current invoice for the subscription. The current invoice is that which includes non-&#x60;metered&#x60; items from the current term and &#x60;metered&#x60; items from the previous term of the subscription.
503
+
504
+ #### prerequisites
505
+
506
+ * The current invoice of the subscription must have been [voided](/docs/api/invoices?prod_cat_ver&#x3D;2#void_an_invoice) or [deleted](/docs/api/invoices?prod_cat_ver&#x3D;2#delete_an_invoice).
507
+ * The subscription &#x60;status&#x60; must be &#x60;active&#x60; or &#x60;non_renewing&#x60;.
508
+ * There should be no [unbilled charges](/docs/api/unbilled_charges?prod_cat_ver&#x3D;2) for non-&#x60;metered&#x60; items for the current term.
509
+ * There should be no [unbilled charges](/docs/api/unbilled_charges?prod_cat_ver&#x3D;2) for &#x60;metered&#x60; items for the previous term.
510
+ * The subscription must not have any [advance invoice](https://www.chargebee.com/docs/2.0/advance-invoices.html#generating-an-advance-invoice) or [advance invoice schedule](https://www.chargebee.com/docs/2.0/advance-invoices.html#generating-an-advance-invoice_setting-up-an-advance-invoicing-schedule).
511
+
512
+ #### deleting an invoice
513
+
514
+ Usages are also deleted when an invoice is deleted. Therefore, if the invoice was deleted, you may [add](/docs/api/usages?prod_cat_ver&#x3D;2#create_a_usage) or [bulk import](https://www.chargebee.com/docs/2.0/bulk-operations.html#overview_available-bulk-operations) usages before regenerating an invoice.
515
+
516
+ */
517
+
72
518
  regenerate_invoice(subscription_id:string, input?:RegenerateInvoiceInputParam):ChargebeeRequest<RegenerateInvoiceResponse>;
519
+
520
+ /**
521
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
522
+
523
+ */
524
+
73
525
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
526
+
527
+ /**
528
+ * @description Imports a subscription into Chargebee.
529
+
530
+ */
531
+
74
532
  import_for_items(customer_id:string, input:ImportForItemsInputParam):ChargebeeRequest<ImportForItemsResponse>;
533
+
534
+ /**
535
+ * @description Retrieves the *advance_invoice_schedule* for a subscription. Note that this endpoint is only applicable for *schedule_type &#x3D; specific_dates* or fixed_intervals.
536
+
537
+ */
538
+
75
539
  retrieve_advance_invoice_schedule(subscription_id:string):ChargebeeRequest<RetrieveAdvanceInvoiceScheduleResponse>;
540
+
541
+ /**
542
+ * @description **Note:** Cannot be called when the subscription is on a [contract term](contract_terms). (That is, when the &#x60;contract_term.status attribute&#x60; is &#x60;active&#x60;.)
543
+
544
+ If the subscription is in **Non Renewing** or **In Trial** state and is also scheduled to cancel at the end of current term, then this API can be used to remove the scheduled cancellation. When a scheduled cancellation is removed, the subscription will revert to **Active** or **In Trial** state, whichever is the state before cancellation was scheduled.
545
+
546
+ While removing the scheduled cancellation, you may specify the number of billing cycles. If the billing cycle is not specified, the default billing cycle from the plan will be applied on the subscription.
547
+
548
+ */
549
+
76
550
  remove_scheduled_cancellation(subscription_id:string, input?:RemoveScheduledCancellationInputParam):ChargebeeRequest<RemoveScheduledCancellationResponse>;
551
+
552
+ /**
553
+ * @description Retrieves a subscription with the scheduled changes applied.
554
+ **Note:** Only the following attributes are changed
555
+
556
+ * item_id
557
+ * item_price_id
558
+ * billing_period
559
+ * billing_period_unit
560
+ * remaining_billing_cycles
561
+ * coupons
562
+
563
+ Other attributes such as **status** ,**next_billing_at** are not changed and will reflect the current subscription values.
564
+
565
+
566
+
567
+
568
+ */
569
+
77
570
  retrieve_with_scheduled_changes(subscription_id:string):ChargebeeRequest<RetrieveWithScheduledChangesResponse>;
571
+
572
+ /**
573
+ * @description **Note:** This operation optionally supports 3DS verification flow. To achieve the same, create the [Payment Intent](/docs/api/#3ds-implementation-guide) and pass it as input parameter to this API.
574
+
575
+ This API is used to reactivate a **cancelled** subscription. You may also optionally specify a trial end date, to move the subscription to **In Trial** state. If trial end is not specified, the subscription will be activated and any applicable charges will be initiated.
576
+
577
+ Unless the billing cycle is specified, it will be set to plan&#x27;s default billing cycle.
578
+
579
+ During an in-term reactivation^++^, unless the billing cycle is specified, the subscription&#x27;s remaining billing cycles will be restored. If a trial end date is specified, then the plan&#x27;s default billing cycle is used.
580
+
581
+ **What is an &quot;in-term reactivation&quot;?**
582
+ An &quot;in-term reactivation&quot; happens when the billing term of the subscription is retained upon cancellation and reactivation is initiated within that term.
583
+
584
+ **When is the &#x27;billing term&#x27; retained for a cancelled subscription?**
585
+ When dunning (payment failure retry settings) is configured with the last retry configured as
586
+
587
+ * cancel subscription and mark invoice as &#x27;Not Paid&#x27;, or
588
+ * cancel subscription and mark the invoice as &#x27;Voided&#x27; and the case if any of the current term invoices is partially or fully paid, the invoice is not voided but instead Chargebee marks the invoices as &#x27;Not Paid&#x27;.
589
+
590
+
591
+
592
+ **Note :** In both cases, the billing term is retained and upon reactivation the subscription will be moved to active state (if the plan does not have a trial period) and no invoice will be generated. Ensure that you collect any unpaid invoices.
593
+
594
+ **Example :** A Subscription was billed from 1st to 31st of a month and it was cancelled on the 20th due to one of the above cases (billing term is not reset). If the reactivation happens on 25th then it is considered an in-term reactivation.
595
+
596
+ */
597
+
78
598
  reactivate(subscription_id:string, input?:ReactivateInputParam):ChargebeeRequest<ReactivateResponse>;
599
+
600
+ /**
601
+ * @description Creates an advance invoice or an [advance invoicing schedule](advance_invoice_schedules#advance_invoice_schedule). When an advance invoice is generated, and [&#x60;auto_collection&#x60;](subscriptions#subscription_auto_collection) is &#x60;on&#x60; for the subscription, the [&#x60;payment_source&#x60;](subscriptions#subscription_payment_source_id) associated with the subscription is charged. Any changes scheduled for the subscription are taken into account automatically while generating an advance invoice. Advance invoices are not generated for a subscription when it is in the [&#x60;paused&#x60;](subscriptions#subscription_status) status. Advance invoices are generated only for non-&#x60;metered&#x60; items in a subscription.
602
+
603
+ */
604
+
79
605
  charge_future_renewals(subscription_id:string, input?:ChargeFutureRenewalsInputParam):ChargebeeRequest<ChargeFutureRenewalsResponse>;
606
+
607
+ /**
608
+ * @description Adds a one time charge to the subscription which will be added to the invoice generated at the end of the current term. If there are any applicable coupons in the subscription, an appropriate discount will be applied.
609
+
610
+ To collect a charge immediately, [use this API](/docs/api/invoices#create_invoice_for_charge).
611
+
612
+ */
613
+
80
614
  add_charge_at_term_end(subscription_id:string, input:AddChargeAtTermEndInputParam):ChargebeeRequest<AddChargeAtTermEndResponse>;
615
+
616
+ /**
617
+ * @description Removes the subscription changes scheduled on next renewal. Advance charges, if any, will be refunded as credits and a new invoice will be generated on renewal.
618
+
619
+ */
620
+
81
621
  remove_scheduled_changes(subscription_id:string):ChargebeeRequest<RemoveScheduledChangesResponse>;
622
+
623
+ /**
624
+ * @description Changes the subscription&#x27;s current term end date. Depending on the &quot;status&quot; of the subscription, &quot;term end date&quot; has different effects.
625
+
626
+ * If the Subscription is in **trial**, it affects trial end date.
627
+ * If the Subscription is **active**, it affects the next billing date.
628
+ * If the Subscription&#x27;s status is **non_renewing**, this affects the upcoming cancellation date.
629
+
630
+ **Tip**: To cycle through a couple of billing cycles and test webhooks, you may use this API.
631
+
632
+ */
633
+
82
634
  change_term_end(subscription_id:string, input:ChangeTermEndInputParam):ChargebeeRequest<ChangeTermEndResponse>;
635
+
636
+ /**
637
+ * @description Deletes the subscription resource.
638
+
639
+ */
640
+
83
641
  delete(subscription_id:string):ChargebeeRequest<DeleteResponse>;
642
+
643
+ /**
644
+ * @description **Note:** This endpoint optionally supports 3DS. To use it [create](./payment_intents?prod_cat_ver&#x3D;2#create_a_payment_intent) a &#x60;payment_intent&#x60; and provide it via this endpoint.
645
+
646
+ Creates a new subscription for an existing customer in Chargebee. Any available [credits and excess payments](./customers?prod_cat_ver&#x3D;2#customer_balances) for the customer are automatically applied on the invoice.
647
+ **See also**
648
+
649
+ * [Create a purchase](https://apidocs.chargebee.com/docs/api/purchases#create_a_purchase): an operation that creates a purchase representing multiple subscriptions bought together by a customer.
650
+
651
+ */
652
+
84
653
  create_with_items(customer_id:string, input?:CreateWithItemsInputParam):ChargebeeRequest<CreateWithItemsResponse>;
654
+
655
+ /**
656
+ * @description Imports unbilled charges into Chargebee.
657
+
658
+ */
659
+
85
660
  import_unbilled_charges(subscription_id:string, input?:ImportUnbilledChargesInputParam):ChargebeeRequest<ImportUnbilledChargesResponse>;
661
+
662
+ /**
663
+ * @description If the subscription is in **Paused** state and is scheduled to resume on a specific_date, this API can be used to remove the scheduled resumption. When the scheduled resumption is removed, the subscription will remain **Paused**.
664
+
665
+ */
666
+
86
667
  remove_scheduled_resumption(subscription_id:string):ChargebeeRequest<RemoveScheduledResumptionResponse>;
668
+
669
+ /**
670
+ * @description Retrieves a subscription.
671
+
672
+ */
673
+
87
674
  retrieve(subscription_id:string):ChargebeeRequest<RetrieveResponse>;
675
+
676
+ /**
677
+ * @description Import previous and active [contract terms](./contract_terms).
678
+
679
+ For contract terms in &#x60;active&#x60; state, import is allowed only if the associated subscription is &#x60;active&#x60;, &#x60;in_trial&#x60;, &#x60;future&#x60; or &#x60;non-renewing&#x60;.
680
+
681
+ */
682
+
88
683
  import_contract_term(subscription_id:string, input?:ImportContractTermInputParam):ChargebeeRequest<ImportContractTermResponse>;
684
+
685
+ /**
686
+ * @description Assigns the payment source and sets auto collection state for the subscription.
687
+
688
+ */
689
+
89
690
  override_billing_profile(subscription_id:string, input?:OverrideBillingProfileInputParam):ChargebeeRequest<OverrideBillingProfileResponse>;
691
+
692
+ /**
693
+ * @description If the subscription is in **Active** or **Non Renewing** state and is also scheduled to pause at the end_of_term/specific_date, this API can be used to remove the scheduled pause.
694
+
695
+ */
696
+
90
697
  remove_scheduled_pause(subscription_id:string):ChargebeeRequest<RemoveScheduledPauseResponse>;
698
+
699
+ /**
700
+ * @description Modifies the [advance invoicing schedule](advance_invoice_schedules#advance_invoice_schedule) for a subscription.
701
+
702
+ */
703
+
91
704
  edit_advance_invoice_schedule(subscription_id:string, input?:EditAdvanceInvoiceScheduleInputParam):ChargebeeRequest<EditAdvanceInvoiceScheduleResponse>;
705
+
706
+ /**
707
+ * @description Returns a list of discounts currently attached to the subscription given by &#x60;{subscription_id}&#x60;. The list is sorted by date of creation, in descending order.
708
+
709
+ */
710
+
92
711
  list_discounts(subscription_id:string, input?:ListDiscountsInputParam):ChargebeeRequest<ListDiscountsResponse>;
712
+
713
+ /**
714
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
715
+
716
+ */
717
+
93
718
  contract_terms_for_subscription(subscription_id:string, input?:ContractTermsForSubscriptionInputParam):ChargebeeRequest<ContractTermsForSubscriptionResponse>;
719
+
720
+ /**
721
+ * @description Pauses the subscription, changing its &#x60;status&#x60; to &#x60;paused&#x60;. This prevents the subscription from getting renewed. No new charges are created until the subscription is resumed.
722
+
723
+
724
+
725
+ #### Note:
726
+
727
+ * Applicable only for **active/non-renewing** subscriptions.
728
+ * If paused indefinitely, the subscription is cancelled on the [cancelled_at](/docs/api/subscriptions#subscription_cancelled_at) date.
729
+ * Advance charges, if any, are refunded as credits.
730
+
731
+ */
732
+
94
733
  pause(subscription_id:string, input?:PauseInputParam):ChargebeeRequest<PauseResponse>;
95
734
  }
96
- export interface RemoveAdvanceInvoiceScheduleResponse {
97
- subscription:Subscription;
98
- advance_invoice_schedules?:AdvanceInvoiceSchedule[];
735
+ export interface RemoveAdvanceInvoiceScheduleResponse {
736
+ subscription:Subscription;
737
+
738
+ advance_invoice_schedules?:AdvanceInvoiceSchedule[];
99
739
  }
100
740
  export interface RemoveAdvanceInvoiceScheduleInputParam {
741
+
742
+ /**
743
+ * @description Parameters for specific_dates_schedule
744
+
745
+ */
746
+
101
747
  specific_dates_schedule?:{id?:string}[];
102
748
  }
103
- export interface UpdateForItemsResponse {
104
- subscription:Subscription;
105
- customer:Customer;
106
- card?:Card;
107
- invoice?:Invoice;
108
- unbilled_charges?:UnbilledCharge[];
109
- credit_notes?:CreditNote[];
749
+ export interface UpdateForItemsResponse {
750
+ subscription:Subscription;
751
+
752
+ customer:Customer;
753
+
754
+ card?:Card;
755
+
756
+ invoice?:Invoice;
757
+
758
+ unbilled_charges?:UnbilledCharge[];
759
+
760
+ credit_notes?:CreditNote[];
110
761
  }
111
762
  export interface UpdateForItemsInputParam {
112
- [key : string] : any;
763
+ [key : string] : any;
764
+ /**
765
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
766
+
767
+ */
768
+
113
769
  mandatory_items_to_remove?:string[];
770
+
771
+ /**
772
+ * @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.
773
+
774
+ */
775
+
114
776
  replace_items_list?:boolean;
777
+
778
+ /**
779
+ * @description Updates [Net D](https://www.chargebee.com/docs/net_d.html) for the subscription. Net D is the number of days within which any invoice raised for the subscription must be paid.
780
+
781
+ * If the value is &#x60;0&#x60; or a positive integer: Net D is set explicitly for the subscription to the value provided. The value must be one of those defined in the [site configuration](https://www.chargebee.com/docs/net_d.html#enable-net-d-for-chargebee-invoices).
782
+ * If the value is &#x60;-1&#x60;: The attribute is reset and therefore not returned by the API. In this case, when an invoice is raised -- whether now or later -- the &#x60;net_term_days&#x60; defined at the [customer level](customers#customer_net_term_days) is considered.
783
+ * If the value is not provided: The attribute is left unaltered.
784
+ .
785
+
786
+ */
787
+
115
788
  net_term_days?:number;
789
+
790
+ /**
791
+ * @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:
792
+
793
+ * &#x60;invoice_date&#x60; must be in the past.
794
+ * &#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.
795
+ * It is not earlier than &#x60;changes_scheduled_at&#x60;, &#x60;reactivate_from&#x60;, or &#x60;trial_end&#x60;.
796
+ * &#x60;invoice_immediately&#x60; is &#x60;true&#x60;.
797
+ .
798
+
799
+ */
800
+
116
801
  invoice_date?:number;
802
+
803
+ /**
804
+ * @description The new start date of a &#x60;future&#x60; subscription. Applicable only for &#x60;future&#x60; subscriptions.
805
+
806
+ */
807
+
117
808
  start_date?:number;
809
+
810
+ /**
811
+ * @description The time at which the trial has ended or will end for the subscription. This is only allowed when the subscription &#x60;status&#x60; is &#x60;future&#x60;, &#x60;in_trial&#x60;, or &#x60;cancelled&#x60;. Also, the value must not be earlier than &#x60;changes_scheduled_at&#x60; or &#x60;start_date&#x60;. **Note** : This parameter can be backdated (set to a value in the past) only when the subscription is in &#x60;cancelled&#x60; or &#x60;in_trial&#x60; &#x60;status&#x60;. Do this to keep a record of when the trial ended in case it ended at some point in the past. When &#x60;trial_end&#x60; is backdated, the subscription immediately goes into &#x60;active&#x60; or &#x60;non_renewing&#x60; status.
812
+
813
+ */
814
+
118
815
  trial_end?:number;
816
+
817
+ /**
818
+ * @description Billing cycles set for plan-item price is used by default.
819
+
820
+ */
821
+
119
822
  billing_cycles?:number;
823
+
824
+ /**
825
+ * @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.
826
+
827
+ */
828
+
120
829
  terms_to_charge?:number;
830
+
831
+ /**
832
+ * @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.
833
+ **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:
834
+
835
+ * Backdating must be enabled for subscription reactivation operations.
836
+ * 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.
837
+ * The date is on or after the last date/time any of the product catalog items of the subscription were changed.
838
+ * 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.
839
+ .
840
+
841
+ */
842
+
121
843
  reactivate_from?:number;
844
+
845
+ /**
846
+ * @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.
847
+
848
+ */
849
+
122
850
  billing_alignment_mode?:BillingAlignmentMode;
851
+
852
+ /**
853
+ * @description Defines whether payments need to be collected automatically for this subscription. Overrides customer&#x27;s auto-collection property. \* on - Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available. \* off - Automatic collection of charges will not be made for this subscription. Use this for offline payments.
854
+
855
+ */
856
+
123
857
  auto_collection?:AutoCollection;
858
+
859
+ /**
860
+ * @description The preferred offline payment method for the subscription. \* sepa_credit - SEPA Credit \* cash - Cash \* no_preference - No Preference \* bank_transfer - Bank Transfer \* check - Check \* boleto - Boleto \* ach_credit - ACH Credit
861
+
862
+ */
863
+
124
864
  offline_payment_method?:OfflinePaymentMethod;
865
+
866
+ /**
867
+ * @description Purchase order number for this subscription.
868
+
869
+ */
870
+
125
871
  po_number?:string;
872
+
873
+ /**
874
+ * @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). If &#x60;changes_scheduled_at&#x60; is in the past, then the currently available coupons can be used even if they were not available as of the date for when the change is scheduled.
875
+
876
+ */
877
+
126
878
  coupon_ids?:string[];
879
+
880
+ /**
881
+ * @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;.
882
+
883
+ */
884
+
127
885
  replace_coupon_list?:boolean;
886
+
887
+ /**
888
+ * @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.
889
+ * When &#x60;false&#x60;: The subscription is changed without creating any credits or charges.
890
+ * 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.
891
+
892
+ **Caveat**
893
+
894
+ 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:
895
+
896
+ An immediate previous change was made
897
+
898
+ * with &#x60;prorate&#x60; set to &#x60;false&#x60; and
899
+ * no changes were made to the subscription&#x27;s billing term and
900
+ * a change was made to either the subscription&#x27;s items or their prices.
901
+
902
+ */
903
+
128
904
  prorate?:boolean;
905
+
906
+ /**
907
+ * @description Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
908
+
909
+ */
910
+
129
911
  end_of_term?:boolean;
912
+
913
+ /**
914
+ * @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).
915
+ **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.
916
+
917
+ */
918
+
130
919
  force_term_reset?:boolean;
920
+
921
+ /**
922
+ * @description When the &#x60;status&#x60; of the subscription is &#x60;cancelled&#x60;, this parameter determines whether the subscription is reactivated upon making this API request. Unless passed explicitly as &#x60;false&#x60;, this parameter is implied as &#x60;true&#x60; when you provide the &#x60;subscription_items&#x60; parameter.
923
+
924
+ */
925
+
131
926
  reactivate?:boolean;
927
+
928
+ /**
929
+ * @description The Chargebee payment token generated by Chargebee JS.
930
+
931
+ */
932
+
132
933
  token_id?:string;
934
+
935
+ /**
936
+ * @description A customer-facing note added to all invoices associated with this subscription. This note is one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
937
+
938
+ */
939
+
133
940
  invoice_notes?:string;
941
+
942
+ /**
943
+ * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./advanced-features#meta_data).
944
+
945
+ */
946
+
134
947
  meta_data?:object;
948
+
949
+ /**
950
+ * @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).
951
+ **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. .
952
+
953
+ */
954
+
135
955
  invoice_immediately?:boolean;
956
+
957
+ /**
958
+ * @description If &#x60;true&#x60;, ignores the [hierarchy relationship](./customers?prod_cat_ver&#x3D;2#customer_relationship) and uses customer as payment and invoice owner.
959
+
960
+ */
961
+
136
962
  override_relationship?:boolean;
963
+
964
+ /**
965
+ * @description When &#x60;change_option&#x60; is set to &#x60;specific_date&#x60;, then set the date/time at which the subscription change is to happen or has happened. **Note:** It is recommended not to pass this parameter along with &#x60;reactivate_from&#x60;. &#x60;changes_scheduled_at&#x60; can be set to a value in the past. This is called backdating the subscription change and is performed when the subscription change has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
966
+
967
+ * Backdating must be enabled for subscription change operations.
968
+ * Only the following changes can be backdated:
969
+ * Changes in the recurring items or their prices.
970
+ * Addition of non-recurring items.
971
+ * Subscription &#x60;status&#x60; is &#x60;active&#x60;, &#x60;cancelled&#x60;, or &#x60;non_renewing&#x60;.
972
+ * The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is typically the day of the month by which the accounting for the previous month must be closed.
973
+ * The date is on or after &#x60;current_term_start&#x60;.
974
+ * The date is on or after the last date/time any of the following changes were made:
975
+ * Changes in the recurring items or their prices.
976
+ * Addition of non-recurring items.
977
+ * 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.
978
+ .
979
+
980
+ */
981
+
137
982
  changes_scheduled_at?:number;
983
+
984
+ /**
985
+ * @description When the quote is converted, this attribute determines the date/time as of when the subscription change is to be carried out. \* end_of_term - The change is carried out at the end of the current billing cycle of the subscription. \* specific_date - The change is carried out as of the date specified under &#x60;changes_scheduled_at&#x60;. \* immediately - The change is carried out immediately.
986
+
987
+ */
988
+
138
989
  change_option?:ChangeOption;
990
+
991
+ /**
992
+ * @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as &#x60;billing_cycles&#x60; or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
993
+
994
+ */
995
+
139
996
  contract_term_billing_cycle_on_renewal?:number;
997
+
998
+ /**
999
+ * @description The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit.
1000
+
1001
+ */
1002
+
140
1003
  free_period?:number;
1004
+
1005
+ /**
1006
+ * @description The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the [period_unit](/docs/api/plans#create_a_plan_period_unit) attribute of the [plan](/docs/api/subscriptions#create_a_subscription_plan_id) chosen. \* week - Charge based on week(s) \* month - Charge based on month(s) \* day - Charge based on day(s) \* year - Charge based on year(s)
1007
+
1008
+ */
1009
+
141
1010
  free_period_unit?:FreePeriodUnit;
1011
+
1012
+ /**
1013
+ * @description Indicates whether the invoices for this subscription are generated with a &#x60;pending&#x60; &#x60;status&#x60;. This attribute is set to &#x60;true&#x60; automatically when the subscription has item prices that belong to &#x60;metered&#x60; items.
1014
+
1015
+ You can also set this to &#x60;true&#x60; explicitly using the [create](/docs/api/subscriptions#create_subscription_for_items_create_pending_invoices)/[update](/docs/api/subscriptions#update_subscription_for_items_create_pending_invoices) subscription operations. This is useful in the following scenarios:
1016
+
1017
+ * When tracking usages and calculating usage-based charges on your end. You can then add them to the subscription as a [one-time charge](https://www.chargebee.com/docs/charges.html) at the end of the billing term.
1018
+ * When you need to inspect all charges before closing invoices for this subscription.
1019
+
1020
+ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_billing.html) is enabled for the site
1021
+ .
1022
+
1023
+ */
1024
+
142
1025
  create_pending_invoices?:boolean;
1026
+
1027
+ /**
1028
+ * @description Set to &#x60;false&#x60; to override for this subscription, the [site-level setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the [customer level](/docs/api/customers?prod_cat_ver&#x3D;2#customer_auto_close_invoices).
1029
+
1030
+ */
1031
+
143
1032
  auto_close_invoices?:boolean;
1033
+
1034
+ /**
1035
+ * @description Applicable only when [End-of-trial Action](https://www.chargebee.com/docs/2.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) has been enabled for the site. Whenever the subscription has a trial period, this attribute (parameter) is returned (required) and specifies the operation to be carried out for the subscription once the trial ends. \* activate_subscription - The subscription activates and charges are raised for non-metered items. \* cancel_subscription - The subscription cancels. \* plan_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when &#x60;trial_end_action&#x60; is defined for the plan. \* site_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when &#x60;trial_end_action&#x60; is **not** defined for the plan.
1036
+
1037
+ */
1038
+
144
1039
  trial_end_action?:TrialEndAction;
145
- payment_initiator?:'merchant' | 'customer';
1040
+
1041
+ /**
1042
+ * @description The type of initiator to be used for the payment request triggered by this operation. \* customer - Pass this value to indicate that the request is initiated by the customer \* merchant - Pass this value to indicate that the request is initiated by the merchant
1043
+
1044
+ */
1045
+
1046
+ payment_initiator?:PaymentInitiator;
1047
+
1048
+ /**
1049
+ * @description Parameters for card
1050
+
1051
+ */
1052
+
146
1053
  card?:{additional_information?:object,billing_addr1?:string,billing_addr2?:string,billing_city?:string,billing_country?:string,billing_state?:string,billing_state_code?:string,billing_zip?:string,cvv?:string,expiry_month?:number,expiry_year?:number,first_name?:string,gateway_account_id?:string,last_name?:string,number?:string};
1054
+
1055
+ /**
1056
+ * @description Parameters for payment_method
1057
+
1058
+ */
1059
+
147
1060
  payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
1061
+
1062
+ /**
1063
+ * @description Parameters for payment_intent
1064
+
1065
+ */
1066
+
148
1067
  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};
1068
+
1069
+ /**
1070
+ * @description Parameters for billing_address
1071
+
1072
+ */
1073
+
149
1074
  billing_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};
1075
+
1076
+ /**
1077
+ * @description Parameters for shipping_address
1078
+
1079
+ */
1080
+
150
1081
  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};
1082
+
1083
+ /**
1084
+ * @description Parameters for customer
1085
+
1086
+ */
1087
+
151
1088
  customer?:{business_customer_without_vat_number?:boolean,einvoicing_method?:EinvoicingMethod,entity_identifier_scheme?:string,entity_identifier_standard?:string,is_einvoice_enabled?:boolean,registered_for_gst?:boolean,vat_number?:string,vat_number_prefix?:string};
1089
+
1090
+ /**
1091
+ * @description Parameters for contract_term
1092
+
1093
+ */
1094
+
152
1095
  contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1096
+
1097
+ /**
1098
+ * @description Parameters for subscription_items
1099
+
1100
+ */
1101
+
153
1102
  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}[];
1103
+
1104
+ /**
1105
+ * @description Parameters for discounts
1106
+
1107
+ */
1108
+
154
1109
  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}[];
1110
+
1111
+ /**
1112
+ * @description Parameters for item_tiers
1113
+
1114
+ */
1115
+
155
1116
  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}[];
156
1117
  }
157
- export interface RemoveCouponsResponse {
158
- subscription:Subscription;
159
- customer:Customer;
160
- card?:Card;
1118
+ export interface RemoveCouponsResponse {
1119
+ subscription:Subscription;
1120
+
1121
+ customer:Customer;
1122
+
1123
+ card?:Card;
161
1124
  }
162
1125
  export interface RemoveCouponsInputParam {
1126
+
1127
+ /**
1128
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
1129
+
1130
+ */
1131
+
163
1132
  coupon_ids?:string[];
164
1133
  }
165
- export interface ResumeResponse {
166
- subscription:Subscription;
167
- customer:Customer;
168
- card?:Card;
169
- invoice?:Invoice;
170
- unbilled_charges?:UnbilledCharge[];
1134
+ export interface ResumeResponse {
1135
+ subscription:Subscription;
1136
+
1137
+ customer:Customer;
1138
+
1139
+ card?:Card;
1140
+
1141
+ invoice?:Invoice;
1142
+
1143
+ unbilled_charges?:UnbilledCharge[];
171
1144
  }
172
1145
  export interface ResumeInputParam {
1146
+
1147
+ /**
1148
+ * @description List of options to resume the subscription. \* specific_date - Resume on a specific date \* immediately - Resume immediately
1149
+
1150
+ */
1151
+
173
1152
  resume_option?:ResumeOption;
1153
+
1154
+ /**
1155
+ * @description Date on which the subscription will be resumed. Applicable when **resume_option** is set as &#x27;specific_date&#x27;.
1156
+
1157
+ */
1158
+
174
1159
  resume_date?:number;
1160
+
1161
+ /**
1162
+ * @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
1163
+
1164
+ */
1165
+
175
1166
  charges_handling?:ChargesHandling;
1167
+
1168
+ /**
1169
+ * @description Applicable when the subscription has past due invoices and **resume_option** is set as &#x27;immediately&#x27;. Allows to collect past due invoices or retain them as unpaid. If &#x27;schedule_payment_collection&#x27; option is chosen in this field, remaining refundable credits and excess payments are applied. **Note:** The payment collection attempt will be asynchronous. \* no_action - Retain as unpaid \* schedule_payment_collection - Collect payment
1170
+
1171
+ */
1172
+
176
1173
  unpaid_invoices_handling?:UnpaidInvoicesHandling;
177
- payment_initiator?:'merchant' | 'customer';
1174
+
1175
+ /**
1176
+ * @description null
1177
+
1178
+ */
1179
+
1180
+ payment_initiator?:PaymentInitiator;
1181
+
1182
+ /**
1183
+ * @description Parameters for payment_intent
1184
+
1185
+ */
1186
+
178
1187
  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};
179
1188
  }
180
- export interface CancelForItemsResponse {
181
- subscription:Subscription;
182
- customer:Customer;
183
- card?:Card;
184
- invoice?:Invoice;
185
- unbilled_charges?:UnbilledCharge[];
186
- credit_notes?:CreditNote[];
1189
+ export interface CancelForItemsResponse {
1190
+ subscription:Subscription;
1191
+
1192
+ customer:Customer;
1193
+
1194
+ card?:Card;
1195
+
1196
+ invoice?:Invoice;
1197
+
1198
+ unbilled_charges?:UnbilledCharge[];
1199
+
1200
+ credit_notes?:CreditNote[];
187
1201
  }
188
1202
  export interface CancelForItemsInputParam {
1203
+
1204
+ /**
1205
+ * @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;.
1206
+
1207
+ */
1208
+
189
1209
  end_of_term?:boolean;
1210
+
1211
+ /**
1212
+ * @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:
1213
+
1214
+ * Backdating must be enabled for subscription cancellation.
1215
+ * 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.
1216
+ * The date is on or after &#x60;current_term_start&#x60;.
1217
+ * The date is on or after the last date/time any of the following changes were made:
1218
+ * Changes in the recurring items or their prices.
1219
+ * Addition of non-recurring items.
1220
+ * 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.
1221
+ .
1222
+
1223
+ */
1224
+
190
1225
  cancel_at?:number;
1226
+
1227
+ /**
1228
+ * @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.
1229
+
1230
+ */
1231
+
191
1232
  credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
1233
+
1234
+ /**
1235
+ * @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.
1236
+
1237
+ */
1238
+
192
1239
  unbilled_charges_option?:UnbilledChargesOption;
1240
+
1241
+ /**
1242
+ * @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;.
1243
+
1244
+ */
1245
+
193
1246
  account_receivables_handling?:AccountReceivablesHandling;
1247
+
1248
+ /**
1249
+ * @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.
1250
+
1251
+ */
1252
+
194
1253
  refundable_credits_handling?:RefundableCreditsHandling;
1254
+
1255
+ /**
1256
+ * @description Cancels the current contract term.
1257
+
1258
+ * &#x60;terminate_immediately&#x60; immediately does the following:
1259
+ * sets the contract term [&#x60;status&#x60;](contract_terms#contract_term_status) to &#x60;terminated&#x60;.
1260
+ * Cancels the subscription.
1261
+ * Collects any [termination fee](contract_terms#termintation_fee).
1262
+ * &#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.
1263
+ . \* terminate_immediately - Terminate immediately \* end_of_contract_term - End of contract term
1264
+
1265
+ */
1266
+
195
1267
  contract_term_cancel_option?:ContractTermCancelOption;
1268
+
1269
+ /**
1270
+ * @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:
1271
+
1272
+ * &#x60;invoice_date&#x60; must be in the past.
1273
+ * &#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.
1274
+ * It is not earlier than &#x60;cancel_at&#x60;.
1275
+ .
1276
+
1277
+ */
1278
+
196
1279
  invoice_date?:number;
1280
+
1281
+ /**
1282
+ * @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.
1283
+
1284
+ */
1285
+
197
1286
  cancel_reason_code?:string;
1287
+
1288
+ /**
1289
+ * @description Parameters for subscription_items
1290
+
1291
+ */
1292
+
198
1293
  subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
199
1294
  }
200
- export interface RegenerateInvoiceResponse {
201
- invoice?:Invoice;
202
- unbilled_charges?:UnbilledCharge[];
1295
+ export interface RegenerateInvoiceResponse {
1296
+ invoice?:Invoice;
1297
+
1298
+ unbilled_charges?:UnbilledCharge[];
203
1299
  }
204
1300
  export interface RegenerateInvoiceInputParam {
1301
+
1302
+ /**
1303
+ * @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 ).
1304
+
1305
+ */
1306
+
205
1307
  date_from?:number;
1308
+
1309
+ /**
1310
+ * @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 ).
1311
+
1312
+ */
1313
+
206
1314
  date_to?:number;
1315
+
1316
+ /**
1317
+ * @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;.
1318
+
1319
+ */
1320
+
207
1321
  prorate?:boolean;
1322
+
1323
+ /**
1324
+ * @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.
1325
+
1326
+ */
1327
+
208
1328
  invoice_immediately?:boolean;
209
1329
  }
210
- export interface ListResponse {
211
- list:{subscription:Subscription,customer:Customer,card?:Card}[];
212
- next_offset?:string;
1330
+ export interface ListResponse {
1331
+ /**
1332
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1333
+
1334
+ */
1335
+
1336
+ list:{subscription:Subscription,customer:Customer,card?:Card}[];
1337
+
1338
+ /**
1339
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1340
+
1341
+ */
1342
+
1343
+ next_offset?:string;
213
1344
  }
214
1345
  export interface ListInputParam {
215
- [key : string]: any;
1346
+ [key : string]: any;
1347
+ /**
1348
+ * @description The number of resources to be returned.
1349
+
1350
+ */
1351
+
216
1352
  limit?:number;
1353
+
1354
+ /**
1355
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
1356
+
1357
+ */
1358
+
217
1359
  offset?:string;
1360
+
1361
+ /**
1362
+ * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
1363
+
1364
+ */
1365
+
218
1366
  include_deleted?:boolean;
1367
+
1368
+ /**
1369
+ * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
1370
+
1371
+ */
1372
+
219
1373
  id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1374
+
1375
+ /**
1376
+ * @description Identifier of the customer with whom this subscription is associated.
1377
+
1378
+ */
1379
+
220
1380
  customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1381
+
1382
+ /**
1383
+ * @description Identifier of the plan for this subscription
1384
+
1385
+ */
1386
+
221
1387
  plan_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1388
+
1389
+ /**
1390
+ * @description The plan item code
1391
+
1392
+ */
1393
+
222
1394
  item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1395
+
1396
+ /**
1397
+ * @description The plan item price code
1398
+
1399
+ */
1400
+
223
1401
  item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1402
+
1403
+ /**
1404
+ * @description Current state of the subscription
1405
+
1406
+ */
1407
+
224
1408
  status?:{in?:string,is?:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing',is_not?:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing',not_in?:string};
1409
+
1410
+ /**
1411
+ * @description The reason for canceling the subscription. Set by Chargebee automatically.
1412
+
1413
+ */
1414
+
225
1415
  cancel_reason?:{in?:string,is?:'tax_calculation_failed' | 'fraud_review_failed' | 'currency_incompatible_with_gateway' | 'non_compliant_eu_customer' | 'non_compliant_customer' | 'not_paid' | 'no_card',is_not?:'tax_calculation_failed' | 'fraud_review_failed' | 'currency_incompatible_with_gateway' | 'non_compliant_eu_customer' | 'non_compliant_customer' | 'not_paid' | 'no_card',is_present?:'true' | 'false',not_in?:string};
1416
+
1417
+ /**
1418
+ * @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
1419
+
1420
+ */
1421
+
226
1422
  cancel_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1423
+
1424
+ /**
1425
+ * @description * When the subscription is not on a contract term: this value is the number of billing cycles remaining after the current cycle, at the end of which, the subscription cancels.
1426
+ * When the subscription is on a [contract term](contract_terms): this value is the number of billing cycles remaining in the contract term after the current billing cycle.
1427
+
1428
+ */
1429
+
227
1430
  remaining_billing_cycles?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,is_present?:'true' | 'false',lt?:string,lte?:string};
1431
+
1432
+ /**
1433
+ * @description The time at which the subscription was created.
1434
+
1435
+ */
1436
+
228
1437
  created_at?:{after?:string,before?:string,between?:string,on?:string};
1438
+
1439
+ /**
1440
+ * @description Time at which the subscription &#x60;status&#x60; last changed to &#x60;active&#x60;. For example, this value is updated when an &#x60;in_trial&#x60; or &#x60;cancelled&#x60; subscription activates.
1441
+
1442
+ */
1443
+
229
1444
  activated_at?:{after?:string,before?:string,between?:string,is_present?:'true' | 'false',on?:string};
1445
+
1446
+ /**
1447
+ * @description The date/time at which the next billing for the subscription happens. This is usually right after &#x60;current_term_end&#x60; unless multiple subscription terms were invoiced in advance using the &#x60;terms_to_charge&#x60; parameter.
1448
+
1449
+ */
1450
+
230
1451
  next_billing_at?:{after?:string,before?:string,between?:string,on?:string};
1452
+
1453
+ /**
1454
+ * @description Time at which subscription was cancelled or is set to be cancelled.
1455
+
1456
+ */
1457
+
231
1458
  cancelled_at?:{after?:string,before?:string,between?:string,on?:string};
1459
+
1460
+ /**
1461
+ * @description If &#x60;true&#x60;, there are subscription changes scheduled on next renewal.
1462
+
1463
+ */
1464
+
232
1465
  has_scheduled_changes?:{is?:'true' | 'false'};
1466
+
1467
+ /**
1468
+ * @description To filter based on &#x60;updated_at&#x60;. This attribute will be present only if the resource has been updated after 2016-09-28. It is advisable when using this filter, to pass the &#x60;sort_by&#x60; input parameter as &#x60;updated_at&#x60; for a faster response.
1469
+
1470
+ */
1471
+
233
1472
  updated_at?:{after?:string,before?:string,between?:string,on?:string};
1473
+
1474
+ /**
1475
+ * @description The preferred offline payment method for the subscription.
1476
+
1477
+ */
1478
+
234
1479
  offline_payment_method?:{in?:string,is?:'bank_transfer' | 'no_preference' | 'ach_credit' | 'boleto' | 'check' | 'sepa_credit' | 'cash',is_not?:'bank_transfer' | 'no_preference' | 'ach_credit' | 'boleto' | 'check' | 'sepa_credit' | 'cash',not_in?:string};
1480
+
1481
+ /**
1482
+ * @description Set to &#x60;false&#x60; to override for this subscription, the [site-level setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the [customer level](/docs/api/customers?prod_cat_ver&#x3D;2#customer_auto_close_invoices).
1483
+
1484
+ */
1485
+
235
1486
  auto_close_invoices?:{is?:'true' | 'false'};
1487
+
1488
+ /**
1489
+ * @description If &#x60;true&#x60;, ignores the [hierarchy relationship](./customers?prod_cat_ver&#x3D;2#customer_relationship) and uses customer as payment and invoice owner.
1490
+
1491
+ */
1492
+
236
1493
  override_relationship?:{is?:'true' | 'false'};
1494
+
1495
+ /**
1496
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1497
+
1498
+ */
1499
+
237
1500
  sort_by?:{asc?:'updated_at' | 'created_at',desc?:'updated_at' | 'created_at'};
1501
+
1502
+ /**
1503
+ * @description The unique ID of the [business entity](/docs/api?prod_cat_ver&#x3D;2#mbe) of this subscription. This is always the same as the [business entity](/docs/api/subscriptions?prod_cat_ver&#x3D;2#subscription_customer_id) of the customer.
1504
+ The ID of the business entity created for the site. For Product Catalog 1.0, all the site data is tied to this business entity.
1505
+ **Note**
1506
+
1507
+ [Multiple Business Entities](/docs/api?prod_cat_ver&#x3D;2#mbe) is a feature available only on Product Catalog 2.0.
1508
+
1509
+ */
1510
+
238
1511
  business_entity_id?:{is?:string,is_not?:string,starts_with?:string};
1512
+
1513
+ /**
1514
+ * @description The subscription channel this object originated from and is maintained in.
1515
+
1516
+ */
1517
+
239
1518
  channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
240
1519
  }
241
- export interface ImportForItemsResponse {
242
- subscription:Subscription;
243
- customer:Customer;
244
- card?:Card;
245
- invoice?:Invoice;
1520
+ export interface ImportForItemsResponse {
1521
+ subscription:Subscription;
1522
+
1523
+ customer:Customer;
1524
+
1525
+ card?:Card;
1526
+
1527
+ invoice?:Invoice;
246
1528
  }
247
1529
  export interface ImportForItemsInputParam {
248
- [key : string] : any;
1530
+ [key : string] : any;
1531
+ /**
1532
+ * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
1533
+
1534
+ */
1535
+
249
1536
  id?:string;
1537
+
1538
+ /**
1539
+ * @description End of the trial period for the subscription. This overrides the trial period set for the plan-item. The value must be later than &#x60;start_date&#x60;. Set it to &#x60;0&#x60; to have no trial period.
1540
+
1541
+ */
1542
+
250
1543
  trial_end?:number;
1544
+
1545
+ /**
1546
+ * @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.
1547
+
1548
+ */
1549
+
251
1550
  billing_cycles?:number;
1551
+
1552
+ /**
1553
+ * @description Defines [Net D](https://www.chargebee.com/docs/net_d.html) for the subscription. Net D is the number of days within which any invoice raised for the subscription must be paid.
1554
+
1555
+ * If a value is provided: Net D is set explicitly for the subscription to the value provided. The value must be one among those defined in the [site configuration](https://www.chargebee.com/docs/net_d.html#enable-net-d-for-chargebee-invoices).
1556
+ * If not provided: The attribute is not set and therefore not returned by the API. In this case, when an invoice is raised -- whether now or later -- the &#x60;net_term_days&#x60; defined at the [customer level](customers#customer_net_term_days) is considered.
1557
+ .
1558
+
1559
+ */
1560
+
252
1561
  net_term_days?:number;
1562
+
1563
+ /**
1564
+ * @description The date/time at which the subscription is to start or has started. If not provided, the subscription starts immediately.
1565
+
1566
+ */
1567
+
253
1568
  start_date?:number;
1569
+
1570
+ /**
1571
+ * @description Defines whether payments need to be collected automatically for this subscription. Overrides customer&#x27;s auto-collection property. \* on - Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available. \* off - Automatic collection of charges will not be made for this subscription. Use this for offline payments.
1572
+
1573
+ */
1574
+
254
1575
  auto_collection?:AutoCollection;
1576
+
1577
+ /**
1578
+ * @description Purchase order number for this subscription.
1579
+
1580
+ */
1581
+
255
1582
  po_number?:string;
1583
+
1584
+ /**
1585
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or [coupon codes](./coupon_codes).
1586
+
1587
+ */
1588
+
256
1589
  coupon_ids?:string[];
1590
+
1591
+ /**
1592
+ * @description Id of the payment source to be attached to this subscription.
1593
+
1594
+ */
1595
+
257
1596
  payment_source_id?:string;
1597
+
1598
+ /**
1599
+ * @description Current state of the subscription. \* future - The subscription is scheduled to start at a future date. \* active - The subscription is active and will be charged for automatically based on the items in it. \* cancelled - The subscription has been canceled and is no longer in service. \* in_trial - The subscription is in trial. \* non_renewing - The subscription will be canceled at the end of the current term. \* paused - The subscription is [paused](https://www.chargebee.com/docs/2.0/pause-subscription.html). The subscription will not renew while in this state.
1600
+
1601
+ */
1602
+
258
1603
  status:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing';
1604
+
1605
+ /**
1606
+ * @description End of the current billing term. Subscription is renewed immediately after this. If not given, this will be calculated based on plan billing cycle.
1607
+
1608
+
1609
+
1610
+ **Note:**
1611
+
1612
+
1613
+ For subscription status: &#x60;non_renewing&#x60;, &#x60;active&#x60;, and &#x60;paused&#x60;, &#x60;current_term_end&#x60; is required.
1614
+
1615
+
1616
+
1617
+ .
1618
+
1619
+ */
1620
+
259
1621
  current_term_end?:number;
1622
+
1623
+ /**
1624
+ * @description Start of the current billing period of the subscription. This is required when the subscription &#x60;status&#x60; is &#x60;paused&#x60;. When the &#x60;status&#x60; is &#x60;active&#x60; or &#x60;non_renewing&#x60;, it defaults to the current time.
1625
+
1626
+ */
1627
+
260
1628
  current_term_start?:number;
1629
+
1630
+ /**
1631
+ * @description Start of the trial period for the subscription. When not passed, it is assumed to be current time. When passed for a &#x60;future&#x60; subscription, it implies that the subscription goes into &#x60;in_trial&#x60; when it starts.
1632
+
1633
+ */
1634
+
261
1635
  trial_start?:number;
1636
+
1637
+ /**
1638
+ * @description Time at which subscription was cancelled or is set to be cancelled.
1639
+
1640
+ */
1641
+
262
1642
  cancelled_at?:number;
1643
+
1644
+ /**
1645
+ * @description Time at which the subscription was started. Is &#x60;null&#x60; for &#x60;future&#x60;subscriptions as it is yet to be started.
1646
+
1647
+ */
1648
+
263
1649
  started_at?:number;
1650
+
1651
+ /**
1652
+ * @description The time at which the subscription was activated. A subscription is &quot;activated&quot; when its &#x60;status&#x60; changes from any other, to either &#x60;active&#x60; or &#x60;non_renewing&#x60;.
1653
+
1654
+ The following conditions must be satisfied when passing this parameter:
1655
+
1656
+ * When &#x60;status&#x60; is &#x60;active&#x60;, &#x60;non_renewing&#x60;, or &#x60;paused&#x60;, &#x60;activated_at&#x60; must be on or after &#x60;trial_end&#x60; or &#x60;started_at&#x60;. Additionally, &#x60;activated_at&#x60; must be on or before &#x60;current_term_start&#x60;.
1657
+ * When &#x60;status&#x60; is &#x60;in_trial&#x60;, &#x60;activated_at&#x60; must precede &#x60;trial_start&#x60;
1658
+
1659
+ #### Note:
1660
+
1661
+ This parameter should not be provided when passing &#x60;status&#x60; as &#x60;future&#x60; or &#x60;cancelled&#x60;.
1662
+
1663
+ */
1664
+
264
1665
  activated_at?:number;
1666
+
1667
+ /**
1668
+ * @description When a pause has been scheduled, it is the date/time of scheduled pause. When the subscription is in the &#x60;paused&#x60; state, it is the date/time when the subscription was paused.
1669
+
1670
+ */
1671
+
265
1672
  pause_date?:number;
1673
+
1674
+ /**
1675
+ * @description For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.
1676
+
1677
+ */
1678
+
266
1679
  resume_date?:number;
1680
+
1681
+ /**
1682
+ * @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as &#x60;billing_cycles&#x60; or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
1683
+
1684
+ */
1685
+
267
1686
  contract_term_billing_cycle_on_renewal?:number;
1687
+
1688
+ /**
1689
+ * @description Set as &#x60;true&#x60; if you want an invoice to be created for the subscription.
1690
+
1691
+ * The invoice will be created for the subscription only if it has an &#x60;active&#x60; or &#x60;non_renewing&#x60; status.
1692
+ * The period of the invoice is from &#x60;current_term_start&#x60; to &#x60;current_term_end&#x60;.
1693
+ * The invoice will not be generated if the subscription amount is zero dollars (for that period) and &#x27;Hide Zero Value Line Items&#x27; option is enabled in site settings.
1694
+
1695
+ */
1696
+
268
1697
  create_current_term_invoice?:boolean;
1698
+
1699
+ /**
1700
+ * @description A customer-facing note added to all invoices associated with this subscription. This note is one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
1701
+
1702
+ */
1703
+
269
1704
  invoice_notes?:string;
1705
+
1706
+ /**
1707
+ * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./#meta_data).
1708
+
1709
+ */
1710
+
270
1711
  meta_data?:object;
1712
+
1713
+ /**
1714
+ * @description Imports a subscription into Chargebee.
1715
+
1716
+ */
1717
+
271
1718
  cancel_reason_code?:string;
1719
+
1720
+ /**
1721
+ * @description Indicates whether the invoices for this subscription are generated with a &#x60;pending&#x60; &#x60;status&#x60;. This attribute is set to &#x60;true&#x60; automatically when the subscription has item prices that belong to &#x60;metered&#x60; items.
1722
+
1723
+ You can also set this to &#x60;true&#x60; explicitly using the [create](/docs/api/subscriptions#create_subscription_for_items_create_pending_invoices)/[update](/docs/api/subscriptions#update_subscription_for_items_create_pending_invoices) subscription operations. This is useful in the following scenarios:
1724
+
1725
+ * When tracking usages and calculating usage-based charges on your end. You can then add them to the subscription as a [one-time charge](https://www.chargebee.com/docs/charges.html) at the end of the billing term.
1726
+ * When you need to inspect all charges before closing invoices for this subscription.
1727
+
1728
+ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_billing.html) is enabled for the site
1729
+ .
1730
+
1731
+ */
1732
+
272
1733
  create_pending_invoices?:boolean;
1734
+
1735
+ /**
1736
+ * @description Set to &#x60;false&#x60; to override for this subscription, the [site-level setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the [customer level](/docs/api/customers?prod_cat_ver&#x3D;2#customer_auto_close_invoices).
1737
+
1738
+ */
1739
+
273
1740
  auto_close_invoices?:boolean;
1741
+
1742
+ /**
1743
+ * @description Parameters for contract_term
1744
+
1745
+ */
1746
+
274
1747
  contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',billing_cycle?:number,cancellation_cutoff_period?:number,contract_start?:number,created_at?:number,id?:string,total_amount_raised?:number,total_amount_raised_before_tax?:number};
1748
+
1749
+ /**
1750
+ * @description Parameters for transaction
1751
+
1752
+ */
1753
+
275
1754
  transaction?:{amount?:number,date?:number,payment_method?:PaymentMethod,reference_number?:string};
1755
+
1756
+ /**
1757
+ * @description Parameters for shipping_address
1758
+
1759
+ */
1760
+
276
1761
  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};
1762
+
1763
+ /**
1764
+ * @description Parameters for subscription_items
1765
+
1766
+ */
1767
+
277
1768
  subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,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}[];
1769
+
1770
+ /**
1771
+ * @description Parameters for discounts
1772
+
1773
+ */
1774
+
278
1775
  discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
1776
+
1777
+ /**
1778
+ * @description Parameters for charged_items
1779
+
1780
+ */
1781
+
279
1782
  charged_items?:{item_price_id?:string,last_charged_at?:number}[];
1783
+
1784
+ /**
1785
+ * @description Parameters for item_tiers
1786
+
1787
+ */
1788
+
280
1789
  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}[];
281
1790
  }
282
- export interface RetrieveAdvanceInvoiceScheduleResponse {
283
- advance_invoice_schedules:AdvanceInvoiceSchedule[];
1791
+ export interface RetrieveAdvanceInvoiceScheduleResponse {
1792
+ advance_invoice_schedules:AdvanceInvoiceSchedule[];
284
1793
  }
285
1794
 
286
- export interface RemoveScheduledCancellationResponse {
287
- subscription:Subscription;
288
- customer:Customer;
289
- card?:Card;
1795
+ export interface RemoveScheduledCancellationResponse {
1796
+ subscription:Subscription;
1797
+
1798
+ customer:Customer;
1799
+
1800
+ card?:Card;
290
1801
  }
291
1802
  export interface RemoveScheduledCancellationInputParam {
1803
+
1804
+ /**
1805
+ * @description Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
1806
+
1807
+ */
1808
+
292
1809
  billing_cycles?:number;
293
1810
  }
294
- export interface RetrieveWithScheduledChangesResponse {
295
- subscription:Subscription;
296
- customer:Customer;
297
- card?:Card;
1811
+ export interface RetrieveWithScheduledChangesResponse {
1812
+ subscription:Subscription;
1813
+
1814
+ customer:Customer;
1815
+
1816
+ card?:Card;
298
1817
  }
299
1818
 
300
- export interface ReactivateResponse {
301
- subscription:Subscription;
302
- customer:Customer;
303
- card?:Card;
304
- invoice?:Invoice;
305
- unbilled_charges?:UnbilledCharge[];
1819
+ export interface ReactivateResponse {
1820
+ subscription:Subscription;
1821
+
1822
+ customer:Customer;
1823
+
1824
+ card?:Card;
1825
+
1826
+ invoice?:Invoice;
1827
+
1828
+ unbilled_charges?:UnbilledCharge[];
306
1829
  }
307
1830
  export interface ReactivateInputParam {
1831
+
1832
+ /**
1833
+ * @description Providing this parameter indicates that the subscription reactivates with an &#x60;in_trial&#x60; &#x60;status&#x60; and the trial period ends at the date provided. The value must not be earlier than &#x60;reactivate_from&#x60;. Note: This parameter can be backdated (set to a value in the past) only when &#x60;reactivate_from&#x60; has been backdated. Do this to keep a record of when the trial ended in case it ended at some point in the past. When &#x60;trial_end&#x60; is backdated, the subscription immediately goes into &#x60;active&#x60; or &#x60;non_renewing&#x60; status.
1834
+
1835
+ */
1836
+
308
1837
  trial_end?:number;
1838
+
1839
+ /**
1840
+ * @description Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
1841
+
1842
+ */
1843
+
309
1844
  billing_cycles?:number;
1845
+
1846
+ /**
1847
+ * @description The date/time at which the subscription was reactivated. When not provided, the subscription is reactivated immediately on calling this API. The value of this parameter must always be in the past (backdating). Do this when the subscription has already been reactivated and the billing has been delayed. The following prerequisites must be met for this parameter to be passed:
1848
+
1849
+ * The backdating feature has been enabled for subscription reactivation operations.
1850
+ * The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is the day of the month by which the accounting for the previous month must be closed.
1851
+ * 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;reactivate_from&#x60; cannot be earlier than 14th February.
1852
+ .
1853
+
1854
+ */
1855
+
310
1856
  reactivate_from?:number;
1857
+
1858
+ /**
1859
+ * @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).
1860
+ **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. .
1861
+
1862
+ */
1863
+
311
1864
  invoice_immediately?:boolean;
1865
+
1866
+ /**
1867
+ * @description Applicable when calendar billing is enabled and a new *active* term gets started during this operation. Unless specified the configured *default* value will be used. \* 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..
1868
+
1869
+ */
1870
+
312
1871
  billing_alignment_mode?:BillingAlignmentMode;
1872
+
1873
+ /**
1874
+ * @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.
1875
+
1876
+ */
1877
+
313
1878
  terms_to_charge?:number;
1879
+
1880
+ /**
1881
+ * @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 the 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 tax configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
1882
+
1883
+ * &#x60;invoice_date&#x60; must be in the past.
1884
+ * &#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.
1885
+ * It is not earlier than &#x60;reactivate_from&#x60; or &#x60;trial_end&#x60;.
1886
+ * &#x60;invoice_immediately&#x60; is &#x60;true&#x60;.
1887
+ .
1888
+
1889
+ */
1890
+
314
1891
  invoice_date?:number;
1892
+
1893
+ /**
1894
+ * @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as &#x60;billing_cycles&#x60; or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
1895
+
1896
+ */
1897
+
315
1898
  contract_term_billing_cycle_on_renewal?:number;
316
- payment_initiator?:'merchant' | 'customer';
1899
+
1900
+ /**
1901
+ * @description null
1902
+
1903
+ */
1904
+
1905
+ payment_initiator?:PaymentInitiator;
1906
+
1907
+ /**
1908
+ * @description Parameters for contract_term
1909
+
1910
+ */
1911
+
317
1912
  contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1913
+
1914
+ /**
1915
+ * @description Parameters for payment_intent
1916
+
1917
+ */
1918
+
318
1919
  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};
319
1920
  }
320
- export interface ChargeFutureRenewalsResponse {
321
- subscription:Subscription;
322
- customer:Customer;
323
- card?:Card;
324
- invoice?:Invoice;
325
- advance_invoice_schedules?:AdvanceInvoiceSchedule[];
1921
+ export interface ChargeFutureRenewalsResponse {
1922
+ subscription:Subscription;
1923
+
1924
+ customer:Customer;
1925
+
1926
+ card?:Card;
1927
+
1928
+ invoice?:Invoice;
1929
+
1930
+ advance_invoice_schedules?:AdvanceInvoiceSchedule[];
326
1931
  }
327
1932
  export interface ChargeFutureRenewalsInputParam {
1933
+
1934
+ /**
1935
+ * @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;.
1936
+ * 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.
1937
+ .
1938
+
1939
+ */
1940
+
328
1941
  terms_to_charge?:number;
1942
+
1943
+ /**
1944
+ * @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;.
1945
+
1946
+ */
1947
+
329
1948
  invoice_immediately?:boolean;
1949
+
1950
+ /**
1951
+ * @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).
1952
+
1953
+ */
1954
+
330
1955
  schedule_type?:ScheduleType;
1956
+
1957
+ /**
1958
+ * @description Parameters for fixed_interval_schedule
1959
+
1960
+ */
1961
+
331
1962
  fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
1963
+
1964
+ /**
1965
+ * @description Parameters for specific_dates_schedule
1966
+
1967
+ */
1968
+
332
1969
  specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
333
1970
  }
334
- export interface AddChargeAtTermEndResponse {
335
- estimate:Estimate;
1971
+ export interface AddChargeAtTermEndResponse {
1972
+ estimate:Estimate;
336
1973
  }
337
1974
  export interface AddChargeAtTermEndInputParam {
1975
+
1976
+ /**
1977
+ * @description The amount to be charged. The unit depends on the [type of currency](/docs/api#md_disabled).
1978
+
1979
+ */
1980
+
338
1981
  amount?:number;
1982
+
1983
+ /**
1984
+ * @description Description for this charge.
1985
+
1986
+ */
1987
+
339
1988
  description:string;
1989
+
1990
+ /**
1991
+ * @description The decimal representation of the amount for the [one-time charge](https://www.chargebee.com/docs/charges.html#one-time-charges ). Provide the value in major units of the currency. Can be provided only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1992
+
1993
+ */
1994
+
340
1995
  amount_in_decimal?:string;
1996
+
1997
+ /**
1998
+ * @description Indicates the type of sale carried out. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. \* retail - Transaction is a sale to an end user \* wholesale - Transaction is a sale to another company that will resell your product or service to another consumer \* vendor_use - Transaction is for an item that is subject to vendor use tax \* consumed - Transaction is for an item that is consumed directly
1999
+
2000
+ */
2001
+
341
2002
  avalara_sale_type?:AvalaraSaleType;
2003
+
2004
+ /**
2005
+ * @description Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
2006
+
2007
+ */
2008
+
342
2009
  avalara_transaction_type?:number;
2010
+
2011
+ /**
2012
+ * @description Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
2013
+
2014
+ */
2015
+
343
2016
  avalara_service_type?:number;
2017
+
2018
+ /**
2019
+ * @description The time when the service period for the charge starts.
2020
+
2021
+ */
2022
+
344
2023
  date_from?:number;
2024
+
2025
+ /**
2026
+ * @description The time when the service period for the charge ends.
2027
+
2028
+ */
2029
+
345
2030
  date_to?:number;
346
2031
  }
347
- export interface RemoveScheduledChangesResponse {
348
- subscription:Subscription;
349
- customer:Customer;
350
- card?:Card;
351
- credit_notes?:CreditNote[];
2032
+ export interface RemoveScheduledChangesResponse {
2033
+ subscription:Subscription;
2034
+
2035
+ customer:Customer;
2036
+
2037
+ card?:Card;
2038
+
2039
+ credit_notes?:CreditNote[];
352
2040
  }
353
2041
 
354
- export interface ChangeTermEndResponse {
355
- subscription:Subscription;
356
- customer:Customer;
357
- card?:Card;
358
- invoice?:Invoice;
359
- unbilled_charges?:UnbilledCharge[];
360
- credit_notes?:CreditNote[];
2042
+ export interface ChangeTermEndResponse {
2043
+ subscription:Subscription;
2044
+
2045
+ customer:Customer;
2046
+
2047
+ card?:Card;
2048
+
2049
+ invoice?:Invoice;
2050
+
2051
+ unbilled_charges?:UnbilledCharge[];
2052
+
2053
+ credit_notes?:CreditNote[];
361
2054
  }
362
2055
  export interface ChangeTermEndInputParam {
2056
+
2057
+ /**
2058
+ * @description The time at which the current term should end for this subscription.
2059
+
2060
+ */
2061
+
363
2062
  term_ends_at:number;
2063
+
2064
+ /**
2065
+ * @description Applicable for *active* / *non_renewing* subscriptions. If specified as *true* prorated charges / credits will be added during this operation.
2066
+
2067
+ */
2068
+
364
2069
  prorate?:boolean;
2070
+
2071
+ /**
2072
+ * @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).
2073
+ **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. .
2074
+
2075
+ */
2076
+
365
2077
  invoice_immediately?:boolean;
366
2078
  }
367
- export interface DeleteResponse {
368
- subscription:Subscription;
369
- customer:Customer;
370
- card?:Card;
2079
+ export interface DeleteResponse {
2080
+ subscription:Subscription;
2081
+
2082
+ customer:Customer;
2083
+
2084
+ card?:Card;
371
2085
  }
372
2086
 
373
- export interface CreateWithItemsResponse {
374
- subscription:Subscription;
375
- customer:Customer;
376
- card?:Card;
377
- invoice?:Invoice;
378
- unbilled_charges?:UnbilledCharge[];
2087
+ export interface CreateWithItemsResponse {
2088
+ subscription:Subscription;
2089
+
2090
+ customer:Customer;
2091
+
2092
+ card?:Card;
2093
+
2094
+ invoice?:Invoice;
2095
+
2096
+ unbilled_charges?:UnbilledCharge[];
379
2097
  }
380
2098
  export interface CreateWithItemsInputParam {
381
- [key : string] : any;
2099
+ [key : string] : any;
2100
+ /**
2101
+ * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
2102
+
2103
+ */
2104
+
382
2105
  id?:string;
2106
+
2107
+ /**
2108
+ * @description The unique ID of the [business entity](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) this subscription should be [linked](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe-linked-be) to. Applicable only when multiple business entities have been created for the site. This must be the same as the business entity of the &#x60;{customer_id}&#x60; for the operation to be successful.
2109
+ **Note**
2110
+
2111
+ An alternative way of passing this parameter is by means of a [custom HTTP header](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe-header-main).
2112
+ .
2113
+
2114
+ */
2115
+
383
2116
  business_entity_id?:string;
2117
+
2118
+ /**
2119
+ * @description End of the trial period for the subscription. This overrides the trial period set for the plan-item. The value must be later than &#x60;start_date&#x60;. Set it to &#x60;0&#x60; to have no trial period.
2120
+
2121
+ */
2122
+
384
2123
  trial_end?:number;
2124
+
2125
+ /**
2126
+ * @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.
2127
+
2128
+ */
2129
+
385
2130
  billing_cycles?:number;
2131
+
2132
+ /**
2133
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
2134
+
2135
+ */
2136
+
386
2137
  mandatory_items_to_remove?:string[];
2138
+
2139
+ /**
2140
+ * @description Defines [Net D](https://www.chargebee.com/docs/net_d.html) for the subscription. Net D is the number of days within which any invoice raised for the subscription must be paid.
2141
+
2142
+ * If a value is provided: Net D is set explicitly for the subscription to the value provided. The value must be one among those defined in the [site configuration](https://www.chargebee.com/docs/net_d.html#enable-net-d-for-chargebee-invoices).
2143
+ * If not provided: The attribute is not set and therefore not returned by the API. In this case, when an invoice is raised -- whether now or later -- the &#x60;net_term_days&#x60; defined at the [customer level](customers#customer_net_term_days) is considered.
2144
+ .
2145
+
2146
+ */
2147
+
387
2148
  net_term_days?:number;
2149
+
2150
+ /**
2151
+ * @description The date/time at which the subscription is to start. If not provided, the subscription starts immediately. You can provide a value in the past as well. This is called backdating the subscription creation and is done when the subscription has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
2152
+
2153
+ * Backdating is enabled for subscription creation operations.
2154
+ * The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is typically the day of the month by which the accounting for the previous month must be closed.
2155
+ * 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;start_date&#x60; cannot be earlier than 14th February.
2156
+ .
2157
+
2158
+ */
2159
+
388
2160
  start_date?:number;
2161
+
2162
+ /**
2163
+ * @description Defines whether payments need to be collected automatically for this subscription. Overrides customer&#x27;s auto-collection property. \* on - Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available. \* off - Automatic collection of charges will not be made for this subscription. Use this for offline payments.
2164
+
2165
+ */
2166
+
389
2167
  auto_collection?:AutoCollection;
2168
+
2169
+ /**
2170
+ * @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
2171
+
2172
+ */
2173
+
390
2174
  terms_to_charge?:number;
2175
+
2176
+ /**
2177
+ * @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.
2178
+
2179
+ */
2180
+
391
2181
  billing_alignment_mode?:BillingAlignmentMode;
2182
+
2183
+ /**
2184
+ * @description Purchase order number for this subscription.
2185
+
2186
+ */
2187
+
392
2188
  po_number?:string;
2189
+
2190
+ /**
2191
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
2192
+
2193
+ */
2194
+
393
2195
  coupon_ids?:string[];
2196
+
2197
+ /**
2198
+ * @description Id of the payment source to be attached to this subscription.
2199
+
2200
+ */
2201
+
394
2202
  payment_source_id?:string;
2203
+
2204
+ /**
2205
+ * @description If &#x60;true&#x60;, ignores the [hierarchy relationship](./customers?prod_cat_ver&#x3D;2#customer_relationship) and uses customer as payment and invoice owner.
2206
+
2207
+ */
2208
+
395
2209
  override_relationship?:boolean;
2210
+
2211
+ /**
2212
+ * @description A customer-facing note added to all invoices associated with this subscription. This note is one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
2213
+
2214
+ */
2215
+
396
2216
  invoice_notes?:string;
2217
+
2218
+ /**
2219
+ * @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 the 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 tax configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
2220
+
2221
+ * &#x60;invoice_date&#x60; must be in the past.
2222
+ * It is not earlier than &#x60;start_date&#x60;.
2223
+ * It is not more than one calendar month into the past. Eg. If today is 13th January, then you cannot pass a value that is earlier than 13th December.
2224
+ * &#x60;invoice_immediately&#x60; is true.
2225
+ .
2226
+
2227
+ */
2228
+
397
2229
  invoice_date?:number;
2230
+
2231
+ /**
2232
+ * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./#meta_data).
2233
+
2234
+ */
2235
+
398
2236
  meta_data?:object;
2237
+
2238
+ /**
2239
+ * @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).
2240
+ **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. .
2241
+
2242
+ */
2243
+
399
2244
  invoice_immediately?:boolean;
2245
+
2246
+ /**
2247
+ * @description Indicates whether the primary payment source should be replaced with this payment source. In case of Create Subscription for Customer endpoint, the default value is True. Otherwise, the default value is False.
2248
+
2249
+ */
2250
+
400
2251
  replace_primary_payment_source?:boolean;
2252
+
2253
+ /**
2254
+ * @description The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit.
2255
+
2256
+ */
2257
+
401
2258
  free_period?:number;
2259
+
2260
+ /**
2261
+ * @description The unit of time in multiples of which the free_period parameter is expressed. The value must be equal to or lower than the [period_unit](/docs/api/plans#create_a_plan_period_unit) attribute of the [plan](/docs/api/subscriptions#create_a_subscription_plan_id) chosen. \* week - Charge based on week(s) \* month - Charge based on month(s) \* day - Charge based on day(s) \* year - Charge based on year(s)
2262
+
2263
+ */
2264
+
402
2265
  free_period_unit?:FreePeriodUnit;
2266
+
2267
+ /**
2268
+ * @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as &#x60;billing_cycles&#x60; or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
2269
+
2270
+ */
2271
+
403
2272
  contract_term_billing_cycle_on_renewal?:number;
2273
+
2274
+ /**
2275
+ * @description Indicates whether the invoices for this subscription are generated with a &#x60;pending&#x60; &#x60;status&#x60;. This attribute is set to &#x60;true&#x60; automatically when the subscription has item prices that belong to &#x60;metered&#x60; items.
2276
+
2277
+ You can also set this to &#x60;true&#x60; explicitly using the [create](/docs/api/subscriptions#create_subscription_for_items_create_pending_invoices)/[update](/docs/api/subscriptions#update_subscription_for_items_create_pending_invoices) subscription operations. This is useful in the following scenarios:
2278
+
2279
+ * When tracking usages and calculating usage-based charges on your end. You can then add them to the subscription as a [one-time charge](https://www.chargebee.com/docs/charges.html) at the end of the billing term.
2280
+ * When you need to inspect all charges before closing invoices for this subscription.
2281
+
2282
+ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_billing.html) is enabled for the site
2283
+ .
2284
+
2285
+ */
2286
+
404
2287
  create_pending_invoices?:boolean;
2288
+
2289
+ /**
2290
+ * @description Set to &#x60;false&#x60; to override for this subscription, the [site-level setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the [customer level](/docs/api/customers?prod_cat_ver&#x3D;2#customer_auto_close_invoices).
2291
+
2292
+ */
2293
+
405
2294
  auto_close_invoices?:boolean;
2295
+
2296
+ /**
2297
+ * @description If you want to bill the usages from the previous billing cycle, set this parameter to &#x60;true&#x60;. This is useful if the subscription has moved from another system into Chargebee and you haven&#x27;t closed the previous cycle&#x27;s invoice yet. This creates a &#x60;pending&#x60; invoice immediately on subscription creation, to which you can [add usages](/docs/api/usages#create_a_usage) for the previous cycle.
2298
+
2299
+ If any non-&#x60;metered&#x60; items are present for the current term, they&#x27;re also added to this &#x60;pending&#x60; invoice. As with all &#x60;pending&#x60; invoices, this invoice is also [closed automatically](https://www.chargebee.com/docs/metered_billing.html#configuring-metered-billing) or via an [API call](/docs/api/invoices#close_a_pending_invoice). This parameter can be passed only when the &#x60;create_pending_invoices&#x60; is &#x60;true&#x60;
2300
+ .
2301
+
2302
+ */
2303
+
406
2304
  first_invoice_pending?:boolean;
2305
+
2306
+ /**
2307
+ * @description Applicable only when [End-of-trial Action](https://www.chargebee.com/docs/2.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) has been enabled for the site. Whenever the subscription has a trial period, this attribute (parameter) is returned (required) and specifies the operation to be carried out for the subscription once the trial ends. \* cancel_subscription - The subscription cancels. \* activate_subscription - The subscription activates and charges are raised for non-metered items. \* plan_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when &#x60;trial_end_action&#x60; is defined for the plan. \* site_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when &#x60;trial_end_action&#x60; is **not** defined for the plan.
2308
+
2309
+ */
2310
+
407
2311
  trial_end_action?:TrialEndAction;
408
- payment_initiator?:'merchant' | 'customer';
2312
+
2313
+ /**
2314
+ * @description The type of initiator to be used for the payment request triggered by this operation. \* customer - Pass this value to indicate that the request is initiated by the customer \* merchant - Pass this value to indicate that the request is initiated by the merchant
2315
+
2316
+ */
2317
+
2318
+ payment_initiator?:PaymentInitiator;
2319
+
2320
+ /**
2321
+ * @description Parameters for shipping_address
2322
+
2323
+ */
2324
+
409
2325
  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};
2326
+
2327
+ /**
2328
+ * @description Parameters for payment_intent
2329
+
2330
+ */
2331
+
410
2332
  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};
2333
+
2334
+ /**
2335
+ * @description Parameters for contract_term
2336
+
2337
+ */
2338
+
411
2339
  contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
2340
+
2341
+ /**
2342
+ * @description Parameters for subscription_items
2343
+
2344
+ */
2345
+
412
2346
  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}[];
2347
+
2348
+ /**
2349
+ * @description Parameters for discounts
2350
+
2351
+ */
2352
+
413
2353
  discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
2354
+
2355
+ /**
2356
+ * @description Parameters for item_tiers
2357
+
2358
+ */
2359
+
414
2360
  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}[];
415
2361
  }
416
- export interface ImportUnbilledChargesResponse {
417
- unbilled_charges:UnbilledCharge[];
2362
+ export interface ImportUnbilledChargesResponse {
2363
+ unbilled_charges:UnbilledCharge[];
418
2364
  }
419
2365
  export interface ImportUnbilledChargesInputParam {
2366
+
2367
+ /**
2368
+ * @description Parameters for unbilled_charges
2369
+
2370
+ */
2371
+
420
2372
  unbilled_charges?:{amount?:number,amount_in_decimal?:string,date_from:number,date_to:number,description?:string,discount_amount?:number,entity_id?:string,entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc',id?:string,is_advance_charge?:boolean,quantity?:number,quantity_in_decimal?:string,unit_amount?:number,unit_amount_in_decimal?:string,use_for_proration?:boolean}[];
2373
+
2374
+ /**
2375
+ * @description Parameters for discounts
2376
+
2377
+ */
2378
+
421
2379
  discounts?:{amount:number,description?:string,entity_id?:string,entity_type?:'item_level_coupon' | 'item_level_discount' | 'document_level_discount' | 'document_level_coupon',unbilled_charge_id?:string}[];
2380
+
2381
+ /**
2382
+ * @description Parameters for tiers
2383
+
2384
+ */
2385
+
422
2386
  tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,quantity_used?:number,quantity_used_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string,unbilled_charge_id:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
423
2387
  }
424
- export interface RemoveScheduledResumptionResponse {
425
- subscription:Subscription;
426
- customer:Customer;
427
- card?:Card;
2388
+ export interface RemoveScheduledResumptionResponse {
2389
+ subscription:Subscription;
2390
+
2391
+ customer:Customer;
2392
+
2393
+ card?:Card;
428
2394
  }
429
2395
 
430
- export interface RetrieveResponse {
431
- subscription:Subscription;
432
- customer:Customer;
433
- card?:Card;
2396
+ export interface RetrieveResponse {
2397
+ subscription:Subscription;
2398
+
2399
+ customer:Customer;
2400
+
2401
+ card?:Card;
434
2402
  }
435
2403
 
436
- export interface ImportContractTermResponse {
437
- contract_term:ContractTerm;
2404
+ export interface ImportContractTermResponse {
2405
+ contract_term:ContractTerm;
438
2406
  }
439
2407
  export interface ImportContractTermInputParam {
2408
+
2409
+ /**
2410
+ * @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as &#x60;billing_cycles&#x60; or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
2411
+
2412
+ */
2413
+
440
2414
  contract_term_billing_cycle_on_renewal?:number;
2415
+
2416
+ /**
2417
+ * @description Parameters for contract_term
2418
+
2419
+ */
2420
+
441
2421
  contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',billing_cycle?:number,cancellation_cutoff_period?:number,contract_end?:number,contract_start?:number,created_at?:number,id?:string,status?:'active' | 'cancelled' | 'completed' | 'terminated',total_amount_raised?:number,total_amount_raised_before_tax?:number,total_contract_value?:number,total_contract_value_before_tax?:number};
442
2422
  }
443
- export interface OverrideBillingProfileResponse {
444
- subscription:Subscription;
445
- payment_source?:PaymentSource;
2423
+ export interface OverrideBillingProfileResponse {
2424
+ subscription:Subscription;
2425
+
2426
+ payment_source?:PaymentSource;
446
2427
  }
447
2428
  export interface OverrideBillingProfileInputParam {
2429
+
2430
+ /**
2431
+ * @description Unique identifier of the payment source to be attached to this subscription.
2432
+
2433
+ */
2434
+
448
2435
  payment_source_id?:string;
2436
+
2437
+ /**
2438
+ * @description Defines whether payments need to be collected automatically for this subscription. Overrides customer&#x27;s auto-collection property. \* off - Automatic collection of charges will not be made for this subscription. Use this for offline payments. \* on - Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.
2439
+
2440
+ */
2441
+
449
2442
  auto_collection?:AutoCollection;
450
2443
  }
451
- export interface RemoveScheduledPauseResponse {
452
- subscription:Subscription;
453
- customer:Customer;
454
- card?:Card;
2444
+ export interface RemoveScheduledPauseResponse {
2445
+ subscription:Subscription;
2446
+
2447
+ customer:Customer;
2448
+
2449
+ card?:Card;
455
2450
  }
456
2451
 
457
- export interface EditAdvanceInvoiceScheduleResponse {
458
- advance_invoice_schedules:AdvanceInvoiceSchedule[];
2452
+ export interface EditAdvanceInvoiceScheduleResponse {
2453
+ advance_invoice_schedules:AdvanceInvoiceSchedule[];
459
2454
  }
460
2455
  export interface EditAdvanceInvoiceScheduleInputParam {
2456
+
2457
+ /**
2458
+ * @description The number of billing cycles in one interval.
2459
+
2460
+ */
2461
+
461
2462
  terms_to_charge?:number;
2463
+
2464
+ /**
2465
+ * @description The type of advance invoice or advance invoicing schedule. \* 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).
2466
+
2467
+ */
2468
+
462
2469
  schedule_type?:ScheduleType;
2470
+
2471
+ /**
2472
+ * @description Parameters for fixed_interval_schedule
2473
+
2474
+ */
2475
+
463
2476
  fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
2477
+
2478
+ /**
2479
+ * @description Parameters for specific_dates_schedule
2480
+
2481
+ */
2482
+
464
2483
  specific_dates_schedule?:{date?:number,id?:string,terms_to_charge?:number}[];
465
2484
  }
466
- export interface ListDiscountsResponse {
467
- list:{discount:Discount}[];
468
- next_offset?:string;
2485
+ export interface ListDiscountsResponse {
2486
+ /**
2487
+ * @description Returns a list of discounts currently attached to the subscription given by &#x60;{subscription_id}&#x60;. The list is sorted by date of creation, in descending order.
2488
+
2489
+ */
2490
+
2491
+ list:{discount:Discount}[];
2492
+
2493
+ /**
2494
+ * @description Returns a list of discounts currently attached to the subscription given by &#x60;{subscription_id}&#x60;. The list is sorted by date of creation, in descending order.
2495
+
2496
+ */
2497
+
2498
+ next_offset?:string;
469
2499
  }
470
2500
  export interface ListDiscountsInputParam {
471
- [key : string]: any;
2501
+ [key : string]: any;
2502
+ /**
2503
+ * @description The number of resources to be returned.
2504
+
2505
+ */
2506
+
472
2507
  limit?:number;
2508
+
2509
+ /**
2510
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
2511
+
2512
+ */
2513
+
473
2514
  offset?:string;
474
2515
  }
475
- export interface ContractTermsForSubscriptionResponse {
476
- list:{contract_term:ContractTerm}[];
477
- next_offset?:string;
2516
+ export interface ContractTermsForSubscriptionResponse {
2517
+ /**
2518
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
2519
+
2520
+ */
2521
+
2522
+ list:{contract_term:ContractTerm}[];
2523
+
2524
+ /**
2525
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
2526
+
2527
+ */
2528
+
2529
+ next_offset?:string;
478
2530
  }
479
2531
  export interface ContractTermsForSubscriptionInputParam {
480
- [key : string]: any;
2532
+ [key : string]: any;
2533
+ /**
2534
+ * @description The number of resources to be returned.
2535
+
2536
+ */
2537
+
481
2538
  limit?:number;
2539
+
2540
+ /**
2541
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
2542
+
2543
+ */
2544
+
482
2545
  offset?:string;
483
2546
  }
484
- export interface PauseResponse {
485
- subscription:Subscription;
486
- customer:Customer;
487
- card?:Card;
488
- invoice?:Invoice;
489
- unbilled_charges?:UnbilledCharge[];
490
- credit_notes?:CreditNote[];
2547
+ export interface PauseResponse {
2548
+ subscription:Subscription;
2549
+
2550
+ customer:Customer;
2551
+
2552
+ card?:Card;
2553
+
2554
+ invoice?:Invoice;
2555
+
2556
+ unbilled_charges?:UnbilledCharge[];
2557
+
2558
+ credit_notes?:CreditNote[];
491
2559
  }
492
2560
  export interface PauseInputParam {
2561
+
2562
+ /**
2563
+ * @description List of options to pause the subscription. \* billing_cycles -
2564
+
2565
+ Pause at the end of the current term, and resume automatically after the set number of billing cycles (in [skip_billing_cycles](/docs/api/subscriptions#pause_a_subscription_skip_billing_cycles)) have been skipped
2566
+ \* immediately - Pause immediately
2567
+ \* end_of_term - Pause at the end of current term
2568
+ \* specific_date - Pause on a specific date
2569
+
2570
+ */
2571
+
493
2572
  pause_option?:PauseOption;
2573
+
2574
+ /**
2575
+ * @description Date on which the subscription will be paused. Applicable when &#x60;specific_date&#x60; option is chosen in the [pause_option](/docs/api/subscriptions#pause_a_subscription_pause_option) field.
2576
+
2577
+ For non-renewing subscriptions, &#x60;pause_date&#x60; should be before the cancellation date.
2578
+
2579
+ */
2580
+
494
2581
  pause_date?:number;
2582
+
2583
+ /**
2584
+ * @description Applicable when unbilled charges are present for the subscription and [pause_option](/docs/api/subscriptions#pause_a_subscription_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;.
2585
+ \* invoice -
2586
+
2587
+ Invoice charges
2588
+
2589
+ 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.
2590
+ \* no_action -
2591
+
2592
+ Retain as unbilled
2593
+
2594
+ If &#x60;no_action&#x60; is chosen, charges are added to the resumption invoice.
2595
+
2596
+ */
2597
+
495
2598
  unbilled_charges_handling?:UnbilledChargesHandling;
2599
+
2600
+ /**
2601
+ * @description Handles dunning for invoices already in the dunning cycle when a subscription is paused. Applicable when [pause_option](/docs/api/subscriptions#pause_a_subscription_pause_option) is set as &#x60;immediately&#x60;.
2602
+
2603
+ If invoice is in the dunning cycle, &#x60;invoice_dunning_handing&#x60; allows you to &#x60;stop&#x60; or &#x60;continue&#x60; dunning.
2604
+ \* continue - Continue dunning \* stop - Stop dunning
2605
+
2606
+ */
2607
+
496
2608
  invoice_dunning_handling?:InvoiceDunningHandling;
2609
+
2610
+ /**
2611
+ * @description The number of subscription billing cycles that will be skipped. The subscription resumes after the set number of billing cycles have been skipped. This is applicable only when the value of of [pause_option](/docs/api/subscriptions#pause_a_subscription_pause_option) is &#x60;billing_cycles&#x60;.
2612
+
2613
+ */
2614
+
497
2615
  skip_billing_cycles?:number;
2616
+
2617
+ /**
2618
+ * @description For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.
2619
+
2620
+ For non-renewing subscriptions,&#x60;resume_date&#x60; should be before the cancellation date.
2621
+
2622
+ */
2623
+
498
2624
  resume_date?:number;
499
2625
  }
500
- export interface SubscriptionItem {
2626
+ export interface SubscriptionItem {
501
2627
  item_price_id?:string;
2628
+
502
2629
  item_type?:'charge' | 'addon' | 'plan';
2630
+
503
2631
  quantity?:number;
2632
+
504
2633
  quantity_in_decimal?:string;
2634
+
505
2635
  unit_price?:number;
2636
+
506
2637
  unit_price_in_decimal?:string;
2638
+
507
2639
  amount?:number;
2640
+
508
2641
  amount_in_decimal?:string;
2642
+
509
2643
  free_quantity?:number;
2644
+
510
2645
  free_quantity_in_decimal?:string;
2646
+
511
2647
  trial_end?:number;
2648
+
512
2649
  billing_cycles?:number;
2650
+
513
2651
  service_period_days?:number;
2652
+
514
2653
  charge_on_event?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation';
2654
+
515
2655
  charge_once?:boolean;
2656
+
516
2657
  charge_on_option?:'on_event' | 'immediately';
517
2658
  }
518
- export interface ItemTier {
2659
+ export interface ItemTier {
519
2660
  item_price_id?:string;
2661
+
520
2662
  starting_unit?:number;
2663
+
521
2664
  ending_unit?:number;
2665
+
522
2666
  price?:number;
2667
+
523
2668
  starting_unit_in_decimal?:string;
2669
+
524
2670
  ending_unit_in_decimal?:string;
2671
+
525
2672
  price_in_decimal?:string;
2673
+
526
2674
  index?:number;
527
2675
  }
528
- export interface ChargedItem {
2676
+ export interface ChargedItem {
529
2677
  item_price_id?:string;
2678
+
530
2679
  last_charged_at?:number;
531
2680
  }
532
- export interface Coupon {
2681
+ export interface Coupon {
533
2682
  coupon_id?:string;
2683
+
534
2684
  apply_till?:number;
2685
+
535
2686
  applied_count?:number;
2687
+
536
2688
  coupon_code?:string;
537
2689
  }
538
- export interface ShippingAddress {
2690
+ export interface ShippingAddress {
2691
+ /**
2692
+ * @description The first name of the contact.
2693
+
2694
+ */
2695
+
539
2696
  first_name?:string;
2697
+
2698
+ /**
2699
+ * @description The last name of the contact.
2700
+
2701
+ */
2702
+
540
2703
  last_name?:string;
2704
+
2705
+ /**
2706
+ * @description The email address.
2707
+
2708
+ */
2709
+
541
2710
  email?:string;
2711
+
2712
+ /**
2713
+ * @description The company name.
2714
+
2715
+ */
2716
+
542
2717
  company?:string;
2718
+
2719
+ /**
2720
+ * @description The phone number.
2721
+
2722
+ */
2723
+
543
2724
  phone?:string;
2725
+
2726
+ /**
2727
+ * @description Address line 1
2728
+
2729
+ */
2730
+
544
2731
  line1?:string;
2732
+
2733
+ /**
2734
+ * @description Address line 2
2735
+
2736
+ */
2737
+
545
2738
  line2?:string;
2739
+
2740
+ /**
2741
+ * @description Address line 3
2742
+
2743
+ */
2744
+
546
2745
  line3?:string;
2746
+
2747
+ /**
2748
+ * @description The name of the city.
2749
+
2750
+ */
2751
+
547
2752
  city?:string;
2753
+
2754
+ /**
2755
+ * @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
2756
+
2757
+ */
2758
+
548
2759
  state_code?:string;
2760
+
2761
+ /**
2762
+ * @description The state/province name.
2763
+
2764
+ */
2765
+
549
2766
  state?:string;
2767
+
2768
+ /**
2769
+ * @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
2770
+
2771
+ **Note** : If you enter an invalid country code, the system will return an error.
2772
+
2773
+ **Brexit**
2774
+
2775
+
2776
+ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
2777
+
2778
+ */
2779
+
550
2780
  country?:string;
2781
+
2782
+ /**
2783
+ * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
2784
+
2785
+ */
2786
+
551
2787
  zip?:string;
2788
+
2789
+ /**
2790
+ * @description The address verification status. \* not_validated - Address is not yet validated. \* valid - Address was validated successfully. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* invalid - Address is invalid.
2791
+
2792
+ */
2793
+
552
2794
  validation_status?:ValidationStatus;
2795
+
2796
+ /**
2797
+ * @description The index number of the subscription to which the item price is added. Provide a unique number between &#x60;0&#x60; and &#x60;4&#x60; (inclusive) for each subscription that is to be created.
2798
+
2799
+ */
2800
+
553
2801
  index?:number;
554
2802
  }
555
- export interface ReferralInfo {
2803
+ export interface ReferralInfo {
2804
+ /**
2805
+ * @description Referral code if available for the subscription
2806
+
2807
+ */
2808
+
556
2809
  referral_code?:string;
2810
+
2811
+ /**
2812
+ * @description Referral coupon code if available for the subscription
2813
+
2814
+ */
2815
+
557
2816
  coupon_code?:string;
2817
+
2818
+ /**
2819
+ * @description Referrer id if available for the subscription
2820
+
2821
+ */
2822
+
558
2823
  referrer_id?:string;
2824
+
2825
+ /**
2826
+ * @description External reference id in referral system for the subscription
2827
+
2828
+ */
2829
+
559
2830
  external_reference_id?:string;
2831
+
2832
+ /**
2833
+ * @description Reward status for the referral subscription \* paid - Paid \* invalid - Invalid \* pending - Pending
2834
+
2835
+ */
2836
+
560
2837
  reward_status?:'pending' | 'paid' | 'invalid';
2838
+
2839
+ /**
2840
+ * @description Source referral system for the referral subscription \* referral_saasquatch - Referral Saasquatch \* referral_candy - Referral Candy \* friendbuy - Friendbuy
2841
+
2842
+ */
2843
+
561
2844
  referral_system?:ReferralSystem;
2845
+
2846
+ /**
2847
+ * @description Referral account id
2848
+
2849
+ */
2850
+
562
2851
  account_id?:string;
2852
+
2853
+ /**
2854
+ * @description Referral campaign id
2855
+
2856
+ */
2857
+
563
2858
  campaign_id?:string;
2859
+
2860
+ /**
2861
+ * @description Referral external campaign id
2862
+
2863
+ */
2864
+
564
2865
  external_campaign_id?:string;
2866
+
2867
+ /**
2868
+ * @description Friend offer type for the referral camapign \* none - None \* coupon_code - Coupon Code \* coupon - Coupon
2869
+
2870
+ */
2871
+
565
2872
  friend_offer_type?:FriendOfferType;
2873
+
2874
+ /**
2875
+ * @description Referrer reward type for the referral campaign \* none - None \* custom_revenue_percent_based - Custom Revenue Percent Based \* referral_direct_reward - Referral Direct Reward \* custom_promotional_credit - Custom Promotional Credit
2876
+
2877
+ */
2878
+
566
2879
  referrer_reward_type?:ReferrerRewardType;
2880
+
2881
+ /**
2882
+ * @description Whether or not to notify the referral purchases to the referral system \* first_paid_conversion - First Paid Conversion \* none - None \* all_invoices - All Invoices
2883
+
2884
+ */
2885
+
567
2886
  notify_referral_system?:NotifyReferralSystem;
2887
+
2888
+ /**
2889
+ * @description Destination url for the referral campaign
2890
+
2891
+ */
2892
+
568
2893
  destination_url?:string;
2894
+
2895
+ /**
2896
+ * @description Whether post purchase widget is enabled for this campaign
2897
+
2898
+ */
2899
+
569
2900
  post_purchase_widget_enabled?:boolean;
570
2901
  }
571
- export interface ContractTerm {
2902
+ export interface ContractTerm {
2903
+ /**
2904
+ * @description Id that uniquely identifies the contract term in the site.
2905
+
2906
+ */
2907
+
572
2908
  id?:string;
2909
+
2910
+ /**
2911
+ * @description Current status of contract \* terminated - The contract term was terminated ahead of completion. \* completed - The contract term has run its full duration. \* active - An actively running contract term. \* cancelled - The contract term was ended because:
2912
+
2913
+ * a change in the subscription caused a [subscription term reset](subscriptions#update_a_subscription_force_term_reset).
2914
+ * the subscription was cancelled due to non-payment.
2915
+
2916
+ */
2917
+
573
2918
  status?:'active' | 'cancelled' | 'completed' | 'terminated';
2919
+
2920
+ /**
2921
+ * @description The start date of the contract term
2922
+
2923
+ */
2924
+
574
2925
  contract_start?:number;
2926
+
2927
+ /**
2928
+ * @description The end date of the contract term
2929
+
2930
+ */
2931
+
575
2932
  contract_end?:number;
2933
+
2934
+ /**
2935
+ * @description The number of billing cycles of the subscription that the contract term is for.
2936
+
2937
+ */
2938
+
576
2939
  billing_cycle?:number;
2940
+
2941
+ /**
2942
+ * @description Action to be taken when the contract term completes. \* renew_once - Used when you want to renew the contract term just once. Does the following:
2943
+ * Contract term completes and a new contract term is started for the number of billing cycles specified in [&#x60;contract_billing_cycle_on_renewal&#x60;](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
2944
+ * The &#x60;action_at_term_end&#x60; for the new contract term is set to &#x60;cancel&#x60;.
2945
+ \* cancel - Contract term completes and subscription is canceled. \* evergreen - Contract term completes and the subscription renews. \* renew -
2946
+ * Contract term completes and a new contract term is started for the number of billing cycles specified in [&#x60;contract_billing_cycle_on_renewal&#x60;](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
2947
+ * The &#x60;action_at_term_end&#x60; for the new contract term is set to &#x60;renew&#x60;.
2948
+
2949
+
2950
+ */
2951
+
577
2952
  action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen';
2953
+
2954
+ /**
2955
+ * @description The sum of the [totals](invoices#invoice_total) of all the invoices raised as part of the contract term. For &#x60;active&#x60; contract terms, this is a predicted value. The value depends on the [type of currency](./#handling_currency_units). If the subscription was [imported](#import_a_subscription) with the contract term, then this value includes the value passed for &#x60;total_amount_raised&#x60;.
2956
+
2957
+ */
2958
+
578
2959
  total_contract_value?:number;
2960
+
2961
+ /**
2962
+ * @description It refers to the total amount of revenue that is expected to be generated from a specific contract term, calculated as the sum of all invoices raised during the term, regardless of payment status. It is based on past performance and the specified currency in the contract. If the subscription was imported, the value for &#x60;total_amount_raised_before_tax&#x60; is included in the calculation of the total contract value before tax. It&#x27;s important to note that this value excludes any applicable taxes.
2963
+
2964
+ */
2965
+
579
2966
  total_contract_value_before_tax?:number;
2967
+
2968
+ /**
2969
+ * @description The number of days before [&#x60;contract_end&#x60;](contract_terms#contract_term_contract_end), during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
2970
+
2971
+ */
2972
+
580
2973
  cancellation_cutoff_period?:number;
2974
+
2975
+ /**
2976
+ * @description The date when the contract term was created.
2977
+
2978
+ */
2979
+
581
2980
  created_at?:number;
2981
+
2982
+ /**
2983
+ * @description The [Id](subscriptions#subscription_id) of the subscription that this contract term is for.
2984
+
2985
+ */
2986
+
582
2987
  subscription_id?:string;
2988
+
2989
+ /**
2990
+ * @description The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for &#x60;active&#x60; contract terms.
2991
+
2992
+ */
2993
+
583
2994
  remaining_billing_cycles?:number;
584
2995
  }
585
- export interface Discount {
2996
+ export interface Discount {
586
2997
  id?:string;
2998
+
587
2999
  invoice_name?:string;
3000
+
588
3001
  type?:'fixed_amount' | 'percentage';
3002
+
589
3003
  percentage?:number;
3004
+
590
3005
  amount?:number;
3006
+
591
3007
  currency_code?:string;
3008
+
592
3009
  duration_type?:'limited_period' | 'one_time' | 'forever';
3010
+
593
3011
  period?:number;
3012
+
594
3013
  period_unit?:'week' | 'month' | 'year' | 'day';
3014
+
595
3015
  included_in_mrr?:boolean;
3016
+
596
3017
  apply_on?:'specific_item_price' | 'invoice_amount';
3018
+
597
3019
  item_price_id?:string;
3020
+
598
3021
  created_at?:number;
3022
+
599
3023
  apply_till?:number;
3024
+
600
3025
  applied_count?:number;
3026
+
601
3027
  coupon_id?:string;
3028
+
602
3029
  index?:number;
603
3030
  }
604
3031
  }