chargebee 2.26.0 → 2.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/chargebee.js +1 -1
  3. package/package.json +1 -1
  4. package/types/core.d.ts +1 -0
  5. package/types/resources/Address.d.ts +245 -5
  6. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  7. package/types/resources/AttachedItem.d.ts +305 -13
  8. package/types/resources/Card.d.ts +485 -13
  9. package/types/resources/Comment.d.ts +177 -11
  10. package/types/resources/Contact.d.ts +54 -0
  11. package/types/resources/ContractTerm.d.ts +83 -0
  12. package/types/resources/Coupon.d.ts +665 -20
  13. package/types/resources/CouponCode.d.ts +56 -5
  14. package/types/resources/CouponSet.d.ts +224 -17
  15. package/types/resources/CreditNote.d.ts +1202 -44
  16. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  17. package/types/resources/Customer.d.ts +2132 -73
  18. package/types/resources/DifferentialPrice.d.ts +266 -15
  19. package/types/resources/Discount.d.ts +107 -0
  20. package/types/resources/Download.d.ts +18 -0
  21. package/types/resources/EntitlementOverride.d.ts +101 -7
  22. package/types/resources/Estimate.d.ts +1181 -27
  23. package/types/resources/Event.d.ts +145 -8
  24. package/types/resources/Export.d.ts +703 -32
  25. package/types/resources/Feature.d.ts +356 -22
  26. package/types/resources/Gift.d.ts +351 -24
  27. package/types/resources/Hierarchy.d.ts +30 -0
  28. package/types/resources/HostedPage.d.ts +1212 -37
  29. package/types/resources/ImpactedItem.d.ts +41 -1
  30. package/types/resources/ImpactedSubscription.d.ts +36 -1
  31. package/types/resources/InAppSubscription.d.ts +636 -9
  32. package/types/resources/Invoice.d.ts +2293 -93
  33. package/types/resources/InvoiceEstimate.d.ts +75 -6
  34. package/types/resources/Item.d.ts +542 -16
  35. package/types/resources/ItemEntitlement.d.ts +172 -13
  36. package/types/resources/ItemFamily.d.ts +173 -15
  37. package/types/resources/ItemPrice.d.ts +971 -26
  38. package/types/resources/Media.d.ts +24 -0
  39. package/types/resources/NonSubscription.d.ts +51 -3
  40. package/types/resources/Order.d.ts +1224 -32
  41. package/types/resources/PaymentIntent.d.ts +318 -8
  42. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  43. package/types/resources/PaymentSource.d.ts +1259 -55
  44. package/types/resources/PaymentVoucher.d.ts +262 -14
  45. package/types/resources/PortalSession.d.ts +187 -10
  46. package/types/resources/PromotionalCredit.d.ts +351 -16
  47. package/types/resources/Purchase.d.ts +274 -5
  48. package/types/resources/Quote.d.ts +1595 -62
  49. package/types/resources/QuoteLineGroup.d.ts +134 -5
  50. package/types/resources/QuotedCharge.d.ts +63 -5
  51. package/types/resources/QuotedSubscription.d.ts +192 -5
  52. package/types/resources/ResourceMigration.d.ts +73 -3
  53. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  54. package/types/resources/Subscription.d.ts +3462 -137
  55. package/types/resources/SubscriptionEntitlement.d.ts +116 -8
  56. package/types/resources/SubscriptionEstimate.d.ts +36 -2
  57. package/types/resources/TaxWithheld.d.ts +32 -0
  58. package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
  59. package/types/resources/TimeMachine.d.ts +99 -7
  60. package/types/resources/Token.d.ts +179 -7
  61. package/types/resources/Transaction.d.ts +597 -25
  62. package/types/resources/UnbilledCharge.d.ts +355 -14
  63. package/types/resources/Usage.d.ts +259 -13
  64. package/types/resources/VirtualBankAccount.d.ts +255 -17
