Skip to main content
POST
/
einvoicing
/
documents
curl --request POST \
  --url https://partner.app.com/einvoicing/documents \
  --header 'Content-Type: application/json' \
  --header 'Authorization: {"api_key" : ... }' \
  --data '{
    "id": "INV-10001",
    "type": "INVOICE",
    "issue_date": "2025-04-02",
    "tax_date": "2025-04-02",
    "currency_code": "EUR",
    "due_date": "2025-04-30",
    "amount": 114.0,
    "note": "Payment due in 28 days.",
    "accounting_supplier_party": {
      "name": "Example Seller GmbH",
      "address": {
        "line_1": "Hauptstr. 456",
        "line_2": "Suite 5",
        "zip": "50667",
        "city": "Cologne",
        "country": "DE"
      },
      "tax_scheme": [
        {
          "scheme": "VAT",
          "id": "DE987654321"
        }
      ]
    },
    "accounting_customer_party": {
      "name": "Example Buyer GmbH",
      "address": {
        "line_1": "Berliner Str. 123",
        "line_2": "2nd Floor",
        "zip": "10115",
        "city": "Berlin",
        "country": "DE"
      },
      "tax_scheme": [
        {
          "scheme": "VAT",
          "id": "DE123456789"
        }
      ]
    },
    "payment_means": [
      {
        "code": "ONLINE_PAYMENT_SERVICE",
        "payment_id": "PAY-2024-00987",
        "card_account": {
          "primary_account_number_id": "4111********1111",
          "card_holder_name": "Jane Smith",
          "network_id": "MASTERCARD"
        }
      }
    ],
    "lines": [
      {
        "id": "1",
        "description": "Consulting Services - April",
        "quantity": 1,
        "unit_price": 100.0,
        "amount": 100.0,
        "item_code": "CONS-APRIL",
        "classified_tax_category": [
          {
            "percentage": 14,
            "category": "VAT",
            "country": "DE"
          }
        ]
      }
    ],
    "tax_total": {
      "tax_amount": 14.0,
      "tax_sub_totals": [
        {
          "taxable_amount": 100.0,
          "tax_amount": 14.0,
          "percentage": 14,
          "country": "DE",
          "category": "VAT"
        }
      ]
    }
  }'
{
  "document_id": "DOC-20250402-0002",
  "status": "ACCEPTED",
  "request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

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

Authorization
string
header
required

Body

application/json

Represents an invoice or credit note document to be validated and submitted via the e-invoicing provider.

id
string
required

A unique identifier for the document being submitted. This typically represents the invoice number or credit note number generated by Chargebee.

type
enum<string>
required

Type of document, either an invoice or a credit note.

Available options:
INVOICE,
CREDIT_NOTE
issue_date
string<date>
required

The date when the document was issued. Format "YYYY-MM-DD"

tax_date
string<date>
required

The date used to determine tax. Format "YYYY-MM-DD"

currency_code
string
required

The currency code ISO 4217 format for the document.

amount
number
required

Total payable amount for the document, including taxes.

accounting_supplier_party
object
required

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.

accounting_customer_party
object
required

Party responsible for receiving the invoice (i.e., the customer).

lines
object[]
required
tax_total
object
required

Represents the total tax details for the document.

due_date
string<date>

The date when the payment is due. Format "YYYY-MM-DD".

note
string

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.

billing_reference
object[]

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.

payment_means
object[]

A list of payment methods with corresponding payment details.

overrides
object

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_mapping to determine where values go in the provider's schema
  • Use values to 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 from values) 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 the values section (e.g. invoice.id, line_items[].tax_category)
    • fixed_value (optional): Used if the field always has a constant value (e.g. 380 for InvoiceTypeCode)
    • 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.

document_id
string
required

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.

status
enum<string>
required

The current status of the submitted document.

Available options:
ACCEPTED,
FAILED,
SUCCESS
request_id
string

A unique identifier assigned to the request for tracking and correlation purposes across systems and logs.

provider_interaction
object

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.

Example:
{
"request": { "body": "{}" },
"response": { "status_code": 0, "body": "{}" }
}