Submit a document
Submits a new document, such as an invoice or credit note, to the connected e-invoicing provider for validation, compliance checks, and delivery to the appropriate tax authorities or business partners.
This endpoint is MANDATORY for enabling document submission through the Chargebee E-invoicing SPI framework.
Within Chargebee, this endpoint is invoked asynchronously by an internal background job whenever a new invoice, credit note, or other supported billing document is generated and requires processing through the configured e-invoicing provider.
If the e-invoicing provider requires merchants to configure field mappings manually, instead of relying on predefined mappings managed by Chargebee, Chargebee will collect this mapping as entered by the Chargebee merchant through the Chargebee Admin Console.
The collected field mapping and the corresponding input values will be passed to the adapter via the overrides parameter.
Note: When the overrides parameter is present, the adapter must rely exclusively on the field_mapping and values defined within it. All other standard schema fields should be ignored for transformation purposes.
Additionally, this endpoint supports submission of Application Response documents, such as invoice acknowledgements or rejections, to facilitate downstream workflows and business rule validation. These responses are submitted using the same endpoint but distinguished using a type discriminator with APPLICATION_RESPONSE.
Authorizations
Body
- Option 1
- Option 2
Represents an invoice or credit note document to be validated and submitted via the e-invoicing provider.
A unique identifier for the document being submitted. This typically represents the invoice number or credit note number generated by Chargebee.
Type of document, either an invoice or a credit note.
INVOICE, CREDIT_NOTE The ISO country code for the scenario.
"DE"
Indicates the eInvoicing flow model that governs the document exchange and processing mechanism. Different countries adopt different models based on legal, technical, and administrative mandates. Supported values:
- PEPPOL: A standardized, secure eInvoicing network enabling cross-border electronic document exchange between businesses and governments.
- EINVOICE: Traditional eInvoicing model where invoices are digitally exchanged between businesses and sometimes stored.
- CLEARANCE: Invoices must be pre-approved by a tax authority before they are sent to the buyer.
- REPORTING: Invoices are shared with tax authorities after issuance, usually for compliance and audit purposes.
- ZUGFERD: A hybrid eInvoicing format used in Germany combining PDF and XML for human and machine readability.
- CTC: Continuous Transaction Controls involve real-time or near-real-time invoice validation and transmission to tax authorities.
- NEMHANDEL: Denmark’s national infrastructure for eInvoicing that supports secure delivery via specific formats like OIOUBL.
- FACE: Spain’s centralized system (FACe/FACeB2B) for routing invoices to government or private recipients.
- VERIFACTU: Spain’s mechanism for validating and reporting sales invoices directly to the tax agency.
PEPPOL, EINVOICE, CLEARANCE, REPORTING, ZUGFERD, CTC, NEMHANDEL, FACE, VERIFACTU "PEPPOL"
The date when the document was issued. Format "YYYY-MM-DD"
The date used to determine tax. Format "YYYY-MM-DD"
The currency code ISO 4217 format for the document.
The date when the payment is due. Format "YYYY-MM-DD".
Total payable amount for the document, including taxes.
Billing status of the invoice or credit note in Chargebee.
Invoice statuses (when type is INVOICE):
PAID— Indicates a paid invoice.POSTED— Payment is not yet collected and will remain in this state until the due date to indicate the due period.PAYMENT_DUE— Payment is not yet collected and is being retried as per retry settings.NOT_PAID— Payment has not been made and all attempts to collect have failed.VOIDED— Indicates a voided invoice.
Credit note statuses (when type is CREDIT_NOTE):
ADJUSTED— Indicates an adjustment credit note.REFUNDED— Indicates the credit note has been fully refunded.REFUND_DUE— Indicates a refund is due on the credit note.VOIDED— Indicates a voided credit note.
PAID, POSTED, PAYMENT_DUE, NOT_PAID, VOIDED, ADJUSTED, REFUNDED, REFUND_DUE "PAYMENT_DUE"
Total document amount excluding tax (VAT).
Outstanding balance remaining on the document.
Party responsible for issuing the document (that is, the supplier). This represents the legal entity or business that creates the invoice and bears responsibility for delivering goods or services.
Party responsible for receiving the invoice (i.e., the customer).
Represents the total tax details for the document.
The type of transaction (B2B, B2C, B2G).
B2B, B2C, B2G "B2B"
Type of business document.
"ubl-invoice"
Sum of all discounts applied across line items on the document.
A textual note that gives unstructured information that is relevant to the Document as a whole. Such as the reason for any correction or assignment note in case the document has been factored.
A group of business terms providing information on one or more preceding invoices. This enhances traceability in workflows where a document is linked to earlier billing records. For credit notes this is essential as they must reference the original invoice they amend.
A list of payment methods with corresponding payment details.
Optional structure used to override the standard Chargebee SPI document model fields with a flexible field-value-based approach.
This is typically used by adapters where field mapping is configured manually by the merchant in the Chargebee UI, instead of relying on pre-defined mappings managed by the provider or Chargebee.
When present, the overrides object allows the adapter to entirely ignore the standard document payload and instead:
- Use
field_mappingto determine where values go in the provider's schema - Use
valuesto retrieve the corresponding input data using dot-paths or array-style paths
-
field_mapping: A list of mapping rules that define how Chargebee parameter paths (keys fromvalues) should be translated to the corresponding field paths in the provider schema. Includes custom fields too which are defined by merchant in chargebee.Each item must include:
target: The field path in the e-invoicing provider schema (e.g.Invoice.cbc:ID)- One of the below
source: A dot-notated field path or array path from thevaluessection (e.g.invoice.id,line_items[].tax_category)fixed_value(optional): Used if the field always has a constant value (e.g.380forInvoiceTypeCode)expr: An inline expression evaluated against the values object to compute the target field’s value. This is used when the value depends on conditional logic, tax scenarios, payment methods, or other derived rules.
-
values: Each key in this object uses dot-notation to reference the source path, including arrays and nested arrays — for example: invoice.issue_date, line_items[].id, or line_items[].tax_category[].id.-
Scalar values (e.g., strings, numbers, dates) should be represented as flat keys:
-
Complex types like arrays (e.g.,
line_items) should be represented as nested JSON:
-
This model supports maximum flexibility by separating the actual data values from Chargebee's internal schema structure. It enables provider-specific document construction without tightly coupling the adapter to Chargebee's native schema.
Response
Document submitted successfully.
The unique identifier assigned to the document by the e-invoicing provider. This identifier must be used for subsequent operations such as retrieving the document status and downloading the document.
The current status of the submitted document.
ACCEPTED, FAILED, SUCCESS A unique identifier assigned to the request for tracking and correlation purposes across systems and logs.
Captures the interaction between the adapter and the external e-invoicing provider. Includes both the outbound request details and the inbound response received from the provider. Intended for internally hosted adapters for audit and traceability of SPI transactions.