chargebee 2.33.0 → 2.34.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/CHANGELOG.md +48 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +57 -0
- package/package.json +1 -1
- package/types/core.d.ts +5 -5
- package/types/index.d.ts +6 -0
- package/types/resources/Attribute.d.ts +9 -0
- package/types/resources/Customer.d.ts +2 -2
- package/types/resources/Estimate.d.ts +304 -1
- package/types/resources/Export.d.ts +1 -1
- package/types/resources/Gift.d.ts +87 -1
- package/types/resources/ImpactedItemPrice.d.ts +22 -0
- package/types/resources/Installment.d.ts +121 -0
- package/types/resources/InstallmentConfig.d.ts +162 -0
- package/types/resources/Invoice.d.ts +200 -1
- package/types/resources/ItemPrice.d.ts +0 -7
- package/types/resources/NonSubscription.d.ts +30 -0
- package/types/resources/PaymentIntent.d.ts +4 -4
- package/types/resources/PaymentSource.d.ts +2 -2
- package/types/resources/Purchase.d.ts +91 -5
- package/types/resources/Subscription.d.ts +1252 -209
- package/types/resources/Transaction.d.ts +1 -1
|
@@ -336,6 +336,13 @@ declare module 'chargebee' {
|
|
|
336
336
|
|
|
337
337
|
changes_scheduled_at?:number;
|
|
338
338
|
|
|
339
|
+
/**
|
|
340
|
+
* @description Contract terms for this subscription
|
|
341
|
+
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
contract_term?:Subscription.ContractTerm;
|
|
345
|
+
|
|
339
346
|
/**
|
|
340
347
|
* @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
|
|
341
348
|
|
|
@@ -746,7 +753,7 @@ If specified as **schedule_payment_collection**, payment collection for the amou
|
|
|
746
753
|
|
|
747
754
|
remove_scheduled_resumption(subscription_id:string):ChargebeeRequest<RemoveScheduledResumptionResponse>;
|
|
748
755
|
}
|
|
749
|
-
export interface
|
|
756
|
+
export interface CreateResponse {
|
|
750
757
|
subscription:Subscription;
|
|
751
758
|
|
|
752
759
|
customer:Customer;
|
|
@@ -757,7 +764,7 @@ If specified as **schedule_payment_collection**, payment collection for the amou
|
|
|
757
764
|
|
|
758
765
|
unbilled_charges?:UnbilledCharge[];
|
|
759
766
|
}
|
|
760
|
-
export interface
|
|
767
|
+
export interface CreateInputParam {
|
|
761
768
|
[key : string] : any;
|
|
762
769
|
/**
|
|
763
770
|
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
@@ -767,47 +774,70 @@ If specified as **schedule_payment_collection**, payment collection for the amou
|
|
|
767
774
|
id?:string;
|
|
768
775
|
|
|
769
776
|
/**
|
|
770
|
-
* @description
|
|
771
|
-
**Note**
|
|
777
|
+
* @description Identifier of the plan for this subscription.
|
|
772
778
|
|
|
773
|
-
|
|
774
|
-
|
|
779
|
+
*/
|
|
780
|
+
|
|
781
|
+
plan_id:string;
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* @description Plan quantity for this subscription.
|
|
775
785
|
|
|
776
786
|
*/
|
|
777
787
|
|
|
778
|
-
|
|
788
|
+
plan_quantity?:number;
|
|
779
789
|
|
|
780
790
|
/**
|
|
781
|
-
* @description
|
|
791
|
+
* @description The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
782
792
|
|
|
783
793
|
*/
|
|
784
794
|
|
|
785
|
-
|
|
795
|
+
plan_quantity_in_decimal?:string;
|
|
786
796
|
|
|
787
797
|
/**
|
|
788
|
-
* @description
|
|
798
|
+
* @description Plan Unit Amount for create subscription.
|
|
789
799
|
|
|
790
800
|
*/
|
|
791
801
|
|
|
792
|
-
|
|
802
|
+
plan_unit_price?:number;
|
|
793
803
|
|
|
794
804
|
/**
|
|
795
|
-
* @description
|
|
805
|
+
* @description Plan Unit Amount in Decimal for create subscription.
|
|
796
806
|
|
|
797
807
|
*/
|
|
798
808
|
|
|
799
|
-
|
|
809
|
+
plan_unit_price_in_decimal?:string;
|
|
800
810
|
|
|
801
811
|
/**
|
|
802
|
-
* @description
|
|
812
|
+
* @description Amount that will override the default setup fee. The unit depends on the [type of currency](/docs/api?prod_cat_ver=1#md_disabled).
|
|
803
813
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
814
|
+
*/
|
|
815
|
+
|
|
816
|
+
setup_fee?:number;
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* @description The time at which the trial ends for this subscription. Can be specified to override the default trial period.If **'0'** is passed, the subscription will be activated immediately.
|
|
807
820
|
|
|
808
821
|
*/
|
|
809
822
|
|
|
810
|
-
|
|
823
|
+
trial_end?:number;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* @description Specifies the number of billing cycles for the subscription. The behavior of the subscription after the billing cycles have completed depends on whether the subscription is on a [contract term](contract_terms?prod_cat_ver=1) or not.
|
|
827
|
+
|
|
828
|
+
* When the subscription is not on a contract term: if `billing_cycles` is not provided, then the billing cycles [set for the plan](plans?prod_cat_ver=1&lang=curl#plan_billing_cycles) is used. Moreover, once the `billing_cycles` have completed, the subscription cancels.
|
|
829
|
+
* When the subscription is on a contract term: Providing `billing_cycles` is mandatory. Moreover, once the `billing_cycles` have completed, the behavior of the subscription is determined by the `contract_term[action_at_term_end]` parameter.
|
|
830
|
+
|
|
831
|
+
*/
|
|
832
|
+
|
|
833
|
+
billing_cycles?:number;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* @description List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
|
|
837
|
+
|
|
838
|
+
*/
|
|
839
|
+
|
|
840
|
+
mandatory_addons_to_remove?:string[];
|
|
811
841
|
|
|
812
842
|
/**
|
|
813
843
|
* @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:
|
|
@@ -842,6 +872,13 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
842
872
|
|
|
843
873
|
billing_alignment_mode?:BillingAlignmentMode;
|
|
844
874
|
|
|
875
|
+
/**
|
|
876
|
+
* @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
|
|
877
|
+
|
|
878
|
+
*/
|
|
879
|
+
|
|
880
|
+
offline_payment_method?:OfflinePaymentMethod;
|
|
881
|
+
|
|
845
882
|
/**
|
|
846
883
|
* @description Purchase order number for this subscription.
|
|
847
884
|
|
|
@@ -857,18 +894,18 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
857
894
|
coupon_ids?:string[];
|
|
858
895
|
|
|
859
896
|
/**
|
|
860
|
-
* @description
|
|
897
|
+
* @description The Chargebee payment token generated by Chargebee JS.
|
|
861
898
|
|
|
862
899
|
*/
|
|
863
900
|
|
|
864
|
-
|
|
901
|
+
token_id?:string;
|
|
865
902
|
|
|
866
903
|
/**
|
|
867
|
-
* @description
|
|
904
|
+
* @description A unique tracking token.
|
|
868
905
|
|
|
869
906
|
*/
|
|
870
907
|
|
|
871
|
-
|
|
908
|
+
affiliate_token?:string;
|
|
872
909
|
|
|
873
910
|
/**
|
|
874
911
|
* @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.
|
|
@@ -893,7 +930,7 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
893
930
|
/**
|
|
894
931
|
* @description A collection of key-value pairs that provides extra information about the subscription.
|
|
895
932
|
**Note:** There's a character limit of 65,535.
|
|
896
|
-
[Learn more](advanced-features?prod_cat_ver=
|
|
933
|
+
[Learn more](advanced-features?prod_cat_ver=1#metadata).
|
|
897
934
|
|
|
898
935
|
*/
|
|
899
936
|
|
|
@@ -907,13 +944,6 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
907
944
|
|
|
908
945
|
invoice_immediately?:boolean;
|
|
909
946
|
|
|
910
|
-
/**
|
|
911
|
-
* @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.
|
|
912
|
-
|
|
913
|
-
*/
|
|
914
|
-
|
|
915
|
-
replace_primary_payment_source?:boolean;
|
|
916
|
-
|
|
917
947
|
/**
|
|
918
948
|
* @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.
|
|
919
949
|
|
|
@@ -936,395 +966,535 @@ An alternative way of passing this parameter is by means of a [custom HTTP heade
|
|
|
936
966
|
contract_term_billing_cycle_on_renewal?:number;
|
|
937
967
|
|
|
938
968
|
/**
|
|
939
|
-
* @description
|
|
940
|
-
|
|
941
|
-
You can also set this to `true` explicitly using the [create](/docs/api/subscriptions#create_subscription_for_items_create_pending_invoices)/[update](/docs/api/subscriptions#update_subscription_for_items_create_pending_invoices) subscription operations. This is useful in the following scenarios:
|
|
942
|
-
|
|
943
|
-
* When tracking usages and calculating usage-based charges on your end. You can then add them to the subscription as a [one-time charge](https://www.chargebee.com/docs/charges.html) at the end of the billing term.
|
|
944
|
-
* When you need to inspect all charges before closing invoices for this subscription.
|
|
945
|
-
|
|
946
|
-
Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_billing.html) is enabled for the site
|
|
947
|
-
.
|
|
969
|
+
* @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.
|
|
948
970
|
|
|
949
971
|
*/
|
|
950
972
|
|
|
951
|
-
|
|
973
|
+
trial_end_action?:TrialEndAction;
|
|
952
974
|
|
|
953
975
|
/**
|
|
954
|
-
* @description
|
|
976
|
+
* @description Indicates the Client profile id for the customer. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
955
977
|
|
|
956
978
|
*/
|
|
957
979
|
|
|
958
|
-
|
|
980
|
+
client_profile_id?:string;
|
|
959
981
|
|
|
960
982
|
/**
|
|
961
|
-
* @description
|
|
962
|
-
|
|
963
|
-
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`
|
|
964
|
-
.
|
|
983
|
+
* @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
|
|
965
984
|
|
|
966
985
|
*/
|
|
967
986
|
|
|
968
|
-
|
|
987
|
+
payment_initiator?:PaymentInitiator;
|
|
969
988
|
|
|
970
989
|
/**
|
|
971
|
-
* @description
|
|
990
|
+
* @description Parameters for customer
|
|
972
991
|
|
|
973
992
|
*/
|
|
974
993
|
|
|
975
|
-
|
|
994
|
+
customer?:object;
|
|
976
995
|
|
|
977
996
|
/**
|
|
978
|
-
* @description
|
|
997
|
+
* @description Parameters for card
|
|
979
998
|
|
|
980
999
|
*/
|
|
981
1000
|
|
|
982
|
-
|
|
1001
|
+
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};
|
|
983
1002
|
|
|
984
1003
|
/**
|
|
985
|
-
* @description Parameters for
|
|
1004
|
+
* @description Parameters for bank_account
|
|
986
1005
|
|
|
987
1006
|
*/
|
|
988
1007
|
|
|
989
|
-
|
|
1008
|
+
bank_account?:{account_holder_type?:AccountHolderType,account_number?:string,account_type?:AccountType,bank_code?:string,bank_name?:string,billing_address?:object,company?:string,echeck_type?:EcheckType,email?:string,first_name?:string,gateway_account_id?:string,iban?:string,issuing_country?:string,last_name?:string,phone?:string,routing_number?:string,swedish_identity_number?:string};
|
|
990
1009
|
|
|
991
1010
|
/**
|
|
992
|
-
* @description
|
|
993
|
-
|
|
994
|
-
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.
|
|
995
|
-
**See also**
|
|
996
|
-
|
|
997
|
-
* [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.
|
|
1011
|
+
* @description Parameters for payment_method
|
|
998
1012
|
|
|
999
1013
|
*/
|
|
1000
1014
|
|
|
1001
|
-
|
|
1015
|
+
payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
|
|
1002
1016
|
|
|
1003
1017
|
/**
|
|
1004
1018
|
* @description Parameters for payment_intent
|
|
1005
1019
|
|
|
1006
1020
|
*/
|
|
1007
1021
|
|
|
1008
|
-
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};
|
|
1022
|
+
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' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
1009
1023
|
|
|
1010
1024
|
/**
|
|
1011
|
-
* @description Parameters for
|
|
1025
|
+
* @description Parameters for billing_address
|
|
1012
1026
|
|
|
1013
1027
|
*/
|
|
1014
1028
|
|
|
1015
|
-
|
|
1029
|
+
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};
|
|
1016
1030
|
|
|
1017
1031
|
/**
|
|
1018
|
-
* @description Parameters for
|
|
1032
|
+
* @description Parameters for shipping_address
|
|
1019
1033
|
|
|
1020
1034
|
*/
|
|
1021
1035
|
|
|
1022
|
-
|
|
1036
|
+
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};
|
|
1023
1037
|
|
|
1024
1038
|
/**
|
|
1025
|
-
* @description
|
|
1039
|
+
* @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.
|
|
1040
|
+
|
|
1041
|
+
Creates a new subscription along with the customer. You can attach a plan, plan quantity, one or more addons and coupon while creating this subscription.
|
|
1042
|
+
|
|
1043
|
+
#### Future Subscriptions
|
|
1044
|
+
|
|
1045
|
+
If the **start_date** is specified, the subscription will be created in 'future' state (.ie, instead of starting immediately it will be scheduled to start at the specified 'start_date'). Besides if 'trial' is specified (plan configuration or specified explicitly using trial_end), the subscription will go into 'trial' state when it starts. Otherwise it will directly become 'active' when it starts.
|
|
1046
|
+
|
|
1047
|
+
#### Trial Period
|
|
1048
|
+
|
|
1049
|
+
If the plan has trial period or if the trial_end is specified explicitly, the subscription will be created in 'in_trial' state.
|
|
1050
|
+
|
|
1051
|
+
If the card details are passed, it is not charged until the end of the trial period. Incase you need to verify the card you could enable the ['card verification option'](https://www.chargebee.com/docs/cards.html#card-verification) in the gateway settings.
|
|
1052
|
+
|
|
1053
|
+
#### Invoice
|
|
1054
|
+
|
|
1055
|
+
If the plan does not have a trial period and if any of the recurring items has charges, then a invoice would be raised immediately. If 'auto_collection' is turned 'on', then card attributes are mandatory and subscription will be created only if the payment was successful.
|
|
1056
|
+
|
|
1057
|
+
#### Card details
|
|
1058
|
+
|
|
1059
|
+
Passing card details to this API involves PCI liability at your end as sensitive card information passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable
|
|
1060
|
+
|
|
1061
|
+
* If you are using Stripe gateway, you can use [Stripe.js](https://stripe.com/docs/stripe.js) with your checkout form. Take a look at this [Stripe tutorial](https://stripe.com/docs/payments/accept-a-payment-charges) for more details.
|
|
1062
|
+
* If you are using Braintree gateway, you can use [Braintree.js](//www.braintreepayments.com/docs/javascript) with your checkout form. Please refer this [tutorial](https://www.chargebee.com/tutorials/braintree-js-example.html) for more details.
|
|
1063
|
+
* If you are using Authorize.Net gateway, you use [Accept.js](https://developer.authorize.net/api/reference/features/acceptjs.html) with your checkout form.
|
|
1064
|
+
* In case you are using the Adyen gateway, you will have to use the Adyen's [Client Side Encryption](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/cse-integration-ecommerce) to encrypt sensitive cardholder data. Once the cardholder data is encrypted, pass the value in adyen.encrypted.data as temp token in this API.
|
|
1065
|
+
|
|
1066
|
+
You can also use our [Hosted Pages](https://www.chargebee.com/docs/hosted_pages.html) based integration.
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
**Legacy behavior:**
|
|
1071
|
+
|
|
1072
|
+
* **For [sites](https://www.chargebee.com/docs/sites-intro.html) created before March 1st, 2014:** On making this request, the `billing_address` and `vat_number` of the customer are **deleted** and replaced by the values passed with this request. Ensure that you pass the [billing address parameters](/docs/api/subscriptions?prod_cat_ver=1#create_a_subscription_card_billing_addr1) and the `vat_number` parameters each time you make this request, to avoid losing the same information at the customer-level.
|
|
1073
|
+
* **For [sites](https://www.chargebee.com/docs/sites-intro.html) created on or after March 1st, 2014:** This request does not alter the `billing_address` and `vat_number` of the customer.
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
#### Related Tutorials
|
|
1078
|
+
|
|
1079
|
+
* [Check out this tutorial to create trial signup with custom fields.](//www.chargebee.com/tutorials/custom-fields-recurring-billing-example.html)
|
|
1080
|
+
* [Learn how to implement a in-app checkout flow that allows your customers to select addons and apply coupons. Estimate API is used to dynamically calculate the order summary shown to the customer.](https://www.chargebee.com/tutorials/in-app-checkout-page-using-estimate-api-example.html)
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1026
1084
|
|
|
1027
1085
|
*/
|
|
1028
1086
|
|
|
1029
|
-
|
|
1087
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
1030
1088
|
|
|
1031
1089
|
/**
|
|
1032
|
-
* @description Parameters for
|
|
1090
|
+
* @description Parameters for contract_term
|
|
1033
1091
|
|
|
1034
1092
|
*/
|
|
1035
1093
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
export interface ListResponse {
|
|
1094
|
+
contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
|
|
1095
|
+
|
|
1039
1096
|
/**
|
|
1040
|
-
* @description
|
|
1097
|
+
* @description Parameters for entity_identifiers
|
|
1041
1098
|
|
|
1042
1099
|
*/
|
|
1043
1100
|
|
|
1044
|
-
|
|
1101
|
+
entity_identifiers?:{id?:string,scheme?:string,standard?:string,value?:string}[];
|
|
1045
1102
|
|
|
1046
1103
|
/**
|
|
1047
|
-
* @description
|
|
1104
|
+
* @description Parameters for addons
|
|
1048
1105
|
|
|
1049
1106
|
*/
|
|
1050
1107
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
export interface ListInputParam {
|
|
1054
|
-
[key : string]: any;
|
|
1108
|
+
addons?:{billing_cycles?:number,id?:string,quantity?:number,quantity_in_decimal?:string,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1109
|
+
|
|
1055
1110
|
/**
|
|
1056
|
-
* @description
|
|
1111
|
+
* @description Parameters for event_based_addons
|
|
1057
1112
|
|
|
1058
1113
|
*/
|
|
1059
|
-
|
|
1060
|
-
limit?:number;
|
|
1061
1114
|
|
|
1115
|
+
event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1116
|
+
}
|
|
1117
|
+
export interface CreateForCustomerResponse {
|
|
1118
|
+
subscription:Subscription;
|
|
1119
|
+
|
|
1120
|
+
customer:Customer;
|
|
1121
|
+
|
|
1122
|
+
card?:Card;
|
|
1123
|
+
|
|
1124
|
+
invoice?:Invoice;
|
|
1125
|
+
|
|
1126
|
+
unbilled_charges?:UnbilledCharge[];
|
|
1127
|
+
}
|
|
1128
|
+
export interface CreateForCustomerInputParam {
|
|
1129
|
+
[key : string] : any;
|
|
1062
1130
|
/**
|
|
1063
|
-
* @description
|
|
1131
|
+
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
1064
1132
|
|
|
1065
1133
|
*/
|
|
1066
|
-
|
|
1067
|
-
|
|
1134
|
+
|
|
1135
|
+
id?:string;
|
|
1068
1136
|
|
|
1069
1137
|
/**
|
|
1070
|
-
* @description
|
|
1138
|
+
* @description Identifier of the plan for this subscription.
|
|
1071
1139
|
|
|
1072
1140
|
*/
|
|
1073
|
-
|
|
1074
|
-
|
|
1141
|
+
|
|
1142
|
+
plan_id:string;
|
|
1075
1143
|
|
|
1076
1144
|
/**
|
|
1077
|
-
* @description
|
|
1145
|
+
* @description Plan quantity for this subscription.
|
|
1078
1146
|
|
|
1079
1147
|
*/
|
|
1080
|
-
|
|
1081
|
-
|
|
1148
|
+
|
|
1149
|
+
plan_quantity?:number;
|
|
1082
1150
|
|
|
1083
1151
|
/**
|
|
1084
|
-
* @description
|
|
1152
|
+
* @description The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1085
1153
|
|
|
1086
1154
|
*/
|
|
1087
|
-
|
|
1088
|
-
|
|
1155
|
+
|
|
1156
|
+
plan_quantity_in_decimal?:string;
|
|
1089
1157
|
|
|
1090
1158
|
/**
|
|
1091
|
-
* @description
|
|
1159
|
+
* @description Amount that will override the Plan's default price. The unit depends on the [type of currency](/docs/api?prod_cat_ver=1#md_disabled).
|
|
1092
1160
|
|
|
1093
1161
|
*/
|
|
1094
|
-
|
|
1095
|
-
|
|
1162
|
+
|
|
1163
|
+
plan_unit_price?:number;
|
|
1096
1164
|
|
|
1097
1165
|
/**
|
|
1098
|
-
* @description
|
|
1166
|
+
* @description When [price overriding](http://chargebee.com/docs/price-override.html )is enabled for the site, the price or per-unit price of the plan can be set here. The value [set for the plan](https://apidocs.chargebee.com/docs/api/plans#plan_price ) is used by default. Provide the value as a decimal string 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.
|
|
1099
1167
|
|
|
1100
1168
|
*/
|
|
1101
|
-
|
|
1102
|
-
|
|
1169
|
+
|
|
1170
|
+
plan_unit_price_in_decimal?:string;
|
|
1103
1171
|
|
|
1104
1172
|
/**
|
|
1105
|
-
* @description
|
|
1173
|
+
* @description Amount that will override the default setup fee. The unit depends on the [type of currency](/docs/api?prod_cat_ver=1#md_disabled).
|
|
1106
1174
|
|
|
1107
1175
|
*/
|
|
1108
|
-
|
|
1109
|
-
|
|
1176
|
+
|
|
1177
|
+
setup_fee?:number;
|
|
1110
1178
|
|
|
1111
1179
|
/**
|
|
1112
|
-
* @description
|
|
1180
|
+
* @description The time at which the trial ends for this subscription. Can be specified to override the default trial period.If **'0'** is passed, the subscription will be activated immediately.
|
|
1113
1181
|
|
|
1114
1182
|
*/
|
|
1115
|
-
|
|
1116
|
-
|
|
1183
|
+
|
|
1184
|
+
trial_end?:number;
|
|
1117
1185
|
|
|
1118
1186
|
/**
|
|
1119
|
-
* @description
|
|
1187
|
+
* @description Specifies the number of billing cycles for the subscription. The behavior of the subscription after the billing cycles have completed depends on whether the subscription is on a [contract term](contract_terms?prod_cat_ver=1) or not.
|
|
1188
|
+
|
|
1189
|
+
* When the subscription is not on a contract term: if `billing_cycles` is not provided, then the billing cycles [set for the plan](plans?prod_cat_ver=1&lang=curl#plan_billing_cycles) is used. Moreover, once the `billing_cycles` have completed, the subscription cancels.
|
|
1190
|
+
* When the subscription is on a contract term: Providing `billing_cycles` is mandatory. Moreover, once the `billing_cycles` have completed, the behavior of the subscription is determined by the `contract_term[action_at_term_end]` parameter.
|
|
1120
1191
|
|
|
1121
1192
|
*/
|
|
1122
|
-
|
|
1123
|
-
|
|
1193
|
+
|
|
1194
|
+
billing_cycles?:number;
|
|
1124
1195
|
|
|
1125
1196
|
/**
|
|
1126
|
-
* @description
|
|
1197
|
+
* @description List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
|
|
1127
1198
|
|
|
1128
1199
|
*/
|
|
1129
|
-
|
|
1130
|
-
|
|
1200
|
+
|
|
1201
|
+
mandatory_addons_to_remove?:string[];
|
|
1131
1202
|
|
|
1132
1203
|
/**
|
|
1133
|
-
* @description
|
|
1204
|
+
* @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:
|
|
1205
|
+
|
|
1206
|
+
* Backdating is enabled for subscription creation operations.
|
|
1207
|
+
* 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.
|
|
1208
|
+
* 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.
|
|
1209
|
+
.
|
|
1134
1210
|
|
|
1135
1211
|
*/
|
|
1136
|
-
|
|
1137
|
-
|
|
1212
|
+
|
|
1213
|
+
start_date?:number;
|
|
1138
1214
|
|
|
1139
1215
|
/**
|
|
1140
|
-
* @description
|
|
1216
|
+
* @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.
|
|
1141
1217
|
|
|
1142
1218
|
*/
|
|
1143
|
-
|
|
1144
|
-
|
|
1219
|
+
|
|
1220
|
+
auto_collection?:AutoCollection;
|
|
1145
1221
|
|
|
1146
1222
|
/**
|
|
1147
|
-
* @description
|
|
1223
|
+
* @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
|
|
1148
1224
|
|
|
1149
1225
|
*/
|
|
1150
|
-
|
|
1151
|
-
|
|
1226
|
+
|
|
1227
|
+
terms_to_charge?:number;
|
|
1152
1228
|
|
|
1153
1229
|
/**
|
|
1154
|
-
* @description
|
|
1230
|
+
* @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.
|
|
1155
1231
|
|
|
1156
1232
|
*/
|
|
1157
|
-
|
|
1158
|
-
|
|
1233
|
+
|
|
1234
|
+
billing_alignment_mode?:BillingAlignmentMode;
|
|
1159
1235
|
|
|
1160
1236
|
/**
|
|
1161
|
-
* @description
|
|
1237
|
+
* @description The preferred offline payment method for the subscription. \* sepa_credit - SEPA Credit \* cash - Cash \* no_preference - No Preference \* bank_transfer - Bank Transfer \* boleto - Boleto \* check - Check \* ach_credit - ACH Credit
|
|
1162
1238
|
|
|
1163
1239
|
*/
|
|
1164
|
-
|
|
1165
|
-
|
|
1240
|
+
|
|
1241
|
+
offline_payment_method?:OfflinePaymentMethod;
|
|
1166
1242
|
|
|
1167
1243
|
/**
|
|
1168
|
-
* @description
|
|
1244
|
+
* @description Purchase order number for this subscription.
|
|
1169
1245
|
|
|
1170
1246
|
*/
|
|
1171
|
-
|
|
1172
|
-
|
|
1247
|
+
|
|
1248
|
+
po_number?:string;
|
|
1173
1249
|
|
|
1174
1250
|
/**
|
|
1175
|
-
* @description
|
|
1251
|
+
* @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
|
|
1176
1252
|
|
|
1177
1253
|
*/
|
|
1178
|
-
|
|
1179
|
-
|
|
1254
|
+
|
|
1255
|
+
coupon_ids?:string[];
|
|
1180
1256
|
|
|
1181
1257
|
/**
|
|
1182
|
-
* @description
|
|
1258
|
+
* @description Id of the payment source to be attached to this subscription.
|
|
1183
1259
|
|
|
1184
1260
|
*/
|
|
1185
|
-
|
|
1186
|
-
|
|
1261
|
+
|
|
1262
|
+
payment_source_id?:string;
|
|
1187
1263
|
|
|
1188
1264
|
/**
|
|
1189
|
-
* @description
|
|
1265
|
+
* @description If `true`, ignores the [hierarchy relationship](./customers?prod_cat_ver=2#customer_relationship) and uses customer as payment and invoice owner.
|
|
1190
1266
|
|
|
1191
1267
|
*/
|
|
1192
|
-
|
|
1193
|
-
override_relationship?:
|
|
1268
|
+
|
|
1269
|
+
override_relationship?:boolean;
|
|
1194
1270
|
|
|
1195
1271
|
/**
|
|
1196
|
-
* @description
|
|
1272
|
+
* @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.
|
|
1197
1273
|
|
|
1198
1274
|
*/
|
|
1199
|
-
|
|
1200
|
-
|
|
1275
|
+
|
|
1276
|
+
invoice_notes?:string;
|
|
1201
1277
|
|
|
1202
1278
|
/**
|
|
1203
|
-
* @description
|
|
1279
|
+
* @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:
|
|
1280
|
+
|
|
1281
|
+
* `invoice_date` must be in the past.
|
|
1282
|
+
* It is not earlier than `start_date`.
|
|
1283
|
+
* 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.
|
|
1284
|
+
* `invoice_immediately` is true.
|
|
1285
|
+
.
|
|
1204
1286
|
|
|
1205
1287
|
*/
|
|
1206
|
-
|
|
1207
|
-
|
|
1288
|
+
|
|
1289
|
+
invoice_date?:number;
|
|
1208
1290
|
|
|
1209
1291
|
/**
|
|
1210
|
-
* @description
|
|
1292
|
+
* @description A collection of key-value pairs that provides extra information about the subscription.
|
|
1293
|
+
**Note:** There's a character limit of 65,535.
|
|
1294
|
+
[Learn more](advanced-features?prod_cat_ver=1#metadata).
|
|
1211
1295
|
|
|
1212
1296
|
*/
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
export interface ContractTermsForSubscriptionResponse {
|
|
1297
|
+
|
|
1298
|
+
meta_data?:object;
|
|
1299
|
+
|
|
1217
1300
|
/**
|
|
1218
|
-
* @description
|
|
1301
|
+
* @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).
|
|
1302
|
+
**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. .
|
|
1219
1303
|
|
|
1220
1304
|
*/
|
|
1221
1305
|
|
|
1222
|
-
|
|
1306
|
+
invoice_immediately?:boolean;
|
|
1223
1307
|
|
|
1224
1308
|
/**
|
|
1225
|
-
* @description
|
|
1309
|
+
* @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.
|
|
1226
1310
|
|
|
1227
1311
|
*/
|
|
1228
1312
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
export interface ContractTermsForSubscriptionInputParam {
|
|
1232
|
-
[key : string]: any;
|
|
1313
|
+
replace_primary_payment_source?:boolean;
|
|
1314
|
+
|
|
1233
1315
|
/**
|
|
1234
|
-
* @description
|
|
1316
|
+
* @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.
|
|
1235
1317
|
|
|
1236
1318
|
*/
|
|
1237
|
-
|
|
1238
|
-
|
|
1319
|
+
|
|
1320
|
+
free_period?:number;
|
|
1239
1321
|
|
|
1240
1322
|
/**
|
|
1241
|
-
* @description
|
|
1323
|
+
* @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)
|
|
1242
1324
|
|
|
1243
1325
|
*/
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
export interface ListDiscountsResponse {
|
|
1326
|
+
|
|
1327
|
+
free_period_unit?:FreePeriodUnit;
|
|
1328
|
+
|
|
1248
1329
|
/**
|
|
1249
|
-
* @description
|
|
1330
|
+
* @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).
|
|
1250
1331
|
|
|
1251
1332
|
*/
|
|
1252
1333
|
|
|
1253
|
-
|
|
1334
|
+
contract_term_billing_cycle_on_renewal?:number;
|
|
1254
1335
|
|
|
1255
1336
|
/**
|
|
1256
|
-
* @description
|
|
1337
|
+
* @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.
|
|
1257
1338
|
|
|
1258
1339
|
*/
|
|
1259
1340
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
export interface ListDiscountsInputParam {
|
|
1263
|
-
[key : string]: any;
|
|
1341
|
+
trial_end_action?:TrialEndAction;
|
|
1342
|
+
|
|
1264
1343
|
/**
|
|
1265
|
-
* @description
|
|
1344
|
+
* @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
|
|
1266
1345
|
|
|
1267
1346
|
*/
|
|
1268
|
-
|
|
1269
|
-
|
|
1347
|
+
|
|
1348
|
+
payment_initiator?:PaymentInitiator;
|
|
1270
1349
|
|
|
1271
1350
|
/**
|
|
1272
|
-
* @description
|
|
1351
|
+
* @description Parameters for shipping_address
|
|
1273
1352
|
|
|
1274
1353
|
*/
|
|
1275
|
-
|
|
1276
|
-
offset?:string;
|
|
1277
|
-
}
|
|
1278
|
-
export interface RetrieveResponse {
|
|
1279
|
-
subscription:Subscription;
|
|
1280
1354
|
|
|
1281
|
-
|
|
1355
|
+
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};
|
|
1282
1356
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1357
|
+
/**
|
|
1358
|
+
* @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.
|
|
1359
|
+
|
|
1360
|
+
Creates a new subscription for an existing customer. You can attach a plan, plan quantity, one or more addons and coupon while creating this subscription.
|
|
1361
|
+
|
|
1362
|
+
If the plan does not have a trial period and if any of the recurring-item has charges, then the customer is charged immediately if auto_collection is turned 'on'. In that case, subscription is created only if the customer has a payment method on file and attempted payment is successful.
|
|
1363
|
+
|
|
1364
|
+
*/
|
|
1288
1365
|
|
|
1289
|
-
|
|
1366
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
1290
1367
|
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
subscription:Subscription;
|
|
1368
|
+
/**
|
|
1369
|
+
* @description Parameters for payment_intent
|
|
1370
|
+
|
|
1371
|
+
*/
|
|
1296
1372
|
|
|
1297
|
-
|
|
1373
|
+
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' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
1298
1374
|
|
|
1299
|
-
|
|
1375
|
+
/**
|
|
1376
|
+
* @description Parameters for contract_term
|
|
1377
|
+
|
|
1378
|
+
*/
|
|
1300
1379
|
|
|
1301
|
-
|
|
1380
|
+
contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* @description Parameters for addons
|
|
1384
|
+
|
|
1385
|
+
*/
|
|
1386
|
+
|
|
1387
|
+
addons?:{billing_cycles?:number,id?:string,quantity?:number,quantity_in_decimal?:string,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* @description Parameters for event_based_addons
|
|
1391
|
+
|
|
1392
|
+
*/
|
|
1393
|
+
|
|
1394
|
+
event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1302
1395
|
}
|
|
1303
|
-
|
|
1304
|
-
export interface RemoveScheduledCancellationResponse {
|
|
1396
|
+
export interface CreateWithItemsResponse {
|
|
1305
1397
|
subscription:Subscription;
|
|
1306
1398
|
|
|
1307
1399
|
customer:Customer;
|
|
1308
1400
|
|
|
1309
1401
|
card?:Card;
|
|
1402
|
+
|
|
1403
|
+
invoice?:Invoice;
|
|
1404
|
+
|
|
1405
|
+
unbilled_charges?:UnbilledCharge[];
|
|
1310
1406
|
}
|
|
1311
|
-
export interface
|
|
1407
|
+
export interface CreateWithItemsInputParam {
|
|
1408
|
+
[key : string] : any;
|
|
1409
|
+
/**
|
|
1410
|
+
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
1411
|
+
|
|
1412
|
+
*/
|
|
1413
|
+
|
|
1414
|
+
id?:string;
|
|
1312
1415
|
|
|
1313
1416
|
/**
|
|
1314
|
-
* @description
|
|
1417
|
+
* @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.
|
|
1418
|
+
**Note**
|
|
1419
|
+
|
|
1420
|
+
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).
|
|
1421
|
+
.
|
|
1422
|
+
|
|
1423
|
+
*/
|
|
1424
|
+
|
|
1425
|
+
business_entity_id?:string;
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* @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.
|
|
1429
|
+
|
|
1430
|
+
*/
|
|
1431
|
+
|
|
1432
|
+
trial_end?:number;
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* @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.
|
|
1315
1436
|
|
|
1316
1437
|
*/
|
|
1317
1438
|
|
|
1318
1439
|
billing_cycles?:number;
|
|
1319
|
-
}
|
|
1320
|
-
export interface RemoveCouponsResponse {
|
|
1321
|
-
subscription:Subscription;
|
|
1322
1440
|
|
|
1323
|
-
|
|
1441
|
+
/**
|
|
1442
|
+
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
1443
|
+
|
|
1444
|
+
*/
|
|
1324
1445
|
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1446
|
+
mandatory_items_to_remove?:string[];
|
|
1447
|
+
|
|
1448
|
+
/**
|
|
1449
|
+
* @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.
|
|
1450
|
+
|
|
1451
|
+
* 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).
|
|
1452
|
+
* 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.
|
|
1453
|
+
.
|
|
1454
|
+
|
|
1455
|
+
*/
|
|
1456
|
+
|
|
1457
|
+
net_term_days?:number;
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* @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:
|
|
1461
|
+
|
|
1462
|
+
* Backdating is enabled for subscription creation operations.
|
|
1463
|
+
* 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.
|
|
1464
|
+
* 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.
|
|
1465
|
+
.
|
|
1466
|
+
|
|
1467
|
+
*/
|
|
1468
|
+
|
|
1469
|
+
start_date?:number;
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* @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.
|
|
1473
|
+
|
|
1474
|
+
*/
|
|
1475
|
+
|
|
1476
|
+
auto_collection?:AutoCollection;
|
|
1477
|
+
|
|
1478
|
+
/**
|
|
1479
|
+
* @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
|
|
1480
|
+
|
|
1481
|
+
*/
|
|
1482
|
+
|
|
1483
|
+
terms_to_charge?:number;
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* @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.
|
|
1487
|
+
|
|
1488
|
+
*/
|
|
1489
|
+
|
|
1490
|
+
billing_alignment_mode?:BillingAlignmentMode;
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* @description Purchase order number for this subscription.
|
|
1494
|
+
|
|
1495
|
+
*/
|
|
1496
|
+
|
|
1497
|
+
po_number?:string;
|
|
1328
1498
|
|
|
1329
1499
|
/**
|
|
1330
1500
|
* @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
|
|
@@ -1332,6 +1502,879 @@ Creates a new subscription for an existing customer in Chargebee. Any available
|
|
|
1332
1502
|
*/
|
|
1333
1503
|
|
|
1334
1504
|
coupon_ids?:string[];
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* @description Id of the payment source to be attached to this subscription.
|
|
1508
|
+
|
|
1509
|
+
*/
|
|
1510
|
+
|
|
1511
|
+
payment_source_id?:string;
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* @description If `true`, ignores the [hierarchy relationship](./customers?prod_cat_ver=2#customer_relationship) and uses customer as payment and invoice owner.
|
|
1515
|
+
|
|
1516
|
+
*/
|
|
1517
|
+
|
|
1518
|
+
override_relationship?:boolean;
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* @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.
|
|
1522
|
+
|
|
1523
|
+
*/
|
|
1524
|
+
|
|
1525
|
+
invoice_notes?:string;
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* @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:
|
|
1529
|
+
|
|
1530
|
+
* `invoice_date` must be in the past.
|
|
1531
|
+
* It is not earlier than `start_date`.
|
|
1532
|
+
* 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.
|
|
1533
|
+
* `invoice_immediately` is true.
|
|
1534
|
+
.
|
|
1535
|
+
|
|
1536
|
+
*/
|
|
1537
|
+
|
|
1538
|
+
invoice_date?:number;
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* @description A collection of key-value pairs that provides extra information about the subscription.
|
|
1542
|
+
**Note:** There's a character limit of 65,535.
|
|
1543
|
+
[Learn more](advanced-features?prod_cat_ver=2#metadata).
|
|
1544
|
+
|
|
1545
|
+
*/
|
|
1546
|
+
|
|
1547
|
+
meta_data?:object;
|
|
1548
|
+
|
|
1549
|
+
/**
|
|
1550
|
+
* @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).
|
|
1551
|
+
**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. .
|
|
1552
|
+
|
|
1553
|
+
*/
|
|
1554
|
+
|
|
1555
|
+
invoice_immediately?:boolean;
|
|
1556
|
+
|
|
1557
|
+
/**
|
|
1558
|
+
* @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.
|
|
1559
|
+
|
|
1560
|
+
*/
|
|
1561
|
+
|
|
1562
|
+
replace_primary_payment_source?:boolean;
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* @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.
|
|
1566
|
+
|
|
1567
|
+
*/
|
|
1568
|
+
|
|
1569
|
+
free_period?:number;
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* @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)
|
|
1573
|
+
|
|
1574
|
+
*/
|
|
1575
|
+
|
|
1576
|
+
free_period_unit?:FreePeriodUnit;
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* @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).
|
|
1580
|
+
|
|
1581
|
+
*/
|
|
1582
|
+
|
|
1583
|
+
contract_term_billing_cycle_on_renewal?:number;
|
|
1584
|
+
|
|
1585
|
+
/**
|
|
1586
|
+
* @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.
|
|
1587
|
+
|
|
1588
|
+
You can also set this to `true` explicitly using the [create](/docs/api/subscriptions#create_subscription_for_items_create_pending_invoices)/[update](/docs/api/subscriptions#update_subscription_for_items_create_pending_invoices) subscription operations. This is useful in the following scenarios:
|
|
1589
|
+
|
|
1590
|
+
* When tracking usages and calculating usage-based charges on your end. You can then add them to the subscription as a [one-time charge](https://www.chargebee.com/docs/charges.html) at the end of the billing term.
|
|
1591
|
+
* When you need to inspect all charges before closing invoices for this subscription.
|
|
1592
|
+
|
|
1593
|
+
Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_billing.html) is enabled for the site
|
|
1594
|
+
.
|
|
1595
|
+
|
|
1596
|
+
*/
|
|
1597
|
+
|
|
1598
|
+
create_pending_invoices?:boolean;
|
|
1599
|
+
|
|
1600
|
+
/**
|
|
1601
|
+
* @description Set to `false` to override for this subscription, the [site-level setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the [customer level](/docs/api/customers?prod_cat_ver=2#customer_auto_close_invoices).
|
|
1602
|
+
|
|
1603
|
+
*/
|
|
1604
|
+
|
|
1605
|
+
auto_close_invoices?:boolean;
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* @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.
|
|
1609
|
+
|
|
1610
|
+
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`
|
|
1611
|
+
.
|
|
1612
|
+
|
|
1613
|
+
*/
|
|
1614
|
+
|
|
1615
|
+
first_invoice_pending?:boolean;
|
|
1616
|
+
|
|
1617
|
+
/**
|
|
1618
|
+
* @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.
|
|
1619
|
+
|
|
1620
|
+
*/
|
|
1621
|
+
|
|
1622
|
+
trial_end_action?:TrialEndAction;
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* @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
|
|
1626
|
+
|
|
1627
|
+
*/
|
|
1628
|
+
|
|
1629
|
+
payment_initiator?:PaymentInitiator;
|
|
1630
|
+
|
|
1631
|
+
/**
|
|
1632
|
+
* @description Parameters for shipping_address
|
|
1633
|
+
|
|
1634
|
+
*/
|
|
1635
|
+
|
|
1636
|
+
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};
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* @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.
|
|
1640
|
+
|
|
1641
|
+
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.
|
|
1642
|
+
**See also**
|
|
1643
|
+
|
|
1644
|
+
* [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.
|
|
1645
|
+
|
|
1646
|
+
*/
|
|
1647
|
+
|
|
1648
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
1649
|
+
|
|
1650
|
+
/**
|
|
1651
|
+
* @description Parameters for payment_intent
|
|
1652
|
+
|
|
1653
|
+
*/
|
|
1654
|
+
|
|
1655
|
+
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' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* @description Parameters for contract_term
|
|
1659
|
+
|
|
1660
|
+
*/
|
|
1661
|
+
|
|
1662
|
+
contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
|
|
1663
|
+
|
|
1664
|
+
/**
|
|
1665
|
+
* @description Parameters for subscription_items
|
|
1666
|
+
|
|
1667
|
+
*/
|
|
1668
|
+
|
|
1669
|
+
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}[];
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* @description Parameters for discounts
|
|
1673
|
+
|
|
1674
|
+
*/
|
|
1675
|
+
|
|
1676
|
+
discounts:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* @description Parameters for item_tiers
|
|
1680
|
+
|
|
1681
|
+
*/
|
|
1682
|
+
|
|
1683
|
+
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}[];
|
|
1684
|
+
}
|
|
1685
|
+
export interface ListResponse {
|
|
1686
|
+
/**
|
|
1687
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1688
|
+
|
|
1689
|
+
*/
|
|
1690
|
+
|
|
1691
|
+
list:{subscription:Subscription,customer:Customer,card?:Card}[];
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1695
|
+
|
|
1696
|
+
*/
|
|
1697
|
+
|
|
1698
|
+
next_offset?:string;
|
|
1699
|
+
}
|
|
1700
|
+
export interface ListInputParam {
|
|
1701
|
+
[key : string]: any;
|
|
1702
|
+
/**
|
|
1703
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1704
|
+
|
|
1705
|
+
*/
|
|
1706
|
+
|
|
1707
|
+
limit?:number;
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1711
|
+
|
|
1712
|
+
*/
|
|
1713
|
+
|
|
1714
|
+
offset?:string;
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1718
|
+
|
|
1719
|
+
*/
|
|
1720
|
+
|
|
1721
|
+
include_deleted?:boolean;
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1725
|
+
|
|
1726
|
+
*/
|
|
1727
|
+
|
|
1728
|
+
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1732
|
+
|
|
1733
|
+
*/
|
|
1734
|
+
|
|
1735
|
+
customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1739
|
+
|
|
1740
|
+
*/
|
|
1741
|
+
|
|
1742
|
+
item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1746
|
+
|
|
1747
|
+
*/
|
|
1748
|
+
|
|
1749
|
+
item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1753
|
+
|
|
1754
|
+
*/
|
|
1755
|
+
|
|
1756
|
+
status?:{in?:string,is?:'in_trial' | 'paused' | 'transferred' | 'future' | 'active' | 'cancelled' | 'non_renewing',is_not?:'in_trial' | 'paused' | 'transferred' | 'future' | 'active' | 'cancelled' | 'non_renewing',not_in?:string};
|
|
1757
|
+
|
|
1758
|
+
/**
|
|
1759
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1760
|
+
|
|
1761
|
+
*/
|
|
1762
|
+
|
|
1763
|
+
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};
|
|
1764
|
+
|
|
1765
|
+
/**
|
|
1766
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1767
|
+
|
|
1768
|
+
*/
|
|
1769
|
+
|
|
1770
|
+
cancel_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1771
|
+
|
|
1772
|
+
/**
|
|
1773
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1774
|
+
|
|
1775
|
+
*/
|
|
1776
|
+
|
|
1777
|
+
remaining_billing_cycles?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,is_present?:'true' | 'false',lt?:string,lte?:string};
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1781
|
+
|
|
1782
|
+
*/
|
|
1783
|
+
|
|
1784
|
+
created_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1785
|
+
|
|
1786
|
+
/**
|
|
1787
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1788
|
+
|
|
1789
|
+
*/
|
|
1790
|
+
|
|
1791
|
+
activated_at?:{after?:string,before?:string,between?:string,is_present?:'true' | 'false',on?:string};
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1795
|
+
|
|
1796
|
+
*/
|
|
1797
|
+
|
|
1798
|
+
next_billing_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1799
|
+
|
|
1800
|
+
/**
|
|
1801
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1802
|
+
|
|
1803
|
+
*/
|
|
1804
|
+
|
|
1805
|
+
cancelled_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1809
|
+
|
|
1810
|
+
*/
|
|
1811
|
+
|
|
1812
|
+
has_scheduled_changes?:{is?:'true' | 'false'};
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1816
|
+
|
|
1817
|
+
*/
|
|
1818
|
+
|
|
1819
|
+
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1823
|
+
|
|
1824
|
+
*/
|
|
1825
|
+
|
|
1826
|
+
offline_payment_method?:{in?:string,is?:'eu_automated_bank_transfer' | 'bank_transfer' | 'mx_automated_bank_transfer' | 'custom' | 'ach_credit' | 'boleto' | 'check' | 'uk_automated_bank_transfer' | 'no_preference' | 'us_automated_bank_transfer' | 'jp_automated_bank_transfer' | 'sepa_credit' | 'cash',is_not?:'eu_automated_bank_transfer' | 'bank_transfer' | 'mx_automated_bank_transfer' | 'custom' | 'ach_credit' | 'boleto' | 'check' | 'uk_automated_bank_transfer' | 'no_preference' | 'us_automated_bank_transfer' | 'jp_automated_bank_transfer' | 'sepa_credit' | 'cash',not_in?:string};
|
|
1827
|
+
|
|
1828
|
+
/**
|
|
1829
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1830
|
+
|
|
1831
|
+
*/
|
|
1832
|
+
|
|
1833
|
+
auto_close_invoices?:{is?:'true' | 'false'};
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1837
|
+
|
|
1838
|
+
*/
|
|
1839
|
+
|
|
1840
|
+
override_relationship?:{is?:'true' | 'false'};
|
|
1841
|
+
|
|
1842
|
+
/**
|
|
1843
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1844
|
+
|
|
1845
|
+
*/
|
|
1846
|
+
|
|
1847
|
+
sort_by?:{asc?:'updated_at' | 'created_at',desc?:'updated_at' | 'created_at'};
|
|
1848
|
+
|
|
1849
|
+
/**
|
|
1850
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1851
|
+
|
|
1852
|
+
*/
|
|
1853
|
+
|
|
1854
|
+
business_entity_id?:{is?:string,is_not?:string,starts_with?:string};
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* @description Returns a list of subscriptions meeting **all** the conditions specified in the filter parameters below.
|
|
1858
|
+
|
|
1859
|
+
*/
|
|
1860
|
+
|
|
1861
|
+
channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
|
|
1862
|
+
}
|
|
1863
|
+
export interface ContractTermsForSubscriptionResponse {
|
|
1864
|
+
/**
|
|
1865
|
+
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
1866
|
+
|
|
1867
|
+
*/
|
|
1868
|
+
|
|
1869
|
+
list:{contract_term:ContractTerm}[];
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
1873
|
+
|
|
1874
|
+
*/
|
|
1875
|
+
|
|
1876
|
+
next_offset?:string;
|
|
1877
|
+
}
|
|
1878
|
+
export interface ContractTermsForSubscriptionInputParam {
|
|
1879
|
+
[key : string]: any;
|
|
1880
|
+
/**
|
|
1881
|
+
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
1882
|
+
|
|
1883
|
+
*/
|
|
1884
|
+
|
|
1885
|
+
limit?:number;
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* @description Retrieves a list of contract term resources for the subscription specified in the path.
|
|
1889
|
+
|
|
1890
|
+
*/
|
|
1891
|
+
|
|
1892
|
+
offset?:string;
|
|
1893
|
+
}
|
|
1894
|
+
export interface ListDiscountsResponse {
|
|
1895
|
+
/**
|
|
1896
|
+
* @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.
|
|
1897
|
+
|
|
1898
|
+
*/
|
|
1899
|
+
|
|
1900
|
+
list:{discount:Discount}[];
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* @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.
|
|
1904
|
+
|
|
1905
|
+
*/
|
|
1906
|
+
|
|
1907
|
+
next_offset?:string;
|
|
1908
|
+
}
|
|
1909
|
+
export interface ListDiscountsInputParam {
|
|
1910
|
+
[key : string]: any;
|
|
1911
|
+
/**
|
|
1912
|
+
* @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.
|
|
1913
|
+
|
|
1914
|
+
*/
|
|
1915
|
+
|
|
1916
|
+
limit?:number;
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* @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.
|
|
1920
|
+
|
|
1921
|
+
*/
|
|
1922
|
+
|
|
1923
|
+
offset?:string;
|
|
1924
|
+
}
|
|
1925
|
+
export interface RetrieveResponse {
|
|
1926
|
+
subscription:Subscription;
|
|
1927
|
+
|
|
1928
|
+
customer:Customer;
|
|
1929
|
+
|
|
1930
|
+
card?:Card;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
export interface RetrieveWithScheduledChangesResponse {
|
|
1934
|
+
subscription:Subscription;
|
|
1935
|
+
|
|
1936
|
+
customer:Customer;
|
|
1937
|
+
|
|
1938
|
+
card?:Card;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
export interface RemoveScheduledChangesResponse {
|
|
1942
|
+
subscription:Subscription;
|
|
1943
|
+
|
|
1944
|
+
customer:Customer;
|
|
1945
|
+
|
|
1946
|
+
card?:Card;
|
|
1947
|
+
|
|
1948
|
+
credit_notes?:CreditNote[];
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
export interface RemoveScheduledCancellationResponse {
|
|
1952
|
+
subscription:Subscription;
|
|
1953
|
+
|
|
1954
|
+
customer:Customer;
|
|
1955
|
+
|
|
1956
|
+
card?:Card;
|
|
1957
|
+
}
|
|
1958
|
+
export interface RemoveScheduledCancellationInputParam {
|
|
1959
|
+
|
|
1960
|
+
/**
|
|
1961
|
+
* @description Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
|
|
1962
|
+
|
|
1963
|
+
*/
|
|
1964
|
+
|
|
1965
|
+
billing_cycles?:number;
|
|
1966
|
+
}
|
|
1967
|
+
export interface RemoveCouponsResponse {
|
|
1968
|
+
subscription:Subscription;
|
|
1969
|
+
|
|
1970
|
+
customer:Customer;
|
|
1971
|
+
|
|
1972
|
+
card?:Card;
|
|
1973
|
+
}
|
|
1974
|
+
export interface RemoveCouponsInputParam {
|
|
1975
|
+
|
|
1976
|
+
/**
|
|
1977
|
+
* @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
|
|
1978
|
+
|
|
1979
|
+
*/
|
|
1980
|
+
|
|
1981
|
+
coupon_ids?:string[];
|
|
1982
|
+
}
|
|
1983
|
+
export interface UpdateResponse {
|
|
1984
|
+
subscription:Subscription;
|
|
1985
|
+
|
|
1986
|
+
customer:Customer;
|
|
1987
|
+
|
|
1988
|
+
card?:Card;
|
|
1989
|
+
|
|
1990
|
+
invoice?:Invoice;
|
|
1991
|
+
|
|
1992
|
+
unbilled_charges?:UnbilledCharge[];
|
|
1993
|
+
|
|
1994
|
+
credit_notes?:CreditNote[];
|
|
1995
|
+
}
|
|
1996
|
+
export interface UpdateInputParam {
|
|
1997
|
+
[key : string] : any;
|
|
1998
|
+
/**
|
|
1999
|
+
* @description Identifier of the plan for this subscription.
|
|
2000
|
+
|
|
2001
|
+
*/
|
|
2002
|
+
|
|
2003
|
+
plan_id?:string;
|
|
2004
|
+
|
|
2005
|
+
/**
|
|
2006
|
+
* @description Represents the plan quantity for this subscription.
|
|
2007
|
+
|
|
2008
|
+
*/
|
|
2009
|
+
|
|
2010
|
+
plan_quantity?:number;
|
|
2011
|
+
|
|
2012
|
+
/**
|
|
2013
|
+
* @description Amount that will override the plan's default price. The unit depends on the [type of currency](/docs/api#md_disabled). If `changes_scheduled_at` is in the past and a `plan_unit_price` is not passed, then the plan's current unit price is considered even if the plan did not exist on the date as of when the change is scheduled.
|
|
2014
|
+
|
|
2015
|
+
*/
|
|
2016
|
+
|
|
2017
|
+
plan_unit_price?:number;
|
|
2018
|
+
|
|
2019
|
+
/**
|
|
2020
|
+
* @description Amount that will override the default setup fee. The unit depends on the [type of currency](/docs/api?prod_cat_ver=1#md_disabled).
|
|
2021
|
+
|
|
2022
|
+
*/
|
|
2023
|
+
|
|
2024
|
+
setup_fee?:number;
|
|
2025
|
+
|
|
2026
|
+
/**
|
|
2027
|
+
* @description Should be true if the existing addons should be replaced with the ones that are being passed.
|
|
2028
|
+
|
|
2029
|
+
*/
|
|
2030
|
+
|
|
2031
|
+
replace_addon_list?:boolean;
|
|
2032
|
+
|
|
2033
|
+
/**
|
|
2034
|
+
* @description List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
|
|
2035
|
+
|
|
2036
|
+
*/
|
|
2037
|
+
|
|
2038
|
+
mandatory_addons_to_remove?:string[];
|
|
2039
|
+
|
|
2040
|
+
/**
|
|
2041
|
+
* @description The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
2042
|
+
|
|
2043
|
+
*/
|
|
2044
|
+
|
|
2045
|
+
plan_quantity_in_decimal?:string;
|
|
2046
|
+
|
|
2047
|
+
/**
|
|
2048
|
+
* @description When [price overriding](https://www.chargebee.com/docs/price-override.html) is enabled for the site, the price or per-unit price of the item can be set here. The [value set for the item price](/docs/api/item_prices#item_price_price) is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when [multi-decimal pricing](/docs/api#handling_currency_units) is enabled. If `changes_scheduled_at` is in the past and a `unit_price_in_decimal` 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.
|
|
2049
|
+
|
|
2050
|
+
*/
|
|
2051
|
+
|
|
2052
|
+
plan_unit_price_in_decimal?:string;
|
|
2053
|
+
|
|
2054
|
+
/**
|
|
2055
|
+
* @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:
|
|
2056
|
+
|
|
2057
|
+
* `invoice_date` must be in the past.
|
|
2058
|
+
* `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.
|
|
2059
|
+
* It is not earlier than `changes_scheduled_at`, `reactivate_from`, or `trial_end`.
|
|
2060
|
+
* `invoice_immediately` is `true`.
|
|
2061
|
+
.
|
|
2062
|
+
|
|
2063
|
+
*/
|
|
2064
|
+
|
|
2065
|
+
invoice_date?:number;
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* @description The new start date of a `future` subscription. Applicable only for `future` subscriptions.
|
|
2069
|
+
|
|
2070
|
+
*/
|
|
2071
|
+
|
|
2072
|
+
start_date?:number;
|
|
2073
|
+
|
|
2074
|
+
/**
|
|
2075
|
+
* @description The time at which the trial has ended or will end for the subscription. Set it to `0` to have no trial period.
|
|
2076
|
+
**Note**
|
|
2077
|
+
|
|
2078
|
+
* This is only allowed when the subscription `status` is `future`, `in_trial`, or `cancelled`.
|
|
2079
|
+
* The value must not be earlier than `changes_scheduled_at` or `start_date`.
|
|
2080
|
+
* 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.
|
|
2081
|
+
|
|
2082
|
+
*/
|
|
2083
|
+
|
|
2084
|
+
trial_end?:number;
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* @description The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan is used.
|
|
2088
|
+
|
|
2089
|
+
*/
|
|
2090
|
+
|
|
2091
|
+
billing_cycles?:number;
|
|
2092
|
+
|
|
2093
|
+
/**
|
|
2094
|
+
* @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.
|
|
2095
|
+
|
|
2096
|
+
*/
|
|
2097
|
+
|
|
2098
|
+
terms_to_charge?:number;
|
|
2099
|
+
|
|
2100
|
+
/**
|
|
2101
|
+
* @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.
|
|
2102
|
+
**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:
|
|
2103
|
+
|
|
2104
|
+
* Backdating must be enabled for subscription reactivation operations.
|
|
2105
|
+
* 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.
|
|
2106
|
+
* The date is on or after the last date/time any of the product catalog items of the subscription were changed.
|
|
2107
|
+
* 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.
|
|
2108
|
+
.
|
|
2109
|
+
|
|
2110
|
+
*/
|
|
2111
|
+
|
|
2112
|
+
reactivate_from?:number;
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* @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.
|
|
2116
|
+
|
|
2117
|
+
*/
|
|
2118
|
+
|
|
2119
|
+
billing_alignment_mode?:BillingAlignmentMode;
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* @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.
|
|
2123
|
+
|
|
2124
|
+
*/
|
|
2125
|
+
|
|
2126
|
+
auto_collection?:AutoCollection;
|
|
2127
|
+
|
|
2128
|
+
/**
|
|
2129
|
+
* @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
|
|
2130
|
+
|
|
2131
|
+
*/
|
|
2132
|
+
|
|
2133
|
+
offline_payment_method?:OfflinePaymentMethod;
|
|
2134
|
+
|
|
2135
|
+
/**
|
|
2136
|
+
* @description Purchase order number for this subscription.
|
|
2137
|
+
|
|
2138
|
+
*/
|
|
2139
|
+
|
|
2140
|
+
po_number?:string;
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* @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.
|
|
2144
|
+
|
|
2145
|
+
*/
|
|
2146
|
+
|
|
2147
|
+
coupon_ids?:string[];
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* @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`.
|
|
2151
|
+
|
|
2152
|
+
*/
|
|
2153
|
+
|
|
2154
|
+
replace_coupon_list?:boolean;
|
|
2155
|
+
|
|
2156
|
+
/**
|
|
2157
|
+
* @description * When `true`: [Prorated credits or charges](https://www.chargebee.com/docs/1.0/proration.html#proration-mechanism) are created as applicable for this change.
|
|
2158
|
+
* When `false`: The subscription is changed without creating any credits or charges.
|
|
2159
|
+
* When not provided, the value configured in the [site settings](https://www.chargebee.com/docs/1.0/proration.html#proration-for-subscription-change) is considered.
|
|
2160
|
+
|
|
2161
|
+
**Caveat**
|
|
2162
|
+
|
|
2163
|
+
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:
|
|
2164
|
+
|
|
2165
|
+
An immediate previous change was made
|
|
2166
|
+
|
|
2167
|
+
* with `prorate` set to `false` and
|
|
2168
|
+
* no changes were made to the subscription's billing term and
|
|
2169
|
+
* a change was made to either the subscription's plan, its addons, or the prices of the plan or addons.
|
|
2170
|
+
|
|
2171
|
+
*/
|
|
2172
|
+
|
|
2173
|
+
prorate?:boolean;
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* @description Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
|
|
2177
|
+
|
|
2178
|
+
*/
|
|
2179
|
+
|
|
2180
|
+
end_of_term?:boolean;
|
|
2181
|
+
|
|
2182
|
+
/**
|
|
2183
|
+
* @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).
|
|
2184
|
+
**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.
|
|
2185
|
+
|
|
2186
|
+
*/
|
|
2187
|
+
|
|
2188
|
+
force_term_reset?:boolean;
|
|
2189
|
+
|
|
2190
|
+
/**
|
|
2191
|
+
* @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 `plan_id` or `addons[id]`
|
|
2192
|
+
|
|
2193
|
+
*/
|
|
2194
|
+
|
|
2195
|
+
reactivate?:boolean;
|
|
2196
|
+
|
|
2197
|
+
/**
|
|
2198
|
+
* @description The Chargebee payment token generated by Chargebee JS.
|
|
2199
|
+
|
|
2200
|
+
*/
|
|
2201
|
+
|
|
2202
|
+
token_id?:string;
|
|
2203
|
+
|
|
2204
|
+
/**
|
|
2205
|
+
* @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.
|
|
2206
|
+
|
|
2207
|
+
*/
|
|
2208
|
+
|
|
2209
|
+
invoice_notes?:string;
|
|
2210
|
+
|
|
2211
|
+
/**
|
|
2212
|
+
* @description A collection of key-value pairs that provides extra information about the subscription.
|
|
2213
|
+
**Note:** There's a character limit of 65,535.
|
|
2214
|
+
[Learn more](advanced-features?prod_cat_ver=1#metadata).
|
|
2215
|
+
|
|
2216
|
+
*/
|
|
2217
|
+
|
|
2218
|
+
meta_data?:object;
|
|
2219
|
+
|
|
2220
|
+
/**
|
|
2221
|
+
* @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).
|
|
2222
|
+
**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. .
|
|
2223
|
+
|
|
2224
|
+
*/
|
|
2225
|
+
|
|
2226
|
+
invoice_immediately?:boolean;
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* @description If `true`, ignores the [hierarchy relationship](./customers?prod_cat_ver=2#customer_relationship) and uses customer as payment and invoice owner.
|
|
2230
|
+
|
|
2231
|
+
*/
|
|
2232
|
+
|
|
2233
|
+
override_relationship?:boolean;
|
|
2234
|
+
|
|
2235
|
+
/**
|
|
2236
|
+
* @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:
|
|
2237
|
+
|
|
2238
|
+
* Backdating must be enabled for subscription change operations.
|
|
2239
|
+
* Only the following changes can be backdated:
|
|
2240
|
+
* Changes in the recurring items or their prices.
|
|
2241
|
+
* Addition of non-recurring items.
|
|
2242
|
+
* Subscription `status` is `active`, `cancelled`, or `non_renewing`.
|
|
2243
|
+
* 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.
|
|
2244
|
+
* The date is on or after `current_term_start`.
|
|
2245
|
+
* The date is on or after the last date/time any of the following changes were made:
|
|
2246
|
+
* Changes in the recurring items or their prices.
|
|
2247
|
+
* Addition of non-recurring items.
|
|
2248
|
+
* 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.
|
|
2249
|
+
.
|
|
2250
|
+
|
|
2251
|
+
*/
|
|
2252
|
+
|
|
2253
|
+
changes_scheduled_at?:number;
|
|
2254
|
+
|
|
2255
|
+
/**
|
|
2256
|
+
* @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.
|
|
2257
|
+
|
|
2258
|
+
*/
|
|
2259
|
+
|
|
2260
|
+
change_option?:ChangeOption;
|
|
2261
|
+
|
|
2262
|
+
/**
|
|
2263
|
+
* @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).
|
|
2264
|
+
|
|
2265
|
+
*/
|
|
2266
|
+
|
|
2267
|
+
contract_term_billing_cycle_on_renewal?:number;
|
|
2268
|
+
|
|
2269
|
+
/**
|
|
2270
|
+
* @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.
|
|
2271
|
+
|
|
2272
|
+
*/
|
|
2273
|
+
|
|
2274
|
+
free_period?:number;
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* @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)
|
|
2278
|
+
|
|
2279
|
+
*/
|
|
2280
|
+
|
|
2281
|
+
free_period_unit?:FreePeriodUnit;
|
|
2282
|
+
|
|
2283
|
+
/**
|
|
2284
|
+
* @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.
|
|
2285
|
+
|
|
2286
|
+
*/
|
|
2287
|
+
|
|
2288
|
+
trial_end_action?:TrialEndAction;
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* @description Parameters for card
|
|
2292
|
+
|
|
2293
|
+
*/
|
|
2294
|
+
|
|
2295
|
+
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};
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* @description Parameters for payment_method
|
|
2299
|
+
|
|
2300
|
+
*/
|
|
2301
|
+
|
|
2302
|
+
payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
|
|
2303
|
+
|
|
2304
|
+
/**
|
|
2305
|
+
* @description Parameters for payment_intent
|
|
2306
|
+
|
|
2307
|
+
*/
|
|
2308
|
+
|
|
2309
|
+
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' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
2310
|
+
|
|
2311
|
+
/**
|
|
2312
|
+
* @description Parameters for billing_address
|
|
2313
|
+
|
|
2314
|
+
*/
|
|
2315
|
+
|
|
2316
|
+
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};
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* @description Parameters for shipping_address
|
|
2320
|
+
|
|
2321
|
+
*/
|
|
2322
|
+
|
|
2323
|
+
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};
|
|
2324
|
+
|
|
2325
|
+
/**
|
|
2326
|
+
* @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.
|
|
2327
|
+
|
|
2328
|
+
You can modify the plan, plan quantity and add or remove addons for the subscription. By default the changes are applied immediately and the charges (/credits) are prorated and adjusted with the next billing term. You may also choose to effect the changes at the end of the current term by passing **end_of_term** as "true". In this case proration will not be done.
|
|
2329
|
+
|
|
2330
|
+
Only the parameters that are passed are modified for the subscription. Rest will reflect the existing values.
|
|
2331
|
+
|
|
2332
|
+
By default, the addons passed are appended to the existing list of addons for this subscription. In case a passed addon already exists for this subscription, quantity value is replaced. If you want to completely replace the addons for this subscription, pass **replace_addon_list** as "true".
|
|
2333
|
+
|
|
2334
|
+
[Card](/docs/api/cards#card_attributes) and 'vat_number' attributes can also be passed during subscription update. If they are passed, corresponding Billing Info attributes - the [Billing Address](/docs/api/customers#billing_address_attributes) and 'vat_number' - will be replaced automatically.
|
|
2335
|
+
|
|
2336
|
+
Passing credit card details to this API involves PCI liability at your end as sensitive card info passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable
|
|
2337
|
+
|
|
2338
|
+
* If you are using Stripe gateway, you can use [Stripe.js](https://stripe.com/docs/stripe.js) with your checkout form. Take a look at this [Stripe tutorial](https://stripe.com/docs/payments/accept-a-payment-charges) for more details.
|
|
2339
|
+
* If you are using Braintree gateway, you can use [Braintree.js](https://www.braintreepayments.com/docs/javascript) with your checkout form. Please refer this [tutorial](https://www.chargebee.com/tutorials/braintree-js-example.html) for more details.
|
|
2340
|
+
* If you are using Authorize.Net gateway, you use [Accept.js](https://developer.authorize.net/api/reference/features/acceptjs.html) with your checkout form.
|
|
2341
|
+
* If you are using the Adyen gateway, you will have to use the Adyen's [Client Side Encryption](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/cse-integration-ecommerce) to encrypt sensitive cardholder data. Once the cardholder data is encrypted, pass the value in adyen.encrypted.data as temp token in this API.
|
|
2342
|
+
* You can also use our [Hosted Pages](https://www.chargebee.com/docs/hosted_pages.html) based integration.
|
|
2343
|
+
|
|
2344
|
+
|
|
2345
|
+
|
|
2346
|
+
|
|
2347
|
+
*/
|
|
2348
|
+
|
|
2349
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
2350
|
+
|
|
2351
|
+
/**
|
|
2352
|
+
* @description Parameters for customer
|
|
2353
|
+
|
|
2354
|
+
*/
|
|
2355
|
+
|
|
2356
|
+
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};
|
|
2357
|
+
|
|
2358
|
+
/**
|
|
2359
|
+
* @description Parameters for contract_term
|
|
2360
|
+
|
|
2361
|
+
*/
|
|
2362
|
+
|
|
2363
|
+
contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
|
|
2364
|
+
|
|
2365
|
+
/**
|
|
2366
|
+
* @description Parameters for addons
|
|
2367
|
+
|
|
2368
|
+
*/
|
|
2369
|
+
|
|
2370
|
+
addons?:{billing_cycles?:number,id?:string,proration_type?:ProrationType,quantity?:number,quantity_in_decimal?:string,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
2371
|
+
|
|
2372
|
+
/**
|
|
2373
|
+
* @description Parameters for event_based_addons
|
|
2374
|
+
|
|
2375
|
+
*/
|
|
2376
|
+
|
|
2377
|
+
event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1335
2378
|
}
|
|
1336
2379
|
export interface UpdateForItemsResponse {
|
|
1337
2380
|
subscription:Subscription;
|
|
@@ -1653,7 +2696,7 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
|
|
|
1653
2696
|
|
|
1654
2697
|
*/
|
|
1655
2698
|
|
|
1656
|
-
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};
|
|
2699
|
+
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' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
1657
2700
|
|
|
1658
2701
|
/**
|
|
1659
2702
|
* @description Parameters for billing_address
|
|
@@ -1878,7 +2921,7 @@ When dunning (payment failure retry settings) is configured with the last retry
|
|
|
1878
2921
|
|
|
1879
2922
|
*/
|
|
1880
2923
|
|
|
1881
|
-
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};
|
|
2924
|
+
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' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
1882
2925
|
}
|
|
1883
2926
|
export interface AddChargeAtTermEndResponse {
|
|
1884
2927
|
estimate:Estimate;
|
|
@@ -2660,7 +3703,7 @@ For non-renewing subscriptions,`resume_date` should be before the canc
|
|
|
2660
3703
|
|
|
2661
3704
|
*/
|
|
2662
3705
|
|
|
2663
|
-
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};
|
|
3706
|
+
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' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
2664
3707
|
}
|
|
2665
3708
|
export interface RemoveScheduledPauseResponse {
|
|
2666
3709
|
subscription:Subscription;
|