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
|
@@ -447,6 +447,8 @@ In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](m
|
|
|
447
447
|
|
|
448
448
|
shipping_address?:Invoice.ShippingAddress;
|
|
449
449
|
|
|
450
|
+
statement_descriptor?:Invoice.StatementDescriptor;
|
|
451
|
+
|
|
450
452
|
/**
|
|
451
453
|
* @description Billing address for the invoice.
|
|
452
454
|
|
|
@@ -471,34 +473,25 @@ In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](m
|
|
|
471
473
|
export namespace Invoice {
|
|
472
474
|
export class InvoiceResource {
|
|
473
475
|
/**
|
|
474
|
-
* @description
|
|
475
|
-
|
|
476
|
-
*/
|
|
477
|
-
|
|
478
|
-
delete_line_items(invoice_id:string, input?:DeleteLineItemsInputParam):ChargebeeRequest<DeleteLineItemsResponse>;
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* @description This API removes a credit note attached to an invoice. When you remove a credit note from an invoice, the invoice status returns to `not_paid`.
|
|
482
|
-
|
|
483
|
-
**Note:** You cannot remove a credit note from an invoice if it has already been refunded.
|
|
476
|
+
* @description Creates an invoice for [charge-items](./items?prod_cat_ver=2) and [one-time charges](https://www.chargebee.com/docs/2.0/charges.html). The item prices must belong to items of `type` `charge`.
|
|
484
477
|
|
|
485
478
|
*/
|
|
486
479
|
|
|
487
|
-
|
|
480
|
+
create_for_charge_items_and_charges(input?:CreateForChargeItemsAndChargesInputParam):ChargebeeRequest<CreateForChargeItemsAndChargesResponse>;
|
|
488
481
|
|
|
489
482
|
/**
|
|
490
|
-
* @description This API
|
|
483
|
+
* @description This API is used to stop dunning for "Payment Due" invoices that have been enabled for Auto Collection. When dunning is stopped, the status of the invoice will be changed to "Not Paid".
|
|
491
484
|
|
|
492
485
|
*/
|
|
493
486
|
|
|
494
|
-
|
|
487
|
+
stop_dunning(invoice_id:string, input?:StopDunningInputParam):ChargebeeRequest<StopDunningResponse>;
|
|
495
488
|
|
|
496
489
|
/**
|
|
497
|
-
* @description
|
|
490
|
+
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
498
491
|
|
|
499
492
|
*/
|
|
500
493
|
|
|
501
|
-
|
|
494
|
+
import_invoice(input:ImportInvoiceInputParam):ChargebeeRequest<ImportInvoiceResponse>;
|
|
502
495
|
|
|
503
496
|
/**
|
|
504
497
|
* @description The API applies [excess payments](https://apidocs.chargebee.com/docs/api/customers#customer_excess_payments) to an invoice. Once an excess payment is applied, the [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice `status` changes to either `paid` or `payment_due` depending on how much excess payment is applied to the invoice amount.
|
|
@@ -510,137 +503,117 @@ For example, if you have an excess payment of $25.00, and the invoice to which y
|
|
|
510
503
|
apply_payments(invoice_id:string, input?:ApplyPaymentsInputParam):ChargebeeRequest<ApplyPaymentsResponse>;
|
|
511
504
|
|
|
512
505
|
/**
|
|
513
|
-
* @description
|
|
514
|
-
|
|
515
|
-
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
516
|
-
* If an invoice for the current term of a subscription is voided and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
517
|
-
* Any [usages](/docs/api/usages?prod_cat_ver=2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the `invoice_id` field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver=2#retrieve_usages_for_an_invoice_as_pdf) is generated and saved to the invoice as an [attachment](https://www.chargebee.com/docs/2.0/file-attachment.html).
|
|
506
|
+
* @description Updates the [`quantity`](/docs/api/invoices#invoice_line_items_quantity) for `metered` [`line_items`](/docs/api/invoices#invoice_line_items) of an invoice to reflect the latest [usage](https://apidocs.chargebee.com/docs/api/usages) data.
|
|
518
507
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
void_invoice(invoice_id:string, input?:VoidInvoiceInputParam):ChargebeeRequest<VoidInvoiceResponse>;
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* @description Adds a one-time charge to a [pending](https://apidocs.chargebee.com/docs/api/invoices#invoice_status) invoice. A one-time charge is a charge that is added ad hoc to the invoice and does not represent a predefined [item price](https:/apidocs.chargebee.com/docs/api/item_prices). It appears in the invoice as a [line_item](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items) of [entity_type](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items_entity_type) `adhoc`.
|
|
508
|
+
**Note:** This operation is done automatically while [closing](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice) the invoice.
|
|
525
509
|
|
|
526
510
|
*/
|
|
527
511
|
|
|
528
|
-
|
|
512
|
+
sync_usages(invoice_id:string):ChargebeeRequest<SyncUsagesResponse>;
|
|
529
513
|
|
|
530
514
|
/**
|
|
531
|
-
* @description This endpoint is used to
|
|
532
|
-
|
|
533
|
-
To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
|
|
534
|
-
|
|
535
|
-
This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
|
|
536
|
-
|
|
537
|
-
* If e-invoicing is not enabled at the site and customer level.
|
|
538
|
-
|
|
539
|
-
* If there is an e-invoice generated already for the invoice.
|
|
540
|
-
|
|
541
|
-
* If the "**Use automatic e-invoicing**" option is selected.
|
|
542
|
-
|
|
543
|
-
* If there are no generated e-invoices with the `failed` or `skipped` status.
|
|
544
|
-
|
|
545
|
-
* If the invoice status is `voided` or `pending`.
|
|
546
|
-
|
|
515
|
+
* @description This endpoint is used to delete line items from "Pending" invoice.
|
|
547
516
|
|
|
548
517
|
*/
|
|
549
518
|
|
|
550
|
-
|
|
519
|
+
delete_line_items(invoice_id:string, input?:DeleteLineItemsInputParam):ChargebeeRequest<DeleteLineItemsResponse>;
|
|
551
520
|
|
|
552
521
|
/**
|
|
553
|
-
* @description This API
|
|
522
|
+
* @description This API applies [available credits](customers#customer_balances) to an invoice. After credits are applied, [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice status changes to either `paid` or `payment_due` depending on how much credit is applied to the invoice amount.
|
|
554
523
|
|
|
555
524
|
*/
|
|
556
525
|
|
|
557
|
-
|
|
526
|
+
apply_credits(invoice_id:string, input?:ApplyCreditsInputParam):ChargebeeRequest<ApplyCreditsResponse>;
|
|
558
527
|
|
|
559
528
|
/**
|
|
560
|
-
* @description
|
|
529
|
+
* @description Lists all the Invoices.
|
|
561
530
|
|
|
562
531
|
*/
|
|
563
532
|
|
|
564
|
-
|
|
533
|
+
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
565
534
|
|
|
566
535
|
/**
|
|
567
|
-
* @description
|
|
536
|
+
* @description Retrieve the invoice for the specified invoice id.
|
|
568
537
|
|
|
569
538
|
*/
|
|
570
539
|
|
|
571
|
-
|
|
540
|
+
retrieve(invoice_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
572
541
|
|
|
573
542
|
/**
|
|
574
|
-
* @description
|
|
543
|
+
* @description Gets the invoice as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
|
|
575
544
|
|
|
576
|
-
####
|
|
545
|
+
#### Related Tutorial
|
|
577
546
|
|
|
578
|
-
|
|
547
|
+
* [Check out customer portal tutorial on how to download invoice as PDF.](//www.chargebee.com/tutorials/customer-portal-sample.html#downloading_invoices_as_pdf)
|
|
579
548
|
|
|
580
549
|
*/
|
|
581
550
|
|
|
582
|
-
|
|
551
|
+
pdf(invoice_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
|
|
583
552
|
|
|
584
553
|
/**
|
|
585
|
-
* @description
|
|
554
|
+
* @description Download the e-invoice in both XML and PDF formats. The response consists of a `download` object for each format. The XML format follows the [structure as per Peppol BIS Billing v3.0](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/tree/).
|
|
555
|
+
**Note**
|
|
556
|
+
|
|
557
|
+
* You can only download e-invoices when their `status` is `success`.
|
|
558
|
+
* There are some cases in which the PDF is not available for download. In such cases, you can obtain it from the XML by decoding the value for [cbc:EmbeddedDocumentBinaryObject](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cac-Attachment/cbc-EmbeddedDocumentBinaryObject/), which is the Base64-encoded version of the PDF.
|
|
586
559
|
|
|
587
560
|
*/
|
|
588
561
|
|
|
589
|
-
|
|
562
|
+
download_einvoice(invoice_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
|
|
590
563
|
|
|
591
564
|
/**
|
|
592
|
-
* @description
|
|
565
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
593
566
|
|
|
594
567
|
*/
|
|
595
568
|
|
|
596
|
-
|
|
569
|
+
list_payment_reference_numbers(input?:ListPaymentReferenceNumbersInputParam):ChargebeeRequest<ListPaymentReferenceNumbersResponse>;
|
|
597
570
|
|
|
598
571
|
/**
|
|
599
|
-
* @description
|
|
572
|
+
* @description Adds a one-time charge to a [pending](https://apidocs.chargebee.com/docs/api/invoices#invoice_status) invoice. A one-time charge is a charge that is added ad hoc to the invoice and does not represent a predefined [item price](https:/apidocs.chargebee.com/docs/api/item_prices). It appears in the invoice as a [line_item](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items) of [entity_type](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items_entity_type) `adhoc`.
|
|
600
573
|
|
|
601
574
|
*/
|
|
602
575
|
|
|
603
|
-
|
|
576
|
+
add_charge(invoice_id:string, input:AddChargeInputParam):ChargebeeRequest<AddChargeResponse>;
|
|
604
577
|
|
|
605
578
|
/**
|
|
606
|
-
* @description This
|
|
607
|
-
|
|
608
|
-
**Note:** Incase, tax is already applied will now vary due to address change, you cannot update the address. You cannot update the VAT Number if the billing address is not present in the API request.This will update the invoice only, it won't change the corresponding customer/subscription details.
|
|
579
|
+
* @description This endpoint is used when [metered billing](https://www.chargebee.com/docs/2.0/metered_billing.html) is enabled and it adds a [charge-item price](./item_prices?prod_cat_ver=2) to a `pending` invoice. To collect the accumulated charges by closing the invoice, call [Close a pending invoice](./invoices?prod_cat_ver=2#close_a_pending_invoice).
|
|
609
580
|
|
|
610
581
|
*/
|
|
611
582
|
|
|
612
|
-
|
|
583
|
+
add_charge_item(invoice_id:string, input?:AddChargeItemInputParam):ChargebeeRequest<AddChargeItemResponse>;
|
|
613
584
|
|
|
614
585
|
/**
|
|
615
|
-
* @description
|
|
586
|
+
* @description Invoices for a subscription are created with a `pending` `status` when the subscription has `create_pending_invoices` attribute set to `true`. This API call finalizes a `pending` invoice. Any `refundable_credits` and `excess_payments` for the customer are applied to the invoice, and any payment due is collected automatically if `auto_collection` is `on` for the customer.
|
|
616
587
|
|
|
617
|
-
|
|
588
|
+
#### Automation
|
|
618
589
|
|
|
619
|
-
|
|
590
|
+
This operation can be automated by using a [site setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing). Moreover, the automation can be overridden at the [customer](/docs/api/customers?prod_cat_ver=2#customer_auto_close_invoices) and [subscription](/docs/api/subscriptions?prod_cat_ver=2#subscription_auto_close_invoices) level.
|
|
620
591
|
|
|
621
592
|
*/
|
|
622
593
|
|
|
623
|
-
|
|
594
|
+
close(invoice_id:string, input?:CloseInputParam):ChargebeeRequest<CloseResponse>;
|
|
624
595
|
|
|
625
596
|
/**
|
|
626
|
-
* @description
|
|
627
|
-
**Caution**
|
|
597
|
+
* @description Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
|
|
628
598
|
|
|
629
|
-
|
|
599
|
+
This API is used to collect payments for `payment_due` and `not_paid` invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
|
|
630
600
|
|
|
631
|
-
|
|
632
|
-
* If an invoice for the current term of a subscription is deleted and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
601
|
+
Pass `authorization_transaction_id` to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as `payment_due`.
|
|
633
602
|
|
|
634
603
|
*/
|
|
635
604
|
|
|
636
|
-
|
|
605
|
+
collect_payment(invoice_id:string, input?:CollectPaymentInputParam):ChargebeeRequest<CollectPaymentResponse>;
|
|
637
606
|
|
|
638
607
|
/**
|
|
639
|
-
* @description
|
|
608
|
+
* @description To record a [offline payment](https://www.chargebee.com/docs/offline_payments.html) for an invoice.
|
|
609
|
+
|
|
610
|
+
The invoice status will be marked as 'paid' if its amount due becomes 0 because of this recorded payment.
|
|
611
|
+
|
|
612
|
+
**Note:** If the payment transaction amount is more than the invoice due amount, the remaining transaction amount will be added to the customer's Excess Payments balance to be used against other invoices.
|
|
640
613
|
|
|
641
614
|
*/
|
|
642
615
|
|
|
643
|
-
|
|
616
|
+
record_payment(invoice_id:string, input?:RecordPaymentInputParam):ChargebeeRequest<RecordPaymentResponse>;
|
|
644
617
|
|
|
645
618
|
/**
|
|
646
619
|
* @description Records [tax_withheld](/docs/api/tax_withheld) by the customer against the invoice specified. This operation is allowed only when all of the following conditions are true:
|
|
@@ -654,13 +627,6 @@ All associated [usages](/docs/api/usages?prod_cat_ver=2) are permanently de
|
|
|
654
627
|
|
|
655
628
|
record_tax_withheld(invoice_id:string, input?:RecordTaxWithheldInputParam):ChargebeeRequest<RecordTaxWithheldResponse>;
|
|
656
629
|
|
|
657
|
-
/**
|
|
658
|
-
* @description Resend failed einvoice of an invoice to the customer using this API.
|
|
659
|
-
|
|
660
|
-
*/
|
|
661
|
-
|
|
662
|
-
resend_einvoice(invoice_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
|
|
663
|
-
|
|
664
630
|
/**
|
|
665
631
|
* @description Removes a [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld) record from the `invoice` specified. This operation is allowed only when all of the following conditions are true:
|
|
666
632
|
|
|
@@ -672,33 +638,6 @@ All associated [usages](/docs/api/usages?prod_cat_ver=2) are permanently de
|
|
|
672
638
|
|
|
673
639
|
remove_tax_withheld(invoice_id:string, input?:RemoveTaxWithheldInputParam):ChargebeeRequest<RemoveTaxWithheldResponse>;
|
|
674
640
|
|
|
675
|
-
/**
|
|
676
|
-
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
677
|
-
|
|
678
|
-
*/
|
|
679
|
-
|
|
680
|
-
list_payment_reference_numbers(input?:ListPaymentReferenceNumbersInputParam):ChargebeeRequest<ListPaymentReferenceNumbersResponse>;
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* @description Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
|
|
684
|
-
|
|
685
|
-
This API is used to collect payments for `payment_due` and `not_paid` invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
|
|
686
|
-
|
|
687
|
-
Pass `authorization_transaction_id` to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as `payment_due`.
|
|
688
|
-
|
|
689
|
-
*/
|
|
690
|
-
|
|
691
|
-
collect_payment(invoice_id:string, input?:CollectPaymentInputParam):ChargebeeRequest<CollectPaymentResponse>;
|
|
692
|
-
|
|
693
|
-
/**
|
|
694
|
-
* @description Updates the [`quantity`](/docs/api/invoices#invoice_line_items_quantity) for `metered` [`line_items`](/docs/api/invoices#invoice_line_items) of an invoice to reflect the latest [usage](https://apidocs.chargebee.com/docs/api/usages) data.
|
|
695
|
-
|
|
696
|
-
**Note:** This operation is done automatically while [closing](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice) the invoice.
|
|
697
|
-
|
|
698
|
-
*/
|
|
699
|
-
|
|
700
|
-
sync_usages(invoice_id:string):ChargebeeRequest<SyncUsagesResponse>;
|
|
701
|
-
|
|
702
641
|
/**
|
|
703
642
|
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
704
643
|
|
|
@@ -742,1111 +681,1078 @@ If the order of precendence described above does not work for your use case, and
|
|
|
742
681
|
record_refund(invoice_id:string, input?:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
|
|
743
682
|
|
|
744
683
|
/**
|
|
745
|
-
* @description
|
|
746
|
-
|
|
747
|
-
#### Related Tutorial
|
|
748
|
-
|
|
749
|
-
* [Check out customer portal tutorial on how to download invoice as PDF.](//www.chargebee.com/tutorials/customer-portal-sample.html#downloading_invoices_as_pdf)
|
|
684
|
+
* @description This API [removes payments](https://www.chargebee.com/docs/2.0/invoice-operations.html#actions-for-paid-invoices_remove-payment) applied to an invoice. Once the applied payment is removed, the invoice status returns to `not_paid` or `payment_due`. The removed payment is then added to the customer's excess payment balance.
|
|
750
685
|
|
|
751
686
|
*/
|
|
752
687
|
|
|
753
|
-
|
|
688
|
+
remove_payment(invoice_id:string, input?:RemovePaymentInputParam):ChargebeeRequest<RemovePaymentResponse>;
|
|
754
689
|
|
|
755
690
|
/**
|
|
756
|
-
* @description
|
|
757
|
-
**Note**
|
|
691
|
+
* @description This API removes a credit note attached to an invoice. When you remove a credit note from an invoice, the invoice status returns to `not_paid`.
|
|
758
692
|
|
|
759
|
-
|
|
760
|
-
* There are some cases in which the PDF is not available for download. In such cases, you can obtain it from the XML by decoding the value for [cbc:EmbeddedDocumentBinaryObject](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cac-Attachment/cbc-EmbeddedDocumentBinaryObject/), which is the Base64-encoded version of the PDF.
|
|
693
|
+
**Note:** You cannot remove a credit note from an invoice if it has already been refunded.
|
|
761
694
|
|
|
762
695
|
*/
|
|
763
696
|
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
export interface DeleteLineItemsResponse {
|
|
767
|
-
invoice:Invoice;
|
|
768
|
-
}
|
|
769
|
-
export interface DeleteLineItemsInputParam {
|
|
697
|
+
remove_credit_note(invoice_id:string, input?:RemoveCreditNoteInputParam):ChargebeeRequest<RemoveCreditNoteResponse>;
|
|
770
698
|
|
|
771
699
|
/**
|
|
772
|
-
* @description
|
|
700
|
+
* @description Voids the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before voiding it.
|
|
701
|
+
|
|
702
|
+
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
703
|
+
* If an invoice for the current term of a subscription is voided and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
704
|
+
* Any [usages](/docs/api/usages?prod_cat_ver=2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the `invoice_id` field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver=2#retrieve_usages_for_an_invoice_as_pdf) is generated and saved to the invoice as an [attachment](https://www.chargebee.com/docs/2.0/file-attachment.html).
|
|
773
705
|
|
|
774
706
|
*/
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
}
|
|
778
|
-
export interface RemoveCreditNoteResponse {
|
|
779
|
-
invoice:Invoice;
|
|
780
|
-
|
|
781
|
-
credit_note:CreditNote;
|
|
782
|
-
}
|
|
783
|
-
export interface RemoveCreditNoteInputParam {
|
|
707
|
+
|
|
708
|
+
void_invoice(invoice_id:string, input?:VoidInvoiceInputParam):ChargebeeRequest<VoidInvoiceResponse>;
|
|
784
709
|
|
|
785
710
|
/**
|
|
786
|
-
* @description
|
|
711
|
+
* @description This API writes off an Invoice.
|
|
787
712
|
|
|
788
713
|
*/
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
}
|
|
792
|
-
export interface RemovePaymentResponse {
|
|
793
|
-
invoice:Invoice;
|
|
794
|
-
|
|
795
|
-
transaction:Transaction;
|
|
796
|
-
}
|
|
797
|
-
export interface RemovePaymentInputParam {
|
|
714
|
+
|
|
715
|
+
write_off(invoice_id:string, input?:WriteOffInputParam):ChargebeeRequest<WriteOffResponse>;
|
|
798
716
|
|
|
799
717
|
/**
|
|
800
|
-
* @description
|
|
718
|
+
* @description Deletes the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before deleting it.
|
|
719
|
+
**Caution**
|
|
720
|
+
|
|
721
|
+
All associated [usages](/docs/api/usages?prod_cat_ver=2) are permanently deleted on deleting an invoice. If you want to regenerate such an invoice, [add](/docs/api/usages?prod_cat_ver=2#create_a_usage) or [bulk import](https://www.chargebee.com/docs/2.0/bulk-operations.html#overview_available-bulk-operations) usages before invoice regeneration.
|
|
722
|
+
|
|
723
|
+
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
724
|
+
* If an invoice for the current term of a subscription is deleted and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
801
725
|
|
|
802
726
|
*/
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}
|
|
806
|
-
export interface StopDunningResponse {
|
|
807
|
-
invoice:Invoice;
|
|
808
|
-
}
|
|
809
|
-
export interface StopDunningInputParam {
|
|
727
|
+
|
|
728
|
+
delete(invoice_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
|
|
810
729
|
|
|
811
730
|
/**
|
|
812
|
-
* @description
|
|
731
|
+
* @description This API allows you to update the invoice Billing/Shipping address, VAT and PO number. During this operation if Billing Info (Billing Address, vat_number), Shipping info and PO number are not already present in the system the data will be added. If data is already present, the existing values will be replaced. If info is present in the system, but not passed as part of the request, the info will not be removed from the system.
|
|
732
|
+
|
|
733
|
+
**Note:** Incase, tax is already applied will now vary due to address change, you cannot update the address. You cannot update the VAT Number if the billing address is not present in the API request.This will update the invoice only, it won't change the corresponding customer/subscription details.
|
|
813
734
|
|
|
814
735
|
*/
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
}
|
|
818
|
-
export interface ApplyPaymentsResponse {
|
|
819
|
-
invoice:Invoice;
|
|
820
|
-
}
|
|
821
|
-
export interface ApplyPaymentsInputParam {
|
|
736
|
+
|
|
737
|
+
update_details(invoice_id:string, input?:UpdateDetailsInputParam):ChargebeeRequest<UpdateDetailsResponse>;
|
|
822
738
|
|
|
823
739
|
/**
|
|
824
|
-
* @description
|
|
740
|
+
* @description Resend failed einvoice of an invoice to the customer using this API.
|
|
825
741
|
|
|
826
742
|
*/
|
|
827
|
-
|
|
828
|
-
|
|
743
|
+
|
|
744
|
+
resend_einvoice(invoice_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
|
|
829
745
|
|
|
830
746
|
/**
|
|
831
|
-
* @description
|
|
747
|
+
* @description This endpoint is used to send an e-invoice for invoice.
|
|
832
748
|
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
749
|
+
To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
|
|
750
|
+
|
|
751
|
+
This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
|
|
752
|
+
|
|
753
|
+
* If e-invoicing is not enabled at the site and customer level.
|
|
754
|
+
|
|
755
|
+
* If there is an e-invoice generated already for the invoice.
|
|
756
|
+
|
|
757
|
+
* If the "**Use automatic e-invoicing**" option is selected.
|
|
758
|
+
|
|
759
|
+
* If there are no generated e-invoices with the `failed` or `skipped` status.
|
|
760
|
+
|
|
761
|
+
* If the invoice status is `voided` or `pending`.
|
|
846
762
|
|
|
847
|
-
*/
|
|
848
|
-
|
|
849
|
-
comment?:string;
|
|
850
|
-
|
|
851
|
-
/**
|
|
852
|
-
* @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Invoices \> Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
853
763
|
|
|
854
764
|
*/
|
|
855
|
-
|
|
856
|
-
|
|
765
|
+
|
|
766
|
+
send_einvoice(invoice_id:string):ChargebeeRequest<SendEinvoiceResponse>;
|
|
857
767
|
}
|
|
858
|
-
export interface
|
|
768
|
+
export interface CreateForChargeItemsAndChargesResponse {
|
|
859
769
|
invoice:Invoice;
|
|
860
770
|
}
|
|
861
|
-
export interface
|
|
771
|
+
export interface CreateForChargeItemsAndChargesInputParam {
|
|
862
772
|
|
|
863
773
|
/**
|
|
864
|
-
* @description
|
|
774
|
+
* @description Unique ID of the customer this invoice should be created for. Either this or `subscription_id` must be provided.
|
|
775
|
+
**Note**
|
|
776
|
+
|
|
777
|
+
The invoice is [linked](/docs/api?prod_cat_ver=2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver=2#mbe) as this customer.
|
|
778
|
+
.
|
|
865
779
|
|
|
866
780
|
*/
|
|
867
781
|
|
|
868
|
-
|
|
782
|
+
customer_id?:string;
|
|
869
783
|
|
|
870
784
|
/**
|
|
871
|
-
* @description
|
|
785
|
+
* @description Unique ID of the subscription this invoice should be created for. Either this or `customer_id` must be provided.
|
|
786
|
+
**Note**
|
|
787
|
+
|
|
788
|
+
The invoice is [linked](/docs/api?prod_cat_ver=2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver=2#mbe) as this subscription.
|
|
789
|
+
.
|
|
872
790
|
|
|
873
791
|
*/
|
|
874
792
|
|
|
875
|
-
|
|
793
|
+
subscription_id?:string;
|
|
876
794
|
|
|
877
795
|
/**
|
|
878
|
-
* @description
|
|
796
|
+
* @description The currency code (ISO 4217 format) of the invoice amount.
|
|
879
797
|
|
|
880
798
|
*/
|
|
881
799
|
|
|
882
|
-
|
|
800
|
+
currency_code?:string;
|
|
883
801
|
|
|
884
802
|
/**
|
|
885
|
-
* @description
|
|
803
|
+
* @description A note for this particular invoice. This, and [all other notes](/docs/api/invoices#invoice_notes) for the invoice are displayed on the PDF invoice sent to the customer.
|
|
886
804
|
|
|
887
805
|
*/
|
|
888
806
|
|
|
889
|
-
|
|
807
|
+
invoice_note?:string;
|
|
890
808
|
|
|
891
809
|
/**
|
|
892
|
-
* @description
|
|
810
|
+
* @description Set as `true` to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
|
|
893
811
|
|
|
894
812
|
*/
|
|
895
813
|
|
|
896
|
-
|
|
814
|
+
remove_general_note?:boolean;
|
|
897
815
|
|
|
898
816
|
/**
|
|
899
|
-
* @description
|
|
817
|
+
* @description Purchase Order Number for this invoice.
|
|
900
818
|
|
|
901
819
|
*/
|
|
902
820
|
|
|
903
|
-
|
|
821
|
+
po_number?:string;
|
|
904
822
|
|
|
905
823
|
/**
|
|
906
|
-
* @description
|
|
824
|
+
* @description List of Coupons to be added.
|
|
907
825
|
|
|
908
826
|
*/
|
|
909
827
|
|
|
910
|
-
|
|
828
|
+
coupon_ids?:string[];
|
|
911
829
|
|
|
912
830
|
/**
|
|
913
|
-
* @description
|
|
831
|
+
* @description Authorization transaction to be captured.
|
|
914
832
|
|
|
915
833
|
*/
|
|
916
834
|
|
|
917
|
-
|
|
918
|
-
}
|
|
919
|
-
export interface SendEinvoiceResponse {
|
|
920
|
-
invoice:Invoice;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
export interface WriteOffResponse {
|
|
924
|
-
invoice:Invoice;
|
|
925
|
-
|
|
926
|
-
credit_note:CreditNote;
|
|
927
|
-
}
|
|
928
|
-
export interface WriteOffInputParam {
|
|
835
|
+
authorization_transaction_id?:string;
|
|
929
836
|
|
|
930
837
|
/**
|
|
931
|
-
* @description
|
|
838
|
+
* @description Payment source to be used for this payment.
|
|
932
839
|
|
|
933
840
|
*/
|
|
934
841
|
|
|
935
|
-
|
|
936
|
-
}
|
|
937
|
-
export interface AddChargeItemResponse {
|
|
938
|
-
invoice:Invoice;
|
|
939
|
-
}
|
|
940
|
-
export interface AddChargeItemInputParam {
|
|
842
|
+
payment_source_id?:string;
|
|
941
843
|
|
|
942
844
|
/**
|
|
943
|
-
* @description
|
|
845
|
+
* @description The customer level auto collection will be override if specified. \* on - Whenever an invoice is created, an automatic attempt will be made to charge. \* off - Whenever an invoice is created as payment due.
|
|
944
846
|
|
|
945
847
|
*/
|
|
946
848
|
|
|
947
|
-
|
|
849
|
+
auto_collection?:AutoCollection;
|
|
948
850
|
|
|
949
851
|
/**
|
|
950
|
-
* @description
|
|
852
|
+
* @description The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
|
|
951
853
|
|
|
952
854
|
*/
|
|
953
855
|
|
|
954
|
-
|
|
856
|
+
invoice_date?:number;
|
|
955
857
|
|
|
956
858
|
/**
|
|
957
|
-
* @description
|
|
859
|
+
* @description Token generated by Chargebee JS representing payment method details.
|
|
958
860
|
|
|
959
861
|
*/
|
|
960
862
|
|
|
961
|
-
|
|
863
|
+
token_id?:string;
|
|
962
864
|
|
|
963
865
|
/**
|
|
964
|
-
* @description
|
|
866
|
+
* @description Indicates whether the primary payment source should be replaced with this payment source. In case of Create Subscription for Customer endpoint, the default value is True. Otherwise, the default value is False.
|
|
965
867
|
|
|
966
868
|
*/
|
|
967
869
|
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
export interface ListResponse {
|
|
870
|
+
replace_primary_payment_source?:boolean;
|
|
871
|
+
|
|
971
872
|
/**
|
|
972
|
-
* @description
|
|
873
|
+
* @description Indicates whether the payment source should be retained for the customer.
|
|
973
874
|
|
|
974
875
|
*/
|
|
975
876
|
|
|
976
|
-
|
|
877
|
+
retain_payment_source?:boolean;
|
|
977
878
|
|
|
978
879
|
/**
|
|
979
|
-
* @description
|
|
880
|
+
* @description Parameters for shipping_address
|
|
980
881
|
|
|
981
882
|
*/
|
|
982
883
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
export interface ListInputParam {
|
|
986
|
-
[key : string]: any;
|
|
884
|
+
shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
885
|
+
|
|
987
886
|
/**
|
|
988
|
-
* @description The
|
|
887
|
+
* @description Creates an invoice for [charge-items](./items?prod_cat_ver=2) and [one-time charges](https://www.chargebee.com/docs/2.0/charges.html). The item prices must belong to items of `type` `charge`.
|
|
989
888
|
|
|
990
889
|
*/
|
|
991
|
-
|
|
992
|
-
|
|
890
|
+
|
|
891
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
993
892
|
|
|
994
893
|
/**
|
|
995
|
-
* @description
|
|
894
|
+
* @description Parameters for card
|
|
996
895
|
|
|
997
896
|
*/
|
|
998
|
-
|
|
999
|
-
|
|
897
|
+
|
|
898
|
+
card?:{additional_information?:object,billing_addr1?:string,billing_addr2?:string,billing_city?:string,billing_country?:string,billing_state?:string,billing_state_code?:string,billing_zip?:string,cvv?:string,expiry_month?:number,expiry_year?:number,first_name?:string,gateway_account_id?:string,last_name?:string,number?:string};
|
|
1000
899
|
|
|
1001
900
|
/**
|
|
1002
|
-
* @description
|
|
901
|
+
* @description Parameters for bank_account
|
|
1003
902
|
|
|
1004
903
|
*/
|
|
1005
|
-
|
|
1006
|
-
|
|
904
|
+
|
|
905
|
+
bank_account?:{account_holder_type?:AccountHolderType,account_number?:string,account_type?:AccountType,bank_code?:string,bank_name?:string,billing_address?:object,company?:string,echeck_type?:EcheckType,email?:string,first_name?:string,gateway_account_id?:string,iban?:string,issuing_country?:string,last_name?:string,phone?:string,routing_number?:string,swedish_identity_number?:string};
|
|
1007
906
|
|
|
1008
907
|
/**
|
|
1009
|
-
* @description
|
|
908
|
+
* @description Parameters for payment_method
|
|
1010
909
|
|
|
1011
910
|
*/
|
|
1012
|
-
|
|
1013
|
-
|
|
911
|
+
|
|
912
|
+
payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
|
|
1014
913
|
|
|
1015
914
|
/**
|
|
1016
|
-
* @description
|
|
1017
|
-
NOTE: Not to be used if *consolidated invoicing* is enabled.
|
|
915
|
+
* @description Parameters for payment_intent
|
|
1018
916
|
|
|
1019
917
|
*/
|
|
1020
|
-
|
|
1021
|
-
|
|
918
|
+
|
|
919
|
+
payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'faster_payments' | 'sofort' | 'upi' | 'venmo' | 'amazon_payments' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'pay_to' | 'card',reference_id?:string};
|
|
1022
920
|
|
|
1023
921
|
/**
|
|
1024
|
-
* @description
|
|
922
|
+
* @description Parameters for item_prices
|
|
1025
923
|
|
|
1026
924
|
*/
|
|
1027
|
-
|
|
1028
|
-
|
|
925
|
+
|
|
926
|
+
item_prices?:{date_from?:number,date_to?:number,item_price_id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1029
927
|
|
|
1030
928
|
/**
|
|
1031
|
-
* @description
|
|
929
|
+
* @description Parameters for item_tiers
|
|
1032
930
|
|
|
1033
931
|
*/
|
|
1034
|
-
|
|
1035
|
-
|
|
932
|
+
|
|
933
|
+
item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
|
|
1036
934
|
|
|
1037
935
|
/**
|
|
1038
|
-
* @description
|
|
936
|
+
* @description Parameters for charges
|
|
1039
937
|
|
|
1040
938
|
*/
|
|
1041
|
-
|
|
1042
|
-
|
|
939
|
+
|
|
940
|
+
charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
|
|
1043
941
|
|
|
1044
942
|
/**
|
|
1045
|
-
* @description
|
|
943
|
+
* @description Parameters for notes_to_remove
|
|
1046
944
|
|
|
1047
945
|
*/
|
|
1048
|
-
|
|
1049
|
-
|
|
946
|
+
|
|
947
|
+
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
1050
948
|
|
|
1051
949
|
/**
|
|
1052
|
-
* @description
|
|
950
|
+
* @description Parameters for discounts
|
|
1053
951
|
|
|
1054
952
|
*/
|
|
1055
|
-
|
|
1056
|
-
|
|
953
|
+
|
|
954
|
+
discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
|
|
955
|
+
}
|
|
956
|
+
export interface StopDunningResponse {
|
|
957
|
+
invoice:Invoice;
|
|
958
|
+
}
|
|
959
|
+
export interface StopDunningInputParam {
|
|
1057
960
|
|
|
1058
961
|
/**
|
|
1059
|
-
* @description
|
|
962
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1060
963
|
|
|
1061
964
|
*/
|
|
1062
|
-
|
|
1063
|
-
|
|
965
|
+
|
|
966
|
+
comment?:string;
|
|
967
|
+
}
|
|
968
|
+
export interface ImportInvoiceResponse {
|
|
969
|
+
invoice:Invoice;
|
|
970
|
+
|
|
971
|
+
credit_note?:CreditNote;
|
|
972
|
+
}
|
|
973
|
+
export interface ImportInvoiceInputParam {
|
|
1064
974
|
|
|
1065
975
|
/**
|
|
1066
|
-
* @description
|
|
976
|
+
* @description Invoice Number.
|
|
1067
977
|
|
|
1068
978
|
*/
|
|
1069
|
-
|
|
1070
|
-
|
|
979
|
+
|
|
980
|
+
id:string;
|
|
1071
981
|
|
|
1072
982
|
/**
|
|
1073
|
-
* @description
|
|
983
|
+
* @description The currency code (ISO 4217 format) for the invoice.
|
|
1074
984
|
|
|
1075
985
|
*/
|
|
1076
|
-
|
|
1077
|
-
|
|
986
|
+
|
|
987
|
+
currency_code?:string;
|
|
1078
988
|
|
|
1079
989
|
/**
|
|
1080
|
-
* @description
|
|
990
|
+
* @description Identifier of the customer for which this invoice needs to be created.
|
|
1081
991
|
|
|
1082
992
|
*/
|
|
1083
|
-
|
|
1084
|
-
|
|
993
|
+
|
|
994
|
+
customer_id?:string;
|
|
1085
995
|
|
|
1086
996
|
/**
|
|
1087
|
-
* @description
|
|
997
|
+
* @description If recurring items are present in line items then subscription id is required.
|
|
1088
998
|
|
|
1089
999
|
*/
|
|
1090
|
-
|
|
1091
|
-
|
|
1000
|
+
|
|
1001
|
+
subscription_id?:string;
|
|
1092
1002
|
|
|
1093
1003
|
/**
|
|
1094
|
-
* @description
|
|
1004
|
+
* @description Purchase Order Number for this invoice.
|
|
1095
1005
|
|
|
1096
1006
|
*/
|
|
1097
|
-
|
|
1098
|
-
|
|
1007
|
+
|
|
1008
|
+
po_number?:string;
|
|
1099
1009
|
|
|
1100
1010
|
/**
|
|
1101
|
-
* @description
|
|
1011
|
+
* @description The price type of the invoice. \* tax_inclusive - All amounts in the document are inclusive of tax. \* tax_exclusive - All amounts in the document are exclusive of tax.
|
|
1102
1012
|
|
|
1103
1013
|
*/
|
|
1104
|
-
|
|
1105
|
-
|
|
1014
|
+
|
|
1015
|
+
price_type?:PriceType;
|
|
1106
1016
|
|
|
1107
1017
|
/**
|
|
1108
|
-
* @description
|
|
1018
|
+
* @description The reason for exempting the invoice from tax. (Applicable only for exempted invoices.). \* export - The customer is from a non-taxable region or the billing address and shipping address are unavailable. \* customer_exempt - The customer is [exempted](customers#customer_taxability) from tax. \* id_exempt - The customer is from a different country than your business and they have a valid VAT number or, the customer is a business entity. (This reason is only applicable when [EU VAT](https://www.chargebee.com/docs/eu-vat.html) or [UK VAT](https://www.chargebee.com/docs/uk-vat.html) is enabled.)
|
|
1109
1019
|
|
|
1110
1020
|
*/
|
|
1111
|
-
|
|
1112
|
-
|
|
1021
|
+
|
|
1022
|
+
tax_override_reason?:TaxOverrideReason;
|
|
1113
1023
|
|
|
1114
1024
|
/**
|
|
1115
|
-
* @description
|
|
1025
|
+
* @description Vat Number. Required if this invoice is VAT exempted.
|
|
1116
1026
|
|
|
1117
1027
|
*/
|
|
1118
|
-
|
|
1119
|
-
|
|
1028
|
+
|
|
1029
|
+
vat_number?:string;
|
|
1120
1030
|
|
|
1121
1031
|
/**
|
|
1122
|
-
* @description
|
|
1032
|
+
* @description An overridden value for the first two characters of the [full VAT
|
|
1033
|
+
number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
|
|
1034
|
+
|
|
1035
|
+
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1036
|
+
enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting [billing_address](customers#customer_billing_address) `country` as `XI`. That's the code for **United Kingdom - Northern
|
|
1037
|
+
Ireland** . The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
|
|
1123
1038
|
|
|
1124
1039
|
*/
|
|
1125
|
-
|
|
1126
|
-
|
|
1040
|
+
|
|
1041
|
+
vat_number_prefix?:string;
|
|
1127
1042
|
|
|
1128
1043
|
/**
|
|
1129
|
-
* @description
|
|
1044
|
+
* @description Date when invoice raised.
|
|
1130
1045
|
|
|
1131
1046
|
*/
|
|
1132
|
-
|
|
1133
|
-
|
|
1047
|
+
|
|
1048
|
+
date:number;
|
|
1134
1049
|
|
|
1135
1050
|
/**
|
|
1136
|
-
* @description
|
|
1051
|
+
* @description Invoice total amount.
|
|
1137
1052
|
|
|
1138
1053
|
*/
|
|
1139
|
-
|
|
1140
|
-
|
|
1054
|
+
|
|
1055
|
+
total:number;
|
|
1141
1056
|
|
|
1142
1057
|
/**
|
|
1143
|
-
* @description
|
|
1058
|
+
* @description Round off amount.
|
|
1144
1059
|
|
|
1145
1060
|
*/
|
|
1146
|
-
|
|
1147
|
-
|
|
1061
|
+
|
|
1062
|
+
round_off?:number;
|
|
1148
1063
|
|
|
1149
1064
|
/**
|
|
1150
|
-
* @description
|
|
1065
|
+
* @description Current status of this invoice. \* not_paid - Indicates the payment is not made and all attempts to collect is failed. \* voided - Indicates a voided invoice. \* paid - Indicates a paid invoice. \* posted - Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period \* pending -
|
|
1066
|
+
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`.
|
|
1067
|
+
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.
|
|
1151
1068
|
|
|
1152
1069
|
*/
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
}
|
|
1156
|
-
export interface CloseResponse {
|
|
1157
|
-
invoice:Invoice;
|
|
1158
|
-
}
|
|
1159
|
-
export interface CloseInputParam {
|
|
1070
|
+
|
|
1071
|
+
status?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
|
|
1160
1072
|
|
|
1161
1073
|
/**
|
|
1162
|
-
* @description
|
|
1074
|
+
* @description Timestamp indicating the date \& time this invoice got voided.
|
|
1163
1075
|
|
|
1164
1076
|
*/
|
|
1165
1077
|
|
|
1166
|
-
|
|
1078
|
+
voided_at?:number;
|
|
1167
1079
|
|
|
1168
1080
|
/**
|
|
1169
|
-
* @description
|
|
1081
|
+
* @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Invoices \> Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
1170
1082
|
|
|
1171
1083
|
*/
|
|
1172
1084
|
|
|
1173
|
-
|
|
1085
|
+
void_reason_code?:string;
|
|
1174
1086
|
|
|
1175
1087
|
/**
|
|
1176
|
-
* @description
|
|
1088
|
+
* @description If is_written_off is true then the invoice is written off.
|
|
1177
1089
|
|
|
1178
1090
|
*/
|
|
1179
1091
|
|
|
1180
|
-
|
|
1092
|
+
is_written_off?:boolean;
|
|
1181
1093
|
|
|
1182
1094
|
/**
|
|
1183
|
-
* @description
|
|
1095
|
+
* @description Amount written off against this invoice. If this value is not present then the due amount of the invoice will be written off.
|
|
1184
1096
|
|
|
1185
1097
|
*/
|
|
1186
1098
|
|
|
1187
|
-
|
|
1099
|
+
write_off_amount?:number;
|
|
1188
1100
|
|
|
1189
1101
|
/**
|
|
1190
|
-
* @description
|
|
1102
|
+
* @description The date on which the write_off invoice has occurred. This is a mandatory field if is_written_off is true. The same date reflects on the created credit note.
|
|
1191
1103
|
|
|
1192
1104
|
*/
|
|
1193
1105
|
|
|
1194
|
-
|
|
1195
|
-
}
|
|
1196
|
-
export interface ApplyCreditsResponse {
|
|
1197
|
-
invoice:Invoice;
|
|
1198
|
-
}
|
|
1199
|
-
export interface ApplyCreditsInputParam {
|
|
1106
|
+
write_off_date?:number;
|
|
1200
1107
|
|
|
1201
1108
|
/**
|
|
1202
|
-
* @description
|
|
1109
|
+
* @description Invoice Due Date.
|
|
1203
1110
|
|
|
1204
1111
|
*/
|
|
1205
1112
|
|
|
1206
|
-
|
|
1113
|
+
due_date?:number;
|
|
1207
1114
|
|
|
1208
1115
|
/**
|
|
1209
|
-
* @description
|
|
1116
|
+
* @description Invoice net term days.
|
|
1210
1117
|
|
|
1211
1118
|
*/
|
|
1212
1119
|
|
|
1213
|
-
|
|
1214
|
-
}
|
|
1215
|
-
export interface RetrieveResponse {
|
|
1216
|
-
invoice:Invoice;
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
export interface CreateForChargeItemsAndChargesResponse {
|
|
1220
|
-
invoice:Invoice;
|
|
1221
|
-
}
|
|
1222
|
-
export interface CreateForChargeItemsAndChargesInputParam {
|
|
1120
|
+
net_term_days?:number;
|
|
1223
1121
|
|
|
1224
1122
|
/**
|
|
1225
|
-
* @description
|
|
1226
|
-
**Note**
|
|
1227
|
-
|
|
1228
|
-
The invoice is [linked](/docs/api?prod_cat_ver=2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver=2#mbe) as this customer.
|
|
1229
|
-
.
|
|
1123
|
+
* @description Boolean indicating any advance charge is present in this invoice.
|
|
1230
1124
|
|
|
1231
1125
|
*/
|
|
1232
1126
|
|
|
1233
|
-
|
|
1127
|
+
has_advance_charges?:boolean;
|
|
1234
1128
|
|
|
1235
1129
|
/**
|
|
1236
|
-
* @description
|
|
1237
|
-
**Note**
|
|
1238
|
-
|
|
1239
|
-
The invoice is [linked](/docs/api?prod_cat_ver=2#mbe-linked-be) to the same [business entity](/docs/api?prod_cat_ver=2#mbe) as this subscription.
|
|
1240
|
-
.
|
|
1130
|
+
* @description If the invoice falls within the subscription current term will be used for proration.
|
|
1241
1131
|
|
|
1242
1132
|
*/
|
|
1243
1133
|
|
|
1244
|
-
|
|
1134
|
+
use_for_proration?:boolean;
|
|
1245
1135
|
|
|
1246
1136
|
/**
|
|
1247
|
-
* @description
|
|
1137
|
+
* @description Parameters for credit_note
|
|
1248
1138
|
|
|
1249
1139
|
*/
|
|
1250
1140
|
|
|
1251
|
-
|
|
1141
|
+
credit_note?:{id?:string};
|
|
1252
1142
|
|
|
1253
1143
|
/**
|
|
1254
|
-
* @description
|
|
1144
|
+
* @description Parameters for billing_address
|
|
1255
1145
|
|
|
1256
1146
|
*/
|
|
1257
1147
|
|
|
1258
|
-
|
|
1148
|
+
billing_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1259
1149
|
|
|
1260
1150
|
/**
|
|
1261
|
-
* @description
|
|
1151
|
+
* @description Parameters for shipping_address
|
|
1262
1152
|
|
|
1263
1153
|
*/
|
|
1264
1154
|
|
|
1265
|
-
|
|
1155
|
+
shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1266
1156
|
|
|
1267
1157
|
/**
|
|
1268
|
-
* @description
|
|
1158
|
+
* @description Parameters for line_items
|
|
1269
1159
|
|
|
1270
1160
|
*/
|
|
1271
1161
|
|
|
1272
|
-
|
|
1162
|
+
line_items?:{amount?:number,amount_in_decimal?:string,date_from?:number,date_to?:number,description:string,entity_id?:string,entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc',id?:string,item_level_discount1_amount?:number,item_level_discount1_entity_id?:string,item_level_discount2_amount?:number,item_level_discount2_entity_id?:string,quantity?:number,quantity_in_decimal?:string,subscription_id?:string,tax10_amount?:number,tax10_name?:string,tax1_amount?:number,tax1_name?:string,tax2_amount?:number,tax2_name?:string,tax3_amount?:number,tax3_name?:string,tax4_amount?:number,tax4_name?:string,tax5_amount?:number,tax5_name?:string,tax6_amount?:number,tax6_name?:string,tax7_amount?:number,tax7_name?:string,tax8_amount?:number,tax8_name?:string,tax9_amount?:number,tax9_name?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
|
|
1273
1163
|
|
|
1274
1164
|
/**
|
|
1275
|
-
* @description
|
|
1165
|
+
* @description Parameters for payment_reference_numbers
|
|
1276
1166
|
|
|
1277
1167
|
*/
|
|
1278
1168
|
|
|
1279
|
-
|
|
1169
|
+
payment_reference_numbers?:{id?:string,number:string,type:'frn' | 'kid' | 'fik' | 'ocr'}[];
|
|
1280
1170
|
|
|
1281
1171
|
/**
|
|
1282
|
-
* @description
|
|
1172
|
+
* @description Parameters for line_item_tiers
|
|
1283
1173
|
|
|
1284
1174
|
*/
|
|
1285
1175
|
|
|
1286
|
-
|
|
1176
|
+
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}[];
|
|
1287
1177
|
|
|
1288
1178
|
/**
|
|
1289
|
-
* @description
|
|
1179
|
+
* @description Parameters for discounts
|
|
1290
1180
|
|
|
1291
1181
|
*/
|
|
1292
1182
|
|
|
1293
|
-
|
|
1183
|
+
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}[];
|
|
1294
1184
|
|
|
1295
1185
|
/**
|
|
1296
|
-
* @description
|
|
1186
|
+
* @description Parameters for taxes
|
|
1297
1187
|
|
|
1298
1188
|
*/
|
|
1299
1189
|
|
|
1300
|
-
|
|
1190
|
+
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}[];
|
|
1301
1191
|
|
|
1302
1192
|
/**
|
|
1303
|
-
* @description
|
|
1193
|
+
* @description Parameters for payments
|
|
1304
1194
|
|
|
1305
1195
|
*/
|
|
1306
1196
|
|
|
1307
|
-
|
|
1197
|
+
payments?:{amount:number,date?:number,payment_method:PaymentMethod,reference_number?:string}[];
|
|
1308
1198
|
|
|
1309
1199
|
/**
|
|
1310
|
-
* @description
|
|
1200
|
+
* @description Parameters for notes
|
|
1311
1201
|
|
|
1312
1202
|
*/
|
|
1313
1203
|
|
|
1314
|
-
|
|
1204
|
+
notes?:{entity_id?:string,entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price',note?:string}[];
|
|
1205
|
+
}
|
|
1206
|
+
export interface ApplyPaymentsResponse {
|
|
1207
|
+
invoice:Invoice;
|
|
1208
|
+
}
|
|
1209
|
+
export interface ApplyPaymentsInputParam {
|
|
1315
1210
|
|
|
1316
1211
|
/**
|
|
1317
|
-
* @description
|
|
1212
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1318
1213
|
|
|
1319
1214
|
*/
|
|
1320
1215
|
|
|
1321
|
-
|
|
1216
|
+
comment?:string;
|
|
1322
1217
|
|
|
1323
1218
|
/**
|
|
1324
|
-
* @description
|
|
1219
|
+
* @description Parameters for transactions
|
|
1325
1220
|
|
|
1326
1221
|
*/
|
|
1327
1222
|
|
|
1328
|
-
|
|
1223
|
+
transactions?:{id?:string}[];
|
|
1224
|
+
}
|
|
1225
|
+
export interface SyncUsagesResponse {
|
|
1226
|
+
invoice:Invoice;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
export interface DeleteLineItemsResponse {
|
|
1230
|
+
invoice:Invoice;
|
|
1231
|
+
}
|
|
1232
|
+
export interface DeleteLineItemsInputParam {
|
|
1329
1233
|
|
|
1330
1234
|
/**
|
|
1331
|
-
* @description
|
|
1235
|
+
* @description The list of line items which have to be deleted.
|
|
1332
1236
|
|
|
1333
1237
|
*/
|
|
1334
1238
|
|
|
1335
|
-
|
|
1239
|
+
line_items?:{id?:string}[];
|
|
1240
|
+
}
|
|
1241
|
+
export interface ApplyCreditsResponse {
|
|
1242
|
+
invoice:Invoice;
|
|
1243
|
+
}
|
|
1244
|
+
export interface ApplyCreditsInputParam {
|
|
1336
1245
|
|
|
1337
1246
|
/**
|
|
1338
|
-
* @description
|
|
1247
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1339
1248
|
|
|
1340
1249
|
*/
|
|
1341
1250
|
|
|
1342
|
-
|
|
1251
|
+
comment?:string;
|
|
1343
1252
|
|
|
1344
1253
|
/**
|
|
1345
|
-
* @description Parameters for
|
|
1254
|
+
* @description Parameters for credit_notes
|
|
1346
1255
|
|
|
1347
1256
|
*/
|
|
1348
1257
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1258
|
+
credit_notes?:{id?:string}[];
|
|
1259
|
+
}
|
|
1260
|
+
export interface ListResponse {
|
|
1351
1261
|
/**
|
|
1352
|
-
* @description
|
|
1262
|
+
* @description Lists all the Invoices.
|
|
1353
1263
|
|
|
1354
1264
|
*/
|
|
1355
1265
|
|
|
1356
|
-
|
|
1266
|
+
list:{invoice:Invoice}[];
|
|
1357
1267
|
|
|
1358
1268
|
/**
|
|
1359
|
-
* @description
|
|
1269
|
+
* @description Lists all the Invoices.
|
|
1360
1270
|
|
|
1361
1271
|
*/
|
|
1362
1272
|
|
|
1363
|
-
|
|
1364
|
-
|
|
1273
|
+
next_offset?:string;
|
|
1274
|
+
}
|
|
1275
|
+
export interface ListInputParam {
|
|
1276
|
+
[key : string]: any;
|
|
1365
1277
|
/**
|
|
1366
|
-
* @description
|
|
1278
|
+
* @description Lists all the Invoices.
|
|
1367
1279
|
|
|
1368
1280
|
*/
|
|
1369
|
-
|
|
1370
|
-
|
|
1281
|
+
|
|
1282
|
+
limit?:number;
|
|
1371
1283
|
|
|
1372
1284
|
/**
|
|
1373
|
-
* @description
|
|
1285
|
+
* @description Lists all the Invoices.
|
|
1374
1286
|
|
|
1375
1287
|
*/
|
|
1376
|
-
|
|
1377
|
-
|
|
1288
|
+
|
|
1289
|
+
offset?:string;
|
|
1378
1290
|
|
|
1379
1291
|
/**
|
|
1380
|
-
* @description
|
|
1292
|
+
* @description Lists all the Invoices.
|
|
1381
1293
|
|
|
1382
1294
|
*/
|
|
1383
|
-
|
|
1384
|
-
|
|
1295
|
+
|
|
1296
|
+
include_deleted?:boolean;
|
|
1385
1297
|
|
|
1386
1298
|
/**
|
|
1387
|
-
* @description
|
|
1299
|
+
* @description Lists all the Invoices.
|
|
1388
1300
|
|
|
1389
1301
|
*/
|
|
1390
|
-
|
|
1391
|
-
|
|
1302
|
+
|
|
1303
|
+
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1392
1304
|
|
|
1393
1305
|
/**
|
|
1394
|
-
* @description
|
|
1306
|
+
* @description Lists all the Invoices.
|
|
1395
1307
|
|
|
1396
1308
|
*/
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
}
|
|
1400
|
-
export interface UpdateDetailsResponse {
|
|
1401
|
-
invoice:Invoice;
|
|
1402
|
-
}
|
|
1403
|
-
export interface UpdateDetailsInputParam {
|
|
1309
|
+
|
|
1310
|
+
subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
|
|
1404
1311
|
|
|
1405
1312
|
/**
|
|
1406
|
-
* @description
|
|
1313
|
+
* @description Lists all the Invoices.
|
|
1407
1314
|
|
|
1408
1315
|
*/
|
|
1409
|
-
|
|
1410
|
-
|
|
1316
|
+
|
|
1317
|
+
customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1411
1318
|
|
|
1412
1319
|
/**
|
|
1413
|
-
* @description
|
|
1414
|
-
number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
|
|
1415
|
-
|
|
1416
|
-
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1417
|
-
enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting [billing_address](customers#customer_billing_address) `country` as `XI`. That's the code for **United Kingdom - Northern
|
|
1418
|
-
Ireland** . The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
|
|
1320
|
+
* @description Lists all the Invoices.
|
|
1419
1321
|
|
|
1420
1322
|
*/
|
|
1421
|
-
|
|
1422
|
-
|
|
1323
|
+
|
|
1324
|
+
recurring?:{is?:'true' | 'false'};
|
|
1423
1325
|
|
|
1424
1326
|
/**
|
|
1425
|
-
* @description
|
|
1327
|
+
* @description Lists all the Invoices.
|
|
1426
1328
|
|
|
1427
1329
|
*/
|
|
1428
|
-
|
|
1429
|
-
|
|
1330
|
+
|
|
1331
|
+
status?:{in?:string,is?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due',is_not?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due',not_in?:string};
|
|
1430
1332
|
|
|
1431
1333
|
/**
|
|
1432
|
-
* @description
|
|
1334
|
+
* @description Lists all the Invoices.
|
|
1433
1335
|
|
|
1434
1336
|
*/
|
|
1435
|
-
|
|
1436
|
-
|
|
1337
|
+
|
|
1338
|
+
price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
|
|
1437
1339
|
|
|
1438
1340
|
/**
|
|
1439
|
-
* @description
|
|
1341
|
+
* @description Lists all the Invoices.
|
|
1440
1342
|
|
|
1441
1343
|
*/
|
|
1442
|
-
|
|
1443
|
-
|
|
1344
|
+
|
|
1345
|
+
date?:{after?:string,before?:string,between?:string,on?:string};
|
|
1444
1346
|
|
|
1445
1347
|
/**
|
|
1446
|
-
* @description
|
|
1348
|
+
* @description Lists all the Invoices.
|
|
1447
1349
|
|
|
1448
1350
|
*/
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
}
|
|
1452
|
-
export interface RecordPaymentResponse {
|
|
1453
|
-
invoice:Invoice;
|
|
1454
|
-
|
|
1455
|
-
transaction:Transaction;
|
|
1456
|
-
}
|
|
1457
|
-
export interface RecordPaymentInputParam {
|
|
1351
|
+
|
|
1352
|
+
paid_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1458
1353
|
|
|
1459
1354
|
/**
|
|
1460
|
-
* @description
|
|
1355
|
+
* @description Lists all the Invoices.
|
|
1461
1356
|
|
|
1462
1357
|
*/
|
|
1463
|
-
|
|
1464
|
-
|
|
1358
|
+
|
|
1359
|
+
total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1465
1360
|
|
|
1466
1361
|
/**
|
|
1467
|
-
* @description
|
|
1362
|
+
* @description Lists all the Invoices.
|
|
1468
1363
|
|
|
1469
1364
|
*/
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
}
|
|
1473
|
-
export interface DeleteResponse {
|
|
1474
|
-
invoice:Invoice;
|
|
1475
|
-
}
|
|
1476
|
-
export interface DeleteInputParam {
|
|
1365
|
+
|
|
1366
|
+
amount_paid?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1477
1367
|
|
|
1478
1368
|
/**
|
|
1479
|
-
* @description
|
|
1369
|
+
* @description Lists all the Invoices.
|
|
1480
1370
|
|
|
1481
1371
|
*/
|
|
1482
|
-
|
|
1483
|
-
|
|
1372
|
+
|
|
1373
|
+
amount_adjusted?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1484
1374
|
|
|
1485
1375
|
/**
|
|
1486
|
-
* @description
|
|
1376
|
+
* @description Lists all the Invoices.
|
|
1487
1377
|
|
|
1488
1378
|
*/
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
}
|
|
1492
|
-
export interface ImportInvoiceResponse {
|
|
1493
|
-
invoice:Invoice;
|
|
1494
|
-
|
|
1495
|
-
credit_note?:CreditNote;
|
|
1496
|
-
}
|
|
1497
|
-
export interface ImportInvoiceInputParam {
|
|
1379
|
+
|
|
1380
|
+
credits_applied?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1498
1381
|
|
|
1499
1382
|
/**
|
|
1500
|
-
* @description
|
|
1383
|
+
* @description Lists all the Invoices.
|
|
1501
1384
|
|
|
1502
1385
|
*/
|
|
1503
|
-
|
|
1504
|
-
|
|
1386
|
+
|
|
1387
|
+
amount_due?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
|
|
1505
1388
|
|
|
1506
1389
|
/**
|
|
1507
|
-
* @description
|
|
1390
|
+
* @description Lists all the Invoices.
|
|
1508
1391
|
|
|
1509
1392
|
*/
|
|
1510
|
-
|
|
1511
|
-
|
|
1393
|
+
|
|
1394
|
+
dunning_status?:{in?:string,is?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_not?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_present?:'true' | 'false',not_in?:string};
|
|
1512
1395
|
|
|
1513
1396
|
/**
|
|
1514
|
-
* @description
|
|
1397
|
+
* @description Lists all the Invoices.
|
|
1515
1398
|
|
|
1516
1399
|
*/
|
|
1517
|
-
|
|
1518
|
-
|
|
1400
|
+
|
|
1401
|
+
payment_owner?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1519
1402
|
|
|
1520
1403
|
/**
|
|
1521
|
-
* @description
|
|
1404
|
+
* @description Lists all the Invoices.
|
|
1522
1405
|
|
|
1523
1406
|
*/
|
|
1524
|
-
|
|
1525
|
-
|
|
1407
|
+
|
|
1408
|
+
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1526
1409
|
|
|
1527
1410
|
/**
|
|
1528
|
-
* @description
|
|
1411
|
+
* @description Lists all the Invoices.
|
|
1529
1412
|
|
|
1530
1413
|
*/
|
|
1531
|
-
|
|
1532
|
-
|
|
1414
|
+
|
|
1415
|
+
channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
|
|
1533
1416
|
|
|
1534
1417
|
/**
|
|
1535
|
-
* @description
|
|
1418
|
+
* @description Lists all the Invoices.
|
|
1536
1419
|
|
|
1537
1420
|
*/
|
|
1538
|
-
|
|
1539
|
-
|
|
1421
|
+
|
|
1422
|
+
voided_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1540
1423
|
|
|
1541
1424
|
/**
|
|
1542
|
-
* @description
|
|
1425
|
+
* @description Lists all the Invoices.
|
|
1543
1426
|
|
|
1544
1427
|
*/
|
|
1545
|
-
|
|
1546
|
-
|
|
1428
|
+
|
|
1429
|
+
void_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
1547
1430
|
|
|
1548
1431
|
/**
|
|
1549
|
-
* @description
|
|
1432
|
+
* @description Lists all the Invoices.
|
|
1550
1433
|
|
|
1551
1434
|
*/
|
|
1552
|
-
|
|
1553
|
-
|
|
1435
|
+
|
|
1436
|
+
sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
|
|
1554
1437
|
|
|
1555
1438
|
/**
|
|
1556
|
-
* @description
|
|
1557
|
-
number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
|
|
1558
|
-
|
|
1559
|
-
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1560
|
-
enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting [billing_address](customers#customer_billing_address) `country` as `XI`. That's the code for **United Kingdom - Northern
|
|
1561
|
-
Ireland** . The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
|
|
1439
|
+
* @description Lists all the Invoices.
|
|
1562
1440
|
|
|
1563
1441
|
*/
|
|
1442
|
+
|
|
1443
|
+
einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
|
|
1444
|
+
}
|
|
1445
|
+
export interface RetrieveResponse {
|
|
1446
|
+
invoice:Invoice;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
export interface PdfResponse {
|
|
1450
|
+
download:Download;
|
|
1451
|
+
}
|
|
1452
|
+
export interface PdfInputParam {
|
|
1564
1453
|
|
|
1565
|
-
|
|
1454
|
+
/**
|
|
1455
|
+
* @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
|
|
1456
|
+
|
|
1457
|
+
*/
|
|
1566
1458
|
|
|
1459
|
+
disposition_type?:DispositionType;
|
|
1460
|
+
}
|
|
1461
|
+
export interface DownloadEinvoiceResponse {
|
|
1462
|
+
downloads:Download[];
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
export interface ListPaymentReferenceNumbersResponse {
|
|
1567
1466
|
/**
|
|
1568
|
-
* @description
|
|
1467
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1569
1468
|
|
|
1570
1469
|
*/
|
|
1571
1470
|
|
|
1572
|
-
|
|
1471
|
+
list:{payment_reference_number:PaymentReferenceNumber}[];
|
|
1573
1472
|
|
|
1574
1473
|
/**
|
|
1575
|
-
* @description
|
|
1474
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1576
1475
|
|
|
1577
1476
|
*/
|
|
1578
1477
|
|
|
1579
|
-
|
|
1580
|
-
|
|
1478
|
+
next_offset?:string;
|
|
1479
|
+
}
|
|
1480
|
+
export interface ListPaymentReferenceNumbersInputParam {
|
|
1481
|
+
[key : string]: any;
|
|
1581
1482
|
/**
|
|
1582
|
-
* @description
|
|
1483
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1583
1484
|
|
|
1584
1485
|
*/
|
|
1486
|
+
|
|
1487
|
+
limit?:number;
|
|
1585
1488
|
|
|
1586
|
-
|
|
1489
|
+
/**
|
|
1490
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1491
|
+
|
|
1492
|
+
*/
|
|
1493
|
+
|
|
1494
|
+
offset?:string;
|
|
1587
1495
|
|
|
1588
1496
|
/**
|
|
1589
|
-
* @description
|
|
1590
|
-
The [invoice](/docs/api/invoices?prod_cat_ver=2#invoice_status) is yet to be closed (sent for payment collection). An invoice is generated with this `status` when it has line items that belong to items that are `metered` or when the `subscription.create_pending_invoices`attribute is set to `true`.
|
|
1591
|
-
The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to be closed (sent for payment collection). All invoices are generated with this `status` when [Metered Billing](https://www.chargebee.com/docs/1.0/metered_billing.html) is enabled for the site. \* not_paid - Indicates the payment is not made and all attempts to collect is failed. \* payment_due - Indicates the payment is not yet collected and is being retried as per retry settings. \* voided - Indicates a voided invoice. \* paid - Indicates a paid invoice. \* posted - Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period
|
|
1497
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1592
1498
|
|
|
1593
1499
|
*/
|
|
1500
|
+
|
|
1501
|
+
id?:{in?:string,is?:string};
|
|
1594
1502
|
|
|
1595
|
-
|
|
1503
|
+
/**
|
|
1504
|
+
* @description This API endpoint allows users to retrieve the payment reference numbers (PRNs) associated with an invoice. Only one PRN is allowed per payment type. You can use the `invoice_id` or the `payment_reference_number[number]` to retrieve the PRN.
|
|
1505
|
+
|
|
1506
|
+
*/
|
|
1507
|
+
|
|
1508
|
+
payment_reference_number?:{number?:{in?:string,is?:string}};
|
|
1509
|
+
}
|
|
1510
|
+
export interface AddChargeResponse {
|
|
1511
|
+
invoice:Invoice;
|
|
1512
|
+
}
|
|
1513
|
+
export interface AddChargeInputParam {
|
|
1596
1514
|
|
|
1597
1515
|
/**
|
|
1598
|
-
* @description
|
|
1516
|
+
* @description The amount to be charged. The unit depends on the [type of currency](/docs/api#md_disabled).
|
|
1599
1517
|
|
|
1600
1518
|
*/
|
|
1601
1519
|
|
|
1602
|
-
|
|
1520
|
+
amount:number;
|
|
1603
1521
|
|
|
1604
1522
|
/**
|
|
1605
|
-
* @description
|
|
1523
|
+
* @description Detailed description about this lineitem.
|
|
1606
1524
|
|
|
1607
1525
|
*/
|
|
1608
1526
|
|
|
1609
|
-
|
|
1527
|
+
description:string;
|
|
1610
1528
|
|
|
1611
1529
|
/**
|
|
1612
|
-
* @description
|
|
1530
|
+
* @description Indicates the type of sale carried out. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. \* retail - Transaction is a sale to an end user \* wholesale - Transaction is a sale to another company that will resell your product or service to another consumer \* vendor_use - Transaction is for an item that is subject to vendor use tax \* consumed - Transaction is for an item that is consumed directly
|
|
1613
1531
|
|
|
1614
1532
|
*/
|
|
1615
1533
|
|
|
1616
|
-
|
|
1534
|
+
avalara_sale_type?:AvalaraSaleType;
|
|
1617
1535
|
|
|
1618
1536
|
/**
|
|
1619
|
-
* @description
|
|
1537
|
+
* @description Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
1620
1538
|
|
|
1621
1539
|
*/
|
|
1622
1540
|
|
|
1623
|
-
|
|
1541
|
+
avalara_transaction_type?:number;
|
|
1624
1542
|
|
|
1625
1543
|
/**
|
|
1626
|
-
* @description
|
|
1544
|
+
* @description Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
|
|
1627
1545
|
|
|
1628
1546
|
*/
|
|
1629
1547
|
|
|
1630
|
-
|
|
1548
|
+
avalara_service_type?:number;
|
|
1631
1549
|
|
|
1632
1550
|
/**
|
|
1633
|
-
* @description
|
|
1551
|
+
* @description This represents the Avalara tax code to which the one-time charge is mapped. Applicable only if you use Chargebee's [AvaTax for Sales integration](https://www.chargebee.com/docs/avatax-for-sales.html).
|
|
1634
1552
|
|
|
1635
1553
|
*/
|
|
1636
1554
|
|
|
1637
|
-
|
|
1555
|
+
avalara_tax_code?:string;
|
|
1638
1556
|
|
|
1639
1557
|
/**
|
|
1640
|
-
* @description
|
|
1558
|
+
* @description The [HSN code](https://cbic-gst.gov.in/gst-goods-services-rates.html) to which the one-time charge is mapped for calculating the customer's tax in India. Applicable when both the conditions are true:
|
|
1559
|
+
|
|
1560
|
+
* **[India](https://www.chargebee.com/docs/indian-gst.html#configuring-indian-gst)** has been enabled as a **Tax Region**. (An error is returned when this condition is not true.)
|
|
1561
|
+
* The [**AvaTax for Sales** integration](https://www.chargebee.com/docs/avalara.html) has been enabled in Chargebee.
|
|
1562
|
+
.
|
|
1641
1563
|
|
|
1642
1564
|
*/
|
|
1643
1565
|
|
|
1644
|
-
|
|
1566
|
+
hsn_code?:string;
|
|
1645
1567
|
|
|
1646
1568
|
/**
|
|
1647
|
-
* @description
|
|
1569
|
+
* @description This represents the TaxJar product code to which the one-time charge is mapped. Applicable only if you use Chargebee's [TaxJar integration](https://www.chargebee.com/docs/taxjar.html).
|
|
1648
1570
|
|
|
1649
1571
|
*/
|
|
1650
1572
|
|
|
1651
|
-
|
|
1573
|
+
taxjar_product_code?:string;
|
|
1652
1574
|
|
|
1653
1575
|
/**
|
|
1654
|
-
* @description
|
|
1576
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1655
1577
|
|
|
1656
1578
|
*/
|
|
1657
1579
|
|
|
1658
|
-
|
|
1580
|
+
comment?:string;
|
|
1659
1581
|
|
|
1660
1582
|
/**
|
|
1661
|
-
* @description
|
|
1583
|
+
* @description Identifier of the subscription for which this charge needs to be created. Applicable for consolidated invoice.
|
|
1662
1584
|
|
|
1663
1585
|
*/
|
|
1664
1586
|
|
|
1665
|
-
|
|
1587
|
+
subscription_id?:string;
|
|
1666
1588
|
|
|
1667
1589
|
/**
|
|
1668
|
-
* @description Parameters for
|
|
1590
|
+
* @description Parameters for line_item
|
|
1669
1591
|
|
|
1670
1592
|
*/
|
|
1671
1593
|
|
|
1672
|
-
|
|
1594
|
+
line_item?:{date_from?:number,date_to?:number};
|
|
1595
|
+
}
|
|
1596
|
+
export interface AddChargeItemResponse {
|
|
1597
|
+
invoice:Invoice;
|
|
1598
|
+
}
|
|
1599
|
+
export interface AddChargeItemInputParam {
|
|
1673
1600
|
|
|
1674
1601
|
/**
|
|
1675
|
-
* @description
|
|
1602
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1676
1603
|
|
|
1677
1604
|
*/
|
|
1678
1605
|
|
|
1679
|
-
|
|
1606
|
+
comment?:string;
|
|
1680
1607
|
|
|
1681
1608
|
/**
|
|
1682
|
-
* @description
|
|
1609
|
+
* @description Identifier of the subscription for which this addon needs to be created. Applicable for consolidated invoice.
|
|
1683
1610
|
|
|
1684
1611
|
*/
|
|
1685
1612
|
|
|
1686
|
-
|
|
1613
|
+
subscription_id?:string;
|
|
1687
1614
|
|
|
1688
1615
|
/**
|
|
1689
|
-
* @description
|
|
1616
|
+
* @description Parameters for item_price
|
|
1690
1617
|
|
|
1691
1618
|
*/
|
|
1692
1619
|
|
|
1693
|
-
|
|
1620
|
+
item_price?:{date_from?:number,date_to?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string};
|
|
1694
1621
|
|
|
1695
1622
|
/**
|
|
1696
|
-
* @description Parameters for
|
|
1623
|
+
* @description Parameters for item_tiers
|
|
1697
1624
|
|
|
1698
1625
|
*/
|
|
1699
1626
|
|
|
1700
|
-
|
|
1627
|
+
item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
|
|
1628
|
+
}
|
|
1629
|
+
export interface CloseResponse {
|
|
1630
|
+
invoice:Invoice;
|
|
1631
|
+
}
|
|
1632
|
+
export interface CloseInputParam {
|
|
1701
1633
|
|
|
1702
1634
|
/**
|
|
1703
|
-
* @description
|
|
1635
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1704
1636
|
|
|
1705
1637
|
*/
|
|
1706
1638
|
|
|
1707
|
-
|
|
1639
|
+
comment?:string;
|
|
1708
1640
|
|
|
1709
1641
|
/**
|
|
1710
|
-
* @description
|
|
1642
|
+
* @description A note for this particular invoice. This, and [all other notes](/docs/api/invoices#invoice_notes) for the invoice are displayed on the PDF invoice sent to the customer.
|
|
1711
1643
|
|
|
1712
1644
|
*/
|
|
1713
1645
|
|
|
1714
|
-
|
|
1646
|
+
invoice_note?:string;
|
|
1715
1647
|
|
|
1716
1648
|
/**
|
|
1717
|
-
* @description
|
|
1649
|
+
* @description Set as `true` to remove the **[general note](https://www.chargebee.com/docs/invoice_notes.html#adding-general-notes)** from this invoice.
|
|
1718
1650
|
|
|
1719
1651
|
*/
|
|
1720
1652
|
|
|
1721
|
-
|
|
1653
|
+
remove_general_note?:boolean;
|
|
1722
1654
|
|
|
1723
1655
|
/**
|
|
1724
|
-
* @description
|
|
1656
|
+
* @description Set the [invoice date](https://apidocs.chargebee.com/docs/api/invoices#invoice_date). Must lie between the date when the invoice was generated and current date. Can only be passed when the site setting to allow overriding is enabled. If not passed, then the default value [set at the site level](https://www.chargebee.com/docs/metered_billing.html#overview) is used.
|
|
1725
1657
|
|
|
1726
1658
|
*/
|
|
1727
1659
|
|
|
1728
|
-
|
|
1729
|
-
}
|
|
1730
|
-
export interface RecordTaxWithheldResponse {
|
|
1731
|
-
invoice:Invoice;
|
|
1732
|
-
}
|
|
1733
|
-
export interface RecordTaxWithheldInputParam {
|
|
1660
|
+
invoice_date?:number;
|
|
1734
1661
|
|
|
1735
1662
|
/**
|
|
1736
|
-
* @description Parameters for
|
|
1663
|
+
* @description Parameters for notes_to_remove
|
|
1737
1664
|
|
|
1738
1665
|
*/
|
|
1739
1666
|
|
|
1740
|
-
|
|
1741
|
-
}
|
|
1742
|
-
export interface ResendEinvoiceResponse {
|
|
1743
|
-
invoice:Invoice;
|
|
1667
|
+
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
1744
1668
|
}
|
|
1745
|
-
|
|
1746
|
-
export interface RemoveTaxWithheldResponse {
|
|
1669
|
+
export interface CollectPaymentResponse {
|
|
1747
1670
|
invoice:Invoice;
|
|
1671
|
+
|
|
1672
|
+
transaction:Transaction;
|
|
1748
1673
|
}
|
|
1749
|
-
export interface
|
|
1674
|
+
export interface CollectPaymentInputParam {
|
|
1750
1675
|
|
|
1751
1676
|
/**
|
|
1752
|
-
* @description
|
|
1677
|
+
* @description Amount to be collected. If this parameter is not passed then the entire amount due will be collected.
|
|
1753
1678
|
|
|
1754
1679
|
*/
|
|
1755
1680
|
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
export interface ListPaymentReferenceNumbersResponse {
|
|
1681
|
+
amount?:number;
|
|
1682
|
+
|
|
1759
1683
|
/**
|
|
1760
|
-
* @description
|
|
1684
|
+
* @description Authorization transaction to be captured.
|
|
1761
1685
|
|
|
1762
1686
|
*/
|
|
1763
1687
|
|
|
1764
|
-
|
|
1688
|
+
authorization_transaction_id?:string;
|
|
1765
1689
|
|
|
1766
1690
|
/**
|
|
1767
|
-
* @description
|
|
1691
|
+
* @description Payment source to be used for this payment.
|
|
1768
1692
|
|
|
1769
1693
|
*/
|
|
1770
1694
|
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
export interface ListPaymentReferenceNumbersInputParam {
|
|
1774
|
-
[key : string]: any;
|
|
1695
|
+
payment_source_id?:string;
|
|
1696
|
+
|
|
1775
1697
|
/**
|
|
1776
|
-
* @description
|
|
1698
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1777
1699
|
|
|
1778
1700
|
*/
|
|
1779
|
-
|
|
1780
|
-
limit?:number;
|
|
1781
1701
|
|
|
1782
|
-
|
|
1783
|
-
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
|
|
1784
|
-
|
|
1785
|
-
*/
|
|
1786
|
-
|
|
1787
|
-
offset?:string;
|
|
1702
|
+
comment?:string;
|
|
1788
1703
|
|
|
1789
1704
|
/**
|
|
1790
|
-
* @description
|
|
1791
|
-
**Note**: To retrieve the PRN, the API requires either the invoice ID or the payment reference number to be provided by the user. If both values are missing, an error will be returned by the API.
|
|
1705
|
+
* @description The type of initiator to be used for the payment request triggered by this operation. \* merchant - Pass this value to indicate that the request is initiated by the merchant \* customer - Pass this value to indicate that the request is initiated by the customer
|
|
1792
1706
|
|
|
1793
1707
|
*/
|
|
1794
|
-
|
|
1795
|
-
id?:{in?:string,is?:string};
|
|
1796
1708
|
|
|
1797
|
-
|
|
1798
|
-
* @description Parameters for payment_reference_number
|
|
1799
|
-
|
|
1800
|
-
*/
|
|
1801
|
-
|
|
1802
|
-
payment_reference_number?:{number?:{in?:string,is?:string}};
|
|
1709
|
+
payment_initiator?:PaymentInitiator;
|
|
1803
1710
|
}
|
|
1804
|
-
export interface
|
|
1711
|
+
export interface RecordPaymentResponse {
|
|
1805
1712
|
invoice:Invoice;
|
|
1806
1713
|
|
|
1807
1714
|
transaction:Transaction;
|
|
1808
1715
|
}
|
|
1809
|
-
export interface
|
|
1810
|
-
|
|
1811
|
-
/**
|
|
1812
|
-
* @description Amount to be collected. If this parameter is not passed then the entire amount due will be collected.
|
|
1813
|
-
|
|
1814
|
-
*/
|
|
1815
|
-
|
|
1816
|
-
amount?:number;
|
|
1716
|
+
export interface RecordPaymentInputParam {
|
|
1817
1717
|
|
|
1818
1718
|
/**
|
|
1819
|
-
* @description
|
|
1719
|
+
* @description Remarks, if any, on the payment.
|
|
1820
1720
|
|
|
1821
1721
|
*/
|
|
1822
1722
|
|
|
1823
|
-
|
|
1723
|
+
comment?:string;
|
|
1824
1724
|
|
|
1825
1725
|
/**
|
|
1826
|
-
* @description
|
|
1726
|
+
* @description Parameters for transaction
|
|
1827
1727
|
|
|
1828
1728
|
*/
|
|
1829
1729
|
|
|
1830
|
-
|
|
1730
|
+
transaction?:{amount?:number,date?:number,error_code?:string,error_text?:string,id_at_gateway?:string,payment_method:PaymentMethod,reference_number?:string,status?:'success' | 'failure'};
|
|
1731
|
+
}
|
|
1732
|
+
export interface RecordTaxWithheldResponse {
|
|
1733
|
+
invoice:Invoice;
|
|
1734
|
+
}
|
|
1735
|
+
export interface RecordTaxWithheldInputParam {
|
|
1831
1736
|
|
|
1832
1737
|
/**
|
|
1833
|
-
* @description
|
|
1738
|
+
* @description Parameters for tax_withheld
|
|
1834
1739
|
|
|
1835
1740
|
*/
|
|
1836
1741
|
|
|
1837
|
-
|
|
1742
|
+
tax_withheld?:{amount:number,date?:number,description?:string,reference_number?:string};
|
|
1743
|
+
}
|
|
1744
|
+
export interface RemoveTaxWithheldResponse {
|
|
1745
|
+
invoice:Invoice;
|
|
1746
|
+
}
|
|
1747
|
+
export interface RemoveTaxWithheldInputParam {
|
|
1838
1748
|
|
|
1839
1749
|
/**
|
|
1840
|
-
* @description
|
|
1750
|
+
* @description Parameters for tax_withheld
|
|
1841
1751
|
|
|
1842
1752
|
*/
|
|
1843
1753
|
|
|
1844
|
-
|
|
1845
|
-
}
|
|
1846
|
-
export interface SyncUsagesResponse {
|
|
1847
|
-
invoice:Invoice;
|
|
1754
|
+
tax_withheld?:{id:string};
|
|
1848
1755
|
}
|
|
1849
|
-
|
|
1850
1756
|
export interface RefundResponse {
|
|
1851
1757
|
invoice:Invoice;
|
|
1852
1758
|
|
|
@@ -1921,234 +1827,878 @@ The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to b
|
|
|
1921
1827
|
|
|
1922
1828
|
credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'chargeback' | 'order_change' | 'waiver'};
|
|
1923
1829
|
}
|
|
1924
|
-
export interface
|
|
1925
|
-
|
|
1830
|
+
export interface RemovePaymentResponse {
|
|
1831
|
+
invoice:Invoice;
|
|
1832
|
+
|
|
1833
|
+
transaction:Transaction;
|
|
1926
1834
|
}
|
|
1927
|
-
export interface
|
|
1835
|
+
export interface RemovePaymentInputParam {
|
|
1928
1836
|
|
|
1929
1837
|
/**
|
|
1930
|
-
* @description
|
|
1838
|
+
* @description Parameters for transaction
|
|
1931
1839
|
|
|
1932
1840
|
*/
|
|
1933
1841
|
|
|
1934
|
-
|
|
1842
|
+
transaction?:{id:string};
|
|
1935
1843
|
}
|
|
1936
|
-
export interface
|
|
1937
|
-
|
|
1844
|
+
export interface RemoveCreditNoteResponse {
|
|
1845
|
+
invoice:Invoice;
|
|
1846
|
+
|
|
1847
|
+
credit_note:CreditNote;
|
|
1848
|
+
}
|
|
1849
|
+
export interface RemoveCreditNoteInputParam {
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* @description Parameters for credit_note
|
|
1853
|
+
|
|
1854
|
+
*/
|
|
1855
|
+
|
|
1856
|
+
credit_note?:{id:string};
|
|
1857
|
+
}
|
|
1858
|
+
export interface VoidInvoiceResponse {
|
|
1859
|
+
invoice:Invoice;
|
|
1860
|
+
|
|
1861
|
+
credit_note?:CreditNote;
|
|
1862
|
+
}
|
|
1863
|
+
export interface VoidInvoiceInputParam {
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1867
|
+
|
|
1868
|
+
*/
|
|
1869
|
+
|
|
1870
|
+
comment?:string;
|
|
1871
|
+
|
|
1872
|
+
/**
|
|
1873
|
+
* @description Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in **Settings \> Configure Chargebee \> Reason Codes \> Invoices \> Void invoice**. Must be passed if set as mandatory in the app. The codes are case-sensitive.
|
|
1874
|
+
|
|
1875
|
+
*/
|
|
1876
|
+
|
|
1877
|
+
void_reason_code?:string;
|
|
1878
|
+
}
|
|
1879
|
+
export interface WriteOffResponse {
|
|
1880
|
+
invoice:Invoice;
|
|
1881
|
+
|
|
1882
|
+
credit_note:CreditNote;
|
|
1883
|
+
}
|
|
1884
|
+
export interface WriteOffInputParam {
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1888
|
+
|
|
1889
|
+
*/
|
|
1890
|
+
|
|
1891
|
+
comment?:string;
|
|
1892
|
+
}
|
|
1893
|
+
export interface DeleteResponse {
|
|
1894
|
+
invoice:Invoice;
|
|
1895
|
+
}
|
|
1896
|
+
export interface DeleteInputParam {
|
|
1897
|
+
|
|
1898
|
+
/**
|
|
1899
|
+
* @description Reason for deleting the invoice. This comment will be added to the subscription entity if the invoice belongs to a subscription. It is added to the customer entity if the invoice is associated only with a customer.
|
|
1900
|
+
|
|
1901
|
+
*/
|
|
1902
|
+
|
|
1903
|
+
comment?:string;
|
|
1904
|
+
|
|
1905
|
+
/**
|
|
1906
|
+
* @description Indicates whether to put prorated credits back to the subscription or ignore while deleting the invoice.
|
|
1907
|
+
|
|
1908
|
+
*/
|
|
1909
|
+
|
|
1910
|
+
claim_credits?:boolean;
|
|
1911
|
+
}
|
|
1912
|
+
export interface UpdateDetailsResponse {
|
|
1913
|
+
invoice:Invoice;
|
|
1914
|
+
}
|
|
1915
|
+
export interface UpdateDetailsInputParam {
|
|
1916
|
+
|
|
1917
|
+
/**
|
|
1918
|
+
* @description VAT/ Tax registration number of the customer. [Learn more](https://www.chargebee.com/docs/tax.html#capture-tax-registration-number).
|
|
1919
|
+
|
|
1920
|
+
*/
|
|
1921
|
+
|
|
1922
|
+
vat_number?:string;
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* @description An overridden value for the first two characters of the [full VAT
|
|
1926
|
+
number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with [billing_address](customers#customer_billing_address) `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
|
|
1927
|
+
|
|
1928
|
+
When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually
|
|
1929
|
+
enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting [billing_address](customers#customer_billing_address) `country` as `XI`. That's the code for **United Kingdom - Northern
|
|
1930
|
+
Ireland** . The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
|
|
1931
|
+
|
|
1932
|
+
*/
|
|
1933
|
+
|
|
1934
|
+
vat_number_prefix?:string;
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* @description Purchase Order Number for this invoice.
|
|
1938
|
+
|
|
1939
|
+
*/
|
|
1940
|
+
|
|
1941
|
+
po_number?:string;
|
|
1942
|
+
|
|
1943
|
+
/**
|
|
1944
|
+
* @description An internal [comment](./comments) to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Invoice PDF](./invoices#retrieve_invoice_as_pdf).
|
|
1945
|
+
|
|
1946
|
+
*/
|
|
1947
|
+
|
|
1948
|
+
comment?:string;
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* @description Parameters for billing_address
|
|
1952
|
+
|
|
1953
|
+
*/
|
|
1954
|
+
|
|
1955
|
+
billing_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* @description Parameters for shipping_address
|
|
1959
|
+
|
|
1960
|
+
*/
|
|
1961
|
+
|
|
1962
|
+
shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* @description This API allows you to update the invoice Billing/Shipping address, VAT and PO number. During this operation if Billing Info (Billing Address, vat_number), Shipping info and PO number are not already present in the system the data will be added. If data is already present, the existing values will be replaced. If info is present in the system, but not passed as part of the request, the info will not be removed from the system.
|
|
1966
|
+
|
|
1967
|
+
**Note:** Incase, tax is already applied will now vary due to address change, you cannot update the address. You cannot update the VAT Number if the billing address is not present in the API request.This will update the invoice only, it won't change the corresponding customer/subscription details.
|
|
1968
|
+
|
|
1969
|
+
*/
|
|
1970
|
+
|
|
1971
|
+
statement_descriptor?:{additional_info?:string,descriptor?:string};
|
|
1972
|
+
}
|
|
1973
|
+
export interface ResendEinvoiceResponse {
|
|
1974
|
+
invoice:Invoice;
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
export interface SendEinvoiceResponse {
|
|
1978
|
+
invoice:Invoice;
|
|
1938
1979
|
}
|
|
1939
1980
|
|
|
1940
1981
|
export interface LineItem {
|
|
1982
|
+
/**
|
|
1983
|
+
* @description Uniquely identifies a line_item
|
|
1984
|
+
|
|
1985
|
+
*/
|
|
1986
|
+
|
|
1941
1987
|
id?:string;
|
|
1942
1988
|
|
|
1989
|
+
/**
|
|
1990
|
+
* @description A unique identifier for the subscription this line item belongs to.
|
|
1991
|
+
|
|
1992
|
+
*/
|
|
1993
|
+
|
|
1943
1994
|
subscription_id?:string;
|
|
1944
1995
|
|
|
1945
|
-
|
|
1996
|
+
/**
|
|
1997
|
+
* @description Start date of this line item.
|
|
1998
|
+
|
|
1999
|
+
*/
|
|
2000
|
+
|
|
2001
|
+
date_from:number;
|
|
2002
|
+
|
|
2003
|
+
/**
|
|
2004
|
+
* @description End date of this line item.
|
|
2005
|
+
|
|
2006
|
+
*/
|
|
2007
|
+
|
|
2008
|
+
date_to:number;
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* @description Unit amount of the line item.
|
|
2012
|
+
|
|
2013
|
+
*/
|
|
1946
2014
|
|
|
1947
|
-
|
|
2015
|
+
unit_amount:number;
|
|
1948
2016
|
|
|
1949
|
-
|
|
2017
|
+
/**
|
|
2018
|
+
* @description [Quantity of the recurring item](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2#invoice_line_items_quantity) represented by this line item.
|
|
2019
|
+
|
|
2020
|
+
For metered line items, this value is updated from [usages](https://apidocs.chargebee.com/docs/api/usages) when:
|
|
2021
|
+
|
|
2022
|
+
* the invoice is generated as pending
|
|
2023
|
+
|
|
2024
|
+
* the invoice is [closed](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice)
|
|
2025
|
+
|
|
2026
|
+
* the sync usages API is called
|
|
2027
|
+
|
|
2028
|
+
|
|
2029
|
+
*/
|
|
1950
2030
|
|
|
1951
2031
|
quantity?:number;
|
|
1952
2032
|
|
|
2033
|
+
/**
|
|
2034
|
+
* @description Total amount of this line item. Typically equals to unit amount x quantity
|
|
2035
|
+
|
|
2036
|
+
*/
|
|
2037
|
+
|
|
1953
2038
|
amount?:number;
|
|
1954
2039
|
|
|
2040
|
+
/**
|
|
2041
|
+
* @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.
|
|
2042
|
+
|
|
2043
|
+
*/
|
|
2044
|
+
|
|
1955
2045
|
pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
|
|
1956
2046
|
|
|
1957
|
-
|
|
2047
|
+
/**
|
|
2048
|
+
* @description Specifies whether this line item is taxed or not
|
|
2049
|
+
|
|
2050
|
+
*/
|
|
2051
|
+
|
|
2052
|
+
is_taxed:boolean;
|
|
2053
|
+
|
|
2054
|
+
/**
|
|
2055
|
+
* @description The tax amount charged for this item
|
|
2056
|
+
|
|
2057
|
+
*/
|
|
1958
2058
|
|
|
1959
2059
|
tax_amount?:number;
|
|
1960
2060
|
|
|
2061
|
+
/**
|
|
2062
|
+
* @description Rate of tax used to calculate tax for this lineitem
|
|
2063
|
+
|
|
2064
|
+
*/
|
|
2065
|
+
|
|
1961
2066
|
tax_rate?:number;
|
|
1962
2067
|
|
|
2068
|
+
/**
|
|
2069
|
+
* @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.
|
|
2070
|
+
|
|
2071
|
+
*/
|
|
2072
|
+
|
|
1963
2073
|
unit_amount_in_decimal?:string;
|
|
1964
2074
|
|
|
2075
|
+
/**
|
|
2076
|
+
* @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.
|
|
2077
|
+
|
|
2078
|
+
*/
|
|
2079
|
+
|
|
1965
2080
|
quantity_in_decimal?:string;
|
|
1966
2081
|
|
|
2082
|
+
/**
|
|
2083
|
+
* @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.
|
|
2084
|
+
|
|
2085
|
+
*/
|
|
2086
|
+
|
|
1967
2087
|
amount_in_decimal?:string;
|
|
1968
2088
|
|
|
2089
|
+
/**
|
|
2090
|
+
* @description Total discounts for this line
|
|
2091
|
+
|
|
2092
|
+
*/
|
|
2093
|
+
|
|
1969
2094
|
discount_amount?:number;
|
|
1970
2095
|
|
|
2096
|
+
/**
|
|
2097
|
+
* @description Line Item-level discounts for this line.
|
|
2098
|
+
|
|
2099
|
+
*/
|
|
2100
|
+
|
|
1971
2101
|
item_level_discount_amount?:number;
|
|
1972
2102
|
|
|
2103
|
+
/**
|
|
2104
|
+
* @description The unique identifier of the invoice line item to which this credit note line item is related. This is the same as [invoice.line_items.id](https://apidocs.chargebee.com/docs/api/invoices#invoice_line_items_id ).
|
|
2105
|
+
|
|
2106
|
+
*/
|
|
2107
|
+
|
|
1973
2108
|
reference_line_item_id?:string;
|
|
1974
2109
|
|
|
1975
|
-
|
|
2110
|
+
/**
|
|
2111
|
+
* @description Detailed description about this line item.
|
|
2112
|
+
|
|
2113
|
+
*/
|
|
2114
|
+
|
|
2115
|
+
description:string;
|
|
2116
|
+
|
|
2117
|
+
/**
|
|
2118
|
+
* @description Detailed description about this item.
|
|
2119
|
+
|
|
2120
|
+
*/
|
|
1976
2121
|
|
|
1977
2122
|
entity_description?:string;
|
|
1978
2123
|
|
|
1979
|
-
|
|
2124
|
+
/**
|
|
2125
|
+
* @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
|
|
2126
|
+
|
|
2127
|
+
*/
|
|
2128
|
+
|
|
2129
|
+
entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
|
|
2130
|
+
|
|
2131
|
+
/**
|
|
2132
|
+
* @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
|
|
2133
|
+
|
|
2134
|
+
*/
|
|
1980
2135
|
|
|
1981
2136
|
tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
|
|
1982
2137
|
|
|
2138
|
+
/**
|
|
2139
|
+
* @description The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
|
|
2140
|
+
|
|
2141
|
+
*/
|
|
2142
|
+
|
|
1983
2143
|
entity_id?:string;
|
|
1984
2144
|
|
|
2145
|
+
/**
|
|
2146
|
+
* @description A unique identifier for the customer this line item belongs to
|
|
2147
|
+
|
|
2148
|
+
*/
|
|
2149
|
+
|
|
1985
2150
|
customer_id?:string;
|
|
1986
2151
|
}
|
|
1987
2152
|
export interface Discount {
|
|
1988
|
-
|
|
2153
|
+
/**
|
|
2154
|
+
* @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver=2#currencies).
|
|
2155
|
+
|
|
2156
|
+
*/
|
|
2157
|
+
|
|
2158
|
+
amount:number;
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* @description Description for this deduction.
|
|
2162
|
+
|
|
2163
|
+
*/
|
|
1989
2164
|
|
|
1990
2165
|
description?:string;
|
|
1991
2166
|
|
|
2167
|
+
/**
|
|
2168
|
+
* @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`.
|
|
2169
|
+
|
|
2170
|
+
*/
|
|
2171
|
+
|
|
1992
2172
|
line_item_id?:string;
|
|
1993
2173
|
|
|
1994
|
-
|
|
2174
|
+
/**
|
|
2175
|
+
* @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`.
|
|
2176
|
+
|
|
2177
|
+
*/
|
|
2178
|
+
|
|
2179
|
+
entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
2180
|
+
|
|
2181
|
+
/**
|
|
2182
|
+
* @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
|
|
2183
|
+
|
|
2184
|
+
*/
|
|
1995
2185
|
|
|
1996
2186
|
discount_type?:'fixed_amount' | 'percentage';
|
|
1997
2187
|
|
|
2188
|
+
/**
|
|
2189
|
+
* @description When the deduction is due to a `coupon` or a [discount](discounts), then this is the `id` of the coupon or discount.
|
|
2190
|
+
|
|
2191
|
+
*/
|
|
2192
|
+
|
|
1998
2193
|
entity_id?:string;
|
|
1999
2194
|
|
|
2195
|
+
/**
|
|
2196
|
+
* @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`.
|
|
2197
|
+
|
|
2198
|
+
*/
|
|
2199
|
+
|
|
2000
2200
|
coupon_set_code?:string;
|
|
2001
2201
|
}
|
|
2002
2202
|
export interface LineItemDiscount {
|
|
2003
|
-
|
|
2203
|
+
/**
|
|
2204
|
+
* @description The unique id of the line item that this deduction is for.
|
|
2205
|
+
|
|
2206
|
+
*/
|
|
2207
|
+
|
|
2208
|
+
line_item_id:string;
|
|
2209
|
+
|
|
2210
|
+
/**
|
|
2211
|
+
* @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`.
|
|
2212
|
+
|
|
2213
|
+
*/
|
|
2004
2214
|
|
|
2005
|
-
discount_type
|
|
2215
|
+
discount_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
2006
2216
|
|
|
2007
2217
|
coupon_id?:string;
|
|
2008
2218
|
|
|
2219
|
+
/**
|
|
2220
|
+
* @description When the deduction is due to a `coupon` or a [discount](discounts), then this is the `id` of the coupon or discount.
|
|
2221
|
+
|
|
2222
|
+
*/
|
|
2223
|
+
|
|
2009
2224
|
entity_id?:string;
|
|
2010
2225
|
|
|
2011
|
-
|
|
2226
|
+
/**
|
|
2227
|
+
* @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api#currencies).
|
|
2228
|
+
|
|
2229
|
+
*/
|
|
2230
|
+
|
|
2231
|
+
discount_amount:number;
|
|
2012
2232
|
}
|
|
2013
2233
|
export interface Tax {
|
|
2014
|
-
|
|
2234
|
+
/**
|
|
2235
|
+
* @description The name of the tax applied. E.g. GST.
|
|
2236
|
+
|
|
2237
|
+
*/
|
|
2015
2238
|
|
|
2016
|
-
|
|
2239
|
+
name:string;
|
|
2240
|
+
|
|
2241
|
+
/**
|
|
2242
|
+
* @description The tax amount.
|
|
2243
|
+
|
|
2244
|
+
*/
|
|
2245
|
+
|
|
2246
|
+
amount:number;
|
|
2247
|
+
|
|
2248
|
+
/**
|
|
2249
|
+
* @description Description of the tax item.
|
|
2250
|
+
|
|
2251
|
+
*/
|
|
2017
2252
|
|
|
2018
2253
|
description?:string;
|
|
2019
2254
|
}
|
|
2020
2255
|
export interface LineItemTax {
|
|
2256
|
+
/**
|
|
2257
|
+
* @description The unique reference id of the line item for which the tax is applicable
|
|
2258
|
+
|
|
2259
|
+
*/
|
|
2260
|
+
|
|
2021
2261
|
line_item_id?:string;
|
|
2022
2262
|
|
|
2023
|
-
|
|
2263
|
+
/**
|
|
2264
|
+
* @description The name of the tax applied
|
|
2265
|
+
|
|
2266
|
+
*/
|
|
2024
2267
|
|
|
2025
|
-
|
|
2268
|
+
tax_name:string;
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* @description The rate of tax used to calculate tax amount
|
|
2272
|
+
|
|
2273
|
+
*/
|
|
2274
|
+
|
|
2275
|
+
tax_rate:number;
|
|
2276
|
+
|
|
2277
|
+
/**
|
|
2278
|
+
* @description Indicates if tax is applied only on a portion of the line item amount.
|
|
2279
|
+
|
|
2280
|
+
*/
|
|
2026
2281
|
|
|
2027
2282
|
is_partial_tax_applied?:boolean;
|
|
2028
2283
|
|
|
2284
|
+
/**
|
|
2285
|
+
* @description Indicates the non-compliance tax that should not be reported to the jurisdiction.
|
|
2286
|
+
|
|
2287
|
+
*/
|
|
2288
|
+
|
|
2029
2289
|
is_non_compliance_tax?:boolean;
|
|
2030
2290
|
|
|
2031
|
-
|
|
2291
|
+
/**
|
|
2292
|
+
* @description Indicates the actual portion of the line item amount that is taxable.
|
|
2293
|
+
|
|
2294
|
+
*/
|
|
2295
|
+
|
|
2296
|
+
taxable_amount:number;
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* @description The tax amount
|
|
2300
|
+
|
|
2301
|
+
*/
|
|
2302
|
+
|
|
2303
|
+
tax_amount:number;
|
|
2032
2304
|
|
|
2033
|
-
|
|
2305
|
+
/**
|
|
2306
|
+
* @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.
|
|
2307
|
+
|
|
2308
|
+
*/
|
|
2034
2309
|
|
|
2035
2310
|
tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
|
|
2036
2311
|
|
|
2312
|
+
/**
|
|
2313
|
+
* @description The name of the tax jurisdiction
|
|
2314
|
+
|
|
2315
|
+
*/
|
|
2316
|
+
|
|
2037
2317
|
tax_juris_name?:string;
|
|
2038
2318
|
|
|
2319
|
+
/**
|
|
2320
|
+
* @description The tax jurisdiction code
|
|
2321
|
+
|
|
2322
|
+
*/
|
|
2323
|
+
|
|
2039
2324
|
tax_juris_code?:string;
|
|
2040
2325
|
|
|
2326
|
+
/**
|
|
2327
|
+
* @description Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
|
|
2328
|
+
|
|
2329
|
+
*/
|
|
2330
|
+
|
|
2041
2331
|
tax_amount_in_local_currency?:number;
|
|
2042
2332
|
|
|
2333
|
+
/**
|
|
2334
|
+
* @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.
|
|
2335
|
+
|
|
2336
|
+
*/
|
|
2337
|
+
|
|
2043
2338
|
local_currency_code?:string;
|
|
2044
2339
|
}
|
|
2045
2340
|
export interface LineItemTier {
|
|
2341
|
+
/**
|
|
2342
|
+
* @description Uniquely identifies a line_item
|
|
2343
|
+
|
|
2344
|
+
*/
|
|
2345
|
+
|
|
2046
2346
|
line_item_id?:string;
|
|
2047
2347
|
|
|
2048
|
-
|
|
2348
|
+
/**
|
|
2349
|
+
* @description The lower limit of a range of units for the tier
|
|
2350
|
+
|
|
2351
|
+
*/
|
|
2352
|
+
|
|
2353
|
+
starting_unit:number;
|
|
2354
|
+
|
|
2355
|
+
/**
|
|
2356
|
+
* @description The upper limit of a range of units for the tier
|
|
2357
|
+
|
|
2358
|
+
*/
|
|
2049
2359
|
|
|
2050
2360
|
ending_unit?:number;
|
|
2051
2361
|
|
|
2052
|
-
|
|
2362
|
+
/**
|
|
2363
|
+
* @description The number of units purchased in a range.
|
|
2364
|
+
|
|
2365
|
+
*/
|
|
2366
|
+
|
|
2367
|
+
quantity_used:number;
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* @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.
|
|
2371
|
+
|
|
2372
|
+
*/
|
|
2373
|
+
|
|
2374
|
+
unit_amount:number;
|
|
2053
2375
|
|
|
2054
|
-
|
|
2376
|
+
/**
|
|
2377
|
+
* @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.
|
|
2378
|
+
|
|
2379
|
+
*/
|
|
2055
2380
|
|
|
2056
2381
|
starting_unit_in_decimal?:string;
|
|
2057
2382
|
|
|
2383
|
+
/**
|
|
2384
|
+
* @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.
|
|
2385
|
+
|
|
2386
|
+
*/
|
|
2387
|
+
|
|
2058
2388
|
ending_unit_in_decimal?:string;
|
|
2059
2389
|
|
|
2390
|
+
/**
|
|
2391
|
+
* @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.
|
|
2392
|
+
|
|
2393
|
+
*/
|
|
2394
|
+
|
|
2060
2395
|
quantity_used_in_decimal?:string;
|
|
2061
2396
|
|
|
2397
|
+
/**
|
|
2398
|
+
* @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.
|
|
2399
|
+
|
|
2400
|
+
*/
|
|
2401
|
+
|
|
2062
2402
|
unit_amount_in_decimal?:string;
|
|
2063
2403
|
}
|
|
2064
2404
|
export interface InvoiceTransaction {
|
|
2065
|
-
|
|
2405
|
+
/**
|
|
2406
|
+
* @description Uniquely identifies the transaction.
|
|
2407
|
+
|
|
2408
|
+
*/
|
|
2409
|
+
|
|
2410
|
+
txn_id:string;
|
|
2411
|
+
|
|
2412
|
+
/**
|
|
2413
|
+
* @description The transaction amount applied to this invoice
|
|
2414
|
+
|
|
2415
|
+
*/
|
|
2416
|
+
|
|
2417
|
+
applied_amount:number;
|
|
2418
|
+
|
|
2419
|
+
/**
|
|
2420
|
+
* @description Timestamp at which the transaction is applied.
|
|
2421
|
+
|
|
2422
|
+
*/
|
|
2066
2423
|
|
|
2067
|
-
|
|
2424
|
+
applied_at:number;
|
|
2068
2425
|
|
|
2069
|
-
|
|
2426
|
+
/**
|
|
2427
|
+
* @description The status of this transaction. \* timeout - Transaction failed because of Gateway not accepting the connection. \* voided - The transaction got voided or authorization expired at gateway. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually \* 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. \* success - The transaction is successful.
|
|
2428
|
+
|
|
2429
|
+
*/
|
|
2070
2430
|
|
|
2071
2431
|
txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
|
|
2072
2432
|
|
|
2433
|
+
/**
|
|
2434
|
+
* @description Indicates when this transaction occurred.
|
|
2435
|
+
|
|
2436
|
+
*/
|
|
2437
|
+
|
|
2073
2438
|
txn_date?:number;
|
|
2074
2439
|
|
|
2440
|
+
/**
|
|
2441
|
+
* @description Total amount of the transaction
|
|
2442
|
+
|
|
2443
|
+
*/
|
|
2444
|
+
|
|
2075
2445
|
txn_amount?:number;
|
|
2076
2446
|
}
|
|
2077
2447
|
export interface DunningAttempt {
|
|
2078
|
-
|
|
2448
|
+
/**
|
|
2449
|
+
* @description Dunning attempt number.
|
|
2450
|
+
|
|
2451
|
+
*/
|
|
2452
|
+
|
|
2453
|
+
attempt:number;
|
|
2454
|
+
|
|
2455
|
+
/**
|
|
2456
|
+
* @description Transaction associated with attempt.
|
|
2457
|
+
|
|
2458
|
+
*/
|
|
2079
2459
|
|
|
2080
2460
|
transaction_id?:string;
|
|
2081
2461
|
|
|
2082
|
-
|
|
2462
|
+
/**
|
|
2463
|
+
* @description Types of dunning \* offline - Dunning type is offline. \* direct_debit - Dunning type is direct debit. \* auto_collect - Dunning type is auto collection.
|
|
2464
|
+
|
|
2465
|
+
*/
|
|
2466
|
+
|
|
2467
|
+
dunning_type:'offline' | 'auto_collect' | 'direct_debit';
|
|
2468
|
+
|
|
2469
|
+
/**
|
|
2470
|
+
* @description Timestamp at which the attempt was made.
|
|
2471
|
+
|
|
2472
|
+
*/
|
|
2083
2473
|
|
|
2084
2474
|
created_at?:number;
|
|
2085
2475
|
|
|
2476
|
+
/**
|
|
2477
|
+
* @description The status of this transaction. \* success - The transaction is successful. \* voided - The transaction got voided or authorization expired at gateway. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually \* 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. \* timeout - Transaction failed because of Gateway not accepting the connection.
|
|
2478
|
+
|
|
2479
|
+
*/
|
|
2480
|
+
|
|
2086
2481
|
txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
|
|
2087
2482
|
|
|
2483
|
+
/**
|
|
2484
|
+
* @description Total amount of the transaction
|
|
2485
|
+
|
|
2486
|
+
*/
|
|
2487
|
+
|
|
2088
2488
|
txn_amount?:number;
|
|
2089
2489
|
}
|
|
2090
2490
|
export interface AppliedCredit {
|
|
2091
|
-
|
|
2491
|
+
/**
|
|
2492
|
+
* @description Credit applied on the credit note ID.
|
|
2493
|
+
|
|
2494
|
+
*/
|
|
2495
|
+
|
|
2496
|
+
cn_id:string;
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* @description Total credit amount applied to this invoice.
|
|
2500
|
+
|
|
2501
|
+
*/
|
|
2502
|
+
|
|
2503
|
+
applied_amount:number;
|
|
2504
|
+
|
|
2505
|
+
/**
|
|
2506
|
+
* @description Timestamp when the credit amount was applied to this invoice.
|
|
2507
|
+
|
|
2508
|
+
*/
|
|
2092
2509
|
|
|
2093
|
-
|
|
2510
|
+
applied_at:number;
|
|
2094
2511
|
|
|
2095
|
-
|
|
2512
|
+
/**
|
|
2513
|
+
* @description Credit note reason code. Deprecated; use the cn_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 \* 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. \* other - Can be set when none of the above reason codes are applicable \* order_cancellation - Order Cancellation \* order_change - Order Change \* product_unsatisfactory - Product Unsatisfactory \* waiver - Waiver \* chargeback - Can be set when you are recording your customer Chargebacks \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* fraudulent - FRAUDULENT \* subscription_pause - This reason will be automatically set to credit notes created during pause/resume subscription operation. \* service_unsatisfactory - Service Unsatisfactory
|
|
2514
|
+
|
|
2515
|
+
*/
|
|
2096
2516
|
|
|
2097
2517
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2098
2518
|
|
|
2519
|
+
/**
|
|
2520
|
+
* @description Credit note reason code
|
|
2521
|
+
|
|
2522
|
+
*/
|
|
2523
|
+
|
|
2099
2524
|
cn_create_reason_code?:string;
|
|
2100
2525
|
|
|
2526
|
+
/**
|
|
2527
|
+
* @description Indicates the date at which this credit note is created
|
|
2528
|
+
|
|
2529
|
+
*/
|
|
2530
|
+
|
|
2101
2531
|
cn_date?:number;
|
|
2102
2532
|
|
|
2103
|
-
|
|
2533
|
+
/**
|
|
2534
|
+
* @description Credit note status. \* refunded - When the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded). \* voided - When the Credit Note has been cancelled. \* adjusted - When the Credit Note has been adjusted against an invoice. \* refund_due - When the credits are yet to be used, or have been partially used.
|
|
2535
|
+
|
|
2536
|
+
*/
|
|
2537
|
+
|
|
2538
|
+
cn_status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
2104
2539
|
}
|
|
2105
2540
|
export interface CreatedCreditNote {
|
|
2106
|
-
|
|
2541
|
+
/**
|
|
2542
|
+
* @description Credit-note id
|
|
2543
|
+
|
|
2544
|
+
*/
|
|
2545
|
+
|
|
2546
|
+
cn_id:string;
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* @description Credit note reason code. Deprecated; use the cn_create_reason_code parameter instead \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* waiver - Waiver \* subscription_change - This reason will be set automatically for Credit Notes created during Change Subscription operation when [proration](https://www.chargebee.com/docs/proration.html) is enabled \* write_off - This reason will be set automatically for the Credit Notes created during invoice [Write Off](https://www.chargebee.com/docs/invoice-operations.html#write-off) operation. \* service_unsatisfactory - Service Unsatisfactory \* order_cancellation - Order Cancellation \* fraudulent - FRAUDULENT \* product_unsatisfactory - Product Unsatisfactory \* other - Can be set when none of the above reason codes are applicable \* chargeback - Can be set when you are recording your customer Chargebacks \* order_change - Order Change \* subscription_pause - This reason will be automatically set to credit notes created during pause/resume subscription operation.
|
|
2550
|
+
|
|
2551
|
+
*/
|
|
2107
2552
|
|
|
2108
2553
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2109
2554
|
|
|
2555
|
+
/**
|
|
2556
|
+
* @description Credit note reason code
|
|
2557
|
+
|
|
2558
|
+
*/
|
|
2559
|
+
|
|
2110
2560
|
cn_create_reason_code?:string;
|
|
2111
2561
|
|
|
2562
|
+
/**
|
|
2563
|
+
* @description Indicates the date at which this credit note is created
|
|
2564
|
+
|
|
2565
|
+
*/
|
|
2566
|
+
|
|
2112
2567
|
cn_date?:number;
|
|
2113
2568
|
|
|
2569
|
+
/**
|
|
2570
|
+
* @description Total amount of the credit note.
|
|
2571
|
+
|
|
2572
|
+
*/
|
|
2573
|
+
|
|
2114
2574
|
cn_total?:number;
|
|
2115
2575
|
|
|
2116
|
-
|
|
2576
|
+
/**
|
|
2577
|
+
* @description 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.
|
|
2578
|
+
|
|
2579
|
+
*/
|
|
2580
|
+
|
|
2581
|
+
cn_status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
2117
2582
|
}
|
|
2118
2583
|
export interface CreatedCreditNote {
|
|
2119
|
-
|
|
2584
|
+
/**
|
|
2585
|
+
* @description Credit-note id
|
|
2586
|
+
|
|
2587
|
+
*/
|
|
2588
|
+
|
|
2589
|
+
cn_id:string;
|
|
2590
|
+
|
|
2591
|
+
/**
|
|
2592
|
+
* @description Credit note reason code. Deprecated; use the cn_create_reason_code parameter instead \* fraudulent - FRAUDULENT \* product_unsatisfactory - Product Unsatisfactory \* write_off - This reason will be set automatically for the Credit Notes created during invoice [Write Off](https://www.chargebee.com/docs/invoice-operations.html#write-off) operation. \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* service_unsatisfactory - Service Unsatisfactory \* 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 \* order_change - Order Change \* subscription_change - This reason will be set automatically for Credit Notes created during Change Subscription operation when [proration](https://www.chargebee.com/docs/proration.html) is enabled \* order_cancellation - Order Cancellation \* other - Can be set when none of the above reason codes are applicable
|
|
2593
|
+
|
|
2594
|
+
*/
|
|
2120
2595
|
|
|
2121
2596
|
cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
|
|
2122
2597
|
|
|
2598
|
+
/**
|
|
2599
|
+
* @description Credit note reason code
|
|
2600
|
+
|
|
2601
|
+
*/
|
|
2602
|
+
|
|
2123
2603
|
cn_create_reason_code?:string;
|
|
2124
2604
|
|
|
2605
|
+
/**
|
|
2606
|
+
* @description Indicates the date at which this credit note is created
|
|
2607
|
+
|
|
2608
|
+
*/
|
|
2609
|
+
|
|
2125
2610
|
cn_date?:number;
|
|
2126
2611
|
|
|
2612
|
+
/**
|
|
2613
|
+
* @description Total amount of the credit note.
|
|
2614
|
+
|
|
2615
|
+
*/
|
|
2616
|
+
|
|
2127
2617
|
cn_total?:number;
|
|
2128
2618
|
|
|
2129
|
-
|
|
2619
|
+
/**
|
|
2620
|
+
* @description Credit note status. \* refund_due - When the credits are yet to be used, or have been partially used. \* adjusted - When the Credit Note has been adjusted against an invoice. \* 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.
|
|
2621
|
+
|
|
2622
|
+
*/
|
|
2623
|
+
|
|
2624
|
+
cn_status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
|
|
2130
2625
|
}
|
|
2131
2626
|
export interface LinkedOrder {
|
|
2132
|
-
|
|
2627
|
+
/**
|
|
2628
|
+
* @description Uniquely identifies the order. It is the api identifier for the order
|
|
2629
|
+
|
|
2630
|
+
*/
|
|
2631
|
+
|
|
2632
|
+
id:string;
|
|
2633
|
+
|
|
2634
|
+
/**
|
|
2635
|
+
* @description The order's serial number
|
|
2636
|
+
|
|
2637
|
+
*/
|
|
2133
2638
|
|
|
2134
2639
|
document_number?:string;
|
|
2135
2640
|
|
|
2641
|
+
/**
|
|
2642
|
+
* @description The status of this order. \* awaiting_shipment - The order has been picked up by an integration system, and synced to a shipping management platform \* new - Order has been created. Applicable only if you are using Chargebee's legacy order management system. \* shipped - The order has moved from order management system to a shipping system. \* on_hold - The order is paused from being processed. \* queued - Order is yet to be processed by any system, these are scheduled orders created by Chargebee \* returned - The order has been returned after delivery. \* complete - Order has been processed successfully. Applicable only if you are using Chargebee's legacy order management system \* cancelled - Order has been cancelled. Applicable only if you are using Chargebee's legacy order management system \* delivered - The order has been delivered to the customer. \* partially_delivered - The order has been partially delivered to the customer. \* voided - Order has been voided. Applicable only if you are using Chargebee's legacy order management system \* processing - Order is being processed. Applicable only if you are using Chargebee's legacy order management system
|
|
2643
|
+
|
|
2644
|
+
*/
|
|
2645
|
+
|
|
2136
2646
|
status?:'new' | 'partially_delivered' | 'queued' | 'delivered' | 'on_hold' | 'shipped' | 'processing' | 'cancelled' | 'voided' | 'complete' | 'awaiting_shipment' | 'returned';
|
|
2137
2647
|
|
|
2648
|
+
/**
|
|
2649
|
+
* @description Order type \* manual - The order has been created by the the user using Chargebee's legacy order management system. \* system_generated - The order has been created by Chargebee automatically based on the preferences set by the user.
|
|
2650
|
+
|
|
2651
|
+
*/
|
|
2652
|
+
|
|
2138
2653
|
order_type?:'system_generated' | 'manual';
|
|
2139
2654
|
|
|
2655
|
+
/**
|
|
2656
|
+
* @description Reference id can be used to map the orders in the shipping/order management application to the orders in ChargeBee. The reference_id generally is same as the order id in the third party application.
|
|
2657
|
+
|
|
2658
|
+
*/
|
|
2659
|
+
|
|
2140
2660
|
reference_id?:string;
|
|
2141
2661
|
|
|
2662
|
+
/**
|
|
2663
|
+
* @description The fulfillment status of an order as reflected in the shipping/order management application. Typical statuses include Shipped,Awaiting Shipment,Not fulfilled etc;
|
|
2664
|
+
|
|
2665
|
+
*/
|
|
2666
|
+
|
|
2142
2667
|
fulfillment_status?:string;
|
|
2143
2668
|
|
|
2669
|
+
/**
|
|
2670
|
+
* @description Unique id to identify a group of orders.
|
|
2671
|
+
|
|
2672
|
+
*/
|
|
2673
|
+
|
|
2144
2674
|
batch_id?:string;
|
|
2145
2675
|
|
|
2146
|
-
|
|
2676
|
+
/**
|
|
2677
|
+
* @description The time at which the order was created
|
|
2678
|
+
|
|
2679
|
+
*/
|
|
2680
|
+
|
|
2681
|
+
created_at:number;
|
|
2147
2682
|
}
|
|
2148
2683
|
export interface Note {
|
|
2149
|
-
|
|
2684
|
+
/**
|
|
2685
|
+
* @description Type of entity to which the note belongs. \* subscription - Entity that represents a subscription of customer. \* plan_item_price - Indicates that this line item is based on plan Item Price \* customer - Entity that represents a customer. \* plan - Entity that represents a plan. \* coupon - Entity that represents a coupon. \* tax - The note is configured as part of the [tax configuration](https://www.chargebee.com/docs/tax.html) in Chargebee Billing. \* addon_item_price - Indicates that this line item is based on addon Item Price \* charge_item_price - Indicates that this line item is based on charge Item Price \* addon - Entity that represents an addon.
|
|
2686
|
+
|
|
2687
|
+
*/
|
|
2688
|
+
|
|
2689
|
+
entity_type:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price' | 'tax' | 'subscription' | 'customer';
|
|
2690
|
+
|
|
2691
|
+
/**
|
|
2692
|
+
* @description Actual note.
|
|
2693
|
+
|
|
2694
|
+
*/
|
|
2150
2695
|
|
|
2151
|
-
note
|
|
2696
|
+
note:string;
|
|
2697
|
+
|
|
2698
|
+
/**
|
|
2699
|
+
* @description Unique identifier of the entity.
|
|
2700
|
+
|
|
2701
|
+
*/
|
|
2152
2702
|
|
|
2153
2703
|
entity_id?:string;
|
|
2154
2704
|
}
|
|
@@ -2263,7 +2813,14 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
|
|
|
2263
2813
|
|
|
2264
2814
|
*/
|
|
2265
2815
|
|
|
2266
|
-
index
|
|
2816
|
+
index:number;
|
|
2817
|
+
}
|
|
2818
|
+
export interface StatementDescriptor {
|
|
2819
|
+
id:string;
|
|
2820
|
+
|
|
2821
|
+
descriptor?:string;
|
|
2822
|
+
|
|
2823
|
+
additional_info?:string;
|
|
2267
2824
|
}
|
|
2268
2825
|
export interface BillingAddress {
|
|
2269
2826
|
/**
|
|
@@ -2377,7 +2934,7 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
|
|
|
2377
2934
|
|
|
2378
2935
|
*/
|
|
2379
2936
|
|
|
2380
|
-
id
|
|
2937
|
+
id:string;
|
|
2381
2938
|
|
|
2382
2939
|
/**
|
|
2383
2940
|
* @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.
|
|
@@ -2391,7 +2948,7 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
|
|
|
2391
2948
|
|
|
2392
2949
|
*/
|
|
2393
2950
|
|
|
2394
|
-
status
|
|
2951
|
+
status:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
|
|
2395
2952
|
|
|
2396
2953
|
/**
|
|
2397
2954
|
* @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:
|
|
@@ -2404,14 +2961,39 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
|
|
|
2404
2961
|
message?:string;
|
|
2405
2962
|
}
|
|
2406
2963
|
export interface LinkedTaxWithheld {
|
|
2407
|
-
|
|
2964
|
+
/**
|
|
2965
|
+
* @description An auto-generated unique identifier for the tax withheld. The value starts with the prefix `tax_wh_`. For example, `tax_wh_16BdDXSlbu4uV1Ee6`.
|
|
2966
|
+
|
|
2967
|
+
*/
|
|
2968
|
+
|
|
2969
|
+
id:string;
|
|
2970
|
+
|
|
2971
|
+
/**
|
|
2972
|
+
* @description The amount withheld by the customer as tax from the invoice. The unit depends on the [type of currency](/docs/api#md_disabled).
|
|
2973
|
+
|
|
2974
|
+
*/
|
|
2408
2975
|
|
|
2409
2976
|
amount?:number;
|
|
2410
2977
|
|
|
2978
|
+
/**
|
|
2979
|
+
* @description The description for this tax withheld.
|
|
2980
|
+
|
|
2981
|
+
*/
|
|
2982
|
+
|
|
2411
2983
|
description?:string;
|
|
2412
2984
|
|
|
2985
|
+
/**
|
|
2986
|
+
* @description Date or time associated with the tax withheld.
|
|
2987
|
+
|
|
2988
|
+
*/
|
|
2989
|
+
|
|
2413
2990
|
date?:number;
|
|
2414
2991
|
|
|
2992
|
+
/**
|
|
2993
|
+
* @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.
|
|
2994
|
+
|
|
2995
|
+
*/
|
|
2996
|
+
|
|
2415
2997
|
reference_number?:string;
|
|
2416
2998
|
}
|
|
2417
2999
|
}
|