Skip to navigation

Auto-detect and parse e-invoice

Automatically detect the e-invoice format and country, then parse the document. The country is extracted from the document content (seller country). A PDF is opened first: format and country come from its embedded XML, so it answers like that XML; a PDF without embedded XML answers 400 NO_EMBEDDED_XML. Requires e-invoice:::parse entitlement.

Sample documents

The “Examples” dropdown below offers the same set of real / placeholder documents as the explicit /:countryCode/:format/parse endpoint. Pick any one — the server will inspect the bytes and figure out format and country on its own.

Authentication

AuthorizationBearer

API Key authentication. Use sk_live_* for production or sk_test_* for testing.

Request

This endpoint expects an object.
datastringRequired

Base64 encoded document (XML or PDF with embedded XML)

filenamestringOptional

Original filename (helps detect format)

Response

Invoice parsed successfully
successboolean
Whether parsing was successful
detectionobject
Format and country detection result
invoiceobjectOptional
Extracted invoice data
hashstringOptional

SHA-256 hash of the input document

errorslist of objectsOptional

Parsing errors (if any)

warningslist of objectsOptional

Parsing warnings (if any). A party address without a country (seller, buyer, tax representative, payee) gets the country of the format, and the warning PARTY_COUNTRY_ASSUMED names the field and the place in the document.

infoslist of objectsOptional

Informational messages (e.g., XML extracted from PDF)

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error