chargebee 2.28.0 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +6 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  5. package/.github/workflows/greeting.yml +47 -0
  6. package/CHANGELOG.md +47 -0
  7. package/SECURITY.md +8 -0
  8. package/lib/chargebee.js +1 -1
  9. package/lib/resources/api_endpoints.js +0 -7
  10. package/package.json +1 -1
  11. package/types/core.d.ts +4 -4
  12. package/types/resources/AttachedItem.d.ts +88 -88
  13. package/types/resources/Card.d.ts +68 -68
  14. package/types/resources/Comment.d.ts +50 -44
  15. package/types/resources/Coupon.d.ts +242 -207
  16. package/types/resources/CouponSet.d.ts +72 -68
  17. package/types/resources/CreditNote.d.ts +612 -236
  18. package/types/resources/Customer.d.ts +655 -513
  19. package/types/resources/DifferentialPrice.d.ts +99 -74
  20. package/types/resources/EntitlementOverride.d.ts +27 -12
  21. package/types/resources/Estimate.d.ts +450 -450
  22. package/types/resources/Event.d.ts +30 -12
  23. package/types/resources/Export.d.ts +200 -200
  24. package/types/resources/Feature.d.ts +66 -35
  25. package/types/resources/Gift.d.ts +54 -44
  26. package/types/resources/HostedPage.d.ts +381 -381
  27. package/types/resources/InAppSubscription.d.ts +94 -90
  28. package/types/resources/Invoice.d.ts +1242 -660
  29. package/types/resources/Item.d.ts +148 -142
  30. package/types/resources/ItemEntitlement.d.ts +36 -36
  31. package/types/resources/ItemFamily.d.ts +45 -45
  32. package/types/resources/ItemPrice.d.ts +317 -273
  33. package/types/resources/PaymentIntent.d.ts +60 -60
  34. package/types/resources/PaymentVoucher.d.ts +74 -59
  35. package/types/resources/PortalSession.d.ts +45 -20
  36. package/types/resources/PromotionalCredit.d.ts +68 -68
  37. package/types/resources/Purchase.d.ts +3 -3
  38. package/types/resources/Quote.d.ts +652 -363
  39. package/types/resources/QuoteLineGroup.d.ts +245 -0
  40. package/types/resources/QuotedCharge.d.ts +170 -0
  41. package/types/resources/QuotedSubscription.d.ts +219 -0
  42. package/types/resources/SiteMigrationDetail.d.ts +7 -7
  43. package/types/resources/Subscription.d.ts +1219 -932
  44. package/types/resources/SubscriptionEntitlement.d.ts +33 -12
  45. package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
  46. package/types/resources/TimeMachine.d.ts +15 -15
  47. package/types/resources/Token.d.ts +23 -23
  48. package/types/resources/Transaction.d.ts +229 -112
  49. package/types/resources/UnbilledCharge.d.ts +112 -67
  50. package/types/resources/Usage.d.ts +46 -47
  51. package/types/resources/VirtualBankAccount.d.ts +66 -66
