chargebee 2.46.0 → 2.48.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.
@@ -3,1418 +3,523 @@
3
3
  declare module 'chargebee' {
4
4
  export interface Invoice {
5
5
 
6
- /**
7
- * @description The invoice number. Acts as a identifier for invoice and typically generated sequentially.
8
6
 
9
- */
10
-
11
7
  id:string;
12
-
13
- /**
14
- * @description Purchase Order Number for this invoice
15
8
 
16
- */
17
-
18
9
  po_number?:string;
19
-
20
- /**
21
- * @description The identifier of the customer this invoice belongs to.
22
10
 
23
- */
24
-
25
11
  customer_id:string;
26
-
27
- /**
28
- * @description The identifier of the subscription this invoice belongs to.
29
- **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.
30
12
 
31
- */
32
-
33
13
  subscription_id?:string;
34
-
35
- /**
36
- * @description Boolean indicating whether this invoice belongs to a subscription
37
14
 
38
- */
39
-
40
15
  recurring:boolean;
41
-
42
- /**
43
- * @description Current status of this 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 -
44
- 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`.
45
- 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. \* not_paid - Indicates the payment is not made and all attempts to collect is failed. \* voided - Indicates a voided invoice.
46
16
 
47
- */
48
-
49
- status:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
50
-
51
- /**
52
- * @description VAT/ Tax registration number of the customer. [Learn more](https://www.chargebee.com/docs/tax.html#capture-tax-registration-number)
17
+ status:'paid' | 'posted' | 'payment_due' | 'not_paid' | 'voided' | 'pending';
53
18
 
54
- */
55
-
56
19
  vat_number?:string;
57
-
58
- /**
59
- * @description The price type of the invoice. \* tax_exclusive - All amounts in the document are exclusive of tax. \* tax_inclusive - All amounts in the document are inclusive of tax.
60
20
 
61
- */
62
-
63
21
  price_type:PriceType;
64
-
65
- /**
66
- * @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.
67
22
 
68
- */
69
-
70
23
  date?:number;
71
-
72
- /**
73
- * @description Due date of the invoice
74
24
 
75
- */
76
-
77
25
  due_date?:number;
78
-
79
- /**
80
- * @description Number of days within which the invoice has to be paid
81
26
 
82
- */
83
-
84
27
  net_term_days?:number;
85
-
86
- /**
87
- * @description Exchange rate used for base currency conversion.
88
28
 
89
- 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.
90
- **Exchange rate** = tax_amount_in_local_currency / tax_amount
91
-
92
- */
93
-
94
29
  exchange_rate?:number;
95
-
96
- /**
97
- * @description The currency code (ISO 4217 format) for the invoice
98
30
 
99
- */
100
-
101
31
  currency_code:string;
102
-
103
- /**
104
- * @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.
105
32
 
106
- */
107
-
108
33
  total?:number;
109
-
110
- /**
111
- * @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`.
112
34
 
113
- */
114
-
115
35
  amount_paid?:number;
116
-
117
- /**
118
- * @description Total adjustments made against this invoice.
119
36
 
120
- */
121
-
122
37
  amount_adjusted?:number;
123
-
124
- /**
125
- * @description Amount written off against this invoice.
126
38
 
127
- */
128
-
129
39
  write_off_amount?:number;
130
-
131
- /**
132
- * @description Total credits applied against this invoice.
133
40
 
134
- */
135
-
136
41
  credits_applied?:number;
137
-
138
- /**
139
- * @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`.
140
42
 
141
- */
142
-
143
43
  amount_due?:number;
144
-
145
- /**
146
- * @description Timestamp indicating the date \& time this invoice got paid.
147
44
 
148
- */
149
-
150
45
  paid_at?:number;
151
-
152
- /**
153
- * @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.
154
46
 
155
- */
156
-
157
- dunning_status?:'in_progress' | 'stopped' | 'success' | 'exhausted';
158
-
159
- /**
160
- * @description Timestamp indicating when will the next attempt to collect payment for this invoice occur.
47
+ dunning_status?:'in_progress' | 'exhausted' | 'stopped' | 'success';
161
48
 
162
- */
163
-
164
49
  next_retry_at?:number;
165
-
166
- /**
167
- * @description Timestamp indicating the date \& time this invoice got voided.
168
50
 
169
- */
170
-
171
51
  voided_at?:number;
172
-
173
- /**
174
- * @description The version number of this resource. For every change made to the resource, `resource_version` is updated with a new timestamp in milliseconds.
175
52
 
176
- */
177
-
178
53
  resource_version?:number;
179
-
180
- /**
181
- * @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.
182
- **Note** : This value does not change when the following attributes are changed: *next_retry_at, dunning_status, has_advance_charges*
183
54
 
184
- */
185
-
186
55
  updated_at?:number;
187
-
188
- /**
189
- * @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`.
190
56
 
191
- */
192
-
193
57
  sub_total:number;
194
-
195
- /**
196
- * @description Invoice subtotal in the currency of the place of supply.
197
58
 
198
- */
199
-
200
59
  sub_total_in_local_currency?:number;
201
-
202
- /**
203
- * @description Total invoice amount in the currency of the place of supply.
204
60
 
205
- */
206
-
207
61
  total_in_local_currency?:number;
208
-
209
- /**
210
- * @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed.
211
62
 
212
- */
213
-
214
63
  local_currency_code?:string;
215
-
216
- /**
217
- * @description Total tax amount for this invoice
218
64
 
219
- */
220
-
221
65
  tax:number;
222
-
223
- /**
224
- * @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.
225
66
 
226
- */
227
-
228
67
  local_currency_exchange_rate?:number;
229
-
230
- /**
231
- * @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.
232
68
 
233
- */
234
-
235
69
  first_invoice?:boolean;
236
-
237
- /**
238
- * @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.
239
70
 
240
- */
241
-
242
71
  new_sales_amount?:number;
243
-
244
- /**
245
- * @description Boolean indicating any advance charge is present in this invoice.
246
72
 
247
- */
248
-
249
73
  has_advance_charges?:boolean;
250
-
251
- /**
252
- * @description Boolean indicating this invoice line_items terms are finalized or not.
253
74
 
254
- */
255
-
256
75
  term_finalized:boolean;
257
-
258
- /**
259
- * @description Boolean indicating this invoice is gifted or not.
260
76
 
261
- */
262
-
263
77
  is_gifted:boolean;
264
-
265
- /**
266
- * @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.
267
78
 
268
- */
269
-
270
79
  generated_at?:number;
271
-
272
- /**
273
- * @description Expected payment date recorded for this invoice.
274
80
 
275
- */
276
-
277
81
  expected_payment_date?:number;
278
-
279
- /**
280
- * @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`.
281
82
 
282
- */
283
-
284
83
  amount_to_collect?:number;
285
-
286
- /**
287
- * @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`.
288
84
 
289
- */
290
-
291
85
  round_off_amount?:number;
292
-
293
- /**
294
- * @description Payment owner of an invoice
295
-
296
- */
297
-
298
- payment_owner?:string;
299
-
300
- /**
301
- * @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
302
-
303
- */
304
-
305
- void_reason_code?:string;
306
-
307
- /**
308
- * @description Indicates that this resource has been deleted.
309
-
310
- */
311
-
312
- deleted:boolean;
313
-
314
- /**
315
- * @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.
316
-
317
- */
318
-
319
- tax_category?:string;
320
-
321
- /**
322
- * @description An overridden value for the first two characters of the [full VAT
323
- 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** ).
324
-
325
- When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
326
- 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
327
- 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.
328
-
329
- */
330
-
331
- vat_number_prefix?:string;
332
-
333
- /**
334
- * @description The subscription channel this object originated from and is maintained in. \* 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. \* 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.
335
-
336
- In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information. \* web - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI.
337
-
338
- */
339
-
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
-
347
- business_entity_id?:string;
348
-
349
- /**
350
- * @description The list of line items for this invoice
351
86
 
352
- */
353
-
354
87
  line_items?:Invoice.LineItem[];
355
-
356
- /**
357
- * @description The list of all deductions applied to the invoice.
358
88
 
359
- */
360
-
361
89
  discounts?:Invoice.Discount[];
362
-
363
- /**
364
- * @description The list of deduction(s) applied for each line item of this invoice
365
90
 
366
- */
367
-
368
91
  line_item_discounts?:Invoice.LineItemDiscount[];
369
-
370
- /**
371
- * @description The list of taxes applied for this invoice
372
92
 
373
- */
374
-
375
93
  taxes?:Invoice.Tax[];
376
-
377
- /**
378
- * @description The list of taxes applied on line items
379
94
 
380
- */
381
-
382
95
  line_item_taxes?:Invoice.LineItemTax[];
383
-
384
- /**
385
- * @description The list of tiers applicable for this line item
386
96
 
387
- */
388
-
97
+ line_item_credits?:Invoice.LineItemCredit[];
98
+
389
99
  line_item_tiers?:Invoice.LineItemTier[];
390
-
391
- /**
392
- * @description The list of transactions for this invoice
393
100
 
394
- */
395
-
396
- linked_payments?:Invoice.InvoiceTransaction[];
397
-
398
- /**
399
- * @description The list of dunning_attempts for this invoice
101
+ linked_payments?:Invoice.LinkedPayment[];
400
102
 
401
- */
402
-
403
103
  dunning_attempts?:Invoice.DunningAttempt[];
404
-
405
- /**
406
- * @description Refundable Credits applied on this invoice.
407
104
 
408
- */
409
-
410
105
  applied_credits?:Invoice.AppliedCredit[];
411
-
412
- /**
413
- * @description Adjustments created for this invoice
414
106
 
415
- */
416
-
417
- adjustment_credit_notes?:Invoice.CreatedCreditNote[];
418
-
419
- /**
420
- * @description Credit notes issued for this invoice
107
+ adjustment_credit_notes?:Invoice.AdjustmentCreditNote[];
421
108
 
422
- */
423
-
424
- issued_credit_notes?:Invoice.CreatedCreditNote[];
425
-
426
- /**
427
- * @description The list of orders for this invoice
109
+ issued_credit_notes?:Invoice.IssuedCreditNote[];
428
110
 
429
- */
430
-
431
111
  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
112
 
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
-
441
113
  notes?:Invoice.Note[];
442
-
443
- /**
444
- * @description Shipping address for the invoice.
445
114
 
446
- */
447
-
448
115
  shipping_address?:Invoice.ShippingAddress;
449
-
450
- /**
451
- * @description Statement descriptor for the invoice.
452
116
 
453
- */
454
-
455
117
  statement_descriptor?:Invoice.StatementDescriptor;
456
-
457
- /**
458
- * @description Billing address for the invoice.
459
118
 
460
- */
461
-
462
119
  billing_address?:Invoice.BillingAddress;
463
-
464
- /**
465
- * @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.
466
120
 
467
- */
468
-
469
121
  einvoice?:Invoice.Einvoice;
470
-
471
- /**
472
- * @description Details of `tax_withheld` against this invoice.
473
122
 
474
- */
475
-
476
- linked_taxes_withheld?:Invoice.LinkedTaxWithheld[];
123
+ payment_owner?:string;
124
+
125
+ void_reason_code?:string;
126
+
127
+ deleted:boolean;
128
+
129
+ tax_category?:string;
130
+
131
+ vat_number_prefix?:string;
132
+
133
+ channel?:Channel;
134
+
135
+ business_entity_id?:string;
136
+
477
137
  site_details_at_creation?:Invoice.SiteDetailsAtCreation;
138
+
478
139
  tax_origin?:Invoice.TaxOrigin;
140
+
479
141
  }
480
142
  export namespace Invoice {
481
143
  export class InvoiceResource {
482
- /**
483
- * @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`.
484
-
485
- */
486
-
144
+ create(input?:CreateInputParam):ChargebeeRequest<CreateResponse>;
145
+
487
146
  create_for_charge_items_and_charges(input:CreateForChargeItemsAndChargesInputParam):ChargebeeRequest<CreateForChargeItemsAndChargesResponse>;
488
147
 
489
- /**
490
- * @description This API is used to stop dunning for &quot;Payment Due&quot; invoices that have been enabled for Auto Collection. When dunning is stopped, the status of the invoice will be changed to &quot;Not Paid&quot;.
491
-
492
- */
493
-
148
+ charge(input:ChargeInputParam):ChargebeeRequest<ChargeResponse>;
149
+
150
+ charge_addon(input:ChargeAddonInputParam):ChargebeeRequest<ChargeAddonResponse>;
151
+
152
+ create_for_charge_item(input:CreateForChargeItemInputParam):ChargebeeRequest<CreateForChargeItemResponse>;
153
+
494
154
  stop_dunning(invoice_id:string, input?:StopDunningInputParam):ChargebeeRequest<StopDunningResponse>;
495
155
 
496
- /**
497
- * @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.
498
-
499
- */
500
-
501
156
  import_invoice(input:ImportInvoiceInputParam):ChargebeeRequest<ImportInvoiceResponse>;
502
157
 
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 &#x60;status&#x60; changes to either &#x60;paid&#x60; or &#x60;payment_due&#x60; 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 &#x60;paid&#x60;, and [invoice.amount_due](invoices#invoice_amount_due) is adjusted to $25.00.
507
-
508
- */
509
-
510
158
  apply_payments(invoice_id:string, input?:ApplyPaymentsInputParam):ChargebeeRequest<ApplyPaymentsResponse>;
511
159
 
512
- /**
513
- * @description Updates the [&#x60;quantity&#x60;](/docs/api/invoices#invoice_line_items_quantity) for &#x60;metered&#x60; [&#x60;line_items&#x60;](/docs/api/invoices#invoice_line_items) of an invoice to reflect the latest [usage](https://apidocs.chargebee.com/docs/api/usages) data.
514
-
515
- **Note:** This operation is done automatically while [closing](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice) the invoice.
516
-
517
- */
518
-
519
160
  sync_usages(invoice_id:string):ChargebeeRequest<SyncUsagesResponse>;
520
161
 
521
- /**
522
- * @description This endpoint is used to delete line items from &quot;Pending&quot; invoice.
523
-
524
- */
525
-
526
162
  delete_line_items(invoice_id:string, input?:DeleteLineItemsInputParam):ChargebeeRequest<DeleteLineItemsResponse>;
527
163
 
528
- /**
529
- * @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 &#x60;paid&#x60; or &#x60;payment_due&#x60; depending on how much credit is applied to the invoice amount.
530
-
531
- */
532
-
533
164
  apply_credits(invoice_id:string, input?:ApplyCreditsInputParam):ChargebeeRequest<ApplyCreditsResponse>;
534
165
 
535
- /**
536
- * @description Lists all the Invoices.
537
-
538
- */
539
-
540
166
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
541
167
 
542
- /**
543
- * @description Retrieve the invoice for the specified invoice id.
544
-
545
- */
546
-
547
- retrieve(invoice_id:string):ChargebeeRequest<RetrieveResponse>;
168
+ invoices_for_customer(customer_id:string, input?:InvoicesForCustomerInputParam):ChargebeeRequest<InvoicesForCustomerResponse>;
169
+
170
+ invoices_for_subscription(subscription_id:string, input?:InvoicesForSubscriptionInputParam):ChargebeeRequest<InvoicesForSubscriptionResponse>;
171
+
172
+ retrieve(invoice_id:string, input?:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
548
173
 
549
- /**
550
- * @description Gets the invoice as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
551
-
552
- #### Related Tutorial
553
-
554
- * [Check out customer portal tutorial on how to download invoice as PDF.](//www.chargebee.com/tutorials/customer-portal-sample.html#downloading_invoices_as_pdf)
555
-
556
- */
557
-
558
174
  pdf(invoice_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
559
175
 
560
- /**
561
- * @description Download the e-invoice in both XML and PDF formats. The response consists of a &#x60;download&#x60; 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/).
562
- **Note**
563
-
564
- * You can only download e-invoices when their &#x60;status&#x60; is &#x60;success&#x60;.
565
- * 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.
566
-
567
- */
568
-
569
176
  download_einvoice(invoice_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
570
177
 
571
- /**
572
- * @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 &#x60;invoice_id&#x60; or the &#x60;payment_reference_number[number]&#x60; to retrieve the PRN.
573
-
574
- */
575
-
576
178
  list_payment_reference_numbers(input?:ListPaymentReferenceNumbersInputParam):ChargebeeRequest<ListPaymentReferenceNumbersResponse>;
577
179
 
578
- /**
579
- * @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&#x3D;2&amp;lang&#x3D;curl#invoice_line_items) of [entity_type](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver&#x3D;2&amp;lang&#x3D;curl#invoice_line_items_entity_type) &#x60;adhoc&#x60;.
580
-
581
- */
582
-
583
180
  add_charge(invoice_id:string, input:AddChargeInputParam):ChargebeeRequest<AddChargeResponse>;
584
181
 
585
- /**
586
- * @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&#x3D;2) to a &#x60;pending&#x60; invoice. To collect the accumulated charges by closing the invoice, call [Close a pending invoice](./invoices?prod_cat_ver&#x3D;2#close_a_pending_invoice).
587
-
588
- */
589
-
182
+ add_addon_charge(invoice_id:string, input:AddAddonChargeInputParam):ChargebeeRequest<AddAddonChargeResponse>;
183
+
590
184
  add_charge_item(invoice_id:string, input:AddChargeItemInputParam):ChargebeeRequest<AddChargeItemResponse>;
591
185
 
592
- /**
593
- * @description Invoices for a subscription are created with a &#x60;pending&#x60; &#x60;status&#x60; when the subscription has &#x60;create_pending_invoices&#x60; attribute set to &#x60;true&#x60;. This API call finalizes a &#x60;pending&#x60; invoice. Any &#x60;refundable_credits&#x60; and &#x60;excess_payments&#x60; for the customer are applied to the invoice, and any payment due is collected automatically if &#x60;auto_collection&#x60; is &#x60;on&#x60; for the customer.
594
-
595
- #### Automation
596
-
597
- 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&#x3D;2#customer_auto_close_invoices) and [subscription](/docs/api/subscriptions?prod_cat_ver&#x3D;2#subscription_auto_close_invoices) level.
598
-
599
- */
600
-
601
186
  close(invoice_id:string, input?:CloseInputParam):ChargebeeRequest<CloseResponse>;
602
187
 
603
- /**
604
- * @description **Important:**
605
-
606
- * Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](https://apidocs.chargebee.com/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
607
- * This endpoint returns an error if a payment is initiated for an invoice with a [status](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_status) of &#x60;payment_due&#x60; associated with the &#x60;app_store&#x60; and &#x60;play_store&#x60; [channels](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_channel).
608
-
609
- This API is used to collect payments for &#x60;payment_due&#x60; and &#x60;not_paid invoices&#x60;. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
610
-
611
- Pass &#x60;authorization_transaction_id&#x60; 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 &#x60;payment_due&#x60;.
612
-
613
- */
614
-
615
188
  collect_payment(invoice_id:string, input?:CollectPaymentInputParam):ChargebeeRequest<CollectPaymentResponse>;
616
189
 
617
- /**
618
- * @description To record a [offline payment](https://www.chargebee.com/docs/offline_payments.html) for an invoice.
619
-
620
- The invoice status will be marked as &#x27;paid&#x27; if its amount due becomes 0 because of this recorded payment.
621
-
622
- **Note:** If the payment transaction amount is more than the invoice due amount, the remaining transaction amount will be added to the customer&#x27;s Excess Payments balance to be used against other invoices.
623
-
624
- */
625
-
626
190
  record_payment(invoice_id:string, input:RecordPaymentInputParam):ChargebeeRequest<RecordPaymentResponse>;
627
191
 
628
- /**
629
- * @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:
630
-
631
- * Tax Amount Withheld is enabled.
632
- * The &#x60;invoice&#x60; does not have a &#x60;linked_taxes_withheld&#x60; record associated with it already.
633
- * &#x60;invoice.amount_due&#x60; is greater than zero.
634
- * &#x60;invoice.status&#x60; is one of the following: &#x60;payment_due&#x60;, &#x60;not_paid&#x60;, or &#x60;posted&#x60;.
635
-
636
- */
637
-
638
192
  record_tax_withheld(invoice_id:string, input:RecordTaxWithheldInputParam):ChargebeeRequest<RecordTaxWithheldResponse>;
639
193
 
640
- /**
641
- * @description Removes a [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld) record from the &#x60;invoice&#x60; specified. This operation is allowed only when all of the following conditions are true:
642
-
643
- * [invoice.status](/docs/api/invoices#invoice_status) is one of the following: &#x60;payment_due&#x60;, &#x60;not_paid&#x60;, or &#x60;posted&#x60;.
644
- * There are no [adjustment_credit_notes](/docs/api/invoices#invoice_adjustment_credit_notes) associated with the invoice.
645
- * There are no [issued_credit_notes](/docs/api/invoices#invoice_issued_credit_notes) associated with the invoice.
646
-
647
- */
648
-
649
194
  remove_tax_withheld(invoice_id:string, input:RemoveTaxWithheldInputParam):ChargebeeRequest<RemoveTaxWithheldResponse>;
650
195
 
651
- /**
652
- * @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:
653
-
654
- * Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
655
- * Refund a fully refunded invoice.
656
-
657
- If the refund transaction succeeds, a &#x60;credit_note&#x60; capturing this refund detail is created for the invoice.
658
-
659
- */
660
-
661
196
  refund(invoice_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
662
197
 
663
- /**
664
- * @description Refunds the invoice. The refund is provided against the following in order of precedence:
665
-
666
- * Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
667
- * Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
668
- * Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
669
-
670
- **Example**
671
-
672
- Consider an invoice with the following payments and tax withheld.
673
-
674
- * Offline payments: $30
675
- * Online payments: $20
676
- * Tax withheld: $5
677
-
678
- When recording a refund worth $40, the refund amount is split as follows:
679
-
680
- * Refund against offline payments: $30
681
- * Refund against tax withheld: $5
682
- * Refund against online payments: $5
683
-
684
- 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.
685
- **Tip**
686
-
687
- If the order of precendence described above does not work for your use case, and you want to provide a refund against online &#x60;linked_payments&#x60; first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
688
-
689
- */
690
-
691
198
  record_refund(invoice_id:string, input:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
692
199
 
693
- /**
694
- * @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 &#x60;not_paid&#x60; or &#x60;payment_due&#x60;. The removed payment is then added to the customer&#x27;s excess payment balance.
695
-
696
- */
697
-
698
200
  remove_payment(invoice_id:string, input:RemovePaymentInputParam):ChargebeeRequest<RemovePaymentResponse>;
699
201
 
700
- /**
701
- * @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 &#x60;not_paid&#x60;.
702
-
703
- **Note:** You cannot remove a credit note from an invoice if it has already been refunded.
704
-
705
- */
706
-
707
202
  remove_credit_note(invoice_id:string, input:RemoveCreditNoteInputParam):ChargebeeRequest<RemoveCreditNoteResponse>;
708
203
 
709
- /**
710
- * @description Voids the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver&#x3D;2#remove_payment_from_an_invoice) from the invoice before voiding it.
711
-
712
- * Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver&#x3D;2) or [credit notes](/docs/api/credit_notes?prod_cat_ver&#x3D;2) applied to the invoice are removed.
713
- * If an invoice for the current term of a subscription is voided and the subscription is changed later with &#x60;proration&#x60; enabled, no prorated credits are issued.
714
- * Any [usages](/docs/api/usages?prod_cat_ver&#x3D;2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the &#x60;invoice_id&#x60; field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver&#x3D;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).
715
-
716
- */
717
-
718
204
  void_invoice(invoice_id:string, input?:VoidInvoiceInputParam):ChargebeeRequest<VoidInvoiceResponse>;
719
205
 
720
- /**
721
- * @description This API writes off an Invoice.
722
-
723
- */
724
-
725
206
  write_off(invoice_id:string, input?:WriteOffInputParam):ChargebeeRequest<WriteOffResponse>;
726
207
 
727
- /**
728
- * @description Deletes the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver&#x3D;2#remove_payment_from_an_invoice) from the invoice before deleting it.
729
- **Caution**
730
-
731
- All associated [usages](/docs/api/usages?prod_cat_ver&#x3D;2) are permanently deleted on deleting an invoice. If you want to regenerate such an invoice, [add](/docs/api/usages?prod_cat_ver&#x3D;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.
732
-
733
- * Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver&#x3D;2) or [credit notes](/docs/api/credit_notes?prod_cat_ver&#x3D;2) applied to the invoice are removed.
734
- * If an invoice for the current term of a subscription is deleted and the subscription is changed later with &#x60;proration&#x60; enabled, no prorated credits are issued.
735
-
736
- */
737
-
738
208
  delete(invoice_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
739
209
 
740
- /**
741
- * @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.
742
-
743
- **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&#x27;t change the corresponding customer/subscription details.
744
-
745
- */
746
-
747
210
  update_details(invoice_id:string, input?:UpdateDetailsInputParam):ChargebeeRequest<UpdateDetailsResponse>;
748
211
 
749
- /**
750
- * @description Resend failed einvoice of an invoice to the customer using this API.
751
-
752
- */
753
-
212
+ apply_payment_schedule_scheme(invoice_id:string, input:ApplyPaymentScheduleSchemeInputParam):ChargebeeRequest<ApplyPaymentScheduleSchemeResponse>;
213
+
214
+ payment_schedules(invoice_id:string):ChargebeeRequest<PaymentSchedulesResponse>;
215
+
754
216
  resend_einvoice(invoice_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
755
217
 
756
- /**
757
- * @description This endpoint is used to send an e-invoice for invoice.
758
-
759
- To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
760
-
761
- This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
762
-
763
- * If e-invoicing is not enabled at the site and customer level.
764
-
765
- * If there is an e-invoice generated already for the invoice.
766
-
767
- * If the &quot;**Use automatic e-invoicing**&quot; option is selected.
768
-
769
- * If there are no generated e-invoices with the &#x60;failed&#x60; or &#x60;skipped&#x60; status.
770
-
771
- * If the invoice status is &#x60;voided&#x60; or &#x60;pending&#x60;.
772
-
773
-
774
- */
775
-
776
218
  send_einvoice(invoice_id:string):ChargebeeRequest<SendEinvoiceResponse>;
777
- apply_payment_schedule_scheme(invoice_id:string, input:ApplyPaymentScheduleSchemeInputParam):ChargebeeRequest<ApplyPaymentScheduleSchemeResponse>;
778
- payment_schedules(invoice_id:string):ChargebeeRequest<PaymentSchedulesResponse>;
779
219
  }
780
220
  export interface CreateResponse {
781
221
  invoice:Invoice;
782
222
  }
783
223
  export interface CreateInputParam {
784
224
 
785
- /**
786
- * @description Identifier of the customer for which this invoice needs to be created. Should be specified if &#x27;subscription_id&#x27; is not specified.
787
-
788
- */
225
+ 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};
789
226
 
790
- customer_id?:string;
227
+ statement_descriptor?:{descriptor?:string};
791
228
 
792
- /**
793
- * @description Identifier of the subscription for which this invoice needs to be created. Should be specified if &#x27;customer_id&#x27; is not specified.(not applicable for consolidated invoice).
794
-
795
- */
229
+ 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?:Gateway,gateway_account_id?:string,ip_address?:string,last_name?:string,number?:string,preferred_scheme?:'cartes_bancaires' | 'mastercard' | 'visa',tmp_token?:string};
796
230
 
797
- subscription_id?:string;
231
+ 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};
798
232
 
799
- /**
800
- * @description The currency code (ISO 4217 format) of the invoice amount.
801
-
802
- */
233
+ payment_method?:{additional_information?:object,gateway?:Gateway,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
803
234
 
804
- currency_code?:string;
235
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland',reference_id?:string};
805
236
 
806
- /**
807
- * @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. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; 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.
808
-
809
- */
237
+ addons?:{date_from?:number,date_to?:number,id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
810
238
 
811
- invoice_date?:number;
239
+ 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}[];
812
240
 
813
- /**
814
- * @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.
815
-
816
- */
241
+ tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
817
242
 
818
- invoice_note?:string;
243
+ notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
819
244
 
820
- /**
821
- * @description Set as &#x60;true&#x60; to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
822
-
823
- */
245
+ customer_id?:string;
824
246
 
825
- remove_general_note?:boolean;
247
+ subscription_id?:string;
826
248
 
827
- /**
828
- * @description Purchase Order Number for this invoice.
829
-
830
- */
249
+ currency_code?:string;
250
+
251
+ invoice_date?:number;
252
+
253
+ invoice_note?:string;
254
+
255
+ remove_general_note?:boolean;
831
256
 
832
257
  po_number?:string;
833
258
 
834
- /**
835
- * @description List of Coupons to be added.
836
-
837
- */
259
+ coupon?:string;
838
260
 
839
261
  coupon_ids?:string[];
840
262
 
841
- /**
842
- * @description Authorization transaction to be captured.
843
-
844
- */
845
-
846
263
  authorization_transaction_id?:string;
847
264
 
848
- /**
849
- * @description Payment source to be used for this payment.
850
-
851
- */
852
-
853
265
  payment_source_id?:string;
854
266
 
855
- /**
856
- * @description If specified, the customer level auto collection will be overridden. \* on - Whenever an invoice is created, an automatic attempt will be made to charge. \* off - Whenever an invoice is created as payment due.
857
-
858
- */
859
-
860
267
  auto_collection?:AutoCollection;
861
268
 
862
- /**
863
- * @description Token generated by Chargebee JS representing payment method details.
864
-
865
- */
866
-
867
269
  token_id?:string;
868
270
 
869
- /**
870
- * @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.
871
-
872
- */
873
-
874
271
  replace_primary_payment_source?:boolean;
875
272
 
876
- /**
877
- * @description Indicates whether the payment source should be retained for the customer.
878
-
879
- */
880
-
881
273
  retain_payment_source?:boolean;
882
274
 
883
- /**
884
- * @description The type of initiator to be used for the payment request triggered by this operation. \* customer - Pass this value to indicate that the request is initiated by the customer \* merchant - Pass this value to indicate that the request is initiated by the merchant
885
-
886
- */
887
-
888
275
  payment_initiator?:PaymentInitiator;
889
-
890
- /**
891
- * @description Parameters for shipping_address
892
-
893
- */
276
+ }
277
+ export interface CreateForChargeItemsAndChargesResponse {
278
+ invoice:Invoice;
279
+ }
280
+ export interface CreateForChargeItemsAndChargesInputParam {
894
281
 
895
282
  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};
896
283
 
897
- /**
898
- * @description Parameters for statement_descriptor
899
-
900
- */
901
-
902
- statement_descriptor?:{additional_info?:string,descriptor?:string};
903
-
904
- /**
905
- * @description Parameters for card
906
-
907
- */
284
+ statement_descriptor?:{descriptor?:string};
908
285
 
909
286
  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?:Gateway,gateway_account_id?:string,ip_address?:string,last_name?:string,number?:string,preferred_scheme?:'cartes_bancaires' | 'mastercard' | 'visa',tmp_token?:string};
910
287
 
911
- /**
912
- * @description Parameters for bank_account
913
-
914
- */
915
-
916
288
  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};
917
289
 
918
- /**
919
- * @description Parameters for payment_method
920
-
921
- */
290
+ payment_method?:{additional_information?:object,gateway?:Gateway,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
922
291
 
923
- payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
292
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland',reference_id?:string};
924
293
 
925
- /**
926
- * @description Parameters for payment_intent
927
-
928
- */
929
-
930
- payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
931
-
932
- /**
933
- * @description Parameters for addons
934
-
935
- */
936
-
937
- addons?:{date_from?:number,date_to?:number,id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
294
+ 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}[];
938
295
 
939
- /**
940
- * @description Parameters for charges
941
-
942
- */
296
+ 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}[];
943
297
 
944
298
  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}[];
945
299
 
946
- /**
947
- * @description Parameters for notes_to_remove
948
-
949
- */
950
-
951
300
  notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
952
- tax_providers_fields?: { field_id?: string, field_value?: string, provider_name?: string }[];
953
- }
954
- export interface CreateForChargeItemsAndChargesResponse {
955
- invoice:Invoice;
956
- }
957
- export interface CreateForChargeItemsAndChargesInputParam {
958
301
 
959
- /**
960
- * @description Unique ID of the customer this invoice should be created for. Either this or &#x60;subscription_id&#x60; must be provided.
961
- **Note**
962
-
963
- The invoice is [linked](/docs/api?prod_cat_ver&#x3D;2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver&#x3D;2#mbe) as this customer.
964
- .
965
-
966
- */
302
+ tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
967
303
 
968
- customer_id?:string;
304
+ discounts:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
969
305
 
970
- /**
971
- * @description Unique ID of the subscription this invoice should be created for. Either this or &#x60;customer_id&#x60; must be provided.
972
- **Note**
973
-
974
- The invoice is [linked](/docs/api?prod_cat_ver&#x3D;2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver&#x3D;2#mbe) as this subscription.
975
- .
976
-
977
- */
306
+ customer_id?:string;
978
307
 
979
308
  subscription_id?:string;
980
309
 
981
- /**
982
- * @description The currency code (ISO 4217 format) of the invoice amount.
983
-
984
- */
985
-
986
310
  currency_code?:string;
987
311
 
988
- /**
989
- * @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.
990
-
991
- */
992
-
993
312
  invoice_note?:string;
994
313
 
995
- /**
996
- * @description Set as &#x60;true&#x60; to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
997
-
998
- */
999
-
1000
314
  remove_general_note?:boolean;
1001
315
 
1002
- /**
1003
- * @description Purchase Order Number for this invoice.
1004
-
1005
- */
1006
-
1007
316
  po_number?:string;
1008
317
 
1009
- /**
1010
- * @description List of Coupons to be added.
1011
-
1012
- */
318
+ coupon?:string;
1013
319
 
1014
320
  coupon_ids?:string[];
1015
321
 
1016
- /**
1017
- * @description Authorization transaction to be captured.
1018
-
1019
- */
1020
-
1021
322
  authorization_transaction_id?:string;
1022
323
 
1023
- /**
1024
- * @description Payment source to be used for this payment.
1025
-
1026
- */
1027
-
1028
324
  payment_source_id?:string;
1029
325
 
1030
- /**
1031
- * @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.
1032
-
1033
- */
1034
-
1035
326
  auto_collection?:AutoCollection;
1036
327
 
1037
- /**
1038
- * @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. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; 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.
1039
-
1040
- */
1041
-
1042
328
  invoice_date?:number;
1043
329
 
1044
- /**
1045
- * @description Token generated by Chargebee JS representing payment method details.
1046
-
1047
- */
1048
-
1049
330
  token_id?:string;
1050
331
 
1051
- /**
1052
- * @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.
1053
-
1054
- */
1055
-
1056
332
  replace_primary_payment_source?:boolean;
1057
333
 
1058
- /**
1059
- * @description Indicates whether the payment source should be retained for the customer.
1060
-
1061
- */
1062
-
1063
334
  retain_payment_source?:boolean;
1064
335
 
1065
- /**
1066
- * @description null
1067
-
1068
- */
1069
-
1070
336
  payment_initiator?:PaymentInitiator;
337
+ }
338
+ export interface ChargeResponse {
339
+ invoice:Invoice;
340
+ }
341
+ export interface ChargeInputParam {
1071
342
 
1072
- /**
1073
- * @description Parameters for shipping_address
1074
-
1075
- */
1076
-
1077
- 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};
1078
-
1079
- /**
1080
- * @description Creates an invoice for [charge-items](./items?prod_cat_ver&#x3D;2) and [one-time charges](https://www.chargebee.com/docs/2.0/charges.html). The item prices must belong to items of &#x60;type&#x60; &#x60;charge&#x60;.
1081
-
1082
- */
1083
-
1084
- statement_descriptor?:{additional_info?:string,descriptor?:string};
1085
-
1086
- /**
1087
- * @description Parameters for card
1088
-
1089
- */
1090
-
1091
- 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?:Gateway,gateway_account_id?:string,ip_address?:string,last_name?:string,number?:string,preferred_scheme?:'cartes_bancaires' | 'mastercard' | 'visa',tmp_token?:string};
1092
-
1093
- /**
1094
- * @description Parameters for bank_account
1095
-
1096
- */
343
+ tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
1097
344
 
1098
- 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};
345
+ customer_id?:string;
1099
346
 
1100
- /**
1101
- * @description Parameters for payment_method
1102
-
1103
- */
347
+ subscription_id?:string;
1104
348
 
1105
- payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
349
+ currency_code?:string;
1106
350
 
1107
- /**
1108
- * @description Parameters for payment_intent
1109
-
1110
- */
351
+ amount?:number;
1111
352
 
1112
- payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'klarna_pay_now' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
353
+ amount_in_decimal?:string;
1113
354
 
1114
- /**
1115
- * @description Parameters for item_prices
1116
-
1117
- */
355
+ description:string;
1118
356
 
1119
- 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}[];
357
+ date_from?:number;
1120
358
 
