Skip to content

Invoices

Invoices are the primary resource in Mandato. Each invoice represents a document that is validated, converted to the target country’s XML format, and submitted to the government e-invoicing system.

{
"id": "inv_a1b2c3d4e5f6",
"country": "RO",
"supplierVat": "RO12345678",
"customerVat": "RO87654321",
"status": "accepted",
"netAmount": "5200.00",
"vatAmount": "988.00",
"grossAmount": "6188.00",
"currency": "RON",
"govId": "4523789012",
"externalId": "order-12345",
"errorMessage": null,
"errorTranslated": null,
"errorFix": null,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:15.000Z"
}
FieldTypeDescription
idstringUnique invoice identifier
countrystringISO 3166-1 alpha-2 country code (RO, IT, BE, etc.)
supplierVatstringSupplier VAT number
customerVatstringCustomer VAT number
statusstringCurrent lifecycle status (see below)
netAmountstringNet amount (decimal string)
vatAmountstringTotal VAT amount (decimal string)
grossAmountstringGross amount including VAT (decimal string)
currencystringISO 4217 currency code
govIdstring|nullGovernment-assigned ID after submission
externalIdstring|nullYour external reference ID
errorMessagestring|nullRaw error from the government system
errorTranslatedstring|nullAI-translated error in plain English
errorFixstring|nullAI-suggested fix for the error
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp
StatusDescription
createdInvoice received and queued for processing
validatedPassed EN 16931 + country-specific validation rules
convertingBeing converted to the target XML format
submittingBeing uploaded to the government system
submittedGovernment acknowledged receipt, awaiting decision
acceptedGovernment accepted the invoice
rejectedGovernment rejected the invoice (see errorMessage)
errorInternal error during processing

POST /v1/invoices

Creates a new invoice, validates it, converts it to XML, and submits it to the government system. The invoice is created immediately with a created status and processed asynchronously.

HeaderRequiredDescription
AuthorizationYesBearer sk_test_... or Bearer sk_live_...
Content-TypeYesapplication/json
X-Idempotency-KeyNoUnique key to prevent duplicate submissions
FieldTypeRequiredDescription
countrystringYesTarget country code (RO, IT, BE, PL, FR, DE)
invoiceTypestringNoinvoice (default), credit_note, or debit_note
companyIdstringNoSpecific company ID. If omitted, auto-matched by country.
externalIdstringNoYour external reference ID
supplierobjectYesSupplier party (see Party object below)
customerobjectYesCustomer party (see Party object below)
linesarrayYesOne or more line items (see Line object below)
currencystringNoISO 4217 code. Defaults to EUR.
issueDatestringNoISO 8601 date (YYYY-MM-DD). Defaults to today.
dueDatestringNoISO 8601 date (YYYY-MM-DD)
notestringNoFree-text note included in the invoice
paymentMeansobjectNoPayment details (see below)
attachmentsarrayNoFile attachments (see below)
FieldTypeRequiredDescription
vatNumberstringYesVAT identification number (with country prefix)
namestringYesLegal name
addressobjectNoAddress with street, city, postalCode, country, stateOrProvince
emailstringNoContact email
phonestringNoContact phone
sdiCodestringNoItaly SDI recipient code (7 characters)
peppolIdstringNoPeppol participant ID
siretstringNoFrance SIRET number (14 digits)
leitwegIdstringNoGermany Leitweg-ID
FieldTypeRequiredDescription
descriptionstringYesItem description
quantitynumberNoQuantity (defaults to 1)
unitPricenumberYesUnit price
vatRatenumberYesVAT rate as percentage (e.g., 19 for 19%)
unitCodestringNoUN/ECE unit code (defaults to C62 / “unit”)
discountnumberNoDiscount amount per unit
itemCodestringNoProduct/item classification code
FieldTypeRequiredDescription
bankAccountstringNoIBAN bank account number
bicstringNoBIC/SWIFT code
paymentTermsstringNoFree-text payment terms description
dueDatestringNoISO 8601 payment due date
FieldTypeRequiredDescription
filenamestringYesFile name with extension
contentstringYesBase64-encoded file content
mimeTypestringYesMIME type (e.g., application/pdf)
Terminal window
curl -X POST https://api.getmandato.dev/v1/invoices \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: order-12345-inv-001" \
-d '{
"country": "RO",
"externalId": "order-12345",
"supplier": {
"vatNumber": "RO12345678",
"name": "TechVision SRL",
"address": {
"street": "Strada Exemplu 42",
"city": "Bucharest",
"postalCode": "010101",
"country": "RO"
}
},
"customer": {
"vatNumber": "RO87654321",
"name": "Client Corp SRL",
"address": {
"street": "Bulevardul Unirii 10",
"city": "Cluj-Napoca",
"postalCode": "400001",
"country": "RO"
}
},
"lines": [
{
"description": "Software development services",
"quantity": 1,
"unitPrice": 5000,
"vatRate": 19
},
{
"description": "Cloud hosting",
"quantity": 1,
"unitPrice": 200,
"vatRate": 19
}
],
"currency": "RON",
"issueDate": "2025-01-15",
"dueDate": "2025-02-15",
"paymentMeans": {
"bankAccount": "RO49AAAA1B31007593840000",
"bic": "AAABROBU",
"paymentTerms": "Net 30"
},
"note": "Thank you for your business."
}'
{
"data": {
"id": "inv_a1b2c3d4e5f6",
"country": "RO",
"supplierVat": "RO12345678",
"customerVat": "RO87654321",
"status": "created",
"netAmount": "5200.00",
"vatAmount": "988.00",
"grossAmount": "6188.00",
"currency": "RON",
"govId": null,
"externalId": "order-12345",
"errorMessage": null,
"errorTranslated": null,
"errorFix": null,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:00.000Z"
}
}
StatusTypeDescription
400validation_errorInvalid request body or missing required fields
401authentication_errorInvalid or missing API key
403usage_limit_exceededMonthly invoice limit reached
409conflict_errorIdempotency key conflict (different body for same key)
429rate_limit_errorToo many requests