@@ -302,7 +302,9 @@ declare module 'chargebee' {
302
302
  invoice_notes?:string;
303
303
 
304
304
  /**
305
- * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./advanced-features#meta_data).
305
+ * @description A collection of key-value pairs that provides extra information about the subscription.
306
+ **Note:** There's a character limit of 65,535.
307
+ [Learn more](advanced-features#metadata).
306
308
 
307
309
  */
308
310
 
@@ -430,144 +432,111 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
430
432
  export namespace Subscription {
431
433
  export class SubscriptionResource {
432
434
  /**
433
- * @description Deletes an advance invoicing schedule. When *schedule_type = specific_dates*, you also have the option of deleting a part of the schedule.
435
+ * @description **Note:** This endpoint optionally supports 3DS. To use it [create](./payment_intents?prod_cat_ver=2#create_a_payment_intent) a `payment_intent` and provide it via this endpoint.
436
+
437
+ Creates a new subscription for an existing customer in Chargebee. Any available [credits and excess payments](./customers?prod_cat_ver=2#customer_balances) for the customer are automatically applied on the invoice.
438
+ **See also**
439
+
440
+ * [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.
434
441
 
435
442
  */
436
443
 
437
- remove_advance_invoice_schedule(subscription_id:string, input?:RemoveAdvanceInvoiceScheduleInputParam):ChargebeeRequest<RemoveAdvanceInvoiceScheduleResponse>;
444
+ create_with_items(customer_id:string, input?:CreateWithItemsInputParam):ChargebeeRequest<CreateWithItemsResponse>;
438
445
 
439
446
  /**
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.
447
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
443
448
 
444
449
  */
445
450
 
446
- update_for_items(subscription_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
451
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
447
452
 
448
453
  /**
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.
454
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
450
455
 
451
456
  */
452
457
 
453
- remove_coupons(subscription_id:string, input?:RemoveCouponsInputParam):ChargebeeRequest<RemoveCouponsResponse>;
458
+ contract_terms_for_subscription(subscription_id:string, input?:ContractTermsForSubscriptionInputParam):ChargebeeRequest<ContractTermsForSubscriptionResponse>;
454
459
 
455
460
  /**
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.
461
+ * @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.
476
462
 
477
463
  */
478
464
 
479
- resume(subscription_id:string, input?:ResumeInputParam):ChargebeeRequest<ResumeResponse>;
465
+ list_discounts(subscription_id:string, input?:ListDiscountsInputParam):ChargebeeRequest<ListDiscountsResponse>;
480
466
 
481
467
  /**
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;.
468
+ * @description Retrieves a subscription.
496
469
 
497
470
  */
498
471
 
499
- cancel_for_items(subscription_id:string, input?:CancelForItemsInputParam):ChargebeeRequest<CancelForItemsResponse>;
472
+ retrieve(subscription_id:string):ChargebeeRequest<RetrieveResponse>;
500
473
 
501
474
  /**
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.
475
+ * @description Retrieves a subscription with the scheduled changes applied.
476
+ **Note:** Only the following attributes are changed
503
477
 
504
- #### prerequisites
478
+ * item_id
479
+ * item_price_id
480
+ * billing_period
481
+ * billing_period_unit
482
+ * remaining_billing_cycles
483
+ * coupons
484
+
485
+ Other attributes such as **status** ,**next_billing_at** are not changed and will reflect the current subscription values.
505
486
 
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
487
 
512
- #### deleting an invoice
513
488
 
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
489
 
516
490
  */
517
491
 
518
- regenerate_invoice(subscription_id:string, input?:RegenerateInvoiceInputParam):ChargebeeRequest<RegenerateInvoiceResponse>;
492
+ retrieve_with_scheduled_changes(subscription_id:string):ChargebeeRequest<RetrieveWithScheduledChangesResponse>;
519
493
 
520
494
  /**
521
- * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
495
+ * @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.
522
496
 
523
497
  */
524
498
 
525
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
499
+ remove_scheduled_changes(subscription_id:string):ChargebeeRequest<RemoveScheduledChangesResponse>;
526
500
 
527
501
  /**
528
- * @description Imports a subscription into Chargebee.
502
+ * @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;.)
503
+
504
+ 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.
505
+
506
+ 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.
529
507
 
530
508
  */
531
509
 
532
- import_for_items(customer_id:string, input:ImportForItemsInputParam):ChargebeeRequest<ImportForItemsResponse>;
510
+ remove_scheduled_cancellation(subscription_id:string, input?:RemoveScheduledCancellationInputParam):ChargebeeRequest<RemoveScheduledCancellationResponse>;
533
511
 
534
512
  /**
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.
513
+ * @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.
536
514
 
537
515
  */
538
516
 
539
- retrieve_advance_invoice_schedule(subscription_id:string):ChargebeeRequest<RetrieveAdvanceInvoiceScheduleResponse>;
517
+ remove_coupons(subscription_id:string, input?:RemoveCouponsInputParam):ChargebeeRequest<RemoveCouponsResponse>;
540
518
 
541
519
  /**
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.
520
+ * @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.
545
521
 
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.
522
+ 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.
547
523
 
548
524
  */
549
525
 
550
- remove_scheduled_cancellation(subscription_id:string, input?:RemoveScheduledCancellationInputParam):ChargebeeRequest<RemoveScheduledCancellationResponse>;
526
+ update_for_items(subscription_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
551
527
 
552
528
  /**
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
-
529
+ * @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.
565
530
 
531
+ * If the Subscription is in **trial**, it affects trial end date.
532
+ * If the Subscription is **active**, it affects the next billing date.
533
+ * If the Subscription&#x27;s status is **non_renewing**, this affects the upcoming cancellation date.
566
534
 
535
+ **Tip**: To cycle through a couple of billing cycles and test webhooks, you may use this API.
567
536
 
568
537
  */
569
538
 
570
- retrieve_with_scheduled_changes(subscription_id:string):ChargebeeRequest<RetrieveWithScheduledChangesResponse>;
539
+ change_term_end(subscription_id:string, input:ChangeTermEndInputParam):ChargebeeRequest<ChangeTermEndResponse>;
571
540
 
572
541
  /**
573
542
  * @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.
@@ -597,13 +566,6 @@ When dunning (payment failure retry settings) is configured with the last retry
597
566
 
598
567
  reactivate(subscription_id:string, input?:ReactivateInputParam):ChargebeeRequest<ReactivateResponse>;
599
568
 
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
-
605
- charge_future_renewals(subscription_id:string, input?:ChargeFutureRenewalsInputParam):ChargebeeRequest<ChargeFutureRenewalsResponse>;
606
-
607
569
  /**
608
570
  * @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
571
 
@@ -614,64 +576,51 @@ To collect a charge immediately, [use this API](/docs/api/invoices#create_invoic
614
576
  add_charge_at_term_end(subscription_id:string, input:AddChargeAtTermEndInputParam):ChargebeeRequest<AddChargeAtTermEndResponse>;
615
577
 
616
578
  /**
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.
579
+ * @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.
618
580
 
619
581
  */
620
582
 
621
- remove_scheduled_changes(subscription_id:string):ChargebeeRequest<RemoveScheduledChangesResponse>;
583
+ charge_future_renewals(subscription_id:string, input?:ChargeFutureRenewalsInputParam):ChargebeeRequest<ChargeFutureRenewalsResponse>;
622
584
 
623
585
  /**
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.
586
+ * @description Modifies the [advance invoicing schedule](advance_invoice_schedules#advance_invoice_schedule) for a subscription.
631
587
 
632
588
  */
633
589
 
634
- change_term_end(subscription_id:string, input:ChangeTermEndInputParam):ChargebeeRequest<ChangeTermEndResponse>;
590
+ edit_advance_invoice_schedule(subscription_id:string, input?:EditAdvanceInvoiceScheduleInputParam):ChargebeeRequest<EditAdvanceInvoiceScheduleResponse>;
635
591
 
636
592
  /**
637
- * @description Deletes the subscription resource.
593
+ * @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.
638
594
 
639
595
  */
640
596
 
641
- delete(subscription_id:string):ChargebeeRequest<DeleteResponse>;
597
+ retrieve_advance_invoice_schedule(subscription_id:string):ChargebeeRequest<RetrieveAdvanceInvoiceScheduleResponse>;
642
598
 
643
599
  /**
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.
600
+ * @description Deletes an advance invoicing schedule. When *schedule_type &#x3D; specific_dates*, you also have the option of deleting a part of the schedule.
650
601
 
651
602
  */
652
603
 
653
- create_with_items(customer_id:string, input?:CreateWithItemsInputParam):ChargebeeRequest<CreateWithItemsResponse>;
604
+ remove_advance_invoice_schedule(subscription_id:string, input?:RemoveAdvanceInvoiceScheduleInputParam):ChargebeeRequest<RemoveAdvanceInvoiceScheduleResponse>;
654
605
 
655
606
  /**
656
- * @description Imports unbilled charges into Chargebee.
607
+ * @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.
657
608
 
658
- */
659
-
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**.
609
+ #### prerequisites
664
610
 
665
- */
666
-
667
- remove_scheduled_resumption(subscription_id:string):ChargebeeRequest<RemoveScheduledResumptionResponse>;
668
-
669
- /**
670
- * @description Retrieves a subscription.
611
+ * 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).
612
+ * The subscription &#x60;status&#x60; must be &#x60;active&#x60; or &#x60;non_renewing&#x60;.
613
+ * 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.
614
+ * There should be no [unbilled charges](/docs/api/unbilled_charges?prod_cat_ver&#x3D;2) for &#x60;metered&#x60; items for the previous term.
615
+ * 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).
616
+
617
+ #### deleting an invoice
618
+
619
+ 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.
671
620
 
672
621
  */
673
622
 
674
- retrieve(subscription_id:string):ChargebeeRequest<RetrieveResponse>;
623
+ regenerate_invoice(subscription_id:string, input?:RegenerateInvoiceInputParam):ChargebeeRequest<RegenerateInvoiceResponse>;
675
624
 
676
625
  /**
677
626
  * @description Import previous and active [contract terms](./contract_terms).
@@ -683,39 +632,32 @@ For contract terms in &#x60;active&#x60; state, import is allowed only if the as
683
632
  import_contract_term(subscription_id:string, input?:ImportContractTermInputParam):ChargebeeRequest<ImportContractTermResponse>;
684
633
 
685
634
  /**
686
- * @description Assigns the payment source and sets auto collection state for the subscription.
687
-
688
- */
689
-
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.
635
+ * @description Imports unbilled charges into Chargebee.
694
636
 
695
637
  */
696
638
 
697
- remove_scheduled_pause(subscription_id:string):ChargebeeRequest<RemoveScheduledPauseResponse>;
639
+ import_unbilled_charges(subscription_id:string, input?:ImportUnbilledChargesInputParam):ChargebeeRequest<ImportUnbilledChargesResponse>;
698
640
 
699
641
  /**
700
- * @description Modifies the [advance invoicing schedule](advance_invoice_schedules#advance_invoice_schedule) for a subscription.
642
+ * @description Imports a subscription into Chargebee.
701
643
 
702
644
  */
703
645
 
704
- edit_advance_invoice_schedule(subscription_id:string, input?:EditAdvanceInvoiceScheduleInputParam):ChargebeeRequest<EditAdvanceInvoiceScheduleResponse>;
646
+ import_for_items(customer_id:string, input:ImportForItemsInputParam):ChargebeeRequest<ImportForItemsResponse>;
705
647
 
706
648
  /**
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.
649
+ * @description Assigns the payment source and sets auto collection state for the subscription.
708
650
 
709
651
  */
710
652
 
711
- list_discounts(subscription_id:string, input?:ListDiscountsInputParam):ChargebeeRequest<ListDiscountsResponse>;
653
+ override_billing_profile(subscription_id:string, input?:OverrideBillingProfileInputParam):ChargebeeRequest<OverrideBillingProfileResponse>;
712
654
 
713
655
  /**
714
- * @description Retrieves a list of contract term resources for the subscription specified in the path.
656
+ * @description Deletes the subscription resource.
715
657
 
716
658
  */
717
659
 
718
- contract_terms_for_subscription(subscription_id:string, input?:ContractTermsForSubscriptionInputParam):ChargebeeRequest<ContractTermsForSubscriptionResponse>;
660
+ delete(subscription_id:string):ChargebeeRequest<DeleteResponse>;
719
661
 
720
662
  /**
721
663
  * @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.
@@ -731,123 +673,141 @@ For contract terms in &#x60;active&#x60; state, import is allowed only if the as
731
673
  */
732
674
 
733
675
  pause(subscription_id:string, input?:PauseInputParam):ChargebeeRequest<PauseResponse>;
734
- }
735
- export interface RemoveAdvanceInvoiceScheduleResponse {
736
- subscription:Subscription;
737
-
738
- advance_invoice_schedules?:AdvanceInvoiceSchedule[];
739
- }
740
- export interface RemoveAdvanceInvoiceScheduleInputParam {
741
676
 
742
677
  /**
743
- * @description Parameters for specific_dates_schedule
678
+ * @description Cancels the subscription.
744
679
 
745
- */
746
-
747
- specific_dates_schedule?:{id?:string}[];
748
- }
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[];
761
- }
762
- export interface UpdateForItemsInputParam {
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.
680
+ #### Canceling contract terms
681
+
682
+ * 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).
683
+ * 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).
684
+ * &#x60;credit_option_for_current_term_charges&#x60;
685
+ * &#x60;unbilled_charges_option&#x60;
686
+ * &#x60;account_receivables_handling&#x60;
687
+ * &#x60;refundable_credits_handling&#x60;
688
+ * 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.
689
+ * 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:
690
+ * &#x60;contract_term_cancel_option&#x60; must be set to &#x60;terminate_now&#x60;.
691
+ * 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;.
766
692
 
767
693
  */
768
-
769
- mandatory_items_to_remove?:string[];
694
+
695
+ cancel_for_items(subscription_id:string, input?:CancelForItemsInputParam):ChargebeeRequest<CancelForItemsResponse>;
770
696
 
771
697
  /**
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.
698
+ * @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.
773
699
 
774
- */
775
-
776
- replace_items_list?:boolean;
700
+ This API is used to resume a **paused** subscription. On resumption the subscription will be activated and any applicable charges will be initiated.
701
+
702
+ 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.
703
+
704
+ For in-term resumption, unless there are scheduled changes, unbilled charges will not be charged.
705
+
706
+ **What is an &quot;in-term resumption&quot;?**
707
+ An &quot;in-term resumption&quot; is when the pause and resumption happens within the billing term of the subscription.
708
+
709
+ **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.
710
+
711
+ #### UNPAID INVOICES
712
+
713
+ 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.
714
+
715
+ 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.
716
+
717
+ **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.
718
+
719
+ */
720
+
721
+ resume(subscription_id:string, input?:ResumeInputParam):ChargebeeRequest<ResumeResponse>;
777
722
 
778
723
  /**
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.
724
+ * @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.
780
725
 
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
- .
726
+ */
727
+
728
+ remove_scheduled_pause(subscription_id:string):ChargebeeRequest<RemoveScheduledPauseResponse>;
729
+
730
+ /**
731
+ * @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**.
785
732
 
786
733
  */
734
+
735
+ remove_scheduled_resumption(subscription_id:string):ChargebeeRequest<RemoveScheduledResumptionResponse>;
736
+ }
737
+ export interface CreateWithItemsResponse {
738
+ subscription:Subscription;
787
739
 
788
- net_term_days?:number;
740
+ customer:Customer;
741
+
742
+ card?:Card;
789
743
 
744
+ invoice?:Invoice;
745
+
746
+ unbilled_charges?:UnbilledCharge[];
747
+ }
748
+ export interface CreateWithItemsInputParam {
749
+ [key : string] : any;
790
750
  /**
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
- .
751
+ * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
798
752
 
799
753
  */
800
754
 
801
- invoice_date?:number;
755
+ id?:string;
802
756
 
803
757
  /**
804
- * @description The new start date of a &#x60;future&#x60; subscription. Applicable only for &#x60;future&#x60; subscriptions.
758
+ * @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.
759
+ **Note**
760
+
761
+ 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).
762
+ .
805
763
 
806
764
  */
807
765
 
808
- start_date?:number;
766
+ business_entity_id?:string;
809
767
 
810
768
  /**
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.
769
+ * @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.
812
770
 
813
771
  */
814
772
 
815
773
  trial_end?:number;
816
774
 
817
775
  /**
818
- * @description Billing cycles set for plan-item price is used by default.
776
+ * @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.
819
777
 
820
778
  */
821
779
 
822
780
  billing_cycles?:number;
823
781
 
824
782
  /**
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.
783
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
826
784
 
827
785
  */
828
786
 
829
- terms_to_charge?:number;
787
+ mandatory_items_to_remove?:string[];
830
788
 
831
789
  /**
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:
790
+ * @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.
834
791
 
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.
792
+ * 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).
793
+ * 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.
839
794
  .
840
795
 
841
796
  */
842
797
 
843
- reactivate_from?:number;
798
+ net_term_days?:number;
844
799
 
845
800
  /**
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.
801
+ * @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:
802
+
803
+ * Backdating is enabled for subscription creation operations.
804
+ * 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.
805
+ * 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.
806
+ .
847
807
 
848
808
  */
849
809
 
850
- billing_alignment_mode?:BillingAlignmentMode;
810
+ start_date?:number;
851
811
 
852
812
  /**
853
813
  * @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.
@@ -857,90 +817,71 @@ For contract terms in &#x60;active&#x60; state, import is allowed only if the as
857
817
  auto_collection?:AutoCollection;
858
818
 
859
819
  /**
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
-
864
- offline_payment_method?:OfflinePaymentMethod;
865
-
866
- /**
867
- * @description Purchase order number for this subscription.
820
+ * @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
868
821
 
869
822
  */
870
823
 
871
- po_number?:string;
824
+ terms_to_charge?:number;
872
825
 
873
826
  /**
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.
827
+ * @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.
875
828
 
876
829
  */
877
830
 
878
- coupon_ids?:string[];
831
+ billing_alignment_mode?:BillingAlignmentMode;
879
832
 
880
833
  /**
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;.
834
+ * @description Purchase order number for this subscription.
882
835
 
883
836
  */
884
837
 
885
- replace_coupon_list?:boolean;
838
+ po_number?:string;
886
839
 
887
840
  /**
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.
841
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
901
842
 
902
843
  */
903
844
 
904
- prorate?:boolean;
845
+ coupon_ids?:string[];
905
846
 
906
847
  /**
907
- * @description Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
848
+ * @description Id of the payment source to be attached to this subscription.
908
849
 
909
850
  */
910
851
 
911
- end_of_term?:boolean;
852
+ payment_source_id?:string;
912
853
 
913
854
  /**
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.
855
+ * @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.
916
856
 
917
857
  */
918
858
 
919
- force_term_reset?:boolean;
859
+ override_relationship?:boolean;
920
860
 
921
861
  /**
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.
862
+ * @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.
923
863
 
924
864
  */
925
865
 
926
- reactivate?:boolean;
866
+ invoice_notes?:string;
927
867
 
928
868
  /**
929
- * @description The Chargebee payment token generated by Chargebee JS.
869
+ * @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:
930
870
 
931
- */
932
-
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.
871
+ * &#x60;invoice_date&#x60; must be in the past.
872
+ * It is not earlier than &#x60;start_date&#x60;.
873
+ * 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.
874
+ * &#x60;invoice_immediately&#x60; is true.
875
+ .
937
876
 
938
877
  */
939
878
 
940
- invoice_notes?:string;
879
+ invoice_date?:number;
941
880
 
942
881
  /**
943
- * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./advanced-features#meta_data).
882
+ * @description A collection of key-value pairs that provides extra information about the subscription.
883
+ **Note:** There&#x27;s a character limit of 65,535.
884
+ [Learn more](advanced-features?prod_cat_ver&#x3D;2#metadata).
944
885
 
945
886
  */
946
887
 
@@ -955,38 +896,25 @@ An immediate previous change was made
955
896
  invoice_immediately?:boolean;
956
897
 
957
898
  /**
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.
899
+ * @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.
959
900
 
960
901
  */
961
902
 
962
- override_relationship?:boolean;
903
+ replace_primary_payment_source?:boolean;
963
904
 
964
905
  /**
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
- .
906
+ * @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.
979
907
 
980
908
  */
981
909
 
982
- changes_scheduled_at?:number;
910
+ free_period?:number;
983
911
 
984
912
  /**
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.
913
+ * @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)
986
914
 
987
915
  */
988
916
 
989
- change_option?:ChangeOption;
917
+ free_period_unit?:FreePeriodUnit;
990
918
 
991
919
  /**
992
920
  * @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).
@@ -995,20 +923,6 @@ An immediate previous change was made
995
923
 
996
924
  contract_term_billing_cycle_on_renewal?:number;
997
925
 
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
-
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
-
1010
- free_period_unit?:FreePeriodUnit;
1011
-
1012
926
  /**
1013
927
  * @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
928
 
@@ -1032,67 +946,61 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1032
946
  auto_close_invoices?:boolean;
1033
947
 
1034
948
  /**
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.
949
+ * @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.
1036
950
 
1037
- */
1038
-
1039
- trial_end_action?:TrialEndAction;
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
951
+ 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;
952
+ .
1043
953
 
1044
954
  */
1045
955
 
1046
- payment_initiator?:PaymentInitiator;
956
+ first_invoice_pending?:boolean;
1047
957
 
1048
958
  /**
1049
- * @description Parameters for card
959
+ * @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.
1050
960
 
1051
961
  */
1052
962
 
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};
963
+ trial_end_action?:TrialEndAction;
1054
964
 
1055
965
  /**
1056
- * @description Parameters for payment_method
966
+ * @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
1057
967
 
1058
968
  */
1059
969
 
1060
- payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
970
+ payment_initiator?:PaymentInitiator;
1061
971
 
1062
972
  /**
1063
- * @description Parameters for payment_intent
973
+ * @description Parameters for shipping_address
1064
974
 
1065
975
  */
1066
976
 
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};
977
+ 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};
1068
978
 