1121
- /**
1122
- * @description Parameters for item_tiers
1123
-
1124
- */
359
+ date_to?:number;
1125
360
 
1126
- 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}[];
361
+ coupon_ids?:string[];
1127
362
 
1128
- /**
1129
- * @description Parameters for charges
1130
-
1131
- */
363
+ coupon?:string;
1132
364
 
1133
- 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}[];
365
+ avalara_sale_type?:AvalaraSaleType;
1134
366
 
1135
- /**
1136
- * @description Parameters for notes_to_remove
1137
-
1138
- */
367
+ avalara_transaction_type?:number;
1139
368
 
1140
- notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
369
+ avalara_service_type?:number;
1141
370
 
1142
- /**
1143
- * @description Parameters for discounts
1144
-
1145
- */
371
+ po_number?:string;
1146
372
 
1147
- discounts:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
1148
- tax_providers_fields?: { field_id?: string, field_value?: string, provider_name?: string }[];
1149
- }
1150
- export interface StopDunningResponse {
1151
- invoice:Invoice;
1152
- }
1153
- export interface StopDunningInputParam {
373
+ invoice_date?:number;
1154
374
 
1155
- /**
1156
- * @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).
1157
-
1158
- */
375
+ payment_source_id?:string;
1159
376
 
1160
- comment?:string;
377
+ payment_initiator?:PaymentInitiator;
1161
378
  }
