Invoices
Issue an invoice via POST /v1/agent/invoices. The seller is derived from the organization (X-Organization-Id), the buyer from the customer field or an existing customer_id. Numbering, VAT calculation, PDF, and QR code generation all happen server-side, the same as for manual issuance.
Endpoint
| Method | Path | Scope | Headers |
|---|---|---|---|
| POST | /v1/agent/invoices | invoice:create | X-API-Key, X-Organization-Id |
This endpoint has a per-org rate limit of 30 requests / minute (on top of the key's global limit). The invoice currency defaults to the firm's currency; for another one see currency below.
Signature and stamp on invoice PDFs
In eFaktúra Developers, open Organizations → Edit → Signature and stamp. A partner account owner or administrator can edit production companies. To automate the same setting, choose the org:branding:write scope when creating a partner key. A sandbox key works with companies activated in the sandbox. Upload one PNG, JPEG or WebP per request, up to 2 MiB. With application/octet-stream, the server identifies the format from the file contents.
Repeat the PUT request to replace an image. To remove it, use DELETE on the same URL. The company’s document profile and PDF visibility settings determine which images appear. The PDF request uses a key with invoice:download. Download and open the PDF to check the result.
API_URL=https://api.efaktura.sk
curl --request PUT \
"$API_URL/v1/agent/organizations/$ORG_ID/branding/assets/signature" \
-H "X-API-Key: $API_KEY" -F "file=@signature.png"
curl --request PUT \
"$API_URL/v1/agent/organizations/$ORG_ID/branding/assets/stamp" \
-H "X-API-Key: $API_KEY" -F "file=@stamp.png"
curl --fail -o invoice.pdf \
"$API_URL/v1/agent/invoices/$INVOICE_ID/pdf" \
-H "X-API-Key: $API_KEY" -H "X-Organization-Id: $ORG_ID"The signature and stamp appear only on the invoice PDF. A Peppol e-invoice is XML (UBL) with structured invoice data and carries no images. The recipient’s system builds its own view from the XML. To give the recipient your PDF too, download it before sending and attach it to the invoice with POST /v1/agent/invoices/{id}/attachments (scope invoice:update). The attachment is embedded in the XML and reaches the recipient on other systems too. Before sending, GET /v1/agent/invoices/{id}/xml returns exactly the document that will be sent.
A new image appears on the PDFs of invoices that have not been sent via Peppol and are not locked. Sent and locked invoices keep their stored PDF. The signature image is a graphic on the PDF, not an electronic signature of the document.
jq -n --arg pdf "$(base64 < invoice.pdf | tr -d '\n')" \
'{filename: "invoice.pdf", mime_code: "application/pdf", base64_content: $pdf}' |
curl --fail --request POST \
"$API_URL/v1/agent/invoices/$INVOICE_ID/attachments" \
-H "X-API-Key: $API_KEY" -H "X-Organization-Id: $ORG_ID" \
-H "Content-Type: application/json" --data @-Request body
| Field | Type | Required | Description |
|---|---|---|---|
type | invoice | proforma | self_invoice | final_invoice | credit_note | debit_note | No | Document type, defaults to invoice. Each type has its own number series. proforma = proforma (advance) invoice — a payment request, not a tax document, so it has no tax point date and cannot be sent over Peppol; self_invoice goes over Peppol under the BIS Self-Billing 3.0 profile; credit_note = credit note, debit_note = debit note, final_invoice = final settlement invoice (for a paid advance use POST /v1/agent/invoices/{id}/final-invoice, which deducts the tax documents for the received payments). |
customer_id | UUID | Conditionally | ID of an existing customer. Either customer_id OR customer is required. |
customer | object | Conditionally | Inline customer (creates a contact). See the table below. |
items | array of objects | Yes | At least 1 item. See the items table below. |
vehicle_id | UUID | No | ID of an existing vehicle (fleet module). |
vehicle_plate | string (≤20) | No | Vehicle license plate: the vehicle is looked up (normalized to uppercase without spaces). |
payment_method | bank_transfer | cash | card | online | offset | No | Defaults to bank_transfer (mapped internally to "bank"). online = online payment service (PayPal, gateway), offset = mutual set-off. Carried into the Peppol UBL as PaymentMeansCode (UNCL4461): 30 / 10 / 48 / 68 / 97. |
currency | ISO 4217 | No | Document currency. Defaults to the firm's currency (EUR for a Slovak firm, CZK for a Czech one). See Foreign currency and exchange rate. |
exchange_rate | string (decimal) | No | Foreign-currency rate: units of currency per one unit of the firm's home currency. Without it the ECB / CNB rate. See Foreign currency and exchange rate. |
due_days | int 0–365 | No | Payment term in days from the issue date. Defaults to 14. Note: if the organization has defaultDueDays configured, that's used instead. Do not combine with due_date. |
due_date | YYYY-MM-DD | No | Due date given directly — alternative to due_days (both at once = 400). Must not precede issue_date. |
note | string (≤2000) | No | Note on the invoice (visible to the customer). |
internal_note | string (≤2000) | No | Internal note (not on the PDF). |
issue_date | YYYY-MM-DD | No | Issue date. Defaults to today. |
delivery_date | YYYY-MM-DD | No | Delivery date. Defaults to issue_date. |
order_number | string (≤100) | No | Order number (orderReference). |
invoice_number | string (≤50) | No | Your own document number (e.g. from your system). Omit it to draw from the organization's numbering sequence. A taken number returns 409. Variable symbol = the digits of the number (last 10). |
delivery_address | object | Yes for K treatments | Deliver-to address (BG-15): name?, street, city, zip, country (2 letters), gln? (GLN of the delivery point, 13 digits with a valid check digit; the e-invoice carries it as BT-71 with schemeID 0088, as retail chains ask). With gln, gln and country alone are enough, without street, city and zip; a partial address returns 400. Required for intra_eu_goods / intra_eu_transfer / intra_eu_triangulation (BR-IC-12 needs the deliver-to country), optional otherwise. |
exemption_reason | string (1–500) | No | VAT exemption reason (BT-120) for 0 % lines — printed on the PDF and carried into the UBL. Ignored when no line has vat_rate 0. For a non-VAT-payer it replaces the default "Supplier is not a VAT payer" text. |
already_paid | boolean | No | Defaults to false. When true, the invoice is issued with status "paid" and full payment as of the issue date (with advance_deduction: the total minus the advance). |
advance_deduction | string or number | No | Advance already paid on the whole invoice (not per line), e.g. "300.00" or 300. Lowers the amount due: the UBL carries PrepaidAmount and PayableAmount = total − advance; the VAT breakdown stays as it is. Only for type invoice; must not exceed the total. See Advance paid on the whole invoice. |
language | sk, cs, en, de, hu or sk-en | No | PDF language. Without it, the customer's default language applies, then the company's, then the company's country. |
original_invoice_id | UUID | Credit / debit note | The invoice a credit_note or debit_note corrects (same organization). Its number goes into the UBL as BillingReference (BT-25). Only for credit_note / debit_note. See Cancelling an invoice and credit notes. |
attachments | array (≤10) | No | Attachments (PDF/JPG/PNG/CSV/XLSX/ODS, base64). When sent via Peppol they're embedded directly in the document → they reach the recipient even on other systems (e.g. Doklado). |
{ filename, mime_code, base64_content } (optionally description). Allowed types: PDF, JPG, PNG, CSV, XLSX, ODS (exactly the Peppol BIS 3.0 list — DOC/DOCX/XLS/GIF cannot be delivered over the network, convert them to PDF); 10 MB total max (Peppol limit). The type is verified from the content; CSV is accepted only with a filename ending in .csv. An attachment can also be added later to an existing invoice via POST /v1/agent/invoices/{id}/attachments and managed via GET / DELETE on the same path.Customer object
Maps to the contacts table. For an inline customer, a new contact of type customer is created.
| Field | Type | Required | Description |
|---|---|---|---|
name | string 1–300 | Yes | Company name or customer name. |
ico | string (8 digits) | No | IČO: exactly 8 digits. |
dic | string | No | DIČ: 10 digits (SK) or a country code + 8–10 digits (e.g. CZ12345678). Normalized to uppercase without spaces. |
ic_dph | string (SK + 10 digits) | No | VAT ID in the format SK2120035951. |
address | string | object | No | Either a plain string, or an object { street, city, postalCode, country }. For Peppol, a full address object is required. |
email | email (≤254) | No | An empty string is treated as not provided. |
phone | string E.164 (≤16) | No | E.164 format, e.g. +421900123456. Separators and the 00 prefix are normalized (0042... → +42...). An invalid number returns 400 VALIDATION_ERROR. An empty string is treated as not provided. |
address as an object requires non-empty street, city, postalCode, and a 2-letter country. If you send the address as a plain string, the string is stored in the street field and country is set to "SK"; city and postalCode remain empty: insufficient for Peppol (see below). For Peppol sending, always send a full address object.Line item object (items[])
| Field | Type | Required | Description |
|---|---|---|---|
description | string 1–500 | Yes | Item name / description. |
quantity | number ≠ 0 | Yes | Quantity (a numeric string is also accepted). A negative quantity is a negative line (discount, returned deposit, deduction), only on invoice, proforma, debit_note and self_invoice — see Negative line below. |
unit | enum | No | Defaults to ks. Allowed: ks, hod, l, m, km, súbor, kg, t, g, cm, m2, m3, set, deň, bal, kpl. Mapped to UN/ECE Rec 20 codes in the UBL (km → KMT, kg → KGM, t → TNE, m2 → MTK, deň → DAY …); súbor (file) has no code and goes out as C62. |
unit_price | number ≥ 0 | Yes | Unit price excluding VAT, never negative. |
vat_rate | int | Yes | VAT rate in percent. Allowed: 0, 5, 19, 23. |
tax_treatment | enum | No | Tax treatment of a 0 % line: domestic (default), reverse_charge_service, intra_eu_goods, intra_eu_transfer, intra_eu_triangulation, export_goods. Any value other than domestic is allowed only with vat_rate 0 (otherwise 400) and only for a VAT payer. All lines sharing a rate must share the treatment (otherwise 400). It decides the VAT category in the UBL — see the table below. |
ean | string | No | EAN (GTIN) of the goods: 8, 12, 13 or 14 digits with a valid check digit, otherwise 400. The e-invoice carries it as BT-157 with schemeID 0160; retail chains match the line to their order by it. |
VAT categories for 0 % lines (UBL mapping)
A 0 % rate alone is not enough — EN 16931 distinguishes why a line carries no VAT. The category comes from the line's tax_treatment and the document's exemption_reason (BT-120):
| Situation | tax_treatment | exemption_reason | Category (BT-151) | VATEX code |
|---|---|---|---|---|
| Reverse charge | reverse_charge_service | optional | AE | VATEX-EU-AE |
| Intra-EU supply of goods, transfer of own goods, triangulation | intra_eu_goods / intra_eu_transfer / intra_eu_triangulation | optional | K | VATEX-EU-IC |
| Export outside the EU | export_goods | optional | G | VATEX-EU-G |
| Exempt supply (margin schemes, statutory exemptions …) | domestic / absent | yes (reason text) | E | derived from the text (e.g. VATEX-EU-F) |
| Zero rate without a reason | domestic / absent | no | Z | — |
| Supplier is not a VAT payer | (not allowed) | optional, overrides the default | O | VATEX-EU-O |
tax_treatment and without exemption_reason the behaviour is unchanged (category Z). To inspect the resulting UBL before sending, call GET /v1/agent/invoices/{id}/xml — it returns a preview (see below).tax_treatment does not reach the EC sales list (súhrnný výkaz). Set the treatment on a proforma too: the tax document for the received payment takes its lines and belongs to the EC sales list of the payment's period.tax_treatment only, never from the reason text. If exemption_reason by itself reads as reverse charge / export / intra-EU supply (e.g. "§ 69", "reverse charge", "export") and the line has no cross-border treatment, the request returns 400 naming the treatment to set. K treatments (intra_eu_*) additionally require delivery_address with the deliver-to country (BT-80, BR-IC-12). Category O (outside the scope of VAT) cannot share a document with VAT-bearing lines (BR-O-11). On a self_invoice the supplier is the contact — it must have a VAT id for AE/K/G/E.ic_dph nor isVatPayer), no item may have vat_rate > 0; otherwise the request fails with 400 VALIDATION_ERROR (the message is in Slovak: "Dodávateľ „…“ z hlavičky X-Organization-Id nie je platiteľ DPH, nemôže účtovať DPH. … Ak firma DPH neúčtuje, pošlite pri každej položke vat_rate 0.", i.e. the supplier is not a VAT payer and cannot charge VAT; send vat_rate: 0 on every item). It is not a demand for a sender VAT id. The invoice gets the exemption "Supplier is not a VAT payer".Complete example
POST /v1/agent/invoices
X-API-Key: efk_pk_test_...
X-Organization-Id: 0a2c1f3e-…
Idempotency-Key: 7f0c2a4e-order-2026-042
Content-Type: application/json
{
"customer": {
"name": "Customer s.r.o.",
"ico": "87654321",
"dic": "2010101010",
"ic_dph": "SK2010101010",
"address": {
"street": "Obchodná 5",
"city": "Košice",
"postalCode": "04001",
"country": "SK"
},
"email": "fakturacia@odberatel.sk",
"phone": "+421900123456"
},
"items": [
{
"description": "Service work",
"quantity": 2,
"unit": "hod",
"unit_price": 50,
"vat_rate": 23
},
{
"description": "Spare part",
"quantity": 1,
"unit": "ks",
"unit_price": 80,
"vat_rate": 23
}
],
"payment_method": "bank_transfer",
"due_days": 14,
"note": "Thank you for your business.",
"order_number": "OBJ-2026-042",
"invoice_number": "2026-000042"
}Response
HTTP/1.1 201 Created
{
"id": "b1f0d7a2-…",
"invoice_number": "2026001",
"status": "issued",
"customer": { "id": "…", "name": "Customer s.r.o." },
"items": [ … ],
"subtotal": "180.00",
"vat_total": "41.40",
"total": "221.40",
"currency": "EUR",
"exchange_rate": null,
"issue_date": "2026-06-22",
"due_date": "2026-07-06",
"pdf_url": "https://…",
"created_at": "2026-06-22T10:00:00.000Z"
}The id value is used both when sending via Peppol (POST /v1/agent/peppol/send/{id}) and when checking status.
Validate before creating (dry run)
Add ?dry_run=true to POST /v1/agent/invoices to check an invoice without creating it. The server runs every check of a real create (body, customer, VAT rates, a taken invoice_number → 409, credit note limits, the plan limit) and validates the exact Peppol document the invoice would produce, attachments included. Then it rolls everything back: no invoice, no customer and no number is kept, so a corrected request can reuse your own invoice_number.
POST /v1/agent/invoices?dry_run=true
(same headers and body as a real create)
HTTP/1.1 200 OK
{
"dry_run": true,
"invoice_number": "2026001",
"type": "invoice",
"customer": { "name": "Customer s.r.o." },
"items": [ … ],
"subtotal": "180.00",
"vat_total": "41.40",
"total": "221.40",
"advance_deduction": "0.00",
"currency": "EUR",
"issue_date": "2026-06-22",
"due_date": "2026-07-06",
"preflight": {
"send_ready": true,
"validation": { "ran": true, "error_count": 0, … },
"repair": [],
"recipient": { "peppol_id": "0245:2010101010", "found": true },
"assembly": { "attachments_bytes": 0 }
}
}A request error returns the same 4xx as a real create. A document that can be built returns 200; preflight is the same object as POST /v1/agent/invoices/{id}/preflight returns — send_ready: false with the reasons in repair means the Peppol send would be refused. Without your own invoice_number the number shown is a preview and is not reserved. A dry run is never stored under an Idempotency-Key, and it counts towards the 30 requests / minute limit.
Negative line (discount, returned deposit, deduction)
Send a negative line as a negative quantity with a positive unit_price, as Peppol BIS requires (BR-27: the price is never negative). It works on invoice, proforma, debit_note and self_invoice; a credit note and a final invoice accept a positive quantity only.
{
"customer_id": "550e8400-…",
"items": [
{ "description": "Goods", "quantity": 1, "unit": "ks", "unit_price": 100, "vat_rate": 23 },
{ "description": "Discount", "quantity": -1, "unit": "ks", "unit_price": 10, "vat_rate": 23 }
]
}
→ total 110.70 (net 90.00, VAT 20.70)
→ UBL (discount line)
<cbc:InvoicedQuantity unitCode="C62">-1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">-10.00</cbc:LineExtensionAmount>
…
<cbc:PriceAmount currencyID="EUR">10.00</cbc:PriceAmount>The invoice stores the negative line the way the app does: a positive quantity with a negative price. GET /v1/agent/invoices/{id} therefore returns it as "quantity": "1", "unitPrice": "-10" with the line total -10.00; the invoice can be opened, edited and copied in the app.
400 (also with ?dry_run=true). Put a discount on the VAT rate of the goods it belongs to; refund money with a credit note. A debit note (debit_note) may move a base between VAT rates; only its amount due is guarded.Advance paid on the whole invoice
Send advance_deduction when the customer already paid part of the invoice before it was issued and the advance is not split per line. The invoice keeps its full total and VAT breakdown; only the amount due drops. A regular invoice (type: invoice) only.
{
"customer_id": "550e8400-…",
"items": [ { "description": "Delivery", "quantity": 1, "unit": "ks", "unit_price": 8130.08, "vat_rate": 23 } ],
"advance_deduction": "300.00"
}
→ UBL
<cac:LegalMonetaryTotal>
<cbc:TaxExclusiveAmount currencyID="EUR">8130.08</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">10000.00</cbc:TaxInclusiveAmount>
<cbc:PrepaidAmount currencyID="EUR">300.00</cbc:PrepaidAmount>
<cbc:PayableAmount currencyID="EUR">9700.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>The PDF, the PAY by square QR code and outstanding in the payments responses use the amount due (9700.00). A payment of the rest leaves the invoice partially_paid until the hourly status run settles it to paid, the same as in the app. An advance invoice settled with a tax document (proforma → final invoice) is a different flow, see Final invoice for an advance.
Final invoice for an advance
The API runs the advance → payment → tax document → settlement flow the same way as the app:
1. Issue the advance invoice: POST /v1/agent/invoices with type: proforma.
2. Record the payment with POST /v1/agent/invoices/{id}/payments (or let the bank match it). For a VAT payer the tax document for the received payment (DkPP) with its VAT breakdown is created automatically unless the firm turned it off in its advance settings.
3. After delivery, call POST /v1/agent/invoices/{id}/final-invoice, where id is the advance invoice, with every delivered good and service in items. The server adds a deduction for each DkPP by VAT rate, so VAT is due only on the difference. Do not send negative lines or advance_deduction.
| Field | Type | Required | Description |
|---|---|---|---|
items | array | No | Delivered lines in the invoice shape (description, quantity, unit, unit_price, vat_rate), without tax_treatment. Omitted → the advance invoice's own lines are settled. |
additional_proforma_ids | UUID[] | No | Further paid advance invoices of the same customer settled by this invoice (at most 20). |
issue_date | YYYY-MM-DD | No | Issue date, defaults to today (Europe/Bratislava). |
delivery_date | YYYY-MM-DD | No | Delivery date (tax point), defaults to the issue date. |
due_date | YYYY-MM-DD | No | Due date, defaults to 14 days after issue; must not be before the issue date. |
note | string | No | Note printed on the invoice (max 2000 characters). |
POST /v1/agent/invoices/7c1e…/final-invoice
Idempotency-Key: vf-2026-0042
{
"delivery_date": "2026-10-22",
"items": [
{ "description": "Goods per project", "quantity": 2, "unit": "ks", "unit_price": 600, "vat_rate": 23 },
{ "description": "Installation", "quantity": 10, "unit": "hod", "unit_price": 30, "vat_rate": 23 }
]
}
→ 201
{
"type": "final_invoice",
"status": "issued",
"total": "615.00",
"vat_total": "115.00",
"advance_deduction": "1230.00",
"items": [
{ "description": "Goods per project", "total": "1200.00", … },
{ "description": "Installation", "total": "300.00", … },
{ "description": "Odpočet zálohy – DDP260001", "total": "-1000.00", "isAdvanceDeduction": true, … }
],
…
}An advance of 1 230.00 € (DkPP with a 1 000.00 € base and 230.00 € VAT) is deducted by rate and 615.00 € remains due. If the advance exceeds the delivery the total comes out negative (an overpayment to refund); an invoice with nothing left to pay is paid right away. The delivered lines must cover at least the deducted amount at every VAT rate of the advance, otherwise the server returns 400. A second call for a fully settled advance is refused (400). Send an Idempotency-Key. The call counts towards the limit of 30 invoices per minute. Sending over Peppol works as for any invoice.
Cancelling an invoice and credit notes
An issued invoice is never deleted — its number stays used. Pick the way by whether the customer already has the invoice:
| Situation | Call | Result |
|---|---|---|
| Not delivered yet (not sent over Peppol or by e-mail) and unpaid, e.g. a typo | PATCH /v1/agent/invoices/{id}/status with { "status": "cancelled" } | The invoice gets status cancelled. Refused for a draft, a paid invoice and an invoice with a partial payment. |
| Delivered to the customer or paid | POST /v1/agent/invoices with type: credit_note and original_invoice_id | A credit note in its own number series, linked to the original (UBL BillingReference). Send it over Peppol like any invoice. |
POST /v1/agent/invoices
Idempotency-Key: credit-2026001
{
"type": "credit_note",
"original_invoice_id": "b1f0d7a2-…",
"customer_id": "<customer.id from the original invoice>",
"items": [
{ "description": "Credit for invoice 2026001 – Service work", "quantity": 2, "unit": "hod", "unit_price": 50, "vat_rate": 23 }
],
"note": "Credit note for invoice 2026001"
}Send the credited lines with positive quantities and prices — the document type makes them a credit. A full credit repeats every line of the original; a partial one only what you credit. The credit notes of one invoice together must not exceed its total (otherwise 400 with the remaining amount), and they must use its currency. Credit notes are listed with GET /v1/agent/invoices?type=credit_note.
Fixing an issued invoice before it is sent
Until an invoice leaves over Peppol, PATCH /v1/agent/invoices/{id} (invoice:update) changes it in place — the number stays. Send only the fields you change; the names are the app's (camelCase), e.g. dueDate, deliveryDate, notes, orderReference, language, advanceDeduction or items (the whole list: description, quantity, unit, unitPrice, vatRate).
PATCH /v1/agent/invoices/b1f0d7a2-…
{ "dueDate": "2026-07-20", "notes": "Payment terms per contract 12/2026" }An invoice already sent over Peppol is a delivered document and returns 400 — correct it with a credit note. A locked or archived invoice is refused too. To catch errors before the number is used, prefer the dry run.
Foreign currency and exchange rate
Without currency the invoice is issued in the firm's currency (EUR for a Slovak firm, CZK for a Czech one). Send another currency in currency (EUR, CZK, USD, GBP, PLN, CHF, HUF, RON, BGN, SEK, DKK, NOK, HRK, RSD, UAH, RUB, TRY, CNY, JPY, CAD, AUD). exchange_rate is a decimal (string or number) greater than 0 (up to 7 integer and 8 decimal digits): units of currency per one unit of the firm's home currency. Slovak firm, 1 EUR = 1.0842 USD: "exchange_rate": "1.0842".
{
"customer_id": "550e8400-…",
"currency": "USD",
"exchange_rate": "1.0842",
"items": [ { "description": "Consulting", "quantity": 1, "unit": "ks", "unit_price": 500, "vat_rate": 0 } ]
}Without exchange_rate on a foreign-currency invoice the server fills in the ECB rate (Slovak firm) or the CNB rate (Czech firm) for the tax point (delivery_date, else issue_date). If no rate can be fetched the invoice is still created with exchange_rate: null. The response of POST /v1/agent/invoices and of GET /v1/agent/invoices/{id} carry exchange_rate (string or null) next to currency.
exchange_rate on a home-currency invoice returns 400. A credit note or debit note with original_invoice_id must use the currency of the original invoice, otherwise 400 - the message names the currency to send. The bank account (bank_account_id) must be in the same currency as the invoice (BANK_ACCOUNT_CURRENCY_MISMATCH).Bank account on the invoice (IBAN)
An invoice from POST /v1/agent/invoices takes the IBAN from the company's bank accounts: the account from bank_account_id, otherwise the default one. Its IBAN and BIC go into the UBL as cac:PaymentMeans/cac:PayeeFinancialAccount and into the PDF. A company without an account sends a bank-transfer invoice without cac:PaymentMeans.
| Method | Path | Scope |
|---|---|---|
| GET | /v1/agent/bank-accounts | invoice:read |
| POST | /v1/agent/bank-accounts | settings:update | org:provision |
| PATCH | /v1/agent/bank-accounts/{id} | settings:update | org:provision |
| DELETE | /v1/agent/bank-accounts/{id} | settings:update | org:provision |
Writes require the settings:update scope (a company member's key) or org:provision (a partner key). A company with accounts always has exactly one default: the first account is the default, and is_default: true moves the flag to this account. The IBAN is stored without spaces after a checksum check, and a Slovak IBAN gets the BIC of its bank code. The same IBAN a second time returns 409. Issued invoices keep their own copy of the account; the change applies to new ones.
POST /v1/agent/bank-accounts
X-API-Key: efk_pk_test_...
X-Organization-Id: 0a2c1f3e-…
{ "name": "Main account", "iban": "SK92 0900 0000 0000 1234 5671", "is_default": true }
HTTP/1.1 201 Created
{
"data": {
"id": "6b1e…",
"name": "Main account",
"iban": "SK9209000000000012345671",
"bic": "GIBASKBX",
"currency": "EUR",
"is_default": true
}
}Idempotency (retry without duplicates)
POST /v1/agent/invoices supports an optional Idempotency-Key header: the primary protection mechanism against duplicate invoices on automatic retries. The same key with the same body returns the stored response (the invoice isn't created twice and the number series isn't consumed); the same key with a different body, or a concurrent request with the same key, returns 409. Without the header, behavior is unchanged.
POST /v1/agent/expenses. As an extra measure, store the returned id after a successful response.Downloading PDF / XML
You can download an issued invoice as PDF or as UBL XML. Both operations require the scopeinvoice:download and return the file as an attachment (Content-Disposition: attachment).
| Method | Path | Scope | Content-Type |
|---|---|---|---|
| GET | /v1/agent/invoices/{id}/pdf | invoice:download | application/pdf |
| GET | /v1/agent/invoices/{id}/xml | invoice:download | application/xml |
Once the invoice has been sent via Peppol, the XML is the exact UBL handed to the Access Point (kept for statutory e-invoice archiving). Before sending the endpoint returns a preview rendered by the same builder the send job uses — no DB write, no credit charged, no embedded attachments (those are embedded only at send time). The X-Efaktura-Ubl-Source: archive | preview header tells you which one you got. Use the preview to verify the business JSON → UBL mapping (units, VAT categories, parties). The file name is the invoice number ({numberPrefix}{number}.xml).
GET /v1/agent/invoices/b1f0d7a2-…/xml
X-API-Key: efk_pk_test_...
X-Organization-Id: 0a2c1f3e-…
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Content-Disposition: attachment; filename="OF2026001.xml"
X-Efaktura-Ubl-Source: preview
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">…</Invoice>Mutual set-off
A set-off (vzájomný zápočet) of an issued invoice against a received document of the same counterparty (e.g. a platform invoices a client for a service and records the client's fee as a received document). One call writes a payment with method offset on the invoice and on the received document and pairs them. Slovak firms only. To settle just one side, use POST /v1/agent/invoices/{id}/payments.
| Method | Path | Scope | Note |
|---|---|---|---|
| POST | /v1/agent/offsets | invoice:update + receipt:update | Supports Idempotency-Key. |
| GET | /v1/agent/offsets | invoice:read | Filters invoice_id, expense_id, page, per_page (≤100). |
| Field | Type | Required | Description |
|---|---|---|---|
invoice_id | UUID | Yes | Issued invoice, type invoice only. |
expense_id | UUID | Yes | Received supplier invoice of the same counterparty. |
amount | string | Yes | Positive amount with at most 2 decimals. Must not exceed the outstanding balance of either document (no rounding tolerance). |
offset_date | YYYY-MM-DD | No | Defaults to today (Europe/Bratislava). Not in the future and not before the issue date of either document. |
reference | string (≤100) | No | Your set-off / settlement number. |
note | string (≤500) | No | Note. |
POST /v1/agent/offsets
X-API-Key: efk_pk_test_...
X-Organization-Id: 0a2c1f3e-…
Idempotency-Key: 3c8e1d52-settlement-2026-10
Content-Type: application/json
{
"invoice_id": "b1f0d7a2-…",
"expense_id": "5b7e91c4-…",
"amount": "110.70",
"offset_date": "2026-10-31",
"reference": "SETTLEMENT-2026-10"
}
HTTP/1.1 201 Created
{
"data": {
"id": "3d9a60f8-…",
"invoice_id": "b1f0d7a2-…",
"expense_id": "5b7e91c4-…",
"amount": "110.70",
"currency": "EUR",
"offset_date": "2026-10-31",
"reference": "SETTLEMENT-2026-10",
"note": null,
"accounting_program": { "status": "pending", "reason": null },
"created_at": "2026-10-31T09:12:00.000Z",
"invoice": { "id": "b1f0d7a2-…", "total": "270.60", "paid_amount": "110.70", "outstanding": "159.90", "status": "partially_paid" },
"expense": { "id": "5b7e91c4-…", "total": "110.70", "paid_amount": "110.70", "outstanding": "0.00", "payment_status": "paid" }
}
}The payments of a set-off cannot be deleted on their own, nor can the documents it settled (409). A missing document returns 404. 400 errors:
| Code | Meaning |
|---|---|
OFFSET_NOT_SUPPORTED | Czech firm - set-off through the API is for Slovak firms only. |
OFFSET_INVOICE_TYPE | The invoice is not type invoice (self-invoices, proformas and credit notes cannot be set off). |
OFFSET_INVOICE_STATUS | The invoice is a draft, awaits approval or is cancelled. |
OFFSET_EXPENSE_TYPE | The document is not an approved received supplier invoice. |
OFFSET_COUNTERPARTY_MISMATCH | Contact, IČO and DIČ of the two documents all differ. For a person without IČO send the received document with the same contact_id as the invoice. |
OFFSET_CURRENCY_MISMATCH | The documents are in different currencies. |
OFFSET_DATE | The date is in the future or before the issue date of either document. |
OFFSET_EXCEEDS_BALANCE | The amount exceeds the outstanding balance of the invoice or the received document. |
accounting_program.status is pending and reason says why; once created it is sent with internal_document_id. For other programs the set-off is not exported automatically.Completeness requirements for Peppol
An invoice issued via this endpoint is fine as a regular document, but for it to be sendable via Peppol, the resulting UBL XML must pass EN 16931 + Peppol BIS Billing 3.0, plus the Slovak FS overlay. The SK overlay applies when the seller's country is SK, and requires:
| Rule (BT) | Field | Source in the API |
|---|---|---|
SK-BT-35 | Seller street | address.street of the organization |
SK-BT-37 | Seller city | address.city of the organization |
SK-BT-38 | Seller postal code | address.postalCode of the organization |
SK-BT-50 | Buyer street | customer.address.street |
SK-BT-52 | Buyer city | customer.address.city |
SK-BT-53 | Buyer postal code | customer.address.postalCode |
SK-BT-30 | schemeID for the seller's registration ID | derived from the organization's IČO/DIČ |
SK-BT-47 | schemeID for the buyer's registration ID | derived from the buyer's IČO/DIČ |
SK-BT-35-REQUIRED). So when creating an organization and when creating a customer, always send a full address (street + city + postalCode + country).country is not SK gets no e-invoice, even with a Slovak VAT ID: the send fails with „Odosielanie e-faktúr zahraničným odberateľom cez Peppol zatiaľ nie je zapnuté.“ Send such an invoice by e-mail. Do not rewrite a foreign firm's country to SK.Recipient routing in Peppol goes via the buyer's DIČ (sandbox: 9915:<DIČ>, production: 0245:<DIČ>). For correct VAT categorization (BR‑S/BR‑E), both the seller and buyer should have ic_dph. Before sending, you can pre-validate the UBL XML: see Validation.
You send an invoice issued by this endpoint via POST /v1/agent/peppol/send/{id}; right before sending, check it with a dry run via POST /v1/agent/invoices/{id}/preflight (see Recommended flow): no DB writes and no credit charge. The separate /peppol/preflight is only for UBL/CII you assemble yourself. If you assemble the UBL/CII yourself and don't want to go through /agent/invoices, you can validate, reserve credit, and send in a single call via Connector.