1069
979
  /**
1070
- * @description Parameters for billing_address
980
+ * @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.
1071
981
 
1072
- */
1073
-
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
982
+ 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.
983
+ **See also**
984
+
985
+ * [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.
1078
986
 
1079
987
  */
1080
988
 
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};
989
+ statement_descriptor?:{additional_info?:string,descriptor?:string};
1082
990
 
1083
991
  /**
1084
- * @description Parameters for customer
992
+ * @description Parameters for payment_intent
1085
993
 
1086
994
  */
1087
995
 
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};
996
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
1089
997
 
1090
998
  /**
1091
999
  * @description Parameters for contract_term
1092
1000
 
1093
1001
  */
1094
1002
 
1095
- contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1003
+ contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1096
1004
 
1097
1005
  /**
1098
1006
  * @description Parameters for subscription_items
@@ -1106,7 +1014,7 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1106
1014
 
1107
1015
  */
1108
1016
 
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}[];
1017
+ discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
1110
1018
 
1111
1019
  /**
1112
1020
  * @description Parameters for item_tiers
@@ -1115,457 +1023,406 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1115
1023
 
1116
1024
  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}[];
1117
1025
  }
1118
- export interface RemoveCouponsResponse {
1119
- subscription:Subscription;
1120
-
1121
- customer:Customer;
1026
+ export interface ListResponse {
1027
+ /**
1028
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1029
+
1030
+ */
1122
1031
 
1123
- card?:Card;
1124
- }
1125
- export interface RemoveCouponsInputParam {
1032
+ list:{subscription:Subscription,customer:Customer,card?:Card}[];
1126
1033
 
1127
1034
  /**
1128
- * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
1035
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1129
1036
 
1130
1037
  */
1131
1038
 
1132
- coupon_ids?:string[];
1133
- }
1134
- export interface ResumeResponse {
1135
- subscription:Subscription;
1136
-
1137
- customer:Customer;
1138
-
1139
- card?:Card;
1140
-
1141
- invoice?:Invoice;
1142
-
1143
- unbilled_charges?:UnbilledCharge[];
1144
- }
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
-
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
-
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
-
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
-
1173
- unpaid_invoices_handling?:UnpaidInvoicesHandling;
1174
-
1175
- /**
1176
- * @description null
1177
-
1178
- */
1179
-
1180
- payment_initiator?:PaymentInitiator;
1181
-
1182
- /**
1183
- * @description Parameters for payment_intent
1184
-
1185
- */
1186
-
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};
1188
- }
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[];
1039
+ next_offset?:string;
1201
1040
  }
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
-
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
-
1225
- cancel_at?:number;
1226
-
1041
+ export interface ListInputParam {
1042
+ [key : string]: any;
1227
1043
  /**
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.
1044
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1229
1045
 
1230
1046
  */
1231
-
1232
- credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
1047
+
1048
+ limit?:number;
1233
1049
 
1234
1050
  /**
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.
1051
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1236
1052
 
1237
1053
  */
1238
-
1239
- unbilled_charges_option?:UnbilledChargesOption;
1054
+
1055
+ offset?:string;
1240
1056
 
1241
1057
  /**
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;.
1058
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1243
1059
 
1244
1060
  */
1245
-
1246
- account_receivables_handling?:AccountReceivablesHandling;
1061
+
1062
+ include_deleted?:boolean;
1247
1063
 
1248
1064
  /**
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.
1065
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1250
1066
 
1251
1067
  */
1252
-
1253
- refundable_credits_handling?:RefundableCreditsHandling;
1068
+
1069
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1254
1070
 
1255
1071
  /**
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
1072
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1264
1073
 
1265
1074
  */
1266
-
1267
- contract_term_cancel_option?:ContractTermCancelOption;
1075
+
1076
+ customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1268
1077
 
1269
1078
  /**
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
- .
1079
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1276
1080
 
1277
1081
  */
1278
-
1279
- invoice_date?:number;
1082
+
1083
+ item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1280
1084
 
1281
1085
  /**
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.
1086
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1283
1087
 
1284
1088
  */
1285
-
1286
- cancel_reason_code?:string;
1089
+
1090
+ item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1287
1091
 
1288
1092
  /**
1289
- * @description Parameters for subscription_items
1093
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1290
1094
 
1291
1095
  */
1292
-
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}[];
1294
- }
1295
- export interface RegenerateInvoiceResponse {
1296
- invoice?:Invoice;
1297
-
1298
- unbilled_charges?:UnbilledCharge[];
1299
- }
1300
- export interface RegenerateInvoiceInputParam {
1096
+
1097
+ 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};
1301
1098
 
1302
1099
  /**
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 ).
1100
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1304
1101
 
1305
1102
  */
1306
-
1307
- date_from?:number;
1103
+
1104
+ 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};
1308
1105
 
1309
1106
  /**
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 ).
1107
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1311
1108
 
1312
1109
  */
1313
-
1314
- date_to?:number;
1110
+
1111
+ cancel_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1315
1112
 
1316
1113
  /**
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;.
1114
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1318
1115
 
1319
1116
  */
1320
-
1321
- prorate?:boolean;
1117
+
1118
+ remaining_billing_cycles?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,is_present?:'true' | 'false',lt?:string,lte?:string};
1322
1119
 
1323
1120
  /**
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.
1121
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1325
1122
 
1326
1123
  */
1124
+
1125
+ created_at?:{after?:string,before?:string,between?:string,on?:string};
1327
1126
 
1328
- invoice_immediately?:boolean;
1329
- }
1330
- export interface ListResponse {
1331
1127
  /**
1332
1128
  * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1333
1129
 
1334
1130
  */
1335
-
1336
- list:{subscription:Subscription,customer:Customer,card?:Card}[];
1131
+
1132
+ activated_at?:{after?:string,before?:string,between?:string,is_present?:'true' | 'false',on?:string};
1337
1133
 
1338
1134
  /**
1339
1135
  * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1340
1136
 
1341
1137
  */
1138
+
1139
+ next_billing_at?:{after?:string,before?:string,between?:string,on?:string};
1342
1140
 
1343
- next_offset?:string;
1344
- }
1345
- export interface ListInputParam {
1346
- [key : string]: any;
1347
1141
  /**
1348
- * @description The number of resources to be returned.
1142
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1349
1143
 
1350
1144
  */
1351
1145
 
1352
- limit?:number;
1146
+ cancelled_at?:{after?:string,before?:string,between?:string,on?:string};
1353
1147
 
1354
1148
  /**
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.
1149
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1356
1150
 
1357
1151
  */
1358
1152
 
1359
- offset?:string;
1153
+ has_scheduled_changes?:{is?:'true' | 'false'};
1360
1154
 
1361
1155
  /**
1362
- * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
1156
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1363
1157
 
1364
1158
  */
1365
1159
 
1366
- include_deleted?:boolean;
1160
+ updated_at?:{after?:string,before?:string,between?:string,on?:string};
1367
1161
 
1368
1162
  /**
1369
- * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
1163
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1370
1164
 
1371
1165
  */
1372
1166
 
1373
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1167
+ 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};
1374
1168
 
1375
1169
  /**
1376
- * @description Identifier of the customer with whom this subscription is associated.
1170
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1377
1171
 
1378
1172
  */
1379
1173
 
1380
- customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1174
+ auto_close_invoices?:{is?:'true' | 'false'};
1381
1175
 
1382
1176
  /**
1383
- * @description Identifier of the plan for this subscription
1177
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1384
1178
 
1385
1179
  */
1386
1180
 
1387
- plan_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1181
+ override_relationship?:{is?:'true' | 'false'};
1388
1182
 
1389
1183
  /**
1390
- * @description The plan item code
1184
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1391
1185
 
1392
1186
  */
1393
1187
 
1394
- item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1188
+ sort_by?:{asc?:'updated_at' | 'created_at',desc?:'updated_at' | 'created_at'};
1395
1189
 
1396
1190
  /**
1397
- * @description The plan item price code
1191
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1398
1192
 
1399
1193
  */
1400
1194
 
1401
- item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1195
+ business_entity_id?:{is?:string,is_not?:string,starts_with?:string};
1402
1196
 
1403
1197
  /**
1404
- * @description Current state of the subscription
1198
+ * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1405
1199
 
1406
1200
  */
1407
1201
 
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
-
1202
+ channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
1203
+ }
1204
+ export interface ContractTermsForSubscriptionResponse {
1410
1205
  /**
1411
- * @description The reason for canceling the subscription. Set by Chargebee automatically.
1206
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
1412
1207
 
1413
1208
  */
1414
-
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};
1209
+
1210
+ list:{contract_term:ContractTerm}[];
1416
1211
 
1417
1212
  /**
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
1213
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
1419
1214
 
1420
1215
  */
1421
-
1422
- cancel_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1423
1216
 
1217
+ next_offset?:string;
1218
+ }
1219
+ export interface ContractTermsForSubscriptionInputParam {
1220
+ [key : string]: any;
1424
1221
  /**
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.
1222
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
1427
1223
 
1428
1224
  */
1429
1225
 
1430
- remaining_billing_cycles?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,is_present?:'true' | 'false',lt?:string,lte?:string};
1226
+ limit?:number;
1431
1227
 
1432
1228
  /**
1433
- * @description The time at which the subscription was created.
1229
+ * @description Retrieves a list of contract term resources for the subscription specified in the path.
1434
1230
 
1435
1231
  */
1436
1232
 
