chargebee 2.45.0 → 2.47.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.
@@ -1,538 +1,175 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  ///<reference path='./../index.d.ts'/>
3
-
4
3
  declare module 'chargebee' {
5
4
  export interface CreditNote {
6
5
 
7
- /**
8
- * @description Credit-note id.
9
6
 
10
- */
11
-
12
7
  id:string;
13
-
14
- /**
15
- * @description The identifier of the customer this Credit Note belongs to.
16
8
 
17
- */
18
-
19
9
  customer_id:string;
20
-
21
- /**
22
- * @description The identifier of the subscription this Credit Note belongs to.
23
- **Note:** If *consolidated invoicing* is enabled, to know the subscriptions attached with this Credit Note you have to refer [line_item&#x27;s](/docs/api/credit_notes#credit_note_line_items) *subscription_id* . This attribute should **not** be used (which will be *null* if this credit note has lines from multiple subscriptions).
24
10
 
25
- */
26
-
27
11
  subscription_id?:string;
28
-
29
- /**
30
- * @description The identifier of the invoice against which this Credit Note is issued
31
12
 
32
- */
33
-
34
- reference_invoice_id:string;
35
-
36
- /**
37
- * @description The credit note type. \* refundable - Refundable Credit Note \* adjustment - Adjustment Credit Note
13
+ reference_invoice_id?:string;
38
14
 
39
- */
40
-
41
- type:'adjustment' | 'refundable';
42
-
43
- /**
44
- * @description The reason for issuing this Credit Note. The following reason codes are supported now\[Deprecated; use the [create_reason_code](/docs/api/credit_notes#credit_note_create_reason_code) parameter instead\] \* 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_change - Order Change \* other - Can be set when none of the above reason codes are applicable \* 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. \* waiver - Waiver \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* product_unsatisfactory - Product Unsatisfactory \* order_cancellation - Order Cancellation \* 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
15
+ type:'adjustment' | 'refundable' | 'store';
45
16
 
46
- */
47
-
48
- reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
49
-
50
- /**
51
- * @description The credit note status. \* voided - When the Credit Note has been cancelled. \* 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). \* adjusted - When the Credit Note has been adjusted against an invoice.
17
+ reason_code?:'write_off' | 'subscription_change' | 'subscription_cancellation' | 'subscription_pause' | 'chargeback' | 'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other' | 'fraudulent';
52
18
 
53
- */
54
-
55
- status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
56
-
57
- /**
58
- * @description VAT number of the customer for whom this Credit Note is raised.
19
+ status:'adjusted' | 'refunded' | 'refund_due' | 'voided';
59
20
 
60
- */
61
-
62
21
  vat_number?:string;
63
-
64
- /**
65
- * @description The date the Credit Note is issued.
66
22
 
67
- */
68
-
69
23
  date?:number;
70
-
71
- /**
72
- * @description The price type of the Credit Note. \* tax_inclusive - All amounts in the document are inclusive of tax. \* tax_exclusive - All amounts in the document are exclusive of tax.
73
24
 
74
- */
75
-
76
25
  price_type:PriceType;
77
-
78
- /**
79
- * @description The currency code (ISO 4217 format) for the credit note
80
26
 
81
- */
82
-
83
27
  currency_code:string;
84
-
85
- /**
86
- * @description Credit Note amount in cents.
87
28
 
88
- */
89
-
90
29
  total?:number;
91
-
92
- /**
93
- * @description The amount allocated to the invoices.
94
30
 
95
- */
96
-
97
31
  amount_allocated?:number;
98
-
99
- /**
100
- * @description The refunds issued from this Credit Note.
101
32
 
102
- */
103
-
104
33
  amount_refunded?:number;
105
-
106
- /**
107
- * @description The yet to be used credits of this Credit Note.
108
34
 
109
- */
110
-
111
35
  amount_available?:number;
112
-
113
- /**
114
- * @description The time this Credit Note gets fully used. Please note that this field is not present when partial refunds are issued.
115
36
 
116
- */
117
-
118
37
  refunded_at?:number;
119
-
120
- /**
121
- * @description Timestamp indicating the date and time this Credit Note gets voided.
122
38
 
123
- */
124
-
125
39
  voided_at?:number;
126
-
127
- /**
128
- * @description The date/time when the credit note was raised. This date/time can be backdated, which means that the date/time can be earlier than the date/time the credit note was created.
129
40
 
130
- */
131
-
132
41
  generated_at?:number;
133
-
134
- /**
135
- * @description Version number of this resource. The &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
136
42
 
137
- */
138
-
139
43
  resource_version?:number;
140
-
141
- /**
142
- * @description Timestamp indicating when this Credit Note was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
143
44
 
144
- */
145
-
146
45
  updated_at?:number;
147
-
148
- /**
149
- * @description The subscription channel this object originated from and is maintained in. \* play_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
150
-
151
- In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.
152
- \* web - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI. \* app_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.
153
46
 
154
- */
155
-
156
47
  channel?:Channel;
157
-
158
- /**
159
- * @description The Credit Note sub-total
160
48
 
161
- */
162
-
49
+ einvoice?:CreditNote.Einvoice;
50
+
163
51
  sub_total:number;
164
-
165
- /**
166
- * @description Invoice subtotal in the currency of the place of supply.
167
52
 
168
- */
169
-
170
53
  sub_total_in_local_currency?:number;
171
-
172
- /**
173
- * @description Total invoice amount in the currency of the place of supply.
174
54
 
175
- */
176
-
177
55
  total_in_local_currency?:number;
178
-
179
- /**
180
- * @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed.
181
56
 
182
- */
183
-
184
57
  local_currency_code?:string;
185
-
186
- /**
187
- * @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 &#x60;round_off_amount&#x60;. If there is no &#x60;round-off amount&#x60;, it will display &#x60;0&#x60;.
188
58
 
189
- */
190
-
191
59
  round_off_amount?:number;
192
-
193
- /**
194
- * @description Indicates the fractional correction amount.
195
60
 
196
- */
197
-
198
61
  fractional_correction?:number;
199
-
200
- /**
201
- * @description Indicates that this resource has been deleted.
202
-
203
- */
204
-
205
- deleted:boolean;
206
-
207
- /**
208
- * @description Specifies the customer&#x27;s category for the Goods and Services Tax (GST). This field is returned only if you&#x27;ve configured GST for the India region.
209
-
210
- */
211
-
212
- tax_category?:string;
213
-
214
- /**
215
- * @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&#x27;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.
216
-
217
- */
218
-
219
- local_currency_exchange_rate?:number;
220
-
221
- /**
222
- * @description Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Credit Notes \&gt; Create Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive
223
-
224
- */
225
-
226
- create_reason_code?:string;
227
-
228
- /**
229
- * @description An overridden value for the first two characters of the [full VAT
230
- 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** ).
231
62
 
232
- When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
233
- 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
234
- 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.
235
-
236
- */
237
-
238
- vat_number_prefix?:string;
239
-
240
- /**
241
- * @description The unique ID of the [business entity](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) of this credit_note. This is always the same as the business entity of the invoice referred to by [reference_invoice_id](/docs/api/credit_notes?prod_cat_ver&#x3D;2#credit_note_reference_invoice_id).
242
-
243
- */
244
-
245
- business_entity_id?:string;
246
-
247
- /**
248
- * @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.
249
-
250
- */
251
-
252
- einvoice?:CreditNote.Einvoice;
253
-
254
- /**
255
- * @description The line items of this Credit Note
256
-
257
- */
258
-
259
63
  line_items?:CreditNote.LineItem[];
260
-
261
- /**
262
- * @description The list of discounts applied to this Credit Note
263
64
 
264
- */
265
-
266
65
  discounts?:CreditNote.Discount[];
267
-
268
- /**
269
- * @description The list of discount(s) applied for each line item of this invoice.
270
66
 
271
- */
272
-
273
67
  line_item_discounts?:CreditNote.LineItemDiscount[];
274
-
275
- /**
276
- * @description The list of tiers applicable for this line item
277
68
 
278
- */
279
-
280
69
  line_item_tiers?:CreditNote.LineItemTier[];
281
-
282
- /**
283
- * @description The tax-lines of this Credit Note
284
70
 
285
- */
286
-
287
71
  taxes?:CreditNote.Tax[];
288
-
289
- /**
290
- * @description The list of taxes applied on line items
291
72
 
292
- */
293
-
294
73
  line_item_taxes?:CreditNote.LineItemTax[];
295
-
296
- /**
297
- * @description Payment Refunds issued from this Credit Note
298
74
 
299
- */
300
-
301
- linked_refunds?:CreditNote.CreditNoteTransaction[];
302
-
303
- /**
304
- * @description The details of refunds recorded against the [invoice.linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld) component of the &#x60;invoice&#x60; [associated](/docs/api/credit_notes#credit_note_reference_invoice_id) with this &#x60;credit_note&#x60;.
75
+ linked_refunds?:CreditNote.LinkedRefund[];
305
76
 
306
- */
307
-
308
- linked_tax_withheld_refunds?:CreditNote.LinkedTaxWithheldRefund[];
309
-
310
- /**
311
- * @description Invoice allocations made from this Credit Note.
77
+ allocations?:CreditNote.Allocation[];
312
78
 
313
- */
314
-
315
- allocations?:CreditNote.AppliedCredit[];
316
-
317
- /**
318
- * @description Shipping address for the quote.
79
+ deleted:boolean;
80
+
81
+ tax_category?:string;
82
+
83
+ local_currency_exchange_rate?:number;
84
+
85
+ create_reason_code?:string;
86
+
87
+ vat_number_prefix?:string;
88
+
89
+ business_entity_id?:string;
319
90
 
320
- */
321
-
322
91
  shipping_address?:CreditNote.ShippingAddress;
323
-
324
- /**
325
- * @description Billing address for the quote.
326
92
 
327
- */
328
-
329
93
  billing_address?:CreditNote.BillingAddress;
330
-
94
+
331
95
  site_details_at_creation?:CreditNote.SiteDetailsAtCreation;
332
96
 
333
97
  tax_origin?:CreditNote.TaxOrigin;
98
+
334
99
  }
335
100
  export namespace CreditNote {
336
101
  export class CreditNoteResource {
337
- /**
338
- * @description Creates a &#x60;credit_note&#x60; for the specified invoice.
339
- **Note:**
340
-
341
- If the &#x60;credit_note&#x60; [type](/docs/api/credit_notes#create_credit_note_type) is &#x60;refundable&#x60;, then &#x60;linked_taxes_withheld.amount&#x60; for the [invoice specified](/docs/api/credit_notes#create_credit_note_reference_invoice_id) can also be included in the [total](/docs/api/credit_notes#create_credit_note_total).
342
-
343
- */
344
-
345
102
  create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
346
103
 
347
- /**
348
- * @description Retrieves the Credit Note identified by the specified Credit Note number.
349
-
350
- */
351
-
352
- retrieve(credit_note_id:string):ChargebeeRequest<RetrieveResponse>;
104
+ retrieve(credit_note_id:string, input?:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
353
105
 
354
- /**
355
- * @description Gets the credit note as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
356
-
357
- */
358
-
359
106
  pdf(credit_note_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
360
107
 
361
- /**
362
- * @description Download the e-invoice for the credit note 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-creditnote/tree/).
363
- **Note**
364
-
365
- * You can only download e-invoices when their &#x60;status&#x60; is &#x60;success&#x60; or &#x60;registered&#x60;.
366
- * 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-creditnote/cac-AdditionalDocumentReference/cac-Attachment/cbc-EmbeddedDocumentBinaryObject/), which is the Base64-encoded version of the PDF.
367
-
368
- */
369
-
370
108
  download_einvoice(credit_note_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
371
109
 
372
- /**
373
- * @description Refunds a ([refundable](https://www.chargebee.com/docs/credit-notes.html#types-of-credit-notes_refundable-credit-note)) credit note to the [payment source](/docs/api/payment_sources) associated with the [transaction](/docs/api/transactions). Any [linked_tax_withheld_refunds](/docs/api/credit_notes#credit_note_linked_tax_withheld_refunds) recorded against the credit note are not refunded.
374
-
375
- */
376
-
377
110
  refund(credit_note_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
378
111
 
379
- /**
380
- * @description Refunds a ([refundable](https://www.chargebee.com/docs/credit-notes.html#types-of-credit-notes_refundable-credit-note)) credit note. The refund is provided against &#x60;linked_payments&#x60; first and then against any &#x60;linked_taxes_withheld&#x60; for the [invoice](/docs/api/credit_notes#credit_note_reference_invoice_id) associated with the &#x60;credit_note&#x60;. For payments made via online transactions, the refund request is processed via the [payment source](/docs/api/payment_sources) associated with the [transaction](/docs/api/transactions).
381
-
382
- */
383
-
384
112
  record_refund(credit_note_id:string, input:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
385
113
 
386
- /**
387
- * @description Use this API to [void a credit note.](https://www.chargebee.com/docs/credit-notes.html#voiding-or-deleting-a-credit-note) A voided credit is a null entity and cannot be used again. A credit note which has already been voided or refunded cannot be voided. An error message will be displayed when you render such credit notes void.
388
-
389
- **Note:** When adjustment credit notes are voided, the associated invoice will reflect as NOT PAID, and the amount in the invoice will be recalculated to reflect the amount after considering the voided credit note.
390
-
391
- */
392
-
393
114
  void_credit_note(credit_note_id:string, input?:VoidCreditNoteInputParam):ChargebeeRequest<VoidCreditNoteResponse>;
394
115
 
395
- /**
396
- * @description Lists all the Credit Notes.
397
-
398
- */
399
-
400
116
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
401
117
 
402
- /**
403
- * @description This API [deletes a credit note.](https://www.chargebee.com/docs/credit-notes.html#voiding-or-deleting-a-credit-note) A credit note once deleted, is deleted permanently. You cannot delete a credit which has already been deleted or refunded. If you try to delete a refunded or deleted credit note, an error message will be displayed.
404
-
405
- */
406
-
118
+ credit_notes_for_customer(customer_id:string, input?:CreditNotesForCustomerInputParam):ChargebeeRequest<CreditNotesForCustomerResponse>;
119
+
407
120
  delete(credit_note_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
408
121
 
409
- /**
410
- * @description Removes a [linked_tax_withheld_refunds](/docs/api/credit_notes#credit_note_linked_tax_withheld_refunds) record from the &#x60;credit_note&#x60;.
411
-
412
- */
413
-
414
- remove_tax_withheld_refund(credit_note_id:string, input?:RemoveTaxWithheldRefundInputParam):ChargebeeRequest<RemoveTaxWithheldRefundResponse>;
122
+ remove_tax_withheld_refund(credit_note_id:string, input:RemoveTaxWithheldRefundInputParam):ChargebeeRequest<RemoveTaxWithheldRefundResponse>;
415
123
 
416
- /**
417
- * @description Resend failed einvoice in credit notes.
418
-
419
- */
420
-
421
124
  resend_einvoice(credit_note_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
422
125
 
423
- /**
424
- * @description This endpoint is used to send an e-invoice for invoice.
425
-
426
- To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
427
-
428
- This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
429
-
430
- * If e-invoicing is not enabled at the site and customer level.
431
-
432
- * If there is an e-invoice generated already for the invoice.
433
-
434
- * If the &quot;**Use automatic e-invoicing**&quot; option is selected.
435
-
436
- * If there are no generated e-invoices with the &#x60;failed&#x60; or &#x60;skipped&#x60; status.
437
-
438
- * If the invoice status is &#x60;voided&#x60; or &#x60;pending&#x60;.
439
-
440
-
441
- */
442
-
443
126
  send_einvoice(credit_note_id:string):ChargebeeRequest<SendEinvoiceResponse>;
444
127
 
445
- /**
446
- * @description Use this api to import credit notes into your Chargebee site. Billing address, Shipping Address, Vat number will be copied from the reference invoice.
447
-
448
- */
449
-
450
128
  import_credit_note(input:ImportCreditNoteInputParam):ChargebeeRequest<ImportCreditNoteResponse>;
451
129
  }
452
130
  export interface CreateResponse {
453
131
  credit_note:CreditNote;
454
132
 
455
- invoice:Invoice;
133
+ invoice?:Invoice;
456
134
  }
457
135
  export interface CreateInputParam {
458
136
 
459
- /**
460
- * @description The identifier of the invoice against which this Credit Note is issued.
461
-
462
- */
137
+ line_items?:{amount?:number,date_from?:number,date_to?:number,description?:string,entity_id?:string,entity_type?:'adhoc' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price',quantity?:number,quantity_in_decimal?:string,reference_line_item_id?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
463
138
 
464
- reference_invoice_id:string;
139
+ reference_invoice_id?:string;
465
140
 
466
- /**
467
- * @description Credit Note amount in cents. You can either pass the total parameter or the line_items parameter. Passing both will result in an error.
468
-
469
- */
141
+ customer_id?:string;
470
142
 
471
143
  total?:number;
472
144
 
473
- /**
474
- * @description The credit note type. \* refundable - Refundable Credit Note \* adjustment - Adjustment Credit Note
475
-
476
- */
477
-
478
- type:'adjustment' | 'refundable';
479
-
480
- /**
481
- * @description The reason for issuing this Credit Note. The following reason codes are supported now\[Deprecated; use the [create_reason_code](/docs/api/credit_notes#credit_note_create_reason_code) parameter instead\]. \* chargeback - Can be set when you are recording your customer Chargebacks \* 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 \* waiver - Waiver \* order_cancellation - Order Cancellation \* order_change - Order Change \* product_unsatisfactory - Product Unsatisfactory \* subscription_pause - This reason will be automatically set to credit notes created during pause/resume subscription operation. \* service_unsatisfactory - Service Unsatisfactory \* other - Can be set when none of the above reason codes are applicable \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* 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. \* fraudulent - FRAUDULENT
482
-
483
- */
484
-
485
- reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver';
145
+ type:'adjustment' | 'refundable' | 'store';
486
146
 
487
- /**
488
- * @description Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Credit Notes \&gt; Create Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
489
-
490
- */
147
+ reason_code?:'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other';
491
148
 
492
149
  create_reason_code?:string;
493
150
 
494
- /**
495
- * @description The date the Credit Note is issued.
496
-
497
- */
498
-
499
151
  date?:number;
500
152
 
501
- /**
502
- * @description A note to be added for this operation, to the credit note. This note is displayed on customer-facing documents such as the [Credit Note PDF](./credit_notes#retrieve_credit_note_as_pdf).
503
-
504
- */
505
-
506
153
  customer_notes?:string;
507
154
 
508
- /**
509
- * @description An internal [comment](./comments) to be added for this operation, to the credit note. 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 [Credit Note PDF](./credit_notes#retrieve_credit_note_as_pdf).
510
-
511
- */
155
+ currency_code?:string;
512
156
 
513
157
  comment?:string;
514
-
515
- /**
516
- * @description Parameters for line_items
517
-
518
- */
519
-
520
- line_items:{amount?:number,date_from?:number,date_to?:number,description?:string,quantity?:number,quantity_in_decimal?:string,reference_line_item_id:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
521
158
  }
522
159
  export interface RetrieveResponse {
523
160
  credit_note:CreditNote;
524
161
  }
525
-
162
+ export interface RetrieveInputParam {
163
+
164
+ line_items_limit?:number;
165
+
166
+ line_items_offset?:string;
167
+ }
526
168
  export interface PdfResponse {
527
169
  download:Download;
528
170
  }
529
171
  export interface PdfInputParam {
530
172
 
531
- /**
532
- * @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
533
-
534
- */
535
-
536
173
  disposition_type?:DispositionType;
537
174
  }
538
175
  export interface DownloadEinvoiceResponse {
@@ -546,25 +183,10 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
546
183
  }
547
184
  export interface RefundInputParam {
548
185
 
549
- /**
550
- * @description The amount to be refunded. If not specified, the entire [refundable amount](/docs/api/credit_notes#credit_note_amount_available) for this &#x60;credit_note&#x60; is refunded. **Note:** Any [linked_tax_withheld_refunds](/docs/api/credit_notes#credit_note_linked_tax_withheld_refunds) associated with the &#x60;credit_note&#x60; cannot be refunded via this operation.
551
-
552
- */
553
-
554
186
  refund_amount?:number;
555
187
 
556
- /**
557
- * @description A note to be added for this operation, to the credit note. This note is displayed on customer-facing documents such as the [Credit Note PDF](./credit_notes#retrieve_credit_note_as_pdf).
558
-
559
- */
560
-
561
188
  customer_notes?:string;
562
189
 
563
- /**
564
- * @description Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Credit Notes \&gt; Refund Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
565
-
566
- */
567
-
568
190
  refund_reason_code?:string;
569
191
  }
570
192
  export interface RecordRefundResponse {
@@ -574,220 +196,204 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
574
196
  }
575
197
  export interface RecordRefundInputParam {
576
198
 
577
- /**
578
- * @description Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Credit Notes \&gt; Refund Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
579
-
580
- */
199
+ transaction:{amount?:number,custom_payment_method_id?:string,date:number,payment_method:PaymentMethod,reference_number?:string};
581
200
 
582
201
  refund_reason_code?:string;
583
202
 
584
- /**
585
- * @description Remarks, if any, on the refund.
586
-
587
- */
588
-
589
203
  comment?:string;
590
-
591
- /**
592
- * @description Parameters for transaction
593
-
594
- */
595
-
596
- transaction:{amount?:number,custom_payment_method_id?:string,date:number,payment_method:PaymentMethod,reference_number?:string};
597
204
  }
598
205
  export interface VoidCreditNoteResponse {
599
206
  credit_note:CreditNote;
600
207
  }
601
208
  export interface VoidCreditNoteInputParam {
602
209
 
603
- /**
604
- * @description Reason for voiding credit note. This comment will be added to the credit note.
605
-
606
- */
607
-
608
210
  comment?:string;
609
211
  }
610
212
  export interface ListResponse {
611
- /**
612
- * @description Lists all the Credit Notes.
613
-
614
- */
615
-
616
213
  list:{credit_note:CreditNote}[];
617
214
 
618
- /**
619
- * @description Lists all the Credit Notes.
620
-
621
- */
622
-
623
215
  next_offset?:string;
624
216
  }
625
217
  export interface ListInputParam {
626
218
  [key : string]: any;
627
219
  /**
628
- * @description Lists all the Credit Notes.
220
+ * @description The number of resources to be returned.
629
221
 
630
222
  */
631
223
 
632
224
  limit?:number;
633
225
 
634
226
  /**
635
- * @description Lists all the Credit Notes.
227
+ * @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.
636
228
 
637
229
  */
638
230
 
639
231
  offset?:string;
640
232
 
641
233
  /**
642
- * @description Lists all the Credit Notes.
234
+ * @description Parameters for einvoice
235
+
236
+ */
237
+
238
+ einvoice?:{status?:{in?:string,is?:'scheduled' | 'skipped' | 'in_progress' | 'success' | 'failed' | 'registered',is_not?:'scheduled' | 'skipped' | 'in_progress' | 'success' | 'failed' | 'registered',not_in?:string}};
239
+
240
+ show_exempted_tax_lines?:boolean;
241
+
242
+ /**
243
+ * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
643
244
 
644
245
  */
645
246
 
646
247
  include_deleted?:boolean;
647
248
 
648
249
  /**
649
- * @description Lists all the Credit Notes.
250
+ * @description Credit-note id.
650
251
 
651
252
  */
652
253
 
653
254
  id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
654
255
 
655
256
  /**
656
- * @description Lists all the Credit Notes.
257
+ * @description The identifier of the customer this Credit Note belongs to.
657
258
 
658
259
  */
659
260
 
660
261
  customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
661
262
 
662
263
  /**
663
- * @description Lists all the Credit Notes.
264
+ * @description To filter based on subscription_id.
265
+ NOTE: Not to be used if *consolidated invoicing* feature is enabled.
664
266
 
665
267
  */
666
268
 
667
269
  subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
668
270
 
669
271
  /**
670
- * @description Lists all the Credit Notes.
272
+ * @description The identifier of the invoice against which this Credit Note is issued
671
273
 
672
274
  */
673
275
 
674
- reference_invoice_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
276
+ reference_invoice_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
675
277
 
676
278
  /**
677
- * @description Lists all the Credit Notes.
279
+ * @description The credit note type.
678
280
 
679
281
  */
680
282
 
681
- type?:{in?:string,is?:'adjustment' | 'refundable',is_not?:'adjustment' | 'refundable',not_in?:string};
283
+ type?:{in?:string,is?:'adjustment' | 'refundable' | 'store',is_not?:'adjustment' | 'refundable' | 'store',not_in?:string};
682
284
 
683
285
  /**
684
- * @description Lists all the Credit Notes.
286
+ * @description The reason for issuing this Credit Note. The following reason codes are supported now\[Deprecated; use the [create_reason_code](/docs/api/credit_notes#credit_note_create_reason_code) parameter instead\]
685
287
 
686
288
  */
687
289
 
688
- reason_code?:{in?:string,is?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent',is_not?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent',not_in?:string};
290
+ reason_code?:{in?:string,is?:'write_off' | 'subscription_change' | 'subscription_cancellation' | 'subscription_pause' | 'chargeback' | 'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other' | 'fraudulent',is_not?:'write_off' | 'subscription_change' | 'subscription_cancellation' | 'subscription_pause' | 'chargeback' | 'product_unsatisfactory' | 'service_unsatisfactory' | 'order_change' | 'order_cancellation' | 'waiver' | 'other' | 'fraudulent',not_in?:string};
689
291
 
690
292
  /**
691
- * @description Lists all the Credit Notes.
293
+ * @description Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Credit Notes \&gt; Create Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive
692
294
 
693
295
  */
694
296
 
695
297
  create_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
696
298
 
697
299
  /**
698
- * @description Lists all the Credit Notes.
300
+ * @description The credit note status.
699
301
 
700
302
  */
701
303
 
702
- status?:{in?:string,is?:'refund_due' | 'adjusted' | 'refunded' | 'voided',is_not?:'refund_due' | 'adjusted' | 'refunded' | 'voided',not_in?:string};
304
+ status?:{in?:string,is?:'adjusted' | 'refunded' | 'refund_due' | 'voided',is_not?:'adjusted' | 'refunded' | 'refund_due' | 'voided',not_in?:string};
703
305
 
704
306
  /**
705
- * @description Lists all the Credit Notes.
307
+ * @description The date the Credit Note is issued.
706
308
 
707
309
  */
708
310
 
709
311
  date?:{after?:string,before?:string,between?:string,on?:string};
710
312
 
711
313
  /**
712
- * @description Lists all the Credit Notes.
314
+ * @description Credit Note amount in cents.
713
315
 
714
316
  */
715
317
 
716
318
  total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
717
319
 
718
320
  /**
719
- * @description Lists all the Credit Notes.
321
+ * @description The price type of the Credit Note.
720
322
 
721
323
  */
722
324
 
723
325
  price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
724
326
 
725
327
  /**
726
- * @description Lists all the Credit Notes.
328
+ * @description The amount allocated to the invoices.
727
329
 
728
330
  */
729
331
 
730
332
  amount_allocated?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
731
333
 
732
334
  /**
733
- * @description Lists all the Credit Notes.
335
+ * @description The refunds issued from this Credit Note.
734
336
 
735
337
  */
736
338
 
737
339
  amount_refunded?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
738
340
 
739
341
  /**
740
- * @description Lists all the Credit Notes.
342
+ * @description The yet to be used credits of this Credit Note.
741
343
 
742
344
  */
743
345
 
744
346
  amount_available?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
745
347
 
746
348
  /**
747
- * @description Lists all the Credit Notes.
349
+ * @description Timestamp indicating the date and time this Credit Note gets voided.
748
350
 
749
351
  */
750
352
 
751
353
  voided_at?:{after?:string,before?:string,between?:string,on?:string};
752
354
 
753
355
  /**
754
- * @description Lists all the Credit Notes.
356
+ * @description To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
755
357
 
756
358
  */
757
359
 
758
360
  updated_at?:{after?:string,before?:string,between?:string,on?:string};
759
361
 
362
+ sort_by?:{asc?:'date',desc?:'date'};
363
+
760
364
  /**
761
- * @description Lists all the Credit Notes.
365
+ * @description The subscription channel this object originated from and is maintained in.
762
366
 
763
367
  */
764
368
 
765
- sort_by?:{asc?:'date',desc?:'date'};
369
+ channel?:{in?:string,is?:'web' | 'app_store' | 'play_store',is_not?:'web' | 'app_store' | 'play_store',not_in?:string};
370
+ }
371
+ export interface CreditNotesForCustomerResponse {
372
+ list:{credit_note:CreditNote}[];
766
373
 
374
+ next_offset?:string;
375
+ }
376
+ export interface CreditNotesForCustomerInputParam {
377
+ [key : string]: any;
767
378
  /**
768
- * @description Lists all the Credit Notes.
379
+ * @description The number of resources to be returned.
769
380
 
770
381
  */
771
382
 
772
- channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
383
+ limit?:number;
773
384
 
774
385
  /**
775
- * @description Lists all the Credit Notes.
386
+ * @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.
776
387
 
777
388
  */
778
389
 
779
- einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
390
+ offset?:string;
780
391
  }
781
392
  export interface DeleteResponse {
782
393
  credit_note:CreditNote;
783
394
  }
784
395
  export interface DeleteInputParam {
785
396
 
786
- /**
787
- * @description Reason for deleting this credit note. This comment will be added to the associated invoice entity.
788
-
789
- */
790
-
791
397
  comment?:string;
792
398
  }
793
399
  export interface RemoveTaxWithheldRefundResponse {
@@ -795,11 +401,6 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
795
401
  }
796
402
  export interface RemoveTaxWithheldRefundInputParam {
797
403
 
798
- /**
799
- * @description Parameters for tax_withheld
800
-
801
- */
802
-
803
404
  tax_withheld:{id:string};
804
405
  }
805
406
  export interface ResendEinvoiceResponse {
@@ -815,973 +416,275 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
815
416
  }
816
417
  export interface ImportCreditNoteInputParam {
817
418
 
818
- /**
819
- * @description Credit Note Number.
820
-
821
- */
419
+ line_items:{amount?:number,amount_in_decimal?:string,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,reference_line_item_id?: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}[];
822
420
 
823
- id:string;
421
+ 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}[];
824
422
 
825
- /**
826
- * @description This identifies the customer for whom the credit note needs to be created.
827
-
828
- */
423
+ discounts:{amount:number,description?:string,entity_id?:string,entity_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'document_level_discount'}[];
829
424
 
830
- customer_id?:string;
425
+ 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}[];
831
426
 
832
- /**
833
- * @description The identifier of the subscription for which this credit note needs to be created.
834
-
835
- */
427
+ allocations:{allocated_amount:number,allocated_at:number,invoice_id:string}[];
836
428
 
837
- subscription_id?:string;
429
+ linked_refunds:{amount:number,date:number,payment_method:PaymentMethod,reference_number?:string}[];
838
430
 
839
- /**
840
- * @description The identifier of the invoice against which this Credit Note is issued.
841
-
842
- */
431
+ id:string;
843
432
 
844
- reference_invoice_id:string;
433
+ customer_id?:string;
845
434
 
846
- /**
847
- * @description The credit note type. \* refundable - Refundable Credit Note \* adjustment - Adjustment Credit Note
848
-
849
- */
435
+ subscription_id?:string;
850
436
 
851
- type:'adjustment' | 'refundable';
437
+ reference_invoice_id:string;
852
438
 
853
- /**
854
- * @description The currency code (ISO 4217 format) for the credit note.
855
-
856
- */
439
+ type:'adjustment' | 'refundable' | 'store';
857
440
 
858
441
  currency_code?:string;
859
442
 
860
- /**
861
- * @description Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Credit Notes \&gt; Create Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
862
-
863
- */
864
-
865
443
  create_reason_code:string;
866
444
 
867
- /**
868
- * @description The date the Credit Note is issued.
869
-
870
- */
871
-
872
445
  date:number;
873
446
 
874
- /**
875
- * @description The credit note status. \* 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). \* voided - When the Credit Note has been cancelled. \* adjusted - When the Credit Note has been adjusted against an invoice.
876
-
877
- */
878
-
879
- status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
880
-
881
- /**
882
- * @description Credit Note amount in cents.
883
-
884
- */
447
+ status?:'adjusted' | 'refunded' | 'refund_due' | 'voided';
885
448
 
886
449
  total?:number;
887
450
 
888
- /**
889
- * @description The time this Credit Note gets fully used. Please note that this field is not present when partial refunds are issued.
890
-
891
- */
892
-
893
- refunded_at?:number;
894
-
895
- /**
896
- * @description Timestamp indicating the date and time this Credit Note gets voided.
897
-
898
- */
899
-
900
- voided_at?:number;
901
-
902
- /**
903
- * @description The Credit Note sub-total.
904
-
905
- */
906
-
907
- sub_total?:number;
908
-
909
- /**
910
- * @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 &#x60;round_off_amount&#x60;. If there is no &#x60;round-off amount&#x60;, it will display &#x60;0&#x60;.
911
-
912
- */
913
-
914
- round_off_amount?:number;
915
-
916
- /**
917
- * @description Indicates the fractional correction amount.
918
-
919
- */
920
-
921
- fractional_correction?:number;
922
-
923
- /**
924
- * @description An overridden value for the first two characters of the [full VAT
925
- 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** ).
926
-
927
- When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
928
- 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
929
- 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.
930
-
931
- */
932
-
933
- vat_number_prefix?:string;
934
-
935
- /**
936
- * @description Parameters for line_items
937
-
938
- */
939
-
940
- 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,reference_line_item_id?: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}[];
941
-
942
- /**
943
- * @description Parameters for line_item_tiers
944
-
945
- */
946
-
947
- 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}[];
948
-
949
- /**
950
- * @description Parameters for discounts
951
-
952
- */
953
-
954
- 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}[];
955
-
956
- /**
957
- * @description Parameters for taxes
958
-
959
- */
960
-
961
- 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}[];
451
+ refunded_at?:number;
962
452
 
963
- /**
964
- * @description Parameters for allocations
965
-
966
- */
453
+ voided_at?:number;
967
454
 
968
- allocations:{allocated_amount:number,allocated_at:number,invoice_id:string}[];
455
+ sub_total?:number;
969
456
 
970
- /**
971
- * @description Parameters for linked_refunds
972
-
973
- */
457
+ round_off_amount?:number;
974
458
 
975
- linked_refunds:{amount:number,date:number,payment_method:PaymentMethod,reference_number?:string}[];
459
+ fractional_correction?:number;
460
+
461
+ vat_number_prefix?:string;
976
462
  }
977
463
  export interface Einvoice {
978
- /**
979
- * @description The unique &#x60;id&#x60; for the e-invoice. This is auto-generated by Chargebee.
980
-
981
- */
982
-
983
464
  id:string;
984
465
 
985
- /**
986
- * @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.
987
-
988
- */
989
-
990
466
  reference_number?:string;
991
467
 
992
- /**
993
- * @description The status of processing the e-invoice. To obtain detailed information about the current &#x60;status&#x60;, see &#x60;message&#x60;. \* scheduled - Sending the e-invoice to the customer has been scheduled. \* skipped - The e-invoice was not sent. This could be due to missing information or because the &#x60;entity_identifier&#x60; is not registered on the e-invoicing network. \* success - The e-invoice has been successfully delivered to the customer. \* failed - The e-invoice was sent and there was an error due to which it was not delivered. \* in_progress - The e-invoice has been sent and Chargebee is waiting for confirmation from the receiving entity. \* registered - The e-invoice was sent and there was an error due to which it was not delivered but got cleared in the IRP.
994
-
995
- */
996
-
997
- status:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
998
-
999
- /**
1000
- * @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:
1001
-
1002
- * Invoice successfully sent to customer via the e-invoicing network 9090:123456
1003
- * Invoice successfully sent to customer via email id abc@acme.com
1004
-
1005
- */
468
+ status:'scheduled' | 'skipped' | 'in_progress' | 'success' | 'failed' | 'registered';
1006
469
 
1007
470
  message?:string;
1008
471
  }
1009
472
  export interface LineItem {
1010
- /**
1011
- * @description Uniquely identifies a line_item
1012
-
1013
- */
1014
-
1015
473
  id?:string;
1016
474
 
1017
- /**
1018
- * @description A unique identifier for the subscription this line item belongs to.
1019
-
1020
- */
1021
-
1022
475
  subscription_id?:string;
1023
476
 
1024
- /**
1025
- * @description Start date of this line item.
1026
-
1027
- */
1028
-
1029
477
  date_from:number;
1030
478
 
1031
- /**
1032
- * @description End date of this line item.
1033
-
1034
- */
1035
-
1036
479
  date_to:number;
1037
480
 
1038
- /**
1039
- * @description Unit amount of the line item.
1040
-
1041
- */
1042
-
1043
481
  unit_amount:number;
1044
482
 
1045
- /**
1046
- * @description [Quantity of the recurring item](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_line_items_quantity) which is represented by this line item. For &#x60;metered&#x60; line items, this value is updated from [usages](/docs/api/usages) once when the invoice is generated as &#x60;pending&#x60; and finally when the invoice is [closed](/docs/api/invoices#close_a_pending_invoice).
1047
-
1048
- */
1049
-
1050
483
  quantity?:number;
1051
484
 
1052
- /**
1053
- * @description Total amount of this line item. Typically equals to unit amount x quantity
1054
-
1055
- */
1056
-
1057
485
  amount?:number;
1058
486
 
1059
- /**
1060
- * @description The [pricing scheme](https://www.chargebee.com/docs/2.0/plans.html#pricing-models) for this item price. \* 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. \* 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.
1061
-
1062
- */
1063
-
1064
- pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
1065
-
1066
- /**
1067
- * @description Specifies whether this line item is taxed or not
1068
-
1069
- */
487
+ pricing_model?:'flat_fee' | 'per_unit' | 'tiered' | 'volume' | 'stairstep';
1070
488
 
1071
489
  is_taxed:boolean;
1072
490
 
1073
- /**
1074
- * @description The tax amount charged for this item
1075
-
1076
- */
1077
-
1078
491
  tax_amount?:number;
1079
492
 
1080
- /**
1081
- * @description Rate of tax used to calculate tax for this lineitem
1082
-
1083
- */
1084
-
1085
493
  tax_rate?:number;
1086
494
 
1087
- /**
1088
- * @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.
1089
-
1090
- */
1091
-
1092
495
  unit_amount_in_decimal?:string;
1093
496
 
1094
- /**
1095
- * @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.
1096
-
1097
- */
1098
-
1099
497
  quantity_in_decimal?:string;
1100
498
 
1101
- /**
1102
- * @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.
1103
-
1104
- */
1105
-
1106
499
  amount_in_decimal?:string;
1107
500
 
1108
- /**
1109
- * @description Total discounts for this line
1110
-
1111
- */
1112
-
1113
501
  discount_amount?:number;
1114
502
 
1115
- /**
1116
- * @description Line Item-level discounts for this line.
1117
-
1118
- */
1119
-
1120
503
  item_level_discount_amount?:number;
1121
504
 
1122
- /**
1123
- * @description Invoice Reference Line Item ID
1124
-
1125
- */
505
+ usage_percentage?:string;
1126
506
 
1127
507
  reference_line_item_id?:string;
1128
508
 
1129
- /**
1130
- * @description Detailed description about this line item.
1131
-
1132
- */
1133
-
1134
509
  description:string;
1135
510
 
1136
- /**
1137
- * @description Detailed description about this item.
1138
-
1139
- */
1140
-
1141
511
  entity_description?:string;
1142
512
 
1143
- /**
1144
- * @description Specifies the modelled entity this line item is based on. \* 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 \* addon_item_price - Indicates that this line item is based on addon Item Price \* charge_item_price - Indicates that this line item is based on charge 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 \* 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
1145
-
1146
- */
1147
-
1148
- entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
1149
-
1150
- /**
1151
- * @description The reason due to which the line item price/amount is exempted from tax. \* 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 \* tax_not_configured - If tax is not enabled for the site \* 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 \* 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_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
1152
-
1153
- */
1154
-
1155
- 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';
513
+ entity_type:'adhoc' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price' | 'plan_setup' | 'plan' | 'addon';
1156
514
 
1157
- /**
1158
- * @description The identifier of the modelled entity this line item is based on. Will be null for &#x27;adhoc&#x27; entity type
1159
-
1160
- */
515
+ 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';
1161
516
 
1162
517
  entity_id?:string;
1163
518
 
1164
- /**
1165
- * @description A unique identifier for the customer this line item belongs to
1166
-
1167
- */
1168
-
1169
519
  customer_id?:string;
1170
520
  }
1171
521
  export interface Discount {
1172
- /**
1173
- * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver&#x3D;2#currencies).
1174
-
1175
- */
1176
-
1177
522
  amount:number;
1178
523
 
1179
- /**
1180
- * @description Description for this deduction.
1181
-
1182
- */
1183
-
1184
524
  description?:string;
1185
525
 
1186
- /**
1187
- * @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;.
1188
-
1189
- */
1190
-
1191
- line_item_id?:string;
1192
-
1193
- /**
1194
- * @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_coupon - The deduction is due to a coupon applied to line item. The coupon &#x60;id&#x60; is passed as &#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 id is passed as &#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;.
1195
-
1196
- */
1197
-
1198
- entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1199
-
1200
- /**
1201
- * @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
1202
-
1203
- */
526
+ entity_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
1204
527
 
1205
528
  discount_type?:'fixed_amount' | 'percentage';
1206
529
 
1207
- /**
1208
- * @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.
1209
-
1210
- */
1211
-
1212
530
  entity_id?:string;
1213
531
 
1214
- /**
1215
- * @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;.
1216
-
1217
- */
1218
-
1219
532
  coupon_set_code?:string;
1220
533
  }
1221
534
  export interface LineItemDiscount {
1222
- /**
1223
- * @description The unique id of the line item that this deduction is for.
1224
-
1225
- */
1226
-
1227
535
  line_item_id:string;
1228
536
 
1229
- /**
1230
- * @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). \* 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;. \* 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. \* 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;. \* 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;.
1231
-
1232
- */
1233
-
1234
- discount_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
537
+ discount_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
1235
538
 
1236
539
  coupon_id?:string;
1237
540
 
1238
- /**
1239
- * @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.
1240
-
1241
- */
1242
-
1243
541
  entity_id?:string;
1244
542
 
1245
- /**
1246
- * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api#currencies).
1247
-
1248
- */
1249
-
1250
543
  discount_amount:number;
1251
544
  }
1252
545
  export interface LineItemTier {
1253
- /**
1254
- * @description Uniquely identifies a line_item
1255
-
1256
- */
1257
-
1258
546
  line_item_id?:string;
1259
547
 
1260
- /**
1261
- * @description The lower limit of a range of units for the tier
1262
-
1263
- */
1264
-
1265
548
  starting_unit:number;
1266
549
 
1267
- /**
1268
- * @description The upper limit of a range of units for the tier
1269
-
1270
- */
1271
-
1272
550
  ending_unit?:number;
1273
551
 
1274
- /**
1275
- * @description The number of units purchased in a range.
1276
-
1277
- */
1278
-
1279
552
  quantity_used:number;
1280
553
 
1281
- /**
1282
- * @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.
1283
-
1284
- */
1285
-
1286
554
  unit_amount:number;
1287
555
 
1288
- /**
1289
- * @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.
1290
-
1291
- */
1292
-
1293
556
  starting_unit_in_decimal?:string;
1294
557
 
1295
- /**
1296
- * @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.
1297
-
1298
- */
1299
-
1300
558
  ending_unit_in_decimal?:string;
1301
559
 
1302
- /**
1303
- * @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.
1304
-
1305
- */
1306
-
1307
560
  quantity_used_in_decimal?:string;
1308
561
 
1309
- /**
1310
- * @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.
1311
-
1312
- */
1313
-
1314
562
  unit_amount_in_decimal?:string;
1315
563
  }
1316
564
  export interface Tax {
1317
- /**
1318
- * @description The name of the tax applied. E.g. GST.
1319
-
1320
- */
1321
-
1322
565
  name:string;
1323
566
 
1324
- /**
1325
- * @description The tax amount.
1326
-
1327
- */
1328
-
1329
567
  amount:number;
1330
568
 
1331
- /**
1332
- * @description Description of the tax item.
1333
-
1334
- */
1335
-
1336
569
  description?:string;
1337
570
  }
1338
571
  export interface LineItemTax {
1339
- /**
1340
- * @description The unique reference id of the line item for which the tax is applicable
1341
-
1342
- */
1343
-
1344
572
  line_item_id?:string;
1345
573
 
1346
- /**
1347
- * @description The name of the tax applied
1348
-
1349
- */
1350
-
1351
574
  tax_name:string;
1352
575
 
1353
- /**
1354
- * @description The rate of tax used to calculate tax amount
1355
-
1356
- */
1357
-
1358
576
  tax_rate:number;
1359
577
 
1360
- /**
1361
- * @description Indicates the service period end of the tax rate for the line item.
1362
-
1363
- */
1364
-
1365
578
  date_to?:number;
1366
579
 
1367
- /**
1368
- * @description Indicates the service period start of the tax rate for the line item.
1369
-
1370
- */
1371
-
1372
580
  date_from?:number;
1373
581
 
1374
- /**
1375
- * @description Indicates the prorated line item amount in cents.
1376
-
1377
- */
1378
-
1379
582
  prorated_taxable_amount?:number;
1380
583
 
1381
- /**
1382
- * @description Indicates if tax is applied only on a portion of the line item amount.
1383
-
1384
- */
1385
-
1386
584
  is_partial_tax_applied?:boolean;
1387
585
 
1388
- /**
1389
- * @description Indicates the non-compliance tax that should not be reported to the jurisdiction.
1390
-
1391
- */
1392
-
1393
586
  is_non_compliance_tax?:boolean;
1394
587
 
1395
- /**
1396
- * @description Indicates the actual portion of the line item amount that is taxable.
1397
-
1398
- */
1399
-
1400
588
  taxable_amount:number;
1401
589
 
1402
- /**
1403
- * @description The tax amount
1404
-
1405
- */
1406
-
1407
590
  tax_amount:number;
1408
591
 
1409
- /**
1410
- * @description The type of tax jurisdiction \* federal - The tax jurisdiction is a federal \* state - The tax jurisdiction is a state \* county - The tax jurisdiction is a county \* country - The tax jurisdiction is a country \* city - The tax jurisdiction is a city \* special - Special tax jurisdiction. \* unincorporated - Combined tax of state and county. \* other - Jurisdictions other than the ones listed above.
1411
-
1412
- */
1413
-
1414
- tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
1415
-
1416
- /**
1417
- * @description The name of the tax jurisdiction
1418
-
1419
- */
592
+ tax_juris_type?:'country' | 'federal' | 'state' | 'county' | 'city' | 'special' | 'unincorporated' | 'other';
1420
593
 
1421
594
  tax_juris_name?:string;
1422
595
 
1423
- /**
1424
- * @description The tax jurisdiction code
1425
-
1426
- */
1427
-
1428
596
  tax_juris_code?:string;
1429
597
 
1430
- /**
1431
- * @description Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
1432
-
1433
- */
1434
-
1435
598
  tax_amount_in_local_currency?:number;
1436
599
 
1437
- /**
1438
- * @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.
1439
-
1440
- */
1441
-
1442
600
  local_currency_code?:string;
1443
601
  }
1444
- export interface CreditNoteTransaction {
1445
- /**
1446
- * @description Uniquely identifies the transaction.
1447
-
1448
- */
1449
-
602
+ export interface LinkedRefund {
1450
603
  txn_id:string;
1451
604
 
1452
- /**
1453
- * @description The transaction amount applied to this invoice
1454
-
1455
- */
1456
-
1457
605
  applied_amount:number;
1458
606
 
1459
- /**
1460
- * @description Time when the transaction amount applied to this invoice.
1461
-
1462
- */
1463
-
1464
607
  applied_at:number;
1465
608
 
1466
- /**
1467
- * @description The status of this transaction. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually \* voided - The transaction got voided or authorization expired at gateway. \* timeout - Transaction failed because of Gateway not accepting the connection. \* success - The transaction is successful. \* 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.
1468
-
1469
- */
1470
-
1471
- txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
1472
-
1473
- /**
1474
- * @description Indicates when this transaction occurred.
1475
-
1476
- */
609
+ txn_status?:'in_progress' | 'success' | 'voided' | 'failure' | 'timeout' | 'needs_attention' | 'late_failure';
1477
610
 
1478
611
  txn_date?:number;
1479
612
 
1480
- /**
1481
- * @description Total amount of the transaction
1482
-
1483
- */
1484
-
1485
613
  txn_amount?:number;
1486
614
 
1487
- /**
1488
- * @description Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in **Settings \&gt; Configure Chargebee \&gt; Reason Codes \&gt; Credit Notes \&gt; Refund Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive
1489
-
1490
- */
1491
-
1492
615
  refund_reason_code?:string;
1493
616
  }
1494
- export interface LinkedTaxWithheldRefund {
1495
- /**
1496
- * @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;.
1497
-
1498
- */
1499
-
1500
- id:string;
1501
-
1502
- /**
1503
- * @description The amount withheld by the customer as tax from the invoice. The unit depends on the [type of currency](/docs/api#md_disabled).
1504
-
1505
- */
1506
-
1507
- amount?:number;
1508
-
1509
- /**
1510
- * @description The description for this tax withheld.
1511
-
1512
- */
1513
-
1514
- description?:string;
1515
-
1516
- /**
1517
- * @description Date or time associated with the tax withheld.
1518
-
1519
- */
1520
-
1521
- date?:number;
1522
-
1523
- /**
1524
- * @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.
1525
-
1526
- */
1527
-
1528
- reference_number?:string;
1529
- }
1530
- export interface AppliedCredit {
1531
- /**
1532
- * @description Unique identifier of the invoice.
1533
-
1534
- */
1535
-
617
+ export interface Allocation {
1536
618
  invoice_id:string;
1537
619
 
1538
- /**
1539
- * @description Amount of this refund transaction.
1540
-
1541
- */
1542
-
1543
620
  allocated_amount:number;
1544
621
 
1545
- /**
1546
- * @description Indicates when this refund occured.
1547
-
1548
- */
1549
-
1550
622
  allocated_at:number;
1551
623
 
1552
- /**
1553
- * @description Closing date of the invoice. Typically this is the date on which invoice is generated
1554
-
1555
- */
1556
-
1557
624
  invoice_date?:number;
1558
625
 
1559
- /**
1560
- * @description Current status of the invoice. \* not_paid - Indicates the payment is not made and all attempts to collect is failed. \* paid - Indicates a paid invoice. \* voided - Indicates a voided 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 -
1561
- 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;.
1562
- 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.
1563
-
1564
- */
626
+ invoice_status:'paid' | 'posted' | 'payment_due' | 'not_paid' | 'voided' | 'pending';
1565
627
 
1566
- invoice_status:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
628
+ tax_application?:'pre_tax' | 'post_tax';
1567
629
  }
1568
630
  export interface ShippingAddress {
1569
- /**
1570
- * @description The first name of the contact.
1571
-
1572
- */
1573
-
1574
631
  first_name?:string;
1575
632
 
1576
- /**
1577
- * @description The last name of the contact.
1578
-
1579
- */
1580
-
1581
633
  last_name?:string;
1582
634
 
1583
- /**
1584
- * @description The email address.
1585
-
1586
- */
1587
-
1588
635
  email?:string;
1589
636
 
1590
- /**
1591
- * @description The company name.
1592
-
1593
- */
1594
-
1595
637
  company?:string;
1596
638
 
1597
- /**
1598
- * @description The phone number.
1599
-
1600
- */
1601
-
1602
639
  phone?:string;
1603
640
 
1604
- /**
1605
- * @description Address line 1
1606
-
1607
- */
1608
-
1609
641
  line1?:string;
1610
642
 
1611
- /**
1612
- * @description Address line 2
1613
-
1614
- */
1615
-
1616
643
  line2?:string;
1617
644
 
1618
- /**
1619
- * @description Address line 3
1620
-
1621
- */
1622
-
1623
645
  line3?:string;
1624
646
 
1625
- /**
1626
- * @description The name of the city.
1627
-
1628
- */
1629
-
1630
647
  city?:string;
1631
648
 
1632
- /**
1633
- * @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;).
1634
-
1635
- */
1636
-
1637
649
  state_code?:string;
1638
650
 
1639
- /**
1640
- * @description The state/province name.
1641
-
1642
- */
1643
-
1644
651
  state?:string;
1645
652
 
1646
- /**
1647
- * @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).
1648
-
1649
- **Note** : If you enter an invalid country code, the system will return an error.
1650
-
1651
- **Brexit**
1652
-
1653
-
1654
- 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.
1655
-
1656
- */
1657
-
1658
653
  country?:string;
1659
654
 
1660
- /**
1661
- * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address).
1662
-
1663
- */
1664
-
1665
655
  zip?:string;
1666
656
 
1667
- /**
1668
- * @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.
1669
-
1670
- */
1671
-
1672
657
  validation_status?:ValidationStatus;
1673
658
 
1674
- /**
1675
- * @description The index number of the subscription/one-time group to which the item price is added. Provide a unique number between &#x60;0&#x60; and &#x60;9&#x60; (inclusive) for each group that is to be created. To increase this limit, contact Chargebee Support
1676
-
1677
- */
1678
-
1679
659
  index:number;
1680
660
  }
1681
661
  export interface BillingAddress {
1682
- /**
1683
- * @description The first name of the billing contact.
1684
-
1685
- */
1686
-
1687
662
  first_name?:string;
1688
663
 
1689
- /**
1690
- * @description The last name of the billing contact.
1691
-
1692
- */
1693
-
1694
664
  last_name?:string;
1695
665
 
1696
- /**
1697
- * @description The email address.
1698
-
1699
- */
1700
-
1701
666
  email?:string;
1702
667
 
1703
- /**
1704
- * @description The company name.
1705
-
1706
- */
1707
-
1708
668
  company?:string;
1709
669
 
1710
- /**
1711
- * @description The phone number.
1712
-
1713
- */
1714
-
1715
670
  phone?:string;
1716
671
 
1717
- /**
1718
- * @description Address line 1
1719
-
1720
- */
1721
-
1722
672
  line1?:string;
1723
673
 
1724
- /**
1725
- * @description Address line 2
1726
-
1727
- */
1728
-
1729
674
  line2?:string;
1730
675
 
1731
- /**
1732
- * @description Address line 3
1733
-
1734
- */
1735
-
1736
676
  line3?:string;
1737
677
 
1738
- /**
1739
- * @description The name of the city.
1740
-
1741
- */
1742
-
1743
678
  city?:string;
1744
679
 
1745
- /**
1746
- * @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;).
1747
-
1748
- */
1749
-
1750
680
  state_code?:string;
1751
681
 
1752
- /**
1753
- * @description State or Province
1754
-
1755
- */
1756
-
1757
682
  state?:string;
1758
683
 
1759
- /**
1760
- * @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).
1761
-
1762
- **Note** : If you enter an invalid country code, the system will return an error.
1763
-
1764
- **Brexit**
1765
-
1766
-
1767
- 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.
1768
-
1769
- */
1770
-
1771
684
  country?:string;
1772
685
 
1773
- /**
1774
- * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address).
1775
-
1776
- */
1777
-
1778
686
  zip?:string;
1779
687
 
1780
- /**
1781
- * @description The address verification status. \* valid - Address was validated successfully. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* invalid - Address is invalid. \* not_validated - Address is not yet validated.
1782
-
1783
- */
1784
-
1785
688
  validation_status?:ValidationStatus;
1786
689
  }
1787
690
  export interface SiteDetailsAtCreation {