1162
- export interface ImportInvoiceResponse {
379
+ export interface ChargeAddonResponse {
1163
380
  invoice:Invoice;
1164
-
1165
- credit_note?:CreditNote;
1166
381
  }
1167
- export interface ImportInvoiceInputParam {
1168
-
1169
- /**
1170
- * @description Invoice Number.
1171
-
1172
- */
1173
-
1174
- id:string;
1175
-
1176
- /**
1177
- * @description The currency code (ISO 4217 format) for the invoice.
1178
-
1179
- */
1180
-
1181
- currency_code?:string;
1182
-
1183
- /**
1184
- * @description Identifier of the customer for which this invoice needs to be created.
1185
-
1186
- */
382
+ export interface ChargeAddonInputParam {
1187
383
 
1188
384
  customer_id?:string;
1189
385
 
1190
- /**
1191
- * @description If recurring items are present in line items then subscription id is required.
1192
-
1193
- */
1194
-
1195
386
  subscription_id?:string;
1196
387
 
1197
- /**
1198
- * @description Purchase Order Number for this invoice.
1199
-
1200
- */
388
+ addon_id:string;
1201
389
 
1202
- po_number?:string;
390
+ addon_quantity?:number;
1203
391
 
1204
- /**
1205
- * @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.
1206
-
1207
- */
392
+ addon_unit_price?:number;
1208
393
 
1209
- price_type?:PriceType;
394
+ addon_quantity_in_decimal?:string;
1210
395
 
1211
- /**
1212
- * @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.)
1213
-
1214
- */
396
+ addon_unit_price_in_decimal?:string;
1215
397
 
1216
- tax_override_reason?:TaxOverrideReason;
1217
-
1218
- /**
1219
- * @description Vat Number. Required if this invoice is VAT exempted.
1220
-
1221
- */
398
+ date_from?:number;
1222
399
 
1223
- vat_number?:string;
400
+ date_to?:number;
1224
401
 
1225
- /**
1226
- * @description An overridden value for the first two characters of the [full VAT
1227
- number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) &#x60;country&#x60; as &#x60;XI&#x60; (which is **United Kingdom - Northern Ireland** ).
1228
-
1229
- When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
1230
- 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) &#x60;country&#x60; as &#x60;XI&#x60;. That&#x27;s the code for **United Kingdom - Northern
1231
- Ireland** . The first two characters of the VAT number in such a case is &#x60;XI&#x60; by default. However, if the VAT number was registered in UK, the value should be &#x60;GB&#x60;. Set &#x60;vat_number_prefix&#x60; to &#x60;GB&#x60; for such cases.
1232
-
1233
- */
402
+ coupon_ids?:string[];
1234
403
 
1235
- vat_number_prefix?:string;
404
+ coupon?:string;
1236
405
 
1237
- /**
1238
- * @description Date when invoice raised.
1239
-
1240
- */
406
+ po_number?:string;
1241
407
 
1242
- date:number;
408
+ invoice_date?:number;
1243
409
 
1244
- /**
1245
- * @description Invoice total amount.
1246
-
1247
- */
410
+ payment_source_id?:string;
1248
411
 
1249
- total:number;
412
+ payment_initiator?:PaymentInitiator;
413
+ }
414
+ export interface CreateForChargeItemResponse {
415
+ invoice:Invoice;
416
+ }
417
+ export interface CreateForChargeItemInputParam {
1250
418
 
1251
- /**
1252
- * @description Round off amount.
1253
-
1254
- */
419
+ 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};
1255
420
 
1256
- round_off?:number;
421
+ item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
1257
422
 
1258
- /**
1259
- * @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 -
1260
- The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_status) is yet to be closed (sent for payment collection). An invoice is generated with this &#x60;status&#x60; when it has line items that belong to items that are &#x60;metered&#x60; or when the &#x60;subscription.create_pending_invoices&#x60;attribute is set to &#x60;true&#x60;.
1261
- The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to be closed (sent for payment collection). All invoices are generated with this &#x60;status&#x60; 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.
1262
-
1263
- */
423
+ customer_id?:string;
1264
424
 
1265
- status?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
425
+ subscription_id?:string;
1266
426
 
1267
- /**
1268
- * @description Timestamp indicating the date \&amp; time this invoice got voided.
1269
-
1270
- */
427
+ po_number?:string;
1271
428
 
1272
- voided_at?:number;
429
+ coupon?:string;
1273
430
 
1274
- /**
1275
- * @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Invoices \&gt; Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
1276
-
1277
- */
431
+ payment_source_id?:string;
1278
432
 
1279
- void_reason_code?:string;
433
+ payment_initiator?:PaymentInitiator;
1280
434
 
1281
- /**
1282
- * @description If is_written_off is true then the invoice is written off.
1283
-
1284
- */
435
+ invoice_date?:number;
436
+ }
437
+ export interface StopDunningResponse {
438
+ invoice:Invoice;
439
+ }
440
+ export interface StopDunningInputParam {
1285
441
 
1286
- is_written_off?:boolean;
442
+ comment?:string;
443
+ }
444
+ export interface ImportInvoiceResponse {
445
+ invoice:Invoice;
1287
446
 
1288
- /**
1289
- * @description Amount written off against this invoice. If this value is not present then the due amount of the invoice will be written off.
1290
-
1291
- */
447
+ credit_note?:CreditNote;
448
+ }
449
+ export interface ImportInvoiceInputParam {
1292
450
 
1293
- write_off_amount?:number;
451
+ credit_note?:{id?:string};
1294
452
 
1295
- /**
1296
- * @description The date on which the write_off invoice has occurred. This is a mandatory field if is_written_off is true. The same date reflects on the created credit note.
1297
-
1298
- */
453
+ 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};
1299
454
 
1300
- write_off_date?:number;
455
+ 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};
1301
456
 