1437
- created_at?:{after?:string,before?:string,between?:string,on?:string};
1438
-
1233
+ offset?:string;
1234
+ }
1235
+ export interface ListDiscountsResponse {
1439
1236
  /**
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.
1237
+ * @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.
1441
1238
 
1442
1239
  */
1443
-
1444
- activated_at?:{after?:string,before?:string,between?:string,is_present?:'true' | 'false',on?:string};
1240
+
1241
+ list:{discount:Discount}[];
1445
1242
 
1446
1243
  /**
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.
1244
+ * @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.
1448
1245
 
1449
1246
  */
1450
-
1451
- next_billing_at?:{after?:string,before?:string,between?:string,on?:string};
1452
1247
 
1248
+ next_offset?:string;
1249
+ }
1250
+ export interface ListDiscountsInputParam {
1251
+ [key : string]: any;
1453
1252
  /**
1454
- * @description Time at which subscription was cancelled or is set to be cancelled.
1253
+ * @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.
1455
1254
 
1456
1255
  */
1457
1256
 
1458
- cancelled_at?:{after?:string,before?:string,between?:string,on?:string};
1257
+ limit?:number;
1459
1258
 
1460
1259
  /**
1461
- * @description If &#x60;true&#x60;, there are subscription changes scheduled on next renewal.
1260
+ * @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.
1462
1261
 
1463
1262
  */
1464
1263
 
1465
- has_scheduled_changes?:{is?:'true' | 'false'};
1264
+ offset?:string;
1265
+ }
1266
+ export interface RetrieveResponse {
1267
+ subscription:Subscription;
1268
+
1269
+ customer:Customer;
1270
+
1271
+ card?:Card;
1272
+ }
1273
+
1274
+ export interface RetrieveWithScheduledChangesResponse {
1275
+ subscription:Subscription;
1276
+
1277
+ customer:Customer;
1278
+
1279
+ card?:Card;
1280
+ }
1281
+
1282
+ export interface RemoveScheduledChangesResponse {
1283
+ subscription:Subscription;
1284
+
1285
+ customer:Customer;
1286
+
1287
+ card?:Card;
1288
+
1289
+ credit_notes?:CreditNote[];
1290
+ }
1291
+
1292
+ export interface RemoveScheduledCancellationResponse {
1293
+ subscription:Subscription;
1294
+
1295
+ customer:Customer;
1296
+
1297
+ card?:Card;
1298
+ }
1299
+ export interface RemoveScheduledCancellationInputParam {
1466
1300
 
1467
1301
  /**
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.
1302
+ * @description Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
1469
1303
 
1470
1304
  */
1471
-
1472
- updated_at?:{after?:string,before?:string,between?:string,on?:string};
1305
+
1306
+ billing_cycles?:number;
1307
+ }
1308
+ export interface RemoveCouponsResponse {
1309
+ subscription:Subscription;
1310
+
1311
+ customer:Customer;
1312
+
1313
+ card?:Card;
1314
+ }
1315
+ export interface RemoveCouponsInputParam {
1473
1316
 
1474
1317
  /**
1475
- * @description The preferred offline payment method for the subscription.
1318
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
1476
1319
 
1477
1320
  */
1478
-
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
1321
 
1322
+ coupon_ids?:string[];
1323
+ }
1324
+ export interface UpdateForItemsResponse {
1325
+ subscription:Subscription;
1326
+
1327
+ customer:Customer;
1328
+
1329
+ card?:Card;
1330
+
1331
+ invoice?:Invoice;
1332
+
1333
+ unbilled_charges?:UnbilledCharge[];
1334
+
1335
+ credit_notes?:CreditNote[];
1336
+ }
1337
+ export interface UpdateForItemsInputParam {
1338
+ [key : string] : any;
1481
1339
  /**
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).
1340
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
1483
1341
 
1484
1342
  */
1485
-
1486
- auto_close_invoices?:{is?:'true' | 'false'};
1343
+
1344
+ mandatory_items_to_remove?:string[];
1487
1345
 
1488
1346
  /**
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.
1347
+ * @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.
1490
1348
 
1491
1349
  */
1492
-
1493
- override_relationship?:{is?:'true' | 'false'};
1350
+
1351
+ replace_items_list?:boolean;
1494
1352
 
1495
1353
  /**
1496
- * @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
1354
+ * @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.
1355
+
1356
+ * 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).
1357
+ * 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.
1358
+ * If the value is not provided: The attribute is left unaltered.
1359
+ .
1497
1360
 
1498
1361
  */
1499
-
1500
- sort_by?:{asc?:'updated_at' | 'created_at',desc?:'updated_at' | 'created_at'};
1362
+
1363
+ net_term_days?:number;
1501
1364
 
1502
1365
  /**
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**
1366
+ * @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:
1506
1367
 
1507
- [Multiple Business Entities](/docs/api?prod_cat_ver&#x3D;2#mbe) is a feature available only on Product Catalog 2.0.
1368
+ * &#x60;invoice_date&#x60; must be in the past.
1369
+ * &#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.
1370
+ * It is not earlier than &#x60;changes_scheduled_at&#x60;, &#x60;reactivate_from&#x60;, or &#x60;trial_end&#x60;.
1371
+ * &#x60;invoice_immediately&#x60; is &#x60;true&#x60;.
1372
+ .
1508
1373
 
1509
1374
  */
1510
-
1511
- business_entity_id?:{is?:string,is_not?:string,starts_with?:string};
1375
+
1376
+ invoice_date?:number;
1512
1377
 
1513
1378
  /**
1514
- * @description The subscription channel this object originated from and is maintained in.
1379
+ * @description The new start date of a &#x60;future&#x60; subscription. Applicable only for &#x60;future&#x60; subscriptions.
1515
1380
 
1516
1381
  */
1517
-
1518
- channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
1519
- }
1520
- export interface ImportForItemsResponse {
1521
- subscription:Subscription;
1522
-
1523
- customer:Customer;
1524
1382
 
1525
- card?:Card;
1383
+ start_date?:number;
1526
1384
 
1527
- invoice?:Invoice;
1528
- }
1529
- export interface ImportForItemsInputParam {
1530
- [key : string] : any;
1531
1385
  /**
1532
- * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
1386
+ * @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.
1533
1387
 
1534
1388
  */
1535
1389
 
1536
- id?:string;
1390
+ trial_end?:number;
1537
1391
 
1538
1392
  /**
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.
1393
+ * @description Billing cycles set for plan-item price is used by default.
1540
1394
 
1541
1395
  */
1542
1396
 
1543
- trial_end?:number;
1397
+ billing_cycles?:number;
1544
1398
 
1545
1399
  /**
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.
1400
+ * @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.
1547
1401
 
1548
1402
  */
1549
1403
 
1550
- billing_cycles?:number;
1404
+ terms_to_charge?:number;
1551
1405
 
1552
1406
  /**
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.
1407
+ * @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.
1408
+ **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:
1554
1409
 
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.
1410
+ * Backdating must be enabled for subscription reactivation operations.
1411
+ * 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.
1412
+ * The date is on or after the last date/time any of the product catalog items of the subscription were changed.
1413
+ * 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.
1557
1414
  .
1558
1415
 
1559
1416
  */
1560
1417
 
1561
- net_term_days?:number;
1418
+ reactivate_from?:number;
1562
1419
 
1563
1420
  /**
1564
- * @description The date/time at which the subscription is to start or has started. If not provided, the subscription starts immediately.
1421
+ * @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.
1565
1422
 
1566
1423
  */
1567
1424
 
1568
- start_date?:number;
1425
+ billing_alignment_mode?:BillingAlignmentMode;
1569
1426
 
1570
1427
  /**
1571
1428
  * @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.
@@ -1575,147 +1432,159 @@ The ID of the business entity created for the site. For Product Catalog 1.0, all
1575
1432
  auto_collection?:AutoCollection;
1576
1433
 
1577
1434
  /**
1578
- * @description Purchase order number for this subscription.
1435
+ * @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
1579
1436
 
1580
1437
  */
1581
1438
 
1582
- po_number?:string;
1439
+ offline_payment_method?:OfflinePaymentMethod;
1583
1440
 
1584
1441
  /**
1585
- * @description List of coupons to be applied to this subscription. You can provide coupon ids or [coupon codes](./coupon_codes).
1442
+ * @description Purchase order number for this subscription.
1586
1443
 
1587
1444
  */
1588
1445
 
1589
- coupon_ids?:string[];
1446
+ po_number?:string;
1590
1447
 
1591
1448
  /**
1592
- * @description Id of the payment source to be attached to this subscription.
1449
+ * @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.
1593
1450
 
1594
1451
  */
1595
1452
 
1596
- payment_source_id?:string;
1453
+ coupon_ids?:string[];
1597
1454
 
1598
1455
  /**
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.
1456
+ * @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;.
1600
1457
 
1601
1458
  */
1602
1459
 
1603
- status:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing';
1460
+ replace_coupon_list?:boolean;
1604
1461
 
1605
1462
  /**
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:**
1463
+ * @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.
1464
+ * When &#x60;false&#x60;: The subscription is changed without creating any credits or charges.
1465
+ * 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.
1611
1466
 
1467
+ **Caveat**
1612
1468
 
1613
- For subscription status: &#x60;non_renewing&#x60;, &#x60;active&#x60;, and &#x60;paused&#x60;, &#x60;current_term_end&#x60; is required.
1469
+ 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:
1614
1470
 
1471
+ An immediate previous change was made
1615
1472
 
1473
+ * with &#x60;prorate&#x60; set to &#x60;false&#x60; and
1474
+ * no changes were made to the subscription&#x27;s billing term and
1475
+ * a change was made to either the subscription&#x27;s items or their prices.
1616
1476
 
1617
- .
1477
+ */
1478
+
1479
+ prorate?:boolean;
1480
+
1481
+ /**
1482
+ * @description Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
1618
1483
 
1619
1484
  */
1620
1485
 
1621
- current_term_end?:number;
1486
+ end_of_term?:boolean;
1622
1487
 
1623
1488
  /**
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.
1489
+ * @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).
1490
+ **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.
1625
1491
 
1626
1492
  */
1627
1493
 
1628
- current_term_start?:number;
1494
+ force_term_reset?:boolean;
1629
1495
 
1630
1496
  /**
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.
1497
+ * @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.
1632
1498
 
1633
1499
  */
1634
1500
 
1635
- trial_start?:number;
1501
+ reactivate?:boolean;
1636
1502
 
1637
1503
  /**
1638
- * @description Time at which subscription was cancelled or is set to be cancelled.
1504
+ * @description The Chargebee payment token generated by Chargebee JS.
1639
1505
 
1640
1506
  */
1641
1507
 
1642
- cancelled_at?:number;
1508
+ token_id?:string;
1643
1509
 
1644
1510
  /**
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.
1511
+ * @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.
1646
1512
 
1647
1513
  */
1648
1514
 
1649
- started_at?:number;
1515
+ invoice_notes?:string;
1650
1516
 
1651
1517
  /**
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;.
1518
+ * @description A collection of key-value pairs that provides extra information about the subscription.
1519
+ **Note:** There&#x27;s a character limit of 65,535.
1520
+ [Learn more](advanced-features#metadata).
1662
1521
 
1663
1522
  */
1664
1523
 
1665
- activated_at?:number;
1524
+ meta_data?:object;
1666
1525
 
1667
1526
  /**
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.
1527
+ * @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).
1528
+ **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. .
1669
1529
 
1670
1530
  */
1671
1531
 
1672
- pause_date?:number;
1532
+ invoice_immediately?:boolean;
1673
1533
 
1674
1534
  /**
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.
1535
+ * @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.
1676
1536
 
1677
1537
  */
1678
1538
 
1679
- resume_date?:number;
1539
+ override_relationship?:boolean;
1680
1540
 
1681
1541
  /**
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).
1542
+ * @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:
1543
+
1544
+ * Backdating must be enabled for subscription change operations.
1545
+ * Only the following changes can be backdated:
1546
+ * Changes in the recurring items or their prices.
1547
+ * Addition of non-recurring items.
1548
+ * Subscription &#x60;status&#x60; is &#x60;active&#x60;, &#x60;cancelled&#x60;, or &#x60;non_renewing&#x60;.
1549
+ * 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.
1550
+ * The date is on or after &#x60;current_term_start&#x60;.
1551
+ * The date is on or after the last date/time any of the following changes were made:
1552
+ * Changes in the recurring items or their prices.
1553
+ * Addition of non-recurring items.
1554
+ * 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.
1555
+ .
1683
1556
 
1684
1557
  */
1685
1558
 
1686
- contract_term_billing_cycle_on_renewal?:number;
1559
+ changes_scheduled_at?:number;
1687
1560
 
1688
1561
  /**
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.
1562
+ * @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.
1694
1563
 
1695
1564
  */
1696
1565
 
1697
- create_current_term_invoice?:boolean;
1566
+ change_option?:ChangeOption;
1698
1567
 
1699
1568
  /**
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.
1569
+ * @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).
1701
1570
 
1702
1571
  */
1703
1572
 
1704
- invoice_notes?:string;
1573
+ contract_term_billing_cycle_on_renewal?:number;
1705
1574
 
1706
1575
  /**
1707
- * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./#meta_data).
1576
+ * @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.
1708
1577
 
1709
1578
  */
1710
1579
 
1711
- meta_data?:object;
1580
+ free_period?:number;
1712
1581
 
1713
1582
  /**
1714
- * @description Imports a subscription into Chargebee.
1583
+ * @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)
1715
1584
 
1716
1585
  */
1717
1586
 
1718
- cancel_reason_code?:string;
1587
+ free_period_unit?:FreePeriodUnit;
1719
1588
 
1720
1589
  /**
1721
1590
  * @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.
@@ -1740,18 +1609,46 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1740
1609
  auto_close_invoices?:boolean;
1741
1610
 
1742
1611
  /**
1743
- * @description Parameters for contract_term
1612
+ * @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.
1744
1613
 
1745
1614
  */
1746
1615
 
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};
1616
+ trial_end_action?:TrialEndAction;
1748
1617
 
1749
1618
  /**
1750
- * @description Parameters for transaction
1619
+ * @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
1751
1620
 
1752
1621
  */
1753
1622
 
1754
- transaction?:{amount?:number,date?:number,payment_method?:PaymentMethod,reference_number?:string};
1623
+ payment_initiator?:PaymentInitiator;
1624
+
1625
+ /**
1626
+ * @description Parameters for card
1627
+
1628
+ */
1629
+
1630
+ 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};
1631
+
1632
+ /**
1633
+ * @description Parameters for payment_method
1634
+
1635
+ */
1636
+
1637
+ payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
1638
+
1639
+ /**
1640
+ * @description Parameters for payment_intent
1641
+
1642
+ */
1643
+
1644
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
1645
+
1646
+ /**
1647
+ * @description Parameters for billing_address
1648
+
1649
+ */
1650
+
1651
+ 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};
1755
1652
 
1756
1653
  /**
1757
1654
  * @description Parameters for shipping_address
@@ -1761,25 +1658,41 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1761
1658
  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
1659
 
1763
1660
  /**
1764
- * @description Parameters for subscription_items
1661
+ * @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.
1662
+
1663
+ 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.
1765
1664
 
1766
1665
  */
1767
1666
 
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}[];
1667
+ statement_descriptor?:{additional_info?:string,descriptor?:string};
1769
1668
 
1770
1669
  /**
1771
- * @description Parameters for discounts
1670
+ * @description Parameters for customer
1772
1671
 
1773
1672
  */
1774
1673
 
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}[];
1674
+ 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};
1776
1675
 
1777
1676
  /**
1778
- * @description Parameters for charged_items
1677
+ * @description Parameters for contract_term
1779
1678
 
1780
1679
  */
1781
1680
 
1782
- charged_items?:{item_price_id?:string,last_charged_at?:number}[];
1681
+ contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1682
+
1683
+ /**
1684
+ * @description Parameters for subscription_items
1685
+
1686
+ */
1687
+
1688
+ 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}[];
1689
+
1690
+ /**
1691
+ * @description Parameters for discounts
1692
+
1693
+ */
1694
+
1695
+ 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}[];
1783
1696
 
