Skip to content

Import UBL XML

POST
/invoices/import-xml

Import an invoice from a raw UBL XML document. Send the XML as the raw request body with Content-Type: application/xml. The UBL version (2.0, 2.1, or BIS 3.0) is auto-detected. The invoice is created in draft state. Requires the invoice:create scope.

Invoice imported successfully.

object
data
required
InvoiceResource
object
id
required

Unique invoice identifier (UUID).

string
company_id
required

UUID of the company that owns this invoice.

string
user_id
required

UUID of the user who created the invoice, if applicable.

string | null
state
required

Current workflow state: draft, approved, sending, sent, delivered, failed, or cancelled.

string
direction
required

Invoice direction: outgoing (sent by company) or incoming (received).

string
amount
required

Invoice total amount in cents.

integer
currency
required

ISO 4217 currency code (e.g. EUR, USD).

string
ubl_version
required

UBL specification version used. Peppol BIS 3.0 binds to UBL 2.1.

string
ubl_json
required

Full invoice data in structured UBL JSON format (header, seller, buyer, items, totals, etc.).

object | null
metadata_json
required

Additional metadata such as delivery details, error info, or processing history.

object | null
delivery_network_id
required

Delivery network used: peppol, ksef, or email.

string | null
business_entity_id
required

UUID of the business entity (seller identity) used for this invoice.

string | null
related_invoice_id
required
string | null
payment_status
required
string
total_paid_cents
required
integer
is_test
required
boolean
created_at
required

ISO 8601 timestamp when the invoice was created.

string
updated_at
required

ISO 8601 timestamp when the invoice was last updated.

string
deleted_at
required

ISO 8601 timestamp when the invoice was soft-deleted, or null.

string | null

API key lacks the required invoice:create scope.

string

Empty request body or API key not associated with a company.

Any of:
object
message
required
string
Allowed value: Request body must contain UBL XML.

Failed to parse or import the UBL XML.

object
success
required
boolean
message
required
string
data
required
null
errors
required
null