chargebee 2.26.0 → 2.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/chargebee.js +1 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +245 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +305 -13
- package/types/resources/Card.d.ts +485 -13
- package/types/resources/Comment.d.ts +177 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +665 -20
- package/types/resources/CouponCode.d.ts +56 -5
- package/types/resources/CouponSet.d.ts +224 -17
- package/types/resources/CreditNote.d.ts +1202 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +2132 -73
- package/types/resources/DifferentialPrice.d.ts +266 -15
- package/types/resources/Discount.d.ts +107 -0
- package/types/resources/Download.d.ts +18 -0
- package/types/resources/EntitlementOverride.d.ts +101 -7
- package/types/resources/Estimate.d.ts +1181 -27
- package/types/resources/Event.d.ts +145 -8
- package/types/resources/Export.d.ts +703 -32
- package/types/resources/Feature.d.ts +356 -22
- package/types/resources/Gift.d.ts +351 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1212 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +636 -9
- package/types/resources/Invoice.d.ts +2293 -93
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +542 -16
- package/types/resources/ItemEntitlement.d.ts +172 -13
- package/types/resources/ItemFamily.d.ts +173 -15
- package/types/resources/ItemPrice.d.ts +971 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +51 -3
- package/types/resources/Order.d.ts +1224 -32
- package/types/resources/PaymentIntent.d.ts +318 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +1259 -55
- package/types/resources/PaymentVoucher.d.ts +262 -14
- package/types/resources/PortalSession.d.ts +187 -10
- package/types/resources/PromotionalCredit.d.ts +351 -16
- package/types/resources/Purchase.d.ts +274 -5
- package/types/resources/Quote.d.ts +1595 -62
- package/types/resources/QuoteLineGroup.d.ts +134 -5
- package/types/resources/QuotedCharge.d.ts +63 -5
- package/types/resources/QuotedSubscription.d.ts +192 -5
- package/types/resources/ResourceMigration.d.ts +73 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +3462 -137
- package/types/resources/SubscriptionEntitlement.d.ts +116 -8
- package/types/resources/SubscriptionEstimate.d.ts +36 -2
- package/types/resources/TaxWithheld.d.ts +32 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
- package/types/resources/TimeMachine.d.ts +99 -7
- package/types/resources/Token.d.ts +179 -7
- package/types/resources/Transaction.d.ts +597 -25
- package/types/resources/UnbilledCharge.d.ts +355 -14
- package/types/resources/Usage.d.ts +259 -13
- package/types/resources/VirtualBankAccount.d.ts +255 -17
|
@@ -1,567 +1,2767 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface Invoice {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description The invoice number. Acts as a identifier for invoice and typically generated sequentially.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
id:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description Purchase Order Number for this invoice
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
po_number?:string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description The identifier of the customer this invoice belongs to.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
customer_id:string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description The identifier of the subscription this invoice belongs to.
|
|
28
|
+
**Note** : When consolidated invoicing is enabled, you have to refer to [line_item\`s](https://apidocs.chargebee.com/docs/api/invoices#invoice_line_items) `subscription_id` to identify the subscriptions associated with this invoice. However, it is important to avoid using this attribute if the invoice includes charges from multiple subscriptions, as it will be null in such cases.
|
|
29
|
+
|
|
30
|
+
*/
|
|
31
|
+
|
|
7
32
|
subscription_id?:string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @description Boolean indicating whether this invoice belongs to a subscription
|
|
36
|
+
|
|
37
|
+
*/
|
|
38
|
+
|
|
8
39
|
recurring:boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @description Current status of this invoice. \* not_paid - Indicates the payment is not made and all attempts to collect is failed. \* voided - Indicates a voided invoice. \* paid - Indicates a paid invoice. \* posted - Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period \* pending -
|
|
43
|
+
The [invoice](/docs/api/invoices?prod_cat_ver=2#invoice_status) is yet to be closed (sent for payment collection). An invoice is generated with this `status` when it has line items that belong to items that are `metered` or when the `subscription.create_pending_invoices`attribute is set to `true`.
|
|
44
|
+
The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to be closed (sent for payment collection). All invoices are generated with this `status` when [Metered Billing](https://www.chargebee.com/docs/1.0/metered_billing.html) is enabled for the site. \* payment_due - Indicates the payment is not yet collected and is being retried as per retry settings.
|
|
45
|
+
|
|
46
|
+
*/
|
|
47
|
+
|
|
9
48
|
status:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @description VAT/ Tax registration number of the customer. [Learn more](https://www.chargebee.com/docs/tax.html#capture-tax-registration-number)
|
|
52
|
+
|
|
53
|
+
*/
|
|
54
|
+
|
|
10
55
|
vat_number?:string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @description The price type of the invoice. \* tax_inclusive - All amounts in the document are inclusive of tax. \* tax_exclusive - All amounts in the document are exclusive of tax.
|
|
59
|
+
|
|
60
|
+
*/
|
|
61
|
+
|
|
11
62
|
price_type:PriceType;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @description The document date displayed on the invoice PDF. By default, it has the same value as the effective date of the action that created the invoice (subscription creation, update, or invoice creation). This date can be backdated (set to a value in the past) while performing the actions. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription or non-recurring charge is effective as of a past date. However, if the invoice is created as `pending`, and if the site is configured to set invoice dates to the date of closing, then upon invoice closure, this date is changed to the invoice closing date.
|
|
66
|
+
|
|
67
|
+
*/
|
|
68
|
+
|
|
12
69
|
date?:number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @description Due date of the invoice
|
|
73
|
+
|
|
74
|
+
*/
|
|
75
|
+
|
|
13
76
|
due_date?:number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @description Number of days within which the invoice has to be paid
|
|
80
|
+
|
|
81
|
+
*/
|
|
82
|
+
|
|
14
83
|
net_term_days?:number;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @description Exchange rate used for base currency conversion.
|
|
87
|
+
|
|
88
|
+
Note that when converting foreign currency invoices to local currency for VAT purposes, the exchange rates used differ from the base currency exchange rate provided in this field. This is due to regulations set by tax authorities, which require the use of official sources such as European Central Bank rates for local currency conversion. To calculate the exchange rate utilized for VAT in local currency, you may use the following formula.
|
|
89
|
+
**Exchange rate** = tax_amount_in_local_currency / tax_amount
|
|
90
|
+
|
|
91
|
+
*/
|
|
92
|
+
|
|
15
93
|
exchange_rate?:number;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @description The currency code (ISO 4217 format) for the invoice
|
|
97
|
+
|
|
98
|
+
*/
|
|
99
|
+
|
|
16
100
|
currency_code:string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @description Invoiced amount displayed in cents; that is, a decimal point is not present between the whole number and the decimal part. For example, $499.99 is displayed as 49999, and so on.
|
|
104
|
+
|
|
105
|
+
*/
|
|
106
|
+
|
|
17
107
|
total?:number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @description Payments collected successfully for the invoice. This is the sum of [linked_payments[]](invoices#invoice_linked_payments)`.txn_amount` for all `linked_payments[]` that have `txn_status` as `success`.
|
|
111
|
+
|
|
112
|
+
*/
|
|
113
|
+
|
|
18
114
|
amount_paid?:number;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @description Total adjustments made against this invoice.
|
|
118
|
+
|
|
119
|
+
*/
|
|
120
|
+
|
|
19
121
|
amount_adjusted?:number;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @description Amount written off against this invoice.
|
|
125
|
+
|
|
126
|
+
*/
|
|
127
|
+
|
|
20
128
|
write_off_amount?:number;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @description Total credits applied against this invoice.
|
|
132
|
+
|
|
133
|
+
*/
|
|
134
|
+
|
|
21
135
|
credits_applied?:number;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @description The unpaid amount that is due on the invoice. This is calculated as: [total](invoices#invoice_total) - [amount_paid](invoices#invoice_amount_paid) - sum of [applied_credits](invoices#invoice_applied_credits)`.applied_amount` - sum of [adjustment_credit_notes](invoices#invoice_adjustment_credit_notes)`.cn_total` - sum of [linked_taxes_withheld](invoices#invoice_linked_taxes_withheld)`.amount`.
|
|
139
|
+
|
|
140
|
+
*/
|
|
141
|
+
|
|
22
142
|
amount_due?:number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @description Timestamp indicating the date \& time this invoice got paid.
|
|
146
|
+
|
|
147
|
+
*/
|
|
148
|
+
|
|
23
149
|
paid_at?:number;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @description Current dunning status of the invoice. \* exhausted - Maximum number of attempts have been made. \* stopped - Dunning has stopped for this invoice. \* success - Payment successfully collected during dunning process. \* in_progress - Dunning is still in progress.
|
|
153
|
+
|
|
154
|
+
*/
|
|
155
|
+
|
|
24
156
|
dunning_status?:'in_progress' | 'stopped' | 'success' | 'exhausted';
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @description Timestamp indicating when will the next attempt to collect payment for this invoice occur.
|
|
160
|
+
|
|
161
|
+
*/
|
|
162
|
+
|
|
25
163
|
next_retry_at?:number;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @description Timestamp indicating the date \& time this invoice got voided.
|
|
167
|
+
|
|
168
|
+
*/
|
|
169
|
+
|
|
26
170
|
voided_at?:number;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @description The version number of this resource. For every change made to the resource, `resource_version` is updated with a new timestamp in milliseconds.
|
|
174
|
+
|
|
175
|
+
*/
|
|
176
|
+
|
|
27
177
|
resource_version?:number;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @description Timestamp indicating when this invoice was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
|
|
181
|
+
**Note** : This value does not change when the following attributes are changed: *next_retry_at, dunning_status, has_advance_charges*
|
|
182
|
+
|
|
183
|
+
*/
|
|
184
|
+
|
|
28
185
|
updated_at?:number;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @description The sum of all the line item amounts minus the sum of all line item discounts. In other words, this is the sum of all [line_items[]](invoices#invoice_line_items)`.amount` - the sum of all [line_item_discounts[]](invoices#invoice_line_item_discounts)`.discount_amount`.
|
|
189
|
+
|
|
190
|
+
*/
|
|
191
|
+
|
|
29
192
|
sub_total:number;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @description Invoice subtotal in the currency of the place of supply.
|
|
196
|
+
|
|
197
|
+
*/
|
|
198
|
+
|
|
30
199
|
sub_total_in_local_currency?:number;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @description Total invoice amount in the currency of the place of supply.
|
|
203
|
+
|
|
204
|
+
*/
|
|
205
|
+
|
|
31
206
|
total_in_local_currency?:number;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed.
|
|
210
|
+
|
|
211
|
+
*/
|
|
212
|
+
|
|
32
213
|
local_currency_code?:string;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @description Total tax amount for this invoice
|
|
217
|
+
|
|
218
|
+
*/
|
|
219
|
+
|
|
33
220
|
tax:number;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @description This parameter represents the exchange rate as a relative price of the base currency that appears as local currency in invoices and credit notes. The local currency exchange rate specifically refers to the exchange rate of a country's currency when converting it to another currency. For example, if you want to convert US dollars to euros, the local currency exchange rate would be the rate at which you can convert US dollars to euros.
|
|
224
|
+
|
|
225
|
+
*/
|
|
226
|
+
|
|
34
227
|
local_currency_exchange_rate?:number;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @description Boolean indicating the first invoice raised for the subscription. In the case of a non-recurring invoice, it indicates the first invoice raised for the customer.
|
|
231
|
+
|
|
232
|
+
*/
|
|
233
|
+
|
|
35
234
|
first_invoice?:boolean;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @description The share of the invoice total due to new sales. When `first_invoice` is `true`, this attribute is the same as total. However, when the invoice is a [consolidated](https://www.chargebee.com/docs/2.0/consolidated-invoicing.html )one, then it is the sum of all `line_items.amount` belonging to a new.
|
|
238
|
+
|
|
239
|
+
*/
|
|
240
|
+
|
|
36
241
|
new_sales_amount?:number;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @description Boolean indicating any advance charge is present in this invoice.
|
|
245
|
+
|
|
246
|
+
*/
|
|
247
|
+
|
|
37
248
|
has_advance_charges?:boolean;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @description Boolean indicating this invoice line_items terms are finalized or not.
|
|
252
|
+
|
|
253
|
+
*/
|
|
254
|
+
|
|
38
255
|
term_finalized:boolean;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @description Boolean indicating this invoice is gifted or not.
|
|
259
|
+
|
|
260
|
+
*/
|
|
261
|
+
|
|
39
262
|
is_gifted:boolean;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @description The date when the invoice is finalized. This is the date in the invoice lifecycle when its `status` becomes any one of the following for the first time: `payment_due`, `posted`, or `paid`. For an invoice with `status` as `pending`, this happens when it gets closed.
|
|
266
|
+
|
|
267
|
+
*/
|
|
268
|
+
|
|
40
269
|
generated_at?:number;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @description Expected payment date recorded for this invoice.
|
|
273
|
+
|
|
274
|
+
*/
|
|
275
|
+
|
|
41
276
|
expected_payment_date?:number;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @description Payments that are yet to be collected for the invoice. This is the same value as [amount_due](invoices#invoice_amount_due) - the sum of [linked_payments[]](invoices#invoice_linked_payments)`.txn_amount` for all `linked_payments[]` that have `txn_status` as `in_progress`.
|
|
280
|
+
|
|
281
|
+
*/
|
|
282
|
+
|
|
42
283
|
amount_to_collect?:number;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @description Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the `round_off_amount`. If there is no `round-off amount`, it will display `0`.
|
|
287
|
+
|
|
288
|
+
*/
|
|
289
|
+
|
|
43
290
|
round_off_amount?:number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @description Payment owner of an invoice
|
|
294
|
+
|
|
295
|
+
*/
|
|
296
|
+
|
|
44
297
|
payment_owner?:string;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Invoices \> Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive
|
|
301
|
+
|
|
302
|
+
*/
|
|
303
|
+
|
|
45
304
|
void_reason_code?:string;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @description Indicates that this resource has been deleted.
|
|
308
|
+
|
|
309
|
+
*/
|
|
310
|
+
|
|
46
311
|
deleted:boolean;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @description Specifies the customer's category for the Goods and Services Tax (GST). This field is returned only if you've configured GST for the India region.
|
|
315
|
+
|
|
316
|
+
*/
|
|
317
|
+
|
|
47
318
|
tax_category?:string;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @description An overridden value for the first two characters of the [full VAT
|
|
322
|
+
number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
|
|
323
|
+
|
|
324
|
+
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
325
|
+
enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting [billing_address](customers#customer_billing_address) `country` as `XI`. That's the code for **United Kingdom - Northern
|
|
326
|
+
Ireland** . The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
|
|
327
|
+
|
|
328
|
+
*/
|
|
329
|
+
|
|
48
330
|
vat_number_prefix?:string;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* @description The subscription channel this object originated from and is maintained in. \* play_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
|
|
334
|
+
|
|
335
|
+
In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.
|
|
336
|
+
\* web - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI. \* app_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.
|
|
337
|
+
|
|
338
|
+
*/
|
|
339
|
+
|
|
49
340
|
channel?:Channel;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* @description The unique ID of the [business entity](/docs/api/advanced-features?prod_cat_ver=2#mbe) of this invoice. Depending on whether the invoice was created directly for a customer or for a subscription, this is the business entity of the [customer](/docs/api/invoices?prod_cat_ver=2#invoice_customer_id) or the [subscription](/docs/api/invoices?prod_cat_ver=2#invoice_subscription_id) respectively.
|
|
344
|
+
|
|
345
|
+
*/
|
|
346
|
+
|
|
50
347
|
business_entity_id?:string;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @description The list of line items for this invoice
|
|
351
|
+
|
|
352
|
+
*/
|
|
353
|
+
|
|
51
354
|
line_items?:Invoice.LineItem[];
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @description The list of all deductions applied to the invoice.
|
|
358
|
+
|
|
359
|
+
*/
|
|
360
|
+
|
|
52
361
|
discounts?:Invoice.Discount[];
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* @description The list of deduction(s) applied for each line item of this invoice
|
|
365
|
+
|
|
366
|
+
*/
|
|
367
|
+
|
|
53
368
|
line_item_discounts?:Invoice.LineItemDiscount[];
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* @description The list of taxes applied for this invoice
|
|
372
|
+
|
|
373
|
+
*/
|
|
374
|
+
|
|
54
375
|
taxes?:Invoice.Tax[];
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* @description The list of taxes applied on line items
|
|
379
|
+
|
|
380
|
+
*/
|
|
381
|
+
|
|
55
382
|
line_item_taxes?:Invoice.LineItemTax[];
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @description The list of tiers applicable for this line item
|
|
386
|
+
|
|
387
|
+
*/
|
|
388
|
+
|
|
56
389
|
line_item_tiers?:Invoice.LineItemTier[];
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @description The list of transactions for this invoice
|
|
393
|
+
|
|
394
|
+
*/
|
|
395
|
+
|
|
57
396
|
linked_payments?:Invoice.InvoiceTransaction[];
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* @description The list of dunning_attempts for this invoice
|
|
400
|
+
|
|
401
|
+
*/
|
|
402
|
+
|
|
58
403
|
dunning_attempts?:Invoice.DunningAttempt[];
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* @description Refundable Credits applied on this invoice.
|
|
407
|
+
|
|
408
|
+
*/
|
|
409
|
+
|
|
59
410
|
applied_credits?:Invoice.AppliedCredit[];
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* @description Adjustments created for this invoice
|
|
414
|
+
|
|
415
|
+
*/
|
|
416
|
+
|
|
60
417
|
adjustment_credit_notes?:Invoice.CreatedCreditNote[];
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* @description Credit notes issued for this invoice
|
|
421
|
+
|
|
422
|
+
*/
|
|
423
|
+
|
|
61
424
|
issued_credit_notes?:Invoice.CreatedCreditNote[];
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* @description The list of orders for this invoice
|
|
428
|
+
|
|
429
|
+
*/
|
|
430
|
+
|
|
62
431
|
linked_orders?:Invoice.LinkedOrder[];
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* @description The list of [notes](https://www.chargebee.com/docs/2.0/invoice_notes.html) that appear on the invoice PDF sent to the customer. Notes that come from a specific resource related to the invoice have `entity_type` and `entity_id` defined. There can be up to two notes in this array for which `entity_type` and `entity_id` are not defined:
|
|
435
|
+
|
|
436
|
+
* **Invoice-specific note:** It is the note provided via the `invoice_note` parameter for various endpoints in the API that also create invoices. For example, [creating a subscription](https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=2#create_subscription_for_items_invoice_notes), [creating an invoice](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#create_invoice_for_items_and_one_time_charges_invoice_note), and [closing a pending invoice](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#close_a_pending_invoice_invoice_note).
|
|
437
|
+
* **General note:** This note is added to all invoices of the Chargebee site. You can [add/edit](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes) this note in the Chargebee admin console.
|
|
438
|
+
|
|
439
|
+
*/
|
|
440
|
+
|
|
63
441
|
notes?:Invoice.Note[];
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* @description Shipping address for the invoice.
|
|
445
|
+
|
|
446
|
+
*/
|
|
447
|
+
|
|
64
448
|
shipping_address?:Invoice.ShippingAddress;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* @description Billing address for the invoice.
|
|
452
|
+
|
|
453
|
+
*/
|
|
454
|
+
|
|
65
455
|
billing_address?:Invoice.BillingAddress;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* @description An e-invoice or electronic invoice is a structured representation of an invoice that is interoperable between computerized invoicing systems. Depending on the country, e-invoicing can be necessary to meet financial/taxation authority regulations.
|
|
459
|
+
|
|
460
|
+
*/
|
|
461
|
+
|
|
66
462
|
einvoice?:Invoice.Einvoice;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* @description Details of `tax_withheld` against this invoice.
|
|
466
|
+
|
|
467
|
+
*/
|
|
468
|
+
|
|
67
469
|
linked_taxes_withheld?:Invoice.LinkedTaxWithheld[];
|
|
68
470
|
}
|
|
69
471
|
export namespace Invoice {
|
|
70
|
-
export class InvoiceResource {
|
|
472
|
+
export class InvoiceResource {
|
|
473
|
+
/**
|
|
474
|
+
* @description This endpoint is used to delete line items from "Pending" invoice.
|
|
475
|
+
|
|
476
|
+
*/
|
|
477
|
+
|
|
71
478
|
delete_line_items(invoice_id:string, input?:DeleteLineItemsInputParam):ChargebeeRequest<DeleteLineItemsResponse>;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @description This API removes a credit note attached to an invoice. When you remove a credit note from an invoice, the invoice status returns to `not_paid`.
|
|
482
|
+
|
|
483
|
+
**Note:** You cannot remove a credit note from an invoice if it has already been refunded.
|
|
484
|
+
|
|
485
|
+
*/
|
|
486
|
+
|
|
72
487
|
remove_credit_note(invoice_id:string, input?:RemoveCreditNoteInputParam):ChargebeeRequest<RemoveCreditNoteResponse>;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* @description This API [removes payments](https://www.chargebee.com/docs/2.0/invoice-operations.html#actions-for-paid-invoices_remove-payment) applied to an invoice. Once the applied payment is removed, the invoice status returns to `not_paid` or `payment_due`. The removed payment is then added to the customer's excess payment balance.
|
|
491
|
+
|
|
492
|
+
*/
|
|
493
|
+
|
|
73
494
|
remove_payment(invoice_id:string, input?:RemovePaymentInputParam):ChargebeeRequest<RemovePaymentResponse>;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* @description This API is used to stop dunning for "Payment Due" invoices that have been enabled for Auto Collection. When dunning is stopped, the status of the invoice will be changed to "Not Paid".
|
|
498
|
+
|
|
499
|
+
*/
|
|
500
|
+
|
|
74
501
|
stop_dunning(invoice_id:string, input?:StopDunningInputParam):ChargebeeRequest<StopDunningResponse>;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* @description The API applies [excess payments](https://apidocs.chargebee.com/docs/api/customers#customer_excess_payments) to an invoice. Once an excess payment is applied, the [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice `status` changes to either `paid` or `payment_due` depending on how much excess payment is applied to the invoice amount.
|
|
505
|
+
|
|
506
|
+
For example, if you have an excess payment of $25.00, and the invoice to which you want to apply this excess payment has a balance of $50. Once you apply this excess payment, the invoice status changes to `paid`, and [invoice.amount_due](invoices#invoice_amount_due) is adjusted to $25.00.
|
|
507
|
+
|
|
508
|
+
*/
|
|
509
|
+
|
|
75
510
|
apply_payments(invoice_id:string, input?:ApplyPaymentsInputParam):ChargebeeRequest<ApplyPaymentsResponse>;
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @description Voids the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before voiding it.
|
|
514
|
+
|
|
515
|
+
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
516
|
+
* If an invoice for the current term of a subscription is voided and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
517
|
+
* Any [usages](/docs/api/usages?prod_cat_ver=2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the `invoice_id` field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver=2#retrieve_usages_for_an_invoice_as_pdf) is generated and saved to the invoice as an [attachment](https://www.chargebee.com/docs/2.0/file-attachment.html).
|
|
518
|
+
|
|
519
|
+
*/
|
|
520
|
+
|
|
76
521
|
void_invoice(invoice_id:string, input?:VoidInvoiceInputParam):ChargebeeRequest<VoidInvoiceResponse>;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* @description Adds a one-time charge to a [pending](https://apidocs.chargebee.com/docs/api/invoices#invoice_status) invoice. A one-time charge is a charge that is added ad hoc to the invoice and does not represent a predefined [item price](https:/apidocs.chargebee.com/docs/api/item_prices). It appears in the invoice as a [line_item](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items) of [entity_type](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items_entity_type) `adhoc`.
|
|
525
|
+
|
|
526
|
+
*/
|
|
527
|
+
|
|
77
528
|
add_charge(invoice_id:string, input:AddChargeInputParam):ChargebeeRequest<AddChargeResponse>;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* @description This endpoint is used to send an e-invoice for invoice.
|
|
532
|
+
|
|
533
|
+
To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
|
|
534
|
+
|
|
535
|
+
This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
|
|
536
|
+
|
|
537
|
+
* If e-invoicing is not enabled at the site and customer level.
|
|
538
|
+
|
|
539
|
+
* If there is an e-invoice generated already for the invoice.
|
|
540
|
+
|
|
541
|
+
* If the "**Use automatic e-invoicing**" option is selected.
|
|
542
|
+
|
|
543
|
+
* If there are no generated e-invoices with the `failed` or `skipped` status.
|
|
544
|
+
|
|
545
|
+
* If the invoice status is `voided` or `pending`.
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
*/
|
|
549
|
+
|
|
78
550
|
send_einvoice(invoice_id:string):ChargebeeRequest<SendEinvoiceResponse>;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* @description This API writes off an Invoice.
|
|
554
|
+
|
|
555
|
+
*/
|
|
556
|
+
|
|
79
557
|
write_off(invoice_id:string, input?:WriteOffInputParam):ChargebeeRequest<WriteOffResponse>;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* @description This endpoint is used when [metered billing](https://www.chargebee.com/docs/2.0/metered_billing.html) is enabled and it adds a [charge-item price](./item_prices?prod_cat_ver=2) to a `pending` invoice. To collect the accumulated charges by closing the invoice, call [Close a pending invoice](./invoices?prod_cat_ver=2#close_a_pending_invoice).
|
|
561
|
+
|
|
562
|
+
*/
|
|
563
|
+
|
|
80
564
|
add_charge_item(invoice_id:string, input?:AddChargeItemInputParam):ChargebeeRequest<AddChargeItemResponse>;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* @description Lists all the Invoices.
|
|
568
|
+
|
|
569
|
+
*/
|
|
570
|
+
|
|
81
571
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* @description Invoices for a subscription are created with a `pending` `status` when the subscription has `create_pending_invoices` attribute set to `true`. This API call finalizes a `pending` invoice. Any `refundable_credits` and `excess_payments` for the customer are applied to the invoice, and any payment due is collected automatically if `auto_collection` is `on` for the customer.
|
|
575
|
+
|
|
576
|
+
#### Automation
|
|
577
|
+
|
|
578
|
+
This operation can be automated by using a [site setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing). Moreover, the automation can be overridden at the [customer](/docs/api/customers?prod_cat_ver=2#customer_auto_close_invoices) and [subscription](/docs/api/subscriptions?prod_cat_ver=2#subscription_auto_close_invoices) level.
|
|
579
|
+
|
|
580
|
+
*/
|
|
581
|
+
|
|
82
582
|
close(invoice_id:string, input?:CloseInputParam):ChargebeeRequest<CloseResponse>;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* @description This API applies [available credits](customers#customer_balances) to an invoice. After credits are applied, [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice status changes to either `paid` or `payment_due` depending on how much credit is applied to the invoice amount.
|
|
586
|
+
|
|
587
|
+
*/
|
|
588
|
+
|
|
83
589
|
apply_credits(invoice_id:string, input?:ApplyCreditsInputParam):ChargebeeRequest<ApplyCreditsResponse>;
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* @description Retrieve the invoice for the specified invoice id.
|
|
593
|
+
|
|
594
|
+
*/
|
|
595
|
+
|
|
84
596
|
retrieve(invoice_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* @description Creates an invoice for [charge-items](./items?prod_cat_ver=2) and [one-time charges](https://www.chargebee.com/docs/2.0/charges.html). The item prices must belong to items of `type` `charge`.
|
|
600
|
+
|
|
601
|
+
*/
|
|
602
|
+
|
|
85
603
|
create_for_charge_items_and_charges(input?:CreateForChargeItemsAndChargesInputParam):ChargebeeRequest<CreateForChargeItemsAndChargesResponse>;
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* @description This API allows you to update the invoice Billing/Shipping address, VAT and PO number. During this operation if Billing Info (Billing Address, vat_number), Shipping info and PO number are not already present in the system the data will be added. If data is already present, the existing values will be replaced. If info is present in the system, but not passed as part of the request, the info will not be removed from the system.
|
|
607
|
+
|
|
608
|
+
**Note:** Incase, tax is already applied will now vary due to address change, you cannot update the address. You cannot update the VAT Number if the billing address is not present in the API request.This will update the invoice only, it won't change the corresponding customer/subscription details.
|
|
609
|
+
|
|
610
|
+
*/
|
|
611
|
+
|
|
86
612
|
update_details(invoice_id:string, input?:UpdateDetailsInputParam):ChargebeeRequest<UpdateDetailsResponse>;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* @description To record a [offline payment](https://www.chargebee.com/docs/offline_payments.html) for an invoice.
|
|
616
|
+
|
|
617
|
+
The invoice status will be marked as 'paid' if its amount due becomes 0 because of this recorded payment.
|
|
618
|
+
|
|
619
|
+
**Note:** If the payment transaction amount is more than the invoice due amount, the remaining transaction amount will be added to the customer's Excess Payments balance to be used against other invoices.
|
|
620
|
+
|
|
621
|
+
*/
|
|
622
|
+
|
|
87
623
|
record_payment(invoice_id:string, input?:RecordPaymentInputParam):ChargebeeRequest<RecordPaymentResponse>;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* @description Deletes the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before deleting it.
|
|
627
|
+
**Caution**
|
|
628
|
+
|
|
629
|
+
All associated [usages](/docs/api/usages?prod_cat_ver=2) are permanently deleted on deleting an invoice. If you want to regenerate such an invoice, [add](/docs/api/usages?prod_cat_ver=2#create_a_usage) or [bulk import](https://www.chargebee.com/docs/2.0/bulk-operations.html#overview_available-bulk-operations) usages before invoice regeneration.
|
|
630
|
+
|
|
631
|
+
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
632
|
+
* If an invoice for the current term of a subscription is deleted and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
633
|
+
|
|
634
|
+
*/
|
|
635
|
+
|
|
88
636
|
delete(invoice_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
640
|
+
|
|
641
|
+
*/
|
|
642
|
+
|
|
89
643
|
import_invoice(input:ImportInvoiceInputParam):ChargebeeRequest<ImportInvoiceResponse>;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* @description Records [tax_withheld](/docs/api/tax_withheld) by the customer against the invoice specified. This operation is allowed only when all of the following conditions are true:
|
|
647
|
+
|
|
648
|
+
* Tax Amount Withheld is enabled.
|
|
649
|
+
* The `invoice` does not have a `linked_taxes_withheld` record associated with it already.
|
|
650
|
+
* `invoice.amount_due` is greater than zero.
|
|
651
|
+
* `invoice.status` is one of the following: `payment_due`, `not_paid`, or `posted`.
|
|
652
|
+
|
|
653
|
+
*/
|
|
654
|
+
|
|
90
655
|
record_tax_withheld(invoice_id:string, input?:RecordTaxWithheldInputParam):ChargebeeRequest<RecordTaxWithheldResponse>;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* @description Resend failed einvoice of an invoice to the customer using this API.
|
|
659
|
+
|
|
660
|
+
*/
|
|
661
|
+
|
|
91
662
|
resend_einvoice(invoice_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* @description Removes a [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld) record from the `invoice` specified. This operation is allowed only when all of the following conditions are true:
|
|
666
|
+
|
|
667
|
+
* [invoice.status](/docs/api/invoices#invoice_status) is one of the following: `payment_due`, `not_paid`, or `posted`.
|
|
668
|
+
* There are no [adjustment_credit_notes](/docs/api/invoices#invoice_adjustment_credit_notes) associated with the invoice.
|
|
669
|
+
* There are no [issued_credit_notes](/docs/api/invoices#invoice_issued_credit_notes) associated with the invoice.
|
|
670
|
+
|
|
671
|
+
*/
|
|
672
|
+
|
|
92
673
|
remove_tax_withheld(invoice_id:string, input?:RemoveTaxWithheldInputParam):ChargebeeRequest<RemoveTaxWithheldResponse>;
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
677
|
+
|
|
678
|
+
*/
|
|
679
|
+
|
|
93
680
|
list_payment_reference_numbers(input?:ListPaymentReferenceNumbersInputParam):ChargebeeRequest<ListPaymentReferenceNumbersResponse>;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* @description Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
|
|
684
|
+
|
|
685
|
+
This API is used to collect payments for `payment_due` and `not_paid` invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
|
|
686
|
+
|
|
687
|
+
Pass `authorization_transaction_id` to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as `payment_due`.
|
|
688
|
+
|
|
689
|
+
*/
|
|
690
|
+
|
|
94
691
|
collect_payment(invoice_id:string, input?:CollectPaymentInputParam):ChargebeeRequest<CollectPaymentResponse>;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* @description Updates the [`quantity`](/docs/api/invoices#invoice_line_items_quantity) for `metered` [`line_items`](/docs/api/invoices#invoice_line_items) of an invoice to reflect the latest [usage](https://apidocs.chargebee.com/docs/api/usages) data.
|
|
695
|
+
|
|
696
|
+
**Note:** This operation is done automatically while [closing](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice) the invoice.
|
|
697
|
+
|
|
698
|
+
*/
|
|
699
|
+
|
|
95
700
|
sync_usages(invoice_id:string):ChargebeeRequest<SyncUsagesResponse>;
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
704
|
+
|
|
705
|
+
* Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
|
|
706
|
+
* Refund a fully refunded invoice.
|
|
707
|
+
|
|
708
|
+
If the refund transaction succeeds, a `credit_note` capturing this refund detail is created for the invoice.
|
|
709
|
+
|
|
710
|
+
*/
|
|
711
|
+
|
|
96
712
|
refund(invoice_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* @description Refunds the invoice. The refund is provided against the following in order of precedence:
|
|
716
|
+
|
|
717
|
+
* Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
718
|
+
* Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
|
|
719
|
+
* Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
720
|
+
|
|
721
|
+
**Example**
|
|
722
|
+
|
|
723
|
+
Consider an invoice with the following payments and tax withheld.
|
|
724
|
+
|
|
725
|
+
* Offline payments: $30
|
|
726
|
+
* Online payments: $20
|
|
727
|
+
* Tax withheld: $5
|
|
728
|
+
|
|
729
|
+
When recording a refund worth $40, the refund amount is split as follows:
|
|
730
|
+
|
|
731
|
+
* Refund against offline payments: $30
|
|
732
|
+
* Refund against tax withheld: $5
|
|
733
|
+
* Refund against online payments: $5
|
|
734
|
+
|
|
735
|
+
For payments made via online transactions, the [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer.
|
|
736
|
+
**Tip**
|
|
737
|
+
|
|
738
|
+
If the order of precendence described above does not work for your use case, and you want to provide a refund against online `linked_payments` first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
|
|
739
|
+
|
|
740
|
+
*/
|
|
741
|
+
|
|
97
742
|
record_refund(invoice_id:string, input?:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* @description Gets the invoice as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
|
|
746
|
+
|
|
747
|
+
#### Related Tutorial
|
|
748
|
+
|
|
749
|
+
* [Check out customer portal tutorial on how to download invoice as PDF.](//www.chargebee.com/tutorials/customer-portal-sample.html#downloading_invoices_as_pdf)
|
|
750
|
+
|
|
751
|
+
*/
|
|
752
|
+
|
|
98
753
|
pdf(invoice_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* @description Download the e-invoice in both XML and PDF formats. The response consists of a `download` object for each format. The XML format follows the [structure as per Peppol BIS Billing v3.0](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/tree/).
|
|
757
|
+
**Note**
|
|
758
|
+
|
|
759
|
+
* You can only download e-invoices when their `status` is `success`.
|
|
760
|
+
* There are some cases in which the PDF is not available for download. In such cases, you can obtain it from the XML by decoding the value for [cbc:EmbeddedDocumentBinaryObject](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cac-Attachment/cbc-EmbeddedDocumentBinaryObject/), which is the Base64-encoded version of the PDF.
|
|
761
|
+
|
|
762
|
+
*/
|
|
763
|
+
|
|
99
764
|
download_einvoice(invoice_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
|
|
100
765
|
}
|
|
101
|
-
export interface DeleteLineItemsResponse {
|
|
102
|
-
|
|
766
|
+
export interface DeleteLineItemsResponse {
|
|
767
|
+
/**
|
|
768
|
+
* @description This endpoint is used to delete line items from "Pending" invoice.
|
|
769
|
+
|
|
770
|
+
*/
|
|
771
|
+
|
|
772
|
+
invoice:Invoice;
|
|
103
773
|
}
|
|
104
774
|
export interface DeleteLineItemsInputParam {
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* @description The list of line items which have to be deleted.
|
|
778
|
+
|
|
779
|
+
*/
|
|
780
|
+
|
|
105
781
|
line_items?:{id?:string}[];
|
|
106
782
|
}
|
|
107
|
-
export interface RemoveCreditNoteResponse {
|
|
108
|
-
|
|
109
|
-
|
|
783
|
+
export interface RemoveCreditNoteResponse {
|
|
784
|
+
/**
|
|
785
|
+
* @description This API removes a credit note attached to an invoice. When you remove a credit note from an invoice, the invoice status returns to `not_paid`.
|
|
786
|
+
|
|
787
|
+
**Note:** You cannot remove a credit note from an invoice if it has already been refunded.
|
|
788
|
+
|
|
789
|
+
*/
|
|
790
|
+
|
|
791
|
+
invoice:Invoice;
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* @description This API removes a credit note attached to an invoice. When you remove a credit note from an invoice, the invoice status returns to `not_paid`.
|
|
795
|
+
|
|
796
|
+
**Note:** You cannot remove a credit note from an invoice if it has already been refunded.
|
|
797
|
+
|
|
798
|
+
*/
|
|
799
|
+
|
|
800
|
+
credit_note:CreditNote;
|
|
110
801
|
}
|
|
111
802
|
export interface RemoveCreditNoteInputParam {
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* @description Parameters for credit_note
|
|
806
|
+
|
|
807
|
+
*/
|
|
808
|
+
|
|
112
809
|
credit_note?:{id:string};
|
|
113
810
|
}
|
|
114
|
-
export interface RemovePaymentResponse {
|
|
115
|
-
|
|
116
|
-
|
|
811
|
+
export interface RemovePaymentResponse {
|
|
812
|
+
/**
|
|
813
|
+
* @description This API [removes payments](https://www.chargebee.com/docs/2.0/invoice-operations.html#actions-for-paid-invoices_remove-payment) applied to an invoice. Once the applied payment is removed, the invoice status returns to `not_paid` or `payment_due`. The removed payment is then added to the customer's excess payment balance.
|
|
814
|
+
|
|
815
|
+
*/
|
|
816
|
+
|
|
817
|
+
invoice:Invoice;
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* @description This API [removes payments](https://www.chargebee.com/docs/2.0/invoice-operations.html#actions-for-paid-invoices_remove-payment) applied to an invoice. Once the applied payment is removed, the invoice status returns to `not_paid` or `payment_due`. The removed payment is then added to the customer's excess payment balance.
|
|
821
|
+
|
|
822
|
+
*/
|
|
823
|
+
|
|
824
|
+
transaction:Transaction;
|
|
117
825
|
}
|
|
118
826
|
export interface RemovePaymentInputParam {
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* @description Parameters for transaction
|
|
830
|
+
|
|
831
|
+
*/
|
|
832
|
+
|
|
119
833
|
transaction?:{id:string};
|
|
120
834
|
}
|
|
121
|
-
export interface StopDunningResponse {
|
|
122
|
-
|
|
835
|
+
export interface StopDunningResponse {
|
|
836
|
+
/**
|
|
837
|
+
* @description This API is used to stop dunning for "Payment Due" invoices that have been enabled for Auto Collection. When dunning is stopped, the status of the invoice will be changed to "Not Paid".
|
|
838
|
+
|
|
839
|
+
*/
|
|
840
|
+
|
|
841
|
+
invoice:Invoice;
|
|
123
842
|
}
|
|
124
843
|
export interface StopDunningInputParam {
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
847
|
+
|
|
848
|
+
*/
|
|
849
|
+
|
|
125
850
|
comment?:string;
|
|
126
851
|
}
|
|
127
|
-
export interface ApplyPaymentsResponse {
|
|
128
|
-
|
|
852
|
+
export interface ApplyPaymentsResponse {
|
|
853
|
+
/**
|
|
854
|
+
* @description The API applies [excess payments](https://apidocs.chargebee.com/docs/api/customers#customer_excess_payments) to an invoice. Once an excess payment is applied, the [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice `status` changes to either `paid` or `payment_due` depending on how much excess payment is applied to the invoice amount.
|
|
855
|
+
|
|
856
|
+
For example, if you have an excess payment of $25.00, and the invoice to which you want to apply this excess payment has a balance of $50. Once you apply this excess payment, the invoice status changes to `paid`, and [invoice.amount_due](invoices#invoice_amount_due) is adjusted to $25.00.
|
|
857
|
+
|
|
858
|
+
*/
|
|
859
|
+
|
|
860
|
+
invoice:Invoice;
|
|
129
861
|
}
|
|
130
862
|
export interface ApplyPaymentsInputParam {
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
866
|
+
|
|
867
|
+
*/
|
|
868
|
+
|
|
131
869
|
comment?:string;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* @description Parameters for transactions
|
|
873
|
+
|
|
874
|
+
*/
|
|
875
|
+
|
|
132
876
|
transactions?:{id?:string}[];
|
|
133
877
|
}
|
|
134
|
-
export interface VoidInvoiceResponse {
|
|
135
|
-
|
|
136
|
-
|
|
878
|
+
export interface VoidInvoiceResponse {
|
|
879
|
+
/**
|
|
880
|
+
* @description Voids the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before voiding it.
|
|
881
|
+
|
|
882
|
+
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
883
|
+
* If an invoice for the current term of a subscription is voided and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
884
|
+
* Any [usages](/docs/api/usages?prod_cat_ver=2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the `invoice_id` field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver=2#retrieve_usages_for_an_invoice_as_pdf) is generated and saved to the invoice as an [attachment](https://www.chargebee.com/docs/2.0/file-attachment.html).
|
|
885
|
+
|
|
886
|
+
*/
|
|
887
|
+
|
|
888
|
+
invoice:Invoice;
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* @description Voids the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before voiding it.
|
|
892
|
+
|
|
893
|
+
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
894
|
+
* If an invoice for the current term of a subscription is voided and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
895
|
+
* Any [usages](/docs/api/usages?prod_cat_ver=2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the `invoice_id` field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver=2#retrieve_usages_for_an_invoice_as_pdf) is generated and saved to the invoice as an [attachment](https://www.chargebee.com/docs/2.0/file-attachment.html).
|
|
896
|
+
|
|
897
|
+
*/
|
|
898
|
+
|
|
899
|
+
credit_note?:CreditNote;
|
|
137
900
|
}
|
|
138
901
|
export interface VoidInvoiceInputParam {
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
905
|
+
|
|
906
|
+
*/
|
|
907
|
+
|
|
139
908
|
comment?:string;
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Invoices \> Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
912
|
+
|
|
913
|
+
*/
|
|
914
|
+
|
|
140
915
|
void_reason_code?:string;
|
|
141
916
|
}
|
|
142
|
-
export interface AddChargeResponse {
|
|
143
|
-
|
|
917
|
+
export interface AddChargeResponse {
|
|
918
|
+
/**
|
|
919
|
+
* @description Adds a one-time charge to a [pending](https://apidocs.chargebee.com/docs/api/invoices#invoice_status) invoice. A one-time charge is a charge that is added ad hoc to the invoice and does not represent a predefined [item price](https:/apidocs.chargebee.com/docs/api/item_prices). It appears in the invoice as a [line_item](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items) of [entity_type](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items_entity_type) `adhoc`.
|
|
920
|
+
|
|
921
|
+
*/
|
|
922
|
+
|
|
923
|
+
invoice:Invoice;
|
|
144
924
|
}
|
|
145
925
|
export interface AddChargeInputParam {
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* @description The amount to be charged. The unit depends on the [type of currency](/docs/api#md_disabled).
|
|
929
|
+
|
|
930
|
+
*/
|
|
931
|
+
|
|
146
932
|
amount:number;
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* @description Detailed description about this lineitem.
|
|
936
|
+
|
|
937
|
+
*/
|
|
938
|
+
|
|
147
939
|
description:string;
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* @description Indicates the type of sale carried out. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. \* retail - Transaction is a sale to an end user \* wholesale - Transaction is a sale to another company that will resell your product or service to another consumer \* vendor_use - Transaction is for an item that is subject to vendor use tax \* consumed - Transaction is for an item that is consumed directly
|
|
943
|
+
|
|
944
|
+
*/
|
|
945
|
+
|
|
148
946
|
avalara_sale_type?:AvalaraSaleType;
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* @description Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
950
|
+
|
|
951
|
+
*/
|
|
952
|
+
|
|
149
953
|
avalara_transaction_type?:number;
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* @description Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
957
|
+
|
|
958
|
+
*/
|
|
959
|
+
|
|
150
960
|
avalara_service_type?:number;
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
964
|
+
|
|
965
|
+
*/
|
|
966
|
+
|
|
151
967
|
comment?:string;
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* @description Identifier of the subscription for which this charge needs to be created. Applicable for consolidated invoice.
|
|
971
|
+
|
|
972
|
+
*/
|
|
973
|
+
|
|
152
974
|
subscription_id?:string;
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* @description Parameters for line_item
|
|
978
|
+
|
|
979
|
+
*/
|
|
980
|
+
|
|
153
981
|
line_item?:{date_from?:number,date_to?:number};
|
|
154
982
|
}
|
|
155
|
-
export interface SendEinvoiceResponse {
|
|
156
|
-
|
|
983
|
+
export interface SendEinvoiceResponse {
|
|
984
|
+
/**
|
|
985
|
+
* @description This endpoint is used to send an e-invoice for invoice.
|
|
986
|
+
|
|
987
|
+
To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
|
|
988
|
+
|
|
989
|
+
This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
|
|
990
|
+
|
|
991
|
+
* If e-invoicing is not enabled at the site and customer level.
|
|
992
|
+
|
|
993
|
+
* If there is an e-invoice generated already for the invoice.
|
|
994
|
+
|
|
995
|
+
* If the "**Use automatic e-invoicing**" option is selected.
|
|
996
|
+
|
|
997
|
+
* If there are no generated e-invoices with the `failed` or `skipped` status.
|
|
998
|
+
|
|
999
|
+
* If the invoice status is `voided` or `pending`.
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
*/
|
|
1003
|
+
|
|
1004
|
+
invoice:Invoice;
|
|
157
1005
|
}
|
|
158
1006
|
|
|
159
|
-
export interface WriteOffResponse {
|
|
160
|
-
|
|
161
|
-
|
|
1007
|
+
export interface WriteOffResponse {
|
|
1008
|
+
/**
|
|
1009
|
+
* @description This API writes off an Invoice.
|
|
1010
|
+
|
|
1011
|
+
*/
|
|
1012
|
+
|
|
1013
|
+
invoice:Invoice;
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* @description This API writes off an Invoice.
|
|
1017
|
+
|
|
1018
|
+
*/
|
|
1019
|
+
|
|
1020
|
+
credit_note:CreditNote;
|
|
162
1021
|
}
|
|
163
1022
|
export interface WriteOffInputParam {
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1026
|
+
|
|
1027
|
+
*/
|
|
1028
|
+
|
|
164
1029
|
comment?:string;
|
|
165
1030
|
}
|
|
166
|
-
export interface AddChargeItemResponse {
|
|
167
|
-
|
|
1031
|
+
export interface AddChargeItemResponse {
|
|
1032
|
+
/**
|
|
1033
|
+
* @description This endpoint is used when [metered billing](https://www.chargebee.com/docs/2.0/metered_billing.html) is enabled and it adds a [charge-item price](./item_prices?prod_cat_ver=2) to a `pending` invoice. To collect the accumulated charges by closing the invoice, call [Close a pending invoice](./invoices?prod_cat_ver=2#close_a_pending_invoice).
|
|
1034
|
+
|
|
1035
|
+
*/
|
|
1036
|
+
|
|
1037
|
+
invoice:Invoice;
|
|
168
1038
|
}
|
|
169
1039
|
export interface AddChargeItemInputParam {
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1043
|
+
|
|
1044
|
+
*/
|
|
1045
|
+
|
|
170
1046
|
comment?:string;
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* @description Identifier of the subscription for which this addon needs to be created. Applicable for consolidated invoice.
|
|
1050
|
+
|
|
1051
|
+
*/
|
|
1052
|
+
|
|
171
1053
|
subscription_id?:string;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* @description Parameters for item_price
|
|
1057
|
+
|
|
1058
|
+
*/
|
|
1059
|
+
|
|
172
1060
|
item_price?:{date_from?:number,date_to?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string};
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* @description Parameters for item_tiers
|
|
1064
|
+
|
|
1065
|
+
*/
|
|
1066
|
+
|
|
173
1067
|
item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
|
|
174
1068
|
}
|
|
175
|
-
export interface ListResponse {
|
|
176
|
-
|
|
177
|
-
|
|
1069
|
+
export interface ListResponse {
|
|
1070
|
+
/**
|
|
1071
|
+
* @description Lists all the Invoices.
|
|
1072
|
+
|
|
1073
|
+
*/
|
|
1074
|
+
|
|
1075
|
+
list:{invoice:Invoice}[];
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* @description Lists all the Invoices.
|
|
1079
|
+
|
|
1080
|
+
*/
|
|
1081
|
+
|
|
1082
|
+
next_offset?:string;
|
|
178
1083
|
}
|
|
179
1084
|
export interface ListInputParam {
|
|
180
|
-
[key : string]: any;
|
|
1085
|
+
[key : string]: any;
|
|
1086
|
+
/**
|
|
1087
|
+
* @description The number of resources to be returned.
|
|
1088
|
+
|
|
1089
|
+
*/
|
|
1090
|
+
|
|
181
1091
|
limit?:number;
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
|
|
1095
|
+
|
|
1096
|
+
*/
|
|
1097
|
+
|
|
182
1098
|
offset?:string;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \`deleted\` as \`true\`.
|
|
1102
|
+
|
|
1103
|
+
*/
|
|
1104
|
+
|
|
183
1105
|
include_deleted?:boolean;
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* @description The invoice number. Acts as a identifier for invoice and typically generated sequentially.
|
|
1109
|
+
|
|
1110
|
+
*/
|
|
1111
|
+
|
|
184
1112
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* @description To filter based on subscription_id.
|
|
1116
|
+
NOTE: Not to be used if *consolidated invoicing* is enabled.
|
|
1117
|
+
|
|
1118
|
+
*/
|
|
1119
|
+
|
|
185
1120
|
subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* @description The identifier of the customer this invoice belongs to.
|
|
1124
|
+
|
|
1125
|
+
*/
|
|
1126
|
+
|
|
186
1127
|
customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* @description Boolean indicating whether this invoice belongs to a subscription
|
|
1131
|
+
|
|
1132
|
+
*/
|
|
1133
|
+
|
|
187
1134
|
recurring?:{is?:'true' | 'false'};
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* @description Current status of this invoice.
|
|
1138
|
+
|
|
1139
|
+
*/
|
|
1140
|
+
|
|
188
1141
|
status?:{in?:string,is?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due',is_not?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due',not_in?:string};
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* @description The price type of the invoice.
|
|
1145
|
+
|
|
1146
|
+
*/
|
|
1147
|
+
|
|
189
1148
|
price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* @description The document date displayed on the invoice PDF.
|
|
1152
|
+
|
|
1153
|
+
*/
|
|
1154
|
+
|
|
190
1155
|
date?:{after?:string,before?:string,between?:string,on?:string};
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* @description Timestamp indicating the date \& time this invoice got paid.
|
|
1159
|
+
|
|
1160
|
+
*/
|
|
1161
|
+
|
|
191
1162
|
paid_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* @description Invoiced amount displayed in cents; that is, a decimal point is not present between the whole number and the decimal part. For example, $499.99 is displayed as 49999, and so on.
|
|
1166
|
+
|
|
1167
|
+
*/
|
|
1168
|
+
|
|
192
1169
|
total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* @description Payments collected successfully for the invoice. This is the sum of [linked_payments[]](invoices#invoice_linked_payments)`.txn_amount` for all `linked_payments[]` that have `txn_status` as `success`.
|
|
1173
|
+
|
|
1174
|
+
*/
|
|
1175
|
+
|
|
193
1176
|
amount_paid?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* @description Total adjustments made against this invoice.
|
|
1180
|
+
|
|
1181
|
+
*/
|
|
1182
|
+
|
|
194
1183
|
amount_adjusted?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* @description Total credits applied against this invoice.
|
|
1187
|
+
|
|
1188
|
+
*/
|
|
1189
|
+
|
|
195
1190
|
credits_applied?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* @description The unpaid amount that is due on the invoice. This is calculated as: [total](invoices#invoice_total) - [amount_paid](invoices#invoice_amount_paid) - sum of [applied_credits](invoices#invoice_applied_credits)`.applied_amount` - sum of [adjustment_credit_notes](invoices#invoice_adjustment_credit_notes)`.cn_total` - sum of [linked_taxes_withheld](invoices#invoice_linked_taxes_withheld)`.amount`.
|
|
1194
|
+
|
|
1195
|
+
*/
|
|
1196
|
+
|
|
196
1197
|
amount_due?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* @description Current dunning status of the invoice.
|
|
1201
|
+
|
|
1202
|
+
*/
|
|
1203
|
+
|
|
197
1204
|
dunning_status?:{in?:string,is?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_not?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_present?:'true' | 'false',not_in?:string};
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* @description Payment owner of an invoice
|
|
1208
|
+
|
|
1209
|
+
*/
|
|
1210
|
+
|
|
198
1211
|
payment_owner?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* @description To filter based on `updated_at`. This attribute will be present only if the resource has been updated after 2016-09-28. It is advisable when using this filter, to pass the `sort_by` input parameter as `updated_at` for a faster response.
|
|
1215
|
+
|
|
1216
|
+
*/
|
|
1217
|
+
|
|
199
1218
|
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* @description The subscription channel this object originated from and is maintained in.
|
|
1222
|
+
|
|
1223
|
+
*/
|
|
1224
|
+
|
|
200
1225
|
channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* @description Timestamp indicating the date \& time this invoice got voided.
|
|
1229
|
+
|
|
1230
|
+
*/
|
|
1231
|
+
|
|
201
1232
|
voided_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Invoices \> Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive
|
|
1236
|
+
|
|
1237
|
+
*/
|
|
1238
|
+
|
|
202
1239
|
void_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* @description Lists all the Invoices.
|
|
1243
|
+
|
|
1244
|
+
*/
|
|
1245
|
+
|
|
203
1246
|
sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* @description Parameters for einvoice
|
|
1250
|
+
|
|
1251
|
+
*/
|
|
1252
|
+
|
|
204
1253
|
einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
|
|
205
1254
|
}
|
|
206
|
-
export interface CloseResponse {
|
|
207
|
-
|
|
1255
|
+
export interface CloseResponse {
|
|
1256
|
+
/**
|
|
1257
|
+
* @description Invoices for a subscription are created with a `pending` `status` when the subscription has `create_pending_invoices` attribute set to `true`. This API call finalizes a `pending` invoice. Any `refundable_credits` and `excess_payments` for the customer are applied to the invoice, and any payment due is collected automatically if `auto_collection` is `on` for the customer.
|
|
1258
|
+
|
|
1259
|
+
#### Automation
|
|
1260
|
+
|
|
1261
|
+
This operation can be automated by using a [site setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing). Moreover, the automation can be overridden at the [customer](/docs/api/customers?prod_cat_ver=2#customer_auto_close_invoices) and [subscription](/docs/api/subscriptions?prod_cat_ver=2#subscription_auto_close_invoices) level.
|
|
1262
|
+
|
|
1263
|
+
*/
|
|
1264
|
+
|
|
1265
|
+
invoice:Invoice;
|
|
208
1266
|
}
|
|
209
1267
|
export interface CloseInputParam {
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1271
|
+
|
|
1272
|
+
*/
|
|
1273
|
+
|
|
210
1274
|
comment?:string;
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* @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.
|
|
1278
|
+
|
|
1279
|
+
*/
|
|
1280
|
+
|
|
211
1281
|
invoice_note?:string;
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* @description Set as `true` to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
|
|
1285
|
+
|
|
1286
|
+
*/
|
|
1287
|
+
|
|
212
1288
|
remove_general_note?:boolean;
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* @description Set the [invoice date](https://apidocs.chargebee.com/docs/api/invoices#invoice_date). Must lie between the date when the invoice was generated and current date. Can only be passed when the site setting to allow overriding is enabled. If not passed, then the default value [set at the site level](https://www.chargebee.com/docs/metered_billing.html#overview) is used.
|
|
1292
|
+
|
|
1293
|
+
*/
|
|
1294
|
+
|
|
213
1295
|
invoice_date?:number;
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* @description Parameters for notes_to_remove
|
|
1299
|
+
|
|
1300
|
+
*/
|
|
1301
|
+
|
|
214
1302
|
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
215
1303
|
}
|
|
216
|
-
export interface ApplyCreditsResponse {
|
|
217
|
-
|
|
1304
|
+
export interface ApplyCreditsResponse {
|
|
1305
|
+
/**
|
|
1306
|
+
* @description This API applies [available credits](customers#customer_balances) to an invoice. After credits are applied, [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice status changes to either `paid` or `payment_due` depending on how much credit is applied to the invoice amount.
|
|
1307
|
+
|
|
1308
|
+
*/
|
|
1309
|
+
|
|
1310
|
+
invoice:Invoice;
|
|
218
1311
|
}
|
|
219
1312
|
export interface ApplyCreditsInputParam {
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1316
|
+
|
|
1317
|
+
*/
|
|
1318
|
+
|
|
220
1319
|
comment?:string;
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* @description Parameters for credit_notes
|
|
1323
|
+
|
|
1324
|
+
*/
|
|
1325
|
+
|
|
221
1326
|
credit_notes?:{id?:string}[];
|
|
222
1327
|
}
|
|
223
|
-
export interface RetrieveResponse {
|
|
224
|
-
|
|
1328
|
+
export interface RetrieveResponse {
|
|
1329
|
+
/**
|
|
1330
|
+
* @description Retrieve the invoice for the specified invoice id.
|
|
1331
|
+
|
|
1332
|
+
*/
|
|
1333
|
+
|
|
1334
|
+
invoice:Invoice;
|
|
225
1335
|
}
|
|
226
1336
|
|
|
227
|
-
export interface CreateForChargeItemsAndChargesResponse {
|
|
228
|
-
|
|
1337
|
+
export interface CreateForChargeItemsAndChargesResponse {
|
|
1338
|
+
/**
|
|
1339
|
+
* @description Creates an invoice for [charge-items](./items?prod_cat_ver=2) and [one-time charges](https://www.chargebee.com/docs/2.0/charges.html). The item prices must belong to items of `type` `charge`.
|
|
1340
|
+
|
|
1341
|
+
*/
|
|
1342
|
+
|
|
1343
|
+
invoice:Invoice;
|
|
229
1344
|
}
|
|
230
1345
|
export interface CreateForChargeItemsAndChargesInputParam {
|
|
1346
|
+
|
|
1347
|
+
/**
|
|
1348
|
+
* @description Unique ID of the customer this invoice should be created for. Either this or `subscription_id` must be provided.
|
|
1349
|
+
**Note**
|
|
1350
|
+
|
|
1351
|
+
The invoice is [linked](/docs/api?prod_cat_ver=2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver=2#mbe) as this customer.
|
|
1352
|
+
.
|
|
1353
|
+
|
|
1354
|
+
*/
|
|
1355
|
+
|
|
231
1356
|
customer_id?:string;
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* @description Unique ID of the subscription this invoice should be created for. Either this or `customer_id` must be provided.
|
|
1360
|
+
**Note**
|
|
1361
|
+
|
|
1362
|
+
The invoice is [linked](/docs/api?prod_cat_ver=2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver=2#mbe) as this subscription.
|
|
1363
|
+
.
|
|
1364
|
+
|
|
1365
|
+
*/
|
|
1366
|
+
|
|
232
1367
|
subscription_id?:string;
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* @description The currency code (ISO 4217 format) of the invoice amount.
|
|
1371
|
+
|
|
1372
|
+
*/
|
|
1373
|
+
|
|
233
1374
|
currency_code?:string;
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* @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.
|
|
1378
|
+
|
|
1379
|
+
*/
|
|
1380
|
+
|
|
234
1381
|
invoice_note?:string;
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* @description Set as `true` to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
|
|
1385
|
+
|
|
1386
|
+
*/
|
|
1387
|
+
|
|
235
1388
|
remove_general_note?:boolean;
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1391
|
+
* @description Purchase Order Number for this invoice.
|
|
1392
|
+
|
|
1393
|
+
*/
|
|
1394
|
+
|
|
236
1395
|
po_number?:string;
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* @description List of Coupons to be added.
|
|
1399
|
+
|
|
1400
|
+
*/
|
|
1401
|
+
|
|
237
1402
|
coupon_ids?:string[];
|
|
1403
|
+
|
|
1404
|
+
/**
|
|
1405
|
+
* @description Authorization transaction to be captured.
|
|
1406
|
+
|
|
1407
|
+
*/
|
|
1408
|
+
|
|
238
1409
|
authorization_transaction_id?:string;
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* @description Payment source to be used for this payment.
|
|
1413
|
+
|
|
1414
|
+
*/
|
|
1415
|
+
|
|
239
1416
|
payment_source_id?:string;
|
|
1417
|
+
|
|
1418
|
+
/**
|
|
1419
|
+
* @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.
|
|
1420
|
+
|
|
1421
|
+
*/
|
|
1422
|
+
|
|
240
1423
|
auto_collection?:AutoCollection;
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* @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.
|
|
1427
|
+
|
|
1428
|
+
*/
|
|
1429
|
+
|
|
241
1430
|
invoice_date?:number;
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
* @description Token generated by Chargebee JS representing payment method details.
|
|
1434
|
+
|
|
1435
|
+
*/
|
|
1436
|
+
|
|
242
1437
|
token_id?:string;
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* @description Indicates whether the primary payment source should be replaced with this payment source. In case of Create Subscription for Customer endpoint, the default value is True. Otherwise, the default value is False.
|
|
1441
|
+
|
|
1442
|
+
*/
|
|
1443
|
+
|
|
243
1444
|
replace_primary_payment_source?:boolean;
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* @description Indicates whether the payment source should be retained for the customer.
|
|
1448
|
+
|
|
1449
|
+
*/
|
|
1450
|
+
|
|
244
1451
|
retain_payment_source?:boolean;
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* @description Parameters for shipping_address
|
|
1455
|
+
|
|
1456
|
+
*/
|
|
1457
|
+
|
|
245
1458
|
shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* @description Parameters for card
|
|
1462
|
+
|
|
1463
|
+
*/
|
|
1464
|
+
|
|
246
1465
|
card?:{additional_information?:object,billing_addr1?:string,billing_addr2?:string,billing_city?:string,billing_country?:string,billing_state?:string,billing_state_code?:string,billing_zip?:string,cvv?:string,expiry_month?:number,expiry_year?:number,first_name?:string,gateway_account_id?:string,last_name?:string,number?:string};
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* @description Parameters for bank_account
|
|
1469
|
+
|
|
1470
|
+
*/
|
|
1471
|
+
|
|
247
1472
|
bank_account?:{account_holder_type?:AccountHolderType,account_number?:string,account_type?:AccountType,bank_code?:string,bank_name?:string,billing_address?:object,company?:string,echeck_type?:EcheckType,email?:string,first_name?:string,gateway_account_id?:string,iban?:string,issuing_country?:string,last_name?:string,phone?:string,routing_number?:string,swedish_identity_number?:string};
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* @description Parameters for payment_method
|
|
1476
|
+
|
|
1477
|
+
*/
|
|
1478
|
+
|
|
248
1479
|
payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* @description Parameters for payment_intent
|
|
1483
|
+
|
|
1484
|
+
*/
|
|
1485
|
+
|
|
249
1486
|
payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'sofort' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'card',reference_id?:string};
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* @description Parameters for item_prices
|
|
1490
|
+
|
|
1491
|
+
*/
|
|
1492
|
+
|
|
250
1493
|
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}[];
|
|
1494
|
+
|
|
1495
|
+
/**
|
|
1496
|
+
* @description Parameters for item_tiers
|
|
1497
|
+
|
|
1498
|
+
*/
|
|
1499
|
+
|
|
251
1500
|
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}[];
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* @description Parameters for charges
|
|
1504
|
+
|
|
1505
|
+
*/
|
|
1506
|
+
|
|
252
1507
|
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}[];
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* @description Parameters for notes_to_remove
|
|
1511
|
+
|
|
1512
|
+
*/
|
|
1513
|
+
|
|
253
1514
|
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
1515
|
+
|
|
1516
|
+
/**
|
|
1517
|
+
* @description Parameters for discounts
|
|
1518
|
+
|
|
1519
|
+
*/
|
|
1520
|
+
|
|
254
1521
|
discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
|
|
255
1522
|
}
|
|
256
|
-
export interface UpdateDetailsResponse {
|
|
257
|
-
|
|
1523
|
+
export interface UpdateDetailsResponse {
|
|
1524
|
+
/**
|
|
1525
|
+
* @description This API allows you to update the invoice Billing/Shipping address, VAT and PO number. During this operation if Billing Info (Billing Address, vat_number), Shipping info and PO number are not already present in the system the data will be added. If data is already present, the existing values will be replaced. If info is present in the system, but not passed as part of the request, the info will not be removed from the system.
|
|
1526
|
+
|
|
1527
|
+
**Note:** Incase, tax is already applied will now vary due to address change, you cannot update the address. You cannot update the VAT Number if the billing address is not present in the API request.This will update the invoice only, it won't change the corresponding customer/subscription details.
|
|
1528
|
+
|
|
1529
|
+
*/
|
|
1530
|
+
|
|
1531
|
+
invoice:Invoice;
|
|
258
1532
|
}
|
|
259
1533
|
export interface UpdateDetailsInputParam {
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* @description VAT/ Tax registration number of the customer. [Learn more](https://www.chargebee.com/docs/tax.html#capture-tax-registration-number).
|
|
1537
|
+
|
|
1538
|
+
*/
|
|
1539
|
+
|
|
260
1540
|
vat_number?:string;
|
|
1541
|
+
|
|
1542
|
+
/**
|
|
1543
|
+
* @description An overridden value for the first two characters of the [full VAT
|
|
1544
|
+
number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
|
|
1545
|
+
|
|
1546
|
+
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1547
|
+
enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting [billing_address](customers#customer_billing_address) `country` as `XI`. That's the code for **United Kingdom - Northern
|
|
1548
|
+
Ireland** . The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
|
|
1549
|
+
|
|
1550
|
+
*/
|
|
1551
|
+
|
|
261
1552
|
vat_number_prefix?:string;
|
|
1553
|
+
|
|
1554
|
+
/**
|
|
1555
|
+
* @description Purchase Order Number for this invoice.
|
|
1556
|
+
|
|
1557
|
+
*/
|
|
1558
|
+
|
|
262
1559
|
po_number?:string;
|
|
1560
|
+
|
|
1561
|
+
/**
|
|
1562
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1563
|
+
|
|
1564
|
+
*/
|
|
1565
|
+
|
|
263
1566
|
comment?:string;
|
|
1567
|
+
|
|
1568
|
+
/**
|
|
1569
|
+
* @description Parameters for billing_address
|
|
1570
|
+
|
|
1571
|
+
*/
|
|
1572
|
+
|
|
264
1573
|
billing_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* @description Parameters for shipping_address
|
|
1577
|
+
|
|
1578
|
+
*/
|
|
1579
|
+
|
|
265
1580
|
shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
266
1581
|
}
|
|
267
|
-
export interface RecordPaymentResponse {
|
|
268
|
-
|
|
269
|
-
|
|
1582
|
+
export interface RecordPaymentResponse {
|
|
1583
|
+
/**
|
|
1584
|
+
* @description To record a [offline payment](https://www.chargebee.com/docs/offline_payments.html) for an invoice.
|
|
1585
|
+
|
|
1586
|
+
The invoice status will be marked as 'paid' if its amount due becomes 0 because of this recorded payment.
|
|
1587
|
+
|
|
1588
|
+
**Note:** If the payment transaction amount is more than the invoice due amount, the remaining transaction amount will be added to the customer's Excess Payments balance to be used against other invoices.
|
|
1589
|
+
|
|
1590
|
+
*/
|
|
1591
|
+
|
|
1592
|
+
invoice:Invoice;
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* @description To record a [offline payment](https://www.chargebee.com/docs/offline_payments.html) for an invoice.
|
|
1596
|
+
|
|
1597
|
+
The invoice status will be marked as 'paid' if its amount due becomes 0 because of this recorded payment.
|
|
1598
|
+
|
|
1599
|
+
**Note:** If the payment transaction amount is more than the invoice due amount, the remaining transaction amount will be added to the customer's Excess Payments balance to be used against other invoices.
|
|
1600
|
+
|
|
1601
|
+
*/
|
|
1602
|
+
|
|
1603
|
+
transaction:Transaction;
|
|
270
1604
|
}
|
|
271
1605
|
export interface RecordPaymentInputParam {
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* @description Remarks, if any, on the payment.
|
|
1609
|
+
|
|
1610
|
+
*/
|
|
1611
|
+
|
|
272
1612
|
comment?:string;
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
* @description Parameters for transaction
|
|
1616
|
+
|
|
1617
|
+
*/
|
|
1618
|
+
|
|
273
1619
|
transaction?:{amount?:number,date?:number,error_code?:string,error_text?:string,id_at_gateway?:string,payment_method:PaymentMethod,reference_number?:string,status?:'success' | 'failure'};
|
|
274
1620
|
}
|
|
275
|
-
export interface DeleteResponse {
|
|
276
|
-
|
|
1621
|
+
export interface DeleteResponse {
|
|
1622
|
+
/**
|
|
1623
|
+
* @description Deletes the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before deleting it.
|
|
1624
|
+
**Caution**
|
|
1625
|
+
|
|
1626
|
+
All associated [usages](/docs/api/usages?prod_cat_ver=2) are permanently deleted on deleting an invoice. If you want to regenerate such an invoice, [add](/docs/api/usages?prod_cat_ver=2#create_a_usage) or [bulk import](https://www.chargebee.com/docs/2.0/bulk-operations.html#overview_available-bulk-operations) usages before invoice regeneration.
|
|
1627
|
+
|
|
1628
|
+
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
1629
|
+
* If an invoice for the current term of a subscription is deleted and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
1630
|
+
|
|
1631
|
+
*/
|
|
1632
|
+
|
|
1633
|
+
invoice:Invoice;
|
|
277
1634
|
}
|
|
278
1635
|
export interface DeleteInputParam {
|
|
1636
|
+
|
|
1637
|
+
/**
|
|
1638
|
+
* @description Reason for deleting the invoice. This comment will be added to the subscription entity if the invoice belongs to a subscription. It is added to the customer entity if the invoice is associated only with a customer.
|
|
1639
|
+
|
|
1640
|
+
*/
|
|
1641
|
+
|
|
279
1642
|
comment?:string;
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* @description Indicates whether to put prorated credits back to the subscription or ignore while deleting the invoice.
|
|
1646
|
+
|
|
1647
|
+
*/
|
|
1648
|
+
|
|
280
1649
|
claim_credits?:boolean;
|
|
281
1650
|
}
|
|
282
|
-
export interface ImportInvoiceResponse {
|
|
283
|
-
|
|
284
|
-
|
|
1651
|
+
export interface ImportInvoiceResponse {
|
|
1652
|
+
/**
|
|
1653
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1654
|
+
|
|
1655
|
+
*/
|
|
1656
|
+
|
|
1657
|
+
invoice:Invoice;
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1661
|
+
|
|
1662
|
+
*/
|
|
1663
|
+
|
|
1664
|
+
credit_note?:CreditNote;
|
|
285
1665
|
}
|
|
286
1666
|
export interface ImportInvoiceInputParam {
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* @description Invoice Number.
|
|
1670
|
+
|
|
1671
|
+
*/
|
|
1672
|
+
|
|
287
1673
|
id:string;
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* @description The currency code (ISO 4217 format) for the invoice.
|
|
1677
|
+
|
|
1678
|
+
*/
|
|
1679
|
+
|
|
288
1680
|
currency_code?:string;
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* @description Identifier of the customer for which this invoice needs to be created.
|
|
1684
|
+
|
|
1685
|
+
*/
|
|
1686
|
+
|
|
289
1687
|
customer_id?:string;
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* @description If recurring items are present in line items then subscription id is required.
|
|
1691
|
+
|
|
1692
|
+
*/
|
|
1693
|
+
|
|
290
1694
|
subscription_id?:string;
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* @description Purchase Order Number for this invoice.
|
|
1698
|
+
|
|
1699
|
+
*/
|
|
1700
|
+
|
|
291
1701
|
po_number?:string;
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* @description The price type of the invoice. \* tax_inclusive - All amounts in the document are inclusive of tax. \* tax_exclusive - All amounts in the document are exclusive of tax.
|
|
1705
|
+
|
|
1706
|
+
*/
|
|
1707
|
+
|
|
292
1708
|
price_type?:PriceType;
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* @description The reason for exempting the invoice from tax. (Applicable only for exempted invoices.). \* export - The customer is from a non-taxable region or the billing address and shipping address are unavailable. \* customer_exempt - The customer is [exempted](customers#customer_taxability) from tax. \* id_exempt - The customer is from a different country than your business and they have a valid VAT number or, the customer is a business entity. (This reason is only applicable when [EU VAT](https://www.chargebee.com/docs/eu-vat.html) or [UK VAT](https://www.chargebee.com/docs/uk-vat.html) is enabled.)
|
|
1712
|
+
|
|
1713
|
+
*/
|
|
1714
|
+
|
|
293
1715
|
tax_override_reason?:TaxOverrideReason;
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* @description Vat Number. Required if this invoice is VAT exempted.
|
|
1719
|
+
|
|
1720
|
+
*/
|
|
1721
|
+
|
|
294
1722
|
vat_number?:string;
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* @description An overridden value for the first two characters of the [full VAT
|
|
1726
|
+
number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
|
|
1727
|
+
|
|
1728
|
+
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1729
|
+
enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting [billing_address](customers#customer_billing_address) `country` as `XI`. That's the code for **United Kingdom - Northern
|
|
1730
|
+
Ireland** . The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
|
|
1731
|
+
|
|
1732
|
+
*/
|
|
1733
|
+
|
|
295
1734
|
vat_number_prefix?:string;
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* @description Date when invoice raised.
|
|
1738
|
+
|
|
1739
|
+
*/
|
|
1740
|
+
|
|
296
1741
|
date:number;
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* @description Invoice total amount.
|
|
1745
|
+
|
|
1746
|
+
*/
|
|
1747
|
+
|
|
297
1748
|
total:number;
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* @description Round off amount.
|
|
1752
|
+
|
|
1753
|
+
*/
|
|
1754
|
+
|
|
298
1755
|
round_off?:number;
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* @description Current status of this invoice. \* pending -
|
|
1759
|
+
The [invoice](/docs/api/invoices?prod_cat_ver=2#invoice_status) is yet to be closed (sent for payment collection). An invoice is generated with this `status` when it has line items that belong to items that are `metered` or when the `subscription.create_pending_invoices`attribute is set to `true`.
|
|
1760
|
+
The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to be closed (sent for payment collection). All invoices are generated with this `status` when [Metered Billing](https://www.chargebee.com/docs/1.0/metered_billing.html) is enabled for the site. \* not_paid - Indicates the payment is not made and all attempts to collect is failed. \* payment_due - Indicates the payment is not yet collected and is being retried as per retry settings. \* voided - Indicates a voided invoice. \* paid - Indicates a paid invoice. \* posted - Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period
|
|
1761
|
+
|
|
1762
|
+
*/
|
|
1763
|
+
|
|
299
1764
|
status?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
|
|
1765
|
+
|
|
1766
|
+
/**
|
|
1767
|
+
* @description Timestamp indicating the date \& time this invoice got voided.
|
|
1768
|
+
|
|
1769
|
+
*/
|
|
1770
|
+
|
|
300
1771
|
voided_at?:number;
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Invoices \> Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
1775
|
+
|
|
1776
|
+
*/
|
|
1777
|
+
|
|
301
1778
|
void_reason_code?:string;
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1782
|
+
|
|
1783
|
+
*/
|
|
1784
|
+
|
|
302
1785
|
is_written_off?:boolean;
|
|
1786
|
+
|
|
1787
|
+
/**
|
|
1788
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1789
|
+
|
|
1790
|
+
*/
|
|
1791
|
+
|
|
303
1792
|
write_off_amount?:number;
|
|
1793
|
+
|
|
1794
|
+
/**
|
|
1795
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1796
|
+
|
|
1797
|
+
*/
|
|
1798
|
+
|
|
304
1799
|
write_off_date?:number;
|
|
1800
|
+
|
|
1801
|
+
/**
|
|
1802
|
+
* @description Invoice Due Date.
|
|
1803
|
+
|
|
1804
|
+
*/
|
|
1805
|
+
|
|
305
1806
|
due_date?:number;
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* @description Invoice net term days.
|
|
1810
|
+
|
|
1811
|
+
*/
|
|
1812
|
+
|
|
306
1813
|
net_term_days?:number;
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1817
|
+
|
|
1818
|
+
*/
|
|
1819
|
+
|
|
307
1820
|
has_advance_charges?:boolean;
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* @description If the invoice falls within the subscription current term will be used for proration.
|
|
1824
|
+
|
|
1825
|
+
*/
|
|
1826
|
+
|
|
308
1827
|
use_for_proration?:boolean;
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1831
|
+
|
|
1832
|
+
*/
|
|
1833
|
+
|
|
309
1834
|
credit_note?:{id?:string};
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* @description Parameters for billing_address
|
|
1838
|
+
|
|
1839
|
+
*/
|
|
1840
|
+
|
|
310
1841
|
billing_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* @description Parameters for shipping_address
|
|
1845
|
+
|
|
1846
|
+
*/
|
|
1847
|
+
|
|
311
1848
|
shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* @description Parameters for line_items
|
|
1852
|
+
|
|
1853
|
+
*/
|
|
1854
|
+
|
|
312
1855
|
line_items?:{amount?:number,amount_in_decimal?:string,date_from?:number,date_to?:number,description:string,entity_id?:string,entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc',id?:string,item_level_discount1_amount?:number,item_level_discount1_entity_id?:string,item_level_discount2_amount?:number,item_level_discount2_entity_id?:string,quantity?:number,quantity_in_decimal?:string,subscription_id?:string,tax10_amount?:number,tax10_name?:string,tax1_amount?:number,tax1_name?:string,tax2_amount?:number,tax2_name?:string,tax3_amount?:number,tax3_name?:string,tax4_amount?:number,tax4_name?:string,tax5_amount?:number,tax5_name?:string,tax6_amount?:number,tax6_name?:string,tax7_amount?:number,tax7_name?:string,tax8_amount?:number,tax8_name?:string,tax9_amount?:number,tax9_name?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1859
|
+
|
|
1860
|
+
*/
|
|
1861
|
+
|
|
313
1862
|
payment_reference_numbers?:{id?:string,number:string,type:'frn' | 'kid' | 'fik' | 'ocr'}[];
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* @description Parameters for line_item_tiers
|
|
1866
|
+
|
|
1867
|
+
*/
|
|
1868
|
+
|
|
314
1869
|
line_item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,line_item_id:string,quantity_used?:number,quantity_used_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* @description Parameters for discounts
|
|
1873
|
+
|
|
1874
|
+
*/
|
|
1875
|
+
|
|
315
1876
|
discounts?:{amount:number,description?:string,entity_id?:string,entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'document_level_discount' | 'document_level_coupon',line_item_id?:string}[];
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* @description Parameters for taxes
|
|
1880
|
+
|
|
1881
|
+
*/
|
|
1882
|
+
|
|
316
1883
|
taxes?:{amount?:number,description?:string,juris_code?:string,juris_name?:string,juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state',name:string,rate:number}[];
|
|
1884
|
+
|
|
1885
|
+
/**
|
|
1886
|
+
* @description Parameters for payments
|
|
1887
|
+
|
|
1888
|
+
*/
|
|
1889
|
+
|
|
317
1890
|
payments?:{amount:number,date?:number,payment_method:PaymentMethod,reference_number?:string}[];
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* @description Parameters for notes
|
|
1894
|
+
|
|
1895
|
+
*/
|
|
1896
|
+
|
|
318
1897
|
notes?:{entity_id?:string,entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price',note?:string}[];
|
|
319
1898
|
}
|
|
320
|
-
export interface RecordTaxWithheldResponse {
|
|
321
|
-
|
|
1899
|
+
export interface RecordTaxWithheldResponse {
|
|
1900
|
+
/**
|
|
1901
|
+
* @description Records [tax_withheld](/docs/api/tax_withheld) by the customer against the invoice specified. This operation is allowed only when all of the following conditions are true:
|
|
1902
|
+
|
|
1903
|
+
* Tax Amount Withheld is enabled.
|
|
1904
|
+
* The `invoice` does not have a `linked_taxes_withheld` record associated with it already.
|
|
1905
|
+
* `invoice.amount_due` is greater than zero.
|
|
1906
|
+
* `invoice.status` is one of the following: `payment_due`, `not_paid`, or `posted`.
|
|
1907
|
+
|
|
1908
|
+
*/
|
|
1909
|
+
|
|
1910
|
+
invoice:Invoice;
|
|
322
1911
|
}
|
|
323
1912
|
export interface RecordTaxWithheldInputParam {
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* @description Parameters for tax_withheld
|
|
1916
|
+
|
|
1917
|
+
*/
|
|
1918
|
+
|
|
324
1919
|
tax_withheld?:{amount:number,date?:number,description?:string,reference_number?:string};
|
|
325
1920
|
}
|
|
326
|
-
export interface ResendEinvoiceResponse {
|
|
327
|
-
|
|
1921
|
+
export interface ResendEinvoiceResponse {
|
|
1922
|
+
/**
|
|
1923
|
+
* @description Resend failed einvoice of an invoice to the customer using this API.
|
|
1924
|
+
|
|
1925
|
+
*/
|
|
1926
|
+
|
|
1927
|
+
invoice:Invoice;
|
|
328
1928
|
}
|
|
329
1929
|
|
|
330
|
-
export interface RemoveTaxWithheldResponse {
|
|
331
|
-
|
|
1930
|
+
export interface RemoveTaxWithheldResponse {
|
|
1931
|
+
/**
|
|
1932
|
+
* @description Removes a [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld) record from the `invoice` specified. This operation is allowed only when all of the following conditions are true:
|
|
1933
|
+
|
|
1934
|
+
* [invoice.status](/docs/api/invoices#invoice_status) is one of the following: `payment_due`, `not_paid`, or `posted`.
|
|
1935
|
+
* There are no [adjustment_credit_notes](/docs/api/invoices#invoice_adjustment_credit_notes) associated with the invoice.
|
|
1936
|
+
* There are no [issued_credit_notes](/docs/api/invoices#invoice_issued_credit_notes) associated with the invoice.
|
|
1937
|
+
|
|
1938
|
+
*/
|
|
1939
|
+
|
|
1940
|
+
invoice:Invoice;
|
|
332
1941
|
}
|
|
333
1942
|
export interface RemoveTaxWithheldInputParam {
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* @description Parameters for tax_withheld
|
|
1946
|
+
|
|
1947
|
+
*/
|
|
1948
|
+
|
|
334
1949
|
tax_withheld?:{id:string};
|
|
335
1950
|
}
|
|
336
|
-
export interface ListPaymentReferenceNumbersResponse {
|
|
337
|
-
|
|
338
|
-
|
|
1951
|
+
export interface ListPaymentReferenceNumbersResponse {
|
|
1952
|
+
/**
|
|
1953
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1954
|
+
|
|
1955
|
+
*/
|
|
1956
|
+
|
|
1957
|
+
list:{payment_reference_number:PaymentReferenceNumber}[];
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1961
|
+
|
|
1962
|
+
*/
|
|
1963
|
+
|
|
1964
|
+
next_offset?:string;
|
|
339
1965
|
}
|
|
340
1966
|
export interface ListPaymentReferenceNumbersInputParam {
|
|
341
|
-
[key : string]: any;
|
|
1967
|
+
[key : string]: any;
|
|
1968
|
+
/**
|
|
1969
|
+
* @description The number of resources to be returned.
|
|
1970
|
+
|
|
1971
|
+
*/
|
|
1972
|
+
|
|
342
1973
|
limit?:number;
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
|
|
1977
|
+
|
|
1978
|
+
*/
|
|
1979
|
+
|
|
343
1980
|
offset?:string;
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* @description An unique identifier for the invoice serves that links the invoice to the corresponding payment reference number (PRN).
|
|
1984
|
+
**Note**: To retrieve the PRN, the API requires either the invoice ID or the payment reference number to be provided by the user. If both values are missing, an error will be returned by the API.
|
|
1985
|
+
|
|
1986
|
+
*/
|
|
1987
|
+
|
|
344
1988
|
id?:{in?:string,is?:string};
|
|
1989
|
+
|
|
1990
|
+
/**
|
|
1991
|
+
* @description Parameters for payment_reference_number
|
|
1992
|
+
|
|
1993
|
+
*/
|
|
1994
|
+
|
|
345
1995
|
payment_reference_number?:{number?:{in?:string,is?:string}};
|
|
346
1996
|
}
|
|
347
|
-
export interface CollectPaymentResponse {
|
|
348
|
-
|
|
349
|
-
|
|
1997
|
+
export interface CollectPaymentResponse {
|
|
1998
|
+
/**
|
|
1999
|
+
* @description Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
|
|
2000
|
+
|
|
2001
|
+
This API is used to collect payments for `payment_due` and `not_paid` invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
|
|
2002
|
+
|
|
2003
|
+
Pass `authorization_transaction_id` to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as `payment_due`.
|
|
2004
|
+
|
|
2005
|
+
*/
|
|
2006
|
+
|
|
2007
|
+
invoice:Invoice;
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* @description Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
|
|
2011
|
+
|
|
2012
|
+
This API is used to collect payments for `payment_due` and `not_paid` invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
|
|
2013
|
+
|
|
2014
|
+
Pass `authorization_transaction_id` to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as `payment_due`.
|
|
2015
|
+
|
|
2016
|
+
*/
|
|
2017
|
+
|
|
2018
|
+
transaction:Transaction;
|
|
350
2019
|
}
|
|
351
2020
|
export interface CollectPaymentInputParam {
|
|
2021
|
+
|
|
2022
|
+
/**
|
|
2023
|
+
* @description Amount to be collected. If this parameter is not passed then the entire amount due will be collected.
|
|
2024
|
+
|
|
2025
|
+
*/
|
|
2026
|
+
|
|
352
2027
|
amount?:number;
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* @description Authorization transaction to be captured.
|
|
2031
|
+
|
|
2032
|
+
*/
|
|
2033
|
+
|
|
353
2034
|
authorization_transaction_id?:string;
|
|
2035
|
+
|
|
2036
|
+
/**
|
|
2037
|
+
* @description Payment source to be used for this payment.
|
|
2038
|
+
|
|
2039
|
+
*/
|
|
2040
|
+
|
|
354
2041
|
payment_source_id?:string;
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
2045
|
+
|
|
2046
|
+
*/
|
|
2047
|
+
|
|
355
2048
|
comment?:string;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* @description null
|
|
2052
|
+
|
|
2053
|
+
*/
|
|
2054
|
+
|
|
2055
|
+
payment_initiator?:PaymentInitiator;
|
|
2056
|
+
}
|
|
2057
|
+
export interface SyncUsagesResponse {
|
|
2058
|
+
/**
|
|
2059
|
+
* @description Updates the [`quantity`](/docs/api/invoices#invoice_line_items_quantity) for `metered` [`line_items`](/docs/api/invoices#invoice_line_items) of an invoice to reflect the latest [usage](https://apidocs.chargebee.com/docs/api/usages) data.
|
|
2060
|
+
|
|
2061
|
+
**Note:** This operation is done automatically while [closing](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice) the invoice.
|
|
2062
|
+
|
|
2063
|
+
*/
|
|
2064
|
+
|
|
2065
|
+
invoice:Invoice;
|
|
360
2066
|
}
|
|
361
2067
|
|
|
362
|
-
export interface RefundResponse {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
2068
|
+
export interface RefundResponse {
|
|
2069
|
+
/**
|
|
2070
|
+
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
2071
|
+
|
|
2072
|
+
* Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
|
|
2073
|
+
* Refund a fully refunded invoice.
|
|
2074
|
+
|
|
2075
|
+
If the refund transaction succeeds, a `credit_note` capturing this refund detail is created for the invoice.
|
|
2076
|
+
|
|
2077
|
+
*/
|
|
2078
|
+
|
|
2079
|
+
invoice:Invoice;
|
|
2080
|
+
|
|
2081
|
+
/**
|
|
2082
|
+
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
2083
|
+
|
|
2084
|
+
* Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
|
|
2085
|
+
* Refund a fully refunded invoice.
|
|
2086
|
+
|
|
2087
|
+
If the refund transaction succeeds, a `credit_note` capturing this refund detail is created for the invoice.
|
|
2088
|
+
|
|
2089
|
+
*/
|
|
2090
|
+
|
|
2091
|
+
transaction:Transaction;
|
|
2092
|
+
|
|
2093
|
+
/**
|
|
2094
|
+
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
2095
|
+
|
|
2096
|
+
* Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
|
|
2097
|
+
* Refund a fully refunded invoice.
|
|
2098
|
+
|
|
2099
|
+
If the refund transaction succeeds, a `credit_note` capturing this refund detail is created for the invoice.
|
|
2100
|
+
|
|
2101
|
+
*/
|
|
2102
|
+
|
|
2103
|
+
credit_note?:CreditNote;
|
|
366
2104
|
}
|
|
367
2105
|
export interface RefundInputParam {
|
|
2106
|
+
|
|
2107
|
+
/**
|
|
2108
|
+
* @description The amount to be refunded. If not specified, the entire refundable amount for this invoice is refunded. The refundable amount is the total amount paid via online `transaction`s, and not already refunded. **Note:** Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld) associated with the invoice cannot be refunded via this operation.
|
|
2109
|
+
|
|
2110
|
+
*/
|
|
2111
|
+
|
|
368
2112
|
refund_amount?:number;
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* @description Comment, if any, on the refund.
|
|
2116
|
+
|
|
2117
|
+
*/
|
|
2118
|
+
|
|
369
2119
|
comment?:string;
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* @description The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
|
|
2123
|
+
|
|
2124
|
+
*/
|
|
2125
|
+
|
|
370
2126
|
customer_notes?:string;
|
|
2127
|
+
|
|
2128
|
+
/**
|
|
2129
|
+
* @description Parameters for credit_note
|
|
2130
|
+
|
|
2131
|
+
*/
|
|
2132
|
+
|
|
371
2133
|
credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver'};
|
|
372
2134
|
}
|
|
373
|
-
export interface RecordRefundResponse {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
2135
|
+
export interface RecordRefundResponse {
|
|
2136
|
+
/**
|
|
2137
|
+
* @description Refunds the invoice. The refund is provided against the following in order of precedence:
|
|
2138
|
+
|
|
2139
|
+
* Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2140
|
+
* Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
|
|
2141
|
+
* Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2142
|
+
|
|
2143
|
+
**Example**
|
|
2144
|
+
|
|
2145
|
+
Consider an invoice with the following payments and tax withheld.
|
|
2146
|
+
|
|
2147
|
+
* Offline payments: $30
|
|
2148
|
+
* Online payments: $20
|
|
2149
|
+
* Tax withheld: $5
|
|
2150
|
+
|
|
2151
|
+
When recording a refund worth $40, the refund amount is split as follows:
|
|
2152
|
+
|
|
2153
|
+
* Refund against offline payments: $30
|
|
2154
|
+
* Refund against tax withheld: $5
|
|
2155
|
+
* Refund against online payments: $5
|
|
2156
|
+
|
|
2157
|
+
For payments made via online transactions, the [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer.
|
|
2158
|
+
**Tip**
|
|
2159
|
+
|
|
2160
|
+
If the order of precendence described above does not work for your use case, and you want to provide a refund against online `linked_payments` first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
|
|
2161
|
+
|
|
2162
|
+
*/
|
|
2163
|
+
|
|
2164
|
+
invoice:Invoice;
|
|
2165
|
+
|
|
2166
|
+
/**
|
|
2167
|
+
* @description Refunds the invoice. The refund is provided against the following in order of precedence:
|
|
2168
|
+
|
|
2169
|
+
* Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2170
|
+
* Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
|
|
2171
|
+
* Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2172
|
+
|
|
2173
|
+
**Example**
|
|
2174
|
+
|
|
2175
|
+
Consider an invoice with the following payments and tax withheld.
|
|
2176
|
+
|
|
2177
|
+
* Offline payments: $30
|
|
2178
|
+
* Online payments: $20
|
|
2179
|
+
* Tax withheld: $5
|
|
2180
|
+
|
|
2181
|
+
When recording a refund worth $40, the refund amount is split as follows:
|
|
2182
|
+
|
|
2183
|
+
* Refund against offline payments: $30
|
|
2184
|
+
* Refund against tax withheld: $5
|
|
2185
|
+
* Refund against online payments: $5
|
|
2186
|
+
|
|
2187
|
+
For payments made via online transactions, the [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer.
|
|
2188
|
+
**Tip**
|
|
2189
|
+
|
|
2190
|
+
If the order of precendence described above does not work for your use case, and you want to provide a refund against online `linked_payments` first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
|
|
2191
|
+
|
|
2192
|
+
*/
|
|
2193
|
+
|
|
2194
|
+
transaction?:Transaction;
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* @description Refunds the invoice. The refund is provided against the following in order of precedence:
|
|
2198
|
+
|
|
2199
|
+
* Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2200
|
+
* Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
|
|
2201
|
+
* Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2202
|
+
|
|
2203
|
+
**Example**
|
|
2204
|
+
|
|
2205
|
+
Consider an invoice with the following payments and tax withheld.
|
|
2206
|
+
|
|
2207
|
+
* Offline payments: $30
|
|
2208
|
+
* Online payments: $20
|
|
2209
|
+
* Tax withheld: $5
|
|
2210
|
+
|
|
2211
|
+
When recording a refund worth $40, the refund amount is split as follows:
|
|
2212
|
+
|
|
2213
|
+
* Refund against offline payments: $30
|
|
2214
|
+
* Refund against tax withheld: $5
|
|
2215
|
+
* Refund against online payments: $5
|
|
2216
|
+
|
|
2217
|
+
For payments made via online transactions, the [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer.
|
|
2218
|
+
**Tip**
|
|
2219
|
+
|
|
2220
|
+
If the order of precendence described above does not work for your use case, and you want to provide a refund against online `linked_payments` first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
|
|
2221
|
+
|
|
2222
|
+
*/
|
|
2223
|
+
|
|
2224
|
+
credit_note?:CreditNote;
|
|
377
2225
|
}
|
|
378
2226
|
export interface RecordRefundInputParam {
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* @description Remarks, if any, on the refund.
|
|
2230
|
+
|
|
2231
|
+
*/
|
|
2232
|
+
|
|
379
2233
|
comment?:string;
|
|
2234
|
+
|
|
2235
|
+
/**
|
|
2236
|
+
* @description The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
|
|
2237
|
+
|
|
2238
|
+
*/
|
|
2239
|
+
|
|
380
2240
|
customer_notes?:string;
|
|
2241
|
+
|
|
2242
|
+
/**
|
|
2243
|
+
* @description Parameters for transaction
|
|
2244
|
+
|
|
2245
|
+
*/
|
|
2246
|
+
|
|
381
2247
|
transaction?:{amount?:number,date:number,payment_method:PaymentMethod,reference_number?:string};
|
|
2248
|
+
|
|
2249
|
+
/**
|
|
2250
|
+
* @description Parameters for credit_note
|
|
2251
|
+
|
|
2252
|
+
*/
|
|
2253
|
+
|
|
382
2254
|
credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'chargeback' | 'order_change' | 'waiver'};
|
|
383
2255
|
}
|
|
384
|
-
export interface PdfResponse {
|
|
385
|
-
|
|
2256
|
+
export interface PdfResponse {
|
|
2257
|
+
/**
|
|
2258
|
+
* @description Gets the invoice as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
|
|
2259
|
+
|
|
2260
|
+
#### Related Tutorial
|
|
2261
|
+
|
|
2262
|
+
* [Check out customer portal tutorial on how to download invoice as PDF.](//www.chargebee.com/tutorials/customer-portal-sample.html#downloading_invoices_as_pdf)
|
|
2263
|
+
|
|
2264
|
+
*/
|
|
2265
|
+
|
|
2266
|
+
download:Download;
|
|
386
2267
|
}
|
|
387
2268
|
export interface PdfInputParam {
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* @description Determines the pdf should be rendered as inline or attachment in the browser. \* attachment - PDF is rendered as attachment in the browser \* inline - PDF is rendered as inline in the browser
|
|
2272
|
+
|
|
2273
|
+
*/
|
|
2274
|
+
|
|
388
2275
|
disposition_type?:DispositionType;
|
|
389
2276
|
}
|
|
390
|
-
export interface DownloadEinvoiceResponse {
|
|
391
|
-
|
|
2277
|
+
export interface DownloadEinvoiceResponse {
|
|
2278
|
+
/**
|
|
2279
|
+
* @description Download the e-invoice in both XML and PDF formats. The response consists of a `download` object for each format. The XML format follows the [structure as per Peppol BIS Billing v3.0](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/tree/).
|
|
2280
|
+
**Note**
|
|
2281
|
+
|
|
2282
|
+
* You can only download e-invoices when their `status` is `success`.
|
|
2283
|
+
* There are some cases in which the PDF is not available for download. In such cases, you can obtain it from the XML by decoding the value for [cbc:EmbeddedDocumentBinaryObject](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cac-Attachment/cbc-EmbeddedDocumentBinaryObject/), which is the Base64-encoded version of the PDF.
|
|
2284
|
+
|
|
2285
|
+
*/
|
|
2286
|
+
|
|
2287
|
+
downloads:Download[];
|
|
392
2288
|
}
|
|
393
2289
|
|
|
394
|
-
export interface LineItem {
|
|
2290
|
+
export interface LineItem {
|
|
395
2291
|
id?:string;
|
|
2292
|
+
|
|
396
2293
|
subscription_id?:string;
|
|
2294
|
+
|
|
397
2295
|
date_from?:number;
|
|
2296
|
+
|
|
398
2297
|
date_to?:number;
|
|
2298
|
+
|
|
399
2299
|
unit_amount?:number;
|
|
2300
|
+
|
|
400
2301
|
quantity?:number;
|
|
2302
|
+
|
|
401
2303
|
amount?:number;
|
|
2304
|
+
|
|
402
2305
|
pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
|
|
2306
|
+
|
|
403
2307
|
is_taxed?:boolean;
|
|
2308
|
+
|
|
404
2309
|
tax_amount?:number;
|
|
2310
|
+
|
|
405
2311
|
tax_rate?:number;
|
|
2312
|
+
|
|
406
2313
|
unit_amount_in_decimal?:string;
|
|
2314
|
+
|
|
407
2315
|
quantity_in_decimal?:string;
|
|
2316
|
+
|
|
408
2317
|
amount_in_decimal?:string;
|
|
2318
|
+
|
|
409
2319
|
discount_amount?:number;
|
|
2320
|
+
|
|
410
2321
|
item_level_discount_amount?:number;
|
|
2322
|
+
|
|
411
2323
|
reference_line_item_id?:string;
|
|
2324
|
+
|
|
412
2325
|
description?:string;
|
|
2326
|
+
|
|
413
2327
|
entity_description?:string;
|
|
2328
|
+
|
|
414
2329
|
entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
|
|
2330
|
+
|
|
415
2331
|
tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
|
|
2332
|
+
|
|
416
2333
|
entity_id?:string;
|
|
2334
|
+
|
|
417
2335
|
customer_id?:string;
|
|
418
2336
|
}
|
|
419
|
-
export interface Discount {
|
|
2337
|
+
export interface Discount {
|
|
420
2338
|
amount?:number;
|
|
2339
|
+
|
|
421
2340
|
description?:string;
|
|
2341
|
+
|
|
422
2342
|
line_item_id?:string;
|
|
2343
|
+
|
|
423
2344
|
entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
2345
|
+
|
|
424
2346
|
discount_type?:'fixed_amount' | 'percentage';
|
|
2347
|
+
|
|
425
2348
|
entity_id?:string;
|
|
2349
|
+
|
|
426
2350
|
coupon_set_code?:string;
|
|
427
2351
|
}
|
|
428
|
-
export interface LineItemDiscount {
|
|
2352
|
+
export interface LineItemDiscount {
|
|
429
2353
|
line_item_id?:string;
|
|
2354
|
+
|
|
430
2355
|
discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
2356
|
+
|
|
431
2357
|
coupon_id?:string;
|
|
2358
|
+
|
|
432
2359
|
entity_id?:string;
|
|
2360
|
+
|
|
433
2361
|
discount_amount?:number;
|
|
434
2362
|
}
|
|
435
|
-
export interface Tax {
|
|
2363
|
+
export interface Tax {
|
|
436
2364
|
name?:string;
|
|
2365
|
+
|
|
437
2366
|
amount?:number;
|
|
2367
|
+
|
|
438
2368
|
description?:string;
|
|
439
2369
|
}
|
|
440
|
-
export interface LineItemTax {
|
|
2370
|
+
export interface LineItemTax {
|
|
441
2371
|
line_item_id?:string;
|
|
2372
|
+
|
|
442
2373
|
tax_name?:string;
|
|
2374
|
+
|
|
443
2375
|
tax_rate?:number;
|
|
2376
|
+
|
|
444
2377
|
is_partial_tax_applied?:boolean;
|
|
2378
|
+
|
|
445
2379
|
is_non_compliance_tax?:boolean;
|
|
2380
|
+
|
|
446
2381
|
taxable_amount?:number;
|
|
2382
|
+
|
|
447
2383
|
tax_amount?:number;
|
|
2384
|
+
|
|
448
2385
|
tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
|
|
2386
|
+
|
|
449
2387
|
tax_juris_name?:string;
|
|
2388
|
+
|
|
450
2389
|
tax_juris_code?:string;
|
|
2390
|
+
|
|
451
2391
|
tax_amount_in_local_currency?:number;
|
|
2392
|
+
|
|
452
2393
|
local_currency_code?:string;
|
|
453
2394
|
}
|
|
454
|
-
export interface LineItemTier {
|
|
2395
|
+
export interface LineItemTier {
|
|
455
2396
|
line_item_id?:string;
|
|
2397
|
+
|
|
456
2398
|
starting_unit?:number;
|
|
2399
|
+
|
|
457
2400
|
ending_unit?:number;
|
|
2401
|
+
|
|
458
2402
|
quantity_used?:number;
|
|
2403
|
+
|
|
459
2404
|
unit_amount?:number;
|
|
2405
|
+
|
|
460
2406
|
starting_unit_in_decimal?:string;
|
|
2407
|
+
|
|
461
2408
|
ending_unit_in_decimal?:string;
|
|
2409
|
+
|
|
462
2410
|
quantity_used_in_decimal?:string;
|
|
2411
|
+
|
|
463
2412
|
unit_amount_in_decimal?:string;
|
|
464
2413
|
}
|
|
465
|
-
export interface InvoiceTransaction {
|
|
2414
|
+
export interface InvoiceTransaction {
|
|
466
2415
|
txn_id?:string;
|
|
2416
|
+
|
|
467
2417
|
applied_amount?:number;
|
|
2418
|
+
|
|
468
2419
|
applied_at?:number;
|
|
2420
|
+
|
|
469
2421
|
txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
|
|
2422
|
+
|
|
470
2423
|
txn_date?:number;
|
|
2424
|
+
|
|
471
2425
|
txn_amount?:number;
|
|
472
2426
|
}
|
|
473
|
-
export interface DunningAttempt {
|
|
2427
|
+
export interface DunningAttempt {
|
|
474
2428
|
attempt?:number;
|
|
2429
|
+
|
|
475
2430
|
transaction_id?:string;
|
|
2431
|
+
|
|
476
2432
|
dunning_type?:'offline' | 'auto_collect' | 'direct_debit';
|
|
2433
|
+
|
|
477
2434
|
created_at?:number;
|
|
2435
|
+
|
|
478
2436
|
txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
|
|
2437
|
+
|
|
479
2438
|
txn_amount?:number;
|
|
480
2439
|
}
|
|
481
|
-
export interface AppliedCredit {
|
|
2440
|
+
export interface AppliedCredit {
|
|
482
2441
|
cn_id?:string;
|
|
2442
|
+
|
|
483
2443
|
applied_amount?:number;
|
|
2444
|
+
|
|
484
2445
|
applied_at?:number;
|
|
2446
|
+
|
|
485
2447
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2448
|
+
|
|
486
2449
|
cn_create_reason_code?:string;
|
|
2450
|
+
|
|
487
2451
|
cn_date?:number;
|
|
2452
|
+
|
|
488
2453
|
cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
489
2454
|
}
|
|
490
|
-
export interface CreatedCreditNote {
|
|
2455
|
+
export interface CreatedCreditNote {
|
|
491
2456
|
cn_id?:string;
|
|
2457
|
+
|
|
492
2458
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2459
|
+
|
|
493
2460
|
cn_create_reason_code?:string;
|
|
2461
|
+
|
|
494
2462
|
cn_date?:number;
|
|
2463
|
+
|
|
495
2464
|
cn_total?:number;
|
|
2465
|
+
|
|
496
2466
|
cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
497
2467
|
}
|
|
498
|
-
export interface CreatedCreditNote {
|
|
2468
|
+
export interface CreatedCreditNote {
|
|
499
2469
|
cn_id?:string;
|
|
2470
|
+
|
|
500
2471
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2472
|
+
|
|
501
2473
|
cn_create_reason_code?:string;
|
|
2474
|
+
|
|
502
2475
|
cn_date?:number;
|
|
2476
|
+
|
|
503
2477
|
cn_total?:number;
|
|
2478
|
+
|
|
504
2479
|
cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
505
2480
|
}
|
|
506
|
-
export interface LinkedOrder {
|
|
2481
|
+
export interface LinkedOrder {
|
|
507
2482
|
id?:string;
|
|
2483
|
+
|
|
508
2484
|
document_number?:string;
|
|
2485
|
+
|
|
509
2486
|
status?:'new' | 'partially_delivered' | 'queued' | 'delivered' | 'on_hold' | 'shipped' | 'processing' | 'cancelled' | 'voided' | 'complete' | 'awaiting_shipment' | 'returned';
|
|
2487
|
+
|
|
510
2488
|
order_type?:'system_generated' | 'manual';
|
|
2489
|
+
|
|
511
2490
|
reference_id?:string;
|
|
2491
|
+
|
|
512
2492
|
fulfillment_status?:string;
|
|
2493
|
+
|
|
513
2494
|
batch_id?:string;
|
|
2495
|
+
|
|
514
2496
|
created_at?:number;
|
|
515
2497
|
}
|
|
516
|
-
export interface Note {
|
|
2498
|
+
export interface Note {
|
|
517
2499
|
entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price' | 'tax' | 'subscription' | 'customer';
|
|
2500
|
+
|
|
518
2501
|
note?:string;
|
|
2502
|
+
|
|
519
2503
|
entity_id?:string;
|
|
520
2504
|
}
|
|
521
|
-
export interface ShippingAddress {
|
|
2505
|
+
export interface ShippingAddress {
|
|
2506
|
+
/**
|
|
2507
|
+
* @description The first name of the contact.
|
|
2508
|
+
|
|
2509
|
+
*/
|
|
2510
|
+
|
|
522
2511
|
first_name?:string;
|
|
2512
|
+
|
|
2513
|
+
/**
|
|
2514
|
+
* @description The last name of the contact.
|
|
2515
|
+
|
|
2516
|
+
*/
|
|
2517
|
+
|
|
523
2518
|
last_name?:string;
|
|
2519
|
+
|
|
2520
|
+
/**
|
|
2521
|
+
* @description The email address.
|
|
2522
|
+
|
|
2523
|
+
*/
|
|
2524
|
+
|
|
524
2525
|
email?:string;
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* @description The company name.
|
|
2529
|
+
|
|
2530
|
+
*/
|
|
2531
|
+
|
|
525
2532
|
company?:string;
|
|
2533
|
+
|
|
2534
|
+
/**
|
|
2535
|
+
* @description The phone number.
|
|
2536
|
+
|
|
2537
|
+
*/
|
|
2538
|
+
|
|
526
2539
|
phone?:string;
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* @description Address line 1
|
|
2543
|
+
|
|
2544
|
+
*/
|
|
2545
|
+
|
|
527
2546
|
line1?:string;
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* @description Address line 2
|
|
2550
|
+
|
|
2551
|
+
*/
|
|
2552
|
+
|
|
528
2553
|
line2?:string;
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* @description Address line 3
|
|
2557
|
+
|
|
2558
|
+
*/
|
|
2559
|
+
|
|
529
2560
|
line3?:string;
|
|
2561
|
+
|
|
2562
|
+
/**
|
|
2563
|
+
* @description The name of the city.
|
|
2564
|
+
|
|
2565
|
+
*/
|
|
2566
|
+
|
|
530
2567
|
city?:string;
|
|
2568
|
+
|
|
2569
|
+
/**
|
|
2570
|
+
* @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ`). For Tamil Nadu (India), set as `TN` (not `IN-TN`). For British Columbia (Canada), set as `BC` (not `CA-BC`).
|
|
2571
|
+
|
|
2572
|
+
*/
|
|
2573
|
+
|
|
531
2574
|
state_code?:string;
|
|
2575
|
+
|
|
2576
|
+
/**
|
|
2577
|
+
* @description The state/province name.
|
|
2578
|
+
|
|
2579
|
+
*/
|
|
2580
|
+
|
|
532
2581
|
state?:string;
|
|
2582
|
+
|
|
2583
|
+
/**
|
|
2584
|
+
* @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
|
|
2585
|
+
|
|
2586
|
+
**Note** : If you enter an invalid country code, the system will return an error.
|
|
2587
|
+
|
|
2588
|
+
**Brexit**
|
|
2589
|
+
|
|
2590
|
+
|
|
2591
|
+
If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom -- Northern Ireland**) is available as an option.
|
|
2592
|
+
|
|
2593
|
+
*/
|
|
2594
|
+
|
|
533
2595
|
country?:string;
|
|
2596
|
+
|
|
2597
|
+
/**
|
|
2598
|
+
* @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
|
|
2599
|
+
|
|
2600
|
+
*/
|
|
2601
|
+
|
|
534
2602
|
zip?:string;
|
|
2603
|
+
|
|
2604
|
+
/**
|
|
2605
|
+
* @description The address verification status. \* not_validated - Address is not yet validated. \* valid - Address was validated successfully. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* invalid - Address is invalid.
|
|
2606
|
+
|
|
2607
|
+
*/
|
|
2608
|
+
|
|
535
2609
|
validation_status?:ValidationStatus;
|
|
2610
|
+
|
|
2611
|
+
/**
|
|
2612
|
+
* @description The index number of the subscription to which the item price is added. Provide a unique number between `0` and `4` (inclusive) for each subscription that is to be created.
|
|
2613
|
+
|
|
2614
|
+
*/
|
|
2615
|
+
|
|
536
2616
|
index?:number;
|
|
537
2617
|
}
|
|
538
|
-
export interface BillingAddress {
|
|
2618
|
+
export interface BillingAddress {
|
|
2619
|
+
/**
|
|
2620
|
+
* @description The first name of the billing contact.
|
|
2621
|
+
|
|
2622
|
+
*/
|
|
2623
|
+
|
|
539
2624
|
first_name?:string;
|
|
2625
|
+
|
|
2626
|
+
/**
|
|
2627
|
+
* @description The last name of the billing contact.
|
|
2628
|
+
|
|
2629
|
+
*/
|
|
2630
|
+
|
|
540
2631
|
last_name?:string;
|
|
2632
|
+
|
|
2633
|
+
/**
|
|
2634
|
+
* @description The email address.
|
|
2635
|
+
|
|
2636
|
+
*/
|
|
2637
|
+
|
|
541
2638
|
email?:string;
|
|
2639
|
+
|
|
2640
|
+
/**
|
|
2641
|
+
* @description The company name.
|
|
2642
|
+
|
|
2643
|
+
*/
|
|
2644
|
+
|
|
542
2645
|
company?:string;
|
|
2646
|
+
|
|
2647
|
+
/**
|
|
2648
|
+
* @description The phone number.
|
|
2649
|
+
|
|
2650
|
+
*/
|
|
2651
|
+
|
|
543
2652
|
phone?:string;
|
|
2653
|
+
|
|
2654
|
+
/**
|
|
2655
|
+
* @description Address line 1
|
|
2656
|
+
|
|
2657
|
+
*/
|
|
2658
|
+
|
|
544
2659
|
line1?:string;
|
|
2660
|
+
|
|
2661
|
+
/**
|
|
2662
|
+
* @description Address line 2
|
|
2663
|
+
|
|
2664
|
+
*/
|
|
2665
|
+
|
|
545
2666
|
line2?:string;
|
|
2667
|
+
|
|
2668
|
+
/**
|
|
2669
|
+
* @description Address line 3
|
|
2670
|
+
|
|
2671
|
+
*/
|
|
2672
|
+
|
|
546
2673
|
line3?:string;
|
|
2674
|
+
|
|
2675
|
+
/**
|
|
2676
|
+
* @description The name of the city.
|
|
2677
|
+
|
|
2678
|
+
*/
|
|
2679
|
+
|
|
547
2680
|
city?:string;
|
|
2681
|
+
|
|
2682
|
+
/**
|
|
2683
|
+
* @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ`). For Tamil Nadu (India), set as `TN` (not `IN-TN`). For British Columbia (Canada), set as `BC` (not `CA-BC`).
|
|
2684
|
+
|
|
2685
|
+
*/
|
|
2686
|
+
|
|
548
2687
|
state_code?:string;
|
|
2688
|
+
|
|
2689
|
+
/**
|
|
2690
|
+
* @description State or Province
|
|
2691
|
+
|
|
2692
|
+
*/
|
|
2693
|
+
|
|
549
2694
|
state?:string;
|
|
2695
|
+
|
|
2696
|
+
/**
|
|
2697
|
+
* @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
|
|
2698
|
+
|
|
2699
|
+
**Note** : If you enter an invalid country code, the system will return an error.
|
|
2700
|
+
|
|
2701
|
+
**Brexit**
|
|
2702
|
+
|
|
2703
|
+
|
|
2704
|
+
If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom -- Northern Ireland**) is available as an option.
|
|
2705
|
+
|
|
2706
|
+
*/
|
|
2707
|
+
|
|
550
2708
|
country?:string;
|
|
2709
|
+
|
|
2710
|
+
/**
|
|
2711
|
+
* @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
|
|
2712
|
+
|
|
2713
|
+
*/
|
|
2714
|
+
|
|
551
2715
|
zip?:string;
|
|
2716
|
+
|
|
2717
|
+
/**
|
|
2718
|
+
* @description The address verification status. \* valid - Address was validated successfully. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* invalid - Address is invalid. \* not_validated - Address is not yet validated.
|
|
2719
|
+
|
|
2720
|
+
*/
|
|
2721
|
+
|
|
552
2722
|
validation_status?:ValidationStatus;
|
|
553
2723
|
}
|
|
554
|
-
export interface Einvoice {
|
|
2724
|
+
export interface Einvoice {
|
|
2725
|
+
/**
|
|
2726
|
+
* @description The unique `id` for the e-invoice. This is auto-generated by Chargebee.
|
|
2727
|
+
|
|
2728
|
+
*/
|
|
2729
|
+
|
|
555
2730
|
id?:string;
|
|
2731
|
+
|
|
2732
|
+
/**
|
|
2733
|
+
* @description This attribute is used to populate the unique reference number assigned to an invoice on the Invoice Registration Portal (IRP) network. It is essential for identifying and tracking invoices that are processed through the IRP network. In the future, this field may be used to store similar reference numbers for other networks.
|
|
2734
|
+
|
|
2735
|
+
*/
|
|
2736
|
+
|
|
556
2737
|
reference_number?:string;
|
|
2738
|
+
|
|
2739
|
+
/**
|
|
2740
|
+
* @description The status of processing the e-invoice. To obtain detailed information about the current `status`, see `message`. \* scheduled - Sending the e-invoice to the customer has been scheduled. \* skipped - The e-invoice was not sent. This could be due to missing information or because the `entity_identifier` is not registered on the e-invoicing network. \* success - The e-invoice has been successfully delivered to the customer. \* failed - The e-invoice was sent and there was an error due to which it was not delivered. \* in_progress - The e-invoice has been sent and Chargebee is waiting for confirmation from the receiving entity. \* registered - The e-invoice was sent and there was an error due to which it was not delivered but got cleared in the IRP.
|
|
2741
|
+
|
|
2742
|
+
*/
|
|
2743
|
+
|
|
557
2744
|
status?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
|
|
2745
|
+
|
|
2746
|
+
/**
|
|
2747
|
+
* @description Detailed information about the status of the e-invoice. When `status` is `skipped` or `failed`, this contains the reason or error details. The following are some valid examples:
|
|
2748
|
+
|
|
2749
|
+
* Invoice successfully sent to customer via the e-invoicing network 9090:123456
|
|
2750
|
+
* Invoice successfully sent to customer via email id abc@acme.com
|
|
2751
|
+
|
|
2752
|
+
*/
|
|
2753
|
+
|
|
558
2754
|
message?:string;
|
|
559
2755
|
}
|
|
560
|
-
export interface LinkedTaxWithheld {
|
|
2756
|
+
export interface LinkedTaxWithheld {
|
|
561
2757
|
id?:string;
|
|
2758
|
+
|
|
562
2759
|
amount?:number;
|
|
2760
|
+
|
|
563
2761
|
description?:string;
|
|
2762
|
+
|
|
564
2763
|
date?:number;
|
|
2764
|
+
|
|
565
2765
|
reference_number?:string;
|
|
566
2766
|
}
|
|
567
2767
|
}
|