chargebee 2.28.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
- package/.github/ISSUE_TEMPLATE/config.yml +6 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- package/.github/workflows/greeting.yml +47 -0
- package/CHANGELOG.md +59 -0
- package/SECURITY.md +8 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +0 -14
- package/package.json +1 -1
- package/types/core.d.ts +4 -4
- package/types/resources/AttachedItem.d.ts +88 -88
- package/types/resources/Card.d.ts +68 -68
- package/types/resources/Comment.d.ts +50 -44
- package/types/resources/Coupon.d.ts +242 -207
- package/types/resources/CouponSet.d.ts +72 -68
- package/types/resources/CreditNote.d.ts +612 -236
- package/types/resources/Customer.d.ts +655 -513
- package/types/resources/DifferentialPrice.d.ts +99 -74
- package/types/resources/EntitlementOverride.d.ts +27 -12
- package/types/resources/Estimate.d.ts +450 -450
- package/types/resources/Event.d.ts +30 -12
- package/types/resources/Export.d.ts +200 -200
- package/types/resources/Feature.d.ts +66 -35
- package/types/resources/Gift.d.ts +54 -44
- package/types/resources/HostedPage.d.ts +381 -381
- package/types/resources/InAppSubscription.d.ts +94 -90
- package/types/resources/Invoice.d.ts +1242 -660
- package/types/resources/Item.d.ts +148 -142
- package/types/resources/ItemEntitlement.d.ts +36 -36
- package/types/resources/ItemFamily.d.ts +45 -45
- package/types/resources/ItemPrice.d.ts +317 -273
- package/types/resources/PaymentIntent.d.ts +60 -60
- package/types/resources/PaymentReferenceNumber.d.ts +1 -1
- package/types/resources/PaymentVoucher.d.ts +74 -59
- package/types/resources/PortalSession.d.ts +45 -20
- package/types/resources/PromotionalCredit.d.ts +68 -68
- package/types/resources/Purchase.d.ts +3 -3
- package/types/resources/Quote.d.ts +655 -366
- package/types/resources/QuoteLineGroup.d.ts +245 -0
- package/types/resources/QuotedCharge.d.ts +170 -0
- package/types/resources/QuotedSubscription.d.ts +219 -0
- package/types/resources/SiteMigrationDetail.d.ts +7 -7
- package/types/resources/Subscription.d.ts +1219 -932
- package/types/resources/SubscriptionEntitlement.d.ts +33 -12
- package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
- package/types/resources/TimeMachine.d.ts +15 -15
- package/types/resources/Token.d.ts +0 -116
- package/types/resources/Transaction.d.ts +229 -112
- package/types/resources/UnbilledCharge.d.ts +112 -67
- package/types/resources/Usage.d.ts +46 -47
- package/types/resources/VirtualBankAccount.d.ts +66 -66
- package/types/resources/Media.d.ts +0 -33
- package/types/resources/NonSubscription.d.ts +0 -65
|
@@ -329,83 +329,76 @@ Ireland** . The first two characters of the VAT number in such a case is `X
|
|
|
329
329
|
export namespace CreditNote {
|
|
330
330
|
export class CreditNoteResource {
|
|
331
331
|
/**
|
|
332
|
-
* @description
|
|
332
|
+
* @description Creates a `credit_note` for the specified invoice.
|
|
333
|
+
**Note:**
|
|
333
334
|
|
|
334
|
-
|
|
335
|
+
If the `credit_note` [type](/docs/api/credit_notes#create_credit_note_type) is `refundable`, then `linked_taxes_withheld.amount` 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).
|
|
335
336
|
|
|
336
337
|
*/
|
|
337
338
|
|
|
338
|
-
|
|
339
|
+
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
339
340
|
|
|
340
341
|
/**
|
|
341
|
-
* @description
|
|
342
|
+
* @description Retrieves the Credit Note identified by the specified Credit Note number.
|
|
342
343
|
|
|
343
344
|
*/
|
|
344
345
|
|
|
345
|
-
|
|
346
|
+
retrieve(credit_note_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
346
347
|
|
|
347
348
|
/**
|
|
348
|
-
* @description
|
|
349
|
+
* @description Gets the credit note as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
|
|
349
350
|
|
|
350
351
|
*/
|
|
351
352
|
|
|
352
|
-
|
|
353
|
+
pdf(credit_note_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
|
|
353
354
|
|
|
354
355
|
/**
|
|
355
|
-
* @description
|
|
356
|
-
**Note
|
|
357
|
-
|
|
358
|
-
If the `credit_note` [type](/docs/api/credit_notes#create_credit_note_type) is `refundable`, then `linked_taxes_withheld.amount` 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).
|
|
356
|
+
* @description Download the e-invoice for the credit note in both XML and PDF formats. The response consists of a `download` object for each format. The XML format follows the [structure as per Peppol BIS Billing v3.0](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-creditnote/tree/).
|
|
357
|
+
**Note**
|
|
359
358
|
|
|
360
|
-
|
|
361
|
-
|
|
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 `linked_payments` first and then against any `linked_taxes_withheld` for the [invoice](/docs/api/credit_notes#credit_note_reference_invoice_id) associated with the `credit_note`. 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).
|
|
359
|
+
* You can only download e-invoices when their `status` is `success` or `registered`.
|
|
360
|
+
* 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.
|
|
366
361
|
|
|
367
362
|
*/
|
|
368
363
|
|
|
369
|
-
|
|
364
|
+
download_einvoice(credit_note_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
|
|
370
365
|
|
|
371
366
|
/**
|
|
372
|
-
* @description
|
|
367
|
+
* @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.
|
|
373
368
|
|
|
374
369
|
*/
|
|
375
370
|
|
|
376
|
-
|
|
371
|
+
refund(credit_note_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
|
|
377
372
|
|
|
378
373
|
/**
|
|
379
|
-
* @description
|
|
374
|
+
* @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 `linked_payments` first and then against any `linked_taxes_withheld` for the [invoice](/docs/api/credit_notes#credit_note_reference_invoice_id) associated with the `credit_note`. 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).
|
|
380
375
|
|
|
381
376
|
*/
|
|
382
377
|
|
|
383
|
-
|
|
378
|
+
record_refund(credit_note_id:string, input?:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
|
|
384
379
|
|
|
385
380
|
/**
|
|
386
|
-
* @description
|
|
387
|
-
**Note**
|
|
381
|
+
* @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
382
|
|
|
389
|
-
|
|
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.
|
|
383
|
+
**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.
|
|
391
384
|
|
|
392
385
|
*/
|
|
393
386
|
|
|
394
|
-
|
|
387
|
+
void_credit_note(credit_note_id:string, input?:VoidCreditNoteInputParam):ChargebeeRequest<VoidCreditNoteResponse>;
|
|
395
388
|
|
|
396
389
|
/**
|
|
397
|
-
* @description
|
|
390
|
+
* @description Lists all the Credit Notes.
|
|
398
391
|
|
|
399
392
|
*/
|
|
400
393
|
|
|
401
|
-
|
|
394
|
+
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
402
395
|
|
|
403
396
|
/**
|
|
404
|
-
* @description
|
|
397
|
+
* @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.
|
|
405
398
|
|
|
406
399
|
*/
|
|
407
400
|
|
|
408
|
-
|
|
401
|
+
delete(credit_note_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
|
|
409
402
|
|
|
410
403
|
/**
|
|
411
404
|
* @description Removes a [linked_tax_withheld_refunds](/docs/api/credit_notes#credit_note_linked_tax_withheld_refunds) record from the `credit_note`.
|
|
@@ -415,11 +408,11 @@ If the `credit_note` [type](/docs/api/credit_notes#create_credit_note_
|
|
|
415
408
|
remove_tax_withheld_refund(credit_note_id:string, input?:RemoveTaxWithheldRefundInputParam):ChargebeeRequest<RemoveTaxWithheldRefundResponse>;
|
|
416
409
|
|
|
417
410
|
/**
|
|
418
|
-
* @description
|
|
411
|
+
* @description Resend failed einvoice in credit notes.
|
|
419
412
|
|
|
420
413
|
*/
|
|
421
414
|
|
|
422
|
-
|
|
415
|
+
resend_einvoice(credit_note_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
|
|
423
416
|
|
|
424
417
|
/**
|
|
425
418
|
* @description This endpoint is used to send an e-invoice for invoice.
|
|
@@ -442,19 +435,104 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
|
|
|
442
435
|
*/
|
|
443
436
|
|
|
444
437
|
send_einvoice(credit_note_id:string):ChargebeeRequest<SendEinvoiceResponse>;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* @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.
|
|
441
|
+
|
|
442
|
+
*/
|
|
443
|
+
|
|
444
|
+
import_credit_note(input:ImportCreditNoteInputParam):ChargebeeRequest<ImportCreditNoteResponse>;
|
|
445
445
|
}
|
|
446
|
-
export interface
|
|
446
|
+
export interface CreateResponse {
|
|
447
447
|
credit_note:CreditNote;
|
|
448
|
+
|
|
449
|
+
invoice:Invoice;
|
|
448
450
|
}
|
|
449
|
-
export interface
|
|
451
|
+
export interface CreateInputParam {
|
|
450
452
|
|
|
451
453
|
/**
|
|
452
|
-
* @description
|
|
454
|
+
* @description The identifier of the invoice against which this Credit Note is issued.
|
|
455
|
+
|
|
456
|
+
*/
|
|
457
|
+
|
|
458
|
+
reference_invoice_id:string;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* @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.
|
|
462
|
+
|
|
463
|
+
*/
|
|
464
|
+
|
|
465
|
+
total?:number;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* @description The credit note type. \* refundable - Refundable Credit Note \* adjustment - Adjustment Credit Note
|
|
469
|
+
|
|
470
|
+
*/
|
|
471
|
+
|
|
472
|
+
type:'adjustment' | 'refundable';
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @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
|
|
476
|
+
|
|
477
|
+
*/
|
|
478
|
+
|
|
479
|
+
reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver';
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* @description Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Credit Notes \> Create Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
483
|
+
|
|
484
|
+
*/
|
|
485
|
+
|
|
486
|
+
create_reason_code?:string;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* @description The date the Credit Note is issued.
|
|
490
|
+
|
|
491
|
+
*/
|
|
492
|
+
|
|
493
|
+
date?:number;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* @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).
|
|
497
|
+
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
customer_notes?:string;
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* @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).
|
|
453
504
|
|
|
454
505
|
*/
|
|
455
506
|
|
|
456
507
|
comment?:string;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* @description Parameters for line_items
|
|
511
|
+
|
|
512
|
+
*/
|
|
513
|
+
|
|
514
|
+
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}[];
|
|
515
|
+
}
|
|
516
|
+
export interface RetrieveResponse {
|
|
517
|
+
credit_note:CreditNote;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export interface PdfResponse {
|
|
521
|
+
download:Download;
|
|
522
|
+
}
|
|
523
|
+
export interface PdfInputParam {
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* @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
|
|
527
|
+
|
|
528
|
+
*/
|
|
529
|
+
|
|
530
|
+
disposition_type?:DispositionType;
|
|
531
|
+
}
|
|
532
|
+
export interface DownloadEinvoiceResponse {
|
|
533
|
+
downloads:Download[];
|
|
457
534
|
}
|
|
535
|
+
|
|
458
536
|
export interface RefundResponse {
|
|
459
537
|
credit_note:CreditNote;
|
|
460
538
|
|
|
@@ -483,6 +561,46 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
|
|
|
483
561
|
|
|
484
562
|
refund_reason_code?:string;
|
|
485
563
|
}
|
|
564
|
+
export interface RecordRefundResponse {
|
|
565
|
+
credit_note:CreditNote;
|
|
566
|
+
|
|
567
|
+
transaction?:Transaction;
|
|
568
|
+
}
|
|
569
|
+
export interface RecordRefundInputParam {
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* @description Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Credit Notes \> Refund Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
573
|
+
|
|
574
|
+
*/
|
|
575
|
+
|
|
576
|
+
refund_reason_code?:string;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* @description Remarks, if any, on the refund.
|
|
580
|
+
|
|
581
|
+
*/
|
|
582
|
+
|
|
583
|
+
comment?:string;
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* @description Parameters for transaction
|
|
587
|
+
|
|
588
|
+
*/
|
|
589
|
+
|
|
590
|
+
transaction?:{amount?:number,date:number,payment_method:PaymentMethod,reference_number?:string};
|
|
591
|
+
}
|
|
592
|
+
export interface VoidCreditNoteResponse {
|
|
593
|
+
credit_note:CreditNote;
|
|
594
|
+
}
|
|
595
|
+
export interface VoidCreditNoteInputParam {
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* @description Reason for voiding credit note. This comment will be added to the credit note.
|
|
599
|
+
|
|
600
|
+
*/
|
|
601
|
+
|
|
602
|
+
comment?:string;
|
|
603
|
+
}
|
|
486
604
|
export interface ListResponse {
|
|
487
605
|
/**
|
|
488
606
|
* @description Lists all the Credit Notes.
|
|
@@ -501,134 +619,133 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
|
|
|
501
619
|
export interface ListInputParam {
|
|
502
620
|
[key : string]: any;
|
|
503
621
|
/**
|
|
504
|
-
* @description
|
|
622
|
+
* @description Lists all the Credit Notes.
|
|
505
623
|
|
|
506
624
|
*/
|
|
507
625
|
|
|
508
626
|
limit?:number;
|
|
509
627
|
|
|
510
628
|
/**
|
|
511
|
-
* @description
|
|
629
|
+
* @description Lists all the Credit Notes.
|
|
512
630
|
|
|
513
631
|
*/
|
|
514
632
|
|
|
515
633
|
offset?:string;
|
|
516
634
|
|
|
517
635
|
/**
|
|
518
|
-
* @description
|
|
636
|
+
* @description Lists all the Credit Notes.
|
|
519
637
|
|
|
520
638
|
*/
|
|
521
639
|
|
|
522
640
|
include_deleted?:boolean;
|
|
523
641
|
|
|
524
642
|
/**
|
|
525
|
-
* @description Credit
|
|
643
|
+
* @description Lists all the Credit Notes.
|
|
526
644
|
|
|
527
645
|
*/
|
|
528
646
|
|
|
529
647
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
530
648
|
|
|
531
649
|
/**
|
|
532
|
-
* @description
|
|
650
|
+
* @description Lists all the Credit Notes.
|
|
533
651
|
|
|
534
652
|
*/
|
|
535
653
|
|
|
536
654
|
customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
537
655
|
|
|
538
656
|
/**
|
|
539
|
-
* @description
|
|
540
|
-
NOTE: Not to be used if *consolidated invoicing* feature is enabled.
|
|
657
|
+
* @description Lists all the Credit Notes.
|
|
541
658
|
|
|
542
659
|
*/
|
|
543
660
|
|
|
544
661
|
subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
|
|
545
662
|
|
|
546
663
|
/**
|
|
547
|
-
* @description
|
|
664
|
+
* @description Lists all the Credit Notes.
|
|
548
665
|
|
|
549
666
|
*/
|
|
550
667
|
|
|
551
668
|
reference_invoice_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
552
669
|
|
|
553
670
|
/**
|
|
554
|
-
* @description
|
|
671
|
+
* @description Lists all the Credit Notes.
|
|
555
672
|
|
|
556
673
|
*/
|
|
557
674
|
|
|
558
675
|
type?:{in?:string,is?:'adjustment' | 'refundable',is_not?:'adjustment' | 'refundable',not_in?:string};
|
|
559
676
|
|
|
560
677
|
/**
|
|
561
|
-
* @description
|
|
678
|
+
* @description Lists all the Credit Notes.
|
|
562
679
|
|
|
563
680
|
*/
|
|
564
681
|
|
|
565
682
|
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};
|
|
566
683
|
|
|
567
684
|
/**
|
|
568
|
-
* @description
|
|
685
|
+
* @description Lists all the Credit Notes.
|
|
569
686
|
|
|
570
687
|
*/
|
|
571
688
|
|
|
572
689
|
create_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
573
690
|
|
|
574
691
|
/**
|
|
575
|
-
* @description
|
|
692
|
+
* @description Lists all the Credit Notes.
|
|
576
693
|
|
|
577
694
|
*/
|
|
578
695
|
|
|
579
696
|
status?:{in?:string,is?:'refund_due' | 'adjusted' | 'refunded' | 'voided',is_not?:'refund_due' | 'adjusted' | 'refunded' | 'voided',not_in?:string};
|
|
580
697
|
|
|
581
698
|
/**
|
|
582
|
-
* @description
|
|
699
|
+
* @description Lists all the Credit Notes.
|
|
583
700
|
|
|
584
701
|
*/
|
|
585
702
|
|
|
586
703
|
date?:{after?:string,before?:string,between?:string,on?:string};
|
|
587
704
|
|
|
588
705
|
/**
|
|
589
|
-
* @description
|
|
706
|
+
* @description Lists all the Credit Notes.
|
|
590
707
|
|
|
591
708
|
*/
|
|
592
709
|
|
|
593
710
|
total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
594
711
|
|
|
595
712
|
/**
|
|
596
|
-
* @description
|
|
713
|
+
* @description Lists all the Credit Notes.
|
|
597
714
|
|
|
598
715
|
*/
|
|
599
716
|
|
|
600
717
|
price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
|
|
601
718
|
|
|
602
719
|
/**
|
|
603
|
-
* @description
|
|
720
|
+
* @description Lists all the Credit Notes.
|
|
604
721
|
|
|
605
722
|
*/
|
|
606
723
|
|
|
607
724
|
amount_allocated?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
608
725
|
|
|
609
726
|
/**
|
|
610
|
-
* @description
|
|
727
|
+
* @description Lists all the Credit Notes.
|
|
611
728
|
|
|
612
729
|
*/
|
|
613
730
|
|
|
614
731
|
amount_refunded?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
615
732
|
|
|
616
733
|
/**
|
|
617
|
-
* @description
|
|
734
|
+
* @description Lists all the Credit Notes.
|
|
618
735
|
|
|
619
736
|
*/
|
|
620
737
|
|
|
621
738
|
amount_available?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
622
739
|
|
|
623
740
|
/**
|
|
624
|
-
* @description
|
|
741
|
+
* @description Lists all the Credit Notes.
|
|
625
742
|
|
|
626
743
|
*/
|
|
627
744
|
|
|
628
745
|
voided_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
629
746
|
|
|
630
747
|
/**
|
|
631
|
-
* @description
|
|
748
|
+
* @description Lists all the Credit Notes.
|
|
632
749
|
|
|
633
750
|
*/
|
|
634
751
|
|
|
@@ -642,138 +759,72 @@ NOTE: Not to be used if *consolidated invoicing* feature is enabled.
|
|
|
642
759
|
sort_by?:{asc?:'date',desc?:'date'};
|
|
643
760
|
|
|
644
761
|
/**
|
|
645
|
-
* @description
|
|
762
|
+
* @description Lists all the Credit Notes.
|
|
646
763
|
|
|
647
764
|
*/
|
|
648
765
|
|
|
649
766
|
channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
|
|
650
767
|
|
|
651
768
|
/**
|
|
652
|
-
* @description
|
|
769
|
+
* @description Lists all the Credit Notes.
|
|
653
770
|
|
|
654
771
|
*/
|
|
655
772
|
|
|
656
773
|
einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
|
|
657
774
|
}
|
|
658
|
-
export interface
|
|
775
|
+
export interface DeleteResponse {
|
|
659
776
|
credit_note:CreditNote;
|
|
660
|
-
|
|
661
|
-
invoice:Invoice;
|
|
662
777
|
}
|
|
663
|
-
export interface
|
|
778
|
+
export interface DeleteInputParam {
|
|
664
779
|
|
|
665
780
|
/**
|
|
666
|
-
* @description
|
|
781
|
+
* @description Reason for deleting this credit note. This comment will be added to the associated invoice entity.
|
|
667
782
|
|
|
668
783
|
*/
|
|
669
784
|
|
|
670
|
-
|
|
785
|
+
comment?:string;
|
|
786
|
+
}
|
|
787
|
+
export interface RemoveTaxWithheldRefundResponse {
|
|
788
|
+
credit_note:CreditNote;
|
|
789
|
+
}
|
|
790
|
+
export interface RemoveTaxWithheldRefundInputParam {
|
|
671
791
|
|
|
672
792
|
/**
|
|
673
|
-
* @description
|
|
793
|
+
* @description Parameters for tax_withheld
|
|
674
794
|
|
|
675
795
|
*/
|
|
676
796
|
|
|
677
|
-
|
|
797
|
+
tax_withheld?:{id:string};
|
|
798
|
+
}
|
|
799
|
+
export interface ResendEinvoiceResponse {
|
|
800
|
+
credit_note:CreditNote;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export interface SendEinvoiceResponse {
|
|
804
|
+
credit_note:CreditNote;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
export interface ImportCreditNoteResponse {
|
|
808
|
+
credit_note:CreditNote;
|
|
809
|
+
}
|
|
810
|
+
export interface ImportCreditNoteInputParam {
|
|
678
811
|
|
|
679
812
|
/**
|
|
680
|
-
* @description
|
|
813
|
+
* @description Credit Note Number.
|
|
681
814
|
|
|
682
815
|
*/
|
|
683
816
|
|
|
684
|
-
|
|
817
|
+
id:string;
|
|
685
818
|
|
|
686
819
|
/**
|
|
687
|
-
* @description
|
|
820
|
+
* @description This identifies the customer for whom the credit note needs to be created.
|
|
688
821
|
|
|
689
822
|
*/
|
|
690
823
|
|
|
691
|
-
|
|
824
|
+
customer_id?:string;
|
|
692
825
|
|
|
693
826
|
/**
|
|
694
|
-
* @description
|
|
695
|
-
|
|
696
|
-
*/
|
|
697
|
-
|
|
698
|
-
create_reason_code?:string;
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* @description The date the Credit Note is issued.
|
|
702
|
-
|
|
703
|
-
*/
|
|
704
|
-
|
|
705
|
-
date?:number;
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* @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).
|
|
709
|
-
|
|
710
|
-
*/
|
|
711
|
-
|
|
712
|
-
customer_notes?:string;
|
|
713
|
-
|
|
714
|
-
/**
|
|
715
|
-
* @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).
|
|
716
|
-
|
|
717
|
-
*/
|
|
718
|
-
|
|
719
|
-
comment?:string;
|
|
720
|
-
|
|
721
|
-
/**
|
|
722
|
-
* @description Parameters for line_items
|
|
723
|
-
|
|
724
|
-
*/
|
|
725
|
-
|
|
726
|
-
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}[];
|
|
727
|
-
}
|
|
728
|
-
export interface RecordRefundResponse {
|
|
729
|
-
credit_note:CreditNote;
|
|
730
|
-
|
|
731
|
-
transaction?:Transaction;
|
|
732
|
-
}
|
|
733
|
-
export interface RecordRefundInputParam {
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* @description Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Credit Notes \> Refund Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
737
|
-
|
|
738
|
-
*/
|
|
739
|
-
|
|
740
|
-
refund_reason_code?:string;
|
|
741
|
-
|
|
742
|
-
/**
|
|
743
|
-
* @description Remarks, if any, on the refund.
|
|
744
|
-
|
|
745
|
-
*/
|
|
746
|
-
|
|
747
|
-
comment?:string;
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* @description Parameters for transaction
|
|
751
|
-
|
|
752
|
-
*/
|
|
753
|
-
|
|
754
|
-
transaction?:{amount?:number,date:number,payment_method:PaymentMethod,reference_number?:string};
|
|
755
|
-
}
|
|
756
|
-
export interface ImportCreditNoteResponse {
|
|
757
|
-
credit_note:CreditNote;
|
|
758
|
-
}
|
|
759
|
-
export interface ImportCreditNoteInputParam {
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* @description Credit Note Number.
|
|
763
|
-
|
|
764
|
-
*/
|
|
765
|
-
|
|
766
|
-
id:string;
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* @description This identifies the customer for whom the credit note needs to be created.
|
|
770
|
-
|
|
771
|
-
*/
|
|
772
|
-
|
|
773
|
-
customer_id?:string;
|
|
774
|
-
|
|
775
|
-
/**
|
|
776
|
-
* @description The identifier of the subscription for which this credit note needs to be created.
|
|
827
|
+
* @description The identifier of the subscription for which this credit note needs to be created.
|
|
777
828
|
|
|
778
829
|
*/
|
|
779
830
|
|
|
@@ -917,65 +968,13 @@ Ireland** . The first two characters of the VAT number in such a case is `X
|
|
|
917
968
|
|
|
918
969
|
linked_refunds?:{amount:number,date:number,payment_method:PaymentMethod,reference_number?:string}[];
|
|
919
970
|
}
|
|
920
|
-
export interface DeleteResponse {
|
|
921
|
-
credit_note:CreditNote;
|
|
922
|
-
}
|
|
923
|
-
export interface DeleteInputParam {
|
|
924
|
-
|
|
925
|
-
/**
|
|
926
|
-
* @description Reason for deleting this credit note. This comment will be added to the associated invoice entity.
|
|
927
|
-
|
|
928
|
-
*/
|
|
929
|
-
|
|
930
|
-
comment?:string;
|
|
931
|
-
}
|
|
932
|
-
export interface DownloadEinvoiceResponse {
|
|
933
|
-
downloads:Download[];
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
export interface PdfResponse {
|
|
937
|
-
download:Download;
|
|
938
|
-
}
|
|
939
|
-
export interface PdfInputParam {
|
|
940
|
-
|
|
941
|
-
/**
|
|
942
|
-
* @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
|
|
943
|
-
|
|
944
|
-
*/
|
|
945
|
-
|
|
946
|
-
disposition_type?:DispositionType;
|
|
947
|
-
}
|
|
948
|
-
export interface ResendEinvoiceResponse {
|
|
949
|
-
credit_note:CreditNote;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
export interface RemoveTaxWithheldRefundResponse {
|
|
953
|
-
credit_note:CreditNote;
|
|
954
|
-
}
|
|
955
|
-
export interface RemoveTaxWithheldRefundInputParam {
|
|
956
|
-
|
|
957
|
-
/**
|
|
958
|
-
* @description Parameters for tax_withheld
|
|
959
|
-
|
|
960
|
-
*/
|
|
961
|
-
|
|
962
|
-
tax_withheld?:{id:string};
|
|
963
|
-
}
|
|
964
|
-
export interface RetrieveResponse {
|
|
965
|
-
credit_note:CreditNote;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
export interface SendEinvoiceResponse {
|
|
969
|
-
credit_note:CreditNote;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
971
|
export interface Einvoice {
|
|
973
972
|
/**
|
|
974
973
|
* @description The unique `id` for the e-invoice. This is auto-generated by Chargebee.
|
|
975
974
|
|
|
976
975
|
*/
|
|
977
976
|
|
|
978
|
-
id
|
|
977
|
+
id:string;
|
|
979
978
|
|
|
980
979
|
/**
|
|
981
980
|
* @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.
|
|
@@ -989,7 +988,7 @@ Ireland** . The first two characters of the VAT number in such a case is `X
|
|
|
989
988
|
|
|
990
989
|
*/
|
|
991
990
|
|
|
992
|
-
status
|
|
991
|
+
status:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
|
|
993
992
|
|
|
994
993
|
/**
|
|
995
994
|
* @description Detailed information about the status of the e-invoice. When `status` is `skipped` or `failed`, this contains the reason or error details. The following are some valid examples:
|
|
@@ -1002,165 +1001,542 @@ Ireland** . The first two characters of the VAT number in such a case is `X
|
|
|
1002
1001
|
message?:string;
|
|
1003
1002
|
}
|
|
1004
1003
|
export interface LineItem {
|
|
1004
|
+
/**
|
|
1005
|
+
* @description Uniquely identifies a line_item
|
|
1006
|
+
|
|
1007
|
+
*/
|
|
1008
|
+
|
|
1005
1009
|
id?:string;
|
|
1006
1010
|
|
|
1011
|
+
/**
|
|
1012
|
+
* @description A unique identifier for the subscription this line item belongs to.
|
|
1013
|
+
|
|
1014
|
+
*/
|
|
1015
|
+
|
|
1007
1016
|
subscription_id?:string;
|
|
1008
1017
|
|
|
1009
|
-
|
|
1018
|
+
/**
|
|
1019
|
+
* @description Start date of this line item.
|
|
1020
|
+
|
|
1021
|
+
*/
|
|
1022
|
+
|
|
1023
|
+
date_from:number;
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* @description End date of this line item.
|
|
1027
|
+
|
|
1028
|
+
*/
|
|
1029
|
+
|
|
1030
|
+
date_to:number;
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* @description Unit amount of the line item.
|
|
1034
|
+
|
|
1035
|
+
*/
|
|
1010
1036
|
|
|
1011
|
-
|
|
1037
|
+
unit_amount:number;
|
|
1012
1038
|
|
|
1013
|
-
|
|
1039
|
+
/**
|
|
1040
|
+
* @description [Quantity of the recurring item](/docs/api/invoices?prod_cat_ver=2#invoice_line_items_quantity) which is represented by this line item. For `metered` line items, this value is updated from [usages](/docs/api/usages) once when the invoice is generated as `pending` and finally when the invoice is [closed](/docs/api/invoices#close_a_pending_invoice).
|
|
1041
|
+
|
|
1042
|
+
*/
|
|
1014
1043
|
|
|
1015
1044
|
quantity?:number;
|
|
1016
1045
|
|
|
1046
|
+
/**
|
|
1047
|
+
* @description Total amount of this line item. Typically equals to unit amount x quantity
|
|
1048
|
+
|
|
1049
|
+
*/
|
|
1050
|
+
|
|
1017
1051
|
amount?:number;
|
|
1018
1052
|
|
|
1053
|
+
/**
|
|
1054
|
+
* @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.
|
|
1055
|
+
|
|
1056
|
+
*/
|
|
1057
|
+
|
|
1019
1058
|
pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
|
|
1020
1059
|
|
|
1021
|
-
|
|
1060
|
+
/**
|
|
1061
|
+
* @description Specifies whether this line item is taxed or not
|
|
1062
|
+
|
|
1063
|
+
*/
|
|
1064
|
+
|
|
1065
|
+
is_taxed:boolean;
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* @description The tax amount charged for this item
|
|
1069
|
+
|
|
1070
|
+
*/
|
|
1022
1071
|
|
|
1023
1072
|
tax_amount?:number;
|
|
1024
1073
|
|
|
1074
|
+
/**
|
|
1075
|
+
* @description Rate of tax used to calculate tax for this lineitem
|
|
1076
|
+
|
|
1077
|
+
*/
|
|
1078
|
+
|
|
1025
1079
|
tax_rate?:number;
|
|
1026
1080
|
|
|
1081
|
+
/**
|
|
1082
|
+
* @description The decimal representation of the unit amount of the `line_item`. The value is in major units of the currency. Returned when the `line_item` is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1083
|
+
|
|
1084
|
+
*/
|
|
1085
|
+
|
|
1027
1086
|
unit_amount_in_decimal?:string;
|
|
1028
1087
|
|
|
1088
|
+
/**
|
|
1089
|
+
* @description The decimal representation of the quantity of this line_item. Returned when the `line_item` is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1090
|
+
|
|
1091
|
+
*/
|
|
1092
|
+
|
|
1029
1093
|
quantity_in_decimal?:string;
|
|
1030
1094
|
|
|
1095
|
+
/**
|
|
1096
|
+
* @description The decimal representation of the amount for the `line_item`, in major units of the currency. Typically equals to `unit_amount_in_decimal` x `quantity_in_decimal`. Returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1097
|
+
|
|
1098
|
+
*/
|
|
1099
|
+
|
|
1031
1100
|
amount_in_decimal?:string;
|
|
1032
1101
|
|
|
1102
|
+
/**
|
|
1103
|
+
* @description Total discounts for this line
|
|
1104
|
+
|
|
1105
|
+
*/
|
|
1106
|
+
|
|
1033
1107
|
discount_amount?:number;
|
|
1034
1108
|
|
|
1109
|
+
/**
|
|
1110
|
+
* @description Line Item-level discounts for this line.
|
|
1111
|
+
|
|
1112
|
+
*/
|
|
1113
|
+
|
|
1035
1114
|
item_level_discount_amount?:number;
|
|
1036
1115
|
|
|
1116
|
+
/**
|
|
1117
|
+
* @description Invoice Reference Line Item ID
|
|
1118
|
+
|
|
1119
|
+
*/
|
|
1120
|
+
|
|
1037
1121
|
reference_line_item_id?:string;
|
|
1038
1122
|
|
|
1039
|
-
|
|
1123
|
+
/**
|
|
1124
|
+
* @description Detailed description about this line item.
|
|
1125
|
+
|
|
1126
|
+
*/
|
|
1127
|
+
|
|
1128
|
+
description:string;
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* @description Detailed description about this item.
|
|
1132
|
+
|
|
1133
|
+
*/
|
|
1040
1134
|
|
|
1041
1135
|
entity_description?:string;
|
|
1042
1136
|
|
|
1043
|
-
|
|
1137
|
+
/**
|
|
1138
|
+
* @description Specifies the modelled entity this line item is based on. \* addon - Indicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the [addon](/docs/api/addons#addon_attributes) id \* plan - Indicates that this lineitem is based on 'Plan' entity. The 'entity_id' 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 'entity_id' attribute will be null in this case \* plan_setup - Indicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the [plan](/docs/api/plans#plan_attributes) id
|
|
1139
|
+
|
|
1140
|
+
*/
|
|
1141
|
+
|
|
1142
|
+
entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* @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's region. This is also the reason code when both `billing_address` and `shipping_address` have not been provided for the customer and subscription respectively
|
|
1146
|
+
|
|
1147
|
+
*/
|
|
1044
1148
|
|
|
1045
1149
|
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';
|
|
1046
1150
|
|
|
1151
|
+
/**
|
|
1152
|
+
* @description The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
|
|
1153
|
+
|
|
1154
|
+
*/
|
|
1155
|
+
|
|
1047
1156
|
entity_id?:string;
|
|
1048
1157
|
|
|
1158
|
+
/**
|
|
1159
|
+
* @description A unique identifier for the customer this line item belongs to
|
|
1160
|
+
|
|
1161
|
+
*/
|
|
1162
|
+
|
|
1049
1163
|
customer_id?:string;
|
|
1050
1164
|
}
|
|
1051
1165
|
export interface Discount {
|
|
1052
|
-
|
|
1166
|
+
/**
|
|
1167
|
+
* @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver=2#currencies).
|
|
1168
|
+
|
|
1169
|
+
*/
|
|
1170
|
+
|
|
1171
|
+
amount:number;
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* @description Description for this deduction.
|
|
1175
|
+
|
|
1176
|
+
*/
|
|
1053
1177
|
|
|
1054
1178
|
description?:string;
|
|
1055
1179
|
|
|
1180
|
+
/**
|
|
1181
|
+
* @description The unique id of the line item that this deduction is for. Is required when `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon`.
|
|
1182
|
+
|
|
1183
|
+
*/
|
|
1184
|
+
|
|
1056
1185
|
line_item_id?:string;
|
|
1057
1186
|
|
|
1058
|
-
|
|
1187
|
+
/**
|
|
1188
|
+
* @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 `entity_id` is `null` in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver=2#invoice_adjustment_credit_notes). \* item_level_coupon - The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id`. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to a line item of the invoice. The discount `id` is available as the `entity_id`. \* document_level_coupon - The deduction is due to a coupon applied to the invoice `sub_total`. The coupon id is passed as `entity_id`. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits?prod_cat_ver=2) applied to the invoice. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
|
|
1189
|
+
|
|
1190
|
+
*/
|
|
1191
|
+
|
|
1192
|
+
entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* @description The type of discount that is applied to the line item. Relevant only when `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon`, `document_level_discount`, or `document_level_coupon` \* percentage - when percentage is applied as discount \* fixed_amount - when amount is applied as discount
|
|
1196
|
+
|
|
1197
|
+
*/
|
|
1059
1198
|
|
|
1060
1199
|
discount_type?:'fixed_amount' | 'percentage';
|
|
1061
1200
|
|
|
1201
|
+
/**
|
|
1202
|
+
* @description When the deduction is due to a `coupon` or a [discount](discounts), then this is the `id` of the coupon or discount.
|
|
1203
|
+
|
|
1204
|
+
*/
|
|
1205
|
+
|
|
1062
1206
|
entity_id?:string;
|
|
1063
1207
|
|
|
1208
|
+
/**
|
|
1209
|
+
* @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 `entity_id`.
|
|
1210
|
+
|
|
1211
|
+
*/
|
|
1212
|
+
|
|
1064
1213
|
coupon_set_code?:string;
|
|
1065
1214
|
}
|
|
1066
1215
|
export interface LineItemDiscount {
|
|
1067
|
-
|
|
1216
|
+
/**
|
|
1217
|
+
* @description The unique id of the line item that this deduction is for.
|
|
1218
|
+
|
|
1219
|
+
*/
|
|
1220
|
+
|
|
1221
|
+
line_item_id:string;
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* @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 `entity_id` is `null` in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver=2#invoice_adjustment_credit_notes). \* document_level_coupon - The deduction is due to a coupon applied to the invoice `sub_total`. The coupon `id` is available as `entity_id`. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice. The `entity_id` is `null` in this case. \* item_level_coupon - The deduction is due to a coupon applied to a line item of the invoice. The coupon `id` is available as `entity_id`. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to a line item of the invoice. The discount `id` is available as the `entity_id`.
|
|
1225
|
+
|
|
1226
|
+
*/
|
|
1068
1227
|
|
|
1069
|
-
discount_type
|
|
1228
|
+
discount_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
1070
1229
|
|
|
1071
1230
|
coupon_id?:string;
|
|
1072
1231
|
|
|
1232
|
+
/**
|
|
1233
|
+
* @description When the deduction is due to a `coupon` or a [discount](discounts), then this is the `id` of the coupon or discount.
|
|
1234
|
+
|
|
1235
|
+
*/
|
|
1236
|
+
|
|
1073
1237
|
entity_id?:string;
|
|
1074
1238
|
|
|
1075
|
-
|
|
1239
|
+
/**
|
|
1240
|
+
* @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
1241
|
+
|
|
1242
|
+
*/
|
|
1243
|
+
|
|
1244
|
+
discount_amount:number;
|
|
1076
1245
|
}
|
|
1077
1246
|
export interface LineItemTier {
|
|
1247
|
+
/**
|
|
1248
|
+
* @description Uniquely identifies a line_item
|
|
1249
|
+
|
|
1250
|
+
*/
|
|
1251
|
+
|
|
1078
1252
|
line_item_id?:string;
|
|
1079
1253
|
|
|
1080
|
-
|
|
1254
|
+
/**
|
|
1255
|
+
* @description The lower limit of a range of units for the tier
|
|
1256
|
+
|
|
1257
|
+
*/
|
|
1258
|
+
|
|
1259
|
+
starting_unit:number;
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* @description The upper limit of a range of units for the tier
|
|
1263
|
+
|
|
1264
|
+
*/
|
|
1081
1265
|
|
|
1082
1266
|
ending_unit?:number;
|
|
1083
1267
|
|
|
1084
|
-
|
|
1268
|
+
/**
|
|
1269
|
+
* @description The number of units purchased in a range.
|
|
1270
|
+
|
|
1271
|
+
*/
|
|
1272
|
+
|
|
1273
|
+
quantity_used:number;
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* @description The price of the tier if the charge model is a `stairtstep` pricing , or the price of each unit in the tier if the charge model is `tiered`/`volume` pricing.
|
|
1277
|
+
|
|
1278
|
+
*/
|
|
1279
|
+
|
|
1280
|
+
unit_amount:number;
|
|
1085
1281
|
|
|
1086
|
-
|
|
1282
|
+
/**
|
|
1283
|
+
* @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 `ending_unit_in_decimal` of the next lower tier. Returned only when the `line_items.pricing_model` is `tiered`, `volume` or `stairstep` and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1284
|
+
|
|
1285
|
+
*/
|
|
1087
1286
|
|
|
1088
1287
|
starting_unit_in_decimal?:string;
|
|
1089
1288
|
|
|
1289
|
+
/**
|
|
1290
|
+
* @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 `starting_unit_in_decimal` of the next higher tier. Returned only when the `line_items.pricing_model` is `tiered`, `volume` or stairstep and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1291
|
+
|
|
1292
|
+
*/
|
|
1293
|
+
|
|
1090
1294
|
ending_unit_in_decimal?:string;
|
|
1091
1295
|
|
|
1296
|
+
/**
|
|
1297
|
+
* @description The decimal representation of the quantity purchased from this tier. Returned when the `line_item` is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1298
|
+
|
|
1299
|
+
*/
|
|
1300
|
+
|
|
1092
1301
|
quantity_used_in_decimal?:string;
|
|
1093
1302
|
|
|
1303
|
+
/**
|
|
1304
|
+
* @description The decimal representation of the per-unit price for the tier when the `pricing_model` is `tiered` or `volume`. When the `pricing_model` is `stairstep`, it is the decimal representation of the total price for `line_item`. The value is in major units of the currency. Returned when the `line_item` is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
1305
|
+
|
|
1306
|
+
*/
|
|
1307
|
+
|
|
1094
1308
|
unit_amount_in_decimal?:string;
|
|
1095
1309
|
}
|
|
1096
1310
|
export interface Tax {
|
|
1097
|
-
|
|
1311
|
+
/**
|
|
1312
|
+
* @description The name of the tax applied. E.g. GST.
|
|
1313
|
+
|
|
1314
|
+
*/
|
|
1098
1315
|
|
|
1099
|
-
|
|
1316
|
+
name:string;
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* @description The tax amount.
|
|
1320
|
+
|
|
1321
|
+
*/
|
|
1322
|
+
|
|
1323
|
+
amount:number;
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* @description Description of the tax item.
|
|
1327
|
+
|
|
1328
|
+
*/
|
|
1100
1329
|
|
|
1101
1330
|
description?:string;
|
|
1102
1331
|
}
|
|
1103
1332
|
export interface LineItemTax {
|
|
1333
|
+
/**
|
|
1334
|
+
* @description The unique reference id of the line item for which the tax is applicable
|
|
1335
|
+
|
|
1336
|
+
*/
|
|
1337
|
+
|
|
1104
1338
|
line_item_id?:string;
|
|
1105
1339
|
|
|
1106
|
-
|
|
1340
|
+
/**
|
|
1341
|
+
* @description The name of the tax applied
|
|
1342
|
+
|
|
1343
|
+
*/
|
|
1344
|
+
|
|
1345
|
+
tax_name:string;
|
|
1107
1346
|
|
|
1108
|
-
|
|
1347
|
+
/**
|
|
1348
|
+
* @description The rate of tax used to calculate tax amount
|
|
1349
|
+
|
|
1350
|
+
*/
|
|
1351
|
+
|
|
1352
|
+
tax_rate:number;
|
|
1353
|
+
|
|
1354
|
+
/**
|
|
1355
|
+
* @description Indicates if tax is applied only on a portion of the line item amount.
|
|
1356
|
+
|
|
1357
|
+
*/
|
|
1109
1358
|
|
|
1110
1359
|
is_partial_tax_applied?:boolean;
|
|
1111
1360
|
|
|
1361
|
+
/**
|
|
1362
|
+
* @description Indicates the non-compliance tax that should not be reported to the jurisdiction.
|
|
1363
|
+
|
|
1364
|
+
*/
|
|
1365
|
+
|
|
1112
1366
|
is_non_compliance_tax?:boolean;
|
|
1113
1367
|
|
|
1114
|
-
|
|
1368
|
+
/**
|
|
1369
|
+
* @description Indicates the actual portion of the line item amount that is taxable.
|
|
1370
|
+
|
|
1371
|
+
*/
|
|
1372
|
+
|
|
1373
|
+
taxable_amount:number;
|
|
1115
1374
|
|
|
1116
|
-
|
|
1375
|
+
/**
|
|
1376
|
+
* @description The tax amount
|
|
1377
|
+
|
|
1378
|
+
*/
|
|
1379
|
+
|
|
1380
|
+
tax_amount:number;
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* @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.
|
|
1384
|
+
|
|
1385
|
+
*/
|
|
1117
1386
|
|
|
1118
1387
|
tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
|
|
1119
1388
|
|
|
1389
|
+
/**
|
|
1390
|
+
* @description The name of the tax jurisdiction
|
|
1391
|
+
|
|
1392
|
+
*/
|
|
1393
|
+
|
|
1120
1394
|
tax_juris_name?:string;
|
|
1121
1395
|
|
|
1396
|
+
/**
|
|
1397
|
+
* @description The tax jurisdiction code
|
|
1398
|
+
|
|
1399
|
+
*/
|
|
1400
|
+
|
|
1122
1401
|
tax_juris_code?:string;
|
|
1123
1402
|
|
|
1403
|
+
/**
|
|
1404
|
+
* @description Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
|
|
1405
|
+
|
|
1406
|
+
*/
|
|
1407
|
+
|
|
1124
1408
|
tax_amount_in_local_currency?:number;
|
|
1125
1409
|
|
|
1410
|
+
/**
|
|
1411
|
+
* @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.
|
|
1412
|
+
|
|
1413
|
+
*/
|
|
1414
|
+
|
|
1126
1415
|
local_currency_code?:string;
|
|
1127
1416
|
}
|
|
1128
1417
|
export interface CreditNoteTransaction {
|
|
1129
|
-
|
|
1418
|
+
/**
|
|
1419
|
+
* @description Uniquely identifies the transaction.
|
|
1420
|
+
|
|
1421
|
+
*/
|
|
1422
|
+
|
|
1423
|
+
txn_id:string;
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* @description The transaction amount applied to this invoice
|
|
1427
|
+
|
|
1428
|
+
*/
|
|
1130
1429
|
|
|
1131
|
-
applied_amount
|
|
1430
|
+
applied_amount:number;
|
|
1132
1431
|
|
|
1133
|
-
|
|
1432
|
+
/**
|
|
1433
|
+
* @description Time when the transaction amount applied to this invoice.
|
|
1434
|
+
|
|
1435
|
+
*/
|
|
1436
|
+
|
|
1437
|
+
applied_at:number;
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* @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 'error_code' and 'error_text' 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.
|
|
1441
|
+
|
|
1442
|
+
*/
|
|
1134
1443
|
|
|
1135
1444
|
txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
|
|
1136
1445
|
|
|
1446
|
+
/**
|
|
1447
|
+
* @description Indicates when this transaction occurred.
|
|
1448
|
+
|
|
1449
|
+
*/
|
|
1450
|
+
|
|
1137
1451
|
txn_date?:number;
|
|
1138
1452
|
|
|
1453
|
+
/**
|
|
1454
|
+
* @description Total amount of the transaction
|
|
1455
|
+
|
|
1456
|
+
*/
|
|
1457
|
+
|
|
1139
1458
|
txn_amount?:number;
|
|
1140
1459
|
|
|
1460
|
+
/**
|
|
1461
|
+
* @description Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Credit Notes \> Refund Credit Note**. Must be passed if set as mandatory in the app. The codes are case-sensitive
|
|
1462
|
+
|
|
1463
|
+
*/
|
|
1464
|
+
|
|
1141
1465
|
refund_reason_code?:string;
|
|
1142
1466
|
}
|
|
1143
1467
|
export interface LinkedTaxWithheldRefund {
|
|
1144
|
-
|
|
1468
|
+
/**
|
|
1469
|
+
* @description An auto-generated unique identifier for the tax withheld. The value starts with the prefix `tax_wh_`. For example, `tax_wh_16BdDXSlbu4uV1Ee6`.
|
|
1470
|
+
|
|
1471
|
+
*/
|
|
1472
|
+
|
|
1473
|
+
id:string;
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* @description The amount withheld by the customer as tax from the invoice. The unit depends on the [type of currency](/docs/api#md_disabled).
|
|
1477
|
+
|
|
1478
|
+
*/
|
|
1145
1479
|
|
|
1146
1480
|
amount?:number;
|
|
1147
1481
|
|
|
1482
|
+
/**
|
|
1483
|
+
* @description The description for this tax withheld.
|
|
1484
|
+
|
|
1485
|
+
*/
|
|
1486
|
+
|
|
1148
1487
|
description?:string;
|
|
1149
1488
|
|
|
1489
|
+
/**
|
|
1490
|
+
* @description Date or time associated with the tax withheld.
|
|
1491
|
+
|
|
1492
|
+
*/
|
|
1493
|
+
|
|
1150
1494
|
date?:number;
|
|
1151
1495
|
|
|
1496
|
+
/**
|
|
1497
|
+
* @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.
|
|
1498
|
+
|
|
1499
|
+
*/
|
|
1500
|
+
|
|
1152
1501
|
reference_number?:string;
|
|
1153
1502
|
}
|
|
1154
1503
|
export interface AppliedCredit {
|
|
1155
|
-
|
|
1504
|
+
/**
|
|
1505
|
+
* @description Unique identifier of the invoice.
|
|
1506
|
+
|
|
1507
|
+
*/
|
|
1508
|
+
|
|
1509
|
+
invoice_id:string;
|
|
1156
1510
|
|
|
1157
|
-
|
|
1511
|
+
/**
|
|
1512
|
+
* @description Amount of this refund transaction.
|
|
1513
|
+
|
|
1514
|
+
*/
|
|
1158
1515
|
|
|
1159
|
-
|
|
1516
|
+
allocated_amount:number;
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* @description Indicates when this refund occured.
|
|
1520
|
+
|
|
1521
|
+
*/
|
|
1522
|
+
|
|
1523
|
+
allocated_at:number;
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* @description Closing date of the invoice. Typically this is the date on which invoice is generated
|
|
1527
|
+
|
|
1528
|
+
*/
|
|
1160
1529
|
|
|
1161
1530
|
invoice_date?:number;
|
|
1162
1531
|
|
|
1163
|
-
|
|
1532
|
+
/**
|
|
1533
|
+
* @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 -
|
|
1534
|
+
The [invoice](/docs/api/invoices?prod_cat_ver=2#invoice_status) is yet to be closed (sent for payment collection). An invoice is generated with this `status` when it has line items that belong to items that are `metered` or when the `subscription.create_pending_invoices`attribute is set to `true`.
|
|
1535
|
+
The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to be closed (sent for payment collection). All invoices are generated with this `status` when [Metered Billing](https://www.chargebee.com/docs/1.0/metered_billing.html) is enabled for the site. \* payment_due - Indicates the payment is not yet collected and is being retried as per retry settings.
|
|
1536
|
+
|
|
1537
|
+
*/
|
|
1538
|
+
|
|
1539
|
+
invoice_status:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
|
|
1164
1540
|
}
|
|
1165
1541
|
export interface ShippingAddress {
|
|
1166
1542
|
/**
|
|
@@ -1273,7 +1649,7 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
|
|
|
1273
1649
|
|
|
1274
1650
|
*/
|
|
1275
1651
|
|
|
1276
|
-
index
|
|
1652
|
+
index:number;
|
|
1277
1653
|
}
|
|
1278
1654
|
export interface BillingAddress {
|
|
1279
1655
|
/**
|