1302
- /**
1303
- * @description Invoice Due Date.
1304
-
1305
- */
457
+ line_items:{amount?:number,amount_in_decimal?:string,created_at?:number,date_from?:number,date_to?:number,description:string,entity_id?:string,entity_type?:'adhoc' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price',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}[];
1306
458
 
1307
- due_date?:number;
459
+ payment_reference_numbers:{id?:string,number:string,type:'kid' | 'ocr' | 'frn' | 'fik' | 'swiss_reference'}[];
1308
460
 
1309
- /**
1310
- * @description Invoice net term days.
1311
-
1312
- */
461
+ 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}[];
1313
462
 
1314
- net_term_days?:number;
463
+ discounts:{amount:number,description?:string,entity_id?:string,entity_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'document_level_discount'}[];
1315
464
 
1316
- /**
1317
- * @description Boolean indicating any advance charge is present in this invoice.
1318
-
1319
- */
465
+ taxes:{amount?:number,description?:string,juris_code?:string,juris_name?:string,juris_type?:'country' | 'federal' | 'state' | 'county' | 'city' | 'special' | 'unincorporated' | 'other',name:string,rate:number}[];
1320
466
 
1321
- has_advance_charges?:boolean;
467
+ payments:{amount:number,date?:number,payment_method:PaymentMethod,reference_number?:string}[];
1322
468
 
1323
- /**
1324
- * @description If the invoice falls within the subscription current term will be used for proration.
1325
-
1326
- */
469
+ notes?:{entity_id?:string,entity_type?:'coupon' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price',note?:string}[];
1327
470
 
1328
- use_for_proration?:boolean;
471
+ id:string;
1329
472
 
1330
- /**
1331
- * @description Parameters for credit_note
1332
-
1333
- */
473
+ currency_code?:string;
1334
474
 
1335
- credit_note?:{id?:string};
475
+ customer_id?:string;
1336
476
 
1337
- /**
1338
- * @description Parameters for billing_address
1339
-
1340
- */
477
+ subscription_id?:string;
1341
478
 
1342
- 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};
479
+ po_number?:string;
1343
480
 
1344
- /**
1345
- * @description Parameters for shipping_address
1346
-
1347
- */
481
+ price_type?:PriceType;
1348
482
 
1349
- 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};
483
+ tax_override_reason?:TaxOverrideReason;
1350
484
 
1351
- /**
1352
- * @description Parameters for line_items
1353
-
1354
- */
485
+ vat_number?:string;
1355
486
 
1356
- 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}[];
487
+ vat_number_prefix?:string;
1357
488
 
1358
- /**
1359
- * @description Parameters for payment_reference_numbers
1360
-
1361
- */
489
+ date:number;
1362
490
 
1363
- payment_reference_numbers:{id?:string,number:string,type:'frn' | 'kid' | 'fik' | 'swiss_reference' | 'ocr'}[];
491
+ total:number;
1364
492
 
1365
- /**
1366
- * @description Parameters for line_item_tiers
1367
-
1368
- */
493
+ round_off?:number;
1369
494
 
1370
- 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}[];
495
+ status?:'paid' | 'posted' | 'payment_due' | 'not_paid' | 'voided' | 'pending';
1371
496
 
1372
- /**
1373
- * @description Parameters for discounts
1374
-
1375
- */
497
+ voided_at?:number;
1376
498
 
1377
- 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}[];
499
+ void_reason_code?:string;
1378
500
 
1379
- /**
1380
- * @description Parameters for taxes
1381
-
1382
- */
501
+ is_written_off?:boolean;
1383
502
 
1384
- 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}[];
503
+ write_off_amount?:number;
1385
504
 
1386
- /**
1387
- * @description Parameters for payments
1388
-
1389
- */
505
+ write_off_date?:number;
1390
506
 
1391
- payments:{amount:number,date?:number,payment_method:PaymentMethod,reference_number?:string}[];
507
+ due_date?:number;
1392
508
 
1393
- /**
1394
- * @description Parameters for notes
1395
-
1396
- */
509
+ net_term_days?:number;
1397
510
 
1398
- notes?:{entity_id?:string,entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price',note?:string}[];
511
+ has_advance_charges?:boolean;
512
+
513
+ use_for_proration?:boolean;
1399
514
  }
1400
515
  export interface ApplyPaymentsResponse {
1401
516
  invoice:Invoice;
1402
517
  }
1403
518
  export interface ApplyPaymentsInputParam {
1404
519
 
1405
- /**
1406
- * @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).
1407
-
1408
- */
520
+ transactions?:{amount?:number,id?:string}[];
1409
521
 
1410
522
  comment?:string;
1411
-
1412
- /**
1413
- * @description Parameters for transactions
1414
-
1415
- */
1416
-
1417
- transactions?:{amount?:number,id?:string}[];
1418
523
  }
1419
524
  export interface SyncUsagesResponse {
1420
525
  invoice:Invoice;
@@ -1425,11 +530,6 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1425
530
  }
1426
531
  export interface DeleteLineItemsInputParam {
1427
532
 
1428
- /**
1429
- * @description The list of line items which have to be deleted.
1430
-
1431
- */
1432
-
1433
533
  line_items?:{id?:string}[];
1434
534
  }
1435
535
  export interface ApplyCreditsResponse {
@@ -1437,219 +537,249 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1437
537
  }
1438
538
  export interface ApplyCreditsInputParam {
1439
539
 
1440
- /**
1441
- * @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).
1442
-
1443
- */
540
+ credit_notes?:{id?:string}[];
1444
541
 
1445
542
  comment?:string;
1446
-
1447
- /**
1448
- * @description Parameters for credit_notes
1449
-
1450
- */
1451
-
1452
- credit_notes?:{id?:string}[];
1453
543
  }
1454
544
  export interface ListResponse {
1455
- /**
1456
- * @description Lists all the Invoices.
1457
-
1458
- */
1459
-
1460
545
  list:{invoice:Invoice}[];
1461
546
 
1462
- /**
1463
- * @description Lists all the Invoices.
1464
-
1465
- */
1466
-
1467
547
  next_offset?:string;
1468
548
  }
1469
549
  export interface ListInputParam {
1470
550
  [key : string]: any;
1471
551
  /**
1472
- * @description Lists all the Invoices.
552
+ * @description The number of resources to be returned.
1473
553
 
1474
554
  */
1475
555
 
1476
556
  limit?:number;
1477
557
 
1478
558
  /**
1479
- * @description Lists all the Invoices.
559
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
1480
560
 
1481
561
  */
1482
562
 
1483
563
  offset?:string;
1484
564
 
1485
565
  /**
1486
- * @description Lists all the Invoices.
566
+ * @description Parameters for einvoice
567
+
568
+ */
569
+
570
+ einvoice?:{status?:{in?:string,is?:'scheduled' | 'skipped' | 'in_progress' | 'success' | 'failed' | 'registered',is_not?:'scheduled' | 'skipped' | 'in_progress' | 'success' | 'failed' | 'registered',not_in?:string}};
571
+
572
+ paid_on_after?:number;
573
+
574
+ /**
575
+ * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
1487
576
 
1488
577
  */
1489
578
 
1490
579
  include_deleted?:boolean;
1491
580
 
581
+ hide_zero_line_item?:boolean;
582
+
583
+ show_zero_tax_lines?:boolean;
584
+
585
+ show_exempted_tax_lines?:boolean;
586
+
587
+ include_consolidated_invoices?:boolean;
588
+
589
+ ignore_imported_invoice?:boolean;
590
+
1492
591
  /**
1493
- * @description Lists all the Invoices.
592
+ * @description The invoice number. Acts as a identifier for invoice and typically generated sequentially.
1494
593
 
1495
594
  */
1496
595
 
1497
596
  id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1498
597
 
1499
598
  /**
1500
- * @description Lists all the Invoices.
599
+ * @description To filter based on subscription_id.
600
+ NOTE: Not to be used if *consolidated invoicing* is enabled.
1501
601
 
1502
602
  */
1503
603
 
1504
604
  subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
1505
605
 
1506
606
  /**
1507
- * @description Lists all the Invoices.
607
+ * @description The identifier of the customer this invoice belongs to.
1508
608
 
1509
609
  */
1510
610
 
1511
611
  customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1512
612
 
1513
613
  /**
1514
- * @description Lists all the Invoices.
614
+ * @description Boolean indicating whether this invoice belongs to a subscription
1515
615
 
1516
616
  */
1517
617
 
1518
618
  recurring?:{is?:'true' | 'false'};
1519
619
 
1520
620
  /**
1521
- * @description Lists all the Invoices.
621
+ * @description Current status of this invoice.
1522
622
 
1523
623
  */
1524
624
 
1525
- 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};
625
+ status?:{in?:string,is?:'paid' | 'posted' | 'payment_due' | 'not_paid' | 'voided' | 'pending',is_not?:'paid' | 'posted' | 'payment_due' | 'not_paid' | 'voided' | 'pending',not_in?:string};
1526
626
 
1527
627
  /**
1528
- * @description Lists all the Invoices.
628
+ * @description The price type of the invoice.
1529
629
 
1530
630
  */
1531
631
 
1532
632
  price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
1533
633
 
1534
634
  /**
1535
- * @description Lists all the Invoices.
635
+ * @description The document date displayed on the invoice PDF.
1536
636
 
1537
637
  */
1538
638
 
1539
639
  date?:{after?:string,before?:string,between?:string,on?:string};
1540
640
 
1541
641
  /**
1542
- * @description Lists all the Invoices.
642
+ * @description Timestamp indicating the date \&amp; time this invoice got paid.
1543
643
 
1544
644
  */
1545
645
 
1546
646
  paid_at?:{after?:string,before?:string,between?:string,on?:string};
1547
647
 
1548
648
  /**
1549
- * @description Lists all the Invoices.
649
+ * @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.
1550
650
 
1551
651
  */
1552
652
 
1553
653
  total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
1554
654
 
1555
655
  /**
1556
- * @description Lists all the Invoices.
656
+ * @description Payments collected successfully for the invoice. This is the sum of [linked_payments[]](invoices#invoice_linked_payments)&#x60;.txn_amount&#x60; for all &#x60;linked_payments[]&#x60; that have &#x60;txn_status&#x60; as &#x60;success&#x60;.
1557
657
 
1558
658
  */
1559
659
 
1560
660
  amount_paid?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
1561
661
 
1562
662
  /**
1563
- * @description Lists all the Invoices.
663
+ * @description Total adjustments made against this invoice.
1564
664
 
1565
665
  */
1566
666
 
1567
667
  amount_adjusted?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
1568
668
 
1569
669
  /**
1570
- * @description Lists all the Invoices.
670
+ * @description Total credits applied against this invoice.
1571
671
 
1572
672
  */
1573
673
 
1574
674
  credits_applied?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
1575
675
 
1576
676
  /**
1577
- * @description Lists all the Invoices.
677
+ * @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)&#x60;.applied_amount&#x60; - sum of [adjustment_credit_notes](invoices#invoice_adjustment_credit_notes)&#x60;.cn_total&#x60; - sum of [linked_taxes_withheld](invoices#invoice_linked_taxes_withheld)&#x60;.amount&#x60;.
1578
678
 
1579
679
  */
1580
680
 
1581
681
  amount_due?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
1582
682
 
1583
683
  /**
1584
- * @description Lists all the Invoices.
684
+ * @description Current dunning status of the invoice.
1585
685
 
1586
686
  */
1587
687
 
1588
- dunning_status?:{in?:string,is?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_not?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_present?:'true' | 'false',not_in?:string};
688
+ dunning_status?:{in?:string,is?:'in_progress' | 'exhausted' | 'stopped' | 'success',is_not?:'in_progress' | 'exhausted' | 'stopped' | 'success',is_present?:'true' | 'false',not_in?:string};
1589
689
 
1590
690
  /**
1591
- * @description Lists all the Invoices.
691
+ * @description Payment owner of an invoice
1592
692
 
1593
693
  */
1594
694
 
1595
695
  payment_owner?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1596
696
 
1597
697
  /**
1598
- * @description Lists all the Invoices.
698
+ * @description To filter based on &#x60;updated_at&#x60;. 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 &#x60;sort_by&#x60; input parameter as &#x60;updated_at&#x60; for a faster response.
1599
699
 
1600
700
  */
1601
701
 
1602
702
  updated_at?:{after?:string,before?:string,between?:string,on?:string};
1603
703
 
1604
704
  /**
1605
- * @description Lists all the Invoices.
705
+ * @description The subscription channel this object originated from and is maintained in.
1606
706
 
1607
707
  */
1608
708
 
1609
- channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
709
+ channel?:{in?:string,is?:'web' | 'app_store' | 'play_store',is_not?:'web' | 'app_store' | 'play_store',not_in?:string};
1610
710
 
1611
711
  /**
1612
- * @description Lists all the Invoices.
712
+ * @description Timestamp indicating the date \&amp; time this invoice got voided.
1613
713
 
1614
714
  */
1615
715
 
1616
716
  voided_at?:{after?:string,before?:string,between?:string,on?:string};
1617
717
 
1618
718
  /**
1619
- * @description Lists all the Invoices.
719
+ * @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Invoices \&gt; Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive
1620
720
 
1621
721
  */
1622
722
 
1623
723
  void_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1624
724
 
725
+ sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
726
+ }
727
+ export interface InvoicesForCustomerResponse {
728
+ list:{invoice:Invoice}[];
729
+
730
+ next_offset?:string;
731
+ }
732
+ export interface InvoicesForCustomerInputParam {
733
+ [key : string]: any;
734
+ /**
735
+ * @description The number of resources to be returned.
736
+
737
+ */
738
+
739
+ limit?:number;
740
+
1625
741
  /**
1626
- * @description Lists all the Invoices.
742
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
1627
743
 
1628
744
  */
1629
745
 
1630
- sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
746
+ offset?:string;
747
+ }
748
+ export interface InvoicesForSubscriptionResponse {
749
+ list:{invoice:Invoice}[];
750
+
751
+ next_offset?:string;
752
+ }
753
+ export interface InvoicesForSubscriptionInputParam {
754
+ [key : string]: any;
755
+ /**
756
+ * @description The number of resources to be returned.
757
+
758
+ */
759
+
760
+ limit?:number;
1631
761
 
1632
762
  /**
1633
- * @description Lists all the Invoices.
763
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
1634
764
 
1635
765
  */
1636
766
 
1637
- einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
767
+ offset?:string;
1638
768
  }
