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.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
- package/.github/ISSUE_TEMPLATE/config.yml +6 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- package/.github/workflows/greeting.yml +47 -0
- package/CHANGELOG.md +47 -0
- package/SECURITY.md +8 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +0 -7
- package/package.json +1 -1
- package/types/core.d.ts +4 -4
- package/types/resources/AttachedItem.d.ts +88 -88
- package/types/resources/Card.d.ts +68 -68
- package/types/resources/Comment.d.ts +50 -44
- package/types/resources/Coupon.d.ts +242 -207
- package/types/resources/CouponSet.d.ts +72 -68
- package/types/resources/CreditNote.d.ts +612 -236
- package/types/resources/Customer.d.ts +655 -513
- package/types/resources/DifferentialPrice.d.ts +99 -74
- package/types/resources/EntitlementOverride.d.ts +27 -12
- package/types/resources/Estimate.d.ts +450 -450
- package/types/resources/Event.d.ts +30 -12
- package/types/resources/Export.d.ts +200 -200
- package/types/resources/Feature.d.ts +66 -35
- package/types/resources/Gift.d.ts +54 -44
- package/types/resources/HostedPage.d.ts +381 -381
- package/types/resources/InAppSubscription.d.ts +94 -90
- package/types/resources/Invoice.d.ts +1242 -660
- package/types/resources/Item.d.ts +148 -142
- package/types/resources/ItemEntitlement.d.ts +36 -36
- package/types/resources/ItemFamily.d.ts +45 -45
- package/types/resources/ItemPrice.d.ts +317 -273
- package/types/resources/PaymentIntent.d.ts +60 -60
- package/types/resources/PaymentVoucher.d.ts +74 -59
- package/types/resources/PortalSession.d.ts +45 -20
- package/types/resources/PromotionalCredit.d.ts +68 -68
- package/types/resources/Purchase.d.ts +3 -3
- package/types/resources/Quote.d.ts +652 -363
- package/types/resources/QuoteLineGroup.d.ts +245 -0
- package/types/resources/QuotedCharge.d.ts +170 -0
- package/types/resources/QuotedSubscription.d.ts +219 -0
- package/types/resources/SiteMigrationDetail.d.ts +7 -7
- package/types/resources/Subscription.d.ts +1219 -932
- package/types/resources/SubscriptionEntitlement.d.ts +33 -12
- package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
- package/types/resources/TimeMachine.d.ts +15 -15
- package/types/resources/Token.d.ts +23 -23
- package/types/resources/Transaction.d.ts +229 -112
- package/types/resources/UnbilledCharge.d.ts +112 -67
- package/types/resources/Usage.d.ts +46 -47
- 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
|
|
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
|
|
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
|
-
|
|
444
|
+
create_with_items(customer_id:string, input?:CreateWithItemsInputParam):ChargebeeRequest<CreateWithItemsResponse>;
|
|
438
445
|
|
|
439
446
|
/**
|
|
440
|
-
* @description
|
|
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=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
|
-
|
|
451
|
+
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
447
452
|
|
|
448
453
|
/**
|
|
449
|
-
* @description
|
|
454
|
+
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
450
455
|
|
|
451
456
|
*/
|
|
452
457
|
|
|
453
|
-
|
|
458
|
+
contract_terms_for_subscription(subscription_id:string, input?:ContractTermsForSubscriptionInputParam):ChargebeeRequest<ContractTermsForSubscriptionResponse>;
|
|
454
459
|
|
|
455
460
|
/**
|
|
456
|
-
* @description
|
|
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 "in-term resumption"?**
|
|
465
|
-
An "in-term resumption" 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 `{subscription_id}`. The list is sorted by date of creation, in descending order.
|
|
476
462
|
|
|
477
463
|
*/
|
|
478
464
|
|
|
479
|
-
|
|
465
|
+
list_discounts(subscription_id:string, input?:ListDiscountsInputParam):ChargebeeRequest<ListDiscountsResponse>;
|
|
480
466
|
|
|
481
467
|
/**
|
|
482
|
-
* @description
|
|
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=2&lang=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
|
-
* `credit_option_for_current_term_charges`
|
|
489
|
-
* `unbilled_charges_option`
|
|
490
|
-
* `account_receivables_handling`
|
|
491
|
-
* `refundable_credits_handling`
|
|
492
|
-
* From among the parameters for this request, `end_of_term` or `cancel_at` should not be passed when using contract terms; use `contract_term_cancel_option` instead.
|
|
493
|
-
* The `subscription_items` parameter is used to override price or quantity for the termination fee. To use this parameter, the following two conditions must be met:
|
|
494
|
-
* `contract_term_cancel_option` must be set to `terminate_now`.
|
|
495
|
-
* the subscription must have a [subscription_items](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items) attribute with `charge_on_event` set to `contract_term_termination`.
|
|
468
|
+
* @description Retrieves a subscription.
|
|
496
469
|
|
|
497
470
|
*/
|
|
498
471
|
|
|
499
|
-
|
|
472
|
+
retrieve(subscription_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
500
473
|
|
|
501
474
|
/**
|
|
502
|
-
* @description
|
|
475
|
+
* @description Retrieves a subscription with the scheduled changes applied.
|
|
476
|
+
**Note:** Only the following attributes are changed
|
|
503
477
|
|
|
504
|
-
|
|
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=2#void_an_invoice) or [deleted](/docs/api/invoices?prod_cat_ver=2#delete_an_invoice).
|
|
507
|
-
* The subscription `status` must be `active` or `non_renewing`.
|
|
508
|
-
* There should be no [unbilled charges](/docs/api/unbilled_charges?prod_cat_ver=2) for non-`metered` items for the current term.
|
|
509
|
-
* There should be no [unbilled charges](/docs/api/unbilled_charges?prod_cat_ver=2) for `metered` 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=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
|
-
|
|
492
|
+
retrieve_with_scheduled_changes(subscription_id:string):ChargebeeRequest<RetrieveWithScheduledChangesResponse>;
|
|
519
493
|
|
|
520
494
|
/**
|
|
521
|
-
* @description
|
|
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
|
-
|
|
499
|
+
remove_scheduled_changes(subscription_id:string):ChargebeeRequest<RemoveScheduledChangesResponse>;
|
|
526
500
|
|
|
527
501
|
/**
|
|
528
|
-
* @description
|
|
502
|
+
* @description **Note:** Cannot be called when the subscription is on a [contract term](contract_terms). (That is, when the `contract_term.status attribute` is `active`.)
|
|
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
|
-
|
|
510
|
+
remove_scheduled_cancellation(subscription_id:string, input?:RemoveScheduledCancellationInputParam):ChargebeeRequest<RemoveScheduledCancellationResponse>;
|
|
533
511
|
|
|
534
512
|
/**
|
|
535
|
-
* @description
|
|
513
|
+
* @description Removes Coupons associated with the Subscription. If the param 'coupon_ids' is not specified, all the Coupons linked to the Subscription will be removed.
|
|
536
514
|
|
|
537
515
|
*/
|
|
538
516
|
|
|
539
|
-
|
|
517
|
+
remove_coupons(subscription_id:string, input?:RemoveCouponsInputParam):ChargebeeRequest<RemoveCouponsResponse>;
|
|
540
518
|
|
|
541
519
|
/**
|
|
542
|
-
* @description **Note:**
|
|
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=2#create_a_payment_intent) a `payment_intent` and provide it via this endpoint.
|
|
545
521
|
|
|
546
|
-
|
|
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=2#customer_balances) for the customer are automatically applied.
|
|
547
523
|
|
|
548
524
|
*/
|
|
549
525
|
|
|
550
|
-
|
|
526
|
+
update_for_items(subscription_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
|
|
551
527
|
|
|
552
528
|
/**
|
|
553
|
-
* @description
|
|
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's current term end date. Depending on the "status" of the subscription, "term end date" 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'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
|
-
|
|
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 [`auto_collection`](subscriptions#subscription_auto_collection) is `on` for the subscription, the [`payment_source`](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 [`paused`](subscriptions#subscription_status) status. Advance invoices are generated only for non-`metered` 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
|
|
579
|
+
* @description Creates an advance invoice or an [advance invoicing schedule](advance_invoice_schedules#advance_invoice_schedule). When an advance invoice is generated, and [`auto_collection`](subscriptions#subscription_auto_collection) is `on` for the subscription, the [`payment_source`](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 [`paused`](subscriptions#subscription_status) status. Advance invoices are generated only for non-`metered` items in a subscription.
|
|
618
580
|
|
|
619
581
|
*/
|
|
620
582
|
|
|
621
|
-
|
|
583
|
+
charge_future_renewals(subscription_id:string, input?:ChargeFutureRenewalsInputParam):ChargebeeRequest<ChargeFutureRenewalsResponse>;
|
|
622
584
|
|
|
623
585
|
/**
|
|
624
|
-
* @description
|
|
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'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
|
-
|
|
590
|
+
edit_advance_invoice_schedule(subscription_id:string, input?:EditAdvanceInvoiceScheduleInputParam):ChargebeeRequest<EditAdvanceInvoiceScheduleResponse>;
|
|
635
591
|
|
|
636
592
|
/**
|
|
637
|
-
* @description
|
|
593
|
+
* @description Retrieves the *advance_invoice_schedule* for a subscription. Note that this endpoint is only applicable for *schedule_type = specific_dates* or fixed_intervals.
|
|
638
594
|
|
|
639
595
|
*/
|
|
640
596
|
|
|
641
|
-
|
|
597
|
+
retrieve_advance_invoice_schedule(subscription_id:string):ChargebeeRequest<RetrieveAdvanceInvoiceScheduleResponse>;
|
|
642
598
|
|
|
643
599
|
/**
|
|
644
|
-
* @description
|
|
645
|
-
|
|
646
|
-
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.
|
|
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 = specific_dates*, you also have the option of deleting a part of the schedule.
|
|
650
601
|
|
|
651
602
|
*/
|
|
652
603
|
|
|
653
|
-
|
|
604
|
+
remove_advance_invoice_schedule(subscription_id:string, input?:RemoveAdvanceInvoiceScheduleInputParam):ChargebeeRequest<RemoveAdvanceInvoiceScheduleResponse>;
|
|
654
605
|
|
|
655
606
|
/**
|
|
656
|
-
* @description
|
|
607
|
+
* @description Regenerates the current invoice for the subscription. The current invoice is that which includes non-`metered` items from the current term and `metered` 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
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
611
|
+
* The current invoice of the subscription must have been [voided](/docs/api/invoices?prod_cat_ver=2#void_an_invoice) or [deleted](/docs/api/invoices?prod_cat_ver=2#delete_an_invoice).
|
|
612
|
+
* The subscription `status` must be `active` or `non_renewing`.
|
|
613
|
+
* There should be no [unbilled charges](/docs/api/unbilled_charges?prod_cat_ver=2) for non-`metered` items for the current term.
|
|
614
|
+
* There should be no [unbilled charges](/docs/api/unbilled_charges?prod_cat_ver=2) for `metered` 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=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
|
-
|
|
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 `active` 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
|
|
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
|
-
|
|
639
|
+
import_unbilled_charges(subscription_id:string, input?:ImportUnbilledChargesInputParam):ChargebeeRequest<ImportUnbilledChargesResponse>;
|
|
698
640
|
|
|
699
641
|
/**
|
|
700
|
-
* @description
|
|
642
|
+
* @description Imports a subscription into Chargebee.
|
|
701
643
|
|
|
702
644
|
*/
|
|
703
645
|
|
|
704
|
-
|
|
646
|
+
import_for_items(customer_id:string, input:ImportForItemsInputParam):ChargebeeRequest<ImportForItemsResponse>;
|
|
705
647
|
|
|
706
648
|
/**
|
|
707
|
-
* @description
|
|
649
|
+
* @description Assigns the payment source and sets auto collection state for the subscription.
|
|
708
650
|
|
|
709
651
|
*/
|
|
710
652
|
|
|
711
|
-
|
|
653
|
+
override_billing_profile(subscription_id:string, input?:OverrideBillingProfileInputParam):ChargebeeRequest<OverrideBillingProfileResponse>;
|
|
712
654
|
|
|
713
655
|
/**
|
|
714
|
-
* @description
|
|
656
|
+
* @description Deletes the subscription resource.
|
|
715
657
|
|
|
716
658
|
*/
|
|
717
659
|
|
|
718
|
-
|
|
660
|
+
delete(subscription_id:string):ChargebeeRequest<DeleteResponse>;
|
|
719
661
|
|
|
720
662
|
/**
|
|
721
663
|
* @description Pauses the subscription, changing its `status` to `paused`. 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 `active` 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
|
|
678
|
+
* @description Cancels the subscription.
|
|
744
679
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
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=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=2&lang=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
|
+
* `credit_option_for_current_term_charges`
|
|
685
|
+
* `unbilled_charges_option`
|
|
686
|
+
* `account_receivables_handling`
|
|
687
|
+
* `refundable_credits_handling`
|
|
688
|
+
* From among the parameters for this request, `end_of_term` or `cancel_at` should not be passed when using contract terms; use `contract_term_cancel_option` instead.
|
|
689
|
+
* The `subscription_items` parameter is used to override price or quantity for the termination fee. To use this parameter, the following two conditions must be met:
|
|
690
|
+
* `contract_term_cancel_option` must be set to `terminate_now`.
|
|
691
|
+
* the subscription must have a [subscription_items](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items) attribute with `charge_on_event` set to `contract_term_termination`.
|
|
766
692
|
|
|
767
693
|
*/
|
|
768
|
-
|
|
769
|
-
|
|
694
|
+
|
|
695
|
+
cancel_for_items(subscription_id:string, input?:CancelForItemsInputParam):ChargebeeRequest<CancelForItemsResponse>;
|
|
770
696
|
|
|
771
697
|
/**
|
|
772
|
-
* @description
|
|
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
|
-
|
|
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 "in-term resumption"?**
|
|
707
|
+
An "in-term resumption" 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
|
|
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
|
-
|
|
782
|
-
|
|
783
|
-
|
|
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
|
-
|
|
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
|
|
792
|
-
|
|
793
|
-
* `invoice_date` must be in the past.
|
|
794
|
-
* `invoice_date` 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 `changes_scheduled_at`, `reactivate_from`, or `trial_end`.
|
|
796
|
-
* `invoice_immediately` is `true`.
|
|
797
|
-
.
|
|
751
|
+
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
798
752
|
|
|
799
753
|
*/
|
|
800
754
|
|
|
801
|
-
|
|
755
|
+
id?:string;
|
|
802
756
|
|
|
803
757
|
/**
|
|
804
|
-
* @description The
|
|
758
|
+
* @description The unique ID of the [business entity](/docs/api/advanced-features?prod_cat_ver=2#mbe) this subscription should be [linked](/docs/api/advanced-features?prod_cat_ver=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 `{customer_id}` 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=2#mbe-header-main).
|
|
762
|
+
.
|
|
805
763
|
|
|
806
764
|
*/
|
|
807
765
|
|
|
808
|
-
|
|
766
|
+
business_entity_id?:string;
|
|
809
767
|
|
|
810
768
|
/**
|
|
811
|
-
* @description
|
|
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 `start_date`. Set it to `0` to have no trial period.
|
|
812
770
|
|
|
813
771
|
*/
|
|
814
772
|
|
|
815
773
|
trial_end?:number;
|
|
816
774
|
|
|
817
775
|
/**
|
|
818
|
-
* @description
|
|
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=2#item_price_billing_cycles) is used.
|
|
819
777
|
|
|
820
778
|
*/
|
|
821
779
|
|
|
822
780
|
billing_cycles?:number;
|
|
823
781
|
|
|
824
782
|
/**
|
|
825
|
-
* @description
|
|
783
|
+
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
826
784
|
|
|
827
785
|
*/
|
|
828
786
|
|
|
829
|
-
|
|
787
|
+
mandatory_items_to_remove?:string[];
|
|
830
788
|
|
|
831
789
|
/**
|
|
832
|
-
* @description
|
|
833
|
-
**Note:** It is recommended not to pass this parameter along with `changed_scheduled_at`. `reactivate_from` 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
|
-
*
|
|
836
|
-
* The
|
|
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, `changes_scheduled_at` 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 `net_term_days` defined at the [customer level](customers#customer_net_term_days) is considered.
|
|
839
794
|
.
|
|
840
795
|
|
|
841
796
|
*/
|
|
842
797
|
|
|
843
|
-
|
|
798
|
+
net_term_days?:number;
|
|
844
799
|
|
|
845
800
|
/**
|
|
846
|
-
* @description
|
|
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, `start_date` cannot be earlier than 14th February.
|
|
806
|
+
.
|
|
847
807
|
|
|
848
808
|
*/
|
|
849
809
|
|
|
850
|
-
|
|
810
|
+
start_date?:number;
|
|
851
811
|
|
|
852
812
|
/**
|
|
853
813
|
* @description Defines whether payments need to be collected automatically for this subscription. Overrides customer'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 `active` state, import is allowed only if the as
|
|
|
857
817
|
auto_collection?:AutoCollection;
|
|
858
818
|
|
|
859
819
|
/**
|
|
860
|
-
* @description The
|
|
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
|
-
|
|
824
|
+
terms_to_charge?:number;
|
|
872
825
|
|
|
873
826
|
/**
|
|
874
|
-
* @description
|
|
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
|
-
|
|
831
|
+
billing_alignment_mode?:BillingAlignmentMode;
|
|
879
832
|
|
|
880
833
|
/**
|
|
881
|
-
* @description
|
|
834
|
+
* @description Purchase order number for this subscription.
|
|
882
835
|
|
|
883
836
|
*/
|
|
884
837
|
|
|
885
|
-
|
|
838
|
+
po_number?:string;
|
|
886
839
|
|
|
887
840
|
/**
|
|
888
|
-
* @description
|
|
889
|
-
* When `false`: 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 `prorate` is set to `true`, **credits** are **not created** when **all** the conditions below hold true:
|
|
895
|
-
|
|
896
|
-
An immediate previous change was made
|
|
897
|
-
|
|
898
|
-
* with `prorate` set to `false` and
|
|
899
|
-
* no changes were made to the subscription's billing term and
|
|
900
|
-
* a change was made to either the subscription'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
|
-
|
|
845
|
+
coupon_ids?:string[];
|
|
905
846
|
|
|
906
847
|
/**
|
|
907
|
-
* @description
|
|
848
|
+
* @description Id of the payment source to be attached to this subscription.
|
|
908
849
|
|
|
909
850
|
*/
|
|
910
851
|
|
|
911
|
-
|
|
852
|
+
payment_source_id?:string;
|
|
912
853
|
|
|
913
854
|
/**
|
|
914
|
-
* @description
|
|
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 `true`, ignores the [hierarchy relationship](./customers?prod_cat_ver=2#customer_relationship) and uses customer as payment and invoice owner.
|
|
916
856
|
|
|
917
857
|
*/
|
|
918
858
|
|
|
919
|
-
|
|
859
|
+
override_relationship?:boolean;
|
|
920
860
|
|
|
921
861
|
/**
|
|
922
|
-
* @description
|
|
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
|
-
|
|
866
|
+
invoice_notes?:string;
|
|
927
867
|
|
|
928
868
|
/**
|
|
929
|
-
* @description The
|
|
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 `create_pending_invoices` is set to `true`, 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. `taxes` and `line_item_taxes` are computed based on the tax configuration as of `invoice_date`. When passing this parameter, the following prerequisites must be met:
|
|
930
870
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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
|
+
* `invoice_date` must be in the past.
|
|
872
|
+
* It is not earlier than `start_date`.
|
|
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
|
+
* `invoice_immediately` is true.
|
|
875
|
+
.
|
|
937
876
|
|
|
938
877
|
*/
|
|
939
878
|
|
|
940
|
-
|
|
879
|
+
invoice_date?:number;
|
|
941
880
|
|
|
942
881
|
/**
|
|
943
|
-
* @description A
|
|
882
|
+
* @description A collection of key-value pairs that provides extra information about the subscription.
|
|
883
|
+
**Note:** There's a character limit of 65,535.
|
|
884
|
+
[Learn more](advanced-features?prod_cat_ver=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
|
|
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
|
-
|
|
903
|
+
replace_primary_payment_source?:boolean;
|
|
963
904
|
|
|
964
905
|
/**
|
|
965
|
-
* @description
|
|
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 `status` is `active`, `cancelled`, or `non_renewing`.
|
|
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 `current_term_start`.
|
|
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, `changes_scheduled_at` 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
|
-
|
|
910
|
+
free_period?:number;
|
|
983
911
|
|
|
984
912
|
/**
|
|
985
|
-
* @description
|
|
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
|
-
|
|
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 `billing_cycles` 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 `pending` `status`. This attribute is set to `true` automatically when the subscription has item prices that belong to `metered` 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
|
|
949
|
+
* @description If you want to bill the usages from the previous billing cycle, set this parameter to `true`. This is useful if the subscription has moved from another system into Chargebee and you haven't closed the previous cycle's invoice yet. This creates a `pending` 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-`metered` items are present for the current term, they're also added to this `pending` invoice. As with all `pending` 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 `create_pending_invoices` is `true`
|
|
952
|
+
.
|
|
1043
953
|
|
|
1044
954
|
*/
|
|
1045
955
|
|
|
1046
|
-
|
|
956
|
+
first_invoice_pending?:boolean;
|
|
1047
957
|
|
|
1048
958
|
/**
|
|
1049
|
-
* @description
|
|
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 `trial_end_action` is defined for the plan. \* site_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when `trial_end_action` is **not** defined for the plan.
|
|
1050
960
|
|
|
1051
961
|
*/
|
|
1052
962
|
|
|
1053
|
-
|
|
963
|
+
trial_end_action?:TrialEndAction;
|
|
1054
964
|
|
|
1055
965
|
/**
|
|
1056
|
-
* @description
|
|
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
|
-
|
|
970
|
+
payment_initiator?:PaymentInitiator;
|
|
1061
971
|
|
|
1062
972
|
/**
|
|
1063
|
-
* @description Parameters for
|
|
973
|
+
* @description Parameters for shipping_address
|
|
1064
974
|
|
|
1065
975
|
*/
|
|
1066
976
|
|
|
1067
|
-
|
|
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
|
|
980
|
+
* @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.
|
|
1071
981
|
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
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=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
|
-
|
|
989
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
1082
990
|
|
|
1083
991
|
/**
|
|
1084
|
-
* @description Parameters for
|
|
992
|
+
* @description Parameters for payment_intent
|
|
1085
993
|
|
|
1086
994
|
*/
|
|
1087
995
|
|
|
1088
|
-
|
|
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' | '
|
|
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,
|
|
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
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
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
|
|
1035
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1129
1036
|
|
|
1130
1037
|
*/
|
|
1131
1038
|
|
|
1132
|
-
|
|
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 'specific_date'.
|
|
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 'immediately'. 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 'immediately'. Allows to collect past due invoices or retain them as unpaid. If 'schedule_payment_collection' 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
|
|
1203
|
-
|
|
1204
|
-
/**
|
|
1205
|
-
* @description Set this to `true` if you want to cancel the subscription at the end of the current subscription billing cycle. The subscription `status` changes to `non_renewing`.
|
|
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 `end_of_term` is passed as `true`. `cancel_at` 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 `current_term_start`.
|
|
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's plan is 2 months and today is 14th April, `changes_scheduled_at` 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
|
|
1044
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1229
1045
|
|
|
1230
1046
|
*/
|
|
1231
|
-
|
|
1232
|
-
|
|
1047
|
+
|
|
1048
|
+
limit?:number;
|
|
1233
1049
|
|
|
1234
1050
|
/**
|
|
1235
|
-
* @description
|
|
1051
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1236
1052
|
|
|
1237
1053
|
*/
|
|
1238
|
-
|
|
1239
|
-
|
|
1054
|
+
|
|
1055
|
+
offset?:string;
|
|
1240
1056
|
|
|
1241
1057
|
/**
|
|
1242
|
-
* @description
|
|
1058
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1243
1059
|
|
|
1244
1060
|
*/
|
|
1245
|
-
|
|
1246
|
-
|
|
1061
|
+
|
|
1062
|
+
include_deleted?:boolean;
|
|
1247
1063
|
|
|
1248
1064
|
/**
|
|
1249
|
-
* @description
|
|
1065
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1250
1066
|
|
|
1251
1067
|
*/
|
|
1252
|
-
|
|
1253
|
-
|
|
1068
|
+
|
|
1069
|
+
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1254
1070
|
|
|
1255
1071
|
/**
|
|
1256
|
-
* @description
|
|
1257
|
-
|
|
1258
|
-
* `terminate_immediately` immediately does the following:
|
|
1259
|
-
* sets the contract term [`status`](contract_terms#contract_term_status) to `terminated`.
|
|
1260
|
-
* Cancels the subscription.
|
|
1261
|
-
* Collects any [termination fee](contract_terms#termintation_fee).
|
|
1262
|
-
* `end_of_contract_term` Sets the [`contract_term[action_at_term_end]`](contract_terms#contract_term_action_at_term_end) to `cancel`. 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
|
-
|
|
1075
|
+
|
|
1076
|
+
customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1268
1077
|
|
|
1269
1078
|
/**
|
|
1270
|
-
* @description
|
|
1271
|
-
|
|
1272
|
-
* `invoice_date` must be in the past.
|
|
1273
|
-
* `invoice_date` 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 `cancel_at`.
|
|
1275
|
-
.
|
|
1079
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1276
1080
|
|
|
1277
1081
|
*/
|
|
1278
|
-
|
|
1279
|
-
|
|
1082
|
+
|
|
1083
|
+
item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1280
1084
|
|
|
1281
1085
|
/**
|
|
1282
|
-
* @description
|
|
1086
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1283
1087
|
|
|
1284
1088
|
*/
|
|
1285
|
-
|
|
1286
|
-
|
|
1089
|
+
|
|
1090
|
+
item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1287
1091
|
|
|
1288
1092
|
/**
|
|
1289
|
-
* @description
|
|
1093
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1290
1094
|
|
|
1291
1095
|
*/
|
|
1292
|
-
|
|
1293
|
-
|
|
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
|
|
1100
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1304
1101
|
|
|
1305
1102
|
*/
|
|
1306
|
-
|
|
1307
|
-
|
|
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
|
|
1107
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1311
1108
|
|
|
1312
1109
|
*/
|
|
1313
|
-
|
|
1314
|
-
|
|
1110
|
+
|
|
1111
|
+
cancel_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1315
1112
|
|
|
1316
1113
|
/**
|
|
1317
|
-
* @description
|
|
1114
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1318
1115
|
|
|
1319
1116
|
*/
|
|
1320
|
-
|
|
1321
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
1142
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1349
1143
|
|
|
1350
1144
|
*/
|
|
1351
1145
|
|
|
1352
|
-
|
|
1146
|
+
cancelled_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1353
1147
|
|
|
1354
1148
|
/**
|
|
1355
|
-
* @description
|
|
1149
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1356
1150
|
|
|
1357
1151
|
*/
|
|
1358
1152
|
|
|
1359
|
-
|
|
1153
|
+
has_scheduled_changes?:{is?:'true' | 'false'};
|
|
1360
1154
|
|
|
1361
1155
|
/**
|
|
1362
|
-
* @description
|
|
1156
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1363
1157
|
|
|
1364
1158
|
*/
|
|
1365
1159
|
|
|
1366
|
-
|
|
1160
|
+
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1367
1161
|
|
|
1368
1162
|
/**
|
|
1369
|
-
* @description
|
|
1163
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1370
1164
|
|
|
1371
1165
|
*/
|
|
1372
1166
|
|
|
1373
|
-
|
|
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
|
|
1170
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1377
1171
|
|
|
1378
1172
|
*/
|
|
1379
1173
|
|
|
1380
|
-
|
|
1174
|
+
auto_close_invoices?:{is?:'true' | 'false'};
|
|
1381
1175
|
|
|
1382
1176
|
/**
|
|
1383
|
-
* @description
|
|
1177
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1384
1178
|
|
|
1385
1179
|
*/
|
|
1386
1180
|
|
|
1387
|
-
|
|
1181
|
+
override_relationship?:{is?:'true' | 'false'};
|
|
1388
1182
|
|
|
1389
1183
|
/**
|
|
1390
|
-
* @description
|
|
1184
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1391
1185
|
|
|
1392
1186
|
*/
|
|
1393
1187
|
|
|
1394
|
-
|
|
1188
|
+
sort_by?:{asc?:'updated_at' | 'created_at',desc?:'updated_at' | 'created_at'};
|
|
1395
1189
|
|
|
1396
1190
|
/**
|
|
1397
|
-
* @description
|
|
1191
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1398
1192
|
|
|
1399
1193
|
*/
|
|
1400
1194
|
|
|
1401
|
-
|
|
1195
|
+
business_entity_id?:{is?:string,is_not?:string,starts_with?:string};
|
|
1402
1196
|
|
|
1403
1197
|
/**
|
|
1404
|
-
* @description
|
|
1198
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1405
1199
|
|
|
1406
1200
|
*/
|
|
1407
1201
|
|
|
1408
|
-
|
|
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
|
|
1206
|
+
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
1412
1207
|
|
|
1413
1208
|
*/
|
|
1414
|
-
|
|
1415
|
-
|
|
1209
|
+
|
|
1210
|
+
list:{contract_term:ContractTerm}[];
|
|
1416
1211
|
|
|
1417
1212
|
/**
|
|
1418
|
-
* @description
|
|
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
|
|
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
|
-
|
|
1226
|
+
limit?:number;
|
|
1431
1227
|
|
|
1432
1228
|
/**
|
|
1433
|
-
* @description
|
|
1229
|
+
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
1434
1230
|
|
|
1435
1231
|
*/
|
|
1436
1232
|
|
|
1437
|
-
|
|
1438
|
-
|
|
1233
|
+
offset?:string;
|
|
1234
|
+
}
|
|
1235
|
+
export interface ListDiscountsResponse {
|
|
1439
1236
|
/**
|
|
1440
|
-
* @description
|
|
1237
|
+
* @description Returns a list of discounts currently attached to the subscription given by `{subscription_id}`. The list is sorted by date of creation, in descending order.
|
|
1441
1238
|
|
|
1442
1239
|
*/
|
|
1443
|
-
|
|
1444
|
-
|
|
1240
|
+
|
|
1241
|
+
list:{discount:Discount}[];
|
|
1445
1242
|
|
|
1446
1243
|
/**
|
|
1447
|
-
* @description
|
|
1244
|
+
* @description Returns a list of discounts currently attached to the subscription given by `{subscription_id}`. 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
|
|
1253
|
+
* @description Returns a list of discounts currently attached to the subscription given by `{subscription_id}`. The list is sorted by date of creation, in descending order.
|
|
1455
1254
|
|
|
1456
1255
|
*/
|
|
1457
1256
|
|
|
1458
|
-
|
|
1257
|
+
limit?:number;
|
|
1459
1258
|
|
|
1460
1259
|
/**
|
|
1461
|
-
* @description
|
|
1260
|
+
* @description Returns a list of discounts currently attached to the subscription given by `{subscription_id}`. The list is sorted by date of creation, in descending order.
|
|
1462
1261
|
|
|
1463
1262
|
*/
|
|
1464
1263
|
|
|
1465
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
1340
|
+
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
1483
1341
|
|
|
1484
1342
|
*/
|
|
1485
|
-
|
|
1486
|
-
|
|
1343
|
+
|
|
1344
|
+
mandatory_items_to_remove?:string[];
|
|
1487
1345
|
|
|
1488
1346
|
/**
|
|
1489
|
-
* @description If `true`
|
|
1347
|
+
* @description If `true` then the existing `subscription_items` list for the subscription is replaced by the one provided. If `false` then the provided `subscription_items` list gets added to the existing list.
|
|
1490
1348
|
|
|
1491
1349
|
*/
|
|
1492
|
-
|
|
1493
|
-
|
|
1350
|
+
|
|
1351
|
+
replace_items_list?:boolean;
|
|
1494
1352
|
|
|
1495
1353
|
/**
|
|
1496
|
-
* @description
|
|
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 `0` 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 `-1`: The attribute is reset and therefore not returned by the API. In this case, when an invoice is raised -- whether now or later -- the `net_term_days` 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
|
-
|
|
1362
|
+
|
|
1363
|
+
net_term_days?:number;
|
|
1501
1364
|
|
|
1502
1365
|
/**
|
|
1503
|
-
* @description The
|
|
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 `create_pending_invoices` is set to `true`, 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 `invoice_date`. When passing this parameter, the following prerequisites must be met:
|
|
1506
1367
|
|
|
1507
|
-
|
|
1368
|
+
* `invoice_date` must be in the past.
|
|
1369
|
+
* `invoice_date` 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 `changes_scheduled_at`, `reactivate_from`, or `trial_end`.
|
|
1371
|
+
* `invoice_immediately` is `true`.
|
|
1372
|
+
.
|
|
1508
1373
|
|
|
1509
1374
|
*/
|
|
1510
|
-
|
|
1511
|
-
|
|
1375
|
+
|
|
1376
|
+
invoice_date?:number;
|
|
1512
1377
|
|
|
1513
1378
|
/**
|
|
1514
|
-
* @description The
|
|
1379
|
+
* @description The new start date of a `future` subscription. Applicable only for `future` 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
|
-
|
|
1383
|
+
start_date?:number;
|
|
1526
1384
|
|
|
1527
|
-
invoice?:Invoice;
|
|
1528
|
-
}
|
|
1529
|
-
export interface ImportForItemsInputParam {
|
|
1530
|
-
[key : string] : any;
|
|
1531
1385
|
/**
|
|
1532
|
-
* @description
|
|
1386
|
+
* @description The time at which the trial has ended or will end for the subscription. This is only allowed when the subscription `status` is `future`, `in_trial`, or `cancelled`. Also, the value must not be earlier than `changes_scheduled_at` or `start_date`. **Note** : This parameter can be backdated (set to a value in the past) only when the subscription is in `cancelled` or `in_trial` `status`. Do this to keep a record of when the trial ended in case it ended at some point in the past. When `trial_end` is backdated, the subscription immediately goes into `active` or `non_renewing` status.
|
|
1533
1387
|
|
|
1534
1388
|
*/
|
|
1535
1389
|
|
|
1536
|
-
|
|
1390
|
+
trial_end?:number;
|
|
1537
1391
|
|
|
1538
1392
|
/**
|
|
1539
|
-
* @description
|
|
1393
|
+
* @description Billing cycles set for plan-item price is used by default.
|
|
1540
1394
|
|
|
1541
1395
|
*/
|
|
1542
1396
|
|
|
1543
|
-
|
|
1397
|
+
billing_cycles?:number;
|
|
1544
1398
|
|
|
1545
1399
|
/**
|
|
1546
|
-
* @description The number of billing cycles the subscription
|
|
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 `terms_to_charge` is inclusive of this new term. See description for the `force_term_reset` parameter to learn more about when a subscription term is reset.
|
|
1547
1401
|
|
|
1548
1402
|
*/
|
|
1549
1403
|
|
|
1550
|
-
|
|
1404
|
+
terms_to_charge?:number;
|
|
1551
1405
|
|
|
1552
1406
|
/**
|
|
1553
|
-
* @description
|
|
1407
|
+
* @description If the subscription `status` is `cancelled` 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 `changed_scheduled_at`. `reactivate_from` 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
|
-
*
|
|
1556
|
-
*
|
|
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, `changes_scheduled_at` cannot be earlier than 14th February.
|
|
1557
1414
|
.
|
|
1558
1415
|
|
|
1559
1416
|
*/
|
|
1560
1417
|
|
|
1561
|
-
|
|
1418
|
+
reactivate_from?:number;
|
|
1562
1419
|
|
|
1563
1420
|
/**
|
|
1564
|
-
* @description
|
|
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
|
-
|
|
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'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
|
|
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
|
-
|
|
1439
|
+
offline_payment_method?:OfflinePaymentMethod;
|
|
1583
1440
|
|
|
1584
1441
|
/**
|
|
1585
|
-
* @description
|
|
1442
|
+
* @description Purchase order number for this subscription.
|
|
1586
1443
|
|
|
1587
1444
|
*/
|
|
1588
1445
|
|
|
1589
|
-
|
|
1446
|
+
po_number?:string;
|
|
1590
1447
|
|
|
1591
1448
|
/**
|
|
1592
|
-
* @description
|
|
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 `changes_scheduled_at` 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
|
-
|
|
1453
|
+
coupon_ids?:string[];
|
|
1597
1454
|
|
|
1598
1455
|
/**
|
|
1599
|
-
* @description
|
|
1456
|
+
* @description If `true` then the existing `coupon_ids` list for the subscription is replaced by the one provided. If `false` then the provided list gets added to the existing `coupon_ids`.
|
|
1600
1457
|
|
|
1601
1458
|
*/
|
|
1602
1459
|
|
|
1603
|
-
|
|
1460
|
+
replace_coupon_list?:boolean;
|
|
1604
1461
|
|
|
1605
1462
|
/**
|
|
1606
|
-
* @description
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
**Note:**
|
|
1463
|
+
* @description * When `true`: [Prorated credits or charges](https://www.chargebee.com/docs/2.0/proration.html#proration-mechanism) are created as applicable for this change.
|
|
1464
|
+
* When `false`: 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
|
|
1469
|
+
For further changes within the same billing term, when `prorate` is set to `true`, **credits** are **not created** when **all** the conditions below hold true:
|
|
1614
1470
|
|
|
1471
|
+
An immediate previous change was made
|
|
1615
1472
|
|
|
1473
|
+
* with `prorate` set to `false` and
|
|
1474
|
+
* no changes were made to the subscription's billing term and
|
|
1475
|
+
* a change was made to either the subscription'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
|
-
|
|
1486
|
+
end_of_term?:boolean;
|
|
1622
1487
|
|
|
1623
1488
|
/**
|
|
1624
|
-
* @description
|
|
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 `true` will have the subscription reset its term to the current date (provided `end_of_term` 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
|
-
|
|
1494
|
+
force_term_reset?:boolean;
|
|
1629
1495
|
|
|
1630
1496
|
/**
|
|
1631
|
-
* @description
|
|
1497
|
+
* @description When the `status` of the subscription is `cancelled`, this parameter determines whether the subscription is reactivated upon making this API request. Unless passed explicitly as `false`, this parameter is implied as `true` when you provide the `subscription_items` parameter.
|
|
1632
1498
|
|
|
1633
1499
|
*/
|
|
1634
1500
|
|
|
1635
|
-
|
|
1501
|
+
reactivate?:boolean;
|
|
1636
1502
|
|
|
1637
1503
|
/**
|
|
1638
|
-
* @description
|
|
1504
|
+
* @description The Chargebee payment token generated by Chargebee JS.
|
|
1639
1505
|
|
|
1640
1506
|
*/
|
|
1641
1507
|
|
|
1642
|
-
|
|
1508
|
+
token_id?:string;
|
|
1643
1509
|
|
|
1644
1510
|
/**
|
|
1645
|
-
* @description
|
|
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
|
-
|
|
1515
|
+
invoice_notes?:string;
|
|
1650
1516
|
|
|
1651
1517
|
/**
|
|
1652
|
-
* @description
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
* When `status` is `active`, `non_renewing`, or `paused`, `activated_at` must be on or after `trial_end` or `started_at`. Additionally, `activated_at` must be on or before `current_term_start`.
|
|
1657
|
-
* When `status` is `in_trial`, `activated_at` must precede `trial_start`
|
|
1658
|
-
|
|
1659
|
-
#### Note:
|
|
1660
|
-
|
|
1661
|
-
This parameter should not be provided when passing `status` as `future` or `cancelled`.
|
|
1518
|
+
* @description A collection of key-value pairs that provides extra information about the subscription.
|
|
1519
|
+
**Note:** There's a character limit of 65,535.
|
|
1520
|
+
[Learn more](advanced-features#metadata).
|
|
1662
1521
|
|
|
1663
1522
|
*/
|
|
1664
1523
|
|
|
1665
|
-
|
|
1524
|
+
meta_data?:object;
|
|
1666
1525
|
|
|
1667
1526
|
/**
|
|
1668
|
-
* @description
|
|
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:** `invoice_immediately` 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
|
-
|
|
1532
|
+
invoice_immediately?:boolean;
|
|
1673
1533
|
|
|
1674
1534
|
/**
|
|
1675
|
-
* @description
|
|
1535
|
+
* @description If `true`, ignores the [hierarchy relationship](./customers?prod_cat_ver=2#customer_relationship) and uses customer as payment and invoice owner.
|
|
1676
1536
|
|
|
1677
1537
|
*/
|
|
1678
1538
|
|
|
1679
|
-
|
|
1539
|
+
override_relationship?:boolean;
|
|
1680
1540
|
|
|
1681
1541
|
/**
|
|
1682
|
-
* @description
|
|
1542
|
+
* @description When `change_option` is set to `specific_date`, 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 `reactivate_from`. `changes_scheduled_at` 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 `status` is `active`, `cancelled`, or `non_renewing`.
|
|
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 `current_term_start`.
|
|
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, `changes_scheduled_at` cannot be earlier than 14th February.
|
|
1555
|
+
.
|
|
1683
1556
|
|
|
1684
1557
|
*/
|
|
1685
1558
|
|
|
1686
|
-
|
|
1559
|
+
changes_scheduled_at?:number;
|
|
1687
1560
|
|
|
1688
1561
|
/**
|
|
1689
|
-
* @description
|
|
1690
|
-
|
|
1691
|
-
* The invoice will be created for the subscription only if it has an `active` or `non_renewing` status.
|
|
1692
|
-
* The period of the invoice is from `current_term_start` to `current_term_end`.
|
|
1693
|
-
* The invoice will not be generated if the subscription amount is zero dollars (for that period) and 'Hide Zero Value Line Items' 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 `changes_scheduled_at`. \* immediately - The change is carried out immediately.
|
|
1694
1563
|
|
|
1695
1564
|
*/
|
|
1696
1565
|
|
|
1697
|
-
|
|
1566
|
+
change_option?:ChangeOption;
|
|
1698
1567
|
|
|
1699
1568
|
/**
|
|
1700
|
-
* @description
|
|
1569
|
+
* @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as `billing_cycles` or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
|
|
1701
1570
|
|
|
1702
1571
|
*/
|
|
1703
1572
|
|
|
1704
|
-
|
|
1573
|
+
contract_term_billing_cycle_on_renewal?:number;
|
|
1705
1574
|
|
|
1706
1575
|
/**
|
|
1707
|
-
* @description
|
|
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
|
-
|
|
1580
|
+
free_period?:number;
|
|
1712
1581
|
|
|
1713
1582
|
/**
|
|
1714
|
-
* @description
|
|
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
|
-
|
|
1587
|
+
free_period_unit?:FreePeriodUnit;
|
|
1719
1588
|
|
|
1720
1589
|
/**
|
|
1721
1590
|
* @description Indicates whether the invoices for this subscription are generated with a `pending` `status`. This attribute is set to `true` automatically when the subscription has item prices that belong to `metered` items.
|
|
@@ -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
|
|
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 `trial_end_action` is defined for the plan. \* site_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when `trial_end_action` is **not** defined for the plan.
|
|
1744
1613
|
|
|
1745
1614
|
*/
|
|
1746
1615
|
|
|
1747
|
-
|
|
1616
|
+
trial_end_action?:TrialEndAction;
|
|
1748
1617
|
|
|
1749
1618
|
/**
|
|
1750
|
-
* @description
|
|
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
|
-
|
|
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
|
|
1661
|
+
* @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.
|
|
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=2#customer_balances) for the customer are automatically applied.
|
|
1765
1664
|
|
|
1766
1665
|
*/
|
|
1767
1666
|
|
|
1768
|
-
|
|
1667
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
1769
1668
|
|
|
1770
1669
|
/**
|
|
1771
|
-
* @description Parameters for
|
|
1670
|
+
* @description Parameters for customer
|
|
1772
1671
|
|
|
1773
1672
|
*/
|
|
1774
1673
|
|
|
1775
|
-
|
|
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
|
|
1677
|
+
* @description Parameters for contract_term
|
|
1779
1678
|
|
|
1780
1679
|
*/
|
|
1781
1680
|
|
|
1782
|
-
|
|
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
|
|
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
|
|
1717
|
+
export interface ChangeTermEndInputParam {
|
|
1803
1718
|
|
|
1804
1719
|
/**
|
|
1805
|
-
* @description
|
|
1720
|
+
* @description The time at which the current term should end for this subscription.
|
|
1806
1721
|
|
|
1807
1722
|
*/
|
|
1808
1723
|
|
|
1809
|
-
|
|
1810
|
-
}
|
|
1811
|
-
export interface RetrieveWithScheduledChangesResponse {
|
|
1812
|
-
subscription:Subscription;
|
|
1724
|
+
term_ends_at:number;
|
|
1813
1725
|
|
|
1814
|
-
|
|
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
|
-
|
|
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:** `invoice_immediately` 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 `billing_cycles` 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's default billing cycle.
|
|
1842
|
+
|
|
1843
|
+
During an in-term reactivation^++^, unless the billing cycle is specified, the subscription's remaining billing cycles will be restored. If a trial end date is specified, then the plan's default billing cycle is used.
|
|
1844
|
+
|
|
1845
|
+
**What is an "in-term reactivation"?**
|
|
1846
|
+
An "in-term reactivation" happens when the billing term of the subscription is retained upon cancellation and reactivation is initiated within that term.
|
|
1847
|
+
|
|
1848
|
+
**When is the 'billing term' 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 'Not Paid', or
|
|
1852
|
+
* cancel subscription and mark the invoice as 'Voided' 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 'Not Paid'.
|
|
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'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
|
|
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's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
1895
1906
|
|
|
1896
1907
|
*/
|
|
1897
1908
|
|
|
1898
|
-
|
|
1909
|
+
avalara_transaction_type?:number;
|
|
1899
1910
|
|
|
1900
1911
|
/**
|
|
1901
|
-
* @description
|
|
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's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
1902
1913
|
|
|
1903
1914
|
*/
|
|
1904
1915
|
|
|
1905
|
-
|
|
1916
|
+
avalara_service_type?:number;
|
|
1906
1917
|
|
|
1907
1918
|
/**
|
|
1908
|
-
* @description
|
|
1919
|
+
* @description The time when the service period for the charge starts.
|
|
1909
1920
|
|
|
1910
1921
|
*/
|
|
1911
1922
|
|
|
1912
|
-
|
|
1923
|
+
date_from?:number;
|
|
1913
1924
|
|
|
1914
1925
|
/**
|
|
1915
|
-
* @description
|
|
1926
|
+
* @description The time when the service period for the charge ends.
|
|
1916
1927
|
|
|
1917
1928
|
*/
|
|
1918
1929
|
|
|
1919
|
-
|
|
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
|
|
1972
|
-
|
|
1982
|
+
export interface EditAdvanceInvoiceScheduleResponse {
|
|
1983
|
+
advance_invoice_schedules:AdvanceInvoiceSchedule[];
|
|
1973
1984
|
}
|
|
1974
|
-
export interface
|
|
1985
|
+
export interface EditAdvanceInvoiceScheduleInputParam {
|
|
1975
1986
|
|
|
1976
1987
|
/**
|
|
1977
|
-
* @description The
|
|
1988
|
+
* @description The number of billing cycles in one interval.
|
|
1978
1989
|
|
|
1979
1990
|
*/
|
|
1980
1991
|
|
|
1981
|
-
|
|
1992
|
+
terms_to_charge?:number;
|
|
1982
1993
|
|
|
1983
1994
|
/**
|
|
1984
|
-
* @description
|
|
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
|
-
|
|
1999
|
+
schedule_type?:ScheduleType;
|
|
1989
2000
|
|
|
1990
2001
|
/**
|
|
1991
|
-
* @description
|
|
2002
|
+
* @description Parameters for fixed_interval_schedule
|
|
1992
2003
|
|
|
1993
2004
|
*/
|
|
1994
2005
|
|
|
1995
|
-
|
|
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
|
|
2009
|
+
* @description Parameters for specific_dates_schedule
|
|
1999
2010
|
|
|
2000
2011
|
*/
|
|
2001
2012
|
|
|
2002
|
-
|
|
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
|
|
2027
|
+
* @description Parameters for specific_dates_schedule
|
|
2006
2028
|
|
|
2007
2029
|
*/
|
|
2008
2030
|
|
|
2009
|
-
|
|
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
|
|
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
|
-
|
|
2045
|
+
date_from?:number;
|
|
2017
2046
|
|
|
2018
2047
|
/**
|
|
2019
|
-
* @description The
|
|
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
|
-
|
|
2052
|
+
date_to?:number;
|
|
2024
2053
|
|
|
2025
2054
|
/**
|
|
2026
|
-
* @description
|
|
2055
|
+
* @description Whether the charges should be prorated according to the term specified by `date_from` and `date_to`. Should not be passed without `date_from` and `date_to`.
|
|
2027
2056
|
|
|
2028
2057
|
*/
|
|
2029
2058
|
|
|
2030
|
-
|
|
2031
|
-
}
|
|
2032
|
-
export interface RemoveScheduledChangesResponse {
|
|
2033
|
-
subscription:Subscription;
|
|
2034
|
-
|
|
2035
|
-
customer:Customer;
|
|
2059
|
+
prorate?:boolean;
|
|
2036
2060
|
|
|
2037
|
-
|
|
2061
|
+
/**
|
|
2062
|
+
* @description Only applicable when [Consolidated Invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html ) is enabled for the customer. Set to `false` 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
|
-
|
|
2066
|
+
invoice_immediately?:boolean;
|
|
2040
2067
|
}
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
customer:Customer;
|
|
2068
|
+
export interface ImportContractTermResponse {
|
|
2069
|
+
contract_term:ContractTerm;
|
|
2070
|
+
}
|
|
2071
|
+
export interface ImportContractTermInputParam {
|
|
2046
2072
|
|
|
2047
|
-
|
|
2073
|
+
/**
|
|
2074
|
+
* @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as `billing_cycles` or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
|
|
2075
|
+
|
|
2076
|
+
*/
|
|
2048
2077
|
|
|
2049
|
-
|
|
2078
|
+
contract_term_billing_cycle_on_renewal?:number;
|
|
2050
2079
|
|
|
2051
|
-
|
|
2080
|
+
/**
|
|
2081
|
+
* @description Parameters for contract_term
|
|
2082
|
+
|
|
2083
|
+
*/
|
|
2052
2084
|
|
|
2053
|
-
|
|
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
|
|
2087
|
+
export interface ImportUnbilledChargesResponse {
|
|
2088
|
+
unbilled_charges:UnbilledCharge[];
|
|
2089
|
+
}
|
|
2090
|
+
export interface ImportUnbilledChargesInputParam {
|
|
2056
2091
|
|
|
2057
2092
|
/**
|
|
2058
|
-
* @description
|
|
2093
|
+
* @description Parameters for unbilled_charges
|
|
2059
2094
|
|
|
2060
2095
|
*/
|
|
2061
2096
|
|
|
2062
|
-
|
|
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
|
|
2100
|
+
* @description Parameters for discounts
|
|
2066
2101
|
|
|
2067
2102
|
*/
|
|
2068
2103
|
|
|
2069
|
-
|
|
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
|
|
2073
|
-
**Note:** `invoice_immediately` 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
|
-
|
|
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
|
|
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=2#mbe) this subscription should be [linked](/docs/api/advanced-features?prod_cat_ver=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 `{customer_id}` 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=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 `start_date`. Set it to `0` 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=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.
|
|
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, `start_date` 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
|
|
2171
|
+
* @description Purchase order number for this subscription.
|
|
2171
2172
|
|
|
2172
2173
|
*/
|
|
2173
2174
|
|
|
2174
|
-
|
|
2175
|
+
po_number?:string;
|
|
2175
2176
|
|
|
2176
2177
|
/**
|
|
2177
|
-
* @description
|
|
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
|
-
|
|
2182
|
+
coupon_ids?:string[];
|
|
2182
2183
|
|
|
2183
2184
|
/**
|
|
2184
|
-
* @description
|
|
2185
|
+
* @description Id of the payment source to be attached to this subscription.
|
|
2185
2186
|
|
|
2186
2187
|
*/
|
|
2187
2188
|
|
|
2188
|
-
|
|
2189
|
+
payment_source_id?:string;
|
|
2189
2190
|
|
|
2190
2191
|
/**
|
|
2191
|
-
* @description
|
|
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
|
-
|
|
2196
|
+
status:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing';
|
|
2196
2197
|
|
|
2197
2198
|
/**
|
|
2198
|
-
* @description
|
|
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: `non_renewing`, `active`, and `paused`, `current_term_end` is required.
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
|
|
2210
|
+
.
|
|
2199
2211
|
|
|
2200
2212
|
*/
|
|
2201
2213
|
|
|
2202
|
-
|
|
2214
|
+
current_term_end?:number;
|
|
2203
2215
|
|
|
2204
2216
|
/**
|
|
2205
|
-
* @description
|
|
2217
|
+
* @description Start of the current billing period of the subscription. This is required when the subscription `status` is `paused`. When the `status` is `active` or `non_renewing`, it defaults to the current time.
|
|
2206
2218
|
|
|
2207
2219
|
*/
|
|
2208
2220
|
|
|
2209
|
-
|
|
2221
|
+
current_term_start?:number;
|
|
2210
2222
|
|
|
2211
2223
|
/**
|
|
2212
|
-
* @description
|
|
2224
|
+
* @description Start of the trial period for the subscription. When not passed, it is assumed to be current time. When passed for a `future` subscription, it implies that the subscription goes into `in_trial` when it starts.
|
|
2213
2225
|
|
|
2214
2226
|
*/
|
|
2215
2227
|
|
|
2216
|
-
|
|
2228
|
+
trial_start?:number;
|
|
2217
2229
|
|
|
2218
2230
|
/**
|
|
2219
|
-
* @description
|
|
2231
|
+
* @description Time at which subscription was cancelled or is set to be cancelled.
|
|
2220
2232
|
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2233
|
+
*/
|
|
2234
|
+
|
|
2235
|
+
cancelled_at?:number;
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* @description Time at which the subscription was started. Is `null` for `future`subscriptions as it is yet to be started.
|
|
2226
2239
|
|
|
2227
2240
|
*/
|
|
2228
2241
|
|
|
2229
|
-
|
|
2242
|
+
started_at?:number;
|
|
2230
2243
|
|
|
2231
2244
|
/**
|
|
2232
|
-
* @description A
|
|
2245
|
+
* @description The time at which the subscription was activated. A subscription is "activated" when its `status` changes from any other, to either `active` or `non_renewing`.
|
|
2246
|
+
|
|
2247
|
+
The following conditions must be satisfied when passing this parameter:
|
|
2248
|
+
|
|
2249
|
+
* When `status` is `active`, `non_renewing`, or `paused`, `activated_at` must be on or after `trial_end` or `started_at`. Additionally, `activated_at` must be on or before `current_term_start`.
|
|
2250
|
+
* When `status` is `in_trial`, `activated_at` must precede `trial_start`
|
|
2251
|
+
|
|
2252
|
+
#### Note:
|
|
2253
|
+
|
|
2254
|
+
This parameter should not be provided when passing `status` as `future` or `cancelled`.
|
|
2233
2255
|
|
|
2234
2256
|
*/
|
|
2235
2257
|
|
|
2236
|
-
|
|
2258
|
+
activated_at?:number;
|
|
2237
2259
|
|
|
2238
2260
|
/**
|
|
2239
|
-
* @description
|
|
2240
|
-
**Note:** `invoice_immediately` 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 `paused` state, it is the date/time when the subscription was paused.
|
|
2241
2262
|
|
|
2242
2263
|
*/
|
|
2243
2264
|
|
|
2244
|
-
|
|
2265
|
+
pause_date?:number;
|
|
2245
2266
|
|
|
2246
2267
|
/**
|
|
2247
|
-
* @description
|
|
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 `billing_cycles` 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 `true` 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 `active` or `non_renewing` status.
|
|
2285
|
+
* The period of the invoice is from `current_term_start` to `current_term_end`.
|
|
2286
|
+
* The invoice will not be generated if the subscription amount is zero dollars (for that period) and 'Hide Zero Value Line Items' option is enabled in site settings.
|
|
2248
2287
|
|
|
2249
2288
|
*/
|
|
2250
2289
|
|
|
2251
|
-
|
|
2290
|
+
create_current_term_invoice?:boolean;
|
|
2252
2291
|
|
|
2253
2292
|
/**
|
|
2254
|
-
* @description
|
|
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
|
-
|
|
2297
|
+
invoice_notes?:string;
|
|
2259
2298
|
|
|
2260
2299
|
/**
|
|
2261
|
-
* @description
|
|
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
|
-
|
|
2304
|
+
meta_data?:object;
|
|
2266
2305
|
|
|
2267
2306
|
/**
|
|
2268
|
-
* @description
|
|
2307
|
+
* @description Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Subscriptions \> Subscription Cancellation**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
2269
2308
|
|
|
2270
2309
|
*/
|
|
2271
2310
|
|
|
2272
|
-
|
|
2311
|
+
cancel_reason_code?:string;
|
|
2273
2312
|
|
|
2274
2313
|
/**
|
|
2275
2314
|
* @description Indicates whether the invoices for this subscription are generated with a `pending` `status`. This attribute is set to `true` automatically when the subscription has item prices that belong to `metered` items.
|
|
@@ -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
|
|
2298
|
-
|
|
2299
|
-
If any non-`metered` items are present for the current term, they're also added to this `pending` invoice. As with all `pending` 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 `create_pending_invoices` is `true`
|
|
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 `trial_end_action` is defined for the plan. \* site_default - The action [configured for the site](https://www.chargebee.com/docs/trial_periods.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect. This is the default value when `trial_end_action` is **not** defined for the plan.
|
|
2336
|
+
* @description Parameters for contract_term
|
|
2308
2337
|
|
|
2309
2338
|
*/
|
|
2310
2339
|
|
|
2311
|
-
|
|
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
|
|
2343
|
+
* @description Parameters for transaction
|
|
2315
2344
|
|
|
2316
2345
|
*/
|
|
2317
2346
|
|
|
2318
|
-
|
|
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-`metered` items are present for the current term, they'
|
|
|
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
|
|
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
|
-
|
|
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
|
|
2364
|
+
* @description Parameters for discounts
|
|
2343
2365
|
|
|
2344
2366
|
*/
|
|
2345
2367
|
|
|
2346
|
-
|
|
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
|
|
2371
|
+
* @description Parameters for charged_items
|
|
2350
2372
|
|
|
2351
2373
|
*/
|
|
2352
2374
|
|
|
2353
|
-
|
|
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-`metered` items are present for the current term, they'
|
|
|
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
|
|
2363
|
-
|
|
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
|
-
|
|
2387
|
+
payment_source?:PaymentSource;
|
|
2388
|
+
}
|
|
2389
|
+
export interface OverrideBillingProfileInputParam {
|
|
2373
2390
|
|
|
2374
2391
|
/**
|
|
2375
|
-
* @description
|
|
2392
|
+
* @description Unique identifier of the payment source to be attached to this subscription.
|
|
2376
2393
|
|
|
2377
2394
|
*/
|
|
2378
2395
|
|
|
2379
|
-
|
|
2396
|
+
payment_source_id?:string;
|
|
2380
2397
|
|
|
2381
2398
|
/**
|
|
2382
|
-
* @description
|
|
2399
|
+
* @description Defines whether payments need to be collected automatically for this subscription. Overrides customer'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
|
-
|
|
2403
|
+
auto_collection?:AutoCollection;
|
|
2387
2404
|
}
|
|
2388
|
-
export interface
|
|
2405
|
+
export interface DeleteResponse {
|
|
2389
2406
|
subscription:Subscription;
|
|
2390
2407
|
|
|
2391
2408
|
customer:Customer;
|
|
@@ -2393,158 +2410,192 @@ If any non-`metered` items are present for the current term, they'
|
|
|
2393
2410
|
card?:Card;
|
|
2394
2411
|
}
|
|
2395
2412
|
|
|
2396
|
-
export interface
|
|
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
|
|
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
|
-
|
|
2438
|
+
pause_option?:PauseOption;
|
|
2415
2439
|
|
|
2416
2440
|
/**
|
|
2417
|
-
* @description
|
|
2441
|
+
* @description Date on which the subscription will be paused. Applicable when `specific_date` option is chosen in the [pause_option](/docs/api/subscriptions#pause_a_subscription_pause_option) field.
|
|
2442
|
+
|
|
2443
|
+
For non-renewing subscriptions, `pause_date` should be before the cancellation date.
|
|
2418
2444
|
|
|
2419
2445
|
*/
|
|
2420
2446
|
|
|
2421
|
-
|
|
2422
|
-
}
|
|
2423
|
-
export interface OverrideBillingProfileResponse {
|
|
2424
|
-
subscription:Subscription;
|
|
2447
|
+
pause_date?:number;
|
|
2425
2448
|
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
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 `immediately`. **Note:** On the invoice raised, an automatic charge is attempted on the payment method available, if customer's auto-collection property is set to `on`.
|
|
2451
|
+
\* invoice -
|
|
2452
|
+
|
|
2453
|
+
Invoice charges
|
|
2454
|
+
|
|
2455
|
+
If `invoice` 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 `no_action` is chosen, charges are added to the resumption invoice.
|
|
2461
|
+
|
|
2462
|
+
*/
|
|
2463
|
+
|
|
2464
|
+
unbilled_charges_handling?:UnbilledChargesHandling;
|
|
2429
2465
|
|
|
2430
2466
|
/**
|
|
2431
|
-
* @description
|
|
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 `immediately`.
|
|
2468
|
+
|
|
2469
|
+
If invoice is in the dunning cycle, `invoice_dunning_handing` allows you to `stop` or `continue` dunning.
|
|
2470
|
+
\* continue - Continue dunning \* stop - Stop dunning
|
|
2432
2471
|
|
|
2433
2472
|
*/
|
|
2434
2473
|
|
|
2435
|
-
|
|
2474
|
+
invoice_dunning_handling?:InvoiceDunningHandling;
|
|
2436
2475
|
|
|
2437
2476
|
/**
|
|
2438
|
-
* @description
|
|
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 `billing_cycles`.
|
|
2439
2478
|
|
|
2440
2479
|
*/
|
|
2441
2480
|
|
|
2442
|
-
|
|
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,`resume_date` should be before the cancellation date.
|
|
2487
|
+
|
|
2488
|
+
*/
|
|
2489
|
+
|
|
2490
|
+
resume_date?:number;
|
|
2443
2491
|
}
|
|
2444
|
-
export interface
|
|
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
|
|
2508
|
+
* @description Set this to `true` if you want to cancel the subscription at the end of the current subscription billing cycle. The subscription `status` changes to `non_renewing`.
|
|
2459
2509
|
|
|
2460
2510
|
*/
|
|
2461
2511
|
|
|
2462
|
-
|
|
2512
|
+
end_of_term?:boolean;
|
|
2463
2513
|
|
|
2464
2514
|
/**
|
|
2465
|
-
* @description
|
|
2515
|
+
* @description Specify the date/time at which you want to cancel the subscription. This parameter should not be provided when `end_of_term` is passed as `true`. `cancel_at` 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 `current_term_start`.
|
|
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's plan is 2 months and today is 14th April, `changes_scheduled_at` cannot be earlier than 14th February.
|
|
2524
|
+
.
|
|
2466
2525
|
|
|
2467
2526
|
*/
|
|
2468
2527
|
|
|
2469
|
-
|
|
2528
|
+
cancel_at?:number;
|
|
2470
2529
|
|
|
2471
2530
|
/**
|
|
2472
|
-
* @description
|
|
2531
|
+
* @description For immediate cancellation (`end_of_term` = `false`), 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
|
-
|
|
2535
|
+
credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
|
|
2477
2536
|
|
|
2478
2537
|
/**
|
|
2479
|
-
* @description
|
|
2538
|
+
* @description For immediate cancellation (`end_of_term` = `false`), 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
|
-
|
|
2484
|
-
|
|
2485
|
-
export interface ListDiscountsResponse {
|
|
2542
|
+
unbilled_charges_option?:UnbilledChargesOption;
|
|
2543
|
+
|
|
2486
2544
|
/**
|
|
2487
|
-
* @description
|
|
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 'end_of_term' 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's auto-collection property is 'ON'.
|
|
2488
2546
|
|
|
2489
2547
|
*/
|
|
2490
2548
|
|
|
2491
|
-
|
|
2549
|
+
account_receivables_handling?:AccountReceivablesHandling;
|
|
2492
2550
|
|
|
2493
2551
|
/**
|
|
2494
|
-
* @description
|
|
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's past due invoices if any. **Note:** The refunds initiated will be asynchronous. Not applicable when 'end_of_term' is true. \* schedule_refund - Initiates refund of the remaining credits. \* no_action - No action is taken.
|
|
2495
2553
|
|
|
2496
2554
|
*/
|
|
2497
2555
|
|
|
2498
|
-
|
|
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
|
|
2559
|
+
* @description Cancels the current contract term.
|
|
2511
2560
|
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
2561
|
+
* `terminate_immediately` immediately does the following:
|
|
2562
|
+
* sets the contract term [`status`](contract_terms#contract_term_status) to `terminated`.
|
|
2563
|
+
* Cancels the subscription.
|
|
2564
|
+
* Collects any [termination fee](contract_terms#termintation_fee).
|
|
2565
|
+
* `end_of_contract_term` Sets the [`contract_term[action_at_term_end]`](contract_terms#contract_term_action_at_term_end) to `cancel`. 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
|
-
|
|
2570
|
+
contract_term_cancel_option?:ContractTermCancelOption;
|
|
2523
2571
|
|
|
2524
2572
|
/**
|
|
2525
|
-
* @description
|
|
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 `create_pending_invoices` is `true`, 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 `invoice_date`. When passing this parameter, the following prerequisites must be met:
|
|
2574
|
+
|
|
2575
|
+
* `invoice_date` must be in the past.
|
|
2576
|
+
* `invoice_date` 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 `cancel_at`.
|
|
2578
|
+
.
|
|
2526
2579
|
|
|
2527
2580
|
*/
|
|
2528
2581
|
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
export interface ContractTermsForSubscriptionInputParam {
|
|
2532
|
-
[key : string]: any;
|
|
2582
|
+
invoice_date?:number;
|
|
2583
|
+
|
|
2533
2584
|
/**
|
|
2534
|
-
* @description
|
|
2585
|
+
* @description Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Subscriptions \> Subscription Cancellation**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
2535
2586
|
|
|
2536
2587
|
*/
|
|
2537
|
-
|
|
2538
|
-
|
|
2588
|
+
|
|
2589
|
+
cancel_reason_code?:string;
|
|
2539
2590
|
|
|
2540
2591
|
/**
|
|
2541
|
-
* @description
|
|
2592
|
+
* @description Parameters for subscription_items
|
|
2542
2593
|
|
|
2543
2594
|
*/
|
|
2544
|
-
|
|
2545
|
-
|
|
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
|
|
2598
|
+
export interface ResumeResponse {
|
|
2548
2599
|
subscription:Subscription;
|
|
2549
2600
|
|
|
2550
2601
|
customer:Customer;
|
|
@@ -2554,136 +2605,282 @@ If any non-`metered` items are present for the current term, they'
|
|
|
2554
2605
|
invoice?:Invoice;
|
|
2555
2606
|
|
|
2556
2607
|
unbilled_charges?:UnbilledCharge[];
|
|
2557
|
-
|
|
2558
|
-
credit_notes?:CreditNote[];
|
|
2559
2608
|
}
|
|
2560
|
-
export interface
|
|
2609
|
+
export interface ResumeInputParam {
|
|
2561
2610
|
|
|
2562
|
-
/**
|
|
2563
|
-
* @description List of options to
|
|
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
|
-
|
|
2616
|
+
resume_option?:ResumeOption;
|
|
2573
2617
|
|
|
2574
2618
|
/**
|
|
2575
|
-
* @description Date on which the subscription will be
|
|
2576
|
-
|
|
2577
|
-
For non-renewing subscriptions, `pause_date` should be before the cancellation date.
|
|
2619
|
+
* @description Date on which the subscription will be resumed. Applicable when **resume_option** is set as 'specific_date'.
|
|
2578
2620
|
|
|
2579
2621
|
*/
|
|
2580
2622
|
|
|
2581
|
-
|
|
2623
|
+
resume_date?:number;
|
|
2582
2624
|
|
|
2583
2625
|
/**
|
|
2584
|
-
* @description Applicable when
|
|
2585
|
-
\* invoice -
|
|
2586
|
-
|
|
2587
|
-
Invoice charges
|
|
2588
|
-
|
|
2589
|
-
If `invoice` 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 `no_action` 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 'immediately'. 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
|
-
|
|
2630
|
+
charges_handling?:ChargesHandling;
|
|
2599
2631
|
|
|
2600
2632
|
/**
|
|
2601
|
-
* @description
|
|
2602
|
-
|
|
2603
|
-
If invoice is in the dunning cycle, `invoice_dunning_handing` allows you to `stop` or `continue` dunning.
|
|
2604
|
-
\* continue - Continue dunning \* stop - Stop dunning
|
|
2633
|
+
* @description Applicable when the subscription has past due invoices and **resume_option** is set as 'immediately'. Allows to collect past due invoices or retain them as unpaid. If 'schedule_payment_collection' 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
|
-
|
|
2637
|
+
unpaid_invoices_handling?:UnpaidInvoicesHandling;
|
|
2609
2638
|
|
|
2610
2639
|
/**
|
|
2611
|
-
* @description The
|
|
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
|
-
|
|
2644
|
+
payment_initiator?:PaymentInitiator;
|
|
2616
2645
|
|
|
2617
2646
|
/**
|
|
2618
|
-
* @description
|
|
2619
|
-
|
|
2620
|
-
For non-renewing subscriptions,`resume_date` should be before the cancellation date.
|
|
2647
|
+
* @description Parameters for payment_intent
|
|
2621
2648
|
|
|
2622
2649
|
*/
|
|
2623
2650
|
|
|
2624
|
-
|
|
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
|
-
|
|
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 `plan` in this list. \* plan - Plan \* charge - Charge \* addon - Addon
|
|
2679
|
+
|
|
2680
|
+
*/
|
|
2681
|
+
|
|
2682
|
+
item_type:'charge' | 'addon' | 'plan';
|
|
2628
2683
|
|
|
2629
|
-
|
|
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=2#item_price_attributes) for the item price is used. This is only applicable when the `pricing_model` of the item price is `flat_fee` or `per_unit`. 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 `changes_scheduled_at` is in the past and a `unit_price` is not passed, then the item price'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 `unit_price`, `free_quantity`, `quantity` and `item_tiers` 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 `free_quantity` of the plan-item as [specified](./item_prices?prod_cat_ver=2) for the item price.
|
|
2728
|
+
|
|
2729
|
+
*/
|
|
2730
|
+
|
|
2643
2731
|
free_quantity?:number;
|
|
2644
2732
|
|
|
2733
|
+
/**
|
|
2734
|
+
* @description The `free_quantity_in_decimal` 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=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=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=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 `charge_on_option` option is set to `on_event`, 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=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 `active` or `non-renewing` 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 `charge_on_event` 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 `charge_on_event`.
|
|
2781
|
+
|
|
2782
|
+
*/
|
|
2783
|
+
|
|
2657
2784
|
charge_on_option?:'on_event' | 'immediately';
|
|
2658
2785
|
}
|
|
2659
2786
|
export interface ItemTier {
|
|
2660
|
-
|
|
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
|
-
|
|
2801
|
+
/**
|
|
2802
|
+
* @description The highest value in the quantity tier.
|
|
2803
|
+
|
|
2804
|
+
*/
|
|
2663
2805
|
|
|
2664
2806
|
ending_unit?:number;
|
|
2665
2807
|
|
|
2666
|
-
|
|
2808
|
+
/**
|
|
2809
|
+
* @description The per-unit price for the tier when the `pricing_model` is `tiered` or `volume`. The total cost for the item price when the `pricing_model` is `stairstep`. 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 `ending_unit_in_decimal` of the next lower tier. Returned only when the pricing_model is `tiered`, `volume` or `stairstep` 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 `starting_unit_in_decimal` of the next higher tier. Returned only when the pricing_model is `tiered`, `volume` or `stairstep` 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 `pricing_model` is `tiered` or `volume`. When the `pricing_model` is `stairstep`, 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
|
-
|
|
2836
|
+
/**
|
|
2837
|
+
* @description The index number of the subscription to which the item price is added. Provide a unique number between `0` and `4` (inclusive) for each subscription that is to be created.
|
|
2838
|
+
|
|
2839
|
+
*/
|
|
2840
|
+
|
|
2841
|
+
index:number;
|
|
2675
2842
|
}
|
|
2676
2843
|
export interface ChargedItem {
|
|
2677
|
-
|
|
2844
|
+
/**
|
|
2845
|
+
* @description A unique ID for your system to identify the item price.
|
|
2846
|
+
|
|
2847
|
+
*/
|
|
2678
2848
|
|
|
2679
|
-
|
|
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
|
-
|
|
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 `limited_period` [coupons](./coupons?prod_cat_ver=2) only.
|
|
2868
|
+
|
|
2869
|
+
*/
|
|
2683
2870
|
|
|
2684
2871
|
apply_till?:number;
|
|
2685
2872
|
|
|
2686
|
-
|
|
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
|
|
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
|
|
3048
|
+
account_id:string;
|
|
2852
3049
|
|
|
2853
3050
|
/**
|
|
2854
3051
|
* @description Referral campaign id
|
|
2855
3052
|
|
|
2856
3053
|
*/
|
|
2857
3054
|
|
|
2858
|
-
campaign_id
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 `active` 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 `total_amount_raised`.
|
|
2956
3153
|
|
|
2957
3154
|
*/
|
|
2958
3155
|
|
|
2959
|
-
total_contract_value
|
|
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 `total_amount_raised_before_tax` is included in the calculation of the total contract value before tax. It's important to note that this value excludes any applicable taxes.
|
|
2963
3160
|
|
|
2964
3161
|
*/
|
|
2965
3162
|
|
|
2966
|
-
total_contract_value_before_tax
|
|
3163
|
+
total_contract_value_before_tax:number;
|
|
2967
3164
|
|
|
2968
3165
|
/**
|
|
2969
3166
|
* @description The number of days before [`contract_end`](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
|
|
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
|
|
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 `active` 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
|
-
|
|
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=2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver=2). This is auto-generated based on the `type`, `amount`, and `currency_code` of the discount. For example, it can be `10% off` or `10$ off`.
|
|
3203
|
+
|
|
3204
|
+
*/
|
|
2998
3205
|
|
|
2999
3206
|
invoice_name?:string;
|
|
3000
3207
|
|
|
3001
|
-
|
|
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 `discount.type` 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=2#currencies) depends on the kind of currency. This is only applicable when `discount.type` is `fixed_amount`.
|
|
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 `discount.type` is `fixed_amount`.
|
|
3231
|
+
|
|
3232
|
+
*/
|
|
3233
|
+
|
|
3007
3234
|
currency_code?:string;
|
|
3008
3235
|
|
|
3009
|
-
|
|
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 `period` and `period_unit`. \* forever - The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions?prod_cat_ver=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 `period_units`. Applicable only when `duration_type` is `limited_period`.
|
|
3245
|
+
|
|
3246
|
+
*/
|
|
3010
3247
|
|
|
3011
3248
|
period?:number;
|
|
3012
3249
|
|
|
3250
|
+
/**
|
|
3251
|
+
* @description The unit of time for `period`. Applicable only when `duration_type` is `limited_period`. \* 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
|
-
|
|
3257
|
+
/**
|
|
3258
|
+
* @description The discount is included in MRR calculations for your site. This attribute is only applicable when `duration_type` is `one_time` 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 `false`.
|
|
3259
|
+
|
|
3260
|
+
*/
|
|
3261
|
+
|
|
3262
|
+
included_in_mrr:boolean;
|
|
3016
3263
|
|
|
3017
|
-
|
|
3264
|
+
/**
|
|
3265
|
+
* @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice `sub_total`. \* specific_item_price - The discount is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id`.
|
|
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=2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when `apply_on` = `specific_item_price`.
|
|
3273
|
+
|
|
3274
|
+
*/
|
|
3018
3275
|
|
|
3019
3276
|
item_price_id?:string;
|
|
3020
3277
|
|
|
3021
|
-
|
|
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 `limited_period` 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
|
-
|
|
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: `#`, 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 `0` and `4` (inclusive) for each subscription that is to be created.
|
|
3313
|
+
|
|
3314
|
+
*/
|
|
3028
3315
|
|
|
3029
|
-
index
|
|
3316
|
+
index:number;
|
|
3030
3317
|
}
|
|
3031
3318
|
}
|
|
3032
3319
|
}
|