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.
Documentation Index
Fetch the complete documentation index at: https://spidocs.chargebee.com/llms.txt
Use this file to discover all available pages before exploring further.
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 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.
Total payable amount for the document, including taxes.
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 date when the payment is due. Format "YYYY-MM-DD".
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:
{
"invoice.id": "INV-10001",
"invoice.issue_date": "2025-04-02",
"invoice.currency_code": "EUR"
} -
Complex types like arrays (e.g.,
line_items) should be represented as nested JSON:{
"line_items": [
{ "id": "1", "line_item_tax": [ {"name" : "VAT" }] },
{ "id": "2", "line_item_tax": [ {"name" : "Local Tax"}] }
]
}
-
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.
{
"request": { "body": "{}" },
"response": { "status_code": 0, "body": "{}" }
}