1639
769
  export interface RetrieveResponse {
1640
770
  invoice:Invoice;
1641
771
  }
1642
-
772
+ export interface RetrieveInputParam {
773
+
774
+ line_items_limit?:number;
775
+
776
+ line_items_offset?:string;
777
+ }
1643
778
  export interface PdfResponse {
1644
779
  download:Download;
1645
780
  }
1646
781
  export interface PdfInputParam {
1647
782
 
1648
- /**
1649
- * @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
1650
-
1651
- */
1652
-
1653
783
  disposition_type?:DispositionType;
1654
784
  }
1655
785
  export interface DownloadEinvoiceResponse {
@@ -1657,209 +787,116 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1657
787
  }
1658
788
 
1659
789
  export interface ListPaymentReferenceNumbersResponse {
1660
- /**
1661
- * @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 &#x60;invoice_id&#x60; or the &#x60;payment_reference_number[number]&#x60; to retrieve the PRN.
1662
-
1663
- */
1664
-
1665
790
  list:{payment_reference_number:PaymentReferenceNumber}[];
1666
791
 
1667
- /**
1668
- * @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 &#x60;invoice_id&#x60; or the &#x60;payment_reference_number[number]&#x60; to retrieve the PRN.
1669
-
1670
- */
1671
-
1672
792
  next_offset?:string;
1673
793
  }
1674
794
  export interface ListPaymentReferenceNumbersInputParam {
1675
795
  [key : string]: any;
1676
796
  /**
1677
- * @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 &#x60;invoice_id&#x60; or the &#x60;payment_reference_number[number]&#x60; to retrieve the PRN.
797
+ * @description The number of resources to be returned.
1678
798
 
1679
799
  */
1680
800
 
1681
801
  limit?:number;
1682
802
 
1683
803
  /**
1684
- * @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 &#x60;invoice_id&#x60; or the &#x60;payment_reference_number[number]&#x60; to retrieve the PRN.
804
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
1685
805
 
1686
806
  */
1687
807
 
1688
808
  offset?:string;
1689
809
 
1690
810
  /**
1691
- * @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 &#x60;invoice_id&#x60; or the &#x60;payment_reference_number[number]&#x60; to retrieve the PRN.
811
+ * @description Parameters for payment_reference_number
1692
812
 
1693
813
  */
1694
814
 
1695
- id?:{in?:string,is?:string};
815
+ payment_reference_number?:{number?:{in?:string,is?:string}};
1696
816
 
1697
817
  /**
1698
- * @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 &#x60;invoice_id&#x60; or the &#x60;payment_reference_number[number]&#x60; to retrieve the PRN.
818
+ * @description An unique identifier for the invoice serves that links the invoice to the corresponding payment reference number (PRN).
819
+ **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.
1699
820
 
1700
821
  */
1701
822
 
1702
- payment_reference_number?:{number?:{in?:string,is?:string}};
823
+ id?:{in?:string,is?:string};
1703
824
  }
1704
825
  export interface AddChargeResponse {
1705
826
  invoice:Invoice;
1706
827
  }
1707
828
  export interface AddChargeInputParam {
1708
829
 
1709
- /**
1710
- * @description The amount to be charged. The unit depends on the [type of currency](/docs/api#md_disabled).
1711
-
1712
- */
830
+ line_item?:{date_from?:number,date_to?:number};
1713
831
 
1714
832
  amount:number;
1715
833
 
1716
- /**
1717
- * @description Detailed description about this lineitem.
1718
-
1719
- */
1720
-
1721
834
  description:string;
1722
835
 
1723
- /**
1724
- * @description Indicates the type of sale carried out. This is applicable only if you use [Chargebee&#x27;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
1725
-
1726
- */
1727
-
1728
836
  avalara_sale_type?:AvalaraSaleType;
1729
837
 
1730
- /**
1731
- * @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&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
1732
-
1733
- */
1734
-
1735
838
  avalara_transaction_type?:number;
1736
839
 
1737
- /**
1738
- * @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&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
1739
-
1740
- */
1741
-
1742
840
  avalara_service_type?:number;
1743
841
 
1744
- /**
1745
- * @description This represents the Avalara tax code to which the one-time charge is mapped. Applicable only if you use Chargebee&#x27;s [AvaTax for Sales integration](https://www.chargebee.com/docs/avatax-for-sales.html).
1746
-
1747
- */
1748
-
1749
842
  avalara_tax_code?:string;
1750
843
 
1751
- /**
1752
- * @description The [HSN code](https://cbic-gst.gov.in/gst-goods-services-rates.html) to which the one-time charge is mapped for calculating the customer&#x27;s tax in India. Applicable when both the conditions are true:
1753
-
1754
- * **[India](https://www.chargebee.com/docs/indian-gst.html#configuring-indian-gst)** has been enabled as a **Tax Region**. (An error is returned when this condition is not true.)
1755
- * The [**AvaTax for Sales** integration](https://www.chargebee.com/docs/avalara.html) has been enabled in Chargebee.
1756
- .
1757
-
1758
- */
1759
-
1760
844
  hsn_code?:string;
1761
845
 
1762
- /**
1763
- * @description This represents the TaxJar product code to which the one-time charge is mapped. Applicable only if you use Chargebee&#x27;s [TaxJar integration](https://www.chargebee.com/docs/taxjar.html).
1764
-
1765
- */
1766
-
1767
846
  taxjar_product_code?:string;
1768
847
 
1769
- /**
1770
- * @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).
1771
-
1772
- */
1773
-
1774
848
  comment?:string;
1775
849
 
1776
- /**
1777
- * @description Identifier of the subscription for which this charge needs to be created. Applicable for consolidated invoice.
1778
-
1779
- */
1780
-
1781
850
  subscription_id?:string;
851
+ }
852
+ export interface AddAddonChargeResponse {
853
+ invoice:Invoice;
854
+ }
855
+ export interface AddAddonChargeInputParam {
1782
856
 
1783
- /**
1784
- * @description Parameters for line_item
1785
-
1786
- */
857
+ line_item?:{date_from?:number,date_to?:number};
858
+
859
+ addon_id:string;
860
+
861
+ addon_quantity?:number;
862
+
863
+ addon_unit_price?:number;
864
+
865
+ addon_quantity_in_decimal?:string;
866
+
867
+ addon_unit_price_in_decimal?:string;
868
+
869
+ comment?:string;
1787
870
 
1788
- line_item?:{date_from?:number,date_to?:number};
871
+ subscription_id?:string;
1789
872
  }
1790
873
  export interface AddChargeItemResponse {
1791
874
  invoice:Invoice;
1792
875
  }
1793
876
  export interface AddChargeItemInputParam {
1794
877
 
1795
- /**
1796
- * @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).
1797
-
1798
- */
878
+ 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};
1799
879
 
1800
- comment?:string;
880
+ item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
1801
881
 
1802
- /**
1803
- * @description Identifier of the subscription for which this addon needs to be created. Applicable for consolidated invoice.
1804
-
1805
- */
882
+ comment?:string;
1806
883
 
1807
884
  subscription_id?:string;
1808
-
1809
- /**
1810
- * @description Parameters for item_price
1811
-
1812
- */
1813
-
1814
- 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};
1815
-
1816
- /**
1817
- * @description Parameters for item_tiers
1818
-
1819
- */
1820
-
1821
- item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
1822
- tax_providers_fields?: { field_id?: string, field_value?: string, provider_name?: string }[];
1823
885
  }
1824
886
  export interface CloseResponse {
1825
887
  invoice:Invoice;
1826
888
  }
1827
889
  export interface CloseInputParam {
1828
890
 
1829
- /**
1830
- * @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).
1831
-
1832
- */
891
+ notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
1833
892
 
1834
893
  comment?:string;
1835
894
 
1836
- /**
1837
- * @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.
1838
-
1839
- */
1840
-
1841
895
  invoice_note?:string;
1842
896
 
1843
- /**
1844
- * @description Set as &#x60;true&#x60; to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
1845
-
1846
- */
1847
-
1848
897
  remove_general_note?:boolean;
1849
898
 
1850
- /**
1851
- * @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.
1852
-
1853
- */
1854
-
1855
899
  invoice_date?:number;
1856
-
1857
- /**
1858
- * @description Parameters for notes_to_remove
1859
-
1860
- */
1861
-
1862
- notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
1863
900
  }
1864
901
  export interface CollectPaymentResponse {
1865
902
  invoice:Invoice;
@@ -1868,39 +905,14 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1868
905
  }
1869
906
  export interface CollectPaymentInputParam {
1870
907
 
1871
- /**
1872
- * @description Amount to be collected. If this parameter is not passed then the entire amount due will be collected.
1873
-
1874
- */
1875
-
1876
908
  amount?:number;
1877
909
 
1878
- /**
1879
- * @description Authorization transaction to be captured.
1880
-
1881
- */
1882
-
1883
910
  authorization_transaction_id?:string;
1884
911
 
1885
- /**
1886
- * @description Payment source to be used for this payment.
1887
-
1888
- */
1889
-
1890
912
  payment_source_id?:string;
1891
913
 
1892
- /**
1893
- * @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).
1894
-
1895
- */
1896
-
1897
914
  comment?:string;
1898
915
 
1899
- /**
1900
- * @description The type of initiator to be used for the payment request triggered by this operation. \* merchant - Pass this value to indicate that the request is initiated by the merchant \* customer - Pass this value to indicate that the request is initiated by the customer
1901
-
1902
- */
1903
-
1904
916
  payment_initiator?:PaymentInitiator;
1905
917
  }
1906
918
  export interface RecordPaymentResponse {
@@ -1910,30 +922,15 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1910
922
  }
1911
923
  export interface RecordPaymentInputParam {
1912
924
 
1913
- /**
1914
- * @description Remarks, if any, on the payment.
1915
-
1916
- */
925
+ transaction:{amount?:number,custom_payment_method_id?:string,date?:number,error_code?:string,error_text?:string,id_at_gateway?:string,payment_method:PaymentMethod,reference_number?:string,status?:'success' | 'failure' | 'late_failure'};
1917
926
 
1918
927
  comment?:string;
1919
-
1920
- /**
1921
- * @description Parameters for transaction
1922
-
1923
- */
1924
-
1925
- transaction:{amount?:number,custom_payment_method_id?:string,date?:number,error_code?:string,error_text?:string,id_at_gateway?:string,payment_method:PaymentMethod,reference_number?:string,status?:'success' | 'failure'};
1926
928
  }
1927
929
  export interface RecordTaxWithheldResponse {
1928
930
  invoice:Invoice;
1929
931
  }
1930
932
  export interface RecordTaxWithheldInputParam {
1931
933
 
1932
- /**
1933
- * @description Parameters for tax_withheld
1934
-
1935
- */
1936
-
1937
934
  tax_withheld:{amount:number,date?:number,description?:string,reference_number?:string};
1938
935
  }
1939
936
  export interface RemoveTaxWithheldResponse {
@@ -1941,11 +938,6 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1941
938
  }
1942
939
  export interface RemoveTaxWithheldInputParam {
1943
940
 
1944
- /**
1945
- * @description Parameters for tax_withheld
1946
-
1947
- */
1948
-
1949
941
  tax_withheld:{id:string};
1950
942
  }
1951
943
  export interface RefundResponse {
@@ -1957,33 +949,13 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1957
949
  }
1958
950
  export interface RefundInputParam {
1959
951
 
1960
- /**
1961
- * @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 &#x60;transaction&#x60;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.
1962
-
1963
- */
952
+ credit_note?:{create_reason_code?:string,reason_code?:'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other'};
1964
953
 
1965
954
  refund_amount?:number;
1966
955
 
1967
- /**
1968
- * @description Comment, if any, on the refund.
1969
-
1970
- */
1971
-
1972
956
  comment?:string;
1973
957
 
1974
- /**
1975
- * @description The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
1976
-
1977
- */
1978
-
1979
958
  customer_notes?:string;
1980
-
1981
- /**
1982
- * @description Parameters for credit_note
1983
-
1984
- */
1985
-
1986
- credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver'};
1987
959
  }
1988
960
  export interface RecordRefundResponse {
1989
961
  invoice:Invoice;
@@ -1994,33 +966,13 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
1994
966
  }
1995
967
  export interface RecordRefundInputParam {
1996
968
 
1997
- /**
1998
- * @description Remarks, if any, on the refund.
1999
-
2000
- */
969
+ transaction:{amount?:number,custom_payment_method_id?:string,date:number,payment_method:PaymentMethod,reference_number?:string};
2001
970
 
2002
- comment?:string;
971
+ credit_note?:{create_reason_code?:string,reason_code?:'chargeback' | 'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other'};
2003
972
 
2004
- /**
2005
- * @description The Customer Notes to be filled in the Credit Notes created to capture this refund detail.
2006
-
2007
- */
973
+ comment?:string;
2008
974
 
2009
975
  customer_notes?:string;
2010
-
2011
- /**
2012
- * @description Parameters for transaction
2013
-
2014
- */
2015
-
2016
- transaction:{amount?:number,custom_payment_method_id?:string,date:number,payment_method:PaymentMethod,reference_number?:string};
2017
-
2018
- /**
2019
- * @description Parameters for credit_note
2020
-
2021
- */
2022
-
2023
- credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'chargeback' | 'order_change' | 'waiver'};
2024
976
  }
2025
977
  export interface RemovePaymentResponse {
2026
978
  invoice:Invoice;
@@ -2029,11 +981,6 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
2029
981
  }
2030
982
  export interface RemovePaymentInputParam {
2031
983
 
2032
- /**
2033
- * @description Parameters for transaction
2034
-
2035
- */
2036
-
2037
984
  transaction:{id:string};
2038
985
  }
2039
986
  export interface RemoveCreditNoteResponse {
@@ -2043,11 +990,6 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
2043
990
  }
2044
991
  export interface RemoveCreditNoteInputParam {
2045
992
 
2046
- /**
2047
- * @description Parameters for credit_note
2048
-
2049
- */
2050
-
2051
993
  credit_note:{id:string};
2052
994
  }
2053
995
  export interface VoidInvoiceResponse {
@@ -2057,18 +999,8 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
2057
999
  }
2058
1000
  export interface VoidInvoiceInputParam {
2059
1001
 
2060
- /**
2061
- * @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).
2062
-
2063
- */
2064
-
2065
1002
  comment?:string;
2066
1003
 
2067
- /**
2068
- * @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Invoices \&gt; Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
2069
-
2070
- */
2071
-
2072
1004
  void_reason_code?:string;
2073
1005
  }
2074
1006
  export interface WriteOffResponse {
@@ -2078,11 +1010,6 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
2078
1010
  }