@@ -1,328 +1,1486 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface CreditNote {
4
+
5
+ /**
6
+ * @description Credit-note id.
7
+
8
+ */
9
+
4
10
  id:string;
11
+
12
+ /**
13
+ * @description The identifier of the customer this Credit Note belongs to.
14
+
15
+ */
16
+
5
17
  customer_id:string;
18
+
19
+ /**
20
+ * @description The identifier of the subscription this Credit Note belongs to.
21
+ **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).
22
+
23
+ */
24
+
6
25
  subscription_id?:string;
26
+
27
+ /**
28
+ * @description The identifier of the invoice against which this Credit Note is issued
29
+
30
+ */
31
+
7
32
  reference_invoice_id:string;
33
+
34
+ /**
35
+ * @description The credit note type. \* refundable - Refundable Credit Note \* adjustment - Adjustment Credit Note
36
+
37
+ */
38
+
8
39
  type:'adjustment' | 'refundable';
40
+
41
+ /**
42
+ * @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
43
+
44
+ */
45
+
9
46
  reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
47
+
48
+ /**
49
+ * @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.
50
+
51
+ */
52
+
10
53
  status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
54
+
55
+ /**
56
+ * @description VAT number of the customer for whom this Credit Note is raised.
57
+
58
+ */
59
+
11
60
  vat_number?:string;
61
+
62
+ /**
63
+ * @description The date the Credit Note is issued.
64
+
65
+ */
66
+
12
67
  date?:number;
68
+
69
+ /**
70
+ * @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.
71
+
72
+ */
73
+
13
74
  price_type:PriceType;
75
+
76
+ /**
77
+ * @description The currency code (ISO 4217 format) for the credit note
78
+
79
+ */
80
+
14
81
  currency_code:string;
82
+
83
+ /**
84
+ * @description Credit Note amount in cents.
85
+
86
+ */
87
+
15
88
  total?:number;
89
+
90
+ /**
91
+ * @description The amount allocated to the invoices.
92
+
93
+ */
94
+
16
95
  amount_allocated?:number;
96
+
97
+ /**
98
+ * @description The refunds issued from this Credit Note.
99
+
100
+ */
101
+
17
102
  amount_refunded?:number;
103
+
104
+ /**
105
+ * @description The yet to be used credits of this Credit Note.
106
+
107
+ */
108
+
18
109
  amount_available?:number;
110
+
111
+ /**
112
+ * @description The time this Credit Note gets fully used. Please note that this field is not present when partial refunds are issued.
113
+
114
+ */
115
+
19
116
  refunded_at?:number;
117
+
118
+ /**
119
+ * @description Timestamp indicating the date and time this Credit Note gets voided.
120
+
121
+ */
122
+
20
123
  voided_at?:number;
124
+
125
+ /**
126
+ * @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.
127
+
128
+ */
129
+
21
130
  generated_at?:number;
131
+
132
+ /**
133
+ * @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.
134
+
135
+ */
136
+
22
137
  resource_version?:number;
138
+
139
+ /**
140
+ * @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.
141
+
142
+ */
143
+
23
144
  updated_at?:number;
145
+
146
+ /**
147
+ * @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.
148
+
149
+ In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.
150
+ \* 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.
151
+
152
+ */
153
+
24
154
  channel?:Channel;
155
+
156
+ /**
157
+ * @description The Credit Note sub-total
158
+
159
+ */
160
+
25
161
  sub_total:number;
162
+
163
+ /**
164
+ * @description Invoice subtotal in the currency of the place of supply.
165
+
166
+ */
167
+
26
168
  sub_total_in_local_currency?:number;
169
+
170
+ /**
171
+ * @description Total invoice amount in the currency of the place of supply.
172
+
173
+ */
174
+
27
175
  total_in_local_currency?:number;
176
+
177
+ /**
178
+ * @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed.
179
+
180
+ */
181
+
28
182
  local_currency_code?:string;
183
+
184
+ /**
185
+ * @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;.
186
+
187
+ */
188
+
29
189
  round_off_amount?:number;
190
+
191
+ /**
192
+ * @description Indicates the fractional correction amount.
193
+
194
+ */
195
+
30
196
  fractional_correction?:number;
197
+
198
+ /**
199
+ * @description Indicates that this resource has been deleted.
200
+
201
+ */
202
+
31
203
  deleted:boolean;
204
+
205
+ /**
206
+ * @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.
207
+
208
+ */
209
+
32
210
  tax_category?:string;
211
+
212
+ /**
213
+ * @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.
214
+
215
+ */
216
+
33
217
  local_currency_exchange_rate?:number;
218
+
219
+ /**
220
+ * @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
221
+
222
+ */
223
+
34
224
  create_reason_code?:string;
225
+
226
+ /**
227
+ * @description An overridden value for the first two characters of the [full VAT
228
+ 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** ).
229
+
230
+ When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
231
+ 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
232
+ 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.
233
+
234
+ */
235
+
35
236
  vat_number_prefix?:string;
237
+
238
+ /**
239
+ * @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).
240
+
241
+ */
242
+
36
243
  business_entity_id:string;
244
+
245
+ /**
246
+ * @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.
247
+
248
+ */
249
+
37
250
  einvoice?:CreditNote.Einvoice;
251
+
252
+ /**
253
+ * @description The line items of this Credit Note
254
+
255
+ */
256
+
38
257
  line_items?:CreditNote.LineItem[];
258
+
259
+ /**
260
+ * @description The list of discounts applied to this Credit Note
261
+
262
+ */
263
+
39
264
  discounts?:CreditNote.Discount[];
265
+
266
+ /**
267
+ * @description The list of discount(s) applied for each line item of this invoice.
268
+
269
+ */
270
+
40
271
  line_item_discounts?:CreditNote.LineItemDiscount[];
272
+
273
+ /**
274
+ * @description The list of tiers applicable for this line item
275
+
276
+ */
277
+
41
278
  line_item_tiers?:CreditNote.LineItemTier[];
279
+
280
+ /**
281
+ * @description The tax-lines of this Credit Note
282
+
283
+ */
284
+
42
285
  taxes?:CreditNote.Tax[];
286
+
287
+ /**
288
+ * @description The list of taxes applied on line items
289
+
290
+ */
291
+
43
292
  line_item_taxes?:CreditNote.LineItemTax[];
293
+
294
+ /**
295
+ * @description Payment Refunds issued from this Credit Note
296
+
297
+ */
298
+
44
299
  linked_refunds?:CreditNote.CreditNoteTransaction[];
300
+
301
+ /**
302
+ * @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;.
303
+
304
+ */
305
+
45
306
  linked_tax_withheld_refunds?:CreditNote.LinkedTaxWithheldRefund[];
307
+
308
+ /**
309
+ * @description Invoice allocations made from this Credit Note.
310
+
311
+ */
312
+
46
313
  allocations?:CreditNote.AppliedCredit[];
314
+
315
+ /**
316
+ * @description Shipping address for the quote.
317
+
318
+ */
319
+
47
320
  shipping_address?:CreditNote.ShippingAddress;
321
+
322
+ /**
323
+ * @description Billing address for the quote.
324
+
325
+ */
326
+
48
327
  billing_address?:CreditNote.BillingAddress;
49
328
  }