1784
1697
  /**
1785
1698
  * @description Parameters for item_tiers
@@ -1788,34 +1701,43 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1788
1701
 
1789
1702
  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}[];
1790
1703
  }
1791
- export interface RetrieveAdvanceInvoiceScheduleResponse {
1792
- advance_invoice_schedules:AdvanceInvoiceSchedule[];
1793
- }
1794
-
1795
- export interface RemoveScheduledCancellationResponse {
1704
+ export interface ChangeTermEndResponse {
1796
1705
  subscription:Subscription;
1797
1706
 
1798
1707
  customer:Customer;
1799
1708
 
1800
1709
  card?:Card;
1710
+
1711
+ invoice?:Invoice;
1712
+
1713
+ unbilled_charges?:UnbilledCharge[];
1714
+
1715
+ credit_notes?:CreditNote[];
1801
1716
  }
1802
- export interface RemoveScheduledCancellationInputParam {
1717
+ export interface ChangeTermEndInputParam {
1803
1718
 
1804
1719
  /**
1805
- * @description Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
1720
+ * @description The time at which the current term should end for this subscription.
1806
1721
 
1807
1722
  */
1808
1723
 
1809
- billing_cycles?:number;
1810
- }
1811
- export interface RetrieveWithScheduledChangesResponse {
1812
- subscription:Subscription;
1724
+ term_ends_at:number;
1813
1725
 
1814
- customer:Customer;
1726
+ /**
1727
+ * @description Applicable for *active* / *non_renewing* subscriptions. If specified as *true* prorated charges / credits will be added during this operation.
1728
+
1729
+ */
1815
1730
 
1816
- card?:Card;
1731
+ prorate?:boolean;
1732
+
1733
+ /**
1734
+ * @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).
1735
+ **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. .
1736
+
1737
+ */
1738
+
1739
+ invoice_immediately?:boolean;
1817
1740
  }
1818
-
1819
1741
  export interface ReactivateResponse {
1820
1742
  subscription:Subscription;
1821
1743
 
@@ -1888,35 +1810,124 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1888
1810
 
1889
1811
  */
1890
1812
 
1891
- invoice_date?:number;
1813
+ invoice_date?:number;
1814
+
1815
+ /**
1816
+ * @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).
1817
+
1818
+ */
1819
+
1820
+ contract_term_billing_cycle_on_renewal?:number;
1821
+
1822
+ /**
1823
+ * @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
1824
+
1825
+ */
1826
+
1827
+ payment_initiator?:PaymentInitiator;
1828
+
1829
+ /**
1830
+ * @description Parameters for contract_term
1831
+
1832
+ */
1833
+
1834
+ contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1835
+
1836
+ /**
1837
+ * @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.
1838
+
1839
+ 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.
1840
+
1841
+ Unless the billing cycle is specified, it will be set to plan&#x27;s default billing cycle.
1842
+
1843
+ 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.
1844
+
1845
+ **What is an &quot;in-term reactivation&quot;?**
1846
+ 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.
1847
+
1848
+ **When is the &#x27;billing term&#x27; retained for a cancelled subscription?**
1849
+ When dunning (payment failure retry settings) is configured with the last retry configured as
1850
+
1851
+ * cancel subscription and mark invoice as &#x27;Not Paid&#x27;, or
1852
+ * 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;.
1853
+
1854
+
1855
+
1856
+ **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.
1857
+
1858
+ **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.
1859
+
1860
+ */
1861
+
1862
+ statement_descriptor?:{additional_info?:string,descriptor?:string};
1863
+
1864
+ /**
1865
+ * @description Parameters for payment_intent
1866
+
1867
+ */
1868
+
1869
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
1870
+ }
1871
+ export interface AddChargeAtTermEndResponse {
1872
+ estimate:Estimate;
1873
+ }
1874
+ export interface AddChargeAtTermEndInputParam {
1875
+
1876
+ /**
1877
+ * @description The amount to be charged. The unit depends on the [type of currency](/docs/api#md_disabled).
1878
+
1879
+ */
1880
+
1881
+ amount?:number;
1882
+
1883
+ /**
1884
+ * @description Description for this charge.
1885
+
1886
+ */
1887
+
1888
+ description:string;
1889
+
1890
+ /**
1891
+ * @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.
1892
+
1893
+ */
1894
+
1895
+ amount_in_decimal?:string;
1896
+
1897
+ /**
1898
+ * @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
1899
+
1900
+ */
1901
+
1902
+ avalara_sale_type?:AvalaraSaleType;
1892
1903
 
1893
1904
  /**
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).
1905
+ * @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.
1895
1906
 
1896
1907
  */
1897
1908
 
1898
- contract_term_billing_cycle_on_renewal?:number;
1909
+ avalara_transaction_type?:number;
1899
1910
 
1900
1911
  /**
1901
- * @description null
1912
+ * @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.
1902
1913
 
1903
1914
  */
1904
1915
 
1905
- payment_initiator?:PaymentInitiator;
1916
+ avalara_service_type?:number;
1906
1917
 
1907
1918
  /**
1908
- * @description Parameters for contract_term
1919
+ * @description The time when the service period for the charge starts.
1909
1920
 
1910
1921
  */
1911
1922
 
1912
- contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1923
+ date_from?:number;
1913
1924
 
1914
1925
  /**
1915
- * @description Parameters for payment_intent
1926
+ * @description The time when the service period for the charge ends.
1916
1927
 
1917
1928
  */
1918
1929
 
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};
1930
+ date_to?:number;
1920
1931
  }
1921
1932
  export interface ChargeFutureRenewalsResponse {
1922
1933
  subscription:Subscription;
@@ -1968,123 +1979,138 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
1968
1979
 
1969
1980
  specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
1970
1981
  }
1971
- export interface AddChargeAtTermEndResponse {
1972
- estimate:Estimate;
1982
+ export interface EditAdvanceInvoiceScheduleResponse {
1983
+ advance_invoice_schedules:AdvanceInvoiceSchedule[];
1973
1984
  }
1974
- export interface AddChargeAtTermEndInputParam {
1985
+ export interface EditAdvanceInvoiceScheduleInputParam {
1975
1986
 
1976
1987
  /**
1977
- * @description The amount to be charged. The unit depends on the [type of currency](/docs/api#md_disabled).
1988
+ * @description The number of billing cycles in one interval.
1978
1989
 
1979
1990
  */
1980
1991
 
1981
- amount?:number;
1992
+ terms_to_charge?:number;
1982
1993
 
1983
1994
  /**
1984
- * @description Description for this charge.
1995
+ * @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).
1985
1996
 
1986
1997
  */
1987
1998
 
1988
- description:string;
1999
+ schedule_type?:ScheduleType;
1989
2000
 
1990
2001
  /**
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.
2002
+ * @description Parameters for fixed_interval_schedule
1992
2003
 
1993
2004
  */
1994
2005
 
1995
- amount_in_decimal?:string;
2006
+ fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
1996
2007
 
1997
2008
  /**
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
2009
+ * @description Parameters for specific_dates_schedule
1999
2010
 
2000
2011
  */
2001
2012
 
2002
- avalara_sale_type?:AvalaraSaleType;
2013
+ specific_dates_schedule?:{date?:number,id?:string,terms_to_charge?:number}[];
2014
+ }
2015
+ export interface RetrieveAdvanceInvoiceScheduleResponse {
2016
+ advance_invoice_schedules:AdvanceInvoiceSchedule[];
2017
+ }
2018
+
2019
+ export interface RemoveAdvanceInvoiceScheduleResponse {
2020
+ subscription:Subscription;
2021
+
2022
+ advance_invoice_schedules?:AdvanceInvoiceSchedule[];
2023
+ }
2024
+ export interface RemoveAdvanceInvoiceScheduleInputParam {
2003
2025
 
2004
2026
  /**
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.
2027
+ * @description Parameters for specific_dates_schedule
2006
2028
 
2007
2029
  */
2008
2030
 
2009
- avalara_transaction_type?:number;
2031
+ specific_dates_schedule?:{id?:string}[];
2032
+ }
2033
+ export interface RegenerateInvoiceResponse {
2034
+ invoice?:Invoice;
2035
+
2036
+ unbilled_charges?:UnbilledCharge[];
2037
+ }
2038
+ export interface RegenerateInvoiceInputParam {
2010
2039
 
2011
2040
  /**
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.
2041
+ * @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 ).
2013
2042
 
2014
2043
  */
2015
2044
 
2016
- avalara_service_type?:number;
2045
+ date_from?:number;
2017
2046
 
2018
2047
  /**
2019
- * @description The time when the service period for the charge starts.
2048
+ * @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 ).
2020
2049
 
2021
2050
  */
2022
2051
 
2023
- date_from?:number;
2052
+ date_to?:number;
2024
2053
 
2025
2054
  /**
2026
- * @description The time when the service period for the charge ends.
2055
+ * @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;.
2027
2056
 
2028
2057
  */
2029
2058
 
2030
- date_to?:number;
2031
- }
2032
- export interface RemoveScheduledChangesResponse {
2033
- subscription:Subscription;
2034
-
2035
- customer:Customer;
2059
+ prorate?:boolean;
2036
2060
 
2037
- card?:Card;
2061
+ /**
2062
+ * @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.
2063
+
2064
+ */
2038
2065
 
2039
- credit_notes?:CreditNote[];
2066
+ invoice_immediately?:boolean;
2040
2067
  }
2041
-
2042
- export interface ChangeTermEndResponse {
2043
- subscription:Subscription;
2044
-
2045
- customer:Customer;
2068
+ export interface ImportContractTermResponse {
2069
+ contract_term:ContractTerm;
2070
+ }
2071
+ export interface ImportContractTermInputParam {
2046
2072
 
2047
- card?:Card;
2073
+ /**
2074
+ * @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).
2075
+
2076
+ */
2048
2077
 
2049
- invoice?:Invoice;
2078
+ contract_term_billing_cycle_on_renewal?:number;
2050
2079
 
2051
- unbilled_charges?:UnbilledCharge[];
2080
+ /**
2081
+ * @description Parameters for contract_term
2082
+
2083
+ */
2052
2084
 
2053
- credit_notes?:CreditNote[];
2085
+ 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};
2054
2086
  }
2055
- export interface ChangeTermEndInputParam {
2087
+ export interface ImportUnbilledChargesResponse {
2088
+ unbilled_charges:UnbilledCharge[];
2089
+ }
2090
+ export interface ImportUnbilledChargesInputParam {
2056
2091
 
2057
2092
  /**
2058
- * @description The time at which the current term should end for this subscription.
2093
+ * @description Parameters for unbilled_charges
2059
2094
 
2060
2095
  */
2061
2096
 
2062
- term_ends_at:number;
2097
+ 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}[];
2063
2098
 
2064
2099
  /**
2065
- * @description Applicable for *active* / *non_renewing* subscriptions. If specified as *true* prorated charges / credits will be added during this operation.
2100
+ * @description Parameters for discounts
2066
2101
 
2067
2102
  */
2068
2103
 
2069
- prorate?:boolean;
2104
+ 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}[];
2070
2105
 
2071
2106
  /**
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. .
2107
+ * @description Parameters for tiers
2074
2108
 
2075
2109
  */
2076
2110
 
2077
- invoice_immediately?:boolean;
2078
- }
2079
- export interface DeleteResponse {
2080
- subscription:Subscription;
2081
-
2082
- customer:Customer;
2083
-
2084
- card?:Card;
2111
+ 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}[];
2085
2112
  }