2079
1011
  export interface WriteOffInputParam {
2080
1012
 
2081
- /**
2082
- * @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).
2083
-
2084
- */
2085
-
2086
1013
  comment?:string;
2087
1014
  }
2088
1015
  export interface DeleteResponse {
@@ -2090,87 +1017,40 @@ The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to b
2090
1017
  }
2091
1018
  export interface DeleteInputParam {
2092
1019
 
2093
- /**
2094
- * @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.
2095
-
2096
- */
2097
-
2098
1020
  comment?:string;
2099
-
2100
- /**
2101
- * @description Indicates whether to put prorated credits back to the subscription or ignore while deleting the invoice.
2102
-
2103
- */
2104
-
2105
- claim_credits?:boolean;
2106
1021
  }
2107
1022
  export interface UpdateDetailsResponse {
2108
1023
  invoice:Invoice;
2109
1024
  }
2110
1025
  export interface UpdateDetailsInputParam {
2111
1026
 
2112
- /**
2113
- * @description VAT/ Tax registration number of the customer. [Learn more](https://www.chargebee.com/docs/tax.html#capture-tax-registration-number).
2114
-
2115
- */
1027
+ 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};
2116
1028
 
2117
- vat_number?:string;
1029
+ 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};
2118
1030
 
2119
- /**
2120
- * @description An overridden value for the first two characters of the [full VAT
2121
- number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) &#x60;country&#x60; as &#x60;XI&#x60; (which is **United Kingdom - Northern Ireland** ).
2122
-
2123
- When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
2124
- 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) &#x60;country&#x60; as &#x60;XI&#x60;. That&#x27;s the code for **United Kingdom - Northern
2125
- Ireland** . The first two characters of the VAT number in such a case is &#x60;XI&#x60; by default. However, if the VAT number was registered in UK, the value should be &#x60;GB&#x60;. Set &#x60;vat_number_prefix&#x60; to &#x60;GB&#x60; for such cases.
2126
-
2127
- */
1031
+ statement_descriptor?:{descriptor?:string};
2128
1032
 
2129
- vat_number_prefix?:string;
1033
+ vat_number?:string;
2130
1034
 
2131
- /**
2132
- * @description Purchase Order Number for this invoice.
2133
-
2134
- */
1035
+ vat_number_prefix?:string;
2135
1036
 
2136
1037
  po_number?:string;
2137
1038
 
2138
- /**
2139
- * @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).
2140
-
2141
- */
2142
-
2143
1039
  comment?:string;
2144
-
2145
- /**
2146
- * @description Parameters for billing_address
2147
-
2148
- */
2149
-
2150
- 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};
2151
-
2152
- /**
2153
- * @description Parameters for shipping_address
2154
-
2155
- */
2156
-
2157
- 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};
2158
-
2159
- /**
2160
- * @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.
2161
-
2162
- **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&#x27;t change the corresponding customer/subscription details.
2163
-
2164
- */
2165
-
2166
- statement_descriptor?:{additional_info?:string,descriptor?:string};
1040
+ }
1041
+ export interface ApplyPaymentScheduleSchemeResponse {
1042
+ invoice:Invoice;
2167
1043
  }
2168
1044
  export interface ApplyPaymentScheduleSchemeInputParam {
2169
-
1045
+
2170
1046
  scheme_id:string;
2171
1047
 
2172
1048
  amount?:number;
2173
1049
  }
1050
+ export interface PaymentSchedulesResponse {
1051
+ payment_schedules:PaymentSchedule[];
1052
+ }
1053
+
2174
1054
  export interface ResendEinvoiceResponse {
2175
1055
  invoice:Invoice;
2176
1056
  }
@@ -2178,1070 +1058,315 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
2178
1058
  export interface SendEinvoiceResponse {
2179
1059
  invoice:Invoice;
2180
1060
  }
2181
- export interface ApplyPaymentScheduleSchemeResponse {
2182
- invoice:Invoice;
2183
- }
2184
- export interface PaymentSchedulesResponse {
2185
- payment_schedules:PaymentSchedule[];
2186
- }
1061
+
2187
1062
  export interface LineItem {
2188
- /**
2189
- * @description Uniquely identifies a line_item
2190
-
2191
- */
2192
-
2193
1063
  id?:string;
2194
1064
 
2195
- /**
2196
- * @description A unique identifier for the subscription this line item belongs to.
2197
-
2198
- */
2199
-
2200
1065
  subscription_id?:string;
2201
1066
 
2202
- /**
2203
- * @description Start date of this line item.
2204
-
2205
- */
2206
-
2207
1067
  date_from:number;
2208
1068
 
2209
- /**
2210
- * @description End date of this line item.
2211
-
2212
- */
2213
-
2214
1069
  date_to:number;
2215
1070
 
2216
- /**
2217
- * @description Unit amount of the line item.
2218
-
2219
- */
2220
-
2221
1071
  unit_amount:number;
2222
1072
 
2223
- /**
2224
- * @description [Quantity of the recurring item](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_line_items_quantity) represented by this line item.
2225
-
2226
- For metered line items, this value is updated from [usages](https://apidocs.chargebee.com/docs/api/usages) when:
2227
-
2228
- * the invoice is generated as pending
2229
-
2230
- * the invoice is [closed](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice)
2231
-
2232
- * the sync usages API is called
2233
-
2234
-
2235
- */
2236
-
2237
1073
  quantity?:number;
2238
1074
 
2239
- /**
2240
- * @description Total amount of this line item. Typically equals to unit amount x quantity
2241
-
2242
- */
2243
-
2244
1075
  amount?:number;
2245
1076
 
2246
- /**
2247
- * @description The [pricing scheme](https://www.chargebee.com/docs/2.0/plans.html#pricing-models) for this item price. \* per_unit - A fixed price per unit quantity. \* volume - There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers. \* stairstep - A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in. \* flat_fee - A fixed price that is not quantity-based. \* tiered - The per unit price is based on the tier that the total quantity falls in.
2248
-
2249
- */
2250
-
2251
- pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
2252
-
2253
- /**
2254
- * @description Specifies whether this line item is taxed or not
2255
-
2256
- */
1077
+ pricing_model?:'flat_fee' | 'per_unit' | 'tiered' | 'volume' | 'stairstep';
2257
1078
 
2258
1079
  is_taxed:boolean;
2259
1080
 
2260
- /**
2261
- * @description The tax amount charged for this item
2262
-
2263
- */
2264
-
2265
1081
  tax_amount?:number;
2266
1082
 
2267
- /**
2268
- * @description Rate of tax used to calculate tax for this lineitem
2269
-
2270
- */
2271
-
2272
1083
  tax_rate?:number;
2273
1084
 
2274
- /**
2275
- * @description The decimal representation of the unit amount of the &#x60;line_item&#x60;. The value is in major units of the currency. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
2276
-
2277
- */
2278
-
2279
1085
  unit_amount_in_decimal?:string;
2280
1086
 
2281
- /**
2282
- * @description The decimal representation of the quantity of this line_item. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
2283
-
2284
- */
2285
-
2286
1087
  quantity_in_decimal?:string;
2287
1088
 
2288
- /**
2289
- * @description The decimal representation of the amount for the &#x60;line_item&#x60;, in major units of the currency. Typically equals to &#x60;unit_amount_in_decimal&#x60; x &#x60;quantity_in_decimal&#x60;. Returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
2290
-
2291
- */
2292
-
2293
1089
  amount_in_decimal?:string;
2294
1090
 
2295
- /**
2296
- * @description Total discounts for this line
2297
-
2298
- */
2299
-
2300
1091
  discount_amount?:number;
2301
1092
 
2302
- /**
2303
- * @description Line Item-level discounts for this line.
2304
-
2305
- */
2306
-
2307
1093
  item_level_discount_amount?:number;
2308
1094
 
2309
- /**
2310
- * @description The unique identifier of the invoice line item to which this credit note line item is related. This is the same as [invoice.line_items.id](https://apidocs.chargebee.com/docs/api/invoices#invoice_line_items_id ).
2311
-
2312
- */
1095
+ usage_percentage?:string;
2313
1096
 
2314
1097
  reference_line_item_id?:string;
2315
1098
 
2316
- /**
2317
- * @description Detailed description about this line item.
2318
-
2319
- */
2320
-
2321
1099
  description:string;
2322
1100
 
2323
- /**
2324
- * @description Detailed description about this item.
2325
-
2326
- */
2327
-
2328
1101
  entity_description?:string;
2329
1102
 
2330
- /**
2331
- * @description Specifies the modelled entity this line item is based on. \* addon_item_price - Indicates that this line item is based on addon Item Price \* adhoc - Indicates that this lineitem is not modelled. i.e created adhoc. So the &#x27;entity_id&#x27; attribute will be null in this case \* addon - Indicates that this lineitem is based on &#x27;Addon&#x27; entity. The &#x27;entity_id&#x27; attribute specifies the [addon](/docs/api/addons#addon_attributes) id \* plan - Indicates that this lineitem is based on &#x27;Plan&#x27; entity. The &#x27;entity_id&#x27; attribute specifies the [plan](/docs/api/plans#plan_attributes) id \* plan_item_price - Indicates that this line item is based on plan Item Price \* charge_item_price - Indicates that this line item is based on charge Item Price \* plan_setup - Indicates that this lineitem is based on &#x27;Plan Setup&#x27; charge. The &#x27;entity_id&#x27; attribute specifies the [plan](/docs/api/plans#plan_attributes) id
2332
-
2333
- */
2334
-
2335
- entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
2336
-
2337
- /**
2338
- * @description The reason due to which the line item price/amount is exempted from tax. \* tax_not_configured - If tax is not enabled for the site \* customer_exempt - If the Customer is marked as Tax exempt \* region_non_taxable - If the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdiction \* product_exempt - If the Plan or Addon is marked as Tax exempt \* zero_value_item - If the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0. \* reverse_charge - If the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU only \* high_value_physical_goods - If physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be applied \* zero_rated - If the rate of tax is 0% and no Sales/ GST tax is collectable for that line item \* export - You are not registered for tax in the customer&#x27;s region. This is also the reason code when both &#x60;billing_address&#x60; and &#x60;shipping_address&#x60; have not been provided for the customer and subscription respectively
2339
-
2340
- */
2341
-
2342
- tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'tax_not_configured_external_provider' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
1103
+ entity_type:'adhoc' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price' | 'plan_setup' | 'plan' | 'addon';
2343
1104
 
2344
- /**
2345
- * @description The identifier of the modelled entity this line item is based on. Will be null for &#x27;adhoc&#x27; entity type
2346
-
2347
- */
1105
+ tax_exempt_reason?:'tax_not_configured' | 'region_non_taxable' | 'export' | 'customer_exempt' | 'product_exempt' | 'zero_rated' | 'reverse_charge' | 'high_value_physical_goods' | 'zero_value_item' | 'tax_not_configured_external_provider';
2348
1106
 
2349
1107
  entity_id?:string;
2350
1108
 
2351
- /**
2352
- * @description A unique identifier for the customer this line item belongs to
2353
-
2354
- */
2355
-
2356
1109
  customer_id?:string;
2357
1110
  }
2358
1111
  export interface Discount {
2359
- /**
2360
- * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver&#x3D;2#currencies).
2361
-
2362
- */
2363
-
2364
1112
  amount:number;
2365
1113
 
2366
- /**
2367
- * @description Description for this deduction.
2368
-
2369
- */
2370
-
2371
1114
  description?:string;
2372
1115
 
2373
- /**
2374
- * @description The unique id of the line item that this deduction is for. Is required when &#x60;discounts[entity_type]&#x60; is &#x60;item_level_coupon&#x60; or &#x60;document_level_coupon&#x60;.
2375
-
2376
- */
2377
-
2378
- line_item_id?:string;
2379
-
2380
- /**
2381
- * @description The type of deduction and the amount to which it is applied. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_adjustment_credit_notes). \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to a line item of the invoice. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits?prod_cat_ver&#x3D;2) applied to the invoice. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to the invoice &#x60;sub_total&#x60;. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* item_level_coupon - The deduction is due to a coupon applied to line item. The coupon &#x60;id&#x60; is passed as &#x60;entity_id&#x60;. \* document_level_coupon - The deduction is due to a coupon applied to the invoice &#x60;sub_total&#x60;. The coupon id is passed as &#x60;entity_id&#x60;.
2382
-
2383
- */
2384
-
2385
- entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
2386
-
2387
- /**
2388
- * @description The type of discount that is applied to the line item. Relevant only when &#x60;discounts[entity_type]&#x60; is one of &#x60;item_level_discount&#x60; , &#x60;item_level_coupon&#x60;, &#x60;document_level_discount&#x60;, or &#x60;document_level_coupon&#x60; \* percentage - when percentage is applied as discount \* fixed_amount - when amount is applied as discount
2389
-
2390
- */
1116
+ entity_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
2391
1117
 
2392
1118
  discount_type?:'fixed_amount' | 'percentage';
2393
1119
 
2394
- /**
2395
- * @description When the deduction is due to a &#x60;coupon&#x60; or a [discount](discounts), then this is the &#x60;id&#x60; of the coupon or discount.
2396
-
2397
- */
2398
-
2399
1120
  entity_id?:string;
2400
1121
 
2401
- /**
2402
- * @description The [coupon code](/docs/api/coupon_codes#coupon_code_code), if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons#coupon_id) is available in &#x60;entity_id&#x60;.
2403
-
2404
- */
2405
-
2406
1122
  coupon_set_code?:string;
2407
1123
  }
2408
1124
  export interface LineItemDiscount {
2409
- /**
2410
- * @description The unique id of the line item that this deduction is for.
2411
-
2412
- */
2413
-
2414
1125
  line_item_id:string;
2415
1126
 
2416
- /**
2417
- * @description The type of deduction and the amount to which it is applied. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_adjustment_credit_notes). \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to the invoice &#x60;sub_total&#x60;. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to a line item of the invoice. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* document_level_coupon - The deduction is due to a coupon applied to the invoice &#x60;sub_total&#x60;. The coupon &#x60;id&#x60; is available as &#x60;entity_id&#x60;. \* item_level_coupon - The deduction is due to a coupon applied to a line item of the invoice. The coupon &#x60;id&#x60; is available as &#x60;entity_id&#x60;.
2418
-
2419
- */
2420
-
2421
- discount_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1127
+ discount_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
2422
1128
 
2423
1129
  coupon_id?:string;
2424
1130
 
2425
- /**
2426
- * @description When the deduction is due to a &#x60;coupon&#x60; or a [discount](discounts), then this is the &#x60;id&#x60; of the coupon or discount.
2427
-
2428
- */
2429
-
2430
1131
  entity_id?:string;
2431
1132
 
2432
- /**
2433
- * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api#currencies).
2434
-
2435
- */
2436
-
2437
1133
  discount_amount:number;
2438
1134
  }
2439
1135
  export interface Tax {
2440
- /**
2441
- * @description The name of the tax applied. E.g. GST.
2442
-
2443
- */
2444
-
2445
1136
  name:string;
2446
1137
 
2447
- /**
2448
- * @description The tax amount.
2449
-
2450
- */
2451
-
2452
1138
  amount:number;
2453
1139
 
2454
- /**
2455
- * @description Description of the tax item.
2456
-
2457
- */
2458
-
2459
1140
  description?:string;
2460
1141
  }
2461
1142
  export interface LineItemTax {
2462
- /**
2463
- * @description The unique reference id of the line item for which the tax is applicable
2464
-
2465
- */
2466
-
2467
1143
  line_item_id?:string;
2468
1144
 
2469
- /**
2470
- * @description The name of the tax applied
2471
-
2472
- */
2473
-
2474
1145
  tax_name:string;
2475
1146
 
2476
- /**
2477
- * @description The rate of tax used to calculate tax amount
2478
-
2479
- */
2480
-
2481
1147
  tax_rate:number;
2482
1148
 
2483
- /**
2484
- * @description Indicates the service period end of the tax rate for the line item.
2485
-
2486
- */
2487
-
2488
1149
  date_to?:number;
2489
1150
 
2490
- /**
2491
- * @description Indicates the service period start of the tax rate for the line item.
2492
-
2493
- */
2494
-
2495
1151
  date_from?:number;
2496
1152
 
2497
- /**
2498
- * @description Indicates the prorated line item amount in cents.
2499
-
2500
- */
2501
-
2502
1153
  prorated_taxable_amount?:number;
2503
1154
 
2504
- /**
2505
- * @description Indicates if tax is applied only on a portion of the line item amount.
2506
-
2507
- */
2508
-
2509
1155
  is_partial_tax_applied?:boolean;
2510
1156
 
2511
- /**
2512
- * @description Indicates the non-compliance tax that should not be reported to the jurisdiction.
2513
-
2514
- */
2515
-
2516
1157
  is_non_compliance_tax?:boolean;
2517
1158
 
2518
- /**
2519
- * @description Indicates the actual portion of the line item amount that is taxable.
2520
-
2521
- */
2522
-
2523
1159
  taxable_amount:number;
2524
1160
 
2525
- /**
2526
- * @description The tax amount
2527
-
2528
- */
2529
-
2530
1161
  tax_amount:number;
2531
1162
 
2532
- /**
2533
- * @description The type of tax jurisdiction \* federal - The tax jurisdiction is a federal \* state - The tax jurisdiction is a state \* city - The tax jurisdiction is a city \* special - Special tax jurisdiction. \* unincorporated - Combined tax of state and county. \* county - The tax jurisdiction is a county \* country - The tax jurisdiction is a country \* other - Jurisdictions other than the ones listed above.
2534
-
2535
- */
2536
-
2537
- tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
2538
-
2539
- /**
2540
- * @description The name of the tax jurisdiction
2541
-
2542
- */
1163
+ tax_juris_type?:'country' | 'federal' | 'state' | 'county' | 'city' | 'special' | 'unincorporated' | 'other';
2543
1164
 
2544
1165
  tax_juris_name?:string;
2545
1166
 
2546
- /**
2547
- * @description The tax jurisdiction code
2548
-
2549
- */
2550
-
2551
1167
  tax_juris_code?:string;
2552
1168
 
2553
- /**
2554
- * @description Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
2555
-
2556
- */
2557
-
2558
1169
  tax_amount_in_local_currency?:number;
2559
1170
 
2560
- /**
2561
- * @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
2562
-
2563
- */
2564
-
2565
1171
  local_currency_code?:string;
2566
1172
  }
2567
- export interface LineItemTier {
2568
- /**
2569
- * @description Uniquely identifies a line_item
2570
-
2571
- */
1173
+ export interface LineItemCredit {
1174
+ cn_id:string;
2572
1175
 
2573
- line_item_id?:string;
1176
+ applied_amount:number;
2574
1177
 
2575
- /**
2576
- * @description The lower limit of a range of units for the tier
2577
-
2578
- */
1178
+ line_item_id?:string;
1179
+ }
1180
+ export interface LineItemTier {
1181
+ line_item_id?:string;
2579
1182
 
2580
1183
  starting_unit:number;
2581
1184
 
2582
- /**
2583
- * @description The upper limit of a range of units for the tier
2584
-
2585
- */
2586
-
2587
1185
  ending_unit?:number;
2588
1186
 
2589
- /**
2590
- * @description The number of units purchased in a range.
2591
-
2592
- */
2593
-
2594
1187
  quantity_used:number;
2595
1188
 
2596
- /**
2597
- * @description The price of the tier if the charge model is a &#x60;stairtstep&#x60; pricing , or the price of each unit in the tier if the charge model is &#x60;tiered&#x60;/&#x60;volume&#x60; pricing.
2598
-
2599
- */
2600
-
2601
1189
  unit_amount:number;
2602
1190
 
2603
- /**
2604
- * @description The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as &#x60;ending_unit_in_decimal&#x60; of the next lower tier. Returned only when the &#x60;line_items.pricing_model&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
2605
-
2606
- */
2607
-
2608
1191
  starting_unit_in_decimal?:string;
2609
1192
 
2610
- /**
2611
- * @description The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the &#x60;starting_unit_in_decimal&#x60; of the next higher tier. Returned only when the &#x60;line_items.pricing_model&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60; or stairstep and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
2612
-
2613
- */
2614
-
2615
1193
  ending_unit_in_decimal?:string;
2616
1194
 
2617
- /**
2618
- * @description The decimal representation of the quantity purchased from this tier. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
2619
-
2620
- */
2621
-
2622
1195
  quantity_used_in_decimal?:string;
2623
1196
 
2624
- /**
2625
- * @description The decimal representation of the per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. When the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;, it is the decimal representation of the total price for &#x60;line_item&#x60;. The value is in major units of the currency. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
2626
-
2627
- */
2628
-
2629
1197
  unit_amount_in_decimal?:string;
2630
1198
  }
2631
- export interface InvoiceTransaction {
2632
- /**
2633
- * @description Uniquely identifies the transaction.
2634
-
2635
- */
2636
-
1199
+ export interface LinkedPayment {
2637
1200
  txn_id:string;
2638
1201
 
2639
- /**
2640
- * @description The transaction amount applied to this invoice
2641
-
2642
- */
2643
-
2644
1202
  applied_amount:number;
2645
1203
 
2646
- /**
2647
- * @description Timestamp at which the transaction is applied.
2648
-
2649
- */
2650
-
2651
1204
  applied_at:number;
2652
1205
 
2653
- /**
2654
- * @description The status of this transaction. \* timeout - Transaction failed because of Gateway not accepting the connection. \* failure - Transaction failed. Refer the &#x27;error_code&#x27; and &#x27;error_text&#x27; fields to know the reason for failure \* in_progress - Transaction is being processed by the gateway. This typically happens for [direct debit transactions](https://www.chargebee.com/docs/direct-debit-payments.html) or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method. \* success - The transaction is successful. \* voided - The transaction got voided or authorization expired at gateway. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually
2655
-
2656
- */
2657
-
2658
- txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
2659
-
2660
- /**
2661
- * @description Indicates when this transaction occurred.
2662
-
2663
- */
1206
+ txn_status?:'in_progress' | 'success' | 'voided' | 'failure' | 'timeout' | 'needs_attention' | 'late_failure';
2664
1207
 
2665
1208
  txn_date?:number;
2666
1209
 
2667
- /**
2668
- * @description Total amount of the transaction
2669
-
2670
- */
2671
-
2672
1210
  txn_amount?:number;
2673
1211
  }
2674
1212
  export interface DunningAttempt {
2675
- /**
2676
- * @description Dunning attempt number.
2677
-
2678
- */
2679
-
2680
1213
  attempt:number;
2681
1214
 
2682
- /**
2683
- * @description Transaction associated with attempt.
2684
-
2685
- */
2686
-
2687
1215
  transaction_id?:string;
2688
1216
 
2689
- /**
2690
- * @description Types of dunning \* offline - Dunning type is offline. \* direct_debit - Dunning type is direct debit. \* auto_collect - Dunning type is auto collection.
2691
-
2692
- */
2693
-
2694
- dunning_type:'offline' | 'auto_collect' | 'direct_debit';
2695
-
2696
- /**
2697
- * @description Timestamp at which the attempt was made.
2698
-
2699
- */
1217
+ dunning_type:'auto_collect' | 'offline' | 'direct_debit';
2700
1218
 
2701
1219
  created_at?:number;
2702
1220
 
2703
- /**
2704
- * @description The status of this transaction. \* success - The transaction is successful. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually \* failure - Transaction failed. Refer the &#x27;error_code&#x27; and &#x27;error_text&#x27; fields to know the reason for failure \* voided - The transaction got voided or authorization expired at gateway. \* in_progress - Transaction is being processed by the gateway. This typically happens for [direct debit transactions](https://www.chargebee.com/docs/direct-debit-payments.html) or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method. \* timeout - Transaction failed because of Gateway not accepting the connection.
2705
-
2706
- */
2707
-
2708
- txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
2709
-
2710
- /**
2711
- * @description Total amount of the transaction
2712
-
2713
- */
1221
+ txn_status?:'in_progress' | 'success' | 'voided' | 'failure' | 'timeout' | 'needs_attention' | 'late_failure';
2714
1222
 
2715
1223
  txn_amount?:number;
2716
1224
  }
2717
1225
  export interface AppliedCredit {
2718
- /**
2719
- * @description Credit applied on the credit note ID.
2720
-
2721
- */
2722
-
2723
1226
  cn_id:string;
2724
1227
 
2725
- /**
2726
- * @description Total credit amount applied to this invoice.
2727
-
2728
- */
2729
-
2730
1228
  applied_amount:number;
2731
1229
 
2732
- /**
2733
- * @description Timestamp when the credit amount was applied to this invoice.
2734
-
2735
- */
2736
-
2737
1230
  applied_at:number;
2738
1231
 
2739
- /**
2740
- * @description Credit note reason code. Deprecated; use the cn_create_reason_code parameter instead \* other - Can be set when none of the above reason codes are applicable \* order_cancellation - Order Cancellation \* product_unsatisfactory - Product Unsatisfactory \* chargeback - Can be set when you are recording your customer Chargebacks \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* fraudulent - FRAUDULENT \* subscription_pause - This reason will be automatically set to credit notes created during pause/resume subscription operation. \* service_unsatisfactory - Service Unsatisfactory \* subscription_change - This reason will be set automatically for Credit Notes created during Change Subscription operation when [proration](https://www.chargebee.com/docs/proration.html) is enabled \* write_off - This reason will be set automatically for the Credit Notes created during invoice [Write Off](https://www.chargebee.com/docs/invoice-operations.html#write-off) operation. \* order_change - Order Change \* waiver - Waiver
2741
-
2742
- */
2743
-
2744
- cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
2745
-
2746
- /**
2747
- * @description Credit note reason code
2748
-
2749
- */
1232
+ cn_reason_code?:'write_off' | 'subscription_change' | 'subscription_cancellation' | 'subscription_pause' | 'chargeback' | 'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other' | 'fraudulent';
2750
1233
 
2751
1234
  cn_create_reason_code?:string;
2752
1235
 
2753
- /**
2754
- * @description Indicates the date at which this credit note is created
2755
-
2756
- */
2757
-
2758
1236
  cn_date?:number;
2759
1237
 
2760
- /**
2761
- * @description Credit note status. \* voided - When the Credit Note has been cancelled. \* adjusted - When the Credit Note has been adjusted against an invoice. \* refund_due - When the credits are yet to be used, or have been partially used. \* refunded - When the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded).
2762
-
2763
- */
1238
+ cn_status:'adjusted' | 'refunded' | 'refund_due' | 'voided';
2764
1239
 
2765
- cn_status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
1240
+ tax_application?:'pre_tax' | 'post_tax';
2766
1241
  }
2767
- export interface CreatedCreditNote {
2768
- /**
2769
- * @description Credit-note id
2770
-
2771
- */
2772
-
1242
+ export interface AdjustmentCreditNote {
2773
1243
  cn_id:string;
2774
1244
 
2775
- /**
2776
- * @description Credit note reason code. Deprecated; use the cn_create_reason_code parameter instead \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* waiver - Waiver \* write_off - This reason will be set automatically for the Credit Notes created during invoice [Write Off](https://www.chargebee.com/docs/invoice-operations.html#write-off) operation. \* service_unsatisfactory - Service Unsatisfactory \* fraudulent - FRAUDULENT \* product_unsatisfactory - Product Unsatisfactory \* order_change - Order Change \* subscription_change - This reason will be set automatically for Credit Notes created during Change Subscription operation when [proration](https://www.chargebee.com/docs/proration.html) is enabled \* order_cancellation - Order Cancellation \* other - Can be set when none of the above reason codes are applicable \* chargeback - Can be set when you are recording your customer Chargebacks \* subscription_pause - This reason will be automatically set to credit notes created during pause/resume subscription operation.
2777
-
2778
- */
2779
-
2780
- cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
2781
-
2782
- /**
2783
- * @description Credit note reason code
2784
-
2785
- */
1245
+ cn_reason_code?:'write_off' | 'subscription_change' | 'subscription_cancellation' | 'subscription_pause' | 'chargeback' | 'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other' | 'fraudulent';
2786
1246
 
2787
1247
  cn_create_reason_code?:string;
2788
1248
 
2789
- /**
2790
- * @description Indicates the date at which this credit note is created
2791
-
2792
- */
2793
-
2794
1249
  cn_date?:number;
2795
1250
 
2796
- /**
2797
- * @description Total amount of the credit note.
2798
-
2799
- */
2800
-
2801
1251
  cn_total?:number;
2802
1252
 
2803
- /**
2804
- * @description Credit note status. \* refunded - When the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded). \* voided - When the Credit Note has been cancelled. \* refund_due - When the credits are yet to be used, or have been partially used. \* adjusted - When the Credit Note has been adjusted against an invoice.
2805
-
2806
- */
2807
-
2808
- cn_status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
1253
+ cn_status:'adjusted' | 'refunded' | 'refund_due' | 'voided';
2809
1254
  }
2810
- export interface CreatedCreditNote {
2811
- /**
2812
- * @description Credit-note id
2813
-
2814
- */
2815
-
1255
+ export interface IssuedCreditNote {
2816
1256
  cn_id:string;
2817
1257
 
2818
- /**
2819
- * @description Credit note reason code. Deprecated; use the cn_create_reason_code parameter instead \* fraudulent - FRAUDULENT \* chargeback - Can be set when you are recording your customer Chargebacks \* subscription_pause - This reason will be automatically set to credit notes created during pause/resume subscription operation. \* order_change - Order Change \* subscription_change - This reason will be set automatically for Credit Notes created during Change Subscription operation when [proration](https://www.chargebee.com/docs/proration.html) is enabled \* product_unsatisfactory - Product Unsatisfactory \* write_off - This reason will be set automatically for the Credit Notes created during invoice [Write Off](https://www.chargebee.com/docs/invoice-operations.html#write-off) operation. \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* service_unsatisfactory - Service Unsatisfactory \* waiver - Waiver \* order_cancellation - Order Cancellation \* other - Can be set when none of the above reason codes are applicable
2820
-
2821
- */
2822
-
2823
- cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
2824
-
2825
- /**
2826
- * @description Credit note reason code
2827
-
2828
- */
1258
+ cn_reason_code?:'write_off' | 'subscription_change' | 'subscription_cancellation' | 'subscription_pause' | 'chargeback' | 'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other' | 'fraudulent';
2829
1259
 
2830
1260
  cn_create_reason_code?:string;
2831
1261
 
2832
- /**
2833
- * @description Indicates the date at which this credit note is created
2834
-
2835
- */
2836
-
2837
1262
  cn_date?:number;
2838
1263
 
2839
- /**
2840
- * @description Total amount of the credit note.
2841
-
2842
- */
2843
-
2844
1264
  cn_total?:number;
2845
1265
 
2846
- /**
2847
- * @description Credit note status. \* refund_due - When the credits are yet to be used, or have been partially used. \* adjusted - When the Credit Note has been adjusted against an invoice. \* voided - When the Credit Note has been cancelled. \* refunded - When the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded).
2848
-
2849
- */
2850
-
2851
- cn_status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
1266
+ cn_status:'adjusted' | 'refunded' | 'refund_due' | 'voided';
2852
1267
  }
2853
1268
  export interface LinkedOrder {
2854
- /**
2855
- * @description Uniquely identifies the order. It is the api identifier for the order
2856
-
2857
- */
2858
-
2859
1269
  id:string;
2860
1270
 
2861
- /**
2862
- * @description The order&#x27;s serial number
2863
-
2864
- */
2865
-
2866
1271
  document_number?:string;
2867
1272
 
2868
- /**
2869
- * @description The status of this order. \* awaiting_shipment - The order has been picked up by an integration system, and synced to a shipping management platform \* queued - Order is yet to be processed by any system, these are scheduled orders created by Chargebee \* returned - The order has been returned after delivery. \* complete - Order has been processed successfully. Applicable only if you are using Chargebee&#x27;s legacy order management system \* processing - Order is being processed. Applicable only if you are using Chargebee&#x27;s legacy order management system \* new - Order has been created. Applicable only if you are using Chargebee&#x27;s legacy order management system. \* shipped - The order has moved from order management system to a shipping system. \* on_hold - The order is paused from being processed. \* cancelled - Order has been cancelled. Applicable only if you are using Chargebee&#x27;s legacy order management system \* delivered - The order has been delivered to the customer. \* partially_delivered - The order has been partially delivered to the customer. \* voided - Order has been voided. Applicable only if you are using Chargebee&#x27;s legacy order management system
2870
-
2871
- */
2872
-
2873
- status?:'new' | 'partially_delivered' | 'queued' | 'delivered' | 'on_hold' | 'shipped' | 'processing' | 'cancelled' | 'voided' | 'complete' | 'awaiting_shipment' | 'returned';
2874
-
2875
- /**
2876
- * @description Order type \* system_generated - The order has been created by Chargebee automatically based on the preferences set by the user. \* manual - The order has been created by the the user using Chargebee&#x27;s legacy order management system.
2877
-
2878
- */
2879
-
2880
- order_type?:'system_generated' | 'manual';
1273
+ status?:'new' | 'processing' | 'complete' | 'cancelled' | 'voided' | 'queued' | 'awaiting_shipment' | 'on_hold' | 'delivered' | 'shipped' | 'partially_delivered' | 'returned';
2881
1274
 
2882
- /**
2883
- * @description Reference id can be used to map the orders in the shipping/order management application to the orders in ChargeBee. The reference_id generally is same as the order id in the third party application.
2884
-
2885
- */
1275
+ order_type?:'manual' | 'system_generated';
2886
1276
 
2887
1277
  reference_id?:string;
2888
1278
 
2889
- /**
2890
- * @description The fulfillment status of an order as reflected in the shipping/order management application. Typical statuses include Shipped,Awaiting Shipment,Not fulfilled etc;
2891
-
2892
- */
2893
-
2894
1279
  fulfillment_status?:string;
2895
1280
 
2896
- /**
2897
- * @description Unique id to identify a group of orders.
2898
-
2899
- */
2900
-
2901
1281
  batch_id?:string;
2902
1282
 
2903
- /**
2904
- * @description The time at which the order was created
2905
-
2906
- */
2907
-
2908
1283
  created_at:number;
2909
1284
  }
2910
1285
  export interface Note {
2911
- /**
2912
- * @description Type of entity to which the note belongs. \* subscription - Entity that represents a subscription of customer. \* customer - Entity that represents a customer. \* plan - Entity that represents a plan. \* tax - The note is configured as part of the [tax configuration](https://www.chargebee.com/docs/tax.html) in Chargebee Billing. \* addon_item_price - Indicates that this line item is based on addon Item Price \* addon - Entity that represents an addon. \* plan_item_price - Indicates that this line item is based on plan Item Price \* coupon - Entity that represents a coupon. \* charge_item_price - Indicates that this line item is based on charge Item Price
2913
-
2914
- */
2915
-
2916
- entity_type:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price' | 'tax' | 'subscription' | 'customer';
2917
-
2918
- /**
2919
- * @description Actual note.
2920
-
2921
- */
1286
+ entity_type:'coupon' | 'subscription' | 'customer' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price' | 'tax' | 'plan' | 'addon';
2922
1287
 
2923
1288
  note:string;
2924
1289
 
2925
- /**
2926
- * @description Unique identifier of the entity.
2927
-
2928
- */
2929
-
2930
1290
  entity_id?:string;
2931
1291
  }
2932
1292
  export interface ShippingAddress {
2933
- /**
2934
- * @description The first name of the contact.
2935
-
2936
- */
2937
-
2938
1293
  first_name?:string;
2939
1294
 
2940
- /**
2941
- * @description The last name of the contact.
2942
-
2943
- */
2944
-
2945
1295
  last_name?:string;
2946
1296
 
2947
- /**
2948
- * @description The email address.
2949
-
2950
- */
2951
-
2952
1297
  email?:string;
2953
1298
 
2954
- /**
2955
- * @description The company name.
2956
-
2957
- */
2958
-
2959
1299
  company?:string;
2960
1300
 
2961
- /**
2962
- * @description The phone number.
2963
-
2964
- */
2965
-
2966
1301
  phone?:string;
2967
1302
 
2968
- /**
2969
- * @description Address line 1
2970
-
2971
- */
2972
-
2973
1303
  line1?:string;
2974
1304
 
2975
- /**
2976
- * @description Address line 2
2977
-
2978
- */
2979
-
2980
1305
  line2?:string;
2981
1306
 
2982
- /**
2983
- * @description Address line 3
2984
-
2985
- */
2986
-
2987
1307
  line3?:string;
2988
1308
 
2989
- /**
2990
- * @description The name of the city.
2991
-
2992
- */
2993
-
2994
1309
  city?:string;
2995
1310
 
2996
- /**
2997
- * @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 &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
2998
-
2999
- */
3000
-
3001
1311
  state_code?:string;
3002
1312
 
3003
- /**
3004
- * @description The state/province name.
3005
-
3006
- */
3007
-
3008
1313
  state?:string;
3009
1314
 
3010
- /**
3011
- * @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).
3012
-
3013
- **Note** : If you enter an invalid country code, the system will return an error.
3014
-
3015
- **Brexit**
3016
-
3017
-
3018
- 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 &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
3019
-
3020
- */
3021
-
3022
1315
  country?:string;
3023
1316
 
3024
- /**
3025
- * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
3026
-
3027
- */
3028
-
3029
1317
  zip?:string;
3030
1318
 
3031
- /**
3032
- * @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.
3033
-
3034
- */
3035
-
3036
1319
  validation_status?:ValidationStatus;
3037
1320
 
3038
- /**
3039
- * @description The index number of the subscription to which the item price is added. Provide a unique number between &#x60;0&#x60; and &#x60;4&#x60; (inclusive) for each subscription that is to be created.
3040
-
3041
- */
3042
-
3043
1321
  index:number;
3044
1322
  }
3045
1323
  export interface StatementDescriptor {
3046
- /**
3047
- * @description Uniquely identifies a statement_descriptor
3048
-
3049
- */
3050
-
3051
1324
  id:string;
3052
1325
 
3053
- /**
3054
- * @description Payment descriptor text
3055
-
3056
- */
3057
-
3058
1326
  descriptor?:string;
3059
-
3060
- /**
3061
- * @description Payment descriptor additional info
3062
-
3063
- */
3064
-
3065
- additional_info?:string;
3066
1327
  }
3067
1328
  export interface BillingAddress {
3068
- /**
3069
- * @description The first name of the billing contact.
3070
-
3071
- */
3072
-
3073
1329
  first_name?:string;
3074
1330
 
3075
- /**
3076
- * @description The last name of the billing contact.
3077
-
3078
- */
3079
-
3080
1331
  last_name?:string;
3081
1332
 
3082
- /**
3083
- * @description The email address.
3084
-
3085
- */
3086
-
3087
1333
  email?:string;
3088
1334
 
3089
- /**
3090
- * @description The company name.
3091
-
3092
- */
3093
-
3094
1335
  company?:string;
3095
1336
 
3096
- /**
3097
- * @description The phone number.
3098
-
3099
- */
3100
-
3101
1337
  phone?:string;
3102
1338
 
3103
- /**
3104
- * @description Address line 1
3105
-
3106
- */
3107
-
3108
1339
  line1?:string;
3109
1340
 
3110
- /**
3111
- * @description Address line 2
3112
-
3113
- */
3114
-
3115
1341
  line2?:string;
3116
1342
 
3117
- /**
3118
- * @description Address line 3
3119
-
3120
- */
3121
-
3122
1343
  line3?:string;
3123
1344
 
3124
- /**
3125
- * @description The name of the city.
3126
-
3127
- */
3128
-
3129
1345
  city?:string;
3130
1346
 
3131
- /**
3132
- * @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 &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
3133
-
3134
- */
3135
-
3136
1347
  state_code?:string;
3137
1348
 
3138
- /**
3139
- * @description State or Province
3140
-
3141
- */
3142
-
3143
1349
  state?:string;
3144
1350
 
3145
- /**
3146
- * @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).
3147
-
3148
- **Note** : If you enter an invalid country code, the system will return an error.
3149
-
3150
- **Brexit**
3151
-
3152
-
3153
- 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 &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
3154
-
3155
- */
3156
-
3157
1351
  country?:string;
3158
1352
 
3159
- /**
3160
- * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
3161
-
3162
- */
3163
-
3164
1353
  zip?:string;
3165
1354
 
3166
- /**
3167
- * @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. \* not_validated - Address is not yet validated. \* invalid - Address is invalid.
3168
-
3169
- */
3170
-
3171
1355
  validation_status?:ValidationStatus;
3172
1356
  }
3173
1357
  export interface Einvoice {
3174
- /**
3175
- * @description The unique &#x60;id&#x60; for the e-invoice. This is auto-generated by Chargebee.
3176
-
3177
- */
3178
-
3179
1358
  id:string;
3180
1359
 
3181
- /**
3182
- * @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.
3183
-
3184
- */
3185
-
3186
1360
  reference_number?:string;
3187
1361
 
3188
- /**
3189
- * @description The status of processing the e-invoice. To obtain detailed information about the current &#x60;status&#x60;, see &#x60;message&#x60;. \* skipped - The e-invoice was not sent. This could be due to missing information or because the &#x60;entity_identifier&#x60; is not registered on the e-invoicing network. \* 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. \* scheduled - Sending the e-invoice to the customer has been scheduled. \* success - The e-invoice has been successfully delivered to the customer. \* registered - The e-invoice was sent and there was an error due to which it was not delivered but got cleared in the IRP.
3190
-
3191
- */
3192
-
3193
- status:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
3194
-
3195
- /**
3196
- * @description Detailed information about the status of the e-invoice. When &#x60;status&#x60; is &#x60;skipped&#x60; or &#x60;failed&#x60;, this contains the reason or error details. The following are some valid examples:
3197
-
3198
- * Invoice successfully sent to customer via the e-invoicing network 9090:123456
3199
- * Invoice successfully sent to customer via email id abc@acme.com
3200
-
3201
- */
1362
+ status:'scheduled' | 'skipped' | 'in_progress' | 'success' | 'failed' | 'registered';
3202
1363
 
3203
1364
  message?:string;
3204
1365
  }
3205
- export interface LinkedTaxWithheld {
3206
- /**
3207
- * @description An auto-generated unique identifier for the tax withheld. The value starts with the prefix &#x60;tax_wh_&#x60;. For example, &#x60;tax_wh_16BdDXSlbu4uV1Ee6&#x60;.
3208
-
3209
- */
3210
-
3211
- id:string;
1366
+ export interface SiteDetailsAtCreation {
1367
+ timezone?:string;
3212
1368
 
3213
- /**
3214
- * @description The amount withheld by the customer as tax from the invoice. The unit depends on the [type of currency](/docs/api#md_disabled).
3215
-
3216
- */
3217
-
3218
- amount?:number;
3219
-
3220
- /**
3221
- * @description The description for this tax withheld.
3222
-
3223
- */
3224
-
3225
- description?:string;
3226
-
3227
- /**
3228
- * @description Date or time associated with the tax withheld.
3229
-
3230
- */
3231
-
3232
- date?:number;
3233
-
3234
- /**
3235
- * @description A unique external reference number for the tax withheld. Typically, this is the reference number used by the system you are integrating the API with. Depending on your integration, this could be the reference number issued by the taxation authority to identify the customer or the specific tax transaction.
3236
-
3237
- */
3238
-
3239
- reference_number?:string;
3240
- }
3241
-
3242
- export interface SiteDetailsAtCreation {
3243
- timezone?: string;
3244
- organization_address?: object;
1369
+ organization_address?:object;
3245
1370
  }
3246
1371
  export interface TaxOrigin {
3247
1372
  country?:string;