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