2086
-
2087
- export interface CreateWithItemsResponse {
2113
+ export interface ImportForItemsResponse {
2088
2114
  subscription:Subscription;
2089
2115
 
2090
2116
  customer:Customer;
@@ -2092,10 +2118,8 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
2092
2118
  card?:Card;
2093
2119
 
2094
2120
  invoice?:Invoice;
2095
-
2096
- unbilled_charges?:UnbilledCharge[];
2097
2121
  }
2098
- export interface CreateWithItemsInputParam {
2122
+ export interface ImportForItemsInputParam {
2099
2123
  [key : string] : any;
2100
2124
  /**
2101
2125
  * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
@@ -2104,17 +2128,6 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
2104
2128
 
2105
2129
  id?:string;
2106
2130
 
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
-
2116
- business_entity_id?:string;
2117
-
2118
2131
  /**
2119
2132
  * @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
2133
 
@@ -2129,13 +2142,6 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
2129
2142
 
2130
2143
  billing_cycles?:number;
2131
2144
 
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
-
2137
- mandatory_items_to_remove?:string[];
2138
-
2139
2145
  /**
2140
2146
  * @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
2147
 
@@ -2148,12 +2154,7 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
2148
2154
  net_term_days?:number;
2149
2155
 
2150
2156
  /**
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
+ * @description The date/time at which the subscription is to start or has started. If not provided, the subscription starts immediately.
2157
2158
 
2158
2159
  */
2159
2160
 
@@ -2167,109 +2168,147 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
2167
2168
  auto_collection?:AutoCollection;
2168
2169
 
2169
2170
  /**
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
+ * @description Purchase order number for this subscription.
2171
2172
 
2172
2173
  */
2173
2174
 
2174
- terms_to_charge?:number;
2175
+ po_number?:string;
2175
2176
 
2176
2177
  /**
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
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or [coupon codes](./coupon_codes).
2178
2179
 
2179
2180
  */
2180
2181
 
2181
- billing_alignment_mode?:BillingAlignmentMode;
2182
+ coupon_ids?:string[];
2182
2183
 
2183
2184
  /**
2184
- * @description Purchase order number for this subscription.
2185
+ * @description Id of the payment source to be attached to this subscription.
2185
2186
 
2186
2187
  */
2187
2188
 
2188
- po_number?:string;
2189
+ payment_source_id?:string;
2189
2190
 
2190
2191
  /**
2191
- * @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
2192
+ * @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.
2192
2193
 
2193
2194
  */
2194
2195
 
2195
- coupon_ids?:string[];
2196
+ status:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing';
2196
2197
 
2197
2198
  /**
2198
- * @description Id of the payment source to be attached to this subscription.
2199
+ * @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.
2200
+
2201
+
2202
+
2203
+ **Note:**
2204
+
2205
+
2206
+ For subscription status: &#x60;non_renewing&#x60;, &#x60;active&#x60;, and &#x60;paused&#x60;, &#x60;current_term_end&#x60; is required.
2207
+
2208
+
2209
+
2210
+ .
2199
2211
 
2200
2212
  */
2201
2213
 
2202
- payment_source_id?:string;
2214
+ current_term_end?:number;
2203
2215
 
2204
2216
  /**
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.
2217
+ * @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.
2206
2218
 
2207
2219
  */
2208
2220
 
2209
- override_relationship?:boolean;
2221
+ current_term_start?:number;
2210
2222
 
2211
2223
  /**
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.
2224
+ * @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.
2213
2225
 
2214
2226
  */
2215
2227
 
2216
- invoice_notes?:string;
2228
+ trial_start?:number;
2217
2229
 
2218
2230
  /**
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:
2231
+ * @description Time at which subscription was cancelled or is set to be cancelled.
2220
2232
 
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
- .
2233
+ */
2234
+
2235
+ cancelled_at?:number;
2236
+
2237
+ /**
2238
+ * @description Time at which the subscription was started. Is &#x60;null&#x60; for &#x60;future&#x60;subscriptions as it is yet to be started.
2226
2239
 
2227
2240
  */
2228
2241
 
2229
- invoice_date?:number;
2242
+ started_at?:number;
2230
2243
 
2231
2244
  /**
2232
- * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./#meta_data).
2245
+ * @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;.
2246
+
2247
+ The following conditions must be satisfied when passing this parameter:
2248
+
2249
+ * 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;.
2250
+ * When &#x60;status&#x60; is &#x60;in_trial&#x60;, &#x60;activated_at&#x60; must precede &#x60;trial_start&#x60;
2251
+
2252
+ #### Note:
2253
+
2254
+ This parameter should not be provided when passing &#x60;status&#x60; as &#x60;future&#x60; or &#x60;cancelled&#x60;.
2233
2255
 
2234
2256
  */
2235
2257
 
2236
- meta_data?:object;
2258
+ activated_at?:number;
2237
2259
 
2238
2260
  /**
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. .
2261
+ * @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.
2241
2262
 
2242
2263
  */
2243
2264
 
2244
- invoice_immediately?:boolean;
2265
+ pause_date?:number;
2245
2266
 
2246
2267
  /**
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.
2268
+ * @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.
2269
+
2270
+ */
2271
+
2272
+ resume_date?:number;
2273
+
2274
+ /**
2275
+ * @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).
2276
+
2277
+ */
2278
+
2279
+ contract_term_billing_cycle_on_renewal?:number;
2280
+
2281
+ /**
2282
+ * @description Set as &#x60;true&#x60; if you want an invoice to be created for the subscription.
2283
+
2284
+ * The invoice will be created for the subscription only if it has an &#x60;active&#x60; or &#x60;non_renewing&#x60; status.
2285
+ * The period of the invoice is from &#x60;current_term_start&#x60; to &#x60;current_term_end&#x60;.
2286
+ * 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.
2248
2287
 
2249
2288
  */
2250
2289
 
2251
- replace_primary_payment_source?:boolean;
2290
+ create_current_term_invoice?:boolean;
2252
2291
 
2253
2292
  /**
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.
2293
+ * @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.
2255
2294
 
2256
2295
  */
2257
2296
 
2258
- free_period?:number;
2297
+ invoice_notes?:string;
2259
2298
 
2260
2299
  /**
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)
2300
+ * @description A set of key-value pairs stored as additional information for the subscription. [Learn more](./#meta_data).
2262
2301
 
2263
2302
  */
2264
2303
 
2265
- free_period_unit?:FreePeriodUnit;
2304
+ meta_data?:object;
2266
2305
 
2267
2306
  /**
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).
2307
+ * @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.
2269
2308
 
2270
2309
  */
2271
2310
 
2272
- contract_term_billing_cycle_on_renewal?:number;
2311
+ cancel_reason_code?:string;
2273
2312
 
2274
2313
  /**
2275
2314
  * @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.
@@ -2294,28 +2333,18 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
2294
2333
  auto_close_invoices?:boolean;
2295
2334
 
2296
2335
  /**
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
-
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.
2336
+ * @description Parameters for contract_term
2308
2337
 
2309
2338
  */
2310
2339
 
2311
- trial_end_action?:TrialEndAction;
2340
+ 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};
2312
2341
 
2313
2342
  /**
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
2343
+ * @description Parameters for transaction
2315
2344
 
2316
2345
  */
2317
2346
 
2318
- payment_initiator?:PaymentInitiator;
2347
+ transaction?:{amount?:number,date?:number,payment_method?:PaymentMethod,reference_number?:string};
2319
2348
 
2320
2349
  /**
2321
2350
  * @description Parameters for shipping_address
@@ -2325,32 +2354,25 @@ If any non-&#x60;metered&#x60; items are present for the current term, they&#x27
2325
2354
  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
2355
 
2327
2356
  /**
2328
- * @description Parameters for payment_intent
2329
-
2330
- */
2331
-
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
2357
+ * @description Parameters for subscription_items
2336
2358
 
2337
2359
  */
2338
2360
 
2339
- contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
2361
+ 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}[];
2340
2362
 
2341
2363
  /**
2342
- * @description Parameters for subscription_items
2364
+ * @description Parameters for discounts
2343
2365
 
2344
2366
  */
2345
2367
 
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}[];
2368
+ discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
2347
2369
 
2348
2370
  /**
2349
- * @description Parameters for discounts
2371
+ * @description Parameters for charged_items
2350
2372
 
2351
2373
  */
2352
2374
 
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}[];
2375
+ charged_items?:{item_price_id?:string,last_charged_at?:number}[];
2354
2376
 
2355
2377
  /**
2356
2378
  * @description Parameters for item_tiers
@@ -2359,33 +2381,28 @@ If any non-&#x60;metered&#x60; items are present for the current term, they&#x27
2359
2381
 
2360
2382
  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}[];
2361
2383
  }
2362
- export interface ImportUnbilledChargesResponse {
2363
- unbilled_charges:UnbilledCharge[];
2364
- }
2365
- export interface ImportUnbilledChargesInputParam {
2366
-
2367
- /**
2368
- * @description Parameters for unbilled_charges
2369
-
2370
- */
2384
+ export interface OverrideBillingProfileResponse {
2385
+ subscription:Subscription;
2371
2386
 
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}[];
2387
+ payment_source?:PaymentSource;
2388
+ }
2389
+ export interface OverrideBillingProfileInputParam {
2373
2390
 
2374
2391
  /**
2375
- * @description Parameters for discounts
2392
+ * @description Unique identifier of the payment source to be attached to this subscription.
2376
2393
 
2377
2394
  */
2378
2395
 
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}[];
2396
+ payment_source_id?:string;
2380
2397
 
2381
2398
  /**
2382
- * @description Parameters for tiers
2399
+ * @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.
2383
2400
 
2384
2401
  */
2385
2402
 
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}[];
2403
+ auto_collection?:AutoCollection;
2387
2404
  }
2388
- export interface RemoveScheduledResumptionResponse {
2405
+ export interface DeleteResponse {
2389
2406
  subscription:Subscription;
2390
2407
 
2391
2408
  customer:Customer;
@@ -2393,158 +2410,192 @@ If any non-&#x60;metered&#x60; items are present for the current term, they&#x27
2393
2410
  card?:Card;
2394
2411
  }
2395
2412
 
2396
- export interface RetrieveResponse {
2413
+ export interface PauseResponse {
2397
2414
  subscription:Subscription;
2398
2415
 
2399
2416
  customer:Customer;
2400
2417
 
2401
2418
  card?:Card;
2419
+
2420
+ invoice?:Invoice;
2421
+
2422
+ unbilled_charges?:UnbilledCharge[];
2423
+
2424
+ credit_notes?:CreditNote[];
2402
2425
  }
2403
-
2404
- export interface ImportContractTermResponse {
2405
- contract_term:ContractTerm;
2406
- }
2407
- export interface ImportContractTermInputParam {
2426
+ export interface PauseInputParam {
2408
2427
 
2409
2428
  /**
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).
2429
+ * @description List of options to pause the subscription. \* billing_cycles -
2430
+
2431
+ 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
2432
+ \* immediately - Pause immediately
2433
+ \* end_of_term - Pause at the end of current term
2434
+ \* specific_date - Pause on a specific date
2411
2435
 
2412
2436
  */
2413
2437
 
2414
- contract_term_billing_cycle_on_renewal?:number;
2438
+ pause_option?:PauseOption;
2415
2439
 
2416
2440
  /**
2417
- * @description Parameters for contract_term
2441
+ * @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.
2442
+
2443
+ For non-renewing subscriptions, &#x60;pause_date&#x60; should be before the cancellation date.
2418
2444
 
2419
2445
  */
2420
2446
 
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};
2422
- }
2423
- export interface OverrideBillingProfileResponse {
2424
- subscription:Subscription;
2447
+ pause_date?:number;
2425
2448
 
2426
- payment_source?:PaymentSource;
2427
- }
2428
- export interface OverrideBillingProfileInputParam {
2449
+ /**
2450
+ * @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;.
2451
+ \* invoice -
2452
+
2453
+ Invoice charges
2454
+
2455
+ 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.
2456
+ \* no_action -
2457
+
2458
+ Retain as unbilled
2459
+
2460
+ If &#x60;no_action&#x60; is chosen, charges are added to the resumption invoice.
2461
+
2462
+ */
2463
+
2464
+ unbilled_charges_handling?:UnbilledChargesHandling;
2429
2465
 
2430
2466
  /**
2431
- * @description Unique identifier of the payment source to be attached to this subscription.
2467
+ * @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;.
2468
+
2469
+ If invoice is in the dunning cycle, &#x60;invoice_dunning_handing&#x60; allows you to &#x60;stop&#x60; or &#x60;continue&#x60; dunning.
2470
+ \* continue - Continue dunning \* stop - Stop dunning
2432
2471
 
2433
2472
  */
2434
2473
 
2435
- payment_source_id?:string;
2474
+ invoice_dunning_handling?:InvoiceDunningHandling;
2436
2475
 
2437
2476
  /**
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.
2477
+ * @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;.
2439
2478
 
2440
2479
  */
2441
2480
 
2442
- auto_collection?:AutoCollection;
2481
+ skip_billing_cycles?:number;
2482
+
2483
+ /**
2484
+ * @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.
2485
+
2486
+ For non-renewing subscriptions,&#x60;resume_date&#x60; should be before the cancellation date.
2487
+
2488
+ */
2489
+
2490
+ resume_date?:number;
2443
2491
  }
2444
- export interface RemoveScheduledPauseResponse {
2492
+ export interface CancelForItemsResponse {
2445
2493
  subscription:Subscription;
2446
2494
 
2447
2495
  customer:Customer;
2448
2496
 
2449
2497
  card?:Card;
2498
+
2499
+ invoice?:Invoice;
2500
+
2501
+ unbilled_charges?:UnbilledCharge[];
2502
+
2503
+ credit_notes?:CreditNote[];
2450
2504
  }
2451
-
2452
- export interface EditAdvanceInvoiceScheduleResponse {
2453
- advance_invoice_schedules:AdvanceInvoiceSchedule[];
2454
- }
2455
- export interface EditAdvanceInvoiceScheduleInputParam {
2505
+ export interface CancelForItemsInputParam {
2456
2506
 
2457
2507
  /**
2458
- * @description The number of billing cycles in one interval.
2508
+ * @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;.
2459
2509
 
2460
2510
  */
2461
2511
 
2462
- terms_to_charge?:number;
2512
+ end_of_term?:boolean;
2463
2513
 
2464
2514
  /**
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).
2515
+ * @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:
2516
+
2517
+ * Backdating must be enabled for subscription cancellation.
2518
+ * 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.
2519
+ * The date is on or after &#x60;current_term_start&#x60;.
2520
+ * The date is on or after the last date/time any of the following changes were made:
2521
+ * Changes in the recurring items or their prices.
2522
+ * Addition of non-recurring items.
2523
+ * 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.
2524
+ .
2466
2525
 
2467
2526
  */
2468
2527
 
2469
- schedule_type?:ScheduleType;
2528
+ cancel_at?:number;
2470
2529
 
2471
2530
  /**
2472
- * @description Parameters for fixed_interval_schedule
2531
+ * @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.
2473
2532
 
2474
2533
  */
2475
2534
 
2476
- fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
2535
+ credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
2477
2536
 
2478
2537
  /**
2479
- * @description Parameters for specific_dates_schedule
2538
+ * @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.
2480
2539
 
2481
2540
  */
2482
2541
 
2483
- specific_dates_schedule?:{date?:number,id?:string,terms_to_charge?:number}[];
2484
- }
2485
- export interface ListDiscountsResponse {
2542
+ unbilled_charges_option?:UnbilledChargesOption;
2543
+
2486
2544
  /**
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.
2545
+ * @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;.
2488
2546
 
2489
2547
  */
2490
2548
 
2491
- list:{discount:Discount}[];
2549
+ account_receivables_handling?:AccountReceivablesHandling;
2492
2550
 
2493
2551
  /**
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.
2552
+ * @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.
2495
2553
 
2496
2554
  */
2497
2555
 
2498
- next_offset?:string;
2499
- }
2500
- export interface ListDiscountsInputParam {
2501
- [key : string]: any;
2502
- /**
2503
- * @description The number of resources to be returned.
2504
-
2505
- */
2506
-
2507
- limit?:number;
2556
+ refundable_credits_handling?:RefundableCreditsHandling;
2508
2557
 
2509
2558
  /**
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.
2559
+ * @description Cancels the current contract term.
2511
2560
 
2512
- */
2513
-
2514
- offset?:string;
2515
- }
2516
- export interface ContractTermsForSubscriptionResponse {
2517
- /**
2518
- * @description Retrieves a list of contract term resources for the subscription specified in the path.
2561
+ * &#x60;terminate_immediately&#x60; immediately does the following:
2562
+ * sets the contract term [&#x60;status&#x60;](contract_terms#contract_term_status) to &#x60;terminated&#x60;.
2563
+ * Cancels the subscription.
2564
+ * Collects any [termination fee](contract_terms#termintation_fee).
2565
+ * &#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.
2566
+ . \* terminate_immediately - Terminate immediately \* end_of_contract_term - End of contract term
2519
2567
 
2520
2568
  */
2521
2569
 
2522
- list:{contract_term:ContractTerm}[];
2570
+ contract_term_cancel_option?:ContractTermCancelOption;
2523
2571
 
2524
2572
  /**
2525
- * @description Retrieves a list of contract term resources for the subscription specified in the path.
2573
+ * @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:
2574
+
2575
+ * &#x60;invoice_date&#x60; must be in the past.
2576
+ * &#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.
2577
+ * It is not earlier than &#x60;cancel_at&#x60;.
2578
+ .
2526
2579
 
2527
2580
  */
2528
2581
 
2529
- next_offset?:string;
2530
- }
2531
- export interface ContractTermsForSubscriptionInputParam {
2532
- [key : string]: any;
2582
+ invoice_date?:number;
2583
+
2533
2584
  /**
2534
- * @description The number of resources to be returned.
2585
+ * @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.
2535
2586
 
2536
2587
  */
2537
-
2538
- limit?:number;
2588
+
2589
+ cancel_reason_code?:string;
2539
2590
 
2540
2591
  /**
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.
2592
+ * @description Parameters for subscription_items
2542
2593
 
2543
2594
  */
2544
-
2545
- offset?:string;
2595
+
2596
+ subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
2546
2597
  }
2547
- export interface PauseResponse {
2598
+ export interface ResumeResponse {
2548
2599
  subscription:Subscription;
2549
2600
 
2550
2601
  customer:Customer;
@@ -2554,136 +2605,282 @@ If any non-&#x60;metered&#x60; items are present for the current term, they&#x27
2554
2605
  invoice?:Invoice;
2555
2606
 
2556
2607
  unbilled_charges?:UnbilledCharge[];
2557
-
2558
- credit_notes?:CreditNote[];
2559
2608
  }
2560
- export interface PauseInputParam {
2609
+ export interface ResumeInputParam {
2561
2610
 
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
2611
+ /**
2612
+ * @description List of options to resume the subscription. \* specific_date - Resume on a specific date \* immediately - Resume immediately
2569
2613
 
2570
2614
  */
2571
2615
 
2572
- pause_option?:PauseOption;
2616
+ resume_option?:ResumeOption;
2573
2617
 
2574
2618
  /**
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.
2619
+ * @description Date on which the subscription will be resumed. Applicable when **resume_option** is set as &#x27;specific_date&#x27;.
2578
2620
 
2579
2621
  */
2580
2622
 
2581
- pause_date?:number;
2623
+ resume_date?:number;
2582
2624
 
2583
2625
  /**
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.
2626
+ * @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
2595
2627
 
2596
2628
  */
2597
2629
 
2598
- unbilled_charges_handling?:UnbilledChargesHandling;
2630
+ charges_handling?:ChargesHandling;
2599
2631
 
2600
2632
  /**
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
2633
+ * @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
2605
2634
 
2606
2635
  */
2607
2636
 
2608
- invoice_dunning_handling?:InvoiceDunningHandling;
2637
+ unpaid_invoices_handling?:UnpaidInvoicesHandling;
2609
2638
 
2610
2639
  /**
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;.
2640
+ * @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
2612
2641
 
2613
2642
  */
2614
2643
 
2615
- skip_billing_cycles?:number;
2644
+ payment_initiator?:PaymentInitiator;
2616
2645
 
2617
2646
  /**
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.
2647
+ * @description Parameters for payment_intent
2621
2648
 
2622
2649
  */
2623
2650
 
2624
- resume_date?:number;
2651
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
2652
+ }
2653
+ export interface RemoveScheduledPauseResponse {
2654
+ subscription:Subscription;
2655
+
2656
+ customer:Customer;
2657
+
2658
+ card?:Card;
2659
+ }
2660
+
2661
+ export interface RemoveScheduledResumptionResponse {
2662
+ subscription:Subscription;
2663
+
2664
+ customer:Customer;
2665
+
2666
+ card?:Card;
2625
2667
  }
2668
+
2626
2669
  export interface SubscriptionItem {
2627
- item_price_id?:string;
2670
+ /**
2671
+ * @description The unique identifier of the item price.
2672
+
2673
+ */
2674
+
2675
+ item_price_id:string;
2676
+
2677
+ /**
2678
+ * @description The type of item. There must be one and only one item of type &#x60;plan&#x60; in this list. \* plan - Plan \* charge - Charge \* addon - Addon
2679
+
2680
+ */
2681
+
2682
+ item_type:'charge' | 'addon' | 'plan';
2628
2683
 
2629
- item_type?:'charge' | 'addon' | 'plan';
2684
+ /**
2685
+ * @description The quantity of the item purchased
2686
+
2687
+ */
2630
2688
 
2631
2689
  quantity?:number;
2632
2690
 
2691
+ /**
2692
+ * @description The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
2693
+
2694
+ */
2695
+
2633
2696
  quantity_in_decimal?:string;
2634
2697
 
2698
+ /**
2699
+ * @description The price/per unit price of the item. When not provided, [the value set](/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_attributes) for the item price is used. This is only applicable when the &#x60;pricing_model&#x60; of the item price is &#x60;flat_fee&#x60; or &#x60;per_unit&#x60;. Also, it is only allowed when [price overriding](https://www.chargebee.com/docs/price-override.html) is enabled for the site. The value depends on the type of currency. If &#x60;changes_scheduled_at&#x60; is in the past and a &#x60;unit_price&#x60; is not passed, then the item price&#x27;s current unit price is considered even if the item price did not exist on the date as of when the change is scheduled.
2700
+
2701
+ */
2702
+
2635
2703
  unit_price?:number;
2636
2704
 
2705
+ /**
2706
+ * @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.
2707
+
2708
+ */
2709
+
2637
2710
  unit_price_in_decimal?:string;
2638
2711
 
2712
+ /**
2713
+ * @description The total amount for the item as determined from &#x60;unit_price&#x60;, &#x60;free_quantity&#x60;, &#x60;quantity&#x60; and &#x60;item_tiers&#x60; as applicable. The value depends on the [type of currency](./#handling_currency_units).
2714
+
2715
+ */
2716
+
2639
2717
  amount?:number;
2640
2718
 
2719
+ /**
2720
+ * @description The decimal representation of the total amount for the item, in major units of the currency. Always returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
2721
+
2722
+ */
2723
+
2641
2724
  amount_in_decimal?:string;
2642
2725
 
2726
+ /**
2727
+ * @description The &#x60;free_quantity&#x60; of the plan-item as [specified](./item_prices?prod_cat_ver&#x3D;2) for the item price.
2728
+
2729
+ */
2730
+
2643
2731
  free_quantity?:number;
2644
2732
 
2733
+ /**
2734
+ * @description The &#x60;free_quantity_in_decimal&#x60; as set for the item price. Returned for quantity-based item prices when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
2735
+
2736
+ */
2737
+
2645
2738
  free_quantity_in_decimal?:string;
2646
2739
 
2740
+ /**
2741
+ * @description The date/time when the trial period of the item ends. Applies to plan-items and----when [enabled](https://www.chargebee.com/docs/2.0/addons-trial.html)----addon-items as well.
2742
+
2743
+ */
2744
+
2647
2745
  trial_end?:number;
2648
2746
 
2747
+ /**
2748
+ * @description For the plan-item price:
2749
+ the value determines the number of billing cycles the subscription runs before canceling automatically. If not provided, then [the value set](./item_prices?prod_cat_ver&#x3D;2#item_price_attributes) for the plan-item price is used.
2750
+
2751
+ For addon-item prices:
2752
+ If [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html) are enabled then this is the number of subscription billing cycles for which the addon is included. If not provided, then [the value set under attached addons](./attached_items?prod_cat_ver&#x3D;2#attached_item_attributes) is used. Further, if that value is not provided, then [the value set for the addon-item price](./item_prices?prod_cat_ver&#x3D;2#item_price_attributes) is used.
2753
+
2754
+ */
2755
+
2649
2756
  billing_cycles?:number;
2650
2757
 
2758
+ /**
2759
+ * @description The service period of the item in days from the day of charge.
2760
+
2761
+ */
2762
+
2651
2763
  service_period_days?:number;
2652
2764
 
2765
+ /**
2766
+ * @description When &#x60;charge_on_option&#x60; option is set to &#x60;on_event&#x60;, this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items. \* contract_termination - when a contract term is [terminated](./subscriptions?prod_cat_ver&#x3D;2#cancel_subscription_for_items_contract_term_cancel_option). \* subscription_trial_start - the time when the trial period of the subscription begins. \* subscription_activation - the moment a subscription enters an &#x60;active&#x60; or &#x60;non-renewing&#x60; state. Also includes reactivations of canceled subscriptions. \* plan_activation - same as subscription activation, but also includes the case when the plan-item of the subscription is changed. \* subscription_creation - the time of creation of the subscription.
2767
+
2768
+ */
2769
+
2653
2770
  charge_on_event?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation';
2654
2771
 
2772
+ /**
2773
+ * @description Indicates if the charge-item is to be charged only once or each time the &#x60;charge_on_event&#x60; occurs. This parameter only applies to charge-items.
2774
+
2775
+ */
2776
+
2655
2777
  charge_once?:boolean;
2656
2778
 
2779
+ /**
2780
+ * @description Indicates when the charge-item is to be charged. This parameter only applies to charge-items. \* immediately - The item is charged immediately on being added to the subscription. \* on_event - The item is charged at the occurrence of the event specified as &#x60;charge_on_event&#x60;.
2781
+
2782
+ */
2783
+
2657
2784
  charge_on_option?:'on_event' | 'immediately';
2658
2785
  }
2659
2786
  export interface ItemTier {
2660
- item_price_id?:string;
2787
+ /**
2788
+ * @description The id of the item price to which this tier belongs.
2789
+
2790
+ */
2791
+
2792
+ item_price_id:string;
2793
+
2794
+ /**
2795
+ * @description The lowest value in the quantity tier.
2796
+
2797
+ */
2798
+
2799
+ starting_unit:number;
2661
2800
 
2662
- starting_unit?:number;
2801
+ /**
2802
+ * @description The highest value in the quantity tier.
2803
+
2804
+ */
2663
2805
 
2664
2806
  ending_unit?:number;
2665
2807
 
2666
- price?:number;
2808
+ /**
2809
+ * @description The per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. The total cost for the item price when the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;. The value is in the minor unit of the currency.
2810
+
2811
+ */
2812
+
2813
+ price:number;
2814
+
2815
+ /**
2816
+ * @description The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as &#x60;ending_unit_in_decimal&#x60; of the next lower tier. Returned only when the pricing_model is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
2817
+
2818
+ */
2667
2819
 
2668
2820
  starting_unit_in_decimal?:string;
2669
2821
 
2822
+ /**
2823
+ * @description The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the &#x60;starting_unit_in_decimal&#x60; of the next higher tier. Returned only when the pricing_model is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
2824
+
2825
+ */
2826
+
2670
2827
  ending_unit_in_decimal?:string;
2671
2828
 
2829
+ /**
2830
+ * @description The decimal representation of the per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. When the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
2831
+
2832
+ */
2833
+
2672
2834
  price_in_decimal?:string;
2673
2835
 
2674
- index?:number;
2836
+ /**
2837
+ * @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.
2838
+
2839
+ */
2840
+
2841
+ index:number;
2675
2842
  }
2676
2843
  export interface ChargedItem {
2677
- item_price_id?:string;
2844
+ /**
2845
+ * @description A unique ID for your system to identify the item price.
2846
+
2847
+ */
2678
2848
 
2679
- last_charged_at?:number;
2849
+ item_price_id:string;
2850
+
2851
+ /**
2852
+ * @description Timestamp indicating when this charge item_price was last charged for this subscription.
2853
+
2854
+ */
2855
+
2856
+ last_charged_at:number;
2680
2857
  }
2681
2858
  export interface Coupon {
2682
- coupon_id?:string;
2859
+ /**
2860
+ * @description Used to uniquely identify the coupon
2861
+
2862
+ */
2863
+
2864
+ coupon_id:string;
2865
+
2866
+ /**
2867
+ * @description The date till when the coupon can be applied. Applicable for &#x60;limited_period&#x60; [coupons](./coupons?prod_cat_ver&#x3D;2) only.
2868
+
2869
+ */
2683
2870
 
2684
2871
  apply_till?:number;
2685
2872
 
2686
- applied_count?:number;
2873
+ /**
2874
+ * @description Number of times this coupon has been applied for this subscription
2875
+
2876
+ */
2877
+
2878
+ applied_count:number;
2879
+
2880
+ /**
2881
+ * @description The coupon code used to redeem the coupon. Will be present only when associated code for a coupon is used.
2882
+
2883
+ */
2687
2884
 
2688
2885
  coupon_code?:string;
2689
2886
  }
@@ -2798,7 +2995,7 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2798
2995
 
2799
2996
  */
2800
2997
 
2801
- index?:number;
2998
+ index:number;
2802
2999
  }
2803
3000
  export interface ReferralInfo {
2804
3001
  /**
@@ -2848,14 +3045,14 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2848
3045
 
2849
3046
  */
2850
3047
 
2851
- account_id?:string;
3048
+ account_id:string;
2852
3049
 
2853
3050
  /**
2854
3051
  * @description Referral campaign id
2855
3052
 
2856
3053
  */
2857
3054
 
2858
- campaign_id?:string;
3055
+ campaign_id:string;
2859
3056
 
2860
3057
  /**
2861
3058
  * @description Referral external campaign id
@@ -2897,7 +3094,7 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2897
3094
 
2898
3095
  */
2899
3096
 
2900
- post_purchase_widget_enabled?:boolean;
3097
+ post_purchase_widget_enabled:boolean;
2901
3098
  }
2902
3099
  export interface ContractTerm {
2903
3100
  /**
@@ -2905,7 +3102,7 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2905
3102
 
2906
3103
  */
2907
3104
 
2908
- id?:string;
3105
+ id:string;
2909
3106
 
2910
3107
  /**
2911
3108
  * @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:
@@ -2915,28 +3112,28 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2915
3112
 
2916
3113
  */
2917
3114
 
2918
- status?:'active' | 'cancelled' | 'completed' | 'terminated';
3115
+ status:'active' | 'cancelled' | 'completed' | 'terminated';
2919
3116
 
2920
3117
  /**
2921
3118
  * @description The start date of the contract term
2922
3119
 
2923
3120
  */
2924
3121
 
2925
- contract_start?:number;
3122
+ contract_start:number;
2926
3123
 
2927
3124
  /**
2928
3125
  * @description The end date of the contract term
2929
3126
 
2930
3127
  */
2931
3128
 
2932
- contract_end?:number;
3129
+ contract_end:number;
2933
3130
 
2934
3131
  /**
2935
3132
  * @description The number of billing cycles of the subscription that the contract term is for.
2936
3133
 
2937
3134
  */
2938
3135
 
2939
- billing_cycle?:number;
3136
+ billing_cycle:number;
2940
3137
 
2941
3138
  /**
2942
3139
  * @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:
@@ -2949,21 +3146,21 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2949
3146
 
2950
3147
  */
2951
3148
 
2952
- action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen';
3149
+ action_at_term_end:'cancel' | 'renew_once' | 'renew' | 'evergreen';
2953
3150
 
2954
3151
  /**
2955
3152
  * @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
3153
 
2957
3154
  */
2958
3155
 
2959
- total_contract_value?:number;
3156
+ total_contract_value:number;
2960
3157
 
2961
3158
  /**
2962
3159
  * @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
3160
 
2964
3161
  */
2965
3162
 
2966
- total_contract_value_before_tax?:number;
3163
+ total_contract_value_before_tax:number;
2967
3164
 
2968
3165
  /**
2969
3166
  * @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
@@ -2977,14 +3174,14 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2977
3174
 
2978
3175
  */
2979
3176
 
2980
- created_at?:number;
3177
+ created_at:number;
2981
3178
 
2982
3179
  /**
2983
3180
  * @description The [Id](subscriptions#subscription_id) of the subscription that this contract term is for.
2984
3181
 
2985
3182
  */
2986
3183
 
2987
- subscription_id?:string;
3184
+ subscription_id:string;
2988
3185
 
2989
3186
  /**
2990
3187
  * @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.
@@ -2994,39 +3191,129 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
2994
3191
  remaining_billing_cycles?:number;
2995
3192
  }
2996
3193
  export interface Discount {
2997
- id?:string;
3194
+ /**
3195
+ * @description An immutable unique id for the discount. It is always auto-generated.
3196
+
3197
+ */
3198
+
3199
+ id:string;
3200
+
3201
+ /**
3202
+ * @description The name of the discount as it should appear on customer-facing pages and documents such as [invoices](/docs/api/invoices?prod_cat_ver&#x3D;2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver&#x3D;2). This is auto-generated based on the &#x60;type&#x60;, &#x60;amount&#x60;, and &#x60;currency_code&#x60; of the discount. For example, it can be &#x60;10% off&#x60; or &#x60;10$ off&#x60;.
3203
+
3204
+ */
2998
3205
 
2999
3206
  invoice_name?:string;
3000
3207
 
3001
- type?:'fixed_amount' | 'percentage';
3208
+ /**
3209
+ * @description The type of discount. Possible value are: \* percentage - The specified percentage will be given as discount. \* fixed_amount - The specified amount will be given as discount.
3210
+
3211
+ */
3212
+
3213
+ type:'fixed_amount' | 'percentage';
3214
+
3215
+ /**
3216
+ * @description The percentage of the original amount that should be deducted from it. Only applicable when &#x60;discount.type&#x60; is percentage.
3217
+
3218
+ */
3002
3219
 
3003
3220
  percentage?:number;
3004
3221
 
3222
+ /**
3223
+ * @description The value of the discount. [The format of this value](https://apidocs.chargebee.com/docs/api?prod_cat_ver&#x3D;2#currencies) depends on the kind of currency. This is only applicable when &#x60;discount.type&#x60; is &#x60;fixed_amount&#x60;.
3224
+
3225
+ */
3226
+
3005
3227
  amount?:number;
3006
3228
 
3229
+ /**
3230
+ * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the discount. This is only applicable when &#x60;discount.type&#x60; is &#x60;fixed_amount&#x60;.
3231
+
3232
+ */
3233
+
3007
3234
  currency_code?:string;
3008
3235
 
3009
- duration_type?:'limited_period' | 'one_time' | 'forever';
3236
+ /**
3237
+ * @description Specifies the time duration for which this discount is attached to the subscription. \* limited_period - The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by &#x60;period&#x60; and &#x60;period_unit&#x60;. \* forever - The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions?prod_cat_ver&#x3D;2#update_subscription_for_items_discounts_operation_type). \* one_time - The discount stays attached to the subscription till it is applied on an invoice **once**. It is removed after that from the subscription.
3238
+
3239
+ */
3240
+
3241
+ duration_type:'limited_period' | 'one_time' | 'forever';
3242
+
3243
+ /**
3244
+ * @description The duration of time for which the discount is attached to the subscription, in &#x60;period_units&#x60;. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;.
3245
+
3246
+ */
3010
3247
 
3011
3248
  period?:number;
3012
3249
 
3250
+ /**
3251
+ * @description The unit of time for &#x60;period&#x60;. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours. \* month - A period of 1 calendar month.
3252
+
3253
+ */
3254
+
3013
3255
  period_unit?:'week' | 'month' | 'year' | 'day';
3014
3256
 
3015
- included_in_mrr?:boolean;
3257
+ /**
3258
+ * @description The discount is included in MRR calculations for your site. This attribute is only applicable when &#x60;duration_type&#x60; is &#x60;one_time&#x60; and when the [feature is enabled](https://www.chargebee.com/docs/reporting.html#dashboards_flexible-mrr-calculation) in Chargebee. Also, If the [site-level setting](https://www.chargebee.com/docs/reporting.html#chart_flexible-mrr-calculation) is to exclude one-time discounts from MRR calculations, this value is always returned &#x60;false&#x60;.
3259
+
3260
+ */
3261
+
3262
+ included_in_mrr:boolean;
3016
3263
 
3017
- apply_on?:'specific_item_price' | 'invoice_amount';
3264
+ /**
3265
+ * @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice &#x60;sub_total&#x60;. \* specific_item_price - The discount is applied to the &#x60;invoice.line_item.amount&#x60; that corresponds to the item price specified by &#x60;item_price_id&#x60;.
3266
+
3267
+ */
3268
+
3269
+ apply_on:'specific_item_price' | 'invoice_amount';
3270
+
3271
+ /**
3272
+ * @description The [id of the item price](/docs/api/subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when &#x60;apply_on&#x60; &#x3D; &#x60;specific_item_price&#x60;.
3273
+
3274
+ */
3018
3275
 
3019
3276
  item_price_id?:string;
3020
3277
 
3021
- created_at?:number;
3278
+ /**
3279
+ * @description Timestamp indicating when this discount is created.
3280
+
3281
+ */
3282
+
3283
+ created_at:number;
3284
+
3285
+ /**
3286
+ * @description Specifies till when the limited period discount is applicable. This attribute will be sent in the response only for &#x60;limited_period&#x60; duration type discount.
3287
+
3288
+ */
3022
3289
 
3023
3290
  apply_till?:number;
3024
3291
 
3292
+ /**
3293
+ * @description Specifies the number of times the discount has been applied.
3294
+
3295
+ */
3296
+
3025
3297
  applied_count?:number;
3026
3298
 
3027
- coupon_id?:string;
3299
+ /**
3300
+ * @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
3301
+ **Note:**
3302
+
3303
+
3304
+ When the coupon ID contains a special character; for example: &#x60;#&#x60;, the API returns an error.
3305
+ Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
3306
+
3307
+ */
3308
+
3309
+ coupon_id:string;
3310
+
3311
+ /**
3312
+ * @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.
3313
+
3314
+ */
3028
3315
 
3029
- index?:number;
3316
+ index:number;
3030
3317
  }
3031
3318
  }
3032
3319
  }