50
329
  export namespace CreditNote {
51
- export class CreditNoteResource {
330
+ export class CreditNoteResource {
331
+ /**
332
+ * @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.
333
+
334
+ **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.
335
+
336
+ */
337
+
52
338
  void_credit_note(credit_note_id:string, input?:VoidCreditNoteInputParam):ChargebeeRequest<VoidCreditNoteResponse>;
339
+
340
+ /**
341
+ * @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.
342
+
343
+ */
344
+
53
345
  refund(credit_note_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
346
+
347
+ /**
348
+ * @description Lists all the Credit Notes.
349
+
350
+ */
351
+
54
352
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
353
+
354
+ /**
355
+ * @description Creates a &#x60;credit_note&#x60; for the specified invoice.
356
+ **Note:**
357
+
358
+ 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).
359
+
360
+ */
361
+
55
362
  create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
363
+
364
+ /**
365
+ * @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).
366
+
367
+ */
368
+
56
369
  record_refund(credit_note_id:string, input?:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
370
+
371
+ /**
372
+ * @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.
373
+
374
+ */
375
+
57
376
  import_credit_note(input:ImportCreditNoteInputParam):ChargebeeRequest<ImportCreditNoteResponse>;
377
+
378
+ /**
379
+ * @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.
380
+
381
+ */
382
+
58
383
  delete(credit_note_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
384
+
385
+ /**
386
+ * @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/).
387
+ **Note**
388
+
389
+ * You can only download e-invoices when their &#x60;status&#x60; is &#x60;success&#x60; or &#x60;registered&#x60;.
390
+ * 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.
391
+
392
+ */
393
+
59
394
  download_einvoice(credit_note_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
395
+
396
+ /**
397
+ * @description Gets the credit note as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
398
+
399
+ */
400
+
60
401
  pdf(credit_note_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
402
+
403
+ /**
404
+ * @description Resend failed einvoice in credit notes.
405
+
406
+ */
407
+
61
408
  resend_einvoice(credit_note_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
409
+
410
+ /**
411
+ * @description Removes a [linked_tax_withheld_refunds](/docs/api/credit_notes#credit_note_linked_tax_withheld_refunds) record from the &#x60;credit_note&#x60;.
412
+
413
+ */
414
+
62
415
  remove_tax_withheld_refund(credit_note_id:string, input?:RemoveTaxWithheldRefundInputParam):ChargebeeRequest<RemoveTaxWithheldRefundResponse>;
416
+
417
+ /**
418
+ * @description Retrieves the Credit Note identified by the specified Credit Note number.
419
+
420
+ */
421
+
63
422
  retrieve(credit_note_id:string):ChargebeeRequest<RetrieveResponse>;
423
+
424
+ /**
425
+ * @description This endpoint is used to send an e-invoice for invoice.
426
+
427
+ To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
428
+
429
+ This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
430
+
431
+ * If e-invoicing is not enabled at the site and customer level.
432
+
433
+ * If there is an e-invoice generated already for the invoice.
434
+
435
+ * If the &quot;**Use automatic e-invoicing**&quot; option is selected.
436
+
437
+ * If there are no generated e-invoices with the &#x60;failed&#x60; or &#x60;skipped&#x60; status.
438
+
439
+ * If the invoice status is &#x60;voided&#x60; or &#x60;pending&#x60;.
440
+
441
+
442
+ */
443
+
64
444
  send_einvoice(credit_note_id:string):ChargebeeRequest<SendEinvoiceResponse>;
65
445
  }
66
- export interface VoidCreditNoteResponse {
67
- credit_note:CreditNote;
446
+ export interface VoidCreditNoteResponse {
447
+ /**
448
+ * @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.
449
+
450
+ **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.
451
+
452
+ */
453
+
454
+ credit_note:CreditNote;
68
455
  }
69
456
  export interface VoidCreditNoteInputParam {
457
+
458
+ /**
459
+ * @description Reason for voiding credit note. This comment will be added to the credit note.
460
+
461
+ */
462
+
70
463
  comment?:string;
71
464
  }
72
- export interface RefundResponse {
73
- credit_note:CreditNote;
74
- transaction:Transaction;
465
+ export interface RefundResponse {
466
+ /**
467
+ * @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.
468
+
469
+ */
470
+
471
+ credit_note:CreditNote;
472
+
473
+ /**
474
+ * @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.
475
+
476
+ */
477
+
478
+ transaction:Transaction;
75
479
  }
76
480
  export interface RefundInputParam {
481
+
482
+ /**
483
+ * @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.
484
+
485
+ */
486
+
77
487
  refund_amount?:number;
488
+
489
+ /**
490
+ * @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).
491
+
492
+ */
493
+
78
494
  customer_notes?:string;
495
+
496
+ /**
497
+ * @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.
498
+
499
+ */
500
+
79
501
  refund_reason_code?:string;
80
502
  }
81
- export interface ListResponse {
82
- list:{credit_note:CreditNote}[];
83
- next_offset?:string;
503
+ export interface ListResponse {
504
+ /**
505
+ * @description Lists all the Credit Notes.
506
+
507
+ */
508
+
509
+ list:{credit_note:CreditNote}[];
510
+
511
+ /**
512
+ * @description Lists all the Credit Notes.
513
+
514
+ */
515
+
516
+ next_offset?:string;
84
517
  }
85
518
  export interface ListInputParam {
86
- [key : string]: any;
519
+ [key : string]: any;
520
+ /**
521
+ * @description The number of resources to be returned.
522
+
523
+ */
524
+
87
525
  limit?:number;
526
+
527
+ /**
528
+ * @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.
529
+
530
+ */
531
+
88
532
  offset?:string;
533
+
534
+ /**
535
+ * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
536
+
537
+ */
538
+
89
539
  include_deleted?:boolean;
540
+
541
+ /**
542
+ * @description Credit-note id.
543
+
544
+ */
545
+
90
546
  id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
547
+
548
+ /**
549
+ * @description The identifier of the customer this Credit Note belongs to.
550
+
551
+ */
552
+
91
553
  customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
554
+
555
+ /**
556
+ * @description To filter based on subscription_id.
557
+ NOTE: Not to be used if *consolidated invoicing* feature is enabled.
558
+
559
+ */
560
+
92
561
  subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
562
+
563
+ /**
564
+ * @description The identifier of the invoice against which this Credit Note is issued
565
+
566
+ */
567
+
93
568
  reference_invoice_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
569
+
570
+ /**
571
+ * @description The credit note type.
572
+
573
+ */
574
+
94
575
  type?:{in?:string,is?:'adjustment' | 'refundable',is_not?:'adjustment' | 'refundable',not_in?:string};
576
+
577
+ /**
578
+ * @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\]
579
+
580
+ */
581
+
95
582
  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};
583
+
584
+ /**
585
+ * @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
586
+
587
+ */
588
+
96
589
  create_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
590
+
591
+ /**
592
+ * @description The credit note status.
593
+
594
+ */
595
+
97
596
  status?:{in?:string,is?:'refund_due' | 'adjusted' | 'refunded' | 'voided',is_not?:'refund_due' | 'adjusted' | 'refunded' | 'voided',not_in?:string};
597
+
598
+ /**
599
+ * @description The date the Credit Note is issued.
600
+
601
+ */
602
+
98
603
  date?:{after?:string,before?:string,between?:string,on?:string};
604
+
605
+ /**
606
+ * @description Credit Note amount in cents.
607
+
608
+ */
609
+
99
610
  total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
611
+
612
+ /**
613
+ * @description The price type of the Credit Note.
614
+
615
+ */
616
+
100
617
  price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
618
+
619
+ /**
620
+ * @description The amount allocated to the invoices.
621
+
622
+ */
623
+
101
624
  amount_allocated?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
625
+
626
+ /**
627
+ * @description The refunds issued from this Credit Note.
628
+
629
+ */
630
+
102
631
  amount_refunded?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
632
+
633
+ /**
634
+ * @description The yet to be used credits of this Credit Note.
635
+
636
+ */
637
+
103
638
  amount_available?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
639
+
640
+ /**
641
+ * @description Timestamp indicating the date and time this Credit Note gets voided.
642
+
643
+ */
644
+
104
645
  voided_at?:{after?:string,before?:string,between?:string,on?:string};
646
+
647
+ /**
648
+ * @description To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
649
+
650
+ */
651
+
105
652
  updated_at?:{after?:string,before?:string,between?:string,on?:string};
653
+
654
+ /**
655
+ * @description Lists all the Credit Notes.
656
+
657
+ */
658
+
106
659
  sort_by?:{asc?:'date',desc?:'date'};
660
+
661
+ /**
662
+ * @description The subscription channel this object originated from and is maintained in.
663
+
664
+ */
665
+
107
666
  channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
667
+
668
+ /**
669
+ * @description Parameters for einvoice
670
+
671
+ */
672
+
108
673
  einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
109
674
  }
110
- export interface CreateResponse {
111
- credit_note:CreditNote;
112
- invoice:Invoice;
675
+ export interface CreateResponse {
676
+ /**
677
+ * @description Creates a &#x60;credit_note&#x60; for the specified invoice.
678
+ **Note:**
679
+
680
+ 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).
681
+
682
+ */
683
+
684
+ credit_note:CreditNote;
685
+
686
+ /**
687
+ * @description Creates a &#x60;credit_note&#x60; for the specified invoice.
688
+ **Note:**
689
+
690
+ 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).
691
+
692
+ */
693
+
694
+ invoice:Invoice;
113
695
  }
114
696
  export interface CreateInputParam {
697
+
698
+ /**
699
+ * @description The identifier of the invoice against which this Credit Note is issued.
700
+
701
+ */
702
+
115
703
  reference_invoice_id:string;
704
+
705
+ /**
706
+ * @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.
707
+
708
+ */
709
+
116
710
  total?:number;
711
+
712
+ /**
713
+ * @description The credit note type. \* refundable - Refundable Credit Note \* adjustment - Adjustment Credit Note
714
+
715
+ */
716
+
117
717
  type:'adjustment' | 'refundable';
718
+
719
+ /**
720
+ * @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
721
+
722
+ */
723
+
118
724
  reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver';
725
+
726
+ /**
727
+ * @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.
728
+
729
+ */
730
+
119
731
  create_reason_code?:string;
732
+
733
+ /**
734
+ * @description The date the Credit Note is issued.
735
+
736
+ */
737
+
120
738
  date?:number;
739
+
740
+ /**
741
+ * @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).
742
+
743
+ */
744
+
121
745
  customer_notes?:string;
746
+
747
+ /**
748
+ * @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).
749
+
750
+ */
751
+
122
752
  comment?:string;
753
+
754
+ /**
755
+ * @description Parameters for line_items
756
+
757
+ */
758
+
123
759
  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}[];
124
760
  }
125
- export interface RecordRefundResponse {
126
- credit_note:CreditNote;
127
- transaction?:Transaction;
761
+ export interface RecordRefundResponse {
762
+ /**
763
+ * @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).
764
+
765
+ */
766
+
767
+ credit_note:CreditNote;
768
+
769
+ /**
770
+ * @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).
771
+
772
+ */
773
+
774
+ transaction?:Transaction;
128
775
  }
129
776
  export interface RecordRefundInputParam {
777
+
778
+ /**
779
+ * @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.
780
+
781
+ */
782
+
130
783
  refund_reason_code?:string;
784
+
785
+ /**
786
+ * @description Remarks, if any, on the refund.
787
+
788
+ */
789
+
131
790
  comment?:string;
791
+
792
+ /**
793
+ * @description Parameters for transaction
794
+
795
+ */
796
+
132
797
  transaction?:{amount?:number,date:number,payment_method:PaymentMethod,reference_number?:string};
133
798
  }
134
- export interface ImportCreditNoteResponse {
135
- credit_note:CreditNote;
799
+ export interface ImportCreditNoteResponse {
800
+ /**
801
+ * @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.
802
+
803
+ */
804
+
805
+ credit_note:CreditNote;
136
806
  }
137
807
  export interface ImportCreditNoteInputParam {
808
+
809
+ /**
810
+ * @description Credit Note Number.
811
+
812
+ */
813
+
138
814
  id:string;
815
+
816
+ /**
817
+ * @description This identifies the customer for whom the credit note needs to be created.
818
+
819
+ */
820
+
139
821
  customer_id?:string;
822
+
823
+ /**
824
+ * @description The identifier of the subscription for which this credit note needs to be created.
825
+
826
+ */
827
+
140
828
  subscription_id?:string;
829
+
830
+ /**
831
+ * @description The identifier of the invoice against which this Credit Note is issued.
832
+
833
+ */
834
+
141
835
  reference_invoice_id:string;
836
+
837
+ /**
838
+ * @description The credit note type. \* refundable - Refundable Credit Note \* adjustment - Adjustment Credit Note
839
+
840
+ */
841
+
142
842
  type:'adjustment' | 'refundable';
843
+
844
+ /**
845
+ * @description The currency code (ISO 4217 format) for the credit note.
846
+
847
+ */
848
+
143
849
  currency_code?:string;
850
+
851
+ /**
852
+ * @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.
853
+
854
+ */
855
+
144
856
  create_reason_code:string;
857
+
858
+ /**
859
+ * @description The date the Credit Note is issued.
860
+
861
+ */
862
+
145
863
  date:number;
864
+
865
+ /**
866
+ * @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.
867
+
868
+ */
869
+
146
870
  status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
871
+
872
+ /**
873
+ * @description Credit Note amount in cents.
874
+
875
+ */
876
+
147
877
  total?:number;
878
+
879
+ /**
880
+ * @description The time this Credit Note gets fully used. Please note that this field is not present when partial refunds are issued.
881
+
882
+ */
883
+
148
884
  refunded_at?:number;
885
+
886
+ /**
887
+ * @description Timestamp indicating the date and time this Credit Note gets voided.
888
+
889
+ */
890
+
149
891
  voided_at?:number;
892
+
893
+ /**
894
+ * @description The Credit Note sub-total.
895
+
896
+ */
897
+
150
898
  sub_total?:number;
899
+
900
+ /**
901
+ * @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;.
902
+
903
+ */
904
+
151
905
  round_off_amount?:number;
906
+
907
+ /**
908
+ * @description Indicates the fractional correction amount.
909
+
910
+ */
911
+
152
912
  fractional_correction?:number;
913
+
914
+ /**
915
+ * @description An overridden value for the first two characters of the [full VAT
916
+ 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** ).
917
+
918
+ When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
919
+ 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
920
+ 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.
921
+
922
+ */
923
+
153
924
  vat_number_prefix?:string;
925
+
926
+ /**
927
+ * @description Parameters for line_items
928
+
929
+ */
930
+
154
931
  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}[];
932
+
933
+ /**
934
+ * @description Parameters for line_item_tiers
935
+
936
+ */
937
+
155
938
  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}[];
939
+
940
+ /**
941
+ * @description Parameters for discounts
942
+
943
+ */
944
+
156
945
  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}[];
946
+
947
+ /**
948
+ * @description Parameters for taxes
949
+
950
+ */
951
+
157
952
  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}[];
953
+
954
+ /**
955
+ * @description Parameters for allocations
956
+
957
+ */
958
+
158
959
  allocations?:{allocated_amount:number,allocated_at:number,invoice_id:string}[];
960
+
961
+ /**
962
+ * @description Parameters for linked_refunds
963
+
964
+ */
965
+
159
966
  linked_refunds?:{amount:number,date:number,payment_method:PaymentMethod,reference_number?:string}[];
160
967
  }
161
- export interface DeleteResponse {
162
- credit_note:CreditNote;
968
+ export interface DeleteResponse {
969
+ /**
970
+ * @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.
971
+
972
+ */
973
+
974
+ credit_note:CreditNote;
163
975
  }
164
976
  export interface DeleteInputParam {
977
+
978
+ /**
979
+ * @description Reason for deleting this credit note. This comment will be added to the associated invoice entity.
980
+
981
+ */
982
+
165
983
  comment?:string;
166
984
  }
167
- export interface DownloadEinvoiceResponse {
168
- downloads:Download[];
985
+ export interface DownloadEinvoiceResponse {
986
+ /**
987
+ * @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/).
988
+ **Note**
989
+
990
+ * You can only download e-invoices when their &#x60;status&#x60; is &#x60;success&#x60; or &#x60;registered&#x60;.
991
+ * 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.
992
+
993
+ */
994
+
995
+ downloads:Download[];
169
996
  }
170
997
 
171
- export interface PdfResponse {
172
- download:Download;
998
+ export interface PdfResponse {
999
+ /**
1000
+ * @description Gets the credit note as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
1001
+
1002
+ */
1003
+
1004
+ download:Download;
173
1005
  }
174
1006
  export interface PdfInputParam {
1007
+
1008
+ /**
1009
+ * @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
1010
+
1011
+ */
1012
+
175
1013
  disposition_type?:DispositionType;
176
1014
  }
177
- export interface ResendEinvoiceResponse {
178
- credit_note:CreditNote;
1015
+ export interface ResendEinvoiceResponse {
1016
+ /**
1017
+ * @description Resend failed einvoice in credit notes.
1018
+
1019
+ */
1020
+
1021
+ credit_note:CreditNote;
179
1022
  }
180
1023
 
181
- export interface RemoveTaxWithheldRefundResponse {
182
- credit_note:CreditNote;
1024
+ export interface RemoveTaxWithheldRefundResponse {
1025
+ /**
1026
+ * @description Removes a [linked_tax_withheld_refunds](/docs/api/credit_notes#credit_note_linked_tax_withheld_refunds) record from the &#x60;credit_note&#x60;.
1027
+
1028
+ */
1029
+
1030
+ credit_note:CreditNote;
183
1031
  }
184
1032
  export interface RemoveTaxWithheldRefundInputParam {
1033
+
1034
+ /**
1035
+ * @description Parameters for tax_withheld
1036
+
1037
+ */
1038
+
185
1039
  tax_withheld?:{id:string};
186
1040
  }
187
- export interface RetrieveResponse {
188
- credit_note:CreditNote;
1041
+ export interface RetrieveResponse {
1042
+ /**
1043
+ * @description Retrieves the Credit Note identified by the specified Credit Note number.
1044
+
1045
+ */
1046
+
1047
+ credit_note:CreditNote;
189
1048
  }
190
1049
 
191
- export interface SendEinvoiceResponse {
192
- credit_note:CreditNote;
1050
+ export interface SendEinvoiceResponse {
1051
+ /**
1052
+ * @description This endpoint is used to send an e-invoice for invoice.
1053
+
1054
+ To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
1055
+
1056
+ This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
1057
+
1058
+ * If e-invoicing is not enabled at the site and customer level.
1059
+
1060
+ * If there is an e-invoice generated already for the invoice.
1061
+
1062
+ * If the &quot;**Use automatic e-invoicing**&quot; option is selected.
1063
+
1064
+ * If there are no generated e-invoices with the &#x60;failed&#x60; or &#x60;skipped&#x60; status.
1065
+
1066
+ * If the invoice status is &#x60;voided&#x60; or &#x60;pending&#x60;.
1067
+
1068
+
1069
+ */
1070
+
1071
+ credit_note:CreditNote;
193
1072
  }
194
1073
 
195
- export interface Einvoice {
1074
+ export interface Einvoice {
1075
+ /**
1076
+ * @description The unique &#x60;id&#x60; for the e-invoice. This is auto-generated by Chargebee.
1077
+
1078
+ */
1079
+
196
1080
  id?:string;
1081
+
1082
+ /**
1083
+ * @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.
1084
+
1085
+ */
1086
+
197
1087
  reference_number?:string;
1088
+
1089
+ /**
1090
+ * @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.
1091
+
1092
+ */
1093
+
198
1094
  status?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
1095
+
1096
+ /**
1097
+ * @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:
1098
+
1099
+ * Invoice successfully sent to customer via the e-invoicing network 9090:123456
1100
+ * Invoice successfully sent to customer via email id abc@acme.com
1101
+
1102
+ */
1103
+
199
1104
  message?:string;
200
1105
  }
201
- export interface LineItem {
1106
+ export interface LineItem {
202
1107
  id?:string;
1108
+
203
1109
  subscription_id?:string;
1110
+
204
1111
  date_from?:number;
1112
+
205
1113
  date_to?:number;
1114
+
206
1115
  unit_amount?:number;
1116
+
207
1117
  quantity?:number;
1118
+
208
1119
  amount?:number;
1120
+
209
1121
  pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
1122
+
210
1123
  is_taxed?:boolean;
1124
+
211
1125
  tax_amount?:number;
1126
+
212
1127
  tax_rate?:number;
1128
+
213
1129
  unit_amount_in_decimal?:string;
1130
+
214
1131
  quantity_in_decimal?:string;
1132
+
215
1133
  amount_in_decimal?:string;
1134
+
216
1135
  discount_amount?:number;
1136
+
217
1137
  item_level_discount_amount?:number;
1138
+
218
1139
  reference_line_item_id?:string;
1140
+
219
1141
  description?:string;
1142
+
220
1143
  entity_description?:string;
1144
+
221
1145
  entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
1146
+
222
1147
  tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
1148
+
223
1149
  entity_id?:string;
1150
+
224
1151
  customer_id?:string;
225
1152
  }
226
- export interface Discount {
1153
+ export interface Discount {
227
1154
  amount?:number;
1155
+
228
1156
  description?:string;
1157
+
229
1158
  line_item_id?:string;
1159
+
230
1160
  entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1161
+
231
1162
  discount_type?:'fixed_amount' | 'percentage';
1163
+
232
1164
  entity_id?:string;
1165
+
233
1166
  coupon_set_code?:string;
234
1167
  }
235
- export interface LineItemDiscount {
1168
+ export interface LineItemDiscount {
236
1169
  line_item_id?:string;
1170
+
237
1171
  discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1172
+
238
1173
  coupon_id?:string;
1174
+
239
1175
  entity_id?:string;
1176
+
240
1177
  discount_amount?:number;
241
1178
  }
242
- export interface LineItemTier {
1179
+ export interface LineItemTier {
243
1180
  line_item_id?:string;
1181
+
244
1182
  starting_unit?:number;
1183
+
245
1184
  ending_unit?:number;
1185
+
246
1186
  quantity_used?:number;
1187
+
247
1188
  unit_amount?:number;
1189
+
248
1190
  starting_unit_in_decimal?:string;
1191
+
249
1192
  ending_unit_in_decimal?:string;
1193
+
250
1194
  quantity_used_in_decimal?:string;
1195
+
251
1196
  unit_amount_in_decimal?:string;
252
1197
  }
253
- export interface Tax {
1198
+ export interface Tax {
254
1199
  name?:string;
1200
+
255
1201
  amount?:number;
1202
+
256
1203
  description?:string;
257
1204
  }
258
- export interface LineItemTax {
1205
+ export interface LineItemTax {
259
1206
  line_item_id?:string;
1207
+
260
1208
  tax_name?:string;
1209
+
261
1210
  tax_rate?:number;
1211
+
262
1212
  is_partial_tax_applied?:boolean;
1213
+
263
1214
  is_non_compliance_tax?:boolean;
1215
+
264
1216
  taxable_amount?:number;
1217
+
265
1218
  tax_amount?:number;
1219
+
266
1220
  tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
1221
+
267
1222
  tax_juris_name?:string;
1223
+
268
1224
  tax_juris_code?:string;
1225
+
269
1226
  tax_amount_in_local_currency?:number;
1227
+
270
1228
  local_currency_code?:string;
271
1229
  }
272
- export interface CreditNoteTransaction {
1230
+ export interface CreditNoteTransaction {
273
1231
  txn_id?:string;
1232
+
274
1233
  applied_amount?:number;
1234
+
275
1235
  applied_at?:number;
1236
+
276
1237
  txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
1238
+
277
1239
  txn_date?:number;
1240
+
278
1241
  txn_amount?:number;
1242
+
279
1243
  refund_reason_code?:string;
280
1244
  }
281
- export interface LinkedTaxWithheldRefund {
1245
+ export interface LinkedTaxWithheldRefund {
282
1246
  id?:string;
1247
+
283
1248
  amount?:number;
1249
+
284
1250
  description?:string;
1251
+
285
1252
  date?:number;
1253
+
286
1254
  reference_number?:string;
287
1255
  }
288
- export interface AppliedCredit {
1256
+ export interface AppliedCredit {
289
1257
  invoice_id?:string;
1258
+
290
1259
  allocated_amount?:number;
1260
+
291
1261
  allocated_at?:number;
1262
+
292
1263
  invoice_date?:number;
1264
+
293
1265
  invoice_status?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
294
1266
  }
295
- export interface ShippingAddress {
1267
+ export interface ShippingAddress {
1268
+ /**
1269
+ * @description The first name of the contact.
1270
+
1271
+ */
1272
+
296
1273
  first_name?:string;
1274
+
1275
+ /**
1276
+ * @description The last name of the contact.
1277
+
1278
+ */
1279
+
297
1280
  last_name?:string;
1281
+
1282
+ /**
1283
+ * @description The email address.
1284
+
1285
+ */
1286
+
298
1287
  email?:string;
1288
+
1289
+ /**
1290
+ * @description The company name.
1291
+
1292
+ */
1293
+
299
1294
  company?:string;
1295
+
1296
+ /**
1297
+ * @description The phone number.
1298
+
1299
+ */
1300
+
300
1301
  phone?:string;
1302
+
1303
+ /**
1304
+ * @description Address line 1
1305
+
1306
+ */
1307
+
301
1308
  line1?:string;
1309
+
1310
+ /**
1311
+ * @description Address line 2
1312
+
1313
+ */
1314
+
302
1315
  line2?:string;
1316
+
1317
+ /**
1318
+ * @description Address line 3
1319
+
1320
+ */
1321
+
303
1322
  line3?:string;
1323
+
1324
+ /**
1325
+ * @description The name of the city.
1326
+
1327
+ */
1328
+
304
1329
  city?:string;
1330
+
1331
+ /**
1332
+ * @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;).
1333
+
1334
+ */
1335
+
305
1336
  state_code?:string;
1337
+
1338
+ /**
1339
+ * @description The state/province name.
1340
+
1341
+ */
1342
+
306
1343
  state?:string;
1344
+
1345
+ /**
1346
+ * @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).
1347
+
1348
+ **Note** : If you enter an invalid country code, the system will return an error.
1349
+
1350
+ **Brexit**
1351
+
1352
+
1353
+ 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.
1354
+
1355
+ */
1356
+
307
1357
  country?:string;
1358
+
1359
+ /**
1360
+ * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address).
1361
+
1362
+ */
1363
+
308
1364
  zip?:string;
1365
+
1366
+ /**
1367
+ * @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.
1368
+
1369
+ */
1370
+
309
1371
  validation_status?:ValidationStatus;
1372
+
1373
+ /**
1374
+ * @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
1375
+
1376
+ */
1377
+
310
1378
  index?:number;
311
1379
  }
312
- export interface BillingAddress {
1380
+ export interface BillingAddress {
1381
+ /**
1382
+ * @description The first name of the billing contact.
1383
+
1384
+ */
1385
+
313
1386
  first_name?:string;
1387
+
1388
+ /**
1389
+ * @description The last name of the billing contact.
1390
+
1391
+ */
1392
+
314
1393
  last_name?:string;
1394
+
1395
+ /**
1396
+ * @description The email address.
1397
+
1398
+ */
1399
+
315
1400
  email?:string;
1401
+
1402
+ /**
1403
+ * @description The company name.
1404
+
1405
+ */
1406
+
316
1407
  company?:string;
1408
+
1409
+ /**
1410
+ * @description The phone number.
1411
+
1412
+ */
1413
+
317
1414
  phone?:string;
1415
+
1416
+ /**
1417
+ * @description Address line 1
1418
+
1419
+ */
1420
+
318
1421
  line1?:string;
1422
+
1423
+ /**
1424
+ * @description Address line 2
1425
+
1426
+ */
1427
+
319
1428
  line2?:string;
1429
+
1430
+ /**
1431
+ * @description Address line 3
1432
+
1433
+ */
1434
+
320
1435
  line3?:string;
1436
+
1437
+ /**
1438
+ * @description The name of the city.
1439
+
1440
+ */
1441
+
321
1442
  city?:string;
1443
+
1444
+ /**
1445
+ * @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;).
1446
+
1447
+ */
1448
+
322
1449
  state_code?:string;
1450
+
1451
+ /**
1452
+ * @description State or Province
1453
+
1454
+ */
1455
+
323
1456
  state?:string;
1457
+
1458
+ /**
1459
+ * @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).
1460
+
1461
+ **Note** : If you enter an invalid country code, the system will return an error.
1462
+
1463
+ **Brexit**
1464
+
1465
+
1466
+ 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.
1467
+
1468
+ */
1469
+
324
1470
  country?:string;
1471
+
1472
+ /**
1473
+ * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address).
1474
+
1475
+ */
1476
+
325
1477
  zip?:string;
1478
+
1479
+ /**
1480
+ * @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.
1481
+
1482
+ */
1483
+
326
1484
  validation_status?:ValidationStatus;
327
1485
  }
328
1486
  }