chargebee 2.35.0 → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +18 -17
- package/package.json +1 -1
- package/types/index.d.ts +4 -2
- package/types/resources/BusinessEntity.d.ts +83 -0
- package/types/resources/BusinessEntityTransfer.d.ts +21 -0
- package/types/resources/CreditNote.d.ts +7 -0
- package/types/resources/Customer.d.ts +164 -1630
- package/types/resources/Estimate.d.ts +187 -1159
- package/types/resources/Invoice.d.ts +9 -0
- package/types/resources/ItemPrice.d.ts +3 -0
- package/types/resources/Quote.d.ts +289 -1399
- package/types/resources/Subscription.d.ts +2 -0
- package/types/resources/UnbilledCharge.d.ts +28 -275
- package/.github/workflows/greeting.yml +0 -47
|
@@ -2,248 +2,60 @@
|
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface Estimate {
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* @description The time at which this estimate got generated
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
5
|
created_at:number;
|
|
11
6
|
|
|
12
|
-
/**
|
|
13
|
-
* @description Represents the subscription details when the 'estimate' operations are invoked.
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
7
|
subscription_estimate?:SubscriptionEstimate;
|
|
18
8
|
|
|
19
|
-
/**
|
|
20
|
-
* @description Is a list of estimated subscriptions i.e., an array of *subscription_estimate* objects. It is generated when 'Create an estimate for purchase' operation is invoked
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
9
|
subscription_estimates?:SubscriptionEstimate[];
|
|
25
10
|
|
|
26
|
-
/**
|
|
27
|
-
* @description Represents the preview of the invoice generated immediately when the 'estimate' operations are invoked.
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
11
|
invoice_estimate?:InvoiceEstimate;
|
|
32
12
|
|
|
33
|
-
/**
|
|
34
|
-
* @description Is a list of estimated invoices i.e., an array of *invoice_estimate* objects. It is generated when 'Create an estimate for unbilled charges' operation is invoked
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
13
|
invoice_estimates?:InvoiceEstimate[];
|
|
39
14
|
|
|
40
|
-
/**
|
|
41
|
-
* @description Represents the preview of the invoice generated at term end when the 'estimate' operations are invoked.
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
15
|
next_invoice_estimate?:InvoiceEstimate;
|
|
46
16
|
|
|
47
|
-
/**
|
|
48
|
-
* @description Represents the preview of the credit-notes generated during 'estimate' operation. Currently applicable only for the 'Update Subscription Estimate' operation.
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
17
|
credit_note_estimates?:CreditNoteEstimate[];
|
|
53
18
|
|
|
54
|
-
/**
|
|
55
|
-
* @description Represents the preview of the unbilled charges generated during 'estimate' operation. Currently not applicable for the 'Subscription renewal estimate' operation.
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
19
|
unbilled_charge_estimates?:UnbilledCharge[];
|
|
60
20
|
}
|
|
61
21
|
export namespace Estimate {
|
|
62
22
|
export class EstimateResource {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
**Note:** Estimate operations do not make any changes in Chargebee; hence this API does not create an actual `customer` or `subscription` record.
|
|
67
|
-
**See also**
|
|
68
|
-
|
|
69
|
-
* [Estimate a purchase](https://apidocs.chargebee.com/docs/api/purchases#estimates_for_purchase): an operation that estimates a `purchase` representing multiple subscriptions bought together by a customer.
|
|
70
|
-
|
|
71
|
-
The response contains one or more of the following objects:
|
|
72
|
-
|
|
73
|
-
* `subscription_estimate`: The subscription details like the status of the subscription (such as `in_trial` or `active`), next billing date, and so on.
|
|
74
|
-
* `invoice_estimate`:The details of the immediate invoice, if there is one. If the subscription is created in `trial`/`future` states, `invoice_estimate` is unavailable as no immediate invoice is generated.
|
|
75
|
-
* `next_invoice_estimate`:This is returned when an immediate invoice is not generated. It contains the details of the invoice that will be generated on the next billing date of the subscription.
|
|
76
|
-
* `unbilled_charge_estimates`: This contains the details of charges that have not been invoiced. This is returned only if the `invoice_immediately` parameter is set to `false`.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
*/
|
|
82
|
-
|
|
23
|
+
create_subscription(input:CreateSubscriptionInputParam):ChargebeeRequest<CreateSubscriptionResponse>;
|
|
24
|
+
|
|
83
25
|
create_sub_item_estimate(input:CreateSubItemEstimateInputParam):ChargebeeRequest<CreateSubItemEstimateResponse>;
|
|
84
26
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
**See also**
|
|
88
|
-
|
|
89
|
-
* [Estimate a purchase](https://apidocs.chargebee.com/docs/api/purchases#estimates_for_purchase): an operation that estimates a `purchase` representing multiple subscriptions bought together by a customer.
|
|
90
|
-
|
|
91
|
-
*/
|
|
92
|
-
|
|
27
|
+
create_sub_for_customer_estimate(customer_id:string, input:CreateSubForCustomerEstimateInputParam):ChargebeeRequest<CreateSubForCustomerEstimateResponse>;
|
|
28
|
+
|
|
93
29
|
create_sub_item_for_customer_estimate(customer_id:string, input:CreateSubItemForCustomerEstimateInputParam):ChargebeeRequest<CreateSubItemForCustomerEstimateResponse>;
|
|
94
30
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
In the response,
|
|
99
|
-
|
|
100
|
-
* [subscription_estimate](/docs/api/estimates#subscription_estimate_attributes): The details of the changed subscription such as `status`, next billing date, and so on.
|
|
101
|
-
* [invoice_estimate](/docs/api/estimates#invoice_estimate_attributes):The details of the immediate invoice, if it is generated. An immediate invoice is not generated when:
|
|
102
|
-
* `end_of_term` parameter is true
|
|
103
|
-
* `prorate` parameter is `false`
|
|
104
|
-
* No changes are made to the plan item prices or addon item prices in `subscription_items`.
|
|
105
|
-
* For changes such as [quantity downgrades](https://www.chargebee.com/docs/proration.html#proration-mechanism_plan-quantity-downgrade-paid-invoice).
|
|
106
|
-
* [next_invoice_estimate](/docs/api/estimates#next_invoice_estimate_attributes):The details of the invoice to be generated later (if any) on the occasion that no immediate invoice has been generated.
|
|
107
|
-
* [credit_note_estimates](/docs/api/estimates#credit_note_estimate_attributes):The list of credit notes (if any) generated during this operation.
|
|
108
|
-
* [unbilled_charge_estimates](/docs/api/estimates#unbilled_charge_estimate_attributes): The details of charges that have not been invoiced. This is returned only if the `invoice_immediately` parameter is set to `false`.
|
|
109
|
-
|
|
110
|
-
*/
|
|
111
|
-
|
|
31
|
+
update_subscription(input:UpdateSubscriptionInputParam):ChargebeeRequest<UpdateSubscriptionResponse>;
|
|
32
|
+
|
|
112
33
|
update_subscription_for_items(input:UpdateSubscriptionForItemsInputParam):ChargebeeRequest<UpdateSubscriptionForItemsResponse>;
|
|
113
34
|
|
|
114
|
-
/**
|
|
115
|
-
* @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
|
|
116
|
-
|
|
117
|
-
In the response,
|
|
118
|
-
|
|
119
|
-
* **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
|
|
120
|
-
* **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
|
|
121
|
-
|
|
122
|
-
The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
|
|
123
|
-
|
|
124
|
-
To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify 'false' for the parameter *include_delayed_charges*.
|
|
125
|
-
|
|
126
|
-
**Note:**
|
|
127
|
-
|
|
128
|
-
* This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
|
|
129
|
-
* For 'Non Renewing' subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
|
|
130
|
-
* This API is not supported for 'Cancelled' subscriptions.
|
|
131
|
-
* Only the subscription's charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
|
|
132
|
-
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
35
|
renewal_estimate(subscription_id:string, input?:RenewalEstimateInputParam):ChargebeeRequest<RenewalEstimateResponse>;
|
|
136
36
|
|
|
137
|
-
/**
|
|
138
|
-
* @description This API is used to generate an invoice estimate for preview. Estimate details include the number of billing cycles to be invoiced in advance, the number of billing cycles in one interval, advance invoicing schedules, and so on.
|
|
139
|
-
|
|
140
|
-
*/
|
|
141
|
-
|
|
142
37
|
advance_invoice_estimate(subscription_id:string, input?:AdvanceInvoiceEstimateInputParam):ChargebeeRequest<AdvanceInvoiceEstimateResponse>;
|
|
143
38
|
|
|
144
|
-
/**
|
|
145
|
-
* @description Regenerates the invoice for the current term of the subscription. The subscription must have `status` as `active` or `non_renewing`. This operation is not allowed when any of the following conditions hold true for the subscription:
|
|
146
|
-
|
|
147
|
-
* An invoice exists for the current term and its `status` is not `voided`.
|
|
148
|
-
* There are [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html) for the current term.
|
|
149
|
-
* The subscription has an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html).
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
#### Response
|
|
154
|
-
|
|
155
|
-
Returns an `estimate` object with one of the following components depending on the value of `invoice_immediately`.
|
|
156
|
-
|
|
157
|
-
* If the value is `true`: an `invoice_estimate` object that corresponds to the regenerated invoice.
|
|
158
|
-
* If the value is `false`: a list of `unbilled_charge_estimate` objects corresponding to all the unbilled charges created for the current term of the subscription.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
39
|
regenerate_invoice_estimate(subscription_id:string, input?:RegenerateInvoiceEstimateInputParam):ChargebeeRequest<RegenerateInvoiceEstimateResponse>;
|
|
166
40
|
|
|
167
|
-
/**
|
|
168
|
-
* @description Estimate of the upcoming scheduled invoices (subscription activations, renewals etc) of a customer. For now preview of the invoices generated on the immediate upcoming date is supported. Say a customer has couple of subscription renewals scheduled on *Jan,10th* and another subscription renewal scheduled on *Jan,15th* . This API gives the preview of all the invoices scheduled to be generated on *Jan,10th* (immediate upcoming date).
|
|
169
|
-
|
|
170
|
-
In the response:
|
|
171
|
-
|
|
172
|
-
* **estimate.invoice_estimates\[\]** has details of the invoices scheduled to be generated.
|
|
173
|
-
|
|
174
|
-
**Note:** If *consolidated invoicing* is enabled you may use this API to test whether upcoming renewals are consolidated.
|
|
175
|
-
|
|
176
|
-
*/
|
|
177
|
-
|
|
178
41
|
upcoming_invoices_estimate(customer_id:string):ChargebeeRequest<UpcomingInvoicesEstimateResponse>;
|
|
179
42
|
|
|
180
|
-
/**
|
|
181
|
-
* @description Generates an estimate for the 'change term end' operation. This is similar to the [Change term end](/docs/api/subscriptions#change_term_end) API but the subscription's term end will not be changed, only an estimate for this operation is created. This is applicable only for subscriptions in 'in-trial', 'active' and 'non-renewing' states.
|
|
182
|
-
|
|
183
|
-
In the response,
|
|
184
|
-
|
|
185
|
-
* **estimate.subscription_estimate** has the subscription details like the status of the subscription (in_trial, active, etc.), next billing date, and so on.
|
|
186
|
-
* **estimate.invoice_estimate** has details of the invoice that will be generated immediately. This will not be present if no immediate invoice is generated for this operation. This will happen when
|
|
187
|
-
* *prorate* parameter is false, or
|
|
188
|
-
* *invoice_immediately* parameter is false, or
|
|
189
|
-
* subscription is in *in-trial* state
|
|
190
|
-
* **estimate.credit_note_estimates\[\]** has details of the credit-notes that will get generated during this operation. This list will be empty if no credit-note gets generated during this operation.
|
|
191
|
-
* **estimate.unbilled_charge_estimates\[\]** has details of the unbilled charges. This is returned only if *invoice_immediately* is set as false.
|
|
192
|
-
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
43
|
change_term_end(subscription_id:string, input:ChangeTermEndInputParam):ChargebeeRequest<ChangeTermEndResponse>;
|
|
196
44
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
*/
|
|
201
|
-
|
|
45
|
+
cancel_subscription(subscription_id:string, input?:CancelSubscriptionInputParam):ChargebeeRequest<CancelSubscriptionResponse>;
|
|
46
|
+
|
|
202
47
|
cancel_subscription_for_items(subscription_id:string, input?:CancelSubscriptionForItemsInputParam):ChargebeeRequest<CancelSubscriptionForItemsResponse>;
|
|
203
48
|
|
|
204
|
-
/**
|
|
205
|
-
* @description This API provides an estimate of the details pertaining to the [pause_subscription](/docs/api/subscriptions#pause_a_subscription) operation. It returns attributes such as [pause_date](/docs/api/estimates#estimate_subscription_estimate_pause_date) and [resume_date](/docs/api/estimates#estimate_subscription_estimate_resume_date). This is similar to the [Pause a subscription](/docs/api/subscriptions#pause_a_subscription) API with the exception that the subscription is not paused. Only an estimate for this operation is created.
|
|
206
|
-
|
|
207
|
-
In the response,
|
|
208
|
-
|
|
209
|
-
* **estimate.subscription_estimate** has the subscription details.
|
|
210
|
-
* **estimate.invoice_estimate** has details of the invoice that are generated immediately. This is not present if no immediate invoices are generated for this operation.
|
|
211
|
-
* **estimate.credit_note_estimates\[\]** has details of the credit notes that are generated during this operation. This list is empty if no credit notes are generated.
|
|
212
|
-
|
|
213
|
-
*/
|
|
214
|
-
|
|
215
49
|
pause_subscription(subscription_id:string, input?:PauseSubscriptionInputParam):ChargebeeRequest<PauseSubscriptionResponse>;
|
|
216
50
|
|
|
217
|
-
/**
|
|
218
|
-
* @description Generates an estimate for the 'resume subscription' operation. This is similar to the [Resume a subscription](/docs/api/subscriptions#resume_a_subscription) API, but the subscription will not be resumed. Only an estimate for this operation is created.
|
|
219
|
-
|
|
220
|
-
In the response,
|
|
221
|
-
|
|
222
|
-
* **estimate.subscription_estimate** has the subscription details.
|
|
223
|
-
* **estimate.invoice_estimate** has details of the invoice that will be generated immediately. This will not be present if no immediate invoice is generated for this operation. This will happen for in-term resumption^++^.
|
|
224
|
-
|
|
225
|
-
**^++^What is an "in-term resumption"?**
|
|
226
|
-
An "in-term resumption" is when the resumption happens within the billing term of the subscription.
|
|
227
|
-
* **estimate.next_invoice_estimate** has details of the invoice that will be generated during the next billing date of this subscription. This will be present only if no immediate invoice is generated during this operation (scenario mentioned above) and this subscription has next billing.
|
|
228
|
-
|
|
229
|
-
The generated invoice_estimate/next_invoice_estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any.
|
|
230
|
-
|
|
231
|
-
*/
|
|
232
|
-
|
|
233
51
|
resume_subscription(subscription_id:string, input?:ResumeSubscriptionInputParam):ChargebeeRequest<ResumeSubscriptionResponse>;
|
|
234
52
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
*/
|
|
239
|
-
|
|
53
|
+
gift_subscription(input:GiftSubscriptionInputParam):ChargebeeRequest<GiftSubscriptionResponse>;
|
|
54
|
+
|
|
240
55
|
gift_subscription_for_items(input:GiftSubscriptionForItemsInputParam):ChargebeeRequest<GiftSubscriptionForItemsResponse>;
|
|
241
56
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
*/
|
|
246
|
-
|
|
57
|
+
create_invoice(input?:CreateInvoiceInputParam):ChargebeeRequest<CreateInvoiceResponse>;
|
|
58
|
+
|
|
247
59
|
create_invoice_for_items(input:CreateInvoiceForItemsInputParam):ChargebeeRequest<CreateInvoiceForItemsResponse>;
|
|
248
60
|
}
|
|
249
61
|
export interface CreateSubscriptionResponse {
|
|
@@ -251,754 +63,270 @@ In the response,
|
|
|
251
63
|
}
|
|
252
64
|
export interface CreateSubscriptionInputParam {
|
|
253
65
|
|
|
254
|
-
|
|
255
|
-
* @description Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
|
|
256
|
-
|
|
257
|
-
*/
|
|
66
|
+
subscription:null.null;
|
|
258
67
|
|
|
259
|
-
|
|
68
|
+
billing_address?:null.null;
|
|
260
69
|
|
|
261
|
-
|
|
262
|
-
* @description List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
|
|
263
|
-
|
|
264
|
-
*/
|
|
70
|
+
shipping_address?:null.null;
|
|
265
71
|
|
|
266
|
-
|
|
72
|
+
customer?:null.null;
|
|
267
73
|
|
|
268
|
-
|
|
269
|
-
* @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
|
|
270
|
-
|
|
271
|
-
*/
|
|
74
|
+
contract_term?:null.null;
|
|
272
75
|
|
|
273
|
-
|
|
76
|
+
addons?:{billing_cycles?:number,id?:string,quantity?:number,quantity_in_decimal?:string,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
274
77
|
|
|
275
|
-
|
|
276
|
-
* @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.
|
|
277
|
-
|
|
278
|
-
*/
|
|
78
|
+
event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
279
79
|
|
|
280
|
-
|
|
80
|
+
tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
|
|
281
81
|
|
|
282
|
-
|
|
283
|
-
* @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
|
|
284
|
-
|
|
285
|
-
*/
|
|
82
|
+
billing_cycles?:number;
|
|
286
83
|
|
|
287
|
-
|
|
84
|
+
mandatory_addons_to_remove?:string[];
|
|
288
85
|
|
|
289
|
-
|
|
290
|
-
* @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).
|
|
291
|
-
**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. .
|
|
292
|
-
|
|
293
|
-
*/
|
|
86
|
+
terms_to_charge?:number;
|
|
294
87
|
|
|
295
|
-
|
|
88
|
+
billing_alignment_mode?:BillingAlignmentMode;
|
|
296
89
|
|
|
297
|
-
|
|
298
|
-
* @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of this date. The date should not be 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.
|
|
299
|
-
|
|
300
|
-
*/
|
|
90
|
+
coupon_ids?:string[];
|
|
301
91
|
|
|
302
|
-
|
|
92
|
+
invoice_immediately?:boolean;
|
|
303
93
|
|
|
304
|
-
|
|
305
|
-
* @description Indicates the Client profile id for the customer. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
306
|
-
|
|
307
|
-
*/
|
|
94
|
+
invoice_date?:number;
|
|
308
95
|
|
|
309
96
|
client_profile_id?:string;
|
|
97
|
+
}
|
|
98
|
+
export interface CreateSubItemEstimateResponse {
|
|
99
|
+
estimate:Estimate;
|
|
100
|
+
}
|
|
101
|
+
export interface CreateSubItemEstimateInputParam {
|
|
310
102
|
|
|
311
|
-
|
|
312
|
-
* @description Parameters for subscription
|
|
313
|
-
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
|
-
subscription:{contract_term_billing_cycle_on_renewal?:number,free_period?:number,free_period_unit?:FreePeriodUnit,id?:string,offline_payment_method?:OfflinePaymentMethod,plan_id:string,plan_quantity?:number,plan_quantity_in_decimal?:string,plan_unit_price?:number,plan_unit_price_in_decimal?:string,setup_fee?:number,start_date?:number,trial_end?:number,trial_end_action?:TrialEndAction};
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* @description Parameters for billing_address
|
|
320
|
-
|
|
321
|
-
*/
|
|
322
|
-
|
|
323
|
-
billing_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* @description Parameters for shipping_address
|
|
327
|
-
|
|
328
|
-
*/
|
|
329
|
-
|
|
330
|
-
shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* @description Parameters for customer
|
|
334
|
-
|
|
335
|
-
*/
|
|
103
|
+
subscription?:null.null;
|
|
336
104
|
|
|
337
|
-
|
|
105
|
+
billing_address?:null.null;
|
|
338
106
|
|
|
339
|
-
|
|
340
|
-
* @description Parameters for contract_term
|
|
341
|
-
|
|
342
|
-
*/
|
|
107
|
+
shipping_address?:null.null;
|
|
343
108
|
|
|
344
|
-
|
|
109
|
+
customer?:null.null;
|
|
345
110
|
|
|
346
|
-
|
|
347
|
-
* @description Parameters for addons
|
|
348
|
-
|
|
349
|
-
*/
|
|
111
|
+
contract_term?:null.null;
|
|
350
112
|
|
|
351
|
-
|
|
113
|
+
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,item_type?:ItemType,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
352
114
|
|
|
353
|
-
|
|
354
|
-
* @description Parameters for event_based_addons
|
|
355
|
-
|
|
356
|
-
*/
|
|
115
|
+
discounts:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
|
|
357
116
|
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
export interface CreateSubItemEstimateResponse {
|
|
361
|
-
estimate:Estimate;
|
|
362
|
-
}
|
|
363
|
-
export interface CreateSubItemEstimateInputParam {
|
|
117
|
+
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}[];
|
|
364
118
|
|
|
365
|
-
|
|
366
|
-
* @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.
|
|
367
|
-
|
|
368
|
-
*/
|
|
119
|
+
tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
|
|
369
120
|
|
|
370
121
|
billing_cycles?:number;
|
|
371
122
|
|
|
372
|
-
/**
|
|
373
|
-
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
374
|
-
|
|
375
|
-
*/
|
|
376
|
-
|
|
377
123
|
mandatory_items_to_remove?:string[];
|
|
378
124
|
|
|
379
|
-
/**
|
|
380
|
-
* @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
|
|
381
|
-
|
|
382
|
-
*/
|
|
383
|
-
|
|
384
125
|
terms_to_charge?:number;
|
|
385
126
|
|
|
386
|
-
/**
|
|
387
|
-
* @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.
|
|
388
|
-
|
|
389
|
-
*/
|
|
390
|
-
|
|
391
127
|
billing_alignment_mode?:BillingAlignmentMode;
|
|
392
128
|
|
|
393
|
-
/**
|
|
394
|
-
* @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
|
|
395
|
-
|
|
396
|
-
*/
|
|
397
|
-
|
|
398
129
|
coupon_ids?:string[];
|
|
399
130
|
|
|
400
|
-
/**
|
|
401
|
-
* @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).
|
|
402
|
-
**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. .
|
|
403
|
-
|
|
404
|
-
*/
|
|
405
|
-
|
|
406
131
|
invoice_immediately?:boolean;
|
|
407
132
|
|
|
408
|
-
/**
|
|
409
|
-
* @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of this date. The date should not be 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.
|
|
410
|
-
|
|
411
|
-
*/
|
|
412
|
-
|
|
413
133
|
invoice_date?:number;
|
|
414
134
|
|
|
415
|
-
/**
|
|
416
|
-
* @description Indicates the Client profile id for the customer. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
417
|
-
|
|
418
|
-
*/
|
|
419
|
-
|
|
420
135
|
client_profile_id?:string;
|
|
136
|
+
}
|
|
137
|
+
export interface CreateSubForCustomerEstimateResponse {
|
|
138
|
+
estimate:Estimate;
|
|
139
|
+
}
|
|
140
|
+
export interface CreateSubForCustomerEstimateInputParam {
|
|
141
|
+
|
|
142
|
+
subscription?:null.null;
|
|
421
143
|
|
|
422
|
-
|
|
423
|
-
* @description Parameters for subscription
|
|
424
|
-
|
|
425
|
-
*/
|
|
144
|
+
shipping_address?:null.null;
|
|
426
145
|
|
|
427
|
-
|
|
146
|
+
contract_term?:null.null;
|
|
428
147
|
|
|
429
|
-
|
|
430
|
-
* @description Parameters for billing_address
|
|
431
|
-
|
|
432
|
-
*/
|
|
148
|
+
addons?:{billing_cycles?:number,id?:string,quantity?:number,quantity_in_decimal?:string,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
433
149
|
|
|
434
|
-
|
|
150
|
+
event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
435
151
|
|
|
436
|
-
|
|
437
|
-
* @description Parameters for shipping_address
|
|
438
|
-
|
|
439
|
-
*/
|
|
152
|
+
use_existing_balances?:boolean;
|
|
440
153
|
|
|
441
|
-
|
|
154
|
+
invoice_immediately?:boolean;
|
|
442
155
|
|
|
443
|
-
|
|
444
|
-
* @description Parameters for customer
|
|
445
|
-
|
|
446
|
-
*/
|
|
156
|
+
billing_cycles?:number;
|
|
447
157
|
|
|
448
|
-
|
|
158
|
+
mandatory_addons_to_remove?:string[];
|
|
449
159
|
|
|
450
|
-
|
|
451
|
-
* @description Parameters for contract_term
|
|
452
|
-
|
|
453
|
-
*/
|
|
160
|
+
terms_to_charge?:number;
|
|
454
161
|
|
|
455
|
-
|
|
162
|
+
next_renewal_date?:number;
|
|
456
163
|
|
|
457
|
-
|
|
458
|
-
* @description Parameters for subscription_items
|
|
459
|
-
|
|
460
|
-
*/
|
|
164
|
+
charge_model?:'full_charge' | 'prorate';
|
|
461
165
|
|
|
462
|
-
|
|
166
|
+
billing_alignment_mode?:'immediate' | 'delayed';
|
|
463
167
|
|
|
464
|
-
|
|
465
|
-
* @description Parameters for discounts
|
|
466
|
-
|
|
467
|
-
*/
|
|
168
|
+
referral_details?:string;
|
|
468
169
|
|
|
469
|
-
|
|
170
|
+
invoice_date?:number;
|
|
470
171
|
|
|
471
|
-
|
|
472
|
-
* @description Parameters for item_tiers
|
|
473
|
-
|
|
474
|
-
*/
|
|
172
|
+
coupon_ids?:string[];
|
|
475
173
|
|
|
476
|
-
|
|
174
|
+
allow_gift_plan?:boolean;
|
|
477
175
|
}
|
|
478
|
-
export interface
|
|
176
|
+
export interface CreateSubItemForCustomerEstimateResponse {
|
|
479
177
|
estimate:Estimate;
|
|
480
178
|
}
|
|
481
|
-
export interface
|
|
179
|
+
export interface CreateSubItemForCustomerEstimateInputParam {
|
|
180
|
+
|
|
181
|
+
subscription?:null.null;
|
|
182
|
+
|
|
183
|
+
shipping_address?:null.null;
|
|
184
|
+
|
|
185
|
+
billing_address?:null.null;
|
|
186
|
+
|
|
187
|
+
contract_term?:null.null;
|
|
188
|
+
|
|
189
|
+
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,item_type?:ItemType,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
190
|
+
|
|
191
|
+
discounts:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
|
|
192
|
+
|
|
193
|
+
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}[];
|
|
482
194
|
|
|
483
|
-
/**
|
|
484
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
485
|
-
|
|
486
|
-
*/
|
|
487
|
-
|
|
488
195
|
use_existing_balances?:boolean;
|
|
489
196
|
|
|
490
|
-
/**
|
|
491
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
492
|
-
|
|
493
|
-
*/
|
|
494
|
-
|
|
495
197
|
invoice_immediately?:boolean;
|
|
496
198
|
|
|
497
|
-
/**
|
|
498
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
499
|
-
|
|
500
|
-
*/
|
|
501
|
-
|
|
502
199
|
billing_cycles?:number;
|
|
503
200
|
|
|
504
|
-
|
|
505
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
506
|
-
|
|
507
|
-
*/
|
|
508
|
-
|
|
509
|
-
mandatory_addons_to_remove?:string[];
|
|
201
|
+
mandatory_items_to_remove?:string[];
|
|
510
202
|
|
|
511
|
-
/**
|
|
512
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
513
|
-
|
|
514
|
-
*/
|
|
515
|
-
|
|
516
203
|
terms_to_charge?:number;
|
|
517
204
|
|
|
518
|
-
|
|
519
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
520
|
-
|
|
521
|
-
*/
|
|
522
|
-
|
|
523
|
-
billing_alignment_mode?:'immediate' | 'delayed';
|
|
205
|
+
billing_alignment_mode?:BillingAlignmentMode;
|
|
524
206
|
|
|
525
|
-
/**
|
|
526
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
527
|
-
|
|
528
|
-
*/
|
|
529
|
-
|
|
530
207
|
invoice_date?:number;
|
|
531
208
|
|
|
532
|
-
/**
|
|
533
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
534
|
-
|
|
535
|
-
*/
|
|
536
|
-
|
|
537
209
|
coupon_ids?:string[];
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
541
|
-
|
|
542
|
-
*/
|
|
543
|
-
|
|
544
|
-
subscription?:{contract_term_billing_cycle_on_renewal?:number,free_period?:number,free_period_unit?:FreePeriodUnit,id?:string,offline_payment_method?:OfflinePaymentMethod,plan_id:string,plan_quantity?:number,plan_quantity_in_decimal?:string,plan_unit_price?:number,plan_unit_price_in_decimal?:string,setup_fee?:number,start_date?:number,trial_end?:number,trial_end_action?:TrialEndAction};
|
|
545
|
-
|
|
546
|
-
/**
|
|
547
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
548
|
-
|
|
549
|
-
*/
|
|
550
|
-
|
|
551
|
-
shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
555
|
-
|
|
556
|
-
*/
|
|
557
|
-
|
|
558
|
-
contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
562
|
-
|
|
563
|
-
*/
|
|
564
|
-
|
|
565
|
-
addons?:{billing_cycles?:number,id?:string,quantity?:number,quantity_in_decimal?:string,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* @description Create a subscription for the existing estimate of a customer.
|
|
569
|
-
|
|
570
|
-
*/
|
|
571
|
-
|
|
572
|
-
event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
573
210
|
}
|
|
574
|
-
export interface
|
|
211
|
+
export interface UpdateSubscriptionResponse {
|
|
575
212
|
estimate:Estimate;
|
|
576
213
|
}
|
|
577
|
-
export interface
|
|
214
|
+
export interface UpdateSubscriptionInputParam {
|
|
578
215
|
|
|
579
|
-
|
|
580
|
-
* @description The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
|
|
581
|
-
|
|
582
|
-
*/
|
|
216
|
+
subscription:null.null;
|
|
583
217
|
|
|
584
|
-
|
|
218
|
+
billing_address?:null.null;
|
|
585
219
|
|
|
586
|
-
|
|
587
|
-
* @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).
|
|
588
|
-
**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. .
|
|
589
|
-
|
|
590
|
-
*/
|
|
220
|
+
shipping_address?:null.null;
|
|
591
221
|
|
|
592
|
-
|
|
222
|
+
customer?:null.null;
|
|
593
223
|
|
|
594
|
-
|
|
595
|
-
* @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.
|
|
596
|
-
|
|
597
|
-
*/
|
|
224
|
+
addons?:{billing_cycles?:number,id?:string,proration_type?:ProrationType,quantity?:number,quantity_in_decimal?:string,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
598
225
|
|
|
599
|
-
|
|
226
|
+
changes_scheduled_at?:number;
|
|
600
227
|
|
|
601
|
-
|
|
602
|
-
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
603
|
-
|
|
604
|
-
*/
|
|
228
|
+
change_option?:ChangeOption;
|
|
605
229
|
|
|
606
|
-
|
|
230
|
+
event_based_addons?:{charge_on?:ChargeOn,charge_once?:boolean,id?:string,on_event?:OnEvent,quantity?:number,quantity_in_decimal?:string,service_period_in_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
607
231
|
|
|
608
|
-
|
|
609
|
-
* @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
|
|
610
|
-
|
|
611
|
-
*/
|
|
232
|
+
replace_addon_list?:boolean;
|
|
612
233
|
|
|
613
|
-
|
|
234
|
+
mandatory_addons_to_remove?:string[];
|
|
614
235
|
|
|
615
|
-
|
|
616
|
-
* @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. \* 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..
|
|
617
|
-
|
|
618
|
-
*/
|
|
236
|
+
invoice_date?:number;
|
|
619
237
|
|
|
620
|
-
|
|
238
|
+
billing_cycles?:number;
|
|
621
239
|
|
|
622
|
-
|
|
623
|
-
* @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of this date. The date should not be 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.
|
|
624
|
-
|
|
625
|
-
*/
|
|
240
|
+
terms_to_charge?:number;
|
|
626
241
|
|
|
627
|
-
|
|
242
|
+
reactivate_from?:number;
|
|
628
243
|
|
|
629
|
-
|
|
630
|
-
* @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
|
|
631
|
-
|
|
632
|
-
*/
|
|
244
|
+
billing_alignment_mode?:BillingAlignmentMode;
|
|
633
245
|
|
|
634
246
|
coupon_ids?:string[];
|
|
635
247
|
|
|
636
|
-
|
|
637
|
-
* @description Parameters for subscription
|
|
638
|
-
|
|
639
|
-
*/
|
|
248
|
+
replace_coupon_list?:boolean;
|
|
640
249
|
|
|
641
|
-
|
|
250
|
+
prorate?:boolean;
|
|
642
251
|
|
|
643
|
-
|
|
644
|
-
* @description Parameters for shipping_address
|
|
645
|
-
|
|
646
|
-
*/
|
|
252
|
+
end_of_term?:boolean;
|
|
647
253
|
|
|
648
|
-
|
|
254
|
+
force_term_reset?:boolean;
|
|
649
255
|
|
|
650
|
-
|
|
651
|
-
* @description Generates an estimate without creating a subscription. This endpoint can be called when you want to preview details of a new subscription before actually creating one.
|
|
652
|
-
**See also**
|
|
653
|
-
|
|
654
|
-
* [Estimate a purchase](https://apidocs.chargebee.com/docs/api/purchases#estimates_for_purchase): an operation that estimates a `purchase` representing multiple subscriptions bought together by a customer.
|
|
655
|
-
|
|
656
|
-
*/
|
|
256
|
+
reactivate?:boolean;
|
|
657
257
|
|
|
658
|
-
|
|
258
|
+
include_delayed_charges?:boolean;
|
|
659
259
|
|
|
660
|
-
|
|
661
|
-
* @description Parameters for contract_term
|
|
662
|
-
|
|
663
|
-
*/
|
|
260
|
+
use_existing_balances?:boolean;
|
|
664
261
|
|
|
665
|
-
|
|
262
|
+
invoice_immediately?:boolean;
|
|
263
|
+
}
|
|
264
|
+
export interface UpdateSubscriptionForItemsResponse {
|
|
265
|
+
estimate:Estimate;
|
|
266
|
+
}
|
|
267
|
+
export interface UpdateSubscriptionForItemsInputParam {
|
|
666
268
|
|
|
667
|
-
|
|
668
|
-
* @description Parameters for subscription_items
|
|
669
|
-
|
|
670
|
-
*/
|
|
269
|
+
subscription:null.null;
|
|
671
270
|
|
|
672
|
-
|
|
271
|
+
billing_address?:null.null;
|
|
673
272
|
|
|
674
|
-
|
|
675
|
-
* @description Parameters for discounts
|
|
676
|
-
|
|
677
|
-
*/
|
|
273
|
+
shipping_address?:null.null;
|
|
678
274
|
|
|
679
|
-
|
|
275
|
+
customer?:null.null;
|
|
680
276
|
|
|
681
|
-
|
|
682
|
-
* @description Parameters for item_tiers
|
|
683
|
-
|
|
684
|
-
*/
|
|
277
|
+
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,item_type?:ItemType,proration_type?:ProrationType,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
685
278
|
|
|
686
|
-
|
|
687
|
-
}
|
|
688
|
-
export interface UpdateSubscriptionForItemsResponse {
|
|
689
|
-
estimate:Estimate;
|
|
690
|
-
}
|
|
691
|
-
export interface UpdateSubscriptionForItemsInputParam {
|
|
279
|
+
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}[];
|
|
692
280
|
|
|
693
|
-
|
|
694
|
-
* @description Returns an estimate for updating a subscription.
|
|
695
|
-
|
|
696
|
-
In the response,
|
|
697
|
-
|
|
698
|
-
* [subscription_estimate](/docs/api/estimates#subscription_estimate_attributes): The details of the changed subscription such as `status`, next billing date, and so on.
|
|
699
|
-
* [invoice_estimate](/docs/api/estimates#invoice_estimate_attributes):The details of the immediate invoice, if it is generated. An immediate invoice is not generated when:
|
|
700
|
-
* `end_of_term` parameter is true
|
|
701
|
-
* `prorate` parameter is `false`
|
|
702
|
-
* No changes are made to the plan item prices or addon item prices in `subscription_items`.
|
|
703
|
-
* For changes such as [quantity downgrades](https://www.chargebee.com/docs/proration.html#proration-mechanism_plan-quantity-downgrade-paid-invoice).
|
|
704
|
-
* [next_invoice_estimate](/docs/api/estimates#next_invoice_estimate_attributes):The details of the invoice to be generated later (if any) on the occasion that no immediate invoice has been generated.
|
|
705
|
-
* [credit_note_estimates](/docs/api/estimates#credit_note_estimate_attributes):The list of credit notes (if any) generated during this operation.
|
|
706
|
-
* [unbilled_charge_estimates](/docs/api/estimates#unbilled_charge_estimate_attributes): The details of charges that have not been invoiced. This is returned only if the `invoice_immediately` parameter is set to `false`.
|
|
707
|
-
|
|
708
|
-
*/
|
|
281
|
+
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}[];
|
|
709
282
|
|
|
710
283
|
changes_scheduled_at?:number;
|
|
711
284
|
|
|
712
|
-
/**
|
|
713
|
-
* @description null
|
|
714
|
-
|
|
715
|
-
*/
|
|
716
|
-
|
|
717
285
|
change_option?:ChangeOption;
|
|
718
286
|
|
|
719
|
-
/**
|
|
720
|
-
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
721
|
-
|
|
722
|
-
*/
|
|
723
|
-
|
|
724
287
|
mandatory_items_to_remove?:string[];
|
|
725
288
|
|
|
726
|
-
/**
|
|
727
|
-
* @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.
|
|
728
|
-
|
|
729
|
-
*/
|
|
730
|
-
|
|
731
289
|
replace_items_list?:boolean;
|
|
732
290
|
|
|
733
|
-
/**
|
|
734
|
-
* @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:
|
|
735
|
-
|
|
736
|
-
* `invoice_date` must be in the past.
|
|
737
|
-
* `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.
|
|
738
|
-
* It is not earlier than `changes_scheduled_at`, `reactivate_from`, or `trial_end`.
|
|
739
|
-
* `invoice_immediately` is `true`.
|
|
740
|
-
.
|
|
741
|
-
|
|
742
|
-
*/
|
|
743
|
-
|
|
744
291
|
invoice_date?:number;
|
|
745
292
|
|
|
746
|
-
/**
|
|
747
|
-
* @description Billing cycles set for plan-item price is used by default.
|
|
748
|
-
|
|
749
|
-
*/
|
|
750
|
-
|
|
751
293
|
billing_cycles?:number;
|
|
752
294
|
|
|
753
|
-
/**
|
|
754
|
-
* @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.
|
|
755
|
-
|
|
756
|
-
*/
|
|
757
|
-
|
|
758
295
|
terms_to_charge?:number;
|
|
759
296
|
|
|
760
|
-
/**
|
|
761
|
-
* @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.
|
|
762
|
-
**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:
|
|
763
|
-
|
|
764
|
-
* Backdating must be enabled for subscription reactivation operations.
|
|
765
|
-
* 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.
|
|
766
|
-
* The date is on or after the last date/time any of the product catalog items of the subscription were changed.
|
|
767
|
-
* 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.
|
|
768
|
-
.
|
|
769
|
-
|
|
770
|
-
*/
|
|
771
|
-
|
|
772
297
|
reactivate_from?:number;
|
|
773
298
|
|
|
774
|
-
/**
|
|
775
|
-
* @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.
|
|
776
|
-
|
|
777
|
-
*/
|
|
778
|
-
|
|
779
299
|
billing_alignment_mode?:BillingAlignmentMode;
|
|
780
300
|
|
|
781
|
-
/**
|
|
782
|
-
* @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).
|
|
783
|
-
|
|
784
|
-
*/
|
|
785
|
-
|
|
786
301
|
coupon_ids?:string[];
|
|
787
302
|
|
|
788
|
-
/**
|
|
789
|
-
* @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`.
|
|
790
|
-
|
|
791
|
-
*/
|
|
792
|
-
|
|
793
303
|
replace_coupon_list?:boolean;
|
|
794
304
|
|
|
795
|
-
/**
|
|
796
|
-
* @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.
|
|
797
|
-
* When `false`: The subscription is changed without creating any credits or charges.
|
|
798
|
-
* 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.
|
|
799
|
-
|
|
800
|
-
**Caveat**
|
|
801
|
-
|
|
802
|
-
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:
|
|
803
|
-
|
|
804
|
-
An immediate previous change was made
|
|
805
|
-
|
|
806
|
-
* with `prorate` set to `false` and
|
|
807
|
-
* no changes were made to the subscription's billing term and
|
|
808
|
-
* a change was made to either the subscription's items or their prices.
|
|
809
|
-
|
|
810
|
-
*/
|
|
811
|
-
|
|
812
305
|
prorate?:boolean;
|
|
813
306
|
|
|
814
|
-
/**
|
|
815
|
-
* @description Set this to true if you want the update to be applied at the end of the current subscription billing cycle.
|
|
816
|
-
|
|
817
|
-
*/
|
|
818
|
-
|
|
819
307
|
end_of_term?:boolean;
|
|
820
308
|
|
|
821
|
-
/**
|
|
822
|
-
* @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).
|
|
823
|
-
**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.
|
|
824
|
-
|
|
825
|
-
*/
|
|
826
|
-
|
|
827
309
|
force_term_reset?:boolean;
|
|
828
310
|
|
|
829
|
-
/**
|
|
830
|
-
* @description Applicable only for `cancelled` subscriptions. When passed as `true`, the canceled subscription is activated; otherwise subscription changes are made without changing its `status`. If not passed, subscription will be activated only if `subscription_items` is passed.
|
|
831
|
-
|
|
832
|
-
*/
|
|
833
|
-
|
|
834
311
|
reactivate?:boolean;
|
|
835
312
|
|
|
836
|
-
/**
|
|
837
|
-
* @description If true, all the unbilled charges will be included for the invoice estimate.
|
|
838
|
-
|
|
839
|
-
*/
|
|
840
|
-
|
|
841
313
|
include_delayed_charges?:boolean;
|
|
842
314
|
|
|
843
|
-
/**
|
|
844
|
-
* @description The generated invoice_estimate/next_invoice_estimate will include all the balances - Promotional Credits, Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
|
|
845
|
-
|
|
846
|
-
*/
|
|
847
|
-
|
|
848
315
|
use_existing_balances?:boolean;
|
|
849
316
|
|
|
850
|
-
/**
|
|
851
|
-
* @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).
|
|
852
|
-
**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. .
|
|
853
|
-
|
|
854
|
-
*/
|
|
855
|
-
|
|
856
317
|
invoice_immediately?:boolean;
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* @description Parameters for subscription
|
|
860
|
-
|
|
861
|
-
*/
|
|
862
|
-
|
|
863
|
-
subscription:{auto_collection?:AutoCollection,free_period?:number,free_period_unit?:FreePeriodUnit,id:string,offline_payment_method?:OfflinePaymentMethod,start_date?:number,trial_end?:number,trial_end_action?:TrialEndAction};
|
|
864
|
-
|
|
865
|
-
/**
|
|
866
|
-
* @description Parameters for billing_address
|
|
867
|
-
|
|
868
|
-
*/
|
|
869
|
-
|
|
870
|
-
billing_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
871
|
-
|
|
872
|
-
/**
|
|
873
|
-
* @description Parameters for shipping_address
|
|
874
|
-
|
|
875
|
-
*/
|
|
876
|
-
|
|
877
|
-
shipping_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* @description Parameters for customer
|
|
881
|
-
|
|
882
|
-
*/
|
|
883
|
-
|
|
884
|
-
customer?:{registered_for_gst?:boolean,vat_number?:string,vat_number_prefix?:string};
|
|
885
|
-
|
|
886
|
-
/**
|
|
887
|
-
* @description Parameters for subscription_items
|
|
888
|
-
|
|
889
|
-
*/
|
|
890
|
-
|
|
891
|
-
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,proration_type?:ProrationType,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
892
|
-
|
|
893
|
-
/**
|
|
894
|
-
* @description Parameters for discounts
|
|
895
|
-
|
|
896
|
-
*/
|
|
897
|
-
|
|
898
|
-
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}[];
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* @description Parameters for item_tiers
|
|
902
|
-
|
|
903
|
-
*/
|
|
904
|
-
|
|
905
|
-
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}[];
|
|
906
318
|
}
|
|
907
319
|
export interface RenewalEstimateResponse {
|
|
908
320
|
estimate:Estimate;
|
|
909
321
|
}
|
|
910
322
|
export interface RenewalEstimateInputParam {
|
|
911
323
|
|
|
912
|
-
/**
|
|
913
|
-
* @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
|
|
914
|
-
|
|
915
|
-
In the response,
|
|
916
|
-
|
|
917
|
-
* **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
|
|
918
|
-
* **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
|
|
919
|
-
|
|
920
|
-
The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
|
|
921
|
-
|
|
922
|
-
To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify 'false' for the parameter *include_delayed_charges*.
|
|
923
|
-
|
|
924
|
-
**Note:**
|
|
925
|
-
|
|
926
|
-
* This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
|
|
927
|
-
* For 'Non Renewing' subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
|
|
928
|
-
* This API is not supported for 'Cancelled' subscriptions.
|
|
929
|
-
* Only the subscription's charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
|
|
930
|
-
|
|
931
|
-
*/
|
|
932
|
-
|
|
933
324
|
include_delayed_charges?:boolean;
|
|
934
325
|
|
|
935
|
-
/**
|
|
936
|
-
* @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
|
|
937
|
-
|
|
938
|
-
In the response,
|
|
939
|
-
|
|
940
|
-
* **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
|
|
941
|
-
* **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
|
|
942
|
-
|
|
943
|
-
The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
|
|
944
|
-
|
|
945
|
-
To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify 'false' for the parameter *include_delayed_charges*.
|
|
946
|
-
|
|
947
|
-
**Note:**
|
|
948
|
-
|
|
949
|
-
* This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
|
|
950
|
-
* For 'Non Renewing' subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
|
|
951
|
-
* This API is not supported for 'Cancelled' subscriptions.
|
|
952
|
-
* Only the subscription's charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
|
|
953
|
-
|
|
954
|
-
*/
|
|
955
|
-
|
|
956
326
|
use_existing_balances?:boolean;
|
|
957
327
|
|
|
958
|
-
/**
|
|
959
|
-
* @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
|
|
960
|
-
|
|
961
|
-
In the response,
|
|
962
|
-
|
|
963
|
-
* **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
|
|
964
|
-
* **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
|
|
965
|
-
|
|
966
|
-
The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
|
|
967
|
-
|
|
968
|
-
To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify 'false' for the parameter *include_delayed_charges*.
|
|
969
|
-
|
|
970
|
-
**Note:**
|
|
971
|
-
|
|
972
|
-
* This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
|
|
973
|
-
* For 'Non Renewing' subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
|
|
974
|
-
* This API is not supported for 'Cancelled' subscriptions.
|
|
975
|
-
* Only the subscription's charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
|
|
976
|
-
|
|
977
|
-
*/
|
|
978
|
-
|
|
979
328
|
ignore_scheduled_cancellation?:boolean;
|
|
980
329
|
|
|
981
|
-
/**
|
|
982
|
-
* @description This returns an estimate of the amount that will be charged when the subscription is billed next. The estimate is calculated based on the current recurring items of the subscription - plan, addons, and coupons.
|
|
983
|
-
|
|
984
|
-
In the response,
|
|
985
|
-
|
|
986
|
-
* **estimate.subscription_estimate** has the current subscription details like its status, next billing date, and so on.
|
|
987
|
-
* **estimate.invoice_estimate** has details of the invoice that will be generated at the next billing date.
|
|
988
|
-
|
|
989
|
-
The generated invoice estimate will include all the balances - [Promotional Credits](https://www.chargebee.com/docs/promotional-credits.html), Refundable Credits, and Excess Payments - if any. If you don't want these balances to be included you can specify 'false' for the parameter *use_existing_balances*.
|
|
990
|
-
|
|
991
|
-
To exclude the [delayed charges](https://www.chargebee.com/docs/charges.html) from the invoice estimate, specify 'false' for the parameter *include_delayed_charges*.
|
|
992
|
-
|
|
993
|
-
**Note:**
|
|
994
|
-
|
|
995
|
-
* This API will not generate a renewal invoice if an [advance invoice](https://www.chargebee.com/docs/advance-invoices.html) is already present for the subscription.
|
|
996
|
-
* For 'Non Renewing' subscriptions, only the [delayed charges](https://www.chargebee.com/docs/charges.html) will be included in the invoice estimate.
|
|
997
|
-
* This API is not supported for 'Cancelled' subscriptions.
|
|
998
|
-
* Only the subscription's charges will be included. If you have enabled the Consolidated invoicing feature, use the *Upcoming Invoices* estimate available for the Customer object to get the actual estimate invoice for the customer.
|
|
999
|
-
|
|
1000
|
-
*/
|
|
1001
|
-
|
|
1002
330
|
ignore_scheduled_changes?:boolean;
|
|
1003
331
|
}
|
|
1004
332
|
export interface AdvanceInvoiceEstimateResponse {
|
|
@@ -1006,74 +334,27 @@ In the response,
|
|
|
1006
334
|
}
|
|
1007
335
|
export interface AdvanceInvoiceEstimateInputParam {
|
|
1008
336
|
|
|
1009
|
-
|
|
1010
|
-
* @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`.
|
|
1011
|
-
* 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.
|
|
1012
|
-
.
|
|
1013
|
-
|
|
1014
|
-
*/
|
|
337
|
+
fixed_interval_schedule?:null.null;
|
|
1015
338
|
|
|
1016
|
-
terms_to_charge?:number;
|
|
339
|
+
specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
|
|
1017
340
|
|
|
1018
|
-
|
|
1019
|
-
* @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`.
|
|
1020
|
-
|
|
1021
|
-
*/
|
|
341
|
+
terms_to_charge?:number;
|
|
1022
342
|
|
|
1023
343
|
invoice_immediately?:boolean;
|
|
1024
344
|
|
|
1025
|
-
/**
|
|
1026
|
-
* @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).
|
|
1027
|
-
|
|
1028
|
-
*/
|
|
1029
|
-
|
|
1030
345
|
schedule_type?:ScheduleType;
|
|
1031
|
-
|
|
1032
|
-
/**
|
|
1033
|
-
* @description Parameters for fixed_interval_schedule
|
|
1034
|
-
|
|
1035
|
-
*/
|
|
1036
|
-
|
|
1037
|
-
fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* @description Parameters for specific_dates_schedule
|
|
1041
|
-
|
|
1042
|
-
*/
|
|
1043
|
-
|
|
1044
|
-
specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
|
|
1045
346
|
}
|
|
1046
347
|
export interface RegenerateInvoiceEstimateResponse {
|
|
1047
348
|
estimate:Estimate;
|
|
1048
349
|
}
|
|
1049
350
|
export interface RegenerateInvoiceEstimateInputParam {
|
|
1050
351
|
|
|
1051
|
-
/**
|
|
1052
|
-
* @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 ).
|
|
1053
|
-
|
|
1054
|
-
*/
|
|
1055
|
-
|
|
1056
352
|
date_from?:number;
|
|
1057
353
|
|
|
1058
|
-
/**
|
|
1059
|
-
* @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 ).
|
|
1060
|
-
|
|
1061
|
-
*/
|
|
1062
|
-
|
|
1063
354
|
date_to?:number;
|
|
1064
355
|
|
|
1065
|
-
/**
|
|
1066
|
-
* @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`.
|
|
1067
|
-
|
|
1068
|
-
*/
|
|
1069
|
-
|
|
1070
356
|
prorate?:boolean;
|
|
1071
357
|
|
|
1072
|
-
/**
|
|
1073
|
-
* @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.
|
|
1074
|
-
|
|
1075
|
-
*/
|
|
1076
|
-
|
|
1077
358
|
invoice_immediately?:boolean;
|
|
1078
359
|
}
|
|
1079
360
|
export interface UpcomingInvoicesEstimateResponse {
|
|
@@ -1085,26 +366,10 @@ In the response,
|
|
|
1085
366
|
}
|
|
1086
367
|
export interface ChangeTermEndInputParam {
|
|
1087
368
|
|
|
1088
|
-
/**
|
|
1089
|
-
* @description The time at which the current term should end for this subscription.
|
|
1090
|
-
|
|
1091
|
-
*/
|
|
1092
|
-
|
|
1093
369
|
term_ends_at:number;
|
|
1094
370
|
|
|
1095
|
-
/**
|
|
1096
|
-
* @description Applicable for *active* / *non_renewing* subscriptions. If specified as *true* prorated charges / credits will be added during this operation.
|
|
1097
|
-
|
|
1098
|
-
*/
|
|
1099
|
-
|
|
1100
371
|
prorate?:boolean;
|
|
1101
372
|
|
|
1102
|
-
/**
|
|
1103
|
-
* @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).
|
|
1104
|
-
**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. .
|
|
1105
|
-
|
|
1106
|
-
*/
|
|
1107
|
-
|
|
1108
373
|
invoice_immediately?:boolean;
|
|
1109
374
|
}
|
|
1110
375
|
export interface CancelSubscriptionResponse {
|
|
@@ -1112,423 +377,186 @@ In the response,
|
|
|
1112
377
|
}
|
|
1113
378
|
export interface CancelSubscriptionInputParam {
|
|
1114
379
|
|
|
1115
|
-
/**
|
|
1116
|
-
* @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`.
|
|
1117
|
-
|
|
1118
|
-
*/
|
|
1119
|
-
|
|
1120
380
|
end_of_term?:boolean;
|
|
1121
381
|
|
|
1122
|
-
/**
|
|
1123
|
-
* @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:
|
|
1124
|
-
|
|
1125
|
-
* Backdating must be enabled for subscription cancellation.
|
|
1126
|
-
* 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.
|
|
1127
|
-
* The date is on or after `current_term_start`.
|
|
1128
|
-
* The date is on or after the last date/time any of the following changes were made:
|
|
1129
|
-
* Changes in the recurring items or their prices.
|
|
1130
|
-
* Addition of non-recurring items.
|
|
1131
|
-
* 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.
|
|
1132
|
-
.
|
|
1133
|
-
|
|
1134
|
-
*/
|
|
1135
|
-
|
|
1136
382
|
cancel_at?:number;
|
|
1137
383
|
|
|
1138
|
-
/**
|
|
1139
|
-
* @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.
|
|
1140
|
-
|
|
1141
|
-
*/
|
|
1142
|
-
|
|
1143
384
|
credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
|
|
1144
385
|
|
|
1145
|
-
/**
|
|
1146
|
-
* @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.
|
|
1147
|
-
|
|
1148
|
-
*/
|
|
1149
|
-
|
|
1150
386
|
unbilled_charges_option?:UnbilledChargesOption;
|
|
1151
387
|
|
|
1152
|
-
/**
|
|
1153
|
-
* @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'.
|
|
1154
|
-
|
|
1155
|
-
*/
|
|
1156
|
-
|
|
1157
388
|
account_receivables_handling?:AccountReceivablesHandling;
|
|
1158
389
|
|
|
1159
|
-
/**
|
|
1160
|
-
* @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.
|
|
1161
|
-
|
|
1162
|
-
*/
|
|
1163
|
-
|
|
1164
390
|
refundable_credits_handling?:RefundableCreditsHandling;
|
|
1165
391
|
|
|
1166
|
-
/**
|
|
1167
|
-
* @description Cancels the current contract term.
|
|
1168
|
-
|
|
1169
|
-
* `terminate_immediately` immediately does the following:
|
|
1170
|
-
* sets the contract term [`status`](contract_terms#contract_term_status) to `terminated`.
|
|
1171
|
-
* Cancels the subscription.
|
|
1172
|
-
* Collects any [termination fee](contract_terms#termintation_fee).
|
|
1173
|
-
* `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.
|
|
1174
|
-
. \* terminate_immediately - Terminate immediately \* end_of_contract_term - End of contract term
|
|
1175
|
-
|
|
1176
|
-
*/
|
|
1177
|
-
|
|
1178
392
|
contract_term_cancel_option?:ContractTermCancelOption;
|
|
1179
393
|
|
|
1180
|
-
/**
|
|
1181
|
-
* @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:
|
|
1182
|
-
|
|
1183
|
-
* `invoice_date` must be in the past.
|
|
1184
|
-
* `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.
|
|
1185
|
-
* It is not earlier than `cancel_at`.
|
|
1186
|
-
.
|
|
1187
|
-
|
|
1188
|
-
*/
|
|
1189
|
-
|
|
1190
394
|
invoice_date?:number;
|
|
1191
395
|
|
|
1192
|
-
|
|
1193
|
-
* @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.
|
|
1194
|
-
|
|
1195
|
-
*/
|
|
396
|
+
event_based_addons?:{id?:string,quantity?:number,service_period_in_days?:number,unit_price?:number}[];
|
|
1196
397
|
|
|
1197
398
|
cancel_reason_code?:string;
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* @description Parameters for event_based_addons
|
|
1201
|
-
|
|
1202
|
-
*/
|
|
1203
|
-
|
|
1204
|
-
event_based_addons?:{id?:string,quantity?:number,service_period_in_days?:number,unit_price?:number}[];
|
|
1205
399
|
}
|
|
1206
400
|
export interface CancelSubscriptionForItemsResponse {
|
|
1207
401
|
estimate:Estimate;
|
|
1208
402
|
}
|
|
1209
403
|
export interface CancelSubscriptionForItemsInputParam {
|
|
1210
404
|
|
|
1211
|
-
/**
|
|
1212
|
-
* @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`.
|
|
1213
|
-
|
|
1214
|
-
*/
|
|
1215
|
-
|
|
1216
405
|
end_of_term?:boolean;
|
|
1217
406
|
|
|
1218
|
-
/**
|
|
1219
|
-
* @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:
|
|
1220
|
-
|
|
1221
|
-
* Backdating must be enabled for subscription cancellation.
|
|
1222
|
-
* 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.
|
|
1223
|
-
* The date is on or after `current_term_start`.
|
|
1224
|
-
* The date is on or after the last date/time any of the following changes were made:
|
|
1225
|
-
* Changes in the recurring items or their prices.
|
|
1226
|
-
* Addition of non-recurring items.
|
|
1227
|
-
* 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.
|
|
1228
|
-
.
|
|
1229
|
-
|
|
1230
|
-
*/
|
|
1231
|
-
|
|
1232
407
|
cancel_at?:number;
|
|
1233
408
|
|
|
1234
|
-
/**
|
|
1235
|
-
* @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.
|
|
1236
|
-
|
|
1237
|
-
*/
|
|
1238
|
-
|
|
1239
409
|
credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
|
|
1240
410
|
|
|
1241
|
-
/**
|
|
1242
|
-
* @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.
|
|
1243
|
-
|
|
1244
|
-
*/
|
|
1245
|
-
|
|
1246
411
|
unbilled_charges_option?:UnbilledChargesOption;
|
|
1247
412
|
|
|
1248
|
-
/**
|
|
1249
|
-
* @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'.
|
|
1250
|
-
|
|
1251
|
-
*/
|
|
1252
|
-
|
|
1253
413
|
account_receivables_handling?:AccountReceivablesHandling;
|
|
1254
414
|
|
|
1255
|
-
/**
|
|
1256
|
-
* @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.
|
|
1257
|
-
|
|
1258
|
-
*/
|
|
1259
|
-
|
|
1260
415
|
refundable_credits_handling?:RefundableCreditsHandling;
|
|
1261
416
|
|
|
1262
|
-
/**
|
|
1263
|
-
* @description Cancels the current contract term.
|
|
1264
|
-
|
|
1265
|
-
* `terminate_immediately` immediately does the following:
|
|
1266
|
-
* sets the contract term [`status`](contract_terms#contract_term_status) to `terminated`.
|
|
1267
|
-
* Cancels the subscription.
|
|
1268
|
-
* Collects any [termination fee](contract_terms#termintation_fee).
|
|
1269
|
-
* `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.
|
|
1270
|
-
. \* terminate_immediately - Terminate immediately \* end_of_contract_term - End of contract term
|
|
1271
|
-
|
|
1272
|
-
*/
|
|
1273
|
-
|
|
1274
417
|
contract_term_cancel_option?:ContractTermCancelOption;
|
|
1275
418
|
|
|
1276
|
-
/**
|
|
1277
|
-
* @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:
|
|
1278
|
-
|
|
1279
|
-
* `invoice_date` must be in the past.
|
|
1280
|
-
* `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.
|
|
1281
|
-
* It is not earlier than `cancel_at`.
|
|
1282
|
-
.
|
|
1283
|
-
|
|
1284
|
-
*/
|
|
1285
|
-
|
|
1286
419
|
invoice_date?:number;
|
|
1287
420
|
|
|
1288
|
-
|
|
1289
|
-
* @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.
|
|
1290
|
-
|
|
1291
|
-
*/
|
|
421
|
+
subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1292
422
|
|
|
1293
423
|
cancel_reason_code?:string;
|
|
1294
|
-
|
|
1295
|
-
/**
|
|
1296
|
-
* @description Parameters for subscription_items
|
|
1297
|
-
|
|
1298
|
-
*/
|
|
1299
|
-
|
|
1300
|
-
subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1301
424
|
}
|
|
1302
425
|
export interface PauseSubscriptionResponse {
|
|
1303
426
|
estimate:Estimate;
|
|
1304
427
|
}
|
|
1305
428
|
export interface PauseSubscriptionInputParam {
|
|
1306
429
|
|
|
1307
|
-
|
|
1308
|
-
* @description List of options to pause the subscription. \* billing_cycles -
|
|
1309
|
-
|
|
1310
|
-
Pause at the end of the current term, and resume automatically after the number of billing cycles you specify in [skip_billing_cycles](/docs/api/estimates?prod_cat_ver=2#pause_subscription_estimate_subscription_skip_billing_cycles)
|
|
1311
|
-
\* immediately - Pause immediately
|
|
1312
|
-
\* end_of_term - Pause at the end of current term
|
|
1313
|
-
\* specific_date - Pause on a specific date
|
|
1314
|
-
|
|
1315
|
-
*/
|
|
430
|
+
subscription?:null.null;
|
|
1316
431
|
|
|
1317
432
|
pause_option?:PauseOption;
|
|
1318
433
|
|
|
1319
|
-
/**
|
|
1320
|
-
* @description Applicable when unbilled charges are present for the subscription and [pause_option](/docs/api/estimates#pause_subscription_estimate_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`.
|
|
1321
|
-
\* invoice -
|
|
1322
|
-
|
|
1323
|
-
Invoice charges
|
|
1324
|
-
|
|
1325
|
-
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.
|
|
1326
|
-
\* no_action -
|
|
1327
|
-
|
|
1328
|
-
Retain as unbilled
|
|
1329
|
-
|
|
1330
|
-
If `no_action` is chosen, charges are added to the resumption invoice.
|
|
1331
|
-
|
|
1332
|
-
*/
|
|
1333
|
-
|
|
1334
434
|
unbilled_charges_handling?:UnbilledChargesHandling;
|
|
1335
|
-
|
|
1336
|
-
/**
|
|
1337
|
-
* @description Parameters for subscription
|
|
1338
|
-
|
|
1339
|
-
*/
|
|
1340
|
-
|
|
1341
|
-
subscription?:{pause_date?:number,resume_date?:number,skip_billing_cycles?:number};
|
|
1342
435
|
}
|
|
1343
436
|
export interface ResumeSubscriptionResponse {
|
|
1344
437
|
estimate:Estimate;
|
|
1345
438
|
}
|
|
1346
439
|
export interface ResumeSubscriptionInputParam {
|
|
1347
440
|
|
|
1348
|
-
|
|
1349
|
-
* @description List of options to resume the subscription. \* immediately - Resume immediately \* specific_date - Resume on a specific date
|
|
1350
|
-
|
|
1351
|
-
*/
|
|
441
|
+
subscription?:null.null;
|
|
1352
442
|
|
|
1353
443
|
resume_option?:ResumeOption;
|
|
1354
444
|
|
|
1355
|
-
/**
|
|
1356
|
-
* @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
|
|
1357
|
-
|
|
1358
|
-
*/
|
|
1359
|
-
|
|
1360
445
|
charges_handling?:ChargesHandling;
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* @description Parameters for subscription
|
|
1364
|
-
|
|
1365
|
-
*/
|
|
1366
|
-
|
|
1367
|
-
subscription?:{resume_date?:number};
|
|
1368
446
|
}
|
|
1369
|
-
export interface
|
|
447
|
+
export interface GiftSubscriptionResponse {
|
|
1370
448
|
estimate:Estimate;
|
|
1371
449
|
}
|
|
1372
|
-
export interface
|
|
450
|
+
export interface GiftSubscriptionInputParam {
|
|
1373
451
|
|
|
1374
|
-
|
|
1375
|
-
* @description List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
|
|
1376
|
-
|
|
1377
|
-
*/
|
|
452
|
+
gift?:null.null;
|
|
1378
453
|
|
|
1379
|
-
|
|
454
|
+
gifter:null.null;
|
|
1380
455
|
|
|
1381
|
-
|
|
1382
|
-
* @description Parameters for gift
|
|
1383
|
-
|
|
1384
|
-
*/
|
|
456
|
+
gift_receiver:null.null;
|
|
1385
457
|
|
|
1386
|
-
|
|
458
|
+
payment_intent?:null.null;
|
|
1387
459
|
|
|
1388
|
-
|
|
1389
|
-
* @description Parameters for gifter
|
|
1390
|
-
|
|
1391
|
-
*/
|
|
460
|
+
shipping_address?:null.null;
|
|
1392
461
|
|
|
1393
|
-
|
|
462
|
+
subscription:null.null;
|
|
1394
463
|
|
|
1395
|
-
|
|
1396
|
-
* @description Parameters for gift_receiver
|
|
1397
|
-
|
|
1398
|
-
*/
|
|
464
|
+
addons?:{id?:string,quantity?:number,quantity_in_decimal?:string}[];
|
|
1399
465
|
|
|
1400
|
-
|
|
466
|
+
coupon_ids?:string[];
|
|
467
|
+
}
|
|
468
|
+
export interface GiftSubscriptionForItemsResponse {
|
|
469
|
+
estimate:Estimate;
|
|
470
|
+
}
|
|
471
|
+
export interface GiftSubscriptionForItemsInputParam {
|
|
1401
472
|
|
|
1402
|
-
|
|
1403
|
-
* @description Parameters for payment_intent
|
|
1404
|
-
|
|
1405
|
-
*/
|
|
473
|
+
gift?:null.null;
|
|
1406
474
|
|
|
1407
|
-
|
|
475
|
+
gifter:null.null;
|
|
1408
476
|
|
|
1409
|
-
|
|
1410
|
-
* @description Parameters for shipping_address
|
|
1411
|
-
|
|
1412
|
-
*/
|
|
477
|
+
gift_receiver:null.null;
|
|
1413
478
|
|
|
1414
|
-
|
|
479
|
+
payment_intent?:null.null;
|
|
1415
480
|
|
|
1416
|
-
|
|
1417
|
-
* @description Parameters for subscription_items
|
|
1418
|
-
|
|
1419
|
-
*/
|
|
481
|
+
shipping_address?:null.null;
|
|
1420
482
|
|
|
1421
483
|
subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string}[];
|
|
484
|
+
|
|
485
|
+
coupon_ids?:string[];
|
|
1422
486
|
}
|
|
1423
|
-
export interface
|
|
487
|
+
export interface CreateInvoiceResponse {
|
|
1424
488
|
estimate:Estimate;
|
|
1425
489
|
}
|
|
1426
|
-
export interface
|
|
490
|
+
export interface CreateInvoiceInputParam {
|
|
1427
491
|
|
|
1428
|
-
|
|
1429
|
-
* @description The currency code (ISO 4217 format) of the invoice amount.
|
|
1430
|
-
|
|
1431
|
-
*/
|
|
492
|
+
invoice?:null.null;
|
|
1432
493
|
|
|
1433
|
-
|
|
494
|
+
shipping_address?:null.null;
|
|
1434
495
|
|
|
1435
|
-
|
|
1436
|
-
* @description A note for this particular invoice. This, and [all other notes](/docs/api/invoices#invoice_notes) for the invoice are displayed on the PDF invoice sent to the customer.
|
|
1437
|
-
|
|
1438
|
-
*/
|
|
496
|
+
addons?:{date_from?:number,date_to?:number,id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1439
497
|
|
|
1440
|
-
|
|
498
|
+
charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
|
|
499
|
+
|
|
500
|
+
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
501
|
+
|
|
502
|
+
tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
|
|
1441
503
|
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
*/
|
|
504
|
+
currency_code?:string;
|
|
505
|
+
|
|
506
|
+
invoice_note?:string;
|
|
1446
507
|
|
|
1447
508
|
remove_general_note?:boolean;
|
|
1448
509
|
|
|
1449
|
-
|
|
1450
|
-
* @description List of Coupons to be added.
|
|
1451
|
-
|
|
1452
|
-
*/
|
|
510
|
+
coupon?:string;
|
|
1453
511
|
|
|
1454
512
|
coupon_ids?:string[];
|
|
1455
513
|
|
|
1456
|
-
/**
|
|
1457
|
-
* @description Authorization transaction to be captured.
|
|
1458
|
-
|
|
1459
|
-
*/
|
|
1460
|
-
|
|
1461
514
|
authorization_transaction_id?:string;
|
|
1462
515
|
|
|
1463
|
-
/**
|
|
1464
|
-
* @description Payment source to be used for this payment.
|
|
1465
|
-
|
|
1466
|
-
*/
|
|
1467
|
-
|
|
1468
516
|
payment_source_id?:string;
|
|
1469
517
|
|
|
1470
|
-
/**
|
|
1471
|
-
* @description The customer level auto collection will be override if specified. \* on - Whenever an invoice is created, an automatic attempt will be made to charge. \* off - Whenever an invoice is created as payment due.
|
|
1472
|
-
|
|
1473
|
-
*/
|
|
1474
|
-
|
|
1475
518
|
auto_collection?:AutoCollection;
|
|
1476
519
|
|
|
1477
|
-
/**
|
|
1478
|
-
* @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of this date. The date should not be 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.
|
|
1479
|
-
|
|
1480
|
-
*/
|
|
1481
|
-
|
|
1482
520
|
invoice_date?:number;
|
|
521
|
+
}
|
|
522
|
+
export interface CreateInvoiceForItemsResponse {
|
|
523
|
+
estimate:Estimate;
|
|
524
|
+
}
|
|
525
|
+
export interface CreateInvoiceForItemsInputParam {
|
|
1483
526
|
|
|
1484
|
-
|
|
1485
|
-
* @description Parameters for invoice
|
|
1486
|
-
|
|
1487
|
-
*/
|
|
527
|
+
invoice?:null.null;
|
|
1488
528
|
|
|
1489
|
-
|
|
529
|
+
shipping_address?:null.null;
|
|
1490
530
|
|
|
1491
|
-
|
|
1492
|
-
* @description Parameters for shipping_address
|
|
1493
|
-
|
|
1494
|
-
*/
|
|
531
|
+
item_prices?:{date_from?:number,date_to?:number,item_price_id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1495
532
|
|
|
1496
|
-
|
|
533
|
+
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}[];
|
|
1497
534
|
|
|
1498
|
-
|
|
1499
|
-
* @description Parameters for item_prices
|
|
1500
|
-
|
|
1501
|
-
*/
|
|
535
|
+
charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
|
|
1502
536
|
|
|
1503
|
-
|
|
537
|
+
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
1504
538
|
|
|
1505
|
-
|
|
1506
|
-
* @description Parameters for item_tiers
|
|
1507
|
-
|
|
1508
|
-
*/
|
|
539
|
+
discounts:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
|
|
1509
540
|
|
|
1510
|
-
|
|
541
|
+
tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
|
|
1511
542
|
|
|
1512
|
-
|
|
1513
|
-
* @description Parameters for charges
|
|
1514
|
-
|
|
1515
|
-
*/
|
|
543
|
+
currency_code?:string;
|
|
1516
544
|
|
|
1517
|
-
|
|
545
|
+
invoice_note?:string;
|
|
546
|
+
|
|
547
|
+
remove_general_note?:boolean;
|
|
1518
548
|
|
|
1519
|
-
|
|
1520
|
-
* @description Parameters for notes_to_remove
|
|
1521
|
-
|
|
1522
|
-
*/
|
|
549
|
+
coupon?:string;
|
|
1523
550
|
|
|
1524
|
-
|
|
551
|
+
coupon_ids?:string[];
|
|
1525
552
|
|
|
1526
|
-
|
|
1527
|
-
* @description Parameters for discounts
|
|
1528
|
-
|
|
1529
|
-
*/
|
|
553
|
+
authorization_transaction_id?:string;
|
|
1530
554
|
|
|
1531
|
-
|
|
555
|
+
payment_source_id?:string;
|
|
556
|
+
|
|
557
|
+
auto_collection?:AutoCollection;
|
|
558
|
+
|
|
559
|
+
invoice_date?:number;
|
|
1532
560
|
}
|
|
1533
561
|
|
|
1534
562
|
}
|