GET /v1/invoices

Returns a paginated list of invoices for your account. Results are ordered by creation date (newest first).

ParameterTypeDescription
countrystringFilter by country code (e.g., RO)
statusstringFilter by status (e.g., accepted, rejected)
companyIdstringFilter by company ID
searchstringSearch in VAT numbers, external ID
dateFromstringFilter invoices created after this date (ISO 8601)
dateTostringFilter invoices created before this date (ISO 8601)
cursorstringCursor for pagination (from nextCursor in previous response)
limitnumberNumber of results per page (default 20, max 100)
Terminal window
curl "https://api.getmandato.dev/v1/invoices?country=RO&status=accepted&limit=10" \
-H "Authorization: Bearer sk_test_your_key"
{
"data": [
{
"id": "inv_a1b2c3d4e5f6",
"country": "RO",
"supplierVat": "RO12345678",
"customerVat": "RO87654321",
"status": "accepted",
"netAmount": "5200.00",
"vatAmount": "988.00",
"grossAmount": "6188.00",
"currency": "RON",
"govId": "4523789012",
"externalId": "order-12345",
"errorMessage": null,
"errorTranslated": null,
"errorFix": null,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:15.000Z"
}
],
"hasMore": true,
"nextCursor": "eyJpZCI6Imludl9hMWIyYzNkNGU1ZjYifQ"
}

Mandato uses cursor-based pagination. To get the next page, pass the nextCursor value as the cursor parameter:

Terminal window
curl "https://api.getmandato.dev/v1/invoices?cursor=eyJpZCI6Imludl9hMWIyYzNkNGU1ZjYifQ&limit=10" \
-H "Authorization: Bearer sk_test_your_key"

When hasMore is false, there are no more results.


GET /v1/invoices/:id

Retrieves a single invoice by ID.

ParameterTypeDescription
idstringInvoice ID (e.g., inv_a1b2c3d4e5f6)
Terminal window
curl https://api.getmandato.dev/v1/invoices/inv_a1b2c3d4e5f6 \
-H "Authorization: Bearer sk_test_your_key"
{
"data": {
"id": "inv_a1b2c3d4e5f6",
"country": "RO",
"supplierVat": "RO12345678",
"customerVat": "RO87654321",
"status": "accepted",
"netAmount": "5200.00",
"vatAmount": "988.00",
"grossAmount": "6188.00",
"currency": "RON",
"govId": "4523789012",
"externalId": "order-12345",
"errorMessage": null,
"errorTranslated": null,
"errorFix": null,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:15.000Z"
}
}
StatusTypeDescription
404not_foundInvoice not found or belongs to a different account

POST /v1/invoices/validate

Runs the full validation pipeline on an invoice without creating or submitting it. Use this for pre-submission checks and form validation.

The request body is identical to POST /v1/invoices.

Terminal window
curl -X POST https://api.getmandato.dev/v1/invoices/validate \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"country": "RO",
"supplier": {
"vatNumber": "RO12345678",
"name": "TechVision SRL"
},
"customer": {
"vatNumber": "RO87654321",
"name": "Client Corp SRL"
},
"lines": [
{
"description": "Consulting",
"unitPrice": 1000,
"vatRate": 19
}
]
}'
{
"valid": true,
"errors": []
}
{
"valid": false,
"errors": [
"BR-RO-010: Supplier address is required for Romanian invoices",
"BR-16: Invoice must have at least one line with a positive amount"
]
}

GET /v1/invoices/:id/events

Returns the full event timeline for an invoice, showing every status transition with timestamps and metadata.

ParameterTypeDescription
idstringInvoice ID
Terminal window
curl https://api.getmandato.dev/v1/invoices/inv_a1b2c3d4e5f6/events \
-H "Authorization: Bearer sk_test_your_key"
{
"data": [
{
"id": "evt_001",
"event": "invoice.created",
"status": "created",
"metadata": null,
"createdAt": "2025-01-15T10:00:00.000Z"
},
{
"id": "evt_002",
"event": "invoice.validated",
"status": "validated",
"metadata": {
"rulesChecked": 42,
"format": "UBL-CIUS-RO"
},
"createdAt": "2025-01-15T10:00:01.000Z"
},
{
"id": "evt_003",
"event": "invoice.submitted",
"status": "submitted",
"metadata": {
"govEndpoint": "ANAF e-Factura",
"uploadId": "8734291"
},
"createdAt": "2025-01-15T10:00:05.000Z"
},
{
"id": "evt_004",
"event": "invoice.accepted",
"status": "accepted",
"metadata": {
"govId": "4523789012",
"govMessage": "Factura a fost acceptata"
},
"createdAt": "2025-01-15T10:00:15.000Z"
}
]
}
EventDescription
invoice.createdInvoice received and queued
invoice.validatedPassed all validation rules
invoice.submittedUploaded to the government system
invoice.acceptedGovernment accepted the invoice
invoice.rejectedGovernment rejected the invoice
invoice.errorInternal processing error