chargebee 2.26.0 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +8 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +235 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +285 -13
- package/types/resources/Card.d.ts +375 -13
- package/types/resources/Comment.d.ts +160 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +628 -20
- package/types/resources/CouponCode.d.ts +46 -5
- package/types/resources/CouponSet.d.ts +194 -17
- package/types/resources/CreditNote.d.ts +1100 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +1819 -73
- package/types/resources/DifferentialPrice.d.ts +246 -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 +1021 -27
- package/types/resources/Event.d.ts +138 -8
- package/types/resources/Export.d.ts +622 -32
- package/types/resources/Feature.d.ts +287 -22
- package/types/resources/Gift.d.ts +296 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1046 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +369 -9
- package/types/resources/Invoice.d.ts +1942 -92
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +522 -16
- package/types/resources/ItemEntitlement.d.ts +162 -13
- package/types/resources/ItemFamily.d.ts +153 -15
- package/types/resources/ItemPrice.d.ts +951 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +46 -3
- package/types/resources/Order.d.ts +1172 -32
- package/types/resources/PaymentIntent.d.ts +293 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +984 -55
- package/types/resources/PaymentVoucher.d.ts +252 -14
- package/types/resources/PortalSession.d.ts +154 -10
- package/types/resources/PromotionalCredit.d.ts +300 -16
- package/types/resources/Purchase.d.ts +206 -5
- package/types/resources/Quote.d.ts +1430 -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 +68 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +2564 -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 +82 -7
- package/types/resources/Token.d.ts +164 -7
- package/types/resources/Transaction.d.ts +567 -25
- package/types/resources/UnbilledCharge.d.ts +309 -14
- package/types/resources/Usage.d.ts +237 -13
- package/types/resources/VirtualBankAccount.d.ts +220 -17
|
@@ -1,567 +1,2417 @@
|
|
|
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
|
+
invoice:Invoice;
|
|
103
768
|
}
|
|
104
769
|
export interface DeleteLineItemsInputParam {
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* @description The list of line items which have to be deleted.
|
|
773
|
+
|
|
774
|
+
*/
|
|
775
|
+
|
|
105
776
|
line_items?:{id?:string}[];
|
|
106
777
|
}
|
|
107
|
-
export interface RemoveCreditNoteResponse {
|
|
108
|
-
|
|
109
|
-
|
|
778
|
+
export interface RemoveCreditNoteResponse {
|
|
779
|
+
invoice:Invoice;
|
|
780
|
+
|
|
781
|
+
credit_note:CreditNote;
|
|
110
782
|
}
|
|
111
783
|
export interface RemoveCreditNoteInputParam {
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* @description Parameters for credit_note
|
|
787
|
+
|
|
788
|
+
*/
|
|
789
|
+
|
|
112
790
|
credit_note?:{id:string};
|
|
113
791
|
}
|
|
114
|
-
export interface RemovePaymentResponse {
|
|
115
|
-
|
|
116
|
-
|
|
792
|
+
export interface RemovePaymentResponse {
|
|
793
|
+
invoice:Invoice;
|
|
794
|
+
|
|
795
|
+
transaction:Transaction;
|
|
117
796
|
}
|
|
118
797
|
export interface RemovePaymentInputParam {
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* @description Parameters for transaction
|
|
801
|
+
|
|
802
|
+
*/
|
|
803
|
+
|
|
119
804
|
transaction?:{id:string};
|
|
120
805
|
}
|
|
121
|
-
export interface StopDunningResponse {
|
|
122
|
-
|
|
806
|
+
export interface StopDunningResponse {
|
|
807
|
+
invoice:Invoice;
|
|
123
808
|
}
|
|
124
809
|
export interface StopDunningInputParam {
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* @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).
|
|
813
|
+
|
|
814
|
+
*/
|
|
815
|
+
|
|
125
816
|
comment?:string;
|
|
126
817
|
}
|
|
127
|
-
export interface ApplyPaymentsResponse {
|
|
128
|
-
|
|
818
|
+
export interface ApplyPaymentsResponse {
|
|
819
|
+
invoice:Invoice;
|
|
129
820
|
}
|
|
130
821
|
export interface ApplyPaymentsInputParam {
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* @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).
|
|
825
|
+
|
|
826
|
+
*/
|
|
827
|
+
|
|
131
828
|
comment?:string;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* @description Parameters for transactions
|
|
832
|
+
|
|
833
|
+
*/
|
|
834
|
+
|
|
132
835
|
transactions?:{id?:string}[];
|
|
133
836
|
}
|
|
134
|
-
export interface VoidInvoiceResponse {
|
|
135
|
-
|
|
136
|
-
|
|
837
|
+
export interface VoidInvoiceResponse {
|
|
838
|
+
invoice:Invoice;
|
|
839
|
+
|
|
840
|
+
credit_note?:CreditNote;
|
|
137
841
|
}
|
|
138
842
|
export interface VoidInvoiceInputParam {
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* @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).
|
|
846
|
+
|
|
847
|
+
*/
|
|
848
|
+
|
|
139
849
|
comment?:string;
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* @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.
|
|
853
|
+
|
|
854
|
+
*/
|
|
855
|
+
|
|
140
856
|
void_reason_code?:string;
|
|
141
857
|
}
|
|
142
|
-
export interface AddChargeResponse {
|
|
143
|
-
|
|
858
|
+
export interface AddChargeResponse {
|
|
859
|
+
invoice:Invoice;
|
|
144
860
|
}
|
|
145
861
|
export interface AddChargeInputParam {
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* @description The amount to be charged. The unit depends on the [type of currency](/docs/api#md_disabled).
|
|
865
|
+
|
|
866
|
+
*/
|
|
867
|
+
|
|
146
868
|
amount:number;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* @description Detailed description about this lineitem.
|
|
872
|
+
|
|
873
|
+
*/
|
|
874
|
+
|
|
147
875
|
description:string;
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* @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
|
|
879
|
+
|
|
880
|
+
*/
|
|
881
|
+
|
|
148
882
|
avalara_sale_type?:AvalaraSaleType;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* @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.
|
|
886
|
+
|
|
887
|
+
*/
|
|
888
|
+
|
|
149
889
|
avalara_transaction_type?:number;
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* @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.
|
|
893
|
+
|
|
894
|
+
*/
|
|
895
|
+
|
|
150
896
|
avalara_service_type?:number;
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* @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).
|
|
900
|
+
|
|
901
|
+
*/
|
|
902
|
+
|
|
151
903
|
comment?:string;
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* @description Identifier of the subscription for which this charge needs to be created. Applicable for consolidated invoice.
|
|
907
|
+
|
|
908
|
+
*/
|
|
909
|
+
|
|
152
910
|
subscription_id?:string;
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* @description Parameters for line_item
|
|
914
|
+
|
|
915
|
+
*/
|
|
916
|
+
|
|
153
917
|
line_item?:{date_from?:number,date_to?:number};
|
|
154
918
|
}
|
|
155
|
-
export interface SendEinvoiceResponse {
|
|
156
|
-
|
|
919
|
+
export interface SendEinvoiceResponse {
|
|
920
|
+
invoice:Invoice;
|
|
157
921
|
}
|
|
158
922
|
|
|
159
|
-
export interface WriteOffResponse {
|
|
160
|
-
|
|
161
|
-
|
|
923
|
+
export interface WriteOffResponse {
|
|
924
|
+
invoice:Invoice;
|
|
925
|
+
|
|
926
|
+
credit_note:CreditNote;
|
|
162
927
|
}
|
|
163
928
|
export interface WriteOffInputParam {
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* @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).
|
|
932
|
+
|
|
933
|
+
*/
|
|
934
|
+
|
|
164
935
|
comment?:string;
|
|
165
936
|
}
|
|
166
|
-
export interface AddChargeItemResponse {
|
|
167
|
-
|
|
937
|
+
export interface AddChargeItemResponse {
|
|
938
|
+
invoice:Invoice;
|
|
168
939
|
}
|
|
169
940
|
export interface AddChargeItemInputParam {
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* @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).
|
|
944
|
+
|
|
945
|
+
*/
|
|
946
|
+
|
|
170
947
|
comment?:string;
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* @description Identifier of the subscription for which this addon needs to be created. Applicable for consolidated invoice.
|
|
951
|
+
|
|
952
|
+
*/
|
|
953
|
+
|
|
171
954
|
subscription_id?:string;
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* @description Parameters for item_price
|
|
958
|
+
|
|
959
|
+
*/
|
|
960
|
+
|
|
172
961
|
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};
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* @description Parameters for item_tiers
|
|
965
|
+
|
|
966
|
+
*/
|
|
967
|
+
|
|
173
968
|
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
969
|
}
|
|
175
|
-
export interface ListResponse {
|
|
176
|
-
|
|
177
|
-
|
|
970
|
+
export interface ListResponse {
|
|
971
|
+
/**
|
|
972
|
+
* @description Lists all the Invoices.
|
|
973
|
+
|
|
974
|
+
*/
|
|
975
|
+
|
|
976
|
+
list:{invoice:Invoice}[];
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* @description Lists all the Invoices.
|
|
980
|
+
|
|
981
|
+
*/
|
|
982
|
+
|
|
983
|
+
next_offset?:string;
|
|
178
984
|
}
|
|
179
985
|
export interface ListInputParam {
|
|
180
|
-
[key : string]: any;
|
|
986
|
+
[key : string]: any;
|
|
987
|
+
/**
|
|
988
|
+
* @description The number of resources to be returned.
|
|
989
|
+
|
|
990
|
+
*/
|
|
991
|
+
|
|
181
992
|
limit?:number;
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* @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.
|
|
996
|
+
|
|
997
|
+
*/
|
|
998
|
+
|
|
182
999
|
offset?:string;
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \`deleted\` as \`true\`.
|
|
1003
|
+
|
|
1004
|
+
*/
|
|
1005
|
+
|
|
183
1006
|
include_deleted?:boolean;
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* @description The invoice number. Acts as a identifier for invoice and typically generated sequentially.
|
|
1010
|
+
|
|
1011
|
+
*/
|
|
1012
|
+
|
|
184
1013
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* @description To filter based on subscription_id.
|
|
1017
|
+
NOTE: Not to be used if *consolidated invoicing* is enabled.
|
|
1018
|
+
|
|
1019
|
+
*/
|
|
1020
|
+
|
|
185
1021
|
subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* @description The identifier of the customer this invoice belongs to.
|
|
1025
|
+
|
|
1026
|
+
*/
|
|
1027
|
+
|
|
186
1028
|
customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* @description Boolean indicating whether this invoice belongs to a subscription
|
|
1032
|
+
|
|
1033
|
+
*/
|
|
1034
|
+
|
|
187
1035
|
recurring?:{is?:'true' | 'false'};
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* @description Current status of this invoice.
|
|
1039
|
+
|
|
1040
|
+
*/
|
|
1041
|
+
|
|
188
1042
|
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};
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* @description The price type of the invoice.
|
|
1046
|
+
|
|
1047
|
+
*/
|
|
1048
|
+
|
|
189
1049
|
price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* @description The document date displayed on the invoice PDF.
|
|
1053
|
+
|
|
1054
|
+
*/
|
|
1055
|
+
|
|
190
1056
|
date?:{after?:string,before?:string,between?:string,on?:string};
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* @description Timestamp indicating the date \& time this invoice got paid.
|
|
1060
|
+
|
|
1061
|
+
*/
|
|
1062
|
+
|
|
191
1063
|
paid_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* @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.
|
|
1067
|
+
|
|
1068
|
+
*/
|
|
1069
|
+
|
|
192
1070
|
total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* @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`.
|
|
1074
|
+
|
|
1075
|
+
*/
|
|
1076
|
+
|
|
193
1077
|
amount_paid?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* @description Total adjustments made against this invoice.
|
|
1081
|
+
|
|
1082
|
+
*/
|
|
1083
|
+
|
|
194
1084
|
amount_adjusted?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* @description Total credits applied against this invoice.
|
|
1088
|
+
|
|
1089
|
+
*/
|
|
1090
|
+
|
|
195
1091
|
credits_applied?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* @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`.
|
|
1095
|
+
|
|
1096
|
+
*/
|
|
1097
|
+
|
|
196
1098
|
amount_due?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* @description Current dunning status of the invoice.
|
|
1102
|
+
|
|
1103
|
+
*/
|
|
1104
|
+
|
|
197
1105
|
dunning_status?:{in?:string,is?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_not?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_present?:'true' | 'false',not_in?:string};
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* @description Payment owner of an invoice
|
|
1109
|
+
|
|
1110
|
+
*/
|
|
1111
|
+
|
|
198
1112
|
payment_owner?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* @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.
|
|
1116
|
+
|
|
1117
|
+
*/
|
|
1118
|
+
|
|
199
1119
|
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* @description The subscription channel this object originated from and is maintained in.
|
|
1123
|
+
|
|
1124
|
+
*/
|
|
1125
|
+
|
|
200
1126
|
channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* @description Timestamp indicating the date \& time this invoice got voided.
|
|
1130
|
+
|
|
1131
|
+
*/
|
|
1132
|
+
|
|
201
1133
|
voided_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* @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
|
|
1137
|
+
|
|
1138
|
+
*/
|
|
1139
|
+
|
|
202
1140
|
void_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* @description Lists all the Invoices.
|
|
1144
|
+
|
|
1145
|
+
*/
|
|
1146
|
+
|
|
203
1147
|
sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* @description Parameters for einvoice
|
|
1151
|
+
|
|
1152
|
+
*/
|
|
1153
|
+
|
|
204
1154
|
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
1155
|
}
|
|
206
|
-
export interface CloseResponse {
|
|
207
|
-
|
|
1156
|
+
export interface CloseResponse {
|
|
1157
|
+
invoice:Invoice;
|
|
208
1158
|
}
|
|
209
1159
|
export interface CloseInputParam {
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* @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).
|
|
1163
|
+
|
|
1164
|
+
*/
|
|
1165
|
+
|
|
210
1166
|
comment?:string;
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* @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.
|
|
1170
|
+
|
|
1171
|
+
*/
|
|
1172
|
+
|
|
211
1173
|
invoice_note?:string;
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* @description Set as `true` to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
|
|
1177
|
+
|
|
1178
|
+
*/
|
|
1179
|
+
|
|
212
1180
|
remove_general_note?:boolean;
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* @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.
|
|
1184
|
+
|
|
1185
|
+
*/
|
|
1186
|
+
|
|
213
1187
|
invoice_date?:number;
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* @description Parameters for notes_to_remove
|
|
1191
|
+
|
|
1192
|
+
*/
|
|
1193
|
+
|
|
214
1194
|
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
215
1195
|
}
|
|
216
|
-
export interface ApplyCreditsResponse {
|
|
217
|
-
|
|
1196
|
+
export interface ApplyCreditsResponse {
|
|
1197
|
+
invoice:Invoice;
|
|
218
1198
|
}
|
|
219
1199
|
export interface ApplyCreditsInputParam {
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* @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).
|
|
1203
|
+
|
|
1204
|
+
*/
|
|
1205
|
+
|
|
220
1206
|
comment?:string;
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* @description Parameters for credit_notes
|
|
1210
|
+
|
|
1211
|
+
*/
|
|
1212
|
+
|
|
221
1213
|
credit_notes?:{id?:string}[];
|
|
222
1214
|
}
|
|
223
|
-
export interface RetrieveResponse {
|
|
224
|
-
|
|
1215
|
+
export interface RetrieveResponse {
|
|
1216
|
+
invoice:Invoice;
|
|
225
1217
|
}
|
|
226
1218
|
|
|
227
|
-
export interface CreateForChargeItemsAndChargesResponse {
|
|
228
|
-
|
|
1219
|
+
export interface CreateForChargeItemsAndChargesResponse {
|
|
1220
|
+
invoice:Invoice;
|
|
229
1221
|
}
|
|
230
1222
|
export interface CreateForChargeItemsAndChargesInputParam {
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* @description Unique ID of the customer this invoice should be created for. Either this or `subscription_id` must be provided.
|
|
1226
|
+
**Note**
|
|
1227
|
+
|
|
1228
|
+
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.
|
|
1229
|
+
.
|
|
1230
|
+
|
|
1231
|
+
*/
|
|
1232
|
+
|
|
231
1233
|
customer_id?:string;
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* @description Unique ID of the subscription this invoice should be created for. Either this or `customer_id` must be provided.
|
|
1237
|
+
**Note**
|
|
1238
|
+
|
|
1239
|
+
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.
|
|
1240
|
+
.
|
|
1241
|
+
|
|
1242
|
+
*/
|
|
1243
|
+
|
|
232
1244
|
subscription_id?:string;
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* @description The currency code (ISO 4217 format) of the invoice amount.
|
|
1248
|
+
|
|
1249
|
+
*/
|
|
1250
|
+
|
|
233
1251
|
currency_code?:string;
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* @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.
|
|
1255
|
+
|
|
1256
|
+
*/
|
|
1257
|
+
|
|
234
1258
|
invoice_note?:string;
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* @description Set as `true` to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
|
|
1262
|
+
|
|
1263
|
+
*/
|
|
1264
|
+
|
|
235
1265
|
remove_general_note?:boolean;
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* @description Purchase Order Number for this invoice.
|
|
1269
|
+
|
|
1270
|
+
*/
|
|
1271
|
+
|
|
236
1272
|
po_number?:string;
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* @description List of Coupons to be added.
|
|
1276
|
+
|
|
1277
|
+
*/
|
|
1278
|
+
|
|
237
1279
|
coupon_ids?:string[];
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* @description Authorization transaction to be captured.
|
|
1283
|
+
|
|
1284
|
+
*/
|
|
1285
|
+
|
|
238
1286
|
authorization_transaction_id?:string;
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* @description Payment source to be used for this payment.
|
|
1290
|
+
|
|
1291
|
+
*/
|
|
1292
|
+
|
|
239
1293
|
payment_source_id?:string;
|
|
1294
|
+
|
|
1295
|
+
/**
|
|
1296
|
+
* @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.
|
|
1297
|
+
|
|
1298
|
+
*/
|
|
1299
|
+
|
|
240
1300
|
auto_collection?:AutoCollection;
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* @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.
|
|
1304
|
+
|
|
1305
|
+
*/
|
|
1306
|
+
|
|
241
1307
|
invoice_date?:number;
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* @description Token generated by Chargebee JS representing payment method details.
|
|
1311
|
+
|
|
1312
|
+
*/
|
|
1313
|
+
|
|
242
1314
|
token_id?:string;
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* @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.
|
|
1318
|
+
|
|
1319
|
+
*/
|
|
1320
|
+
|
|
243
1321
|
replace_primary_payment_source?:boolean;
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* @description Indicates whether the payment source should be retained for the customer.
|
|
1325
|
+
|
|
1326
|
+
*/
|
|
1327
|
+
|
|
244
1328
|
retain_payment_source?:boolean;
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* @description Parameters for shipping_address
|
|
1332
|
+
|
|
1333
|
+
*/
|
|
1334
|
+
|
|
245
1335
|
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};
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* @description Parameters for card
|
|
1339
|
+
|
|
1340
|
+
*/
|
|
1341
|
+
|
|
246
1342
|
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};
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* @description Parameters for bank_account
|
|
1346
|
+
|
|
1347
|
+
*/
|
|
1348
|
+
|
|
247
1349
|
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};
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* @description Parameters for payment_method
|
|
1353
|
+
|
|
1354
|
+
*/
|
|
1355
|
+
|
|
248
1356
|
payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* @description Parameters for payment_intent
|
|
1360
|
+
|
|
1361
|
+
*/
|
|
1362
|
+
|
|
249
1363
|
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};
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* @description Parameters for item_prices
|
|
1367
|
+
|
|
1368
|
+
*/
|
|
1369
|
+
|
|
250
1370
|
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}[];
|
|
1371
|
+
|
|
1372
|
+
/**
|
|
1373
|
+
* @description Parameters for item_tiers
|
|
1374
|
+
|
|
1375
|
+
*/
|
|
1376
|
+
|
|
251
1377
|
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}[];
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* @description Parameters for charges
|
|
1381
|
+
|
|
1382
|
+
*/
|
|
1383
|
+
|
|
252
1384
|
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}[];
|
|
1385
|
+
|
|
1386
|
+
/**
|
|
1387
|
+
* @description Parameters for notes_to_remove
|
|
1388
|
+
|
|
1389
|
+
*/
|
|
1390
|
+
|
|
253
1391
|
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* @description Parameters for discounts
|
|
1395
|
+
|
|
1396
|
+
*/
|
|
1397
|
+
|
|
254
1398
|
discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
|
|
255
1399
|
}
|
|
256
|
-
export interface UpdateDetailsResponse {
|
|
257
|
-
|
|
1400
|
+
export interface UpdateDetailsResponse {
|
|
1401
|
+
invoice:Invoice;
|
|
258
1402
|
}
|
|
259
1403
|
export interface UpdateDetailsInputParam {
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* @description VAT/ Tax registration number of the customer. [Learn more](https://www.chargebee.com/docs/tax.html#capture-tax-registration-number).
|
|
1407
|
+
|
|
1408
|
+
*/
|
|
1409
|
+
|
|
260
1410
|
vat_number?:string;
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* @description An overridden value for the first two characters of the [full VAT
|
|
1414
|
+
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** ).
|
|
1415
|
+
|
|
1416
|
+
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1417
|
+
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
|
|
1418
|
+
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.
|
|
1419
|
+
|
|
1420
|
+
*/
|
|
1421
|
+
|
|
261
1422
|
vat_number_prefix?:string;
|
|
1423
|
+
|
|
1424
|
+
/**
|
|
1425
|
+
* @description Purchase Order Number for this invoice.
|
|
1426
|
+
|
|
1427
|
+
*/
|
|
1428
|
+
|
|
262
1429
|
po_number?:string;
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* @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).
|
|
1433
|
+
|
|
1434
|
+
*/
|
|
1435
|
+
|
|
263
1436
|
comment?:string;
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* @description Parameters for billing_address
|
|
1440
|
+
|
|
1441
|
+
*/
|
|
1442
|
+
|
|
264
1443
|
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};
|
|
1444
|
+
|
|
1445
|
+
/**
|
|
1446
|
+
* @description Parameters for shipping_address
|
|
1447
|
+
|
|
1448
|
+
*/
|
|
1449
|
+
|
|
265
1450
|
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
1451
|
}
|
|
267
|
-
export interface RecordPaymentResponse {
|
|
268
|
-
|
|
269
|
-
|
|
1452
|
+
export interface RecordPaymentResponse {
|
|
1453
|
+
invoice:Invoice;
|
|
1454
|
+
|
|
1455
|
+
transaction:Transaction;
|
|
270
1456
|
}
|
|
271
1457
|
export interface RecordPaymentInputParam {
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* @description Remarks, if any, on the payment.
|
|
1461
|
+
|
|
1462
|
+
*/
|
|
1463
|
+
|
|
272
1464
|
comment?:string;
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* @description Parameters for transaction
|
|
1468
|
+
|
|
1469
|
+
*/
|
|
1470
|
+
|
|
273
1471
|
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
1472
|
}
|
|
275
|
-
export interface DeleteResponse {
|
|
276
|
-
|
|
1473
|
+
export interface DeleteResponse {
|
|
1474
|
+
invoice:Invoice;
|
|
277
1475
|
}
|
|
278
1476
|
export interface DeleteInputParam {
|
|
1477
|
+
|
|
1478
|
+
/**
|
|
1479
|
+
* @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.
|
|
1480
|
+
|
|
1481
|
+
*/
|
|
1482
|
+
|
|
279
1483
|
comment?:string;
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* @description Indicates whether to put prorated credits back to the subscription or ignore while deleting the invoice.
|
|
1487
|
+
|
|
1488
|
+
*/
|
|
1489
|
+
|
|
280
1490
|
claim_credits?:boolean;
|
|
281
1491
|
}
|
|
282
|
-
export interface ImportInvoiceResponse {
|
|
283
|
-
|
|
284
|
-
|
|
1492
|
+
export interface ImportInvoiceResponse {
|
|
1493
|
+
invoice:Invoice;
|
|
1494
|
+
|
|
1495
|
+
credit_note?:CreditNote;
|
|
285
1496
|
}
|
|
286
1497
|
export interface ImportInvoiceInputParam {
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* @description Invoice Number.
|
|
1501
|
+
|
|
1502
|
+
*/
|
|
1503
|
+
|
|
287
1504
|
id:string;
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* @description The currency code (ISO 4217 format) for the invoice.
|
|
1508
|
+
|
|
1509
|
+
*/
|
|
1510
|
+
|
|
288
1511
|
currency_code?:string;
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* @description Identifier of the customer for which this invoice needs to be created.
|
|
1515
|
+
|
|
1516
|
+
*/
|
|
1517
|
+
|
|
289
1518
|
customer_id?:string;
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* @description If recurring items are present in line items then subscription id is required.
|
|
1522
|
+
|
|
1523
|
+
*/
|
|
1524
|
+
|
|
290
1525
|
subscription_id?:string;
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* @description Purchase Order Number for this invoice.
|
|
1529
|
+
|
|
1530
|
+
*/
|
|
1531
|
+
|
|
291
1532
|
po_number?:string;
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* @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.
|
|
1536
|
+
|
|
1537
|
+
*/
|
|
1538
|
+
|
|
292
1539
|
price_type?:PriceType;
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* @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.)
|
|
1543
|
+
|
|
1544
|
+
*/
|
|
1545
|
+
|
|
293
1546
|
tax_override_reason?:TaxOverrideReason;
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* @description Vat Number. Required if this invoice is VAT exempted.
|
|
1550
|
+
|
|
1551
|
+
*/
|
|
1552
|
+
|
|
294
1553
|
vat_number?:string;
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* @description An overridden value for the first two characters of the [full VAT
|
|
1557
|
+
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** ).
|
|
1558
|
+
|
|
1559
|
+
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1560
|
+
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
|
|
1561
|
+
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.
|
|
1562
|
+
|
|
1563
|
+
*/
|
|
1564
|
+
|
|
295
1565
|
vat_number_prefix?:string;
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* @description Date when invoice raised.
|
|
1569
|
+
|
|
1570
|
+
*/
|
|
1571
|
+
|
|
296
1572
|
date:number;
|
|
1573
|
+
|
|
1574
|
+
/**
|
|
1575
|
+
* @description Invoice total amount.
|
|
1576
|
+
|
|
1577
|
+
*/
|
|
1578
|
+
|
|
297
1579
|
total:number;
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* @description Round off amount.
|
|
1583
|
+
|
|
1584
|
+
*/
|
|
1585
|
+
|
|
298
1586
|
round_off?:number;
|
|
1587
|
+
|
|
1588
|
+
/**
|
|
1589
|
+
* @description Current status of this invoice. \* pending -
|
|
1590
|
+
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`.
|
|
1591
|
+
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
|
|
1592
|
+
|
|
1593
|
+
*/
|
|
1594
|
+
|
|
299
1595
|
status?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* @description Timestamp indicating the date \& time this invoice got voided.
|
|
1599
|
+
|
|
1600
|
+
*/
|
|
1601
|
+
|
|
300
1602
|
voided_at?:number;
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* @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.
|
|
1606
|
+
|
|
1607
|
+
*/
|
|
1608
|
+
|
|
301
1609
|
void_reason_code?:string;
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* @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.
|
|
1613
|
+
|
|
1614
|
+
*/
|
|
1615
|
+
|
|
302
1616
|
is_written_off?:boolean;
|
|
1617
|
+
|
|
1618
|
+
/**
|
|
1619
|
+
* @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.
|
|
1620
|
+
|
|
1621
|
+
*/
|
|
1622
|
+
|
|
303
1623
|
write_off_amount?:number;
|
|
1624
|
+
|
|
1625
|
+
/**
|
|
1626
|
+
* @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.
|
|
1627
|
+
|
|
1628
|
+
*/
|
|
1629
|
+
|
|
304
1630
|
write_off_date?:number;
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* @description Invoice Due Date.
|
|
1634
|
+
|
|
1635
|
+
*/
|
|
1636
|
+
|
|
305
1637
|
due_date?:number;
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* @description Invoice net term days.
|
|
1641
|
+
|
|
1642
|
+
*/
|
|
1643
|
+
|
|
306
1644
|
net_term_days?:number;
|
|
1645
|
+
|
|
1646
|
+
/**
|
|
1647
|
+
* @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.
|
|
1648
|
+
|
|
1649
|
+
*/
|
|
1650
|
+
|
|
307
1651
|
has_advance_charges?:boolean;
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* @description If the invoice falls within the subscription current term will be used for proration.
|
|
1655
|
+
|
|
1656
|
+
*/
|
|
1657
|
+
|
|
308
1658
|
use_for_proration?:boolean;
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* @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.
|
|
1662
|
+
|
|
1663
|
+
*/
|
|
1664
|
+
|
|
309
1665
|
credit_note?:{id?:string};
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* @description Parameters for billing_address
|
|
1669
|
+
|
|
1670
|
+
*/
|
|
1671
|
+
|
|
310
1672
|
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};
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* @description Parameters for shipping_address
|
|
1676
|
+
|
|
1677
|
+
*/
|
|
1678
|
+
|
|
311
1679
|
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};
|
|
1680
|
+
|
|
1681
|
+
/**
|
|
1682
|
+
* @description Parameters for line_items
|
|
1683
|
+
|
|
1684
|
+
*/
|
|
1685
|
+
|
|
312
1686
|
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}[];
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* @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.
|
|
1690
|
+
|
|
1691
|
+
*/
|
|
1692
|
+
|
|
313
1693
|
payment_reference_numbers?:{id?:string,number:string,type:'frn' | 'kid' | 'fik' | 'ocr'}[];
|
|
1694
|
+
|
|
1695
|
+
/**
|
|
1696
|
+
* @description Parameters for line_item_tiers
|
|
1697
|
+
|
|
1698
|
+
*/
|
|
1699
|
+
|
|
314
1700
|
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}[];
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* @description Parameters for discounts
|
|
1704
|
+
|
|
1705
|
+
*/
|
|
1706
|
+
|
|
315
1707
|
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}[];
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* @description Parameters for taxes
|
|
1711
|
+
|
|
1712
|
+
*/
|
|
1713
|
+
|
|
316
1714
|
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}[];
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* @description Parameters for payments
|
|
1718
|
+
|
|
1719
|
+
*/
|
|
1720
|
+
|
|
317
1721
|
payments?:{amount:number,date?:number,payment_method:PaymentMethod,reference_number?:string}[];
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* @description Parameters for notes
|
|
1725
|
+
|
|
1726
|
+
*/
|
|
1727
|
+
|
|
318
1728
|
notes?:{entity_id?:string,entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price',note?:string}[];
|
|
319
1729
|
}
|
|
320
|
-
export interface RecordTaxWithheldResponse {
|
|
321
|
-
|
|
1730
|
+
export interface RecordTaxWithheldResponse {
|
|
1731
|
+
invoice:Invoice;
|
|
322
1732
|
}
|
|
323
1733
|
export interface RecordTaxWithheldInputParam {
|
|
1734
|
+
|
|
1735
|
+
/**
|
|
1736
|
+
* @description Parameters for tax_withheld
|
|
1737
|
+
|
|
1738
|
+
*/
|
|
1739
|
+
|
|
324
1740
|
tax_withheld?:{amount:number,date?:number,description?:string,reference_number?:string};
|
|
325
1741
|
}
|
|
326
|
-
export interface ResendEinvoiceResponse {
|
|
327
|
-
|
|
1742
|
+
export interface ResendEinvoiceResponse {
|
|
1743
|
+
invoice:Invoice;
|
|
328
1744
|
}
|
|
329
1745
|
|
|
330
|
-
export interface RemoveTaxWithheldResponse {
|
|
331
|
-
|
|
1746
|
+
export interface RemoveTaxWithheldResponse {
|
|
1747
|
+
invoice:Invoice;
|
|
332
1748
|
}
|
|
333
1749
|
export interface RemoveTaxWithheldInputParam {
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* @description Parameters for tax_withheld
|
|
1753
|
+
|
|
1754
|
+
*/
|
|
1755
|
+
|
|
334
1756
|
tax_withheld?:{id:string};
|
|
335
1757
|
}
|
|
336
|
-
export interface ListPaymentReferenceNumbersResponse {
|
|
337
|
-
|
|
338
|
-
|
|
1758
|
+
export interface ListPaymentReferenceNumbersResponse {
|
|
1759
|
+
/**
|
|
1760
|
+
* @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.
|
|
1761
|
+
|
|
1762
|
+
*/
|
|
1763
|
+
|
|
1764
|
+
list:{payment_reference_number:PaymentReferenceNumber}[];
|
|
1765
|
+
|
|
1766
|
+
/**
|
|
1767
|
+
* @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.
|
|
1768
|
+
|
|
1769
|
+
*/
|
|
1770
|
+
|
|
1771
|
+
next_offset?:string;
|
|
339
1772
|
}
|
|
340
1773
|
export interface ListPaymentReferenceNumbersInputParam {
|
|
341
|
-
[key : string]: any;
|
|
1774
|
+
[key : string]: any;
|
|
1775
|
+
/**
|
|
1776
|
+
* @description The number of resources to be returned.
|
|
1777
|
+
|
|
1778
|
+
*/
|
|
1779
|
+
|
|
342
1780
|
limit?:number;
|
|
1781
|
+
|
|
1782
|
+
/**
|
|
1783
|
+
* @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.
|
|
1784
|
+
|
|
1785
|
+
*/
|
|
1786
|
+
|
|
343
1787
|
offset?:string;
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* @description An unique identifier for the invoice serves that links the invoice to the corresponding payment reference number (PRN).
|
|
1791
|
+
**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.
|
|
1792
|
+
|
|
1793
|
+
*/
|
|
1794
|
+
|
|
344
1795
|
id?:{in?:string,is?:string};
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* @description Parameters for payment_reference_number
|
|
1799
|
+
|
|
1800
|
+
*/
|
|
1801
|
+
|
|
345
1802
|
payment_reference_number?:{number?:{in?:string,is?:string}};
|
|
346
1803
|
}
|
|
347
|
-
export interface CollectPaymentResponse {
|
|
348
|
-
|
|
349
|
-
|
|
1804
|
+
export interface CollectPaymentResponse {
|
|
1805
|
+
invoice:Invoice;
|
|
1806
|
+
|
|
1807
|
+
transaction:Transaction;
|
|
350
1808
|
}
|
|
351
1809
|
export interface CollectPaymentInputParam {
|
|
1810
|
+
|
|
1811
|
+
/**
|
|
1812
|
+
* @description Amount to be collected. If this parameter is not passed then the entire amount due will be collected.
|
|
1813
|
+
|
|
1814
|
+
*/
|
|
1815
|
+
|
|
352
1816
|
amount?:number;
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* @description Authorization transaction to be captured.
|
|
1820
|
+
|
|
1821
|
+
*/
|
|
1822
|
+
|
|
353
1823
|
authorization_transaction_id?:string;
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
1826
|
+
* @description Payment source to be used for this payment.
|
|
1827
|
+
|
|
1828
|
+
*/
|
|
1829
|
+
|
|
354
1830
|
payment_source_id?:string;
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* @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).
|
|
1834
|
+
|
|
1835
|
+
*/
|
|
1836
|
+
|
|
355
1837
|
comment?:string;
|
|
356
|
-
|
|
1838
|
+
|
|
1839
|
+
/**
|
|
1840
|
+
* @description null
|
|
1841
|
+
|
|
1842
|
+
*/
|
|
1843
|
+
|
|
1844
|
+
payment_initiator?:PaymentInitiator;
|
|
357
1845
|
}
|
|
358
|
-
export interface SyncUsagesResponse {
|
|
359
|
-
|
|
1846
|
+
export interface SyncUsagesResponse {
|
|
1847
|
+
invoice:Invoice;
|
|
360
1848
|
}
|
|
361
1849
|
|
|
362
|
-
export interface RefundResponse {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
1850
|
+
export interface RefundResponse {
|
|
1851
|
+
invoice:Invoice;
|
|
1852
|
+
|
|
1853
|
+
transaction:Transaction;
|
|
1854
|
+
|
|
1855
|
+
credit_note?:CreditNote;
|
|
366
1856
|
}
|
|
367
1857
|
export interface RefundInputParam {
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* @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.
|
|
1861
|
+
|
|
1862
|
+
*/
|
|
1863
|
+
|
|
368
1864
|
refund_amount?:number;
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* @description Comment, if any, on the refund.
|
|
1868
|
+
|
|
1869
|
+
*/
|
|
1870
|
+
|
|
369
1871
|
comment?:string;
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* @description The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
|
|
1875
|
+
|
|
1876
|
+
*/
|
|
1877
|
+
|
|
370
1878
|
customer_notes?:string;
|
|
1879
|
+
|
|
1880
|
+
/**
|
|
1881
|
+
* @description Parameters for credit_note
|
|
1882
|
+
|
|
1883
|
+
*/
|
|
1884
|
+
|
|
371
1885
|
credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver'};
|
|
372
1886
|
}
|
|
373
|
-
export interface RecordRefundResponse {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
1887
|
+
export interface RecordRefundResponse {
|
|
1888
|
+
invoice:Invoice;
|
|
1889
|
+
|
|
1890
|
+
transaction?:Transaction;
|
|
1891
|
+
|
|
1892
|
+
credit_note?:CreditNote;
|
|
377
1893
|
}
|
|
378
1894
|
export interface RecordRefundInputParam {
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* @description Remarks, if any, on the refund.
|
|
1898
|
+
|
|
1899
|
+
*/
|
|
1900
|
+
|
|
379
1901
|
comment?:string;
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* @description The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
|
|
1905
|
+
|
|
1906
|
+
*/
|
|
1907
|
+
|
|
380
1908
|
customer_notes?:string;
|
|
1909
|
+
|
|
1910
|
+
/**
|
|
1911
|
+
* @description Parameters for transaction
|
|
1912
|
+
|
|
1913
|
+
*/
|
|
1914
|
+
|
|
381
1915
|
transaction?:{amount?:number,date:number,payment_method:PaymentMethod,reference_number?:string};
|
|
1916
|
+
|
|
1917
|
+
/**
|
|
1918
|
+
* @description Parameters for credit_note
|
|
1919
|
+
|
|
1920
|
+
*/
|
|
1921
|
+
|
|
382
1922
|
credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'chargeback' | 'order_change' | 'waiver'};
|
|
383
1923
|
}
|
|
384
|
-
export interface PdfResponse {
|
|
385
|
-
|
|
1924
|
+
export interface PdfResponse {
|
|
1925
|
+
download:Download;
|
|
386
1926
|
}
|
|
387
1927
|
export interface PdfInputParam {
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* @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
|
|
1931
|
+
|
|
1932
|
+
*/
|
|
1933
|
+
|
|
388
1934
|
disposition_type?:DispositionType;
|
|
389
1935
|
}
|
|
390
|
-
export interface DownloadEinvoiceResponse {
|
|
391
|
-
|
|
1936
|
+
export interface DownloadEinvoiceResponse {
|
|
1937
|
+
downloads:Download[];
|
|
392
1938
|
}
|
|
393
1939
|
|
|
394
|
-
export interface LineItem {
|
|
1940
|
+
export interface LineItem {
|
|
395
1941
|
id?:string;
|
|
1942
|
+
|
|
396
1943
|
subscription_id?:string;
|
|
1944
|
+
|
|
397
1945
|
date_from?:number;
|
|
1946
|
+
|
|
398
1947
|
date_to?:number;
|
|
1948
|
+
|
|
399
1949
|
unit_amount?:number;
|
|
1950
|
+
|
|
400
1951
|
quantity?:number;
|
|
1952
|
+
|
|
401
1953
|
amount?:number;
|
|
1954
|
+
|
|
402
1955
|
pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
|
|
1956
|
+
|
|
403
1957
|
is_taxed?:boolean;
|
|
1958
|
+
|
|
404
1959
|
tax_amount?:number;
|
|
1960
|
+
|
|
405
1961
|
tax_rate?:number;
|
|
1962
|
+
|
|
406
1963
|
unit_amount_in_decimal?:string;
|
|
1964
|
+
|
|
407
1965
|
quantity_in_decimal?:string;
|
|
1966
|
+
|
|
408
1967
|
amount_in_decimal?:string;
|
|
1968
|
+
|
|
409
1969
|
discount_amount?:number;
|
|
1970
|
+
|
|
410
1971
|
item_level_discount_amount?:number;
|
|
1972
|
+
|
|
411
1973
|
reference_line_item_id?:string;
|
|
1974
|
+
|
|
412
1975
|
description?:string;
|
|
1976
|
+
|
|
413
1977
|
entity_description?:string;
|
|
1978
|
+
|
|
414
1979
|
entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
|
|
1980
|
+
|
|
415
1981
|
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';
|
|
1982
|
+
|
|
416
1983
|
entity_id?:string;
|
|
1984
|
+
|
|
417
1985
|
customer_id?:string;
|
|
418
1986
|
}
|
|
419
|
-
export interface Discount {
|
|
1987
|
+
export interface Discount {
|
|
420
1988
|
amount?:number;
|
|
1989
|
+
|
|
421
1990
|
description?:string;
|
|
1991
|
+
|
|
422
1992
|
line_item_id?:string;
|
|
1993
|
+
|
|
423
1994
|
entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
1995
|
+
|
|
424
1996
|
discount_type?:'fixed_amount' | 'percentage';
|
|
1997
|
+
|
|
425
1998
|
entity_id?:string;
|
|
1999
|
+
|
|
426
2000
|
coupon_set_code?:string;
|
|
427
2001
|
}
|
|
428
|
-
export interface LineItemDiscount {
|
|
2002
|
+
export interface LineItemDiscount {
|
|
429
2003
|
line_item_id?:string;
|
|
2004
|
+
|
|
430
2005
|
discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
2006
|
+
|
|
431
2007
|
coupon_id?:string;
|
|
2008
|
+
|
|
432
2009
|
entity_id?:string;
|
|
2010
|
+
|
|
433
2011
|
discount_amount?:number;
|
|
434
2012
|
}
|
|
435
|
-
export interface Tax {
|
|
2013
|
+
export interface Tax {
|
|
436
2014
|
name?:string;
|
|
2015
|
+
|
|
437
2016
|
amount?:number;
|
|
2017
|
+
|
|
438
2018
|
description?:string;
|
|
439
2019
|
}
|
|
440
|
-
export interface LineItemTax {
|
|
2020
|
+
export interface LineItemTax {
|
|
441
2021
|
line_item_id?:string;
|
|
2022
|
+
|
|
442
2023
|
tax_name?:string;
|
|
2024
|
+
|
|
443
2025
|
tax_rate?:number;
|
|
2026
|
+
|
|
444
2027
|
is_partial_tax_applied?:boolean;
|
|
2028
|
+
|
|
445
2029
|
is_non_compliance_tax?:boolean;
|
|
2030
|
+
|
|
446
2031
|
taxable_amount?:number;
|
|
2032
|
+
|
|
447
2033
|
tax_amount?:number;
|
|
2034
|
+
|
|
448
2035
|
tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
|
|
2036
|
+
|
|
449
2037
|
tax_juris_name?:string;
|
|
2038
|
+
|
|
450
2039
|
tax_juris_code?:string;
|
|
2040
|
+
|
|
451
2041
|
tax_amount_in_local_currency?:number;
|
|
2042
|
+
|
|
452
2043
|
local_currency_code?:string;
|
|
453
2044
|
}
|
|
454
|
-
export interface LineItemTier {
|
|
2045
|
+
export interface LineItemTier {
|
|
455
2046
|
line_item_id?:string;
|
|
2047
|
+
|
|
456
2048
|
starting_unit?:number;
|
|
2049
|
+
|
|
457
2050
|
ending_unit?:number;
|
|
2051
|
+
|
|
458
2052
|
quantity_used?:number;
|
|
2053
|
+
|
|
459
2054
|
unit_amount?:number;
|
|
2055
|
+
|
|
460
2056
|
starting_unit_in_decimal?:string;
|
|
2057
|
+
|
|
461
2058
|
ending_unit_in_decimal?:string;
|
|
2059
|
+
|
|
462
2060
|
quantity_used_in_decimal?:string;
|
|
2061
|
+
|
|
463
2062
|
unit_amount_in_decimal?:string;
|
|
464
2063
|
}
|
|
465
|
-
export interface InvoiceTransaction {
|
|
2064
|
+
export interface InvoiceTransaction {
|
|
466
2065
|
txn_id?:string;
|
|
2066
|
+
|
|
467
2067
|
applied_amount?:number;
|
|
2068
|
+
|
|
468
2069
|
applied_at?:number;
|
|
2070
|
+
|
|
469
2071
|
txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
|
|
2072
|
+
|
|
470
2073
|
txn_date?:number;
|
|
2074
|
+
|
|
471
2075
|
txn_amount?:number;
|
|
472
2076
|
}
|
|
473
|
-
export interface DunningAttempt {
|
|
2077
|
+
export interface DunningAttempt {
|
|
474
2078
|
attempt?:number;
|
|
2079
|
+
|
|
475
2080
|
transaction_id?:string;
|
|
2081
|
+
|
|
476
2082
|
dunning_type?:'offline' | 'auto_collect' | 'direct_debit';
|
|
2083
|
+
|
|
477
2084
|
created_at?:number;
|
|
2085
|
+
|
|
478
2086
|
txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
|
|
2087
|
+
|
|
479
2088
|
txn_amount?:number;
|
|
480
2089
|
}
|
|
481
|
-
export interface AppliedCredit {
|
|
2090
|
+
export interface AppliedCredit {
|
|
482
2091
|
cn_id?:string;
|
|
2092
|
+
|
|
483
2093
|
applied_amount?:number;
|
|
2094
|
+
|
|
484
2095
|
applied_at?:number;
|
|
2096
|
+
|
|
485
2097
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2098
|
+
|
|
486
2099
|
cn_create_reason_code?:string;
|
|
2100
|
+
|
|
487
2101
|
cn_date?:number;
|
|
2102
|
+
|
|
488
2103
|
cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
489
2104
|
}
|
|
490
|
-
export interface CreatedCreditNote {
|
|
2105
|
+
export interface CreatedCreditNote {
|
|
491
2106
|
cn_id?:string;
|
|
2107
|
+
|
|
492
2108
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2109
|
+
|
|
493
2110
|
cn_create_reason_code?:string;
|
|
2111
|
+
|
|
494
2112
|
cn_date?:number;
|
|
2113
|
+
|
|
495
2114
|
cn_total?:number;
|
|
2115
|
+
|
|
496
2116
|
cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
497
2117
|
}
|
|
498
|
-
export interface CreatedCreditNote {
|
|
2118
|
+
export interface CreatedCreditNote {
|
|
499
2119
|
cn_id?:string;
|
|
2120
|
+
|
|
500
2121
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2122
|
+
|
|
501
2123
|
cn_create_reason_code?:string;
|
|
2124
|
+
|
|
502
2125
|
cn_date?:number;
|
|
2126
|
+
|
|
503
2127
|
cn_total?:number;
|
|
2128
|
+
|
|
504
2129
|
cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
505
2130
|
}
|
|
506
|
-
export interface LinkedOrder {
|
|
2131
|
+
export interface LinkedOrder {
|
|
507
2132
|
id?:string;
|
|
2133
|
+
|
|
508
2134
|
document_number?:string;
|
|
2135
|
+
|
|
509
2136
|
status?:'new' | 'partially_delivered' | 'queued' | 'delivered' | 'on_hold' | 'shipped' | 'processing' | 'cancelled' | 'voided' | 'complete' | 'awaiting_shipment' | 'returned';
|
|
2137
|
+
|
|
510
2138
|
order_type?:'system_generated' | 'manual';
|
|
2139
|
+
|
|
511
2140
|
reference_id?:string;
|
|
2141
|
+
|
|
512
2142
|
fulfillment_status?:string;
|
|
2143
|
+
|
|
513
2144
|
batch_id?:string;
|
|
2145
|
+
|
|
514
2146
|
created_at?:number;
|
|
515
2147
|
}
|
|
516
|
-
export interface Note {
|
|
2148
|
+
export interface Note {
|
|
517
2149
|
entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price' | 'tax' | 'subscription' | 'customer';
|
|
2150
|
+
|
|
518
2151
|
note?:string;
|
|
2152
|
+
|
|
519
2153
|
entity_id?:string;
|
|
520
2154
|
}
|
|
521
|
-
export interface ShippingAddress {
|
|
2155
|
+
export interface ShippingAddress {
|
|
2156
|
+
/**
|
|
2157
|
+
* @description The first name of the contact.
|
|
2158
|
+
|
|
2159
|
+
*/
|
|
2160
|
+
|
|
522
2161
|
first_name?:string;
|
|
2162
|
+
|
|
2163
|
+
/**
|
|
2164
|
+
* @description The last name of the contact.
|
|
2165
|
+
|
|
2166
|
+
*/
|
|
2167
|
+
|
|
523
2168
|
last_name?:string;
|
|
2169
|
+
|
|
2170
|
+
/**
|
|
2171
|
+
* @description The email address.
|
|
2172
|
+
|
|
2173
|
+
*/
|
|
2174
|
+
|
|
524
2175
|
email?:string;
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* @description The company name.
|
|
2179
|
+
|
|
2180
|
+
*/
|
|
2181
|
+
|
|
525
2182
|
company?:string;
|
|
2183
|
+
|
|
2184
|
+
/**
|
|
2185
|
+
* @description The phone number.
|
|
2186
|
+
|
|
2187
|
+
*/
|
|
2188
|
+
|
|
526
2189
|
phone?:string;
|
|
2190
|
+
|
|
2191
|
+
/**
|
|
2192
|
+
* @description Address line 1
|
|
2193
|
+
|
|
2194
|
+
*/
|
|
2195
|
+
|
|
527
2196
|
line1?:string;
|
|
2197
|
+
|
|
2198
|
+
/**
|
|
2199
|
+
* @description Address line 2
|
|
2200
|
+
|
|
2201
|
+
*/
|
|
2202
|
+
|
|
528
2203
|
line2?:string;
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* @description Address line 3
|
|
2207
|
+
|
|
2208
|
+
*/
|
|
2209
|
+
|
|
529
2210
|
line3?:string;
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* @description The name of the city.
|
|
2214
|
+
|
|
2215
|
+
*/
|
|
2216
|
+
|
|
530
2217
|
city?:string;
|
|
2218
|
+
|
|
2219
|
+
/**
|
|
2220
|
+
* @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`).
|
|
2221
|
+
|
|
2222
|
+
*/
|
|
2223
|
+
|
|
531
2224
|
state_code?:string;
|
|
2225
|
+
|
|
2226
|
+
/**
|
|
2227
|
+
* @description The state/province name.
|
|
2228
|
+
|
|
2229
|
+
*/
|
|
2230
|
+
|
|
532
2231
|
state?:string;
|
|
2232
|
+
|
|
2233
|
+
/**
|
|
2234
|
+
* @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).
|
|
2235
|
+
|
|
2236
|
+
**Note** : If you enter an invalid country code, the system will return an error.
|
|
2237
|
+
|
|
2238
|
+
**Brexit**
|
|
2239
|
+
|
|
2240
|
+
|
|
2241
|
+
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.
|
|
2242
|
+
|
|
2243
|
+
*/
|
|
2244
|
+
|
|
533
2245
|
country?:string;
|
|
2246
|
+
|
|
2247
|
+
/**
|
|
2248
|
+
* @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
|
|
2249
|
+
|
|
2250
|
+
*/
|
|
2251
|
+
|
|
534
2252
|
zip?:string;
|
|
2253
|
+
|
|
2254
|
+
/**
|
|
2255
|
+
* @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.
|
|
2256
|
+
|
|
2257
|
+
*/
|
|
2258
|
+
|
|
535
2259
|
validation_status?:ValidationStatus;
|
|
2260
|
+
|
|
2261
|
+
/**
|
|
2262
|
+
* @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.
|
|
2263
|
+
|
|
2264
|
+
*/
|
|
2265
|
+
|
|
536
2266
|
index?:number;
|
|
537
2267
|
}
|
|
538
|
-
export interface BillingAddress {
|
|
2268
|
+
export interface BillingAddress {
|
|
2269
|
+
/**
|
|
2270
|
+
* @description The first name of the billing contact.
|
|
2271
|
+
|
|
2272
|
+
*/
|
|
2273
|
+
|
|
539
2274
|
first_name?:string;
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* @description The last name of the billing contact.
|
|
2278
|
+
|
|
2279
|
+
*/
|
|
2280
|
+
|
|
540
2281
|
last_name?:string;
|
|
2282
|
+
|
|
2283
|
+
/**
|
|
2284
|
+
* @description The email address.
|
|
2285
|
+
|
|
2286
|
+
*/
|
|
2287
|
+
|
|
541
2288
|
email?:string;
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* @description The company name.
|
|
2292
|
+
|
|
2293
|
+
*/
|
|
2294
|
+
|
|
542
2295
|
company?:string;
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* @description The phone number.
|
|
2299
|
+
|
|
2300
|
+
*/
|
|
2301
|
+
|
|
543
2302
|
phone?:string;
|
|
2303
|
+
|
|
2304
|
+
/**
|
|
2305
|
+
* @description Address line 1
|
|
2306
|
+
|
|
2307
|
+
*/
|
|
2308
|
+
|
|
544
2309
|
line1?:string;
|
|
2310
|
+
|
|
2311
|
+
/**
|
|
2312
|
+
* @description Address line 2
|
|
2313
|
+
|
|
2314
|
+
*/
|
|
2315
|
+
|
|
545
2316
|
line2?:string;
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* @description Address line 3
|
|
2320
|
+
|
|
2321
|
+
*/
|
|
2322
|
+
|
|
546
2323
|
line3?:string;
|
|
2324
|
+
|
|
2325
|
+
/**
|
|
2326
|
+
* @description The name of the city.
|
|
2327
|
+
|
|
2328
|
+
*/
|
|
2329
|
+
|
|
547
2330
|
city?:string;
|
|
2331
|
+
|
|
2332
|
+
/**
|
|
2333
|
+
* @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`).
|
|
2334
|
+
|
|
2335
|
+
*/
|
|
2336
|
+
|
|
548
2337
|
state_code?:string;
|
|
2338
|
+
|
|
2339
|
+
/**
|
|
2340
|
+
* @description State or Province
|
|
2341
|
+
|
|
2342
|
+
*/
|
|
2343
|
+
|
|
549
2344
|
state?:string;
|
|
2345
|
+
|
|
2346
|
+
/**
|
|
2347
|
+
* @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).
|
|
2348
|
+
|
|
2349
|
+
**Note** : If you enter an invalid country code, the system will return an error.
|
|
2350
|
+
|
|
2351
|
+
**Brexit**
|
|
2352
|
+
|
|
2353
|
+
|
|
2354
|
+
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.
|
|
2355
|
+
|
|
2356
|
+
*/
|
|
2357
|
+
|
|
550
2358
|
country?:string;
|
|
2359
|
+
|
|
2360
|
+
/**
|
|
2361
|
+
* @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
|
|
2362
|
+
|
|
2363
|
+
*/
|
|
2364
|
+
|
|
551
2365
|
zip?:string;
|
|
2366
|
+
|
|
2367
|
+
/**
|
|
2368
|
+
* @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.
|
|
2369
|
+
|
|
2370
|
+
*/
|
|
2371
|
+
|
|
552
2372
|
validation_status?:ValidationStatus;
|
|
553
2373
|
}
|
|
554
|
-
export interface Einvoice {
|
|
2374
|
+
export interface Einvoice {
|
|
2375
|
+
/**
|
|
2376
|
+
* @description The unique `id` for the e-invoice. This is auto-generated by Chargebee.
|
|
2377
|
+
|
|
2378
|
+
*/
|
|
2379
|
+
|
|
555
2380
|
id?:string;
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* @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.
|
|
2384
|
+
|
|
2385
|
+
*/
|
|
2386
|
+
|
|
556
2387
|
reference_number?:string;
|
|
2388
|
+
|
|
2389
|
+
/**
|
|
2390
|
+
* @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.
|
|
2391
|
+
|
|
2392
|
+
*/
|
|
2393
|
+
|
|
557
2394
|
status?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
|
|
2395
|
+
|
|
2396
|
+
/**
|
|
2397
|
+
* @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:
|
|
2398
|
+
|
|
2399
|
+
* Invoice successfully sent to customer via the e-invoicing network 9090:123456
|
|
2400
|
+
* Invoice successfully sent to customer via email id abc@acme.com
|
|
2401
|
+
|
|
2402
|
+
*/
|
|
2403
|
+
|
|
558
2404
|
message?:string;
|
|
559
2405
|
}
|
|
560
|
-
export interface LinkedTaxWithheld {
|
|
2406
|
+
export interface LinkedTaxWithheld {
|
|
561
2407
|
id?:string;
|
|
2408
|
+
|
|
562
2409
|
amount?:number;
|
|
2410
|
+
|
|
563
2411
|
description?:string;
|
|
2412
|
+
|
|
564
2413
|
date?:number;
|
|
2414
|
+
|
|
565
2415
|
reference_number?:string;
|
|
566
2416
|
}
|
|
567
2417
|
}
|