ePošťák.sk

Neviete, ktoré API zvoliť? Tri alebo štyri otázky stačia.

Vybrať správny postup

Enterprise API Core

SprievodcoviaEnterprise API: keď potrebujete riadiť každý krok

Enterprise API: keď potrebujete riadiť každý krok

Najkratší tok: token, overenie príjemcu, idempotentné odoslanie, čítanie udalostí a potvrdenie importu. Pokročilé endpointy a Enterprise Full otvorte až vtedy, keď ich konkrétne potrebujete.

Vyberte si integračný tok

Začnite tam, kde sa práve nachádza váš tím: tokeny, odosielanie, príjem alebo prevádzka.

Enterprise Core — začnite tu

Jeden päťkrokový tok od credentialu po bezpečne potvrdenú udalosť. Pokročilé možnosti sú o úroveň nižšie, nie v štartovacej ceste.

  1. Prvé odoslanie do 15 minútToken → preflight → idempotentný send → events pull → batch acknowledge po lokálnom commite.

Začať

Najkratšia cesta od sandbox tokenu po prvé bezpečné volanie.

  1. Získať API tokenAPI kľúč vymeníte za krátkodobý JWT. Enterprise podporuje firemný sk_live_* aj existujúci integrátorský sk_int_* flow; pri volaniach za klienta pridáva integrátor X-Firm-Id.
  2. Overiť príjemcuPred odoslaním zistite, či je firma v Peppole a ktoré typy dokumentov prijíma.

Odosielanie

Ako vytvoriť faktúru, poslať hotový UBL a sledovať výsledok.

  1. Vytvoriť faktúruPošlite údaje faktúry v JSON; ePošťák vytvorí, overí a odošle dokument.
  2. DPH režimy a zálohy v JSONHodnoty pre taxTreatment, vatCategoryCode, staršie sadzby DPH a zúčtované zálohy bez hádania UBL kódov.
  3. Poslať hotový UBL XMLAk už máte platný UBL, pošlite ho priamo; odosielateľa stále kontrolujeme voči autentifikovanej firme.
  4. Sledovať životný cyklus dokladuRozlišujte prijatie requestu, AS4 doručenie, Invoice Response a dôkazový archív.

Príjem a import

Ako čítať prijaté dokumenty, importovať mimo-Peppol UBL a rozhodnúť sa medzi pull a webhookmi.

  1. Prijímať dokumentyNajjednoduchší produkčný tok je pull API s cursorom: čítate nové dokumenty a voliteľne ich acknete po spracovaní.
  2. Importovať prijatý UBLPre email, SFTP alebo migráciu z iného AP uložte UBL do rovnakého inbound inboxu ako sieťové Peppol prijatia.
  3. Webhook fallback alebo Events pullWebhooky sú push signalizácia. Ak nemáte stabilný HTTPS receiver, použite Events pull alebo inbound/outbound pull API.

Bezpečnosť a Box

Čo sa berie z tokenu, čo sa mení pri odoslaní, čo je uložené šifrovane a ako funguje durable ePošťák Box.

  1. Bezpečnosť, identita a úložiskoSender identity je odvodená z autentifikovanej firmy, nie z request body. Citlivé technické secrets a Box payload objekty majú samostatné ochranné pravidlá.
  2. ePošťák Box workflowBox je durable vrstva nad Enterprise/Connector sendom: najprv bezpečne uloží payload, potom worker odosiela podľa plánu, limitov a retry pravidiel.
  3. Dôkazy a retenciaPo odoslaní sledujte UBL, AS4 envelope a evidence bundle oddelene od obchodného stavu faktúry.

Prevádzka

Ako riešiť retry, chyby a voľbu medzi Connectorom a plnou Enterprise API.

  1. Riešiť zlyhané odoslanieNajprv rozlíšte validáciu, recipient capability, transport a post-send DB stav.
  2. Enterprise reliability contractJeden stabilný runtime model: capability → preflight → send → events → support.
  3. Vybrať Connector alebo Enterprise APIConnector je riadený ERP tok. Enterprise API je step-level kontrola pre tímy, ktoré chcú skladať vlastný flow.

Enterprise Core golden path

Použite sandbox host a sandbox credential. Firemný sk_live_* JWT je už naviazaný na jednu firmu. Pri sk_int_* JWT pridajte X-Firm-Id schválenej firmy na prvý autentifikovaný Enterprise request a na každý ďalší firm-scoped Enterprise request. Connector customerRef je iný kontrakt a do týchto volaní nepatrí.

Postup

  1. 01Nastavte BASE_URL=https://dev.epostak.sk a credential v secret manageri.
  2. 02Mintnite JWT raz, cacheujte ho do expires_in a pri 401 obnovte token iba raz.
  3. 03Po prvom tokene vytvorte pre firmu raz pull-only subscription cez POST /webhooks s url=null. Bez nej events/pull nemá z čoho plniť queue.
  4. 04Preflight a send používajú rovnaký receiverPeppolId a firm context.
  5. 05Pri nejasnom výsledku send request neopakujte s novým kľúčom; opakujte rovnaký request s rovnakým Idempotency-Key.
  6. 06Events pull je asynchrónny; v DEV môže nová udalosť doraziť až pri nasledujúcom minútovom worker ticku. Pollujte s backoffom, nie tesnou slučkou.
  7. 07Eventy uložte a aplikujte v lokálnej transakcii. Až potom pošlite event_ids do batch-ack.

Endpoint

POST/api/v1/auth/token
Vyskúšať

1. Token

client_secret zostáva iba na serveri. access_token cacheujte podľa expires_in.

curl
1curl -sS "$BASE_URL/api/v1/auth/token" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "grant_type": "client_credentials",
5 "client_id": "<key-id-or-prefix>",
6 "client_secret": "<secret>"
7 }'

1b. Jednorazové nastavenie pull queue

Spustite raz pre firmu po získaní tokenu. url=null vytvorí pull-only kanál; push webhook je samostatná subscription.

curl
1curl -sS "$BASE_URL/api/v1/webhooks" \
2 -H "Authorization: Bearer $ACCESS_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "url": null,
6 "events": ["document.sent", "document.delivered", "document.received"]
7 }'

2. Preflight

Pri sk_int_* pridajte aj -H "X-Firm-Id: <firm-uuid>". Pri sk_live_* túto hlavičku neposielajte.

curl
1curl -sS "$BASE_URL/api/v1/documents/preflight" \
2 -H "Authorization: Bearer $ACCESS_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{"receiverPeppolId":"0245:4188071545"}'

3. Idempotentný JSON send

Pri retry ponechajte rovnaké telo aj Idempotency-Key.

curl
1curl -sS "$BASE_URL/api/v1/documents/send" \
2 -H "Authorization: Bearer $ACCESS_TOKEN" \
3 -H "Idempotency-Key: erp-fa-2026-0001-v1" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "receiverPeppolId": "0245:4188071545",
7 "receiverName": "ePošťák Test – Prijaté",
8 "invoiceNumber": "FA-2026-0001",
9 "currency": "EUR",
10 "items": [{
11 "description": "Implementačná služba",
12 "quantity": 1,
13 "unitPrice": 100,
14 "vatRate": 23
15 }]
16 }'

3b. Hotový UBL

Alternatíva k JSON sendu pre expert tím s hotovým Peppol BIS UBL.

json
1{
2 "receiverPeppolId": "0245:4188071545",
3 "xml": "<?xml version="1.0" encoding="UTF-8"?><Invoice>...</Invoice>"
4}

4. Pull udalostí

Táto Core queue je server-side ack fronta, nie cursor feed.

curl
1curl -sS "$BASE_URL/api/v1/events/pull" \
2 -H "Authorization: Bearer $ACCESS_TOKEN"

5. Batch acknowledge

Volajte až po úspešnom lokálnom commite. Pri páde pred ackom dostanete event znova.

curl
1curl -sS "$BASE_URL/api/v1/events/batch-ack" \
2 -H "Authorization: Bearer $ACCESS_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{"event_ids":["a3d2c1f0-6b5e-4d7a-9c8b-1e2f3a4b5c6d"]}'

Povinné polia

NázovTypPovinnéPopis
AuthorizationBearer JWTánoKrátkodobý token z /auth/token, nie raw API key.
X-Firm-Iduuid headerniePovinný na firm-scoped Enterprise volaniach iba pri sk_int_* integrátorskom JWT. Pri sk_live_* ho vynechajte.
Idempotency-Keystring headeránoStabilný pre jeden business send a všetky jeho retry pokusy.
requestIdresponse fieldnieUložte pri chybe alebo nejasnom stave pre support.

Práca so stavmi

2xx
Uložte documentId, event ID a requestId skôr, než pokračujete.
401
Obnovte JWT raz; raw API key nikdy neposielajte ako Bearer.
409
Pri idempotency konflikte neregenerujte kľúč; porovnajte pôvodný business request.
429/5xx
Retry s exponenciálnym backoffom, rovnakým telom a rovnakým Idempotency-Key.

Chyby

Wrong firm
sk_int_* bez X-Firm-Id alebo bez aktívneho consentu zlyhá; Connector customerRef sem nepridávajte.
Ack before commit
Predčasný ack môže skryť event, ktorý ERP ešte durable nespracovalo.

Ďalšie kroky

  • Pre inbound obsah pokračujte GET /api/v1/inbound/documents a lokálnym POST /inbound/documents/{id}/ack.
  • Pre expert možnosti otvorte Enterprise Full. Connector a SAPI majú vlastné technické rozhrania a dokumentáciu; zmluvu a platiteľa určuje zvolený obchodný režim, nie názov rozhrania.

Získať API token

API kľúč sk_live_* alebo sk_int_* nikdy neposielajte ako Bearer token priamo. Použite ho ako client_secret v OAuth client_credentials volaní, získajte krátkodobý JWT a ten cacheujte do expirácie. Pri Enterprise volaní s integrátorským JWT určíte schválenú spravovanú firmu cez X-Firm-Id; Connector namiesto toho používa customerRef.

Postup

  1. 01Vezmite client_id a client_secret z API kľúča.
  2. 02Zavolajte POST /api/v1/auth/token s grant_type client_credentials.
  3. 03Používajte access_token ako Authorization: Bearer.
  4. 04Refreshujte cez /api/v1/auth/renew alebo znovu mintnite token pred expiráciou.

Endpoint

POST/api/v1/auth/token
Vyskúšať

Payload (demo integrátor, funguje na dev.epostak.sk)

json
1{
2 "grant_type": "client_credentials",
3 "client_id": "8924a11d-a93c-4d5a-b54b-1f1ff246152c",
4 "client_secret": "sk_int_test_face36350e1005c930acff02a00f73140f2a1eabfb87c282"
5}

Response

json
1{
2 "access_token": "eyJhbGciOiJSUzI1NiIs...",
3 "token_type": "Bearer",
4 "expires_in": 900,
5 "refresh_token": "rt_01JZ8...",
6 "scope": "firms:manage documents:send documents:read documents:write events:read webhooks:read webhooks:write evidence:read account:read reporting:read"
7}

Povinné polia

NázovTypPovinnéPopis
grant_typestringánoPoužite client_credentials.
client_idstringánoUUID API kľúča (alebo jeho key prefix v tvare sk_int_xxxxx...xxxx), presne ako ho ukazuje Integrátorský portál → API kľúče alebo Nastavenia → Prepojenie s účtovným programom. Nie je to OAuth client_id (oc_*) z Nastavení ani webhook secret.
client_secretstringánoCelá hodnota sk_live_* alebo sk_int_*, ktorú portál zobrazí raz pri vytvorení kľúča. OAuth client secret ani webhook secret tu nefungujú.
X-Firm-IdheadernieNeposiela sa na token endpoint. Pri následných Enterprise firm-scoped volaniach je povinný pre sk_int_* integrátorský JWT; Connector ho nepoužíva.

Práca so stavmi

oc_* nie je API kľúč
OAuth klient (oc_*) z Nastavení slúži iba na súhlas firmy cez /oauth/authorize. Na tento endpoint patrí API kľúč zo sekcie API kľúče; s oc_* vráti 401 s vysvetlením.
expires_in=900
Access token platí 15 minút; cacheujte ho.
refresh_token
Refresh token je one-shot a rotuje sa pri /auth/renew.
scopes
Scope-y určujú, ktoré Enterprise API volania môžete robiť.

Chyby

401 INVALID_CLIENT
client_id alebo client_secret nesedia, kľúč je vypnutý alebo používate demo kľúč na zlom hoste.
429 RATE_LIMITED
Token endpoint voláte príliš často; cacheujte access_token.

Ďalšie kroky

  • Pri sk_int_* Enterprise volaniach za klienta pridajte X-Firm-Id až na následné API requesty. Connector používa ten istý typ integrátorského JWT, ale firmu vyberá cez customerRef nastavené integrátorom pre schválenú firmu a X-Firm-Id neposiela.
  • Po získaní tokenu zavolajte /api/v1/auth/status ako lacný health check.

Overiť príjemcu

Pred odoslaním overte, či príjemca existuje v Peppol SMP a či prijíma presný typ dokladu, ktorý chcete poslať. Toto volanie je lacnejšie a čitateľnejšie ako čakať na chybu pri send-e.

Postup

  1. 01Rozdeľte Peppol ID na scheme a identifier.
  2. 02Pošlite documentType alebo documentTypes[] pre presné typy.
  3. 03Odosielajte až keď accepts alebo networkReady potvrdí správny typ.

Endpoint

POST/api/v1/peppol/capabilities
Vyskúšať

Payload example

json
1{
2 "participant": {
3 "scheme": "0245",
4 "identifier": "0000000001"
5 },
6 "documentTypes": [
7 "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1",
8 "urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"
9 ]
10}

Response

json
1{
2 "found": true,
3 "accepts": true,
4 "participant": {
5 "scheme": "0245",
6 "identifier": "0000000001",
7 "id": "0245:0000000001"
8 },
9 "matchedDocumentTypes": [
10 "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##..."
11 ],
12 "capabilities": [
13 {
14 "routingStatus": "ready",
15 "networkReady": true,
16 "accepts": true
17 }
18 ],
19 "source": "smp"
20}

Povinné polia

NázovTypPovinnéPopis
participant.schemestringánoŠtvormiestny ISO 6523 scheme, pre slovenské DIČ typicky 0245.
participant.identifierstringánoIdentifikátor bez prefixu scheme, napr. DIČ bez SK prefixu.
documentTypes[]string[]niePole 1 až 20 Peppol document-type URN hodnôt; má prednosť pred documentType.
processIdstringnieVoliteľný Peppol process ID, ak potrebujete rozlíšiť proces.

Práca so stavmi

found=true
Účastník existuje v SMP.
networkReady=true
Pre daný typ dokumentu existuje použiteľná routa.
accepts=false
Účastník existuje, ale neprijíma požadovaný document type.

Chyby

400 INVALID_PARAMS
Scheme, identifier alebo documentTypes[] majú neplatný tvar.
404 NOT_FOUND
Účastník nie je registrovaný v Peppol SMP.

Ďalšie kroky

  • Ak je route ready, pokračujte POST /api/v1/documents/send s rovnakým receiverPeppolId.
  • Ak prijíma iba iné typy, ukážte používateľovi presnú chybu namiesto retry odoslania.

Vytvoriť a odoslať faktúru

Tento postup ukazuje praktický outbound payload, nie iba hello-world. JSON režim vytvára štandardnú faktúru a ePošťák z nej skladá Peppol BIS 3.0 UBL. Pre self-billing pošlite hotový UBL s InvoiceTypeCode 389 cez pole xml; tým zachováte správne Peppol party role.

Postup

  1. 01Overte príjemcu cez capabilities, hlavne ak ho ešte nemáte v adresári.
  2. 02Pre štandardnú faktúru pošlite JSON payload na POST /api/v1/documents/send. Odosielateľ sa berie z autentifikovanej firmy, príjemcu a položky posielate v tele.
  3. 03Pre self-billing použite UBL XML mode: receiverPeppolId je dodávateľ, AccountingCustomerParty je vaša autentifikovaná firma a InvoiceTypeCode je 389.
  4. 04Uložte documentId/submissionId, messageId, status link a payloadSha256.
  5. 05Sledujte stav cez /status, Events pull alebo outbound events.

Endpoint

POST/api/v1/documents/send
Vyskúšať

Complete invoice payload

Toto je odporúčaná štruktúra pre ERP integráciu: posielajte split adresu, daňové identifikátory, platobné údaje, buyer reference, DPH kategóriu a prílohy ako base64. Polia odosielateľa neposielajte; berú sa z autentifikovanej firmy.

json
1{
2 "receiverPeppolId": "0245:0000000001",
3 "receiverName": "Zakaznik Demo s.r.o.",
4 "receiverIco": "12345678",
5 "receiverDic": "0000000001",
6 "receiverIcDph": "SK0000000001",
7 "receiverStreet": "Testovacia 1",
8 "receiverCity": "Bratislava",
9 "receiverPostalCode": "811 01",
10 "receiverCountry": "SK",
11 "invoiceNumber": "FA-2026-001",
12 "issueDate": "2026-07-01",
13 "dueDate": "2026-07-15",
14 "currency": "EUR",
15 "paymentMethod": "bank_transfer",
16 "iban": "SK9811000000000000000001",
17 "variableSymbol": "2026001",
18 "buyerReference": "PO-2026-0001",
19 "note": "Služby za obdobie jún 2026. Príloha: akceptačný protokol.",
20 "prepayments": [
21 {
22 "advanceInvoiceRef": "ZAL-2026-0004",
23 "taxDocumentRef": "DDP-2026-0022",
24 "settlementDate": "2026-02-23",
25 "amountWithoutVat": 1000,
26 "vatAmount": 230,
27 "amountWithVat": 1230,
28 "vatRate": 23
29 }
30 ],
31 "items": [
32 {
33 "description": "Implementačné práce",
34 "quantity": 16,
35 "unit": "HUR",
36 "unitPrice": 75,
37 "vatRate": 23,
38 "vatCategoryCode": "S",
39 "discount": 5,
40 "deliveryDate": "2026-06-30"
41 },
42 {
43 "description": "Servisná podpora",
44 "quantity": 1,
45 "unit": "C62",
46 "unitPrice": 240,
47 "vatRate": 23,
48 "vatCategoryCode": "S"
49 }
50 ],
51 "attachments": [
52 {
53 "fileName": "akceptacny-protokol.pdf",
54 "mimeType": "application/pdf",
55 "content": "JVBERi0xLjQKJc...",
56 "description": "Podpísaný akceptačný protokol"
57 }
58 ]
59}

Self-billing UBL payload

JSON line-item mode je pre štandardné faktúry. Pri self-billing pošlite UBL XML v poli xml spolu s receiverPeppolId. receiverPeppolId je dodávateľ, ktorému dokument posielate; AccountingCustomerParty je vaša firma ako kupujúci, ktorý self-billing vystavuje.

xml
1<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
2 xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
3 xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
4 <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>
5 <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
6 <cbc:ID>SB-2026-001</cbc:ID>
7 <cbc:IssueDate>2026-07-01</cbc:IssueDate>
8 <cbc:DueDate>2026-07-15</cbc:DueDate>
9 <cbc:InvoiceTypeCode>389</cbc:InvoiceTypeCode>
10 <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
11 <cac:AccountingSupplierParty>
12 <cac:Party>
13 <cbc:EndpointID schemeID="0245">0000000001</cbc:EndpointID>
14 <cac:PartyName><cbc:Name>Dodavatel s.r.o.</cbc:Name></cac:PartyName>
15 <cac:PostalAddress>
16 <cbc:StreetName>Priemyselna 8</cbc:StreetName>
17 <cbc:CityName>Zilina</cbc:CityName>
18 <cbc:PostalZone>010 01</cbc:PostalZone>
19 <cac:Country><cbc:IdentificationCode>SK</cbc:IdentificationCode></cac:Country>
20 </cac:PostalAddress>
21 <cac:PartyTaxScheme>
22 <cbc:CompanyID>SK0000000001</cbc:CompanyID>
23 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
24 </cac:PartyTaxScheme>
25 <cac:PartyLegalEntity>
26 <cbc:RegistrationName>Dodavatel s.r.o.</cbc:RegistrationName>
27 <cbc:CompanyID>12345678</cbc:CompanyID>
28 </cac:PartyLegalEntity>
29 </cac:Party>
30 </cac:AccountingSupplierParty>
31 <cac:AccountingCustomerParty>
32 <cac:Party>
33 <cbc:EndpointID schemeID="0245">2122701339</cbc:EndpointID>
34 <cac:PartyName><cbc:Name>Moja Firma s.r.o.</cbc:Name></cac:PartyName>
35 <cac:PostalAddress>
36 <cbc:StreetName>Street 1</cbc:StreetName>
37 <cbc:CityName>Bratislava</cbc:CityName>
38 <cbc:PostalZone>811 01</cbc:PostalZone>
39 <cac:Country><cbc:IdentificationCode>SK</cbc:IdentificationCode></cac:Country>
40 </cac:PostalAddress>
41 <cac:PartyLegalEntity>
42 <cbc:RegistrationName>Moja Firma s.r.o.</cbc:RegistrationName>
43 </cac:PartyLegalEntity>
44 </cac:Party>
45 </cac:AccountingCustomerParty>
46 <cac:PaymentMeans>
47 <cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>
48 <cbc:PaymentID>2026001</cbc:PaymentID>
49 <cac:PayeeFinancialAccount><cbc:ID>SK9811000000000000000001</cbc:ID></cac:PayeeFinancialAccount>
50 </cac:PaymentMeans>
51 <cac:TaxTotal>
52 <cbc:TaxAmount currencyID="EUR">230.00</cbc:TaxAmount>
53 <cac:TaxSubtotal>
54 <cbc:TaxableAmount currencyID="EUR">1000.00</cbc:TaxableAmount>
55 <cbc:TaxAmount currencyID="EUR">230.00</cbc:TaxAmount>
56 <cac:TaxCategory>
57 <cbc:ID>S</cbc:ID>
58 <cbc:Percent>23</cbc:Percent>
59 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
60 </cac:TaxCategory>
61 </cac:TaxSubtotal>
62 </cac:TaxTotal>
63 <cac:LegalMonetaryTotal>
64 <cbc:LineExtensionAmount currencyID="EUR">1000.00</cbc:LineExtensionAmount>
65 <cbc:TaxExclusiveAmount currencyID="EUR">1000.00</cbc:TaxExclusiveAmount>
66 <cbc:TaxInclusiveAmount currencyID="EUR">1230.00</cbc:TaxInclusiveAmount>
67 <cbc:PayableAmount currencyID="EUR">1230.00</cbc:PayableAmount>
68 </cac:LegalMonetaryTotal>
69 <cac:InvoiceLine>
70 <cbc:ID>1</cbc:ID>
71 <cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
72 <cbc:LineExtensionAmount currencyID="EUR">1000.00</cbc:LineExtensionAmount>
73 <cac:Item>
74 <cbc:Name>Self-billed service</cbc:Name>
75 <cac:ClassifiedTaxCategory>
76 <cbc:ID>S</cbc:ID>
77 <cbc:Percent>23</cbc:Percent>
78 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
79 </cac:ClassifiedTaxCategory>
80 </cac:Item>
81 <cac:Price><cbc:PriceAmount currencyID="EUR">1000.00</cbc:PriceAmount></cac:Price>
82 </cac:InvoiceLine>
83</Invoice>

Response

json
1{
2 "documentId": "clx9abc123",
3 "submissionId": "clx9abc123",
4 "messageId": "msg_peppol_xyz",
5 "status": "SENT",
6 "links": {
7 "document": "/api/v1/documents/clx9abc123",
8 "status": "/api/v1/documents/clx9abc123/status",
9 "events": "/api/v1/documents/clx9abc123/events",
10 "ubl": "/api/v1/documents/clx9abc123/ubl",
11 "evidenceBundle": "/api/v1/documents/clx9abc123/support-packet"
12 },
13 "payloadSha256": "a1b2c3d4e5f6..."
14}

Polia požiadavky

NázovTypPovinnéPopis
receiverPeppolIdstringniePeppol participant ID in scheme:identifier form, for example 0245:2123456789. Required for invoice/credit_note and identifies the buyer. For self-billing it identifies the supplier/Peppol recipient, but supplierPeppolId is the clearer alias.
invoiceNumberstringnieInvoice or credit-note number. If omitted or empty, ePošťák allocates the next number from the authenticated firm's numbering sequence.
issueDatedatenieIssue date in YYYY-MM-DD format. Through 2026 a supplied value is preserved. From 1 January 2027 the legal issue date is the Europe/Bratislava handoff day; generated JSON is normalized and raw UBL with a different IssueDate is rejected.
dueDatedateniePayment due date in YYYY-MM-DD format. Optional.
taxPointDatedatenieVAT tax point date (BT-7) in YYYY-MM-DD format. Kept separate from the actual delivery date. For advance_payment (388) and prepayment_invoice (386) it is the date the payment was received (Slovak VAT Act § 74(1)(d)); required for 388, not after issueDate and not in the future.
deliveryDatedatenieActual delivery date for the whole document (BT-72) in YYYY-MM-DD format.
documentDiscountPercentnumbernieDocument-level discount percentage represented as a Peppol BG-20 allowance. This is additional to any items[].discount. (0–100)
currencystringnieISO 4217 currency code. If omitted, the authenticated firm's default currency is used, falling back to EUR.
notestringnieFree-text invoice note. Use it for a human-readable exemption/reverse-charge reason or other information the receiver must see.
ibanstringniePayment IBAN. If omitted, the authenticated firm's saved IBAN is used when available.
paymentMethodstringniePayment method. Accepted convenience aliases: bank_transfer=30, credit_transfer=30, sepa=58, card=48, cash=10, direct_debit=49. A direct UNCL4461 code such as 30 is also accepted. Omitted defaults to 30 in generated UBL.
variableSymbolstringnieVariable symbol (variabilný symbol) sent as the UBL PaymentID. Only its digits are kept, and the stored value equals the sent one; when more than 10 digits remain, the last 10 are used. A value without digits is treated as not sent. The format is never refused.
buyerReferencestringnieBuyer reference, purchase-order number, or internal procurement reference.
receiverNamestringnieCounterparty legal/business name. Required for invoice/credit_note. For self-billing it identifies the supplier, but supplierName is the clearer alias.
receiverIcostringnieCounterparty company registration number (IČO).
receiverDicstringnieCounterparty tax identification number (DIČ).
receiverIcDphstringnieCounterparty VAT identification number (IČ DPH). For self-billing it is also used to determine supplier-side VAT-payer treatment.
receiverStreetstringnieReceiver street and number. Preferred over parsing receiverAddress.
receiverCitystringnieCounterparty city.
receiverPostalCodestringnieCounterparty postal code.
receiverAddressstringnieSingle-line counterparty address. Prefer receiverStreet, receiverCity and receiverPostalCode when the ERP has split address fields.
receiverCountrystringnieCounterparty country as ISO 3166-1 alpha-2. Defaults to SK.
prepaidAmountnumbernieAmount paid in advance (BT-113). Emitted as LegalMonetaryTotal/PrepaidAmount and reduces PayableAmount. Do not combine with your own items[].lineType=advance_deduction. With prepayments[] it may equal the sum of all prepayments[].amountWithVat; only untaxed advances (without taxDocumentRef) are emitted as PrepaidAmount. For advance_payment (388) it defaults to the total with VAT and, if sent, must equal it within 0.01. (min 0)
itemsobject[]nieBilling lines. Between 1 and 999 entries are accepted. (max 999 položiek / items)
items[].descriptionstringánoNon-empty line name (BT-153). A longer text under the name can be sent as itemDescription (BT-154, max 1000 characters).
items[].quantitynumberánoQuantity. Must not be zero. A negative quantity on a standard line is a discount or returned item (unitPrice stays non-negative). Must be negative for lineType=advance_deduction.
items[].unitstringnieUN/ECE Rec 20 unit code. Use H87 for a piece; C62 is the generic one/unit code. Short aliases are also mapped: ks=H87, kus=H87, piece=H87, pcs=H87, jednotka=C62, unit=C62, one=C62, hod=HUR, den=DAY, mes=MON, kg=KGM, m=MTR, l=LTR, km=KMT. Omitted values default to C62.
items[].unitPricenumberánoNet price per unit. Must be a finite non-negative number. (min 0)
items[].vatRatenumberánoVAT rate in percent. Accepted values: 0, 5, 10, 19, 20, 23; this includes historical 20% for older/corrective documents. Z, AE, E, K, G and O categories require 0; S, L and M require a positive rate. Povolené: 0, 5, 10, 19, 20, 23; historická 20 % sadzba je podporovaná pre staršie doklady/opravné doklady.
items[].vatCategoryCodestringnieDPH category BT-151 according to UNCL5305. A positive rate may derive S. At 0%, vatCategoryCode or taxTreatment is required because 0% can represent Z, E, AE, K, G or O. Najčastejšie: S = štandardná sadzba, Z = nulová sadzba, AE = prenesenie daňovej povinnosti.
items[].discountnumbernieLine discount percentage from 0 to 100. Omitted means 0. (0–100)
items[].deliveryDatestringnieLine delivery date. Written to UBL as cac:InvoiceLine/cac:InvoicePeriod (BT-134 and BT-135, start and end are the same date; ISO timestamps are accepted and only the date part is used) and printed in the PDF under the item name as "Dátum dodania". When the line dates differ, the document is a summary invoice (§ 75 of the Slovak VAT Act): the dates must stay within one calendar month and issueDate must be no later than the 15th day after that month ends.
items[].lineTypestringnieLine type. Use advance_deduction for a negative advance deduction line on the final invoice.
items[].advanceInvoiceReferencestringnieAdvance invoice number. Required when lineType is advance_deduction. Emitted to UBL as AdditionalItemProperty named AdvanceInvoiceNumber.
attachmentsobject[]nieInvoice supporting documents (Peppol BG-24), embedded in UBL as base64 through AdditionalDocumentReference / EmbeddedDocumentBinaryObject. Maximum 20 files, 10 MB decoded per file, and 15 MB decoded total. These limits apply only to this field (JSON mode): a finished UBL sent in XML mode or through SAPI is checked only against the 22 MB document limit, however many attachments it embeds. (max 20 položiek / items)
attachments[].fileNamestringánoNon-empty attachment filename. (max 255 znakov / chars)
attachments[].mimeTypestringánoAllowed MIME types according to Peppol BR-CL-22. The decoded content must match this MIME type.
attachments[].contentbase64ánoBase64-encoded file content without a data: prefix. Must decode to a non-empty file and may be at most 10 MB after decoding.
xmlstringnieKompletne UBL XML (Invoice alebo CreditNote).
Idempotency-KeyheadernieOdporucane pre retry. Rovnaky payload s rovnakym klucom vrati cache; iny payload s tym istym klucom vrati IDEMPOTENCY_KEY_MISMATCH.

Práca so stavmi

SENT
Payload prešiel validáciou a odoslanie bolo prijaté na spracovanie.
DELIVERED
AS4 doručenie bolo potvrdené access pointom príjemcu.
RESPONSE_RECEIVED
Príjemca poslal Invoice Response; spracujte AP/RE/PD/UQ ako obchodnú odpoveď.

Chyby

422 VALIDATION_ERROR
JSON alebo XML neprešlo vstupnou validáciou. Opravte payload a skúste znova.
422 RECIPIENT_NOT_REACHABLE
Príjemca nie je dostupný pre daný typ dokumentu. Nič sa neodoslalo ani nefakturuje.
503 VALIDATION_SERVICE_UNAVAILABLE
Dočasná chyba validačnej služby. Retryujte s rovnakým Idempotency-Key.

Ďalšie kroky

  • Pre audit stiahnite evidence bundle alebo UBL cez links v odpovedi.
  • Ak nechcete hostovať webhook receiver, použite Events pull alebo outbound events.
  • Pre ERP plug-and-play integráciu zvážte Connector; Enterprise API nechajte pre vlastný lifecycle flow.

DPH režimy a zúčtované zálohy

JSON režim má dve vrstvy daňového popisu. Buď pošlete priamo UBL kategóriu <code>vatCategoryCode</code>, alebo vyšší ePošťák alias <code>taxTreatment</code>, ktorý sa na UBL kategóriu namapuje. Pri finálnej faktúre so zúčtovanou zálohou použite <code>prepayments[]</code>; finančný efekt je <code>PrepaidAmount</code>, nie záporný riadok.

Postup

  1. 01<code>standard</code> → <code>S</code>: bežná kladná sadzba DPH, napr. 23 %, 20 %, 10 % alebo 5 % podľa dokladu.
  2. 02<code>zero_rate</code> → <code>Z</code>: bežná nulová sadzba; použite <code>vatRate=0</code>.
  3. 03<code>reverse_charge_domestic</code> → <code>AE</code>: prenesenie daňovej povinnosti; použite <code>vatRate=0</code> a dôvod uveďte aj v poznámke, ak ho má vidieť príjemca.
  4. 04<code>exempt</code> → <code>E</code>, <code>intra_community_supply</code> → <code>K</code>, <code>export</code> → <code>G</code>, <code>outside_scope</code> → <code>O</code>. Ak potrebujete zriedkavejší UBL kód, pošlite priamo <code>vatCategoryCode</code>.
  5. 05Historická 20 % sadzba je povolená vo <code>vatRate</code> pre staršie alebo opravné doklady. Pri oprave nesprávnej sadzby DPH zvyčajne posielajte dobropis/storno pôvodného dokladu a nový doklad so správnou sadzbou.
  6. 06<code>prepayments[].amountWithVat</code> je povinné. Záloha bez <code>taxDocumentRef</code> sa spočíta do <code>prepaidAmount</code>; záloha s <code>taxDocumentRef</code> sa odpočíta záporným riadkom (množstvo −1, sadzba DPH daňového dokladu) s odkazom BT-25 na daňový doklad. <code>advanceInvoiceRef</code>, <code>taxDocumentRef</code>, <code>settlementDate</code> a sadzba DPH sa zachovajú v poznámke UBL dokladu.
  7. 07Ak daňový doklad k prijatej platbe pokrýva viac sadzieb DPH, pošlite jeden <code>prepayments[]</code> záznam pre každú sadzbu s rovnakým <code>taxDocumentRef</code>; každý vytvorí vlastný záporný riadok. Nezdanená záloha daňový rozpis nemení, ten sa skladá z položiek faktúry.

Endpoint

POST/api/v1/documents/send
Vyskúšať

Mix DPH režimov a zúčtovanej zálohy

Príklad finálnej faktúry s bežnou 23 % položkou, prenesením daňovej povinnosti a jednou zúčtovanou zálohou. Hodnoty sú syntetické.

json
1{
2 "receiverPeppolId": "0245:0000000001",
3 "receiverName": "Zakaznik s.r.o.",
4 "invoiceNumber": "FA-2026-1042",
5 "issueDate": "2026-07-09",
6 "dueDate": "2026-07-09",
7 "currency": "EUR",
8 "buyerReference": "PO-2026-603",
9 "note": "Prenesenie daňovej povinnosti podľa §69 ods. 12 zákona o DPH. Záloha ZAL-2026-0004 zúčtovaná na finálnej faktúre.",
10 "prepayments": [
11 {
12 "advanceInvoiceRef": "ZAL-2026-0004",
13 "taxDocumentRef": "DDP-2026-0022",
14 "settlementDate": "2026-02-23",
15 "amountWithoutVat": 1000,
16 "vatAmount": 230,
17 "amountWithVat": 1230,
18 "vatRate": 23,
19 "vatCategoryCode": "S"
20 }
21 ],
22 "items": [
23 {
24 "description": "Dodanie tovaru",
25 "quantity": 10,
26 "unit": "C62",
27 "unitPrice": 100,
28 "vatRate": 23,
29 "taxTreatment": "standard"
30 },
31 {
32 "description": "Tuzemské prenesenie daňovej povinnosti",
33 "quantity": 1,
34 "unit": "C62",
35 "unitPrice": 400,
36 "vatRate": 0,
37 "taxTreatment": "reverse_charge_domestic"
38 }
39 ]
40}

Najdôležitejšie polia

NázovTypPovinnéPopis
items[].taxTreatmentstringnieBusiness alias pre DPH režim: standard, zero_rate, reverse_charge_domestic, exempt, intra_community_supply, export, outside_scope.
items[].vatCategoryCodestringniePriamy UBL kód BT-151. Má prednosť pred taxTreatment.
items[].vatRatenumberánoSadzba v percentách. Pre AE/Z/E/K/G/O použite 0; pre staršie alebo opravné doklady je povolená aj 20 % sadzba.
prepayments[].amountWithVatnumberánoZúčtovaná suma vrátane DPH; nezdanená záloha sa spočíta do BT-113 PrepaidAmount, zdanená (s taxDocumentRef) sa odpočíta záporným riadkom.
prepayments[].vatRatenumbernieSadzba DPH zúčtovanej zálohy; povinná pri taxDocumentRef a použije sa na záporný riadok. Zapíše sa aj do poznámky k zálohe.
notestringnieVoľný text pre dôvod nulovej DPH, prenesenia daňovej povinnosti alebo detailný rozpad zálohy, ktorý má vidieť príjemca.

Poslať hotový UBL XML

Ak váš ERP už generuje Peppol BIS Billing 3.0 UBL, nemusíte ho mapovať späť do JSON line-item payloadu. Pošlite JSON telo s poľom xml; ePošťák ho overí, skontroluje party voči autentifikovanej firme a odošle cez AS4.

Postup

  1. 01Vygenerujte UBL Invoice alebo CreditNote v Peppol BIS Billing 3.0.
  2. 02Pošlite { receiverPeppolId, xml } na /documents/send s Idempotency-Key.
  3. 03Uložte documentId, messageId, links a payloadSha256.

Endpoint

POST/api/v1/documents/send
Vyskúšať

Payload example

Toto je UBL hodnota pre pole xml v JSON requeste. receiverPeppolId posielajte vedľa nej v tom istom JSON tele.

xml
1<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
2 xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
3 xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
4 <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>
5 <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
6 <cbc:ID>FA-2026-001</cbc:ID>
7 <cbc:IssueDate>2026-07-01</cbc:IssueDate>
8 <cac:AccountingSupplierParty>...</cac:AccountingSupplierParty>
9 <cac:AccountingCustomerParty>
10 <cac:Party>
11 <cbc:EndpointID schemeID="0245">0000000001</cbc:EndpointID>
12 </cac:Party>
13 </cac:AccountingCustomerParty>
14 <cac:InvoiceLine>...</cac:InvoiceLine>
15</Invoice>

Response

json
1{
2 "documentId": "clx9ubl123",
3 "messageId": "msg_peppol_ubl_xyz",
4 "status": "SENT",
5 "links": {
6 "status": "/api/v1/documents/clx9ubl123/status",
7 "ubl": "/api/v1/documents/clx9ubl123/ubl",
8 "supportPacket": "/api/v1/documents/clx9ubl123/support-packet"
9 },
10 "payloadSha256": "b4c5d6..."
11}

Povinné polia

NázovTypPovinnéPopis
Content-Typeheaderánoapplication/json. UBL XML posielajte ako string v poli xml.
Invoice/CreditNoteXMLánoUBL 2.1 doklad kompatibilný s Peppol BIS Billing 3.0.
AccountingSupplierPartyXML nodeánoPri štandardnej faktúre musí zodpovedať autentifikovanej firme: buď firme viazanej na sk_live_* JWT, alebo firme vybranej cez X-Firm-Id pri sk_int_* JWT. Pri self-billing je to dodávateľ, ktorému dokument posielate.
AccountingCustomerParty/EndpointIDXML nodeánoPri štandardnej faktúre Peppol ID príjemcu. Pri self-billing musí zodpovedať autentifikovanej firme ako kupujúcemu.

Práca so stavmi

SENT
UBL prešiel validáciou a bol odoslaný alebo prijatý na odoslanie.
SENT_DB_PENDING
Transport prebehol, lokálny stav sa dorovná reconciliation workerom.

Chyby

422 UBL_VALIDATION_ERROR
XML je dobre formované, ale porušuje Peppol/CEN pravidlo.
403 SENDER_MISMATCH
Party, ktorá má patriť autentifikovanej firme, sa nezhoduje. Pri štandardnej faktúre je to supplier; pri self-billing customer.

Ďalšie kroky

  • Pre preflight bez odoslania použite POST /api/v1/payloads/validate.
  • Ak migrujete hotové UBL prijaté mimo Peppolu, použite inbound import, nie outbound send.

Sledovať životný cyklus dokladu

Odpoveď zo send endpointu znamená, že request bol prijatý a odosielanie prebehlo alebo beží. Pre účtovný a supportný stav sledujte samostatne technický transport, business odpoveď príjemcu a dôkazový archív.

Postup

  1. 01Pollujte /documents/{id}/status pre aktuálny stav.
  2. 02Použite /outbound/events pre cursor stream udalostí.
  3. 03Pre audit stiahnite UBL, AS4 envelope alebo evidence bundle.

Endpoint

GET/api/v1/documents/{id}/status
Vyskúšať

Payload example

curl
1curl https://epostak.sk/api/v1/documents/clx9abc123/status \
2 -H "Authorization: Bearer eyJhbGc..."

Response

json
1{
2 "documentId": "clx9abc123",
3 "status": "DELIVERED",
4 "messageId": "msg_peppol_xyz",
5 "sentAt": "2026-07-01T09:02:11.000Z",
6 "deliveredAt": "2026-07-01T09:02:18.000Z",
7 "invoiceResponseStatus": "AP",
8 "links": {
9 "events": "/api/v1/documents/clx9abc123/events",
10 "evidenceBundle": "/api/v1/documents/clx9abc123/support-packet"
11 }
12}

Povinné polia

NázovTypPovinnéPopis
idstringánodocumentId alebo submissionId zo send odpovede.
cursorstringniePri event streame cursor z predchádzajúcej odpovede.

Práca so stavmi

SENT
Doklad bol odoslaný na Peppol transport alebo je prijatý na odoslanie.
DELIVERED
Access point príjemcu potvrdil doručenie.
REJECTED
Príjemca alebo validačná vrstva odmietla doklad.

Chyby

404 NOT_FOUND
Doklad neexistuje, patrí inej firme alebo ešte nie je v danej projekcii.
409 PENDING
Niektoré dôkazové artefakty môžu vzniknúť až pár minút po transporte.

Ďalšie kroky

  • Pre customer support ukladajte messageId a event IDs spolu s vaším externalId.
  • Invoice Response AP/RE/PD/UQ spracujte ako obchodný stav, nie ako transportný stav.

Prijímať dokumenty

Najspoľahlivejší produkčný príjem je cursor-based pull API. ERP pravidelne číta nové dokumenty, ukladá next_cursor a po spracovaní môže dokument explicitne acknúť.

Postup

  1. 01Pollujte /inbound/documents s limitom.
  2. 02Spracujte metadata a stiahnite raw UBL podľa links.ubl.
  3. 03Ak potrebujete checkpoint, zavolajte ack až po úspešnom importe.

Endpoint

GET/api/v1/inbound/documents
Vyskúšať

Payload example

curl
1curl "https://epostak.sk/api/v1/inbound/documents?limit=50" \
2 -H "Authorization: Bearer <firm_access_token>"

Response

json
1{
2 "items": [
3 {
4 "id": "inb_01JZ8...",
5 "direction": "inbound",
6 "documentType": "invoice",
7 "senderPeppolId": "0208:987654321",
8 "receiverPeppolId": "0245:0000000001",
9 "receivedAt": "2026-07-01T09:15:30.000Z",
10 "links": {
11 "document": "/api/v1/inbound/documents/inb_01JZ8...",
12 "ubl": "/api/v1/inbound/documents/inb_01JZ8.../ubl",
13 "ack": "/api/v1/inbound/documents/inb_01JZ8.../ack"
14 }
15 }
16 ],
17 "next_cursor": "eyJpZCI6ImluYl8wMU..."
18}

Povinné polia

NázovTypPovinnéPopis
cursorstringnieCursor z predchádzajúcej odpovede next_cursor.
limitintegernieMax počet dokumentov na stránku; držte stabilnú hodnotu pri pollingu.

Práca so stavmi

received
Dokument je uložený a pripravený na čítanie.
acknowledged
Vaša integrácia potvrdila, že dokument spracovala.

Chyby

401 UNAUTHORIZED
Token chýba alebo expiroval.
403 FORBIDDEN
Token nemá potrebný scope, firma nie je API-eligible alebo sk_int_* integrátor nemá aktívny súhlas k firme z X-Firm-Id.

Ďalšie kroky

  • Pre surový XML payload použite links.ubl a parsujte prílohy z UBL.
  • Ak nechcete polling dokumentov, webhook nechajte iba ako signál a dokument stále čítajte cez inbound API.

Importovať prijatý UBL

Tento endpoint používajte, keď máte prijatý UBL mimo Peppol siete — napríklad z emailu, SFTP, manuálnej migrácie alebo z predchádzajúceho access pointu — a chcete ho dostať do rovnakého inboxu ako sieťové prijatia.

Postup

  1. 01Pošlite raw XML alebo JSON s xml.
  2. 02Skontrolujeme receiver identity proti firme.
  3. 03Dostanete rovnaké links ako pri Peppol inbound dokumente.

Endpoint

POST/api/v1/inbound/import
Vyskúšať

Payload example

json
1{
2 "source": "email",
3 "messageId": "mail-2026-07-01-001",
4 "xml": "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\">...</Invoice>"
5}

Response

json
1{
2 "documentId": "inb_import_01JZ8...",
3 "submissionId": "inb_import_01JZ8...",
4 "status": "RECEIVED",
5 "kind": "invoice",
6 "source": "api_import",
7 "links": {
8 "document": "/api/v1/inbound/documents/inb_import_01JZ8...",
9 "ubl": "/api/v1/inbound/documents/inb_import_01JZ8.../ubl",
10 "ack": "/api/v1/inbound/documents/inb_import_01JZ8.../ack"
11 }
12}

Povinné polia

NázovTypPovinnéPopis
xmlstringánoUBL XML payload, raw body alebo JSON pole xml.
sourcestringniePôvod importu, napr. email, sftp alebo migration.
messageIdstringnieExterný audit identifikátor z pôvodného kanála. Dedup/retry kontrakt používa Idempotency-Key.

Práca so stavmi

RECEIVED
UBL bol uložený do inbound schránky a správa sa ako sieťovo prijatý dokument.
duplicate: true
Rovnaký Idempotency-Key s rovnakým XML a metadátami vráti pôvodný dokument bez nového uploadu.

Chyby

422 RECEIVER_MISMATCH
Receiver party nepatrí firme, v mene ktorej importujete: pri štandardnej faktúre AccountingCustomerParty, pri self-billing AccountingSupplierParty.
422 INVALID_UBL
XML nie je čitateľný UBL doklad.

Ďalšie kroky

  • Po importe spracujte dokument rovnakým kódom ako sieťové inbound dokumenty.
  • Ak chcete len parsovať UBL bez uloženia, použite parse endpoint, nie import.

Webhook fallback alebo Events pull

Webhooky používajte ako real-time signál. Ak klient nemá stabilný verejný HTTPS receiver, vytvorte pull subscription a čítajte eventy cez GET /api/v1/events/pull. Pre samotné dokumenty je stále najspoľahlivejšie čítať inbound/outbound pull API.

Postup

  1. 01Pre push nastavte URL a overujte HMAC podpis.
  2. 02Pre pull fallback vytvorte subscription bez URL a čítajte Events pull.
  3. 03Po evente čítajte dokument cez document links alebo pull API.

Endpoint

POST/api/v1/webhooks
Vyskúšať

Payload example

json
1{
2 "url": null,
3 "events": [
4 "document.sent",
5 "document.received",
6 "document.delivered",
7 "document.delivery_failed",
8 "document.mls_received",
9 "document.rejected",
10 "document.response_received"
11 ]
12}

Response

json
1{
2 "id": "whk_01JZ8...",
3 "mode": "pull",
4 "events": [
5 "document.received",
6 "document.rejected",
7 "document.response_received"
8 ],
9 "secretPreview": "whsec_...last4",
10 "status": "active"
11}

Povinné polia

NázovTypPovinnéPopis
urlstring | nullnieVerejný HTTPS receiver pre push; null pre Events pull.
events[]string[]ánoTypy udalostí, napr. document.received, document.mls_received alebo document.response_received.
X-Webhook-SignatureheaderánoHMAC podpis prijatého push webhooku.

Práca so stavmi

active
Subscription prijíma alebo frontuje udalosti.
failedAttempts
Po terminálnych zlyhaniach sa counter zvyšuje; úspech ho znižuje.
auto-disabled
Po opakovaných terminálnych chybách sa push subscription vypne.

Chyby

400 INVALID_URL
URL nie je verejný HTTPS endpoint alebo narazila na SSRF guard.
410 GONE
Receiver signalizuje trvalé vypnutie; retry sa nerobí.

Ďalšie kroky

  • Webhook receiver musí byť idempotentný podľa webhook_event_id.
  • Pri push používajte 503 pre transient chyby; 500 považujeme za terminálny stav.
  • Ak potrebujete dokument, použite event iba ako signál a následne čítajte pull API.

Bezpečnosť, identita a úložisko

Tento postup vysvetľuje hranice Enterprise API: ktoré hodnoty môže poslať vaša integrácia, ktoré hodnoty ePošťák odvodzuje z autentifikácie a ktoré citlivé objekty chránime šifrovaným uložením alebo jednosmerným hashom.

Postup

  1. 01Pre Enterprise vymeňte firemný sk_live_* alebo integrátorský sk_int_* za JWT cez /auth/token; API secret neposielajte ako Bearer token.
  2. 02Pri sk_int_* Enterprise volaniach pošlite X-Firm-Id schválenej spravovanej firmy; server vždy znovu overí väzbu, consent scopes a plan eligibility. Pri sk_live_* JWT X-Firm-Id neposielajte. Connector používa customerRef namiesto X-Firm-Id.
  3. 03Pri JSON invoice mode sa odosielateľské údaje nesmú brať z request body; UBL sa skladá s firmou z autentifikácie.
  4. 04Pri raw UBL mode kontrolujeme party role: štandardná faktúra vyžaduje authenticated supplier, self-billing vyžaduje authenticated customer. Túto stranu následne nahradíme údajmi z profilu firmy (identifikátor, IČO, názov, adresa, IČ DPH, právna forma), takže odoslaný XML sa v nej môže líšiť od vášho.
  5. 05Box ukladá dokumentový payload šifrovane a v zoznamoch/detailoch vystavuje iba operačné metadata ako status, payloadSha256, veľkosť, retenciu a odkazy na akcie.

Endpoint

POST/api/v1/auth/token
Vyskúšať

Identity boundary example

Toto nie je API požiadavka. Ukazuje, čo môže poslať ERP a čo ePošťák berie zo server-side identity.

json
1{
2 "requestBodyMaySet": [
3 "receiverPeppolId",
4 "receiverName",
5 "invoiceNumber",
6 "items",
7 "attachments"
8 ],
9 "derivedFromAuthContext": {
10 "firmId": "firm-scoped JWT subject",
11 "senderPeppolId": "registered firm Peppol participant",
12 "senderName": "firm legal name",
13 "senderTaxIds": "firm registry data"
14 },
15 "rawUblPartyGuard": {
16 "standardInvoice": "AccountingSupplierParty must match authenticated firm",
17 "selfBillingInvoiceTypeCode389": "AccountingCustomerParty must match authenticated firm"
18 }
19}

Protected storage surfaces

Box detail a webhook správa zámerne vracajú bezpečné metadata namiesto plaintextu.

json
1{
2 "boxPayload": {
3 "stored": "encrypted at rest",
4 "publicDetail": [
5 "status",
6 "storageBytes",
7 "payloadSha256",
8 "retention",
9 "action links"
10 ],
11 "notReturnedInListOrDetail": [
12 "raw UBL body",
13 "attachments",
14 "plain storage location"
15 ]
16 },
17 "webhookSigningSecret": {
18 "returned": "once on create or rotate",
19 "stored": "encrypted at rest",
20 "verification": "HMAC-SHA256 over timestamp + body"
21 }
22}

Bezpečnostné pravidlá

NázovTypPovinnéPopis
AuthorizationheaderánoKrátkodobý Bearer JWT z /api/v1/auth/token.
X-Firm-IdheaderniePovinné pri Enterprise firm-scoped volaniach s integrátorským sk_int_* JWT; pri sk_live_* JWT a Connector endpointoch sa neposiela.
sender identityderivedánoOdvodená z autentifikovanej firmy. JSON payload nemá právo prepísať odosielateľa.
payloadSha256sha256nieHash uloženého UBL/payload objektu pre dedup, support a audit bez odhaľovania obsahu.
webhook secretsecretnieVracia sa iba raz pri vytvorení alebo rotácii webhooku; v ePošťákovi sa ukladá šifrovane.

Práca so stavmi

scoped
Volanie je naviazané na jednu autorizovanú firmu zo sk_live_* tokenu alebo z overeného sk_int_* + X-Firm-Id kontextu.
redacted
Detailné API vracia hash a bezpečné metadata, nie plaintext payload.
returned once
Webhook secret sa po vytvorení nedá spätne prečítať; pri strate ho rotujte.

Chyby

403 SENDER_MISMATCH
UBL party, ktorá má patriť autentifikovanej firme, sa nezhoduje.
403 FORBIDDEN
Token nemá scope alebo firm access pre požadovanú firmu.
422 INVALID_URL
Webhook URL narazila na HTTPS/SSRF pravidlá.

Ďalšie kroky

  • Pri vlastnom ERP UI zobrazujte používateľovi firmu z auth contextu, nie odosielateľa z lokálneho draftu.
  • Do supportu posielajte requestId, documentId, messageId a payloadSha256; neposielajte API secrets ani celý UBL, ak stačí hash.

ePošťák Box workflow

Box používajte, keď ERP nechce riskovať nejasný stav medzi uložením faktúry a odoslaním do Peppolu. Položka vznikne ako durable záznam, má vlastné storage metadata, audit timeline, plán odoslania a retry/cancel/send-now akcie.

Postup

  1. 01POST /api/v1/box/items je Enterprise skratka nad stagingom; Connector /outbox používa rovnakú Box vrstvu pre ERP-first flow.
  2. 02Každá položka dostane boxItemId, status, payloadSha256, retention a links na ďalšie akcie.
  3. 03Detail vracia bezpečný storage summary a timeline, nie raw UBL alebo plaintext object key.
  4. 04Ready/scheduled položku odošlite workerom alebo send-now. Failed alebo needs_repair položku opravte a odošlite znovu; neodoslanú položku môžete zrušiť.

Endpoint

POST/api/v1/box/items
Vyskúšať

Stage payload

Toto je single-item Box staging. Pri Connector batch outboxe použite rovnakú položku vo vnútri items[].

json
1{
2 "externalId": "ERP-FA-2026-001",
3 "scheduledFor": "2026-07-01T08:00:00.000Z",
4 "idempotencyKey": "erp-fa-2026-001:v1",
5 "payload": {
6 "receiverPeppolId": "0245:0000000001",
7 "receiverName": "Zakaznik s.r.o.",
8 "invoiceNumber": "FA-2026-001",
9 "items": [
10 {
11 "description": "Servisna podpora",
12 "quantity": 1,
13 "unitPrice": 240,
14 "vatRate": 23
15 }
16 ]
17 }
18}

Stage response

Box list a detail držia operačné metadata. Plaintext dokument čítajte iba cez autorizované dokumentové endpointy alebo evidence flow.

json
1{
2 "total": 1,
3 "ready": 1,
4 "items": [
5 {
6 "boxItemId": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
7 "status": "scheduled",
8 "source": "connector_outbox",
9 "documentId": null,
10 "payloadSha256": "2f5c1d9a9e...",
11 "storageBytes": 8421,
12 "retention": {
13 "expiresAt": "2036-07-01T00:00:00.000Z",
14 "reason": "billing_evidence"
15 },
16 "links": {
17 "self": "/api/v1/box/items/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
18 "sendNow": "/api/v1/box/items/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/send-now",
19 "retry": "/api/v1/box/items/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/retry",
20 "cancel": "/api/v1/box/items/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/cancel"
21 }
22 }
23 ]
24}

Detail storage summary

Detail potvrdí, že payload existuje, je chránený a má auditovateľný hash. Dokumentový obsah sa z Box detailu nesťahuje.

json
1{
2 "boxItemId": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
3 "storage": {
4 "objects": [
5 {
6 "purpose": "canonical_ubl",
7 "objectKeyHash": "sha256:6c7a...",
8 "contentType": "application/xml",
9 "sizeBytes": 8421,
10 "payloadSha256": "2f5c1d9a9e...",
11 "encryption": {
12 "algorithm": "AES-256-GCM"
13 }
14 }
15 ]
16 },
17 "timeline": [
18 {
19 "type": "audit",
20 "event": "epostak_box.outbound.ready",
21 "actorType": "system",
22 "occurredAt": "2026-07-01T07:55:01.000Z"
23 }
24 ]
25}

Polia Box položky

NázovTypPovinnéPopis
payloadobjectnieRovnaký send payload ako pri /documents/send; ak chýba, použije sa koreňové telo.
externalIdstringnieERP korelačný identifikátor pre dedup a spätné mapovanie.
scheduledFordatetimenieBudúci ISO 8601 čas plánovaného odoslania.
idempotencyKeystringnieIdempotentné zaradenie tej istej položky.
payloadSha256responsenieHash uloženého payload objektu, vhodný pre audit a support.

Práca so stavmi

ready
Položka je pripravená na odoslanie.
scheduled
Worker ju odošle po scheduledFor a podľa tenant/rate limitov.
needs_repair
Preflight alebo mapping našiel blokujúci problém; opravte dáta a skúste odoslanie znovu.
failed
Transport alebo spracovanie zlyhalo; pozrite lastError a timeline.

Chyby

409 DISPATCH_POINTER_UNAVAILABLE
send-now nemá Connector/Enterprise pointer; použite detail a repair flow.
422 INVALID_SCHEDULE
scheduledFor musí byť budúci ISO čas.

Ďalšie kroky

  • Pre veľké ERP importy používajte batch Connector outbox a nechajte worker dávkovať odosielanie.
  • Pre audit ukladajte boxItemId, externalId a payloadSha256 vedľa vášho interného ID faktúry.

Dôkazy a retencia

Dôkazový tok nie je to isté ako obchodný stav faktúry. Transport môže byť doručený, Invoice Response môže prísť neskôr a ZIP evidence bundle môže byť pripravený až po vytvorení technických artefaktov.

Postup

  1. 01Po send-e uložte documentId/submissionId, Peppol messageId a payloadSha256.
  2. 02Pollujte status alebo outbound events, kým transport a evidence state nedávajú očakávaný výsledok.
  3. 03Evidence bundle sťahujte cez autorizovaný endpoint; pri 409/PENDING skúste neskôr.

Endpoint

GET/api/v1/documents/{id}/status
Vyskúšať

Download evidence bundle

curl
1curl -L "https://epostak.sk/api/v1/documents/clx9abc123/support-packet" \
2 -H "Authorization: Bearer eyJhbGc..." \
3 -o evidence-clx9abc123.zip

Evidence state response

json
1{
2 "documentId": "clx9abc123",
3 "status": "DELIVERED",
4 "messageId": "msg_peppol_xyz",
5 "payloadSha256": "b4c5d6...",
6 "evidence": {
7 "bundleReady": true,
8 "transportReceipt": "available",
9 "as4Envelope": "available"
10 },
11 "links": {
12 "ubl": "/api/v1/documents/clx9abc123/ubl",
13 "evidence": "/api/v1/documents/clx9abc123/evidence",
14 "evidenceBundle": "/api/v1/documents/clx9abc123/support-packet"
15 }
16}

Povinné polia

NázovTypPovinnéPopis
documentIdstringánoID z odpovede send/status alebo Connector detailu.
messageIdstringniePeppol korelácia na transportnej vrstve.
payloadSha256stringnieHash payloadu, ktorý v supporte pomáha bez posielania celého XML.

Práca so stavmi

bundleReady
ZIP s dostupnými technickými artefaktmi je pripravený na stiahnutie.
PENDING
Niektoré artefakty sa ešte vytvárajú; skúste požiadavku zopakovať neskôr.

Chyby

404 NOT_FOUND
Doklad nepatrí firme alebo evidence endpoint preň zatiaľ nemá artefakt.
409 PENDING
Dôkazový balík ešte nie je kompletný.

Ďalšie kroky

  • Pre support stačí najprv poslať documentId, messageId, payloadSha256 a čas odoslania.
  • Vo vlastnom archíve ukladajte aj váš externalId, aby ste vedeli spojiť ERP faktúru s Peppol dôkazmi.

Riešiť zlyhané odoslanie

Pri chybe najprv určite, v ktorej vrstve vznikla: vstupný payload, Peppol capability, schematron validácia, transport alebo lokálne uloženie po odoslaní. Každá vrstva má iný režim opakovania.

Postup

  1. 01Pozrite HTTP status a error.code.
  2. 02Pri retry použite rovnaký Idempotency-Key.
  3. 03Ak bol transport úspešný, sledujte status/eventy namiesto opätovného send-u.

Endpoint

POST/api/v1/documents/send
Vyskúšať

Payload example

json
1{
2 "receiverPeppolId": "0245:0000000001",
3 "receiverName": "Zakaznik s.r.o.",
4 "items": []
5}

Response

json
1{
2 "error": {
3 "code": "VALIDATION_ERROR",
4 "message": "items must contain at least one line",
5 "fields": {
6 "items": "Required"
7 }
8 },
9 "requestId": "req_01JZ8..."
10}

Povinné polia

NázovTypPovinnéPopis
error.codestringánoPrimárna vetva pre rozhodnutie, čo opraviť alebo opakovať.
requestIdstringnieKorelačný identifikátor pre support/debug.
Idempotency-KeyheaderniePoužite rovnaký kľúč pri opakovaní toho istého payloadu.

Práca so stavmi

retryable
503 alebo dočasné transportné chyby opakujte s rovnakým idempotency key.
fix payload
422 VALIDATION_ERROR/UBL_VALIDATION_ERROR vyžaduje opravu dát.
track status
SENT_DB_PENDING alebo prijaté send ID sledujte cez status/eventy.

Chyby

422 VALIDATION_ERROR
JSON schema alebo povinné polia zlyhali; opravte vstup.
422 UBL_VALIDATION_ERROR
UBL porušuje Peppol/CEN pravidlá; opravte XML alebo mapping.
409 CONFLICT (idempotency in flight)
Rovnaký kľúč už beží; počkajte a skontrolujte stav neskôr.

Ďalšie kroky

  • Do support ticketu pridajte requestId, documentId/submissionId, messageId a payloadSha256.
  • Ak neviete, či príjemca prijíma typ dokladu, začnite guide-om Check receiver.

Enterprise reliability contract

Enterprise API má pôsobiť ľahko, ale integrátor potrebuje presné runtime pravidlá. Používajte jeden flow: capability → preflight → send → events → support. Tento model drží business chyby, retry a support dáta mimo dashboardu a priamo v API kontrakte.

Postup

  1. 01Capability: zavolajte POST /api/v1/peppol/capabilities a branchujte podľa networkReady, matchedDocumentTypes a routing statusu.
  2. 02Preflight: zavolajte POST /api/v1/documents/preflight pre rovnaký documentTypeId/processId a blokované výsledky opravte pred sendom.
  3. 03Send: POST /api/v1/documents/send opakujte iba s rovnakým Idempotency-Key, ak ide o ten istý payload.
  4. 04Events: čítajte GET /api/v1/events/pull a acknowledge after local commit cez /api/v1/events/{eventId}/ack alebo /api/v1/events/batch-ack; neacknuté eventy server vráti znova.
  5. 05Support: pri incidente ukladajte requestId + support-packet, documentId/submissionId, messageId a payloadSha256.

Endpoint

POST/api/v1/peppol/capabilities
Vyskúšať

Runtime state

json
1{
2 "receiver": {
3 "peppolId": "0245:0000000001",
4 "networkReady": true,
5 "matchedDocumentTypes": ["urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##..."]
6 },
7 "send": {
8 "idempotencyKey": "erp-FAK-2026-001",
9 "documentId": "doc_01JZ8...",
10 "requestId": "req_01JZ8..."
11 },
12 "events": {
13 "lastEventCursor": "evt_cur_01JZ8...",
14 "ackPolicy": "acknowledge after local commit"
15 },
16 "support": {
17 "supportPacket": "/api/v1/documents/doc_01JZ8.../support-packet",
18 "payloadSha256": "7f9c..."
19 }
20}

Čo má ERP ukladať

NázovTypPovinnéPopis
networkReadybooleanánoVýsledok capability checku pre rozhodnutie, či vôbec skladať alebo poslať payload.
matchedDocumentTypesstring[]niePresné Peppol document-type URN-y, ktoré príjemca akceptuje.
Idempotency-KeyheaderánoStabilný kľúč pre retry toho istého send payloadu.
last acknowledged event idstringánoPosledný lokálne commitnutý a acknutý event, aby ERP import vedel po reštarte pokračovať idempotentne.
requestId + support-packetsupport fieldsánoMinimálny support balík spolu s documentId/submissionId, messageId a payloadSha256.

Práca so stavmi

networkReady=true
Príjemca prijíma daný typ dokladu; pokračujte preflightom.
preflight blocked
Payload alebo routing opravte pred sendom; neposielajte naslepo.
event unacked
Event ostáva na opakované načítanie, kým ho ERP po lokálnom commite nepotvrdí.

Chyby

participant_not_found
Príjemca nie je zaregistrovaný v Peppol sieti. Prijatý doklad skončí v stave recipient_not_found: povinnosť odosielateľa je splnená, TDD zabezpečuje ePošťák; doručte ho inou cestou. Opätovné odoslanie nie je povinné: ak sa odberateľ v zákonnej 15-dňovej lehote dodatočne zaregistruje, ten istý doklad môžete poslať znova (nový Idempotency-Key, rovnaký payload) a ePošťák potom Finančnej správe automaticky nahlási opravu (TDD Resubmit). Ak pri odoslaní pošlete emailFallback: true, faktúru (PDF a odoslané UBL XML) odberateľovi raz pošleme e-mailom na receiverEmail, a ak ho nepošlete, na e-mail odberateľa z UBL (cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail); výsledok je v emailFallback v stave dokladu a vo webhooku document.delivery_failed.
temporary_transport_error
Retryable runtime chyba; opakujte s backoffom a rovnakým Idempotency-Key.
delivery_dead_lettered
Pre support použite events, requestId a support-packet pred manuálnym retry.

Ďalšie kroky

  • Ak chcete menej krokov, použite Connector; tento kontrakt je pre tímy, ktoré chcú plnú Enterprise API kontrolu.
  • Testujte flow v sandboxe (žiadosť na dev.epostak.sk/dev) na testovacích protistranách alebo v ERP Test Lab pred produkčným go-live.

Vybrať Connector alebo Enterprise API

Connector a Enterprise API nie sú dve značky pre to isté. Connector je ERP-facing managed flow nad Enterprise API; Enterprise API je nižšia vrstva pre tímy, ktoré chcú vlastné workflow, webhooky, dôkazy a viacfiriemnú kontrolu. SAPI je štandardizovaný transportný režim.

Postup

  1. 01Vyberte Connector pre rýchly ERP inbox/outbox.
  2. 02Vyberte Enterprise API pre vlastný lifecycle a dôkazy.
  3. 03Vyberte SAPI pre kompatibilitu so SAPI-SK transportným kontraktom.

Endpoint

GET/api/v1/connector/sync
Vyskúšať

Payload example

json
1{
2 "scenario": "ERP wants plug-and-play Peppol mailbox",
3 "recommendedPath": "Connector",
4 "why": [
5 "polling-first sync",
6 "repair report before send",
7 "mapper/template support"
8 ]
9}

Response

json
1{
2 "scenario": "Platform manages many firms and custom evidence",
3 "recommendedPath": "Enterprise API",
4 "firstEndpoints": [
5 "POST /api/v1/auth/token",
6 "POST /api/v1/documents/send",
7 "GET /api/v1/inbound/documents",
8 "POST /api/v1/webhooks"
9 ]
10}

Povinné polia

NázovTypPovinnéPopis
Connectorproduct pathnieManaged ERP tok: mailbox, mapper, outbox, sync a repair report.
Enterprise APIproduct pathnieKontrolovaná API vrstva: send, inbound, webhooky, dôkazy, multi-firm.
SAPIcompatibility pathnieTransport-only kompatibilita so SAPI-SK, nie dashboard ani Connector flow.

Práca so stavmi

Connector
Najlepšie pre ERP tímy, ktoré chcú rýchly managed flow.
Enterprise API
Najlepšie pre platformy a integrátorov so step-level kontrolou.
SAPI
Použite iba keď potrebujete štandardný transportný kontrakt.

Chyby

Wrong abstraction
Ak ERP tím začne Enterprise API bez potreby vlastného lifecycle, integrácia bude zbytočne dlhšia.
Missing firm context
Pri sk_int_* Enterprise volaniach v mene klienta nezabudnite X-Firm-Id a aktívny consent. Connector používa customerRef nastavené v Integrátorskom portáli pre schválenú firmu; X-Firm-Id na jeho endpointoch neposielajte.

Ďalšie kroky

  • Pre Connector začnite mailbox/sync flowom a SDK konfiguráciou.
  • Pre Enterprise API začnite tokenom, recipient capability checkom a prvým send payloadom.
  • Pre SAPI držte payload ako UBL XML a sledujte iba transportný kontrakt.

Demo testovacie účty

Tieto kľúče sú zámerne verejné a fungujú len v sandboxe dev.epostak.sk.

Prostredia sú oddelené. DEV/test: použite tieto demo kľúče na https://dev.epostak.sk/api/v1/auth/token alebo SAPI https://dev.epostak.sk/sapi/v1/auth/token. LIVE/produkcia: použite vlastné produkčné credentials na https://epostak.sk/api/v1/auth/token alebo SAPI https://epostak.sk/sapi/v1/auth/token. Demo kľúče na LIVE hoste zámerne vrátia Invalid client credentials. Pri existujúcich Enterprise volaniach cez integrátorský kľúč (sk_int_*) priložte X-Firm-Id cieľovej spravovanej firmy. Na Connector endpointoch namiesto toho použite customerRef nastavené pre schválenú firmu a X-Firm-Id neposielajte.

Test Odosielateľ (Participant 1)

0245:0000000001
client_id
487d008a-b3a5-49d0-be3e-ba45cc9c4ffe
client_secret
sk_live_test_5e188b91708ca938e1ee50678b345a3c152b4d4a83d31eac
X-Firm-Id
f2cea3cf-f29e-4ea2-9e76-b06a312ec9ab

Test Prijímateľ (Participant 2)

0245:0000000002
client_id
b6649c59-2f9d-4ae2-a750-af257c455478
client_secret
sk_live_test_e8a28d2e5ec006b2e27a3a1a92739fd93f1d71e70abe6733
X-Firm-Id
b1022d80-5016-4dad-a8d2-53685cab1701

Demo Integrátor (ERP)

integrátor
client_id
8924a11d-a93c-4d5a-b54b-1f1ff246152c
client_secret
sk_int_test_face36350e1005c930acff02a00f73140f2a1eabfb87c282

Integrátorský kľúč je naviazaný na obe demo participantské firmy vyššie. Na existujúcich Enterprise endpointoch určíte cieľovú firmu cez X-Firm-Id — f2cea3cf-f29e-4ea2-9e76-b06a312ec9ab (Test Odosielateľ) alebo b1022d80-5016-4dad-a8d2-53685cab1701 (Test Prijímateľ). Na nových Connector endpointoch použite customerRef nastavené v Integrátorskom portáli pre danú schválenú firmu a X-Firm-Id vynechajte.

Enterprise Core

Odporúčaný stabilný kontrakt pre nový Enterprise kód: 18 operácií, jeden golden path a uzavretý OpenAPI profil.

Začnite Core profilom

Importujte iba Core OpenAPI. Obsahuje token, capabilities, preflight, send, status, pull/webhook events, inbound fetch/ack, support packet a klientske pozvánky. Core je filtrovaný pohľad na jeden Enterprise OpenAPI dokument, nie samostatne udržiavaný kontrakt.

Firm context — jedno pravidlo

sk_live_* token je viazaný na firmu. Pri sk_int_* pridajte X-Firm-Id na každý firm-scoped Enterprise request. Connector vyberá firmu cez customerRef a SAPI cez participant scope; tieto tri mechanizmy nemiešajte.

Retry bez duplicity

Pre jeden business send držte rovnaký Idempotency-Key a rovnaký payload. Event batch acknowledge patrí až za durable lokálny commit.

Kľúč pre inštaláciu u zákazníka

Partner môže po zapnutí tejto funkcie vytvoriť sk_int_* obmedzený na jednu oprávnenú firmu. Pri lokálnej inštalácii ERP uložte u zákazníka tento kľúč. Hlavný partnerský kľúč ponechajte na vlastnom serveri.

Súhlas a existujúce oprávnenia

Najprv musí existovať aktívne oprávnenie partnera voči overenej firme. Kľúč zachováva existujúce účtovanie, platiteľa a dostupné rozhrania. Nenahrádza súhlas, overenie firmy ani jej prevádzkovú pripravenosť. Priame firemné sk_live_* zostávajú v existujúcom postupe.

Vytvorenie cez portál alebo spoločné API

V správe kľúčov zvoľte Prístup k firmám a konkrétnu firmu. Automatizácia používa GET/POST /api/v1/integrator/keys a DELETE /api/v1/integrator/keys/{keyId} s JWT z hlavného kľúča s keys:manage. POST prijíma name, scopes, ipAllowlist a voliteľné scopedFirmId. Tajomstvo key sa zobrazí iba raz. Aj SAPI klienti používajú tieto Enterprise Core endpointy. Nové hlavné kľúče majú keys:manage v predvolenom výbere; existujúce explicitné oprávnenia sa nerozširujú. Pri vypnutom vydávaní nie je výber firmy dostupný a POST s scopedFirmId vráti FIRM_KEY_ISSUANCE_DISABLED.

Použitie a výmena

Výmena sk_int_* za JWT sa nemení. Naďalej posielajte požadované X-Firm-Id, Peppol ID alebo customerRef; identifikátor musí označovať povolenú firmu. Obmedzený kľúč nespravuje kľúče, consent ponuky ani celý účet. Limit je päť aktívnych hlavných kľúčov a päť obmedzených kľúčov na firmu u integrátora. Pri výmene vytvorte nový kľúč, nasaďte ho a zrušte starý. Zrušenie kľúča alebo oprávnenia voči firme zablokuje aj vydané JWT. Nový súhlas staré kľúče neobnoví.

Onboarding klienta

Pre koho je Enterprise API a ako napojíte prvého klienta — cez účet a súhlas vlastníka, alebo cez samostatný White Label provider webhook a zápis participanta do SMP bez účtu ePošťák. Detailné endpointy, oprávnenia a podpisovanie webhookov sú nižšie v sekciách Authentication, Endpoints a Webhooks.

Dve oddelené produkčné cesty. Pri priamom konte alebo technickej delegácii si klient zvolí ePošťák a potvrdí vlastný účet, súhlas a účtovanie. Pri White Label si klient v portáli Finančnej správy SR zvolí konkrétneho integrátora; klient si účet ePošťák nevytvára a neprechádza registráciou ePošťáka. Sandbox slúži iba na technické overenie. Produkčné oprávnenie integrátora vznikne až po go-live kontrole, príslušnej zmluve a spolupodpise Kaja Solutions.
Vetva A — priame konto alebo technická delegácia. Klient si v portáli Finančnej správy SR zvolí ePošťák (Kaja Solutions s.r.o.), vytvorí si konto a dokončí vlastný súhlas. Táto vetva používa registráciu ePošťáka. Detail je v článku Ako si zvoliť digitálneho poštára.
Vetva B — White Label bez účtu ePošťák. Klient si v portáli Finančnej správy SR zvolí integrátora. Finančná správa doručí jednorazový verification_token na podpísaný provider webhook integrátora. Integrátor zavolá POST /white-label/participants/registrations; platforma odovzdá kód do SMP a lokálnu firmu aj väzbu vytvorí až po potvrdení úspešného zápisu. Následne integrátor zavolá alebo zopakuje POST /customers. Klient nepoužíva PFS registráciu, OAuth, konto ani zákaznícke e-maily ePošťáka; túto vrstvu zabezpečuje integrátor pod vlastnou značkou.
Krok 2: Partner s aktívnou zmluvou technického partnera vytvorí v partnerskom konte chránený jednorazový odkaz viazaný na IČO alebo DIČ, primárne plánované rozhranie a presné oprávnenia. Primárne rozhranie zostáva evidenčným údajom a neobmedzuje partnera iba na jedno API. Odkaz odošle firme vlastným bezpečným kanálom; systém firmu nevyhľadáva ani jej automaticky neposiela e-mail. Vlastník alebo správca správnej firmy na jednej stránke jedným potvrdením prijme vlastný zmluvný balík API a účtovanie (objednávka sa aktivuje hneď) a udelí odvolateľný súhlas. Partner naďalej používa svoj sk_int_*; pri Enterprise API vyberá firmu cez X-Firm-Id a pri Connectori cez customerRef. Firemný sk_live_* tajný kľúč nedostane.
Krok 3: Technická delegácia aj spravovaný režim môžu cez jeden centrálny sk_int_* používať SAPI, Connector s customerRef aj Enterprise API iba v rozsahu súhlasu firmy. Pri technickej delegácii platí firma vlastnú spotrebu; v spravovanom režime platí integrátor súhrnne. Samostatný firemný sk_live_* zostáva priamou alternatívou. Voľba rozhrania sama neurčuje zmluvnú stranu ani platiteľa.
Pred produkciou si vyžiadajte sandbox na <a href="https://dev.epostak.sk/dev">dev.epostak.sk/dev</a>. Prístup s testovacími firmami príde e-mailom do pár minút (medzitým funguje demo integrátor nižšie); v sandboxe nájdete integrátorský účet a dve hotové testovacie firmy A a B, prihlásite sa na <a href="https://dev.epostak.sk/integrator">dev.epostak.sk/integrator</a>. Súhlas firmy funguje ako v produkcii: pošlete žiadosť o súhlas (API, OAuth „Prepojiť s ePošťákom“ alebo portál), e-mail príde na vašu adresu, prihlásite sa ako testovacia firma a súhlas prijmete. Produkcia je oddelená: technický partner podpisuje zmluvu technického partnera a firmy podpisujú vlastné API objednávky; spravovaný integrátor podpisuje integrátorskú zmluvu a platí súhrnne. Produkčné kľúče vzniknú až po príslušnom spolupodpise Kaja Solutions a splnení go-live podmienok.

Mapa API referencie

Prehľad zvyšku dokumentácie: prostredia, hlavné API oblasti, request/response pravidlá a odporúčaný spôsob čítania endpointov.

SDK-first quickstart

Odporúčaná cesta je oficiálne SDK: token cacheuje, drží customerRef pri každom volaní a sprístupňuje documents, events aj acknowledge v jednom customer-scoped klientovi. TypeScript je publikovaný na npm; Python, PHP, .NET, Java a Ruby sú dostupné ako zdrojový kód na GitHube.

  • customer = client.connector.customers.for(customerRef)
  • customer.documents.send(...) → customer.events.list(...) → customer.documents.acknowledge(...)
  • Raw HTTP používa rovnaký tok token → documents → events → acknowledge a na Connector endpointoch neposiela X-Firm-Id.

Prostredia

Produkcia a dev sandbox sú oddelené hosty s oddelenými kľúčmi, dátami a Peppol/SMP nastaveniami.

  • Produkcia: https://epostak.sk/api/v1
  • Sandbox: https://dev.epostak.sk/api/v1
  • Demo kľúče používajte iba na dev hoste.

Core documents

Základný send flow: validovať payload, overiť príjemcu, spustiť preflight, odoslať a sledovať lifecycle.

  • JSON faktúra alebo hotový UBL XML.
  • Idempotency-Key je povinný pre bezpečný retry.
  • Support packet je preferovaný podklad pre support.

Alternative formats

PDF/sken, UBL parse, konverzia a validácia patria do Payload Assistant flow pred odoslaním.

  • OCR extract necháva integrátorovi review checklist.
  • Legacy /extract a /documents/* helpery ostávajú podporované.

Integration

Webhook push, Events pull a Connector sú samostatné integračné režimy. Vyberte podľa toho, či ERP hostuje receiver, potrebuje iba eventy alebo chce managed mailbox.

  • Events pull je preferovaná pull alternatíva k webhookom.
  • Connector je ERP-facing managed flow nad Enterprise API.

Partner/admin

Integrátorské firmy, licencie, klientské consent-y a usage/reporting sú oddelené od bežného document flow.

  • sk_int_* tokeny naďalej podporujú existujúce Enterprise firm-scoped volania cez X-Firm-Id aj cross-firm partner endpointy; nový Connector používa customerRef bez X-Firm-Id.
  • Usage/reporting používajte na billing a prevádzkové kontroly.
Request format. Všetky JSON endpointy používajú Content-Type: application/json. UBL/XML endpointy akceptujú buď raw XML, multipart file alebo JSON wrapper podľa konkrétneho endpointu; presný tvar je vždy v sekcii endpointu.
Response format. Úspešné odpovede vracajú stabilné IDs ako documentId, submissionId, peppolMessageId alebo cursor. Chyby branchujte podľa error.code a ukladajte requestId.
Ako čítať reference. Každá sekcia nižšie začína prehľadom podobným API reference mapám: kedy ju použiť, ktoré endpointy sú hlavné a čo je legacy/compatibility. Detail endpointov je potom presný kontrakt pre implementáciu.

Autentifikácia

OAuth 2.0 client_credentials — vymeňte API kľúč za krátkodobý JWT. Priamy klient prijme vlastný zmluvný balík API a po spolupodpise Kaja Solutions spravuje sk_live_* vo firemnom konte. Technický partner prijme zmluvu technického partnera a používa centrálny sk_int_* iba pre firmy, ktoré prijali vlastnú API objednávku, platia vlastnú spotrebu a udelili mu odvolateľný súhlas. Spravovaný integrátor používa centrálny sk_int_* a platí súhrnne podľa integrátorskej zmluvy. Firemný tajný kľúč sa partnerovi nikdy neposiela. V oboch partnerských režimoch sú dostupné SAPI, Connector s customerRef aj Enterprise API; zvolený režim naďalej určuje platiteľa. Ceny sú na https://epostak.sk/cennik.

Token lifecycle

API kľúč je secret na mintovanie tokenu, nie bearer pre bežné requesty.

  • POST /api/v1/auth/token vráti access_token a refresh_token.
  • Access token cacheujte; nevolajte token endpoint pred každým requestom.
  • Rotácia secretu invaliduje aktívne tokeny.
Životnosť tokenov. POST /api/v1/auth/token vráti dva tokeny: access_token (JWT, RS256) s platnosťou 15 minút (expires_in: 900) a refresh_token (rt_…) s platnosťou 30 dní. Refresh token rotujete cez POST /api/v1/auth/renew — server vám vráti novú dvojicu, starý refresh sa okamžite invaliduje (one-shot, replay → 401).
Cachovanie tokenu. Nikdy nevolajte /auth/token pred každým API requestom — minete limit endpointu /auth/token (10 požiadaviek za minútu na kľúč) a zaťažíte si latenciu o ~100 ms na každú operáciu. Cachujte access_token v pamäti (alebo v zdieľanom Redis-e pri viacerých workeroch) a používajte ho do expirácie. Refreshujte buď proaktívne ~1 minútu pred uplynutím expires_in, alebo reaktívne pri prvej 401 odpovedi (skúste raz získať nový token a request zopakovať). Pri rotácii sa SDK štandardne stará o cache automaticky; pri vlastnej implementácii pamätajte, že refresh_token je one-shot.
Zneplatnenie. Token môžete kedykoľvek zneplatniť cez POST /api/v1/auth/revoke — pri access tokene sa jeho jti pridá do Redis blocklistu na zvyšok jeho TTL, pri refresh tokene sa zmaže server-side stav. Endpoint je idempotentný (vždy 200). Pri rotácii kľúča (POST /auth/rotate-secret) sa všetky aktívne tokeny okamžite zneplatnia.
GET/api/v1/auth/status

Introspekcia kľúča

Returns metadata about the calling API key: permissions, linked firm, plan, rate-limit window. Cheap health-check alternative to /account.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl https://epostak.sk/api/v1/auth/status \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Introspection OK
{
  "key": {
    "id": "b1c2d3e4-...",
    "name": "Production key",
    "prefix": "sk_live_abc...xxxx",
    "permissions": "*",
    "active": true,
    "createdAt": "2025-04-01T08:00:00.000Z",
    "lastUsedAt": "2026-04-22T10:30:00.000Z"
  },
  "firm": {"id":"b1022d80-5016-4dad-a8d2-53685cab1701","peppolStatus":"active"},
  "plan": {"name":"api-enterprise","expiresAt":null,"active":true},
  "rateLimit": {"perMinute":1000,"window":"60s","source":"plan-default","note":"effective default — see Rate limits section for endpoint-specific caps"},
  "integrator": null
}

Odpovede

  • 200Introspection OK
  • 401Invalid or missing API key
  • 403API plan required
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/auth/rotate-secret

Rotovať API kľúč

Issues a new API key with the same name/permissions and marks the old one inactive immediately. The new key is returned ONCE in the response. Integrator keys (sk_int_*) are not rotatable via this endpoint — use the integrator dashboard.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/auth/rotate-secret \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Key rotated
{
  "key": "sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "prefix": "sk_live_xxx...xxxx",
  "message": "Key rotated. Save it — it will not be shown again. The previous key is now inactive."
}

Odpovede

  • 200Key rotated
  • 401Invalid or missing API key
  • 403Integrator keys cannot be rotated via this endpoint, or API plan required
  • 404API key not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/account

Info o konte

Vrati zakladne informacie o firme, stav Peppol registracie, aktivny plan a statistiky odoslanych/prijatych dokumentov.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl https://epostak.sk/api/v1/account -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Informacie o ucte
{
  "firm": {"name":"Moja Firma s.r.o.","ico":"12345678","dic":"2020123456","icDph":"SK2020123456","peppolId":"0245:2020123456","peppolStatus":"active"},
  "plan": {"name":"api-enterprise","status":"active"},
  "usage": {"outbound":47,"inbound":12,"ocrExtractions":5},
  "limits": {"documentsPerMonth":-1}
}

Odpovede

  • 200Informacie o ucte
  • 401Missing or invalid API key
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404Firma nenajdena
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/audit

Audit log firmy

Per-firm security/auth audit log. Tenant-isolated by firmId from JWT (sk_live_*) or X-Firm-Id header (sk_int_*). Cursor pagination over (occurred_at DESC, id DESC). Requires audit:read scope and an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
limitinteger (query)optional1–100 (default: 20)
eventstring (query)optionalExact event name match (e.g. jwt.issued, webhook.created)
actor_typestring (query)optional (povolené: user, apiKey, integratorKey, system)
sincedatetime (query)optional
untildatetime (query)optional
cursorstring (query)optionalOpaque cursor from previous response's next_cursor

Príklady volania

cURL
curl "https://epostak.sk/api/v1/audit?limit=20&event=jwt.issued" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Audit events
{
  "items": [
    {
      "id": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
      "occurred_at": "2026-05-10T15:00:00.000Z",
      "actor_type": "apiKey",
      "actor_id": "ak_22222222...",
      "event": "jwt.issued",
      "target_type": "firm",
      "target_id": "11111111-...",
      "ip": "1.2.3.4",
      "user_agent": "epostak-sdk/3.2.0",
      "metadata": {"scope": "documents:send"}
    }
  ],
  "next_cursor": "eyJvY2N1cnJlZEF0Ijoi...",
  "has_more": true
}

Odpovede

  • 200Audit events
  • 401Invalid or missing token
  • 403Plan does not allow this endpoint
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/internal/integrator/oauth/clients

Registrovať OAuth klienta

Registrácia nového OAuth klienta pre integrátora. Vráti client_id a client_secret. Auth: integrátorský JWT (sk_int_* kľúč).

Parametre

NázovTypPovinnéPopis
namestringREQNázov OAuth klienta
redirect_urisstring[]REQPovolené redirect URI (HTTPS alebo localhost)
logo_urlstringoptionalURL loga zobrazené na consent obrazovke

Príklady odpovedí

201 Created (client_secret sa zobrazí len raz — uložte si ho okamžite.)
{
  "client_id": "oc_abc123def456",
  "client_secret": "ocsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "name": "My ERP Integration",
  "redirect_uris": ["https://app.tokinu.sk/api/efaktura/oauth/callback"]
}

Odpovede

  • 201Created (client_secret sa zobrazí len raz — uložte si ho okamžite.)
  • 401Unauthorized
  • 409Conflict
GET/oauth/authorize

Autorizačná URL

Vstup „Prepojiť s ePošťákom“ pre prihláseného vlastníka alebo správcu firmy v aplikácii integrátora. Presmerujte klienta na túto URL. Vlastník alebo správca sa prihlási, vidí zhrnutie ponuky (kto, čo a za akých podmienok) a klikne na „Povoliť prístup“. Toto kliknutie je súhlas firmy: ak už existuje platný prijatý súhlas pokrývajúci požadované oprávnenia (scopes), použije sa; inak sa vytvorí ponuka súhlasu a prijme sa rovnakým postupom ako odkaz na súhlas (consent link) — s uložením ponuky a jej odtlačku, KYC záznamu, aktiváciou väzby integrátora na firmu a webhookom consent.accepted. Podmienky (spravovaný integrátor alebo technický partner) sa berú zo zmluvy integrátora rovnako ako pri POST /api/v1/firms/consent-link. Výsledné oprávnenia = požadované ∩ oprávnenia OAuth klienta ∩ oprávnenia ponuky a musia obsahovať firms:manage a aspoň jedno documents:*. Ak parameter scope vynecháte, aplikácia žiada celý štandardný rozsah integrátora (firms:manage, documents:send, documents:read, documents:write, events:read, webhooks:read, webhooks:write, evidence:read, account:read, reporting:read); pôvodný trojprvkový zoznam OAuth klienta sa už nepoužíva ako strop. Potom je klient presmerovaný späť na redirect_uri s jednorazovým kódom (platí 10 minút). Dôvody odmietnutia: INVALID_CLIENT, INVALID_SCOPE, FORBIDDEN (nie je vlastník ani správca), WHITE_LABEL_API_ONLY, PFS_SELECTION_REQUIRED, PFS_ACTIVATION_IN_PROGRESS (503), INTEGRATOR_NOT_READY, CONSENT_STATE_CHANGED, TEMPORARILY_UNAVAILABLE (503), BILLING_TRANSITION_CONFLICT, FIRM_PEPPOL_IDENTITY_REQUIRED, FIRM_IDENTITY_REQUIRED; limit 20 žiadostí za minútu. Na dev.epostak.sk (DEV) beží rovnaký postup ako v produkcii; súhlas sa tam zaznamená ako sandboxový dôkaz a nevzniká reálne účtovanie. Parameter certification_mode=recovery sa už nepoužíva (ak ho pošlete, ignoruje sa).

Parametre

NázovTypPovinnéPopis
client_idstringREQID vášho OAuth klienta
redirect_uristringREQRegistrovaná callback URL
response_typestringREQcode (povolené: code)
scopestringoptionalfirms:manage documents:send documents:read — ak je prázdne, použije sa celý rozsah klienta
statestringoptionalodporúčané pre CSRF ochranu — náhodný reťazec
code_challengestringREQPKCE code challenge (SHA-256) (43–128 znakov)
code_challenge_methodstringREQS256 (povolené: S256)

Príklady volania

cURL
https://epostak.sk/oauth/authorize
  ?client_id=oc_abc123def456
  &redirect_uri=https://myerp.sk/oauth/callback
  &response_type=code
  &scope=firms:manage%20documents:send%20documents:read
  &state=random_csrf_token
  &code_challenge=BASE64URL(SHA256(code_verifier))
  &code_challenge_method=S256

Odpovede

  • 302Redirect
  • 400Bad Request
POST/api/oauth/token

Výmena kódu za kľúč

Public endpoint at https://epostak.sk/api/oauth/token (NOT under /api/v1/). Exchange an authorization code of an older consent (one created without a consent offer) for a new firm-bound client secret. The returned secret is not a bearer token; exchange it via POST /api/v1/auth/token to mint the short-lived JWT used on /api/v1/* routes. Supports PKCE via code_verifier. A code of a consent created from a consent offer (every new "Povoliť prístup" approval and every consent link) is refused with 400 invalid_grant and is NOT used: redeem the same code at POST /oauth/firm-consent, which returns the firm identifiers for your central sk_int_* key.

Parametre

NázovTypPovinnéPopis
grant_typestringREQ (povolené: authorization_code)
codestringREQ
client_idstringREQ
client_secretstringREQ
redirect_uristringREQ
code_verifierstringoptionalPKCE code verifier (optional)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/oauth/token" \
  -H "Content-Type: application/json" \
  -d '{
  "grant_type": "authorization_code",
  "code": "auth_code_here",
  "client_id": "client_id_here",
  "client_secret": "client_secret_here",
  "redirect_uri": "https://example.com/callback",
  "code_verifier": "pkce_verifier_here"
}'

Príklady odpovedí

200 Integrator client secret issued
{
  "client_id": "sk_live_xxxxx...abcd",
  "client_secret": "sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "secret_type": "sk_live",
  "token_type": "client_secret",
  "scope": "firms:manage documents:send documents:read",
  "firm_id": "b1022d80-5016-4dad-a8d2-53685cab1701",
  "firm_name": "Kaja Solutions s.r.o.",
  "firm_ico": "12345678"
}

Odpovede

  • 200Integrator client secret issued
  • 400Invalid grant or request parameters (RFC 6749 error body)
  • 401Invalid client credentials (RFC 6749 error body)
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/auth/tokenCore

Mint a JWT access token (OAuth 2.0 client_credentials)

Exchange a sk_live_* or sk_int_* API key for a short-lived JWT access token + refresh token. Body (JSON or application/x-www-form-urlencoded): - grant_type: must be client_credentials - client_id: the client_id shown with the key; it must match the API key row UUID or displayed key prefix and must not be the secret - client_secret: the full sk_live_* or sk_int_* key - scope (optional): space-separated subset of the key's allowed scopes Response (RFC 6749): ```json { "access_token": "eyJhbGciOiJSUzI1NiIs...", "token_type": "Bearer", "expires_in": 900, "refresh_token": "rt_...", "scope": "documents:send documents:read" } ``` Errors use Peppol error envelope: { error: { category, code, message, retryable, correlation_id, details? } }. Failed-credential throttling: after 5 invalid attempts within 15 min, repeated exact-pair attempts and further invalid guesses targeting the same client_id return 423. A valid secret is authenticated before client-wide failure state is enforced and remains usable. This endpoint is the canonical Enterprise URL; /sapi/v1/auth/token is the SAPI-spec equivalent and shares the same handler.

Parametre

NázovTypPovinnéPopis
grant_typestringREQ (povolené: client_credentials)
client_idstringREQThe client_id shown with the key. It must match the API key row UUID or displayed key prefix; it is not the sk_live_*/sk_int_* secret.
client_secretstringREQThe full sk_live_* or sk_int_* API key.
scopestringoptionalOptional space-separated subset of the credential's effective allowed scopes. Omitting it returns that allowed set. Unknown names and known but ungranted scopes are rejected.
api_interfacestringoptionalOptional interface selector. /api/v1/auth/token defaults to enterprise_api; Connector integrations should send connector. /sapi/v1/auth/token only accepts sapi. (povolené: sapi, enterprise_api, connector)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/auth/token" \
  -H "Content-Type: application/json" \
  -d '{
  "grant_type": "client_credentials",
  "client_id": "string",
  "client_secret": "string"
}'

Odpovede

  • 200Access token + refresh token issued
  • 400Invalid grant_type or malformed body
  • 401Invalid client credentials
  • 403Requested scope(s) not allowed by key
  • 423Invalid credential attempts throttled after 5 failures; valid credentials remain usable
  • 429Rate limit exceeded
POST/api/v1/auth/renew

Refresh access token using a refresh token

Rotate a refresh token: returns a new access JWT (15 min) + a new refresh token (30 days). The old refresh token is invalidated. Body: ```json { "grant_type": "refresh_token", "refresh_token": "rt_..." } ``` Refresh tokens are stateless JWTs verified server-side via Redis presence — once consumed, they cannot be reused (replay → 401).

Parametre

NázovTypPovinnéPopis
grant_typestringREQ (povolené: refresh_token)
refresh_tokenstringREQ

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/auth/renew" \
  -H "Content-Type: application/json" \
  -d '{
  "grant_type": "refresh_token",
  "refresh_token": "string"
}'

Odpovede

  • 200New access + refresh token
  • 400Missing or malformed refresh_token
  • 401Refresh token invalid, expired, or already consumed
  • 429Rate limit exceeded
POST/api/v1/auth/revoke

Revoke an access or refresh token (RFC 7009)

Idempotent — always returns 200. Revoking an access token adds its jti to the Redis blocklist for the remainder of its lifetime. Revoking a refresh token deletes its server-side state. Body: ```json { "token": "&lt;jwt or refresh token&gt;", "token_type_hint": "access_token" | "refresh_token" } ``` token_type_hint is optional; the server detects the type automatically (eyJ prefix → JWT, rt_ prefix → refresh).

Parametre

NázovTypPovinnéPopis
tokenstringREQEither a JWT access token (starts with eyJ) or a refresh token.
token_type_hintstringoptionalOptional hint — the server detects type automatically. (povolené: access_token, refresh_token)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/auth/revoke" \
  -H "Content-Type: application/json" \
  -d '{
  "token": "string"
}'

Odpovede

  • 200Token revoked (or was already invalid — idempotent)
  • 400Missing token field
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/auth/token/status

Inspect current JWT — expiry, refresh hint, scope

Returns metadata about the JWT presented in Authorization: Bearer. Useful for SDKs to decide whether to renew before making a long-running request.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/auth/token/status" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Token introspection
  • 401Missing or invalid JWT
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/auth/ip-allowlist

Get IP allowlist for current key

Returns the IP allowlist for the API key authenticating this request. Empty array → no IP restriction (any caller IP allowed). Per-key, not per-firm — sk_live_* and sk_int_* allowlists live in their own tables. Requires account:read scope and an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/auth/ip-allowlist" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Current allowlist
  • 401Invalid or missing token
  • 403Plan does not allow this endpoint
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
PUT/api/v1/auth/ip-allowlist

Replace IP allowlist for current key

Replaces the IP allowlist for the API key authenticating this request. Each entry is either a bare IP (v4 or v6) or a CIDR addr/prefix. Max 50 entries. Empty array clears the restriction. Cache is busted so changes are effective on the next request. Requires account:read scope and an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
ip_allowliststring[]REQmax 50 položiek / items

Príklady volania

cURL
curl -X PUT "https://epostak.sk/api/v1/auth/ip-allowlist" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "ip_allowlist": [
    "203.0.113.42"
  ]
}'

Odpovede

  • 200Updated allowlist
  • 400Invalid entry or too many entries
  • 401Invalid or missing token
  • 403Plan does not allow this endpoint
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/licenses/info

Plan and current-period usage

Returns the firm's plan tier, current billing period usage (outbound + inbound API counts), overage so far, quota remaining, estimated month cost, and pricing tiers. Use for billing dashboards and quota warnings. Requires account:read scope and an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/licenses/info" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Plan + usage snapshot
  • 401Invalid or missing token
  • 403Plan does not allow this endpoint
  • 404Firm not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/integrator/keysCore

Create an integrator API key

Potrebný scope: keys:manage

Requires a JWT from an unrestricted sk_int_* key with keys:manage. Browser sessions, direct firm credentials and firm-scoped keys are not accepted. Shared Enterprise Core operation, including for SAPI partners; it does not grant additional document interfaces. Optional scopedFirmId permanently binds the key to one currently authorized firm. Issuance of scoped keys must be enabled by the operator. Requested scopes must be a subset of the caller grant and current firm consent; scoped keys cannot hold keys:manage. Omitting scopes selects applicable defaults. Five active unrestricted keys per integrator and five scoped keys per integrator/firm are permitted. The secret is returned only once. POST is not idempotent; inspect the key list after an uncertain response before retrying. This operation does not activate billing or complete KYC.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
namestringoptionalmax 80 znakov / chars
scopesstring[]optional
ipAllowliststring[]optionalmax 50 položiek / items
scopedFirmIduuidoptionalImmutable firm restriction; null for an unrestricted main key.

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/integrator/keys" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Odpovede

  • 201Created; save the secret now
  • 400Invalid input or five-key limit reached
  • 401Invalid token
  • 403Issuance disabled, unauthorized firm, excessive scopes or missing authorization
  • 409Concurrent update; retry later
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
DELETE/api/v1/integrator/keys/{keyId}Core

Revoke an integrator API key by ID

Potrebný scope: keys:manage

Requires a JWT from an unrestricted sk_int_* key with keys:manage. Browser sessions, direct firm credentials and firm-scoped keys are not accepted. Shared Enterprise Core operation, including for SAPI partners; it does not grant additional document interfaces. Revokes the specified key and its existing JWTs. Only the last active unrestricted main key is protected.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
keyIduuidREQ

Príklady volania

cURL
curl -X DELETE "https://epostak.sk/api/v1/integrator/keys/<keyId>" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200API key deactivated
  • 400Invalid body, already inactive, or last active unrestricted main key
  • 401Invalid or missing token
  • 403Missing keys:manage, restricted key, or missing current partner authorization
  • 404API key not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.

Payload Assistant

Najľahšia cesta od PDF, skenu, UBL alebo JSON vstupu k validnému payloadu pre odoslanie cez Peppol.

Create payload

Použite OCR/PDF alebo UBL helpery, keď ERP ešte nemá čistý send JSON.

  • Extract vráti checklist missing_fields, field_sources a next_action.
  • Parse/convert pomáha pri migrácii z hotového UBL alebo interného formátu.

Validate before send

Vývojový cyklus má najprv validovať payload, až potom vytvárať dokument alebo send.

  • Validation nič neodosiela a nevytvára produkčný doklad.
  • Preflight pridáva Peppol routing a receiver capability kontrolu.
Od vstupu k send payloadu. PDF pošlite na OCR iba raz. Ak odpoveď vyžaduje kontrolu, pošlite jej extraction a všetky opravy naraz na POST /api/v1/payloads/review; tento krok už OCR nespúšťa. Hotový payload potom odošlite cez POST /api/v1/documents/preflight a POST /api/v1/documents/send.
POST/api/v1/payloads/extract

Extrahovať jeden súbor

Canonical Payload Assistant OCR extraction endpoint. Call OCR once, then correct its response through POST /payloads/review by sending the returned extraction and all human corrections together; the review endpoint does not upload the PDF or invoke OCR again. The original resend of the same file with multipart fields remains supported for compatibility. The response identifies accepted corrections in applied_overrides; always follow missing_fields and next_action. The retired /extract alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
filefileREQPDF alebo obrazok faktury (max 20 MB)
fieldsstringoptionalOptional JSON object with corrected OCR values. Resend the same file and supply only fields that should override OCR, for example {"vendor_dic":"2020123456","vendor_ic_dph":"SK2020123456","iban":"SK6807200002891987426353"}. Supported values include supplier and buyer identifiers, dates, payment data, amounts, items, and document_type.

Príklady volania

cURL 1
curl -X POST https://epostak.sk/api/v1/payloads/extract \
  -H "Authorization: Bearer eyJhbGc..." \
  -F "file=@invoice.pdf"

Príklady odpovedí

200 Extrakcia uspesna
{
  "extraction":{"invoice_number":"FAK-001","total":1230.00},
  "ubl_xml":"<?xml...>",
  "confidence":"high",
  "confidence_scores":{"vendor_name":0.95,"invoice_number":0.95,"total":0.95},
  "validation":{"valid":true,"errorCount":0,"warningCount":0,"errors":[],"warnings":[],"deferred":false},
  "vendor_verification":{
    "found_in_peppol_directory":true,
    "canonical_peppol_id":"9950:sk2020019716",
    "canonical_name":"ACME, s.r.o.",
    "canonical_country":"SK",
    "name_match_score":0.95,
    "risk_level":"low",
    "warnings":[]
  },
  "needs_review":false,
  "missing_fields":[],
  "field_sources":{
    "invoice_number":{"source":"ocr","value":"FAK-001","confidence":0.95},
    "sender_peppol_id":{"source":"peppol_directory","value":"9950:sk2020019716"},
    "receiver_peppol_id":{"source":"firm_profile","value":"0245:2020987654"}
  },
  "next_action":{
    "type":"send_document",
    "label":"Pripravené na odoslanie",
    "endpoint":"/api/v1/documents/send",
    "method":"POST"
  },
  "file_name":"invoice.pdf"
}

Odpovede

  • 200Extrakcia uspesna
  • 400Chybajuci subor, nepodporovany typ alebo prilis velky subor
  • 401Missing or invalid API key
  • 403API plan je vyzadovany
  • 409Faktúra z PDF cez API nie je objednaná (ADDON_REQUIRED). Partner si ju objedná v portáli v Služby a doplnky; funguje po schválení objednávky. V sandboxe funguje bez objednávky.
  • 422Extrakcia alebo UBL generovanie zlyhalo. Vystavene/outbound PDF faktury vracaju 200 s direction=outbound; standardne faktury obsahuju send_payload na kontrolu.
  • 429Rate limit exceeded (10/min/firm)
  • 503Gemini API key not configured (SERVICE_UNAVAILABLE)
POST/api/v1/payloads/review

Opraviť OCR výsledok bez nového OCR

Accepts the extraction object returned by /payloads/extract and all human corrections together in fields. Corrections are applied before tenant ownership and direction checks. The endpoint rebuilds and validates the UBL or outbound send_payload without uploading the source file or invoking OCR again. review_decision=approve can clear a low/medium confidence review after a human checked the result, but never bypasses blocking missing fields, tenant mismatch, invalid or deferred validation, or high vendor risk. This endpoint never sends the document.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
extractionobjectREQThe exact extraction object returned by /payloads/extract or by a previous /payloads/review response. Provider diagnostics and unknown fields are ignored.
fieldsobjectoptionalAll human corrections in one object. Supported keys include supplier and buyer identity, dates, payment data, amounts, items and document_type.
review_decisionstringoptionalExplicit human approval after checking the corrected result. Approval cannot clear technical, tenant, validation or high-risk blockers. (povolené: approve)

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/payloads/review \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{
    "extraction": {"...":"object from /payloads/extract"},
    "fields": {
      "buyer_dic":"2020987654",
      "due_date":"2026-08-26",
      "iban":"SK6807200002891987426353"
    },
    "review_decision":"approve"
  }'

Príklady odpovedí

200 Corrected payload rebuilt without another OCR call
{
  "direction":"inbound",
  "extraction":{"invoice_number":"FA-001","due_date":"2026-08-26"},
  "ubl_xml":"<?xml...>",
  "validation":{"valid":true,"deferred":false,"errors":[],"warnings":[]},
  "needs_review":false,
  "review_approved":true,
  "missing_fields":[],
  "applied_overrides":["due_date","iban"],
  "ocr_reused":true,
  "next_action":{"type":"send_document","endpoint":"/api/v1/documents/send","method":"POST"}
}

Odpovede

  • 200Corrected payload rebuilt without another OCR call
  • 400Invalid extraction snapshot, correction object, or review decision
  • 401Invalid or missing API credential
  • 403API access denied or corrected extraction belongs to another firm
  • 413JSON body exceeds 2 MB
  • 422Corrected extraction cannot be converted to a usable UBL or outbound payload
  • 429Rate limit exceeded (60/min/firm)
POST/api/v1/payloads/extract/batch

Batch extrakcia max 50

Canonical batch OCR endpoint. Each successful row contains an extraction object. Correct exception rows individually through POST /payloads/review by sending that extraction and all corrected fields together; no PDF re-upload or repeat OCR is required. The retired /extract/batch alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
filesfile[]REQPDF or image files (max 50 položiek / items)

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/payloads/extract/batch \
  -H "Authorization: Bearer eyJhbGc..." \
  -F "files=@invoice1.pdf" -F "files=@invoice2.pdf"

Príklady odpovedí

200 Batch extraction results (per-file success or error)
{
  "results":[
    {"file_name":"invoice1.pdf","extraction":{"invoiceNumber":"FAK-001"},"ubl_xml":"...","confidence":"high","needs_review":false,"missing_fields":[],"field_sources":{"invoice_number":{"source":"ocr","value":"FAK-001","confidence":0.95}},"next_action":{"type":"send_document","label":"Pripravené na odoslanie","message":"Dokument má všetky blokujúce polia a prešiel preflight validáciou.","endpoint":"/api/v1/documents/send","method":"POST"}},
    {"file_name":"invoice2.pdf","error":"Unsupported type: text/plain"}
  ]
}

Odpovede

  • 200Batch extraction results (per-file success or error)
  • 401Unauthorized
  • 403API plan required
  • 409Faktúra z PDF cez API nie je objednaná (ADDON_REQUIRED). Partner si ju objedná v portáli v Služby a doplnky; funguje po schválení objednávky. V sandboxe funguje bez objednávky.
  • 413Total body exceeds 200 MB or individual file &gt; 20 MB
  • 422Validation error
  • 429Rate limit exceeded (3/min/firm)
  • 503Gemini API not configured
POST/api/v1/payloads/parse

Rozobrať UBL XML na JSON

Canonical Payload Assistant endpoint for parsing UBL/XML into normalized JSON. The retired /documents/parse alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
bodyapplication/xmlREQ
xmlstringREQUBL Invoice or CreditNote XML

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/payloads/parse \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/xml" \
  --data-binary "@invoice.xml"

Príklady odpovedí

200 Parsed invoice payload
{
  "invoice": {
    "invoiceNumber": "FAK-2025-001",
    "issueDate": "2025-04-01",
    "dueDate": "2025-04-15",
    "currency": "EUR",
    "invoiceTypeCode": "380",
    "profileId": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
    "customizationId": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0",
    "supplier": {"name":"Dodávateľ s.r.o.","peppolId":"0245:2020298610","ico":"20202986","icDph":"SK2020298610","street":"Hlavná 1","city":"Bratislava","zip":"81101","country":"SK"},
    "customer": {"name":"Odberateľ a.s.","peppolId":"0245:0000000001","ico":"00000000","icDph":"SK0000000001","street":"Mestská 2","city":"Košice","zip":"04001","country":"SK"},
    "lines": [{"description":"Konzultácia","quantity":1,"unit":"HUR","unitPrice":500,"vatRate":23}],
    "taxSubtotals": [{"vatRate":23,"taxableAmount":500,"taxAmount":115}],
    "totalWithoutVat": 500.00,
    "totalVat": 115.00,
    "totalWithVat": 615.00,
    "amountDue": 615.00
  },
  "extras": {"orderReference":null,"paymentTerms":null},
  "allowances": []
}

Odpovede

  • 200Parsed invoice payload
  • 401Invalid or missing API key
  • 403API plan required
  • 413Payload too large (&gt; 25 MB)
  • 422Validation or parse error
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/payloads/convert

Konverzia formátov

Canonical Payload Assistant endpoint for converting supported document payload formats. The retired /documents/convert alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
input_formatstringREQFormat vstupneho dokumentu (povolené: json, ubl)
output_formatstringREQFormat vystupneho dokumentu (povolené: json, ubl)
documentobjectREQSendDocumentJsonRequest objekt (pre input_format=json) alebo UBL XML string (pre input_format=ubl)
document.processIdstringoptionalPeppol process URN. Accepts the bare URN or the cenbii-procid-ubl:: prefixed form. Defaults to profile 01; use urn:peppol:bis:billing_with_response to require an Invoice Response.
document.documentTypestringoptionalBusiness document type. invoice is a supplier-issued invoice; credit_note corrects a supplier-issued invoice; self_billing is a buyer-issued invoice; self_billing_credit_note corrects a buyer-issued invoice; self_billing_debit_note (527) adds to a buyer-issued invoice. correction uses InvoiceTypeCode 384; correction (384) is a data-only corrective invoice with no VAT effect: it repeats all items, quantities and amounts of the original invoice, only the corrected data, its own invoiceNumber and issueDate differ, and precedingInvoiceRef is mandatory. It is accepted only between a Slovak supplier and a Slovak buyer, from the date the Peppol network accepts it (BIS Billing 3.0.22, rule PEPPOL-EN16931-P0112); before that and for any non-Slovak party the API answers 422 with P0112, so send a credit_note referencing the original plus a new invoice. A change of an amount needs credit_note or debit_note. The original invoice stays the document that is paid, reported and exported; a 384 is never payable. It is billed like a credit note, sent and received. debit_note uses InvoiceTypeCode 383 and requires an original invoice reference. prepayment_invoice uses InvoiceTypeCode 386; it is a separate invoice, not a proforma or a final invoice prepayments entry. advance_payment uses InvoiceTypeCode 388 (daňový doklad k prijatej platbe, tax document for a received payment). Issue 386 and 388 only after the payment was received and put the payment date in taxPointDate; for 388 taxPointDate is required, must not be after issueDate or in the future, prepayments and advance_deduction lines are rejected and PrepaidAmount equals the total with VAT, so PayableAmount is 0. A proforma or payment request is not an invoice and must not be sent over Peppol. Defaults to invoice. (default: invoice) (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
document.document_typestringoptionalSnake_case alias for documentType. If multiple aliases are sent, all non-empty values must match. (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
document.docTypestringoptionalCompatibility alias for documentType. Do not send conflicting alias values. (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
document.receiverPeppolIdstringoptionalPeppol participant ID in scheme:identifier form, for example 0245:2123456789. Required for invoice/credit_note and identifies the buyer. For self-billing it identifies the supplier/Peppol recipient, but supplierPeppolId is the clearer alias.
document.supplierPeppolIdstringoptionalSelf-billing alias for the supplier/Peppol recipient in scheme:identifier form. Allowed only for self_billing, self_billing_credit_note and self_billing_debit_note; it is normalized into receiverPeppolId.
document.invoiceNumberstringoptionalInvoice or credit-note number. If omitted or empty, ePošťák allocates the next number from the authenticated firm's numbering sequence.
document.precedingInvoiceRefstringoptionalExternal original invoice number adjusted by this corrective document. Required for credit_note, correction (384), debit_note, self_billing_credit_note and self_billing_debit_note; emitted as UBL BillingReference.
document.issueDatedateoptionalIssue date in YYYY-MM-DD format. Through 2026 a supplied value is preserved. From 1 January 2027 the legal issue date is the Europe/Bratislava handoff day; generated JSON is normalized and raw UBL with a different IssueDate is rejected.
document.dueDatedateoptionalPayment due date in YYYY-MM-DD format. Optional.
document.taxPointDatedateoptionalVAT tax point date (BT-7) in YYYY-MM-DD format. Kept separate from the actual delivery date. For advance_payment (388) and prepayment_invoice (386) it is the date the payment was received (Slovak VAT Act § 74(1)(d)); required for 388, not after issueDate and not in the future.
document.deliveryDatedateoptionalActual delivery date for the whole document (BT-72) in YYYY-MM-DD format.
document.documentDiscountPercentnumberoptionalDocument-level discount percentage represented as a Peppol BG-20 allowance. This is additional to any items[].discount. (0–100)
document.currencystringoptionalISO 4217 currency code. If omitted, the authenticated firm's default currency is used, falling back to EUR. (default: EUR)
document.exchangeRatenumber | stringoptionalEUR value of one unit of a non-EUR currency; drives BT-6 TaxCurrencyCode and the VAT total in EUR (BT-111). Ignored for EUR.
document.notestringoptionalFree-text invoice note. Use it for a human-readable exemption/reverse-charge reason or other information the receiver must see.
document.ibanstringoptionalPayment IBAN. If omitted, the authenticated firm's saved IBAN is used when available.
document.paymentMethodstringoptionalPayment method. Accepted convenience aliases: bank_transfer=30, credit_transfer=30, sepa=58, card=48, cash=10, direct_debit=49. A direct UNCL4461 code such as 30 is also accepted. Omitted defaults to 30 in generated UBL.
document.variableSymbolstringoptionalVariable symbol (variabilný symbol) sent as the UBL PaymentID. Only its digits are kept, and the stored value equals the sent one; when more than 10 digits remain, the last 10 are used. A value without digits is treated as not sent. The format is never refused.
document.buyerReferencestringoptionalBuyer reference, purchase-order number, or internal procurement reference.
document.orderReferencestringoptionalBuyer's purchase-order number (BT-13, cac:OrderReference). (max 100 znakov / chars)
document.contractReferencestringoptionalContract number (BT-12, cac:ContractDocumentReference). (max 100 znakov / chars)
document.projectReferencestringoptionalProject reference (BT-11, cac:ProjectReference). (max 100 znakov / chars)
document.invoicePeriodStartdateoptionalFirst day of the billing period (BT-73, cac:InvoicePeriod/cbc:StartDate) in YYYY-MM-DD format.
document.invoicePeriodEnddateoptionalLast day of the billing period (BT-74, cac:InvoicePeriod/cbc:EndDate) in YYYY-MM-DD format. Must not be before invoicePeriodStart.
document.receiverNamestringoptionalCounterparty legal/business name. Required for invoice/credit_note. For self-billing it identifies the supplier, but supplierName is the clearer alias.
document.receiverIcostringoptionalCounterparty company registration number (IČO).
document.receiverDicstringoptionalCounterparty tax identification number (DIČ).
document.receiverIcDphstringoptionalCounterparty VAT identification number (IČ DPH). For self-billing it is also used to determine supplier-side VAT-payer treatment.
document.emailFallbackbooleanoptionalWhen true and the buyer has no Peppol registration, ePošťák e-mails the invoice (PDF and the sent UBL XML, plus attachments) once to receiverEmail or, when it is omitted, to the buyer e-mail in the UBL (BT-58). The document still ends as recipient_not_found and the TDD is reported as usual; the e-mail is not billed. The outcome is in emailFallback on GET /documents/{id}/status and on the document.delivery_failed webhook. Ak odberateľ nemá Peppol schránku, faktúru (PDF a odoslané UBL XML) mu pošleme raz e-mailom na receiverEmail, a ak chýba, na e-mail odberateľa z UBL. (default: false)
document.receiverEmailstringoptionalBuyer e-mail for emailFallback. Takes precedence over the buyer e-mail in the UBL (cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail, BT-58). When omitted, that UBL e-mail is used; required when emailFallback is true and the document carries no valid buyer e-mail. E-mail odberateľa pre emailFallback; bez neho použijeme e-mail odberateľa z UBL. (max 254 znakov / chars)
document.receiverStreetstringoptionalReceiver street and number. Preferred over parsing receiverAddress.
document.receiverCitystringoptionalCounterparty city.
document.receiverPostalCodestringoptionalCounterparty postal code.
document.receiverAddressstringoptionalSingle-line counterparty address. Prefer receiverStreet, receiverCity and receiverPostalCode when the ERP has split address fields.
document.receiverCountrystringoptionalCounterparty country as ISO 3166-1 alpha-2. Defaults to SK. (default: SK)
document.supplierNamestringoptionalSelf-billing alias for receiverName (supplier). Required for self_billing/self_billing_credit_note/self_billing_debit_note when receiverName is omitted.
document.supplierIcostringoptionalSelf-billing alias for receiverIco.
document.supplierDicstringoptionalSelf-billing alias for receiverDic.
document.supplierIcDphstringoptionalSelf-billing alias for receiverIcDph. Used for supplier-side VAT payer logic.
document.supplierStreetstringoptionalSelf-billing alias for receiverStreet.
document.supplierCitystringoptionalSelf-billing alias for receiverCity.
document.supplierPostalCodestringoptionalSelf-billing alias for receiverPostalCode.
document.supplierAddressstringoptionalSelf-billing alias for receiverAddress.
document.supplierCountrystringoptionalSelf-billing alias for receiverCountry. (default: SK)
document.prepaidAmountnumberoptionalAmount paid in advance (BT-113). Emitted as LegalMonetaryTotal/PrepaidAmount and reduces PayableAmount. Do not combine with your own items[].lineType=advance_deduction. With prepayments[] it may equal the sum of all prepayments[].amountWithVat; only untaxed advances (without taxDocumentRef) are emitted as PrepaidAmount. For advance_payment (388) it defaults to the total with VAT and, if sent, must equal it within 0.01. (min 0)
document.payableRoundingAmountnumberoptionalRounding of the amount to be paid (BT-114), signed, at most 2 decimal places, between -0.99 and 0.99. Emitted as LegalMonetaryTotal/PayableRoundingAmount; PayableAmount = total with VAT - prepaidAmount + payableRoundingAmount. It changes only the amount due: line amounts, the VAT base and VAT stay as calculated from items[]. ePošťák never calculates this value; when omitted or 0, nothing is rounded. Use it when the amount actually charged differs by cents from the calculated total, for example cash rounding or prices where VAT was taken out of the gross amount. Not allowed for advance_payment (388) and correction (384), and it must not make the amount due negative. (-0.99–0.99)
document.prepaymentsobject[]optionalStructured settled prepayments on the final invoice. Untaxed advances (without taxDocumentRef) are summed into prepaidAmount and reduce PayableAmount; taxed advances (with taxDocumentRef) are deducted as negative advance_deduction lines with a BT-25 BillingReference, so the tax breakdown reflects them. Advance and tax references are preserved in the UBL note. Do not combine your own items[].lineType=advance_deduction with untaxed advances. Not allowed on advance_payment (388).
document.prepayments[].advanceInvoiceRefstringoptionalAdvance/prepayment invoice reference from the ERP.
document.prepayments[].taxDocumentRefstringoptionalNumber of the tax document for the received payment (UNCL1001 386 or 388). When set, the advance is taxed: it is deducted as a negative line with a BT-25 reference and vatRate is required.
document.prepayments[].settlementDatedateoptionalSettlement date in strict YYYY-MM-DD format.
document.prepayments[].amountWithoutVatnumberoptionalSettled amount without VAT. (min 0)
document.prepayments[].vatAmountnumberoptionalVAT amount from the settled prepayment. (min 0)
document.prepayments[].amountWithVatnumberREQSettled amount including VAT. Required. Untaxed advances are summed into prepaidAmount; for a taxed advance it yields the negative line price when amountWithoutVat is missing. (min 0)
document.prepayments[].vatRatenumberoptionalNon-negative VAT rate of the prepayment, preserved in the UBL note. Required with taxDocumentRef: the negative deduction line uses the VAT rate of the tax document. (min 0)
document.prepayments[].vatCategoryCodestringoptionalOptional VAT category of the prepayment. Values are normalized to uppercase and preserved as prepayment metadata. For a taxed advance it is the category of the deduction line (default S when vatRate is above 0). (povolené: S, Z, AE, E, K, G, O, L, M)
document.itemsobject[]REQBilling lines. Between 1 and 999 entries are accepted. (max 999 položiek / items)
document.items[].descriptionstringREQNon-empty line name (BT-153). A longer text under the name can be sent as itemDescription (BT-154, max 1000 characters).
document.items[].quantitynumberREQQuantity. Must not be zero. A negative quantity on a standard line is a discount or returned item (unitPrice stays non-negative). Must be negative for lineType=advance_deduction.
document.items[].unitstringoptionalUN/ECE Rec 20 unit code. Use H87 for a piece; C62 is the generic one/unit code. Short aliases are also mapped: ks=H87, kus=H87, piece=H87, pcs=H87, jednotka=C62, unit=C62, one=C62, hod=HUR, den=DAY, mes=MON, kg=KGM, m=MTR, l=LTR, km=KMT. Omitted values default to C62. (default: C62)
document.items[].unitPricenumberREQNet price per unit. Must be a finite non-negative number. (min 0)
document.items[].vatRatenumberREQVAT rate in percent. Accepted values: 0, 5, 10, 19, 20, 23; this includes historical 20% for older/corrective documents. Z, AE, E, K, G and O categories require 0; S, L and M require a positive rate. (povolené: 0, 5, 10, 19, 20, 23)
document.items[].vatCategoryCodestringoptionalDPH category BT-151 according to UNCL5305. A positive rate may derive S. At 0%, vatCategoryCode or taxTreatment is required because 0% can represent Z, E, AE, K, G or O. (povolené: S, Z, AE, E, K, G, O, L, M)
document.items[].vatCategorystringoptionalAlias for vatCategoryCode. (povolené: S, Z, AE, E, K, G, O, L, M)
document.items[].vat_categorystringoptionalSnake_case alias for vatCategoryCode. (povolené: S, Z, AE, E, K, G, O, L, M)
document.items[].taxTreatmentstringoptionalHigher-level ePostak tax treatment mapped to vatCategoryCode: standard=S, zero_rate=Z, reverse_charge_domestic=AE, exempt=E, intra_community_supply=K, export=G, outside_scope=O. Explicit vatCategoryCode wins when both are present. (povolené: standard, zero_rate, reverse_charge_domestic, exempt, intra_community_supply, export, outside_scope)
document.items[].tax_treatmentstringoptionalSnake_case alias for taxTreatment. (povolené: standard, zero_rate, reverse_charge_domestic, exempt, intra_community_supply, export, outside_scope)
document.items[].discountnumberoptionalLine discount percentage from 0 to 100. Omitted means 0. (0–100)
document.items[].deliveryDatestringoptionalLine delivery date. Written to UBL as cac:InvoiceLine/cac:InvoicePeriod (BT-134 and BT-135, start and end are the same date; ISO timestamps are accepted and only the date part is used) and printed in the PDF under the item name as "Dátum dodania". When the line dates differ, the document is a summary invoice (§ 75 of the Slovak VAT Act): the dates must stay within one calendar month and issueDate must be no later than the 15th day after that month ends.
document.items[].lineTypestringoptionalLine type. Use advance_deduction for a negative advance deduction line on the final invoice. (default: standard) (povolené: standard, advance_deduction)
document.items[].advanceInvoiceReferencestringoptionalAdvance invoice number. Required when lineType is advance_deduction. Emitted to UBL as AdditionalItemProperty named AdvanceInvoiceNumber.
document.items[].customsTariffCodestringoptionalCustoms tariff / combined nomenclature code. Emitted as CommodityClassification/ItemClassificationCode listID=HS; KV DPH A2 uses the first 4 digits as TK. (pattern ^\d{4,10}$)
document.items[].commodityClassificationCodestringoptionalGeneric item classification code when customsTariffCode is not used. Send together with commodityClassificationListId when the list is not HS.
document.items[].commodityClassificationListIdstringoptionalClassification list identifier from UNTDID 7143. Defaults to HS for customsTariffCode.
document.items[].reverseChargeParagraphLetterstringoptionalOptional letter of the domestic reverse-charge provision § 69 ods. 12, for example f or g, without parentheses. Written to the UBL line as AdditionalItemProperty with Name ReverseChargeParagraphLetter. Informational only: it is not printed on the PDF and no export (POHODA, KV DPH) reads it. The KV DPH A.2 row is built from customsTariffCode or commodityClassificationCode and from controlStatementType, controlStatementQuantity and controlStatementUnit.
document.items[].controlStatementTypestringoptionalSlovak KV DPH A2 TD value. (povolené: IO, MT)
document.items[].controlStatementQuantitynumberoptionalPositive Slovak KV DPH A2 Mn quantity. If omitted and the unit can be mapped, the absolute line quantity is used. (min 0)
document.items[].controlStatementUnitstringoptionalSlovak KV DPH A2 MJ unit. (povolené: kg, t, m, ks)
document.attachmentsobject[]optionalInvoice supporting documents (Peppol BG-24), embedded in UBL as base64 through AdditionalDocumentReference / EmbeddedDocumentBinaryObject. Maximum 20 files, 10 MB decoded per file, and 15 MB decoded total. These limits apply only to this field (JSON mode): a finished UBL sent in XML mode or through SAPI is checked only against the 22 MB document limit, however many attachments it embeds. (max 20 položiek / items)
document.attachments[].fileNamestringREQNon-empty attachment filename. (max 255 znakov / chars)
document.attachments[].mimeTypestringREQAllowed MIME types according to Peppol BR-CL-22. The decoded content must match this MIME type. (povolené: application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet)
document.attachments[].contentbase64REQBase64-encoded file content without a data: prefix. Must decode to a non-empty file and may be at most 10 MB after decoding.
document.attachments[].descriptionstringoptionalOptional short attachment description shown as supporting-document metadata.

Príklady volania

cURL 1
curl -X POST https://epostak.sk/api/v1/payloads/convert \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{
    "input_format": "json",
    "output_format": "ubl",
    "document": {
      "invoiceNumber": "FAK-2026-002",
      "issueDate": "2026-06-11",
      "items": [
        {"description": "Sluzba s prenesenim DPH", "quantity": 1, "unitPrice": 200, "vatRate": 0, "vatCategoryCode": "AE"}
      ]
    }
  }'

Príklady odpovedí

200 Konverzia uspesna. Pre <code>output_format=ubl</code> je <code>document</code> string, pre <code>output_format=json</code> je objekt.
{"output_format":"json","document":{"invoice_number":"FAK-001","issue_date":"2025-04-01"},"warnings":[]}

Odpovede

  • 200Konverzia uspesna. Pre <code>output_format=ubl</code> je <code>document</code> string, pre <code>output_format=json</code> je objekt.
  • 401Missing or invalid API key
  • 403API plan required
  • 413Payload too large (&gt; 25 MB)
  • 422Konverzia zlyhala alebo nepodporovana kombinacia input_format/output_format
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503Backend conversion service unavailable
POST/api/v1/payloads/validate

Validovať dokument

Canonical Payload Assistant endpoint for preflight document validation. The retired /documents/validate alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
formatstringoptional (povolené: ubl, json)
documentstringoptionalComplete UBL 2.1 Invoice or CreditNote XML as a non-empty string. XML with DOCTYPE/entity declarations is rejected.
processIdstringoptionalPeppol process URN. Accepts the bare URN or the cenbii-procid-ubl:: prefixed form. Defaults to profile 01; use urn:peppol:bis:billing_with_response to require an Invoice Response.
documentTypestringoptionalBusiness document type. invoice is a supplier-issued invoice; credit_note corrects a supplier-issued invoice; self_billing is a buyer-issued invoice; self_billing_credit_note corrects a buyer-issued invoice; self_billing_debit_note (527) adds to a buyer-issued invoice. correction uses InvoiceTypeCode 384; correction (384) is a data-only corrective invoice with no VAT effect: it repeats all items, quantities and amounts of the original invoice, only the corrected data, its own invoiceNumber and issueDate differ, and precedingInvoiceRef is mandatory. It is accepted only between a Slovak supplier and a Slovak buyer, from the date the Peppol network accepts it (BIS Billing 3.0.22, rule PEPPOL-EN16931-P0112); before that and for any non-Slovak party the API answers 422 with P0112, so send a credit_note referencing the original plus a new invoice. A change of an amount needs credit_note or debit_note. The original invoice stays the document that is paid, reported and exported; a 384 is never payable. It is billed like a credit note, sent and received. debit_note uses InvoiceTypeCode 383 and requires an original invoice reference. prepayment_invoice uses InvoiceTypeCode 386; it is a separate invoice, not a proforma or a final invoice prepayments entry. advance_payment uses InvoiceTypeCode 388 (daňový doklad k prijatej platbe, tax document for a received payment). Issue 386 and 388 only after the payment was received and put the payment date in taxPointDate; for 388 taxPointDate is required, must not be after issueDate or in the future, prepayments and advance_deduction lines are rejected and PrepaidAmount equals the total with VAT, so PayableAmount is 0. A proforma or payment request is not an invoice and must not be sent over Peppol. Defaults to invoice. (default: invoice) (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
document_typestringoptionalSnake_case alias for documentType. If multiple aliases are sent, all non-empty values must match. (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
docTypestringoptionalCompatibility alias for documentType. Do not send conflicting alias values. (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
receiverPeppolIdstringoptionalPeppol participant ID in scheme:identifier form, for example 0245:2123456789. Required for invoice/credit_note and identifies the buyer. For self-billing it identifies the supplier/Peppol recipient, but supplierPeppolId is the clearer alias.
supplierPeppolIdstringoptionalSelf-billing alias for the supplier/Peppol recipient in scheme:identifier form. Allowed only for self_billing, self_billing_credit_note and self_billing_debit_note; it is normalized into receiverPeppolId.
invoiceNumberstringoptionalInvoice or credit-note number. If omitted or empty, ePošťák allocates the next number from the authenticated firm's numbering sequence.
precedingInvoiceRefstringoptionalExternal original invoice number adjusted by this corrective document. Required for credit_note, correction (384), debit_note, self_billing_credit_note and self_billing_debit_note; emitted as UBL BillingReference.
issueDatedateoptionalIssue date in YYYY-MM-DD format. Through 2026 a supplied value is preserved. From 1 January 2027 the legal issue date is the Europe/Bratislava handoff day; generated JSON is normalized and raw UBL with a different IssueDate is rejected.
dueDatedateoptionalPayment due date in YYYY-MM-DD format. Optional.
taxPointDatedateoptionalVAT tax point date (BT-7) in YYYY-MM-DD format. Kept separate from the actual delivery date. For advance_payment (388) and prepayment_invoice (386) it is the date the payment was received (Slovak VAT Act § 74(1)(d)); required for 388, not after issueDate and not in the future.
deliveryDatedateoptionalActual delivery date for the whole document (BT-72) in YYYY-MM-DD format.
documentDiscountPercentnumberoptionalDocument-level discount percentage represented as a Peppol BG-20 allowance. This is additional to any items[].discount. (0–100)
currencystringoptionalISO 4217 currency code. If omitted, the authenticated firm's default currency is used, falling back to EUR. (default: EUR)
exchangeRatenumber | stringoptionalEUR value of one unit of a non-EUR currency; drives BT-6 TaxCurrencyCode and the VAT total in EUR (BT-111). Ignored for EUR.
notestringoptionalFree-text invoice note. Use it for a human-readable exemption/reverse-charge reason or other information the receiver must see.
ibanstringoptionalPayment IBAN. If omitted, the authenticated firm's saved IBAN is used when available.
paymentMethodstringoptionalPayment method. Accepted convenience aliases: bank_transfer=30, credit_transfer=30, sepa=58, card=48, cash=10, direct_debit=49. A direct UNCL4461 code such as 30 is also accepted. Omitted defaults to 30 in generated UBL.
variableSymbolstringoptionalVariable symbol (variabilný symbol) sent as the UBL PaymentID. Only its digits are kept, and the stored value equals the sent one; when more than 10 digits remain, the last 10 are used. A value without digits is treated as not sent. The format is never refused.
buyerReferencestringoptionalBuyer reference, purchase-order number, or internal procurement reference.
orderReferencestringoptionalBuyer's purchase-order number (BT-13, cac:OrderReference). (max 100 znakov / chars)
contractReferencestringoptionalContract number (BT-12, cac:ContractDocumentReference). (max 100 znakov / chars)
projectReferencestringoptionalProject reference (BT-11, cac:ProjectReference). (max 100 znakov / chars)
invoicePeriodStartdateoptionalFirst day of the billing period (BT-73, cac:InvoicePeriod/cbc:StartDate) in YYYY-MM-DD format.
invoicePeriodEnddateoptionalLast day of the billing period (BT-74, cac:InvoicePeriod/cbc:EndDate) in YYYY-MM-DD format. Must not be before invoicePeriodStart.
receiverNamestringoptionalCounterparty legal/business name. Required for invoice/credit_note. For self-billing it identifies the supplier, but supplierName is the clearer alias.
receiverIcostringoptionalCounterparty company registration number (IČO).
receiverDicstringoptionalCounterparty tax identification number (DIČ).
receiverIcDphstringoptionalCounterparty VAT identification number (IČ DPH). For self-billing it is also used to determine supplier-side VAT-payer treatment.
emailFallbackbooleanoptionalWhen true and the buyer has no Peppol registration, ePošťák e-mails the invoice (PDF and the sent UBL XML, plus attachments) once to receiverEmail or, when it is omitted, to the buyer e-mail in the UBL (BT-58). The document still ends as recipient_not_found and the TDD is reported as usual; the e-mail is not billed. The outcome is in emailFallback on GET /documents/{id}/status and on the document.delivery_failed webhook. Ak odberateľ nemá Peppol schránku, faktúru (PDF a odoslané UBL XML) mu pošleme raz e-mailom na receiverEmail, a ak chýba, na e-mail odberateľa z UBL. (default: false)
receiverEmailstringoptionalBuyer e-mail for emailFallback. Takes precedence over the buyer e-mail in the UBL (cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail, BT-58). When omitted, that UBL e-mail is used; required when emailFallback is true and the document carries no valid buyer e-mail. E-mail odberateľa pre emailFallback; bez neho použijeme e-mail odberateľa z UBL. (max 254 znakov / chars)
receiverStreetstringoptionalReceiver street and number. Preferred over parsing receiverAddress.
receiverCitystringoptionalCounterparty city.
receiverPostalCodestringoptionalCounterparty postal code.
receiverAddressstringoptionalSingle-line counterparty address. Prefer receiverStreet, receiverCity and receiverPostalCode when the ERP has split address fields.
receiverCountrystringoptionalCounterparty country as ISO 3166-1 alpha-2. Defaults to SK. (default: SK)
supplierNamestringoptionalSelf-billing alias for receiverName (supplier). Required for self_billing/self_billing_credit_note/self_billing_debit_note when receiverName is omitted.
supplierIcostringoptionalSelf-billing alias for receiverIco.
supplierDicstringoptionalSelf-billing alias for receiverDic.
supplierIcDphstringoptionalSelf-billing alias for receiverIcDph. Used for supplier-side VAT payer logic.
supplierStreetstringoptionalSelf-billing alias for receiverStreet.
supplierCitystringoptionalSelf-billing alias for receiverCity.
supplierPostalCodestringoptionalSelf-billing alias for receiverPostalCode.
supplierAddressstringoptionalSelf-billing alias for receiverAddress.
supplierCountrystringoptionalSelf-billing alias for receiverCountry. (default: SK)
prepaidAmountnumberoptionalAmount paid in advance (BT-113). Emitted as LegalMonetaryTotal/PrepaidAmount and reduces PayableAmount. Do not combine with your own items[].lineType=advance_deduction. With prepayments[] it may equal the sum of all prepayments[].amountWithVat; only untaxed advances (without taxDocumentRef) are emitted as PrepaidAmount. For advance_payment (388) it defaults to the total with VAT and, if sent, must equal it within 0.01. (min 0)
payableRoundingAmountnumberoptionalRounding of the amount to be paid (BT-114), signed, at most 2 decimal places, between -0.99 and 0.99. Emitted as LegalMonetaryTotal/PayableRoundingAmount; PayableAmount = total with VAT - prepaidAmount + payableRoundingAmount. It changes only the amount due: line amounts, the VAT base and VAT stay as calculated from items[]. ePošťák never calculates this value; when omitted or 0, nothing is rounded. Use it when the amount actually charged differs by cents from the calculated total, for example cash rounding or prices where VAT was taken out of the gross amount. Not allowed for advance_payment (388) and correction (384), and it must not make the amount due negative. (-0.99–0.99)
prepaymentsobject[]optionalStructured settled prepayments on the final invoice. Untaxed advances (without taxDocumentRef) are summed into prepaidAmount and reduce PayableAmount; taxed advances (with taxDocumentRef) are deducted as negative advance_deduction lines with a BT-25 BillingReference, so the tax breakdown reflects them. Advance and tax references are preserved in the UBL note. Do not combine your own items[].lineType=advance_deduction with untaxed advances. Not allowed on advance_payment (388).
prepayments[].advanceInvoiceRefstringoptionalAdvance/prepayment invoice reference from the ERP.
prepayments[].taxDocumentRefstringoptionalNumber of the tax document for the received payment (UNCL1001 386 or 388). When set, the advance is taxed: it is deducted as a negative line with a BT-25 reference and vatRate is required.
prepayments[].settlementDatedateoptionalSettlement date in strict YYYY-MM-DD format.
prepayments[].amountWithoutVatnumberoptionalSettled amount without VAT. (min 0)
prepayments[].vatAmountnumberoptionalVAT amount from the settled prepayment. (min 0)
prepayments[].amountWithVatnumberREQSettled amount including VAT. Required. Untaxed advances are summed into prepaidAmount; for a taxed advance it yields the negative line price when amountWithoutVat is missing. (min 0)
prepayments[].vatRatenumberoptionalNon-negative VAT rate of the prepayment, preserved in the UBL note. Required with taxDocumentRef: the negative deduction line uses the VAT rate of the tax document. (min 0)
prepayments[].vatCategoryCodestringoptionalOptional VAT category of the prepayment. Values are normalized to uppercase and preserved as prepayment metadata. For a taxed advance it is the category of the deduction line (default S when vatRate is above 0). (povolené: S, Z, AE, E, K, G, O, L, M)
itemsobject[]optionalBilling lines. Between 1 and 999 entries are accepted. (max 999 položiek / items)
items[].descriptionstringREQNon-empty line name (BT-153). A longer text under the name can be sent as itemDescription (BT-154, max 1000 characters).
items[].quantitynumberREQQuantity. Must not be zero. A negative quantity on a standard line is a discount or returned item (unitPrice stays non-negative). Must be negative for lineType=advance_deduction.
items[].unitstringoptionalUN/ECE Rec 20 unit code. Use H87 for a piece; C62 is the generic one/unit code. Short aliases are also mapped: ks=H87, kus=H87, piece=H87, pcs=H87, jednotka=C62, unit=C62, one=C62, hod=HUR, den=DAY, mes=MON, kg=KGM, m=MTR, l=LTR, km=KMT. Omitted values default to C62. (default: C62)
items[].unitPricenumberREQNet price per unit. Must be a finite non-negative number. (min 0)
items[].vatRatenumberREQVAT rate in percent. Accepted values: 0, 5, 10, 19, 20, 23; this includes historical 20% for older/corrective documents. Z, AE, E, K, G and O categories require 0; S, L and M require a positive rate. (povolené: 0, 5, 10, 19, 20, 23)
items[].vatCategoryCodestringoptionalDPH category BT-151 according to UNCL5305. A positive rate may derive S. At 0%, vatCategoryCode or taxTreatment is required because 0% can represent Z, E, AE, K, G or O. (povolené: S, Z, AE, E, K, G, O, L, M)
items[].vatCategorystringoptionalAlias for vatCategoryCode. (povolené: S, Z, AE, E, K, G, O, L, M)
items[].vat_categorystringoptionalSnake_case alias for vatCategoryCode. (povolené: S, Z, AE, E, K, G, O, L, M)
items[].taxTreatmentstringoptionalHigher-level ePostak tax treatment mapped to vatCategoryCode: standard=S, zero_rate=Z, reverse_charge_domestic=AE, exempt=E, intra_community_supply=K, export=G, outside_scope=O. Explicit vatCategoryCode wins when both are present. (povolené: standard, zero_rate, reverse_charge_domestic, exempt, intra_community_supply, export, outside_scope)
items[].tax_treatmentstringoptionalSnake_case alias for taxTreatment. (povolené: standard, zero_rate, reverse_charge_domestic, exempt, intra_community_supply, export, outside_scope)
items[].discountnumberoptionalLine discount percentage from 0 to 100. Omitted means 0. (0–100)
items[].deliveryDatestringoptionalLine delivery date. Written to UBL as cac:InvoiceLine/cac:InvoicePeriod (BT-134 and BT-135, start and end are the same date; ISO timestamps are accepted and only the date part is used) and printed in the PDF under the item name as "Dátum dodania". When the line dates differ, the document is a summary invoice (§ 75 of the Slovak VAT Act): the dates must stay within one calendar month and issueDate must be no later than the 15th day after that month ends.
items[].lineTypestringoptionalLine type. Use advance_deduction for a negative advance deduction line on the final invoice. (default: standard) (povolené: standard, advance_deduction)
items[].advanceInvoiceReferencestringoptionalAdvance invoice number. Required when lineType is advance_deduction. Emitted to UBL as AdditionalItemProperty named AdvanceInvoiceNumber.
items[].customsTariffCodestringoptionalCustoms tariff / combined nomenclature code. Emitted as CommodityClassification/ItemClassificationCode listID=HS; KV DPH A2 uses the first 4 digits as TK. (pattern ^\d{4,10}$)
items[].commodityClassificationCodestringoptionalGeneric item classification code when customsTariffCode is not used. Send together with commodityClassificationListId when the list is not HS.
items[].commodityClassificationListIdstringoptionalClassification list identifier from UNTDID 7143. Defaults to HS for customsTariffCode.
items[].reverseChargeParagraphLetterstringoptionalOptional letter of the domestic reverse-charge provision § 69 ods. 12, for example f or g, without parentheses. Written to the UBL line as AdditionalItemProperty with Name ReverseChargeParagraphLetter. Informational only: it is not printed on the PDF and no export (POHODA, KV DPH) reads it. The KV DPH A.2 row is built from customsTariffCode or commodityClassificationCode and from controlStatementType, controlStatementQuantity and controlStatementUnit.
items[].controlStatementTypestringoptionalSlovak KV DPH A2 TD value. (povolené: IO, MT)
items[].controlStatementQuantitynumberoptionalPositive Slovak KV DPH A2 Mn quantity. If omitted and the unit can be mapped, the absolute line quantity is used. (min 0)
items[].controlStatementUnitstringoptionalSlovak KV DPH A2 MJ unit. (povolené: kg, t, m, ks)
attachmentsobject[]optionalInvoice supporting documents (Peppol BG-24), embedded in UBL as base64 through AdditionalDocumentReference / EmbeddedDocumentBinaryObject. Maximum 20 files, 10 MB decoded per file, and 15 MB decoded total. These limits apply only to this field (JSON mode): a finished UBL sent in XML mode or through SAPI is checked only against the 22 MB document limit, however many attachments it embeds. (max 20 položiek / items)
attachments[].fileNamestringREQNon-empty attachment filename. (max 255 znakov / chars)
attachments[].mimeTypestringREQAllowed MIME types according to Peppol BR-CL-22. The decoded content must match this MIME type. (povolené: application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet)
attachments[].contentbase64REQBase64-encoded file content without a data: prefix. Must decode to a non-empty file and may be at most 10 MB after decoding.
attachments[].descriptionstringoptionalOptional short attachment description shown as supporting-document metadata.
xmlstringoptionalKompletne UBL XML (Invoice alebo CreditNote).

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/payloads/validate \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"format":"ubl","document":"<?xml version=\"1.0\"?><Invoice>...</Invoice>"}'

Príklady odpovedí

200 Validacia uspesna
{
  "valid": true,
  "errorCount": 0,
  "warningCount": 1,
  "errors": [],
  "warnings": [{"id":"PEPPOL-EN16931-R001","message":"..."}]
}
422 Either the validation result with valid=false (schematron errors found; the body has the shape of ValidateDocumentResponse, see the first example) or a VALIDATION_ERROR envelope (ErrorResponse) for a malformed request: invalid JSON, missing or unknown format, missing document, document that cannot be rendered to UBL, forbidden XML construct.
{
  "valid": false,
  "errorCount": 1,
  "warningCount": 0,
  "errors": [
    {
      "message": "[BR-CO-26]-In order for the buyer to automatically identify a supplier, the Seller identifier (BT-29), the Seller legal registration identifier (BT-30) and/or the Seller VAT identifier (BT-31) shall be present.",
      "test": "(cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID) != '' or (cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) != '' or (cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) != ''",
      "location": "/Invoice[1]",
      "rule": "BR-CO-26"
    }
  ],
  "warnings": []
}

Odpovede

  • 200Validacia uspesna
  • 401Missing or invalid API key
  • 403API plan required
  • 413Payload too large (&gt; 25 MB)
  • 422Either the validation result with valid=false (schematron errors found; the body has the shape of ValidateDocumentResponse, see the first example) or a VALIDATION_ERROR envelope (ErrorResponse) for a malformed request: invalid JSON, missing or unknown format, missing document, document that cannot be rendered to UBL, forbidden XML construct.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503VALIDATION_SERVICE_UNAVAILABLE — ion-docval unreachable

Dokumenty

Odosielanie a príjem faktúr, sledovanie stavu, Lifecycle & proof a sťahovanie evidencie/PDF/UBL.

Outbound lifecycle

Odoslanie je workflow: preflight, send, status/events, protistrana a support packet.

  • POST /documents/send je jediný ostrý send krok.
  • GET /documents/{id}/status je lacný polling status.
  • Support packet nahrádza ručné zbieranie dôkazov.

Inbound and archive

Prijaté dokumenty môžete čítať cez billing inbox alebo full-scope inbound API podľa potreby ERP.

  • Full-scope inbound/outbound API je pre non-billing Peppol typy.
  • PDF, UBL, AS4 envelope a MDN sú auditné artefakty.
Lifecycle & proof. Po odoslaní sledujte jeden dokument cez /documents/{id}/status, /documents/{id}/events, /documents/{id}/responses a /documents/{id}/support-packet. Tieto endpointy tvoria jeden supportovateľný flow: aktuálny stav, časová os, odpovede protistrany a dôkazný balík.
Tri integračné cesty — vyberte podľa potrieb. ePošťák ponúka tri rovnocenné spôsoby, ako konzumovať udalosti a dokumenty. Nemusíte si vybrať jeden — väčšina integrátorov používa kombináciu.
1. Webhooky (POST /api/v1/webhooks + push doručenia) — najnižšia latencia, server-to-server push. Vyžaduje, aby ste mali verejný HTTPS endpoint s HMAC verifikáciou. Vhodné, ak máte ops/IT schopnosť hostovať webhook receiver. HMAC-SHA256 podpis, SSRF guard, encrypted secret-at-rest, auto-disable po 20 terminálnych zlyhaniach, status-code-aware retry (~44h okno pre retryable kódy). Zachované ako mature feature pre súčasných klientov.
2. Events pull facade (GET /api/v1/events/pull + /events/{eventId}/ack) — pull alternatíva k webhookom pre klientov, ktorí nemôžu hostovať receiver. Server nesie stav cez acknowledged=false/true; cross-firm variant /api/v1/webhook-queue/all ostáva pre integrátorov.
3. Inbound / Outbound pull API (GET /api/v1/inbound/documents, GET /api/v1/outbound/documents) — plný dokumentačný prístup. Cursor-based stránkovanie s replay-safe semantikou, list + detail + surový UBL XML, polymorphic naprieč celým Peppol scope-om (Invoice, CreditNote, Order, DespatchAdvice, Catalogue, …). Vhodné, ak potrebujete dokumenty (nie len signály), kompletné historické čítanie, alebo pokrytie non-billing doctypes mimo billing endpointov /documents/inbox a /documents/outbox.
Plus: lifecycle eventy (GET /api/v1/outbound/events) — cursor-based stream interných document_events. Granulárnejší pohľad ako Events pull (per-attempt resolution, transport vs application layer rozlíšenie). Aktuálne pokrýva billing-backed outbound; non-billing je v roadmape.
Rozhodovací prehľad:
  • Mám HTTPS endpoint a chcem push → Webhooky
  • Nemám HTTPS endpoint a chcem len udalosti → Events pull
  • Chcem dokumenty, nie iba signály → Inbound/Outbound pull API
  • Robím audit alebo dashboard a chcem podrobný životný cyklus → Outbound events
Technický partner aj spravovaný integrátor môžu cez centrálny sk_int_* používať SAPI, Enterprise API aj Connector. Každá požiadavka naďalej vyžaduje aktívnu zmluvu zodpovedajúcu režimu vzťahu, neodvolaný súhlas konkrétnej firmy a správny rozsah. Platiteľa určuje režim vzťahu, nie zvolené API rozhranie.
POST/api/v1/documents/sendCore

Odoslať dokument

Odosle fakturu cez Peppol siet. Podporuje dva rezimy: JSON mode — poskytnete strukturovane data (items) pre standardnu fakturu, UBL XML sa vygeneruje automaticky. Odosielatel sa berie z autentifikovanej firmy, nie z payloadu. XML mode — poskytnete hotove UBL XML (xml), odosle sa priamo. V oboch pripadoch je receiverPeppolId povinne. Idempotency (always strict): pass Idempotency-Key: &lt;any unique string&gt; (alias X-Idempotency-Key) to safely retry after network errors — the second completed call with the same body returns HTTP 200 with the current document status and duplicate: true, without creating or sending another document. If the same key is currently being processed, returns 409 CONFLICT. If the body SHA-256 differs from the stored hash, returns 422 IDEMPOTENCY_KEY_MISMATCH (body is canonicalized — keys sorted recursively — before hashing). There is no non-strict mode. Cross-path dedup (XML mode): if the same UBL XML SHA-256 was already accepted for this firm via dashboard mass-import, returns 200 with { data: { invoice_id, peppol_message_id, status, duplicate: true } }. Items[] max 999. Unit codes use UN/ECE Rec 20 (C62, HUR, KGM, MTR, LTR, DAY, ...). Attachments (BG-24): up to 20 files, 10 MB per file, 15 MB total after base64 decode. MIME types enforced per BR-CL-22. Required scope: documents:send. Wildcard scopes (*, full, or empty []) also satisfy this requirement. Retry-After: every error response whose body has retry_after_seconds also sends a Retry-After header with that value (for example 5 for the 409 "already being processed", 60 for TDD_IN_FLIGHT, 30 for 503 SEND_FAILED). Rate-limit headers: X-RateLimit-* reflect the tighter of the credential bucket and the per-operation bucket, i.e. the one that runs out first. Business 409s: VAT_PERIOD_CLOSED (retryable false) and TDD_IN_FLIGHT (retryable true, retry after 60 seconds) are answered with the standard error object (code, message, message_sk, fix_hint, retryable) and the same fields copied at top level. Nothing is stored for them, so a retry under the same Idempotency-Key is processed again, not replayed. Non-billing documents: a body with doctypeKey (order, despatch advice, ...) is sent as a non-billing Peppol document. Its 201, 202 and idempotent 200 bodies carry submissionId (= documentId) and links { document, status }; its 503 SEND_FAILED (terminal, retryable false) and 503 QUEUE_FAILED error objects carry documentId, submissionId and links { document, status }. Follow it with GET /documents/{id}/status.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringoptionalClient-supplied idempotency key (canonical RFC-draft header). If the same key was used recently with the same body, the prior response is replayed. (max 255 znakov / chars)
X-Idempotency-KeystringoptionalAlias for Idempotency-Key. Both headers are accepted. (max 255 znakov / chars)
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
processIdstringoptionalPeppol process URN. Accepts the bare URN or the cenbii-procid-ubl:: prefixed form. Defaults to profile 01; use urn:peppol:bis:billing_with_response to require an Invoice Response.
documentTypestringoptionalBusiness document type. invoice is a supplier-issued invoice; credit_note corrects a supplier-issued invoice; self_billing is a buyer-issued invoice; self_billing_credit_note corrects a buyer-issued invoice; self_billing_debit_note (527) adds to a buyer-issued invoice. correction uses InvoiceTypeCode 384; correction (384) is a data-only corrective invoice with no VAT effect: it repeats all items, quantities and amounts of the original invoice, only the corrected data, its own invoiceNumber and issueDate differ, and precedingInvoiceRef is mandatory. It is accepted only between a Slovak supplier and a Slovak buyer, from the date the Peppol network accepts it (BIS Billing 3.0.22, rule PEPPOL-EN16931-P0112); before that and for any non-Slovak party the API answers 422 with P0112, so send a credit_note referencing the original plus a new invoice. A change of an amount needs credit_note or debit_note. The original invoice stays the document that is paid, reported and exported; a 384 is never payable. It is billed like a credit note, sent and received. debit_note uses InvoiceTypeCode 383 and requires an original invoice reference. prepayment_invoice uses InvoiceTypeCode 386; it is a separate invoice, not a proforma or a final invoice prepayments entry. advance_payment uses InvoiceTypeCode 388 (daňový doklad k prijatej platbe, tax document for a received payment). Issue 386 and 388 only after the payment was received and put the payment date in taxPointDate; for 388 taxPointDate is required, must not be after issueDate or in the future, prepayments and advance_deduction lines are rejected and PrepaidAmount equals the total with VAT, so PayableAmount is 0. A proforma or payment request is not an invoice and must not be sent over Peppol. Defaults to invoice. (default: invoice) (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
document_typestringoptionalSnake_case alias for documentType. If multiple aliases are sent, all non-empty values must match. (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
docTypestringoptionalCompatibility alias for documentType. Do not send conflicting alias values. (povolené: invoice, credit_note, debit_note, prepayment_invoice, advance_payment, correction, self_billing, self_billing_credit_note, self_billing_debit_note)
receiverPeppolIdstringoptionalPeppol participant ID in scheme:identifier form, for example 0245:2123456789. Required for invoice/credit_note and identifies the buyer. For self-billing it identifies the supplier/Peppol recipient, but supplierPeppolId is the clearer alias.
supplierPeppolIdstringoptionalSelf-billing alias for the supplier/Peppol recipient in scheme:identifier form. Allowed only for self_billing, self_billing_credit_note and self_billing_debit_note; it is normalized into receiverPeppolId.
invoiceNumberstringoptionalInvoice or credit-note number. If omitted or empty, ePošťák allocates the next number from the authenticated firm's numbering sequence.
precedingInvoiceRefstringoptionalExternal original invoice number adjusted by this corrective document. Required for credit_note, correction (384), debit_note, self_billing_credit_note and self_billing_debit_note; emitted as UBL BillingReference.
issueDatedateoptionalIssue date in YYYY-MM-DD format. Through 2026 a supplied value is preserved. From 1 January 2027 the legal issue date is the Europe/Bratislava handoff day; generated JSON is normalized and raw UBL with a different IssueDate is rejected.
dueDatedateoptionalPayment due date in YYYY-MM-DD format. Optional.
taxPointDatedateoptionalVAT tax point date (BT-7) in YYYY-MM-DD format. Kept separate from the actual delivery date. For advance_payment (388) and prepayment_invoice (386) it is the date the payment was received (Slovak VAT Act § 74(1)(d)); required for 388, not after issueDate and not in the future.
deliveryDatedateoptionalActual delivery date for the whole document (BT-72) in YYYY-MM-DD format.
documentDiscountPercentnumberoptionalDocument-level discount percentage represented as a Peppol BG-20 allowance. This is additional to any items[].discount. (0–100)
currencystringoptionalISO 4217 currency code. If omitted, the authenticated firm's default currency is used, falling back to EUR. (default: EUR)
exchangeRatenumber | stringoptionalEUR value of one unit of a non-EUR currency; drives BT-6 TaxCurrencyCode and the VAT total in EUR (BT-111). Ignored for EUR.
notestringoptionalFree-text invoice note. Use it for a human-readable exemption/reverse-charge reason or other information the receiver must see.
ibanstringoptionalPayment IBAN. If omitted, the authenticated firm's saved IBAN is used when available.
paymentMethodstringoptionalPayment method. Accepted convenience aliases: bank_transfer=30, credit_transfer=30, sepa=58, card=48, cash=10, direct_debit=49. A direct UNCL4461 code such as 30 is also accepted. Omitted defaults to 30 in generated UBL.
variableSymbolstringoptionalVariable symbol (variabilný symbol) sent as the UBL PaymentID. Only its digits are kept, and the stored value equals the sent one; when more than 10 digits remain, the last 10 are used. A value without digits is treated as not sent. The format is never refused.
buyerReferencestringoptionalBuyer reference, purchase-order number, or internal procurement reference.
orderReferencestringoptionalBuyer's purchase-order number (BT-13, cac:OrderReference). (max 100 znakov / chars)
contractReferencestringoptionalContract number (BT-12, cac:ContractDocumentReference). (max 100 znakov / chars)
projectReferencestringoptionalProject reference (BT-11, cac:ProjectReference). (max 100 znakov / chars)
invoicePeriodStartdateoptionalFirst day of the billing period (BT-73, cac:InvoicePeriod/cbc:StartDate) in YYYY-MM-DD format.
invoicePeriodEnddateoptionalLast day of the billing period (BT-74, cac:InvoicePeriod/cbc:EndDate) in YYYY-MM-DD format. Must not be before invoicePeriodStart.
receiverNamestringoptionalCounterparty legal/business name. Required for invoice/credit_note. For self-billing it identifies the supplier, but supplierName is the clearer alias.
receiverIcostringoptionalCounterparty company registration number (IČO).
receiverDicstringoptionalCounterparty tax identification number (DIČ).
receiverIcDphstringoptionalCounterparty VAT identification number (IČ DPH). For self-billing it is also used to determine supplier-side VAT-payer treatment.
emailFallbackbooleanoptionalWhen true and the buyer has no Peppol registration, ePošťák e-mails the invoice (PDF and the sent UBL XML, plus attachments) once to receiverEmail or, when it is omitted, to the buyer e-mail in the UBL (BT-58). The document still ends as recipient_not_found and the TDD is reported as usual; the e-mail is not billed. The outcome is in emailFallback on GET /documents/{id}/status and on the document.delivery_failed webhook. Ak odberateľ nemá Peppol schránku, faktúru (PDF a odoslané UBL XML) mu pošleme raz e-mailom na receiverEmail, a ak chýba, na e-mail odberateľa z UBL. (default: false)
receiverEmailstringoptionalBuyer e-mail for emailFallback. Takes precedence over the buyer e-mail in the UBL (cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail, BT-58). When omitted, that UBL e-mail is used; required when emailFallback is true and the document carries no valid buyer e-mail. E-mail odberateľa pre emailFallback; bez neho použijeme e-mail odberateľa z UBL. (max 254 znakov / chars)
receiverStreetstringoptionalReceiver street and number. Preferred over parsing receiverAddress.
receiverCitystringoptionalCounterparty city.
receiverPostalCodestringoptionalCounterparty postal code.
receiverAddressstringoptionalSingle-line counterparty address. Prefer receiverStreet, receiverCity and receiverPostalCode when the ERP has split address fields.
receiverCountrystringoptionalCounterparty country as ISO 3166-1 alpha-2. Defaults to SK. (default: SK)
supplierNamestringoptionalSelf-billing alias for receiverName (supplier). Required for self_billing/self_billing_credit_note/self_billing_debit_note when receiverName is omitted.
supplierIcostringoptionalSelf-billing alias for receiverIco.
supplierDicstringoptionalSelf-billing alias for receiverDic.
supplierIcDphstringoptionalSelf-billing alias for receiverIcDph. Used for supplier-side VAT payer logic.
supplierStreetstringoptionalSelf-billing alias for receiverStreet.
supplierCitystringoptionalSelf-billing alias for receiverCity.
supplierPostalCodestringoptionalSelf-billing alias for receiverPostalCode.
supplierAddressstringoptionalSelf-billing alias for receiverAddress.
supplierCountrystringoptionalSelf-billing alias for receiverCountry. (default: SK)
prepaidAmountnumberoptionalAmount paid in advance (BT-113). Emitted as LegalMonetaryTotal/PrepaidAmount and reduces PayableAmount. Do not combine with your own items[].lineType=advance_deduction. With prepayments[] it may equal the sum of all prepayments[].amountWithVat; only untaxed advances (without taxDocumentRef) are emitted as PrepaidAmount. For advance_payment (388) it defaults to the total with VAT and, if sent, must equal it within 0.01. (min 0)
payableRoundingAmountnumberoptionalRounding of the amount to be paid (BT-114), signed, at most 2 decimal places, between -0.99 and 0.99. Emitted as LegalMonetaryTotal/PayableRoundingAmount; PayableAmount = total with VAT - prepaidAmount + payableRoundingAmount. It changes only the amount due: line amounts, the VAT base and VAT stay as calculated from items[]. ePošťák never calculates this value; when omitted or 0, nothing is rounded. Use it when the amount actually charged differs by cents from the calculated total, for example cash rounding or prices where VAT was taken out of the gross amount. Not allowed for advance_payment (388) and correction (384), and it must not make the amount due negative. (-0.99–0.99)
prepaymentsobject[]optionalStructured settled prepayments on the final invoice. Untaxed advances (without taxDocumentRef) are summed into prepaidAmount and reduce PayableAmount; taxed advances (with taxDocumentRef) are deducted as negative advance_deduction lines with a BT-25 BillingReference, so the tax breakdown reflects them. Advance and tax references are preserved in the UBL note. Do not combine your own items[].lineType=advance_deduction with untaxed advances. Not allowed on advance_payment (388). Štruktúrované zúčtované zálohy na konečnej faktúre; referencie zachová UBL poznámka. Záloha s &lt;code&gt;taxDocumentRef&lt;/code&gt; (zdanená, bol k nej vystavený daňový doklad k prijatej platbe) sa odpočíta záporným riadkom: množstvo −1, cena bez DPH, rovnaká sadzba DPH ako na daňovom doklade a odkaz BT-25 (BillingReference) na tento doklad, takže zníži základ aj DPH v daňovom rozpise. Záloha bez &lt;code&gt;taxDocumentRef&lt;/code&gt; (nezdanená) len zníži sumu na úhradu cez BT-113 &lt;code&gt;PrepaidAmount&lt;/code&gt;. Nie je povolené pri &lt;code&gt;advance_payment&lt;/code&gt; (388). Nekombinujte s vlastným riadkom &lt;code&gt;advance_deduction&lt;/code&gt; pre nezdanenú zálohu.
prepayments[].advanceInvoiceRefstringoptionalAdvance/prepayment invoice reference from the ERP.
prepayments[].taxDocumentRefstringoptionalNumber of the tax document for the received payment (UNCL1001 386 or 388). When set, the advance is taxed: it is deducted as a negative line with a BT-25 reference and vatRate is required.
prepayments[].settlementDatedateoptionalSettlement date in strict YYYY-MM-DD format.
prepayments[].amountWithoutVatnumberoptionalSettled amount without VAT. (min 0)
prepayments[].vatAmountnumberoptionalVAT amount from the settled prepayment. (min 0)
prepayments[].amountWithVatnumberREQSettled amount including VAT. Required. Untaxed advances are summed into prepaidAmount; for a taxed advance it yields the negative line price when amountWithoutVat is missing. (min 0)
prepayments[].vatRatenumberoptionalNon-negative VAT rate of the prepayment, preserved in the UBL note. Required with taxDocumentRef: the negative deduction line uses the VAT rate of the tax document. (min 0)
prepayments[].vatCategoryCodestringoptionalOptional VAT category of the prepayment. Values are normalized to uppercase and preserved as prepayment metadata. For a taxed advance it is the category of the deduction line (default S when vatRate is above 0). (povolené: S, Z, AE, E, K, G, O, L, M)
itemsobject[]optionalBilling lines. Between 1 and 999 entries are accepted. (max 999 položiek / items)
items[].descriptionstringREQNon-empty line name (BT-153). A longer text under the name can be sent as itemDescription (BT-154, max 1000 characters).
items[].quantitynumberREQQuantity. Must not be zero. A negative quantity on a standard line is a discount or returned item (unitPrice stays non-negative). Must be negative for lineType=advance_deduction.
items[].unitstringoptionalUN/ECE Rec 20 unit code. Use H87 for a piece; C62 is the generic one/unit code. Short aliases are also mapped: ks=H87, kus=H87, piece=H87, pcs=H87, jednotka=C62, unit=C62, one=C62, hod=HUR, den=DAY, mes=MON, kg=KGM, m=MTR, l=LTR, km=KMT. Omitted values default to C62. (default: C62)
items[].unitPricenumberREQNet price per unit. Must be a finite non-negative number. (min 0)
items[].vatRatenumberREQVAT rate in percent. Accepted values: 0, 5, 10, 19, 20, 23; this includes historical 20% for older/corrective documents. Z, AE, E, K, G and O categories require 0; S, L and M require a positive rate. Povolené: 0, 5, 10, 19, 20, 23; historická 20 % sadzba je podporovaná pre staršie doklady/opravné doklady. (povolené: 0, 5, 10, 19, 20, 23)
items[].vatCategoryCodestringoptionalDPH category BT-151 according to UNCL5305. A positive rate may derive S. At 0%, vatCategoryCode or taxTreatment is required because 0% can represent Z, E, AE, K, G or O. Najčastejšie: S = štandardná sadzba, Z = nulová sadzba, AE = prenesenie daňovej povinnosti. (povolené: S, Z, AE, E, K, G, O, L, M)
items[].vatCategorystringoptionalAlias for vatCategoryCode. (povolené: S, Z, AE, E, K, G, O, L, M)
items[].vat_categorystringoptionalSnake_case alias for vatCategoryCode. (povolené: S, Z, AE, E, K, G, O, L, M)
items[].taxTreatmentstringoptionalHigher-level ePostak tax treatment mapped to vatCategoryCode: standard=S, zero_rate=Z, reverse_charge_domestic=AE, exempt=E, intra_community_supply=K, export=G, outside_scope=O. Explicit vatCategoryCode wins when both are present. (povolené: standard, zero_rate, reverse_charge_domestic, exempt, intra_community_supply, export, outside_scope)
items[].tax_treatmentstringoptionalSnake_case alias for taxTreatment. (povolené: standard, zero_rate, reverse_charge_domestic, exempt, intra_community_supply, export, outside_scope)
items[].discountnumberoptionalLine discount percentage from 0 to 100. Omitted means 0. (0–100)
items[].deliveryDatestringoptionalLine delivery date. Written to UBL as cac:InvoiceLine/cac:InvoicePeriod (BT-134 and BT-135, start and end are the same date; ISO timestamps are accepted and only the date part is used) and printed in the PDF under the item name as "Dátum dodania". When the line dates differ, the document is a summary invoice (§ 75 of the Slovak VAT Act): the dates must stay within one calendar month and issueDate must be no later than the 15th day after that month ends.
items[].lineTypestringoptionalLine type. Use advance_deduction for a negative advance deduction line on the final invoice. (default: standard) (povolené: standard, advance_deduction)
items[].advanceInvoiceReferencestringoptionalAdvance invoice number. Required when lineType is advance_deduction. Emitted to UBL as AdditionalItemProperty named AdvanceInvoiceNumber.
items[].customsTariffCodestringoptionalCustoms tariff / combined nomenclature code. Emitted as CommodityClassification/ItemClassificationCode listID=HS; KV DPH A2 uses the first 4 digits as TK. (pattern ^\d{4,10}$)
items[].commodityClassificationCodestringoptionalGeneric item classification code when customsTariffCode is not used. Send together with commodityClassificationListId when the list is not HS.
items[].commodityClassificationListIdstringoptionalClassification list identifier from UNTDID 7143. Defaults to HS for customsTariffCode.
items[].reverseChargeParagraphLetterstringoptionalOptional letter of the domestic reverse-charge provision § 69 ods. 12, for example f or g, without parentheses. Written to the UBL line as AdditionalItemProperty with Name ReverseChargeParagraphLetter. Informational only: it is not printed on the PDF and no export (POHODA, KV DPH) reads it. The KV DPH A.2 row is built from customsTariffCode or commodityClassificationCode and from controlStatementType, controlStatementQuantity and controlStatementUnit.
items[].controlStatementTypestringoptionalSlovak KV DPH A2 TD value. (povolené: IO, MT)
items[].controlStatementQuantitynumberoptionalPositive Slovak KV DPH A2 Mn quantity. If omitted and the unit can be mapped, the absolute line quantity is used. (min 0)
items[].controlStatementUnitstringoptionalSlovak KV DPH A2 MJ unit. (povolené: kg, t, m, ks)
attachmentsobject[]optionalInvoice supporting documents (Peppol BG-24), embedded in UBL as base64 through AdditionalDocumentReference / EmbeddedDocumentBinaryObject. Maximum 20 files, 10 MB decoded per file, and 15 MB decoded total. These limits apply only to this field (JSON mode): a finished UBL sent in XML mode or through SAPI is checked only against the 22 MB document limit, however many attachments it embeds. (max 20 položiek / items)
attachments[].fileNamestringREQNon-empty attachment filename. (max 255 znakov / chars)
attachments[].mimeTypestringREQAllowed MIME types according to Peppol BR-CL-22. The decoded content must match this MIME type. (povolené: application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet)
attachments[].contentbase64REQBase64-encoded file content without a data: prefix. Must decode to a non-empty file and may be at most 10 MB after decoding.
attachments[].descriptionstringoptionalOptional short attachment description shown as supporting-document metadata.
xmlstringoptionalKompletne UBL XML (Invoice alebo CreditNote).

Príklady volania

cURL 1
curl -X POST https://epostak.sk/api/v1/documents/send \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{
    "receiverPeppolId": "0245:0000000002",
    "receiverName": "Zakaznik s.r.o.",
    "buyerReference": "OBJ-2026-001",
    "invoiceNumber": "FAK-2025-001",
    "issueDate": "2025-04-01",
    "dueDate": "2025-04-15",
    "items": [{"description": "Vyvoj softveru","quantity": 8,"unitPrice": 125,"vatRate": 23}]
  }'

Príklady odpovedí

201 Dokument uspesne odoslany
{ "documentId": "clx9abc123", "submissionId": "clx9abc123", "messageId": "msg_peppol_xyz", "status": "SENT", "links": { "document": "/api/v1/documents/clx9abc123", "status": "/api/v1/documents/clx9abc123/status", "events": "/api/v1/documents/clx9abc123/events", "ubl": "/api/v1/documents/clx9abc123/ubl", "evidence": "/api/v1/documents/clx9abc123/evidence", "supportPacket": "/api/v1/documents/clx9abc123/support-packet" }, "payloadSha256": "a1b2c3d4e5f6..." }
409 Conflict. Three distinct answers: (a) CONFLICT - the same Idempotency-Key is currently being processed; wait and retry (error.retry_after_seconds 5, Retry-After: 5); (b) VAT_PERIOD_CLOSED - the VAT period of the document's taxable-event date is already filed, retryable false; (c) TDD_IN_FLIGHT - the tax data document of the earlier invoice is still in transit, retryable true, retry_after_seconds 60, Retry-After: 60. (b) and (c) use a flat body (the legacy top-level <code>error</code> string plus <code>code</code>, <code>message</code>, <code>message_sk</code>, <code>fix_hint</code>, <code>retryable</code>; see the examples) and are not stored: a retry under the same Idempotency-Key is processed again, not replayed. RECIPIENT_NOT_FOUND (409) keeps its ErrorResponse shape.
{ "error": { "code": "DUPLICATE_INVOICE_NUMBER", "message": "Invoice number 2026001 already exists for your firm. For a sent invoice, issue a credit note, debit note or data correction with a new number and a reference to the original invoice. A new Idempotency-Key does not allow reusing an invoice number.", "conflictKey": ["firmId", "invoiceNumber"], "existingDocument": { "id": "clx9abc123", "invoiceNumber": "2026001", "status": "sent", "sentAt": "2026-04-15T10:23:11.000Z", "updatedAt": "2026-04-15T10:23:12.000Z", "editable": false, "recipient": { "peppolId": "0245:2122701339", "ico": "12345678", "name": "Test s.r.o." } } } }

Odpovede

  • 200Idempotent replay; no new document or send was created
  • 201Dokument uspesne odoslany
  • 202Dokument bol dorucenny cez Peppol, ale zapis lokalneho stavu zlyhal. Reconcile cron stav doplni; idempotent retry vrati identicku odpoved. Also the queued-retry receipt: the first delivery attempt failed temporarily, the document is stored with status sending and retried automatically (body: documentId, messageId, status, warning, submissionId, links; non-billing: status SEND_PENDING). Do not resend; follow GET /documents/{id}/status or the document.sent / document.delivery_failed webhooks.
  • 401Missing or invalid API key
  • 403API plan required or access denied
  • 409Conflict. Three distinct answers: (a) CONFLICT - the same Idempotency-Key is currently being processed; wait and retry (error.retry_after_seconds 5, Retry-After: 5); (b) VAT_PERIOD_CLOSED - the VAT period of the document's taxable-event date is already filed, retryable false; (c) TDD_IN_FLIGHT - the tax data document of the earlier invoice is still in transit, retryable true, retry_after_seconds 60, Retry-After: 60. (b) and (c) use a flat body (the legacy top-level <code>error</code> string plus <code>code</code>, <code>message</code>, <code>message_sk</code>, <code>fix_hint</code>, <code>retryable</code>; see the examples) and are not stored: a retry under the same Idempotency-Key is processed again, not replayed. RECIPIENT_NOT_FOUND (409) keeps its ErrorResponse shape.
  • 413Payload too large (body &gt; 25 MB, UBL &gt; 22 MB in XML mode)
  • 422Validation error. Two distinct failure shapes return 422 here: (a) UBL pre-flight rule violation — body matches UblValidationError with <code>code: "UBL_VALIDATION_ERROR"</code> and a <code>rule</code> field naming the violated BR-* / BT-* / PEPPOL-R* code; (b) IDEMPOTENCY_KEY_MISMATCH — same X-Idempotency-Key was replayed with a different request body hash, body matches the generic ErrorResponse; (c) SELF_ADDRESSED_SEND — receiverPeppolId is the sender's own Peppol ID, on the test network too; nothing was created or sent, send to another participant. (d) DOCUMENT_TYPE_NOT_SUPPORTED - the receiver is registered in Peppol but does not accept this document type; error.routingStatus, error.recipient.peppolId, error.retryable false and error.fix_hint (check GET /api/v1/peppol/capabilities); no document is created and nothing is billed. VALIDATION_ERROR answers may carry error.fields[] with the offending request path (for example <code>items[7].unitPrice</code>).
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 502Not returned any more: SEND_FAILED answers 503 (see below) and a temporary first-attempt failure answers 202. Historical shape: SEND_FAILED - Peppol AP dispatch failed. The error object names the kept document: error.documentId, error.submissionId and error.links (invoice send: document, status, events, ubl, evidence, evidenceBundle; non-billing send: document and status).
  • 503IDEMPOTENCY_STORE_UNAVAILABLE - Redis idempotency layer unreachable. Also SEND_FAILED / enqueue_outcome_unknown and QUEUE_FAILED when the durable queue outcome is unknown or could not be created: the error object then carries error.documentId, error.submissionId and error.links of the kept document (retry_after_seconds 30, Retry-After: 30 where the body names it).
POST/api/v1/documents/send/batch

Hromadné odoslanie max 50

Batch version of /documents/send. Each item is dispatched through the regular send pipeline and returns its own status + documentId (or per-item error). Partial success is expected — the HTTP status is 200 even if some items fail; inspect each result. Body size cap: 25 MB (use individual sends for larger batches). When the Idempotency-Key header is given, each item without its own idempotencyKey is sent under ${header}:${index} and each result item reports the key it used in idempotencyKey; items sent without any key have no idempotencyKey field.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringoptionalOptional batch-level idempotency key. Every item that has no idempotencyKey of its own is sent under &lt;header value&gt;:&lt;index&gt; (0-based position in items[]), so retrying the same batch with the same header replays each item instead of sending it twice. An item's own idempotencyKey always wins. The key actually used is returned as idempotencyKey in each result. (max 255 znakov / chars)
X-Idempotency-KeystringoptionalAlias for Idempotency-Key. Both headers are accepted. (max 255 znakov / chars)
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
itemsobject[]REQmax 50 položiek / items
items[].idempotencyKeystringoptionalOptional per-item idempotency key (propagated as Idempotency-Key header on the underlying single send). Without it, the item uses &lt;Idempotency-Key header&gt;:&lt;index&gt; when the batch request carries that header.

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/documents/send/batch \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"items":[
    {"receiverPeppolId":"0245:0000000002","receiverName":"Zakaznik Demo s.r.o.","buyerReference":"OBJ-2026-001","items":[{"description":"A","quantity":1,"unitPrice":100,"vatRate":23}],"idempotencyKey":"inv-001"},
    {"receiverPeppolId":"0245:0000000002","receiverName":"Zakaznik B s.r.o.","buyerReference":"OBJ-2026-001","items":[{"description":"B","quantity":2,"unitPrice":50,"vatRate":23}],"idempotencyKey":"inv-002"}
  ]}'

Príklady odpovedí

200 Batch processed (partial-success semantics)
{
  "total": 2,
  "succeeded": 1,
  "failed": 1,
  "results": [
    {"index":0,"status":201,"result":{"documentId":"clx9abc123","messageId":"msg_peppol_xyz","status":"SENT"}},
    {"index":1,"status":422,"result":{"error":{"code":"UBL_VALIDATION_ERROR","rule":"BR-CL-22","message":"BR-CL-22: invalid MIME type"}}}
  ]
}

Odpovede

  • 200Batch processed (partial-success semantics)
  • 401Invalid or missing API key
  • 403API plan required
  • 413Payload too large (&gt; 25 MB)
  • 422UBL validation error (schematron rule failed), or SELF_ADDRESSED_SEND when the receiver is the sender's own Peppol ID (test network too)
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/box/items

ePošťák Box: zaradiť dokument

Stages a document into ePošťák Box for durable, scheduled and retryable Peppol dispatch. Box je durable execution layer nad existujúcim Enterprise API: payload sa najprv uloží a až potom ho worker odošle cez Peppol podľa plánu, limitov a retry politiky. ePošťák Box nie je alias nad Connector outboxom a nie je to public RabbitMQ/Kafka rozhranie.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
payloadXmlstringREQUBL XML payload to stage in encrypted Box storage.
scheduledFordatetimeoptionalOptional future dispatch time.
externalIdstringoptionalOptional caller-side id for idempotency and lookup.
metadataobjectoptional

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/box/items \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"externalId":"ERP-1001","scheduledFor":"2026-07-01T08:00:00.000Z","payload":{"receiverPeppolId":"0245:0000000001","receiverName":"Zakaznik s.r.o.","items":[{"description":"Sluzba","quantity":1,"unitPrice":100,"vatRate":23}]}}'

Príklady odpovedí

201 Created
{"total":1,"ready":1,"items":[{"outboxId":"...","status":"ready","managedOutbox":{"state":"ready_to_send"}}]}

Odpovede

  • 201Created
  • 400Request rejected with HTTP 400. The response includes a stable error code and requestId when available.
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 409Request rejected with HTTP 409. The response includes a stable error code and requestId when available.
  • 413Request rejected with HTTP 413. The response includes a stable error code and requestId when available.
  • 422The request body, query parameter, or scheduledFor value is invalid (code VALIDATION_ERROR). Correct the indicated field; retrying unchanged does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/box/items

ePošťák Box: zoznam

Lists durable Box items for the authenticated firm from the dedicated Box model. Box is not a Connector outbox alias; REST, Connector and Dashboard flows attach to it as a shared reliability layer.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
statusstring (query)optionalOptional status filter: ready, scheduled, sending, retrying, sent, received, needs_repair, failed, cancelled or expired. An unknown value returns 422 VALIDATION_ERROR.
directionstring (query)optionalOptional direction filter. (povolené: outbound, inbound)
limitinteger (query)optionalPage size. Default 20; values above 100 are capped to 100 and 0 is raised to 1. A non-numeric or negative value returns 422 VALIDATION_ERROR. (1–100) (default: 20)
offsetinteger (query)optionalNumber of items to skip. Default 0; values above 10000 are capped to 10000, so items beyond that depth are not reachable by offset (narrow the list with status/direction instead). A non-numeric or negative value returns 422 VALIDATION_ERROR. The response echoes the effective limit and offset. (0–10000) (default: 0)

Príklady volania

cURL
curl https://epostak.sk/api/v1/box/items?status=scheduled \
  -H "Authorization: Bearer eyJhbGc..."

Odpovede

  • 200OK
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 422The request body, query parameter, or scheduledFor value is invalid (code VALIDATION_ERROR). Correct the indicated field; retrying unchanged does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/box/items/{itemId}

ePošťák Box: detail položky

Returns status, safe storage summary, dispatch attempts and audit timeline without plaintext invoice payloads or attachments.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
itemIduuidREQ

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/box/items/<itemId>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200OK
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404Not found
  • 422The request body, query parameter, or scheduledFor value is invalid (code VALIDATION_ERROR). Correct the indicated field; retrying unchanged does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/box/items/{itemId}/schedule

ePošťák Box: naplánovať

Schedule a Box item

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
itemIdstringREQ
scheduledFordatetimeREQFuture dispatch time.

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/box/items/{itemId}/schedule \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"scheduledFor":"2026-07-01T08:00:00.000Z"}'

Odpovede

  • 200OK
  • 400Request rejected with HTTP 400. The response includes a stable error code and requestId when available.
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404No such item for this firm. Items of other firms are reported as not found.
  • 409The Box item is in a state that does not allow this action. Read the item again and use only actions its current status allows.
  • 422The request body, query parameter, or scheduledFor value is invalid (code VALIDATION_ERROR). Correct the indicated field; retrying unchanged does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/box/items/{itemId}/send-now

ePošťák Box: odoslať teraz

Attempts dispatch for an outbound Box item when a Connector/Enterprise dispatch pointer is available. Returns 409 when the item cannot be dispatched by this route.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
itemIduuidREQ

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/box/items/<itemId>/send-now" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Dispatch attempted
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404No such item for this firm. Items of other firms are reported as not found.
  • 409Dispatch pointer unavailable
  • 422The request body, query parameter, or scheduledFor value is invalid (code VALIDATION_ERROR). Correct the indicated field; retrying unchanged does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/box/items/{itemId}/retry

ePošťák Box: retry

Moves a failed or repairable outbound Box item back into the retry flow and records an audit event.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
itemIduuidREQ

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/box/items/<itemId>/retry" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200OK
  • 400Request rejected with HTTP 400. The response includes a stable error code and requestId when available.
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404No such item for this firm. Items of other firms are reported as not found.
  • 409The Box item is in a state that does not allow this action. Read the item again and use only actions its current status allows.
  • 422The request body, query parameter, or scheduledFor value is invalid (code VALIDATION_ERROR). Correct the indicated field; retrying unchanged does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/box/items/{itemId}/cancel

ePošťák Box: zrušiť

Cancels an unsent outbound Box item. Sent or received archive items are retained by retention policy.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
itemIduuidREQ

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/box/items/<itemId>/cancel" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200OK
  • 400Request rejected with HTTP 400. The response includes a stable error code and requestId when available.
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404No such item for this firm. Items of other firms are reported as not found.
  • 409The Box item is in a state that does not allow this action. Read the item again and use only actions its current status allows.
  • 422The request body, query parameter, or scheduledFor value is invalid (code VALIDATION_ERROR). Correct the indicated field; retrying unchanged does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/inbound/documentsCore

Pull: zoznam prijatych dokumentov

Cursor-based list of documents received from Peppol. Returns newest-first by default. Use ?since= cursor for forward-paging (oldest-to-newest order is ascending). Auth: scope documents:read, plan api-enterprise directly, or integrator-managed through the managing integrator. Response shape is produced by formatInboundDocument.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
sincestring (query)optionalOpaque versioned cursor from previous response next_cursor. Omit to start from beginning.
limitinteger (query)optionalPage size, default 100. Values above 500 are clamped to 500 (no error). A value below 1 or a non-integer returns 400. (min 1) (default: 100)
kindstring (query)optionalFilter by doctype key (invoice, credit_note, etc.)
senderstring (query)optionalFilter by sender Peppol ID (exact match)

Príklady volania

cURL
# Prvy request — bez kurzora, najstarsie dokumenty:
curl https://epostak.sk/api/v1/inbound/documents \
  -H "Authorization: Bearer eyJhbGc..."

# Pokracovanie z ulozeneho kurzora:
curl "https://epostak.sk/api/v1/inbound/documents?since=eyJ2IjoxLCJyIjoi...&limit=100" \
  -H "Authorization: Bearer eyJhbGc..."

# Filter na faktury od konkretneho odosielatela:
curl "https://epostak.sk/api/v1/inbound/documents?kind=invoice&sender=0245:2012345678" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Paginated list of inbound documents
{
  "documents": [{
    "id": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
    "received_at": "2026-05-10T14:23:45.512Z",
    "kind": "invoice",
    "peppol_message_id": "uuid-from-peppol-network",
    "sender": {
      "peppol_id": "0245:2012345678",
      "name": "ACME s.r.o.",
      "country": "SK"
    },
    "recipient": {
      "peppol_id": "0245:9988776655",
      "name": "Customer s.r.o.",
      "country": "SK"
    },
    "document_type": "BIS Billing 3.0 Invoice",
    "document_type_id": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::Invoice##urn:cen.eu:en16931:2017",
    "ubl_url": "https://epostak.sk/api/v1/inbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/ubl",
    "metadata": {
      "invoice_number": "FA-2026-001",
      "total_amount": "1234.56",
      "currency": "EUR",
      "issue_date": "2026-05-09"
    },
    "preceding_invoice": null,
    "ack": {"acked_at": null, "client_reference": null}
  }],
  "next_cursor": "eyJ2IjoxLCJyIjoiMjAyNi0wNS0xMFQxNDoyMzo0NS41MTJaIiwiaSI6IjhlNGI4ZjBlLTIxZDMtNGQyYS05YzJiLTI0YTNmOGEwYzExMSJ9",
  "has_more": true
}

Odpovede

  • 200Paginated list of inbound documents
  • 400Invalid query parameters (e.g. malformed cursor, limit out of range)
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 429Rate limit exceeded
GET/api/v1/inbound/documents/{id}Core

Pull: detail dokumentu

Fetch a single inbound document by ID. 404 when the document does not exist or belongs to a different tenant.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQDocument ID

Príklady volania

cURL
curl https://epostak.sk/api/v1/inbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111 \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Inbound document
{
  "id": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
  "received_at": "2026-05-10T14:23:45.512Z",
  "kind": "invoice",
  "peppol_message_id": "uuid-from-peppol-network",
  "sender": {"peppol_id": "0245:2012345678", "name": "ACME s.r.o.", "country": "SK"},
  "recipient": {"peppol_id": "0245:9988776655", "name": "Customer s.r.o.", "country": "SK"},
  "document_type": "BIS Billing 3.0 Invoice",
  "document_type_id": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::Invoice##urn:cen.eu:en16931:2017",
  "ubl_url": "https://epostak.sk/api/v1/inbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/ubl",
  "metadata": {"invoice_number": "FA-2026-001", "total_amount": "1234.56", "currency": "EUR", "issue_date": "2026-05-09"},
  "ack": {"acked_at": null, "client_reference": null}
}

Odpovede

  • 200Inbound document
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 404Document not found or does not belong to this tenant
  • 429Rate limit exceeded
GET/api/v1/inbound/documents/{id}/ubl

Pull: surový UBL XML

Returns the raw AS4-received UBL XML. 404 when no rawXmlPath stored (documents received before the raw-archive feature was enabled). Response: with .

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQ

Príklady volania

cURL
curl https://epostak.sk/api/v1/inbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/ubl \
  -H "Authorization: Bearer eyJhbGc..." \
  -o invoice.xml

Príklady odpovedí

200 Raw UBL XML
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
         xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
         xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
  <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>
  <cbc:ID>FA-2026-001</cbc:ID>
  <!-- ... -->
</Invoice>

Odpovede

  • 200Raw UBL XML
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 404Document not found or does not belong to this tenant
  • 429Rate limit exceeded
POST/api/v1/inbound/documents/{id}/ackCore

Pull: explicitné potvrdenie spracovania

Mark an inbound document as acknowledged by the client. Idempotent — calling again with a new client_reference overwrites the previous one (latest-ack-wins). Auth: scope documents:write (NOT documents:read — this is a write operation). Response: Returns the full document shape post-ack. VOLITEĽNÉ. Väčšina klientov toto nepotrebuje — vlastný postup synchronizácie si drží cez kurzor z GET /inbound/documents. Explicitný ack existuje pre klientov, ktorí chcú na serveri zaznamenať „úspešne spracované u nás" oddelene od „úspešne stiahnuté". Je to jeden spoločný stav firmy, nie samostatný stav pre každý API kľúč alebo konzumný systém. Vyžaduje scope documents:write, nie iba documents:read, pretože mení stav dokumentu. Opakované volanie prepíše timestamp a client_reference podľa pravidla latest-ack-wins; každý konzument si preto musí viesť vlastnú evidenciu spracovania.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQ
client_referencestringoptionalOptional opaque reference stored on the document (your internal document ID, ERP reference, etc.). Latest-ack-wins: calling ack again with a new client_reference overwrites the previous one. (max 256 znakov / chars)

Príklady volania

cURL
# Bez tela:
curl -X POST https://epostak.sk/api/v1/inbound/documents/8e4b8f0e-.../ack \
  -H "Authorization: Bearer eyJhbGc..."

# S klientskym referencom:
curl -X POST https://epostak.sk/api/v1/inbound/documents/8e4b8f0e-.../ack \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"client_reference": "INT-2026-417"}'

Príklady odpovedí

200 Document acknowledged; returns updated document shape
{
  "id": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
  "received_at": "2026-05-10T14:23:45.512Z",
  "kind": "invoice",
  "ack": {"acked_at": "2026-05-10T15:00:00.000Z", "client_reference": "INT-2026-417"}
}

Odpovede

  • 200Document acknowledged; returns updated document shape
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:write)
  • 404Document not found or does not belong to this tenant
  • 429Rate limit exceeded
GET/api/v1/documents/{id}/statusCore

Stav dokumentu

Vrati aktualny stav dokumentu vratane kompletnej historie stavov. Vrati aj non-billing dokumenty (Order, DespatchAdvice, ...) v rovnakom tvare: documentType = doctypeKey, statusHistory prazdna, tdd.status not_started a polia specificke pre faktury su null. localAcknowledgedAt je lokalne potvrdenie prijimatela (POST /documents/inbox/{id}/acknowledge alebo POST /inbound/documents/{id}/ack). Required scope: documents:read alebo documents:send. Kľúč iba s documents:send (firma prijíma faktúry u iného poskytovateľa) vidí stav svojich odoslaných dokumentov; prijatý dokument preň vráti 404.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/clx9abc123/status \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Stav dokumentu
{
  "id": "clx9abc123",
  "status": "delivered",
  "documentType": "invoice",
  "direction": "outbound",
  "senderPeppolId": "0245:9876543210",
  "receiverPeppolId": "0245:0000000001",
  "statusHistory": [{"status":"queued","timestamp":"2025-04-01T10:00:00.000Z"},{"status":"sent","timestamp":"2025-04-01T10:01:00.000Z"},{"status":"fs_reported","timestamp":"2025-04-01T10:01:05.000Z","detail":"TDD dispatched via Peppol."},{"status":"delivered","timestamp":"2025-04-01T10:01:30.000Z"}],
  "tdd": {"status":"accepted","submittedAt":"2025-04-01T10:01:05.000Z","responseCode":"AP","responseAt":"2025-04-01T10:02:00.000Z","error":null},
  "deliveryFailure": null,
  "validationResult": null,
  "deliveredAt": "2025-04-01T10:01:30.000Z",
  "acknowledgedAt": null,
  "localAcknowledgedAt": null,
  "invoiceResponseStatus": null,
  "peppolMessageId": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "as4MessageId": "msg_peppol_xyz",
  "deliveryMethod": "as4",
  "invoiceResponseDispatch": null,
  "emailFallback": null,
  "createdAt": "2025-04-01T10:00:00.000Z",
  "updatedAt": "2025-04-01T10:02:00.000Z"
}

Odpovede

  • 200Stav dokumentu
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Dokument nenajdeny
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/documents/status/batch

Hromadný stav až 100 dokumentov

Vráti stav až 100 dokumentov v jednom volaní. Každý nájdený dokument má rovnaký tvar ako GET /documents/{id}/status vrátane tdd, deliveryFailure a acknowledgedAt. Výsledky sú v rovnakom poradí ako vstupné ids. Dokumenty, ktoré nepatria volajúcej firme alebo neexistujú, sú v odpovedi označené { "error": "not_found" } — endpoint nikdy nevráti 404 pre celé volanie ani neprezradí existenciu dokumentov inej firmy. Rate limit: 300 req/min na API kľúč (až 30 000 stavov za minútu). Pre jednotlivé dokumenty použite GET /documents/{id}/status (limit 400 req/min). Telo cap: 64 KB. Required scope: documents:read alebo documents:send. Kľúču iba s documents:send sa prijaté dokumenty vrátia ako { "error": "not_found" }. Non-billing dokumenty (Order, DespatchAdvice, ...) sa vracaju v rovnakom tvare ako faktury (documentType = doctypeKey, statusHistory prazdna, tdd.status not_started, polia specificke pre faktury null); localAcknowledgedAt je lokalne potvrdenie prijimatela.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idsstring[]REQPole 1-100 document IDs. Duplicity sú deduplikované pred query, ale poradie volajúceho je zachované v results. (max 100 položiek / items)

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/documents/status/batch \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"ids":["clx9abc123","clx9def456","clx9ghi789"]}'

Príklady odpovedí

200 Per-item statuses v poradí volajúcich <code>ids</code>
{
  "total": 3,
  "found": 2,
  "notFound": 1,
  "results": [
    { "id": "clx9abc123", "status": "delivered", "documentType": "invoice", "senderPeppolId": "0245:9876543210", "receiverPeppolId": "0245:0000000001", "statusHistory": [...], "validationResult": null, "deliveredAt": "2025-04-01T10:02:30.000Z", "acknowledgedAt": null, "invoiceResponseStatus": null, "as4MessageId": "msg_peppol_xyz", "createdAt": "2025-04-01T10:00:00.000Z", "updatedAt": "2025-04-01T10:02:30.000Z" },
    { "id": "clx9def456", "status": "sent" },
    { "id": "clx9ghi789", "error": "not_found" }
  ]
}

Odpovede

  • 200Per-item statuses v poradí volajúcich <code>ids</code>
  • 400Missing or malformed X-Firm-Id header. Returned when the bearer JWT was minted from an integrator key (sk_int_*) and X-Firm-Id is absent or not a UUID (code BAD_REQUEST). Request-body and query validation failures are reported as 422 VALIDATION_ERROR, not 400.
  • 401Unauthorized
  • 403API plan required
  • 413Body exceeds 64 KB
  • 422Validation failed (VALIDATION_ERROR): invalid JSON, ids missing, empty, longer than 100 items, or containing non-string or empty values.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/{id}/evidence

AS4 potvrdenie a MLS

Vrati AS4 receipt, Peppol Message Level Status (MLS) a samostatnu Invoice Response pre odoslany dokument.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/clx9abc123/evidence \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Dokazy o doruceni
{
  "documentId": "clx9abc123",
  "as4Receipt": "<?xml ...AS4 receipt...>",
  "mlrDocument": "<?xml ...MLS...>",
  "invoiceResponse": {"status":"AP","document":"<?xml...>"},
  "tdd": {"reportedAt":"2025-04-01T10:05:00.000Z","reported":true},
  "deliveredAt": "2025-04-01T10:01:00.000Z",
  "sentAt": "2025-04-01T10:00:00.000Z"
}

Odpovede

  • 200Dokazy o doruceni
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Dokument nenajdeny
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/{id}/support-packetCore

Support packet dokumentu

Canonical Lifecycle &amp; proof endpoint for the document support ZIP bundle. Enterprise reliability contract final step: store requestId, documentId/submissionId, messageId, payloadSha256 and support-packet for incidents instead of sending full XML when a hash and support packet are enough. document.xml and document.pdf are in the packet immediately; the AS4 envelope and the MDN receipt are archived by a job that runs every 5 minutes, so right after delivery manifest.json shows completeness.level=partial with archiveStatus=pending (first 10 minutes) and later missing, until the archive catches up (about 12 minutes in the sandbox). Fetch the packet once after about 15 minutes and check completeness.fullEvidence; if it is false, retry with growing intervals. There is no webhook for archive completion. The retired /documents/{id}/evidence-bundle alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQDocument ID

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/clx9abc123/support-packet \
  -H "Authorization: Bearer eyJhbGc..." \
  --output evidence.zip

Odpovede

  • 200Document support packet
  • 401Unauthorized
  • 403API plan required
  • 404Document not found
  • 413Support packet too large
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 500MDN evidence integrity check failed
GET/api/v1/documents/{id}/envelope

AS4 envelope (WORM archív)

Streams the raw multipart AS4 envelope for this document from the Enterprise API evidence archive exactly as it was transmitted on the Peppol network — signed, timestamped, tamper-evident. The archive is available during the active contract term and for 30 days after termination for export; it is not a standalone accounting archive outside the contract. Response headers include X-Envelope-Archived-At (ISO 8601) and X-Envelope-Direction (inbound|outbound). Archive cron runs on a short interval, so brand-new documents may briefly 404 until archived. Requires an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQDocument ID

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/clx9abc123/envelope \
  -H "Authorization: Bearer eyJhbGc..." \
  --output envelope.as4

Odpovede

  • 200Signed AS4 envelope
  • 401Invalid or missing API key
  • 403API plan required
  • 404Document not found OR envelope not yet archived
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/{id}/events

Udalosti životného cyklu dokumentu

Paginated, reverse-chronological timeline for a single document: creation, validation, AS4 send/receipt, MLS, Invoice Response, FS SR reporting, and user actions. Synthesized from invoice fields when document_events has no rows yet, with real DB rows once events are emitted.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQDocument ID
limitinteger (query)optional1–100 (default: 20)
cursorstring (query)optionalOpaque cursor from previous response

Príklady volania

cURL
curl "https://epostak.sk/api/v1/documents/clx9abc123/events?limit=50" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Event list
{
  "documentId": "clx9abc123",
  "events": [
    {"id":"syn-clx9abc123-1","eventType":"document.created","actor":"system","detail":"Document FAK-2025-001 created","meta":{"createdVia":"api","direction":"outbound","docType":"invoice"},"occurredAt":"2025-04-01T10:00:00.000Z"},
    {"id":"syn-clx9abc123-2","eventType":"document.status_changed","actor":"system","detail":null,"meta":{"toStatus":"sent"},"occurredAt":"2025-04-01T10:01:00.000Z"},
    {"id":"evt_mls_abc","eventType":"document.mls_received","actor":"system","detail":"Receiver AP accepted responsibility; C4 receipt is unconfirmed","meta":{"mlsCode":"AB","deliveryOutcome":"forwarded_unconfirmed","mlsMessageId":"mls-123","originalMessageId":"msg_peppol_xyz","receivedAt":"2025-04-01T11:25:00.000Z","reason":"Receiver AP accepted responsibility; C4 receipt is unconfirmed"},"occurredAt":"2025-04-01T11:25:00.000Z"},
    {"id":"evt_real_abc","eventType":"document.response_received","actor":"system","detail":null,"meta":{"invoiceResponseStatus":"AP"},"occurredAt":"2025-04-01T11:30:00.000Z"}
  ],
  "pagination": {"limit":20,"nextCursor":null,"hasMore":false}
}

Odpovede

  • 200Event list
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 404Document not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/{id}/responses

Invoice response história

Vrati zoznam invoice responses (AP/RE/UQ) pre odoslany dokument.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/clx9abc123/responses \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Zoznam invoice responses
{
  "documentId": "clx9abc123",
  "responses": [
    {"id":"evt_resp_abc","responseCode":"AP","note":null,"senderPeppolId":"0245:9876543210","createdAt":"2025-04-01T11:30:00.000Z"}
  ]
}

Odpovede

  • 200Zoznam invoice responses
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Dokument nenajdeny
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/{id}/pdf

Stiahnuť PDF

Vrati PDF verziu faktury ako binarny subor.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/clx9abc123/pdf \
  -H "Authorization: Bearer eyJhbGc..." \
  --output invoice.pdf

Odpovede

  • 200PDF subor
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Dokument nenajdeny alebo PDF nie je dostupne
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/{id}/ubl

Stiahnuť UBL XML

Vrati UBL XML reprezentaciu dokumentu.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/clx9abc123/ubl \
  -H "Authorization: Bearer eyJhbGc..." \
  --output invoice.xml

Odpovede

  • 200UBL XML subor
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Dokument nenajdeny alebo UBL nie je dostupne
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/documents/{id}/respond

Odoslať odpoved na fakturu

Potrebný scope: documents:write

Sends an invoice response for inbound documents. Allowed changes: AB → IP/UQ/CA/AP/RE/PD; IP → UQ/CA/AP/RE/PD; UQ → IP/CA/AP/RE/PD; CA → AP/RE/PD; AP → PD; RE → —; PD → —. Any listed status is allowed initially. Repeating the same status reuses the original response and note. Other transitions return 422 with currentStatus, requestedStatus and allowedTransitions in error.details. A stored response is a decision; HTTP 202 indicates pending delivery. Poll document status for delivery and retry outcomes.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu
statusstringREQAB=accepted_billing, IP=in_process, UQ=under_query, CA=conditionally_accepted, RE=rejected, AP=accepted, PD=paid (povolené: AB, IP, UQ, CA, RE, AP, PD)
notestringoptionalOptional note, truncated to 500 characters. For CA, UQ and RE it is also sent as the clarification text (cbc:StatusReason). (max 500 znakov / chars)
reasonCodestringoptionalOptional Peppol clarification reason (OpenPeppol OPStatusReason list, cbc:StatusReasonCode). CA, UQ and RE require one (PEPPOL-T111-R001); when omitted, OTH is sent with the note as the clarification text. PPD (partial payment) is only allowed with status PD and needs a note. (povolené: NON, REF, LEG, REC, QUA, DEL, PRI, QTY, ITM, PAY, UNR, FIN, PPD, OTH)

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/documents/clx9abc123/respond \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"status":"AP","note":"Faktura akceptovana"}'

Príklady odpovedí

200 Invoice response dispatched successfully via AS4
{"documentId":"clx9abc123","responseStatus":"AP","respondedAt":"2025-04-01T11:00:00.000Z","peppolMessageId":"msg_peppol_resp_xyz","dispatchStatus":"sent"}

Odpovede

  • 200Invoice response dispatched successfully via AS4
  • 202Response persisted; AS4 dispatch failed or its queue outcome is unknown. Inspect <code>queuedForRetry</code> and <code>dispatchError</code>.
  • 401Missing or invalid API key
  • 403API plan required or access denied
  • 404Dokument nenajdeny alebo nie je inbound
  • 422Invalid request or UBL validation error, or <code>RESPONSE_NOT_ALLOWED_FOR_ISSUED_DOCUMENT</code>: the document was issued by your firm and only the buyer sends an Invoice Response (read the buyer's answers with <code>GET /documents/{id}/responses</code>), or <code>PEPPOL_RECIPIENT_RESPONSE_NOT_SUPPORTED</code>: the supplier has no Invoice Response document type registered in its SMP, so it cannot receive the response; nothing was sent and the document status is unchanged (<code>retryable: false</code>)
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 502<code>RESPONSE_DISPATCH_REJECTED</code>: the response was refused before delivery; nothing was sent and the document status is unchanged (<code>retryable: false</code>, <code>dispatchError</code>)
POST/api/v1/documents/{id}/mark

Označiť stav dokumentu

Granular state-transition endpoint for integrators running their own processing pipeline. Report when the external channel confirmed delivery, the ERP consumed the document, the user opened it, or delivery terminally failed. Local state only: the state is stored for your firm in ePošťák, nothing is sent to the supplier or over Peppol, and it is not reported to the tax authority. To give the supplier a business answer (for example AP accepted), use POST /documents/{id}/respond.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQDocument ID
statestringREQdelivered = external channel confirmed physical delivery; processed = buyer's ERP consumed the document; failed = terminal failure (blocks retries); read = user opened it (sets read_at). delivered, processed and failed are accepted on received (inbound) documents only; on an outbound document they return 422, because the sender gets these signals from the recipient over Peppol. read is accepted on both. failed is applied only while the document is received, acknowledged or failed; from any other status (accepted, rejected, paid, validation_deferred, ...) it returns 409 DOCUMENT_STATUS_CONFLICT with error.current_status. (povolené: delivered, processed, failed, read)
notestringoptionalOptional audit note appended to statusHistory.

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/documents/clx9abc123/mark \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"state":"processed","note":"Zaúčtované v ERP"}'

Príklady odpovedí

200 State updated
{
  "id": "clx9abc123",
  "state": "processed",
  "status": "received",
  "deliveredAt": "2025-04-01T10:01:00.000Z",
  "acknowledgedAt": "2025-04-01T10:15:00.000Z",
  "readAt": null
}

Odpovede

  • 200State updated
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 404Document not found
  • 409DOCUMENT_STATUS_CONFLICT: state <code>failed</code> can only be set while the document is received, acknowledged or failed (failed again is idempotent). The document is not changed. error.current_status names its status, error.retryable is false and error.fix_hint explains that an answered or still-validating document keeps its status.
  • 422Invalid state value
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/documents/preflightCore

Kontrola pred odoslaním

Enterprise reliability contract: capability -&gt; preflight -&gt; send -&gt; events -&gt; support. Dry-run send without creating a document or billing usage; run it after capability checks and before POST /documents/send. Read decision/canSend/errors/checks for the result, and retry the later send call with the same Idempotency-Key when it is the same payload.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
receiverPeppolIdstringREQPeppol ID prijemcu
documentTypeIdstringoptionalFull Peppol document type identifier (optional, default: Invoice BIS Billing 3.0). Credit note: urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1. The busdox-docid-qns:: prefix is accepted and ignored.

Príklady volania

cURL 1
curl -X POST https://epostak.sk/api/v1/documents/preflight \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{
    "senderParticipantId":"0245:2020123456",
    "receiverParticipantId":"0245:2020298610",
    "documentTypeId":"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1",
    "processId":"urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
    "ublDocument":"<Invoice>...</Invoice>"
  }'

Príklady odpovedí

200 Vysledok preflight kontroly (tri-state booleans)
{
  "decision": "sendable_with_warnings",
  "networkReady": true,
  "valid": true,
  "canSend": true,
  "participantExists": true,
  "errors": [],
  "warnings": [{
    "category": "VALIDATION",
    "code": "BR-DEMO",
    "severity": "warning",
    "message": "Buyer reference is recommended",
    "location": "/Invoice/cbc:BuyerReference"
  }],
  "checks": [
    {"name":"validation","status":"warning","durationMs":180},
    {"name":"participant","status":"passed","durationMs":420},
    {"name":"routing","status":"passed","durationMs":420}
  ],
  "recipient": {
    "peppolId": "0245:2020298610",
    "scheme": "0245",
    "identifier": "2020298610",
    "source": "sml",
    "accessPoint": {"url":"https://ap.receiver.example/as4","transportProfile":"peppol-transport-as4-v2_0"},
    "certificate": {"present":true,"serviceExpirationDate":"2099-01-01T00:00:00Z"},
    "supportedDocumentTypes": ["urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##...", "urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##..."]
  },
  "documentProfile": {
    "documentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##...",
    "processId": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
    "ruleset": "Peppol BIS Billing 3.0",
    "rulesetVersion": "current",
    "inputMode": "ubl"
  },
  "trace": {"traceId":"...","checkedAt":"2026-05-17T12:00:00.000Z","durationMs":620,"validationMs":180,"participantLookupMs":420},
  "recipientFound": true,
  "recipientAcceptsDocumentType": true,
  "validationPassed": true,
  "validationErrors": []
}

Odpovede

  • 200Vysledok preflight kontroly (tri-state booleans)
  • 401Missing or invalid API key
  • 403API plan required
  • 413Payload too large (&gt; 25 MB)
  • 422UBL validation error (schematron rule failed), or SELF_ADDRESSED_SEND when the receiver is the sender's own Peppol ID (test network too)
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503SMP lookup service unavailable
POST/api/v1/inbound/import

Importovať prijatý UBL dokument

Stores a UBL billing document received outside the Peppol network (email, SFTP, migration from another access point) in the same inbound document store as Peppol receipts. Accepts raw application/xml or application/json with an xml field. The XML receiver Peppol ID must match the authenticated firm. Emits document.received after the row is stored.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
bodyapplication/xml | text/xmlREQ
xmlstringREQRaw UBL XML. Receiver identity must match the authenticated firm's Peppol ID: AccountingCustomerParty/EndpointID for a standard invoice, AccountingSupplierParty/EndpointID for self-billing.
sourcestringoptionalOptional caller source label, for example email, sftp, manual or migration.
messageIdstringoptionalOptional external audit message ID. Defaults to import:{documentId}. Idempotent replay uses Idempotency-Key, not messageId. Bez idempotencyKey vráti import messageId, ktoré firma už má ako prijatý dokument, tento dokument s 200 a duplicate=true namiesto vytvorenia druhého.
idempotencyKeystringoptionalOptional idempotency key stored on the imported document row. Reusing the same key with the same XML and metadata replays the original document; changing XML or metadata returns 422. Rovnaký kľúč s rovnakou normalizovanou požiadavkou vráti pôvodný dokument s duplicate=true; rovnaký kľúč s inými metadátami alebo XML vráti 422.
documentTypeIdstringoptionalOptional override for the Peppol document type URN. Defaults from the parsed invoice type.
processIdstringoptionalOptional override for the Peppol process URN. Defaults from the parsed invoice type.

Príklady volania

cURL 1
curl -X POST https://epostak.sk/api/v1/inbound/import \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/xml" \
  -H "Idempotency-Key: email-2026-06-30-001" \
  --data-binary "@received-invoice.xml"

Príklady odpovedí

201 Document imported
{
  "documentId": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
  "submissionId": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
  "status": "RECEIVED",
  "kind": "invoice",
  "source": "api_import",
  "links": {
    "document": "/api/v1/inbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
    "ubl": "/api/v1/inbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/ubl",
    "ack": "/api/v1/inbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/ack"
  }
}

Odpovede

  • 201Document imported
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires documents:write)
  • 413Payload too large
  • 422Invalid XML, unsupported document type, or receiver Peppol ID does not match this firm
  • 429Rate limit exceeded
GET/api/v1/documents/expiring

Doklady, ktoré sa budú mazať

Doklady firmy, ktoré sa do troch týždňov začnú mazať, od najstarších. Pole delete_from je najskorší čas zmazania. Zoznam je prázdny, ak má firma Archív 10 rokov alebo jej zmluva doklady uchováva dlhšie.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
offsetinteger (query)optionalPočet preskočených záznamov (min 0) (default: 0)
limitinteger (query)optionalPočet záznamov na stranu (1–100) (default: 20)

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/documents/expiring" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Doklady, ktoré sa budú mazať
  • 401Missing or invalid API key
  • 403API plan required or access denied
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/outbox

Zoznam odoslanych dokumentov

Vrati strankovany zoznam dokumentov odoslanych cez Peppol pre vasu firmu.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
offsetinteger (query)optionalPocet preskocenych zaznamov (min 0) (default: 0)
limitinteger (query)optionalPocet vratenych zaznamov (1–100) (default: 20)
cursorstring (query)optionalOpaque cursor from the previous response's nextCursor. Prefer it over offset: pages stay stable when new documents are created while you paginate. When set, offset is ignored.
statusstring (query)optionalFilter podla stavu dokumentu (povolené: SENT, DELIVERED, FAILED, REJECTED, ACKNOWLEDGED, SENDING, SEND_FAILED, RECIPIENT_NOT_FOUND, VALIDATION_FAILED, PAID, DRAFT, OVERDUE, ACCEPTED)
sincedatetime (query)optionalReturn only documents created after this ISO 8601 timestamp
peppolMessageIdstring (query)optionalFilter by Peppol message ID (exact match) (max 100 znakov / chars)

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/documents/outbox" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Zoznam odoslanych dokumentov (response root key je <code>documents</code>, kazdy item je normalizovany InvoiceResponse so supplier/customer/totals nested objektami podla <code>formatInvoice()</code> v <code>lib/api/format.ts</code>.
  • 401Missing or invalid API key
  • 403API plan required or access denied
  • 422Invalid status, since or peppolMessageId parameter
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/{id}

Detail dokumentu — invoice alebo non-billing Peppol doc

Vráti dokument podľa ID. Najprv hľadá medzi invoices (BIS Billing); ak ho tam nenájde, hľadá medzi peppol_documents (non-billing T01/T16/T19/T76 atď.). Tenant-isolated cez firmId — dokumenty inej firmy nikdy nevráti. Required scope: documents:read.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu (invoice alebo peppol_document)

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/documents/<id>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Detail dokumentu — Invoice (BIS Billing, tvar DocumentResponse vrátane <code>precedingInvoice</code>) alebo PeppolDocument (non-billing) shape, podľa toho kam dokument patrí
  • 401Neplatný alebo chýbajúci JWT
  • 403Enterprise plán vyžadovaný
  • 404Dokument nenájdený
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
PATCH/api/v1/documents/{id}

Upraviť draft fakturu

Aktualizuje draft fakturu pred odoslaním. Pracuje len s status=draft invoice rows — non-draft a non-invoice dokumenty vrátia 422. Telo je strict (neznáme polia odmietne). Polia, ktoré nie sú v tele, ostanú nezmenené. Required scope: documents:write.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID draft faktury
invoiceNumberstringoptional
issueDatestringoptionalpattern ^\d{4}-\d{2}-\d{2}$
dueDatestringoptionalpattern ^\d{4}-\d{2}-\d{2}$
currencystringoptional
notestringoptional
ibanstringoptional
variableSymbolstringoptional
buyerReferencestringoptional
receiverNamestringoptional
receiverIcostringoptional
receiverDicstringoptional
receiverIcDphstringoptional
receiverAddressstringoptional
receiverCountrystringoptional
receiverPeppolIdstringoptional
itemsobject[]optional
items[].descriptionstringREQ
items[].quantitynumberREQmin 0
items[].unitstringoptionalUN/ECE Rec 20 (default: C62)
items[].unitPricenumberREQmin 0
items[].vatRatenumberREQSK VAT rates from 2025 plus historical 20% for older correction documents (povolené: 0, 5, 10, 19, 20, 23)
items[].discountnumberoptional0–100 (default: 0)

Príklady volania

cURL
curl -X PATCH "https://epostak.sk/api/v1/documents/<id>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID" \
  -H "Content-Type: application/json" \
  -d '{}'

Odpovede

  • 200Updated invoice
  • 401Unauthorized
  • 403API plan required
  • 404Document not found
  • 409VAT_PERIOD_CLOSED - the delivery, tax point or issue date falls into an already filed VAT period (standard error envelope: error.code VAT_PERIOD_CLOSED, error.message, error.message_sk, error.fix_hint, error.retryable false). Keep the dates in an open VAT period.
  • 422Validation Error or non-draft / non-invoice document
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/outbound/documentsStabilný, bez nových funkcií

Pull: zoznam odoslaných dokumentov

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /documents/outbox

Cursor-based list of outbound documents (both Invoice-backed billing and PeppolDocument non-billing). Merged and sorted newest-first. Uses a union cursor (-prefixed base64url, v=1) to correctly paginate across two source tables. Auth: scope documents:read, plan api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
sincestring (query)optionalUnion cursor from previous next_cursor
limitinteger (query)optional1–500 (default: 100)
kindstring (query)optionalFilter by doctype key
statusstring (query)optionalFilter by transport_status (povolené: queued, sending, sent, delivered, failed, dead)
business_statusstring (query)optionalFilter by invoice business_status (billing docs only)
recipientstring (query)optionalFilter by recipient Peppol ID
since_datedatetime (query)optionalFilter: rows created at or after this timestamp (ISO 8601), on both invoices and other Peppol documents; combined with since and the integrator consent floor. An unparseable value is ignored.

Príklady volania

cURL
# Najnovsie odoslane dokumenty:
curl https://epostak.sk/api/v1/outbound/documents \
  -H "Authorization: Bearer eyJhbGc..."

# Filter na neuspesne doruceniach (treba zasiahnut):
curl "https://epostak.sk/api/v1/outbound/documents?status=failed" \
  -H "Authorization: Bearer eyJhbGc..."

# Iba fakturacia konkretnemu odberatelovi v stave paid:
curl "https://epostak.sk/api/v1/outbound/documents?kind=invoice&business_status=paid&recipient=0245:2012345678" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Paginated list of outbound documents
{
  "documents": [{
    "id": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
    "kind": "invoice",
    "document_type": "BIS Billing 3.0 Invoice",
    "document_type_id": null,
    "sender": {"peppol_id": "0245:1111111111", "name": "ACME s.r.o.", "country": "SK"},
    "recipient": {"peppol_id": "0245:2222222222", "name": "Customer s.r.o.", "country": "SK"},
    "created_at": "2026-05-10T10:00:00.000Z",
    "transport_status": "delivered",
    "business_status": "sent",
    "attempt_count": 1,
    "last_attempt_at": "2026-05-10T12:00:00.000Z",
    "error": {"message": null},
    "peppol_message_id": "peppol-msg-...",
    "sent_at": "2026-05-10T12:00:00.000Z",
    "delivered_at": "2026-05-10T12:01:00.000Z",
    "ubl_url": "https://epostak.sk/api/v1/outbound/documents/8e4b8f0e-.../ubl",
    "attempt_history": [],
    "metadata": {
      "invoice_number": "FA-2026-001",
      "total_amount": "1234.56",
      "currency": "EUR",
      "issue_date": "2026-05-09",
      "due_date": "2026-05-23"
    }
  }],
  "next_cursor": "eyJ2IjoxLCJyIjoi...",
  "has_more": true
}

Odpovede

  • 200Paginated list of outbound documents
  • 400Invalid query params
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 429Rate limit exceeded
GET/api/v1/outbound/documents/{id}Stabilný, bez nových funkcií

Pull: detail odoslaného dokumentu

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /documents/{id}

Fetch a single outbound document by ID. Probes Invoice and PeppolDocument tables. The detail view includes attempt_history (delivery attempts) which is absent from the list view.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQ

Príklady volania

cURL
curl https://epostak.sk/api/v1/outbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111 \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Outbound document with attempt_history populated
{
  "id": "8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111",
  "kind": "invoice",
  "transport_status": "delivered",
  "business_status": "paid",
  "attempt_count": 1,
  "attempt_history": [{
    "attempt": 1,
    "status": "success",
    "http_status": 200,
    "error_message": null,
    "attempted_at": "2026-05-10T12:00:00.000Z"
  }],
  "sent_at": "2026-05-10T12:00:00.000Z",
  "delivered_at": "2026-05-10T12:01:00.000Z"
}

Odpovede

  • 200Outbound document with attempt_history populated
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 404Document not found or does not belong to this tenant
  • 429Rate limit exceeded
GET/api/v1/outbound/documents/{id}/ublStabilný, bez nových funkcií

Pull: surový UBL XML odoslaného dokumentu

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /documents/{id}/ubl

Returns the raw UBL XML. Probes Invoice.ublXmlPath then PeppolDocument.rawXmlPath, returning whichever is populated first. 404 when neither path is stored.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQ

Príklady volania

cURL
curl https://epostak.sk/api/v1/outbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/ubl \
  -H "Authorization: Bearer eyJhbGc..." \
  -o sent-invoice.xml

Odpovede

  • 200Raw UBL XML
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 404Document not found or does not belong to this tenant
  • 429Rate limit exceeded
GET/api/v1/outbound/documents/{id}/mdnStabilný, bez nových funkcií

Surová AS4 MDN doručenka

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /documents/{id}/evidence

Returns the raw AS4 signal-message receipt (MDN/receipt) for an outbound document when it has been forward-retained in the evidence archive. This endpoint is for audit/dispute scenarios; normal delivery tracking should use transport_status, delivered_at, or webhooks/events. 404 when the document is missing, foreign-tenant, not outbound, or no retained MDN receipt exists yet.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQ

Príklady volania

cURL
curl https://epostak.sk/api/v1/outbound/documents/8e4b8f0e-21d3-4d2a-9c2b-24a3f8a0c111/mdn \
  -H "Authorization: Bearer eyJhbGc..." \
  -o delivery-mdn.as4

Odpovede

  • 200Raw AS4 receipt bytes. Headers include X-MDN-Message-Id, X-MDN-Ref-To-Message-Id, X-MDN-SHA256, and X-MDN-Received-At.
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 404Document not found, not outbound, or no retained MDN receipt exists yet
  • 429Rate limit exceeded
  • 500MDN evidence integrity check failed
GET/api/v1/outbound/eventsStabilný, bez nových funkcií

Pull: stream udalostí (lifecycle)

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /events/pull

Cursor-based stream of outbound document lifecycle events (DocumentEvent table). Sorted oldest-to-newest (ascending) — a saved cursor naturally consumes events forward in time. Coverage: Invoice-backed events only in v1. Non-billing outbound docs (Order, DespatchAdvice, etc.) are tracked by polling /outbound/documents directly. Auth: scope documents:read, plan api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
sincestring (query)optionalVersioned cursor from previous next_cursor
limitinteger (query)optional1–500 (default: 100)
document_iduuid (query)optionalFilter to events for a specific document ID

Príklady volania

cURL
# Vsetky udalosti od posledneho pollu:
curl "https://epostak.sk/api/v1/outbound/events?since=eyJ2IjoxLCJyIjoi..." \
  -H "Authorization: Bearer eyJhbGc..."

# Iba udalosti jednej faktury:
curl "https://epostak.sk/api/v1/outbound/events?document_id=8e4b8f0e-..." \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Paginated event stream
{
  "events": [{
    "id": "dddddddd-dddd-dddd-dddd-dddddddddd01",
    "document_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa01",
    "type": "document.sent",
    "actor": "system",
    "detail": null,
    "meta": {},
    "occurred_at": "2026-05-10T10:00:00.000Z"
  }, {
    "id": "dddddddd-dddd-dddd-dddd-dddddddddd02",
    "document_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa01",
    "type": "document.as4_delivered",
    "actor": "system",
    "detail": null,
    "meta": {"http_status": 200},
    "occurred_at": "2026-05-10T10:01:00.000Z"
  }],
  "next_cursor": "eyJ2IjoxLCJyIjoi...",
  "has_more": false
}

Odpovede

  • 200Paginated event stream
  • 400Invalid cursor
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 429Rate limit exceeded
GET/api/v1/documents/inboxStabilný, bez nových funkcií

Zoznam prijatých fakturačných dokumentov

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /inbound/documents

Vrati strankovany zoznam fakturacnych dokumentov prijatych cez Peppol pre vasu firmu. Pre plny Peppol scope vratane non-billing typov pouzite GET /api/v1/inbound/documents. Oba endpointy funguju pre api-enterprise priamo alebo pre integrator-managed firmu cez spravujuci sk_int_* integratorsky token.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
offsetinteger (query)optionalPocet preskocenych zaznamov (min 0) (default: 0)
limitinteger (query)optionalPocet vratenych zaznamov (1–100) (default: 20)
statusstring (query)optionalFilter podla stavu dokumentu (povolené: RECEIVED, ACKNOWLEDGED, ACCEPTED, REJECTED, PAID, VALIDATION_FAILED, FAILED)
sincedatetime (query)optionalReturn only documents received after this ISO 8601 timestamp
peppolMessageIdstring (query)optionalFilter by Peppol message ID (exact match) (max 100 znakov / chars)
buyerReferencestring (query)optionalFilter by BT-10 Buyer reference (exact match), e.g. a routing code the supplier was asked to quote. Returned in references.buyerReference. (max 100 znakov / chars)
orderReferencestring (query)optionalFilter by BT-13 Purchase order reference (exact match), e.g. a claim or order number. Returned in references.orderReference. (max 100 znakov / chars)
cursorstring (query)optionalOpaque cursor from previous response's nextCursor. Stable pagination — preferred over offset for large result sets.

Príklady volania

cURL 1
curl "https://epostak.sk/api/v1/documents/inbox?limit=10&status=RECEIVED" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Zoznam prijatych dokumentov (response root key je <code>documents</code>, kazdy item je normalizovany InvoiceResponse so supplier/customer/totals nested objektami podla <code>formatInvoice()</code> v <code>lib/api/format.ts</code>.
{ "documents": [{
  "id": "clx9abc123",
  "number": "FAK-2025-001",
  "status": "received",
  "direction": "inbound",
  "docType": "invoice",
  "issueDate": "2025-04-01",
  "currency": "EUR",
  "supplier": {"name":"Dodávateľ s.r.o.","peppolId":"0245:9876543210"},
  "customer": {"name":"Odberateľ a.s.","peppolId":"0245:0000000001"},
  "totals": {"withoutVat":1000.00,"vat":230.00,"withVat":1230.00},
  "createdAt": "2025-04-01T10:00:00.000Z"
}], "total":42,"limit":10,"offset":0,"nextCursor":"eyJpZCI6ImNseDlhYmMxMjMifQ==" }

Odpovede

  • 200Zoznam prijatych dokumentov (response root key je <code>documents</code>, kazdy item je normalizovany InvoiceResponse so supplier/customer/totals nested objektami podla <code>formatInvoice()</code> v <code>lib/api/format.ts</code>.
  • 401Missing or invalid API key
  • 403API plan required or access denied
  • 422Invalid status or since parameter
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/inbox/{id}Stabilný, bez nových funkcií

Detail dokumentu

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /inbound/documents/{id}

Vrati kompletne data prijateho dokumentu vratane UBL XML payloadu (ak je dostupny).

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu

Príklady volania

cURL
curl https://epostak.sk/api/v1/documents/inbox/clx9abc123 \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Detail dokumentu
{
  "document": {
    "id": "clx9abc123",
    "number": "FAK-2025-001",
    "status": "received",
    "direction": "inbound",
    "docType": "invoice",
    "issueDate": "2025-04-01",
    "currency": "EUR",
    "supplier": {"name":"Dodávateľ s.r.o.","peppolId":"0245:9876543210"},
    "customer": {"name":"Odberateľ a.s.","peppolId":"0245:0000000001"},
    "totals": {"withoutVat":1000,"vat":230,"withVat":1230},
    "peppolMessageId": "msg_peppol_xyz",
    "createdAt": "2025-04-01T10:00:00.000Z"
  },
  "payload": "<?xml ... UBL invoice XML ...?>"
}

Odpovede

  • 200Detail dokumentu
  • 401Missing or invalid API key
  • 403Dokument nepatri vasej firme
  • 404Dokument nenajdeny alebo nie je inbound
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/documents/inbox/{id}/acknowledgeStabilný, bez nových funkcií

Potvrdiť spracovanie klientom

Stabilný, bez nových funkcií. Odporúčaná náhrada: POST /inbound/documents/{id}/ack

Idempotentne zaznamena, ze prijimatelov ERP alebo iny klient spracoval inbound dokument. Ide o jeden spolocny lokalny stav firmy, nie o samostatne potvrdenie pre kazdy API kluc alebo konzumny system. Opakovane volanie vrati HTTP 200 s povodnym casom prveho potvrdenia a idempotent=true. Potvrdenie dokument nezmaze, nezablokuje jeho detail ani opatovne stiahnutie a neodosiela Peppol Invoice Response odosielatelovi. Potvrdit sa daju aj uz zodpovedane dokumenty: stavy received, acknowledged, validation_deferred, validation_failed, accepted, rejected, paid, approved, exported, archived, overdue a failed. Lokalne potvrdenie len zaznamena, ze ERP dokument prevzal, a obchodny stav dokumentu nemeni. Ine (odchadzajuce) stavy vratia 422. Cas potvrdenia vidiet ako localAcknowledgedAt v GET /documents/{id}/status. Ide o jeden spoločný stav firmy, nie o samostatné potvrdenie pre každý API kľúč alebo systém. Telo požiadavky nie je potrebné. Neodosiela MLS ani Invoice Response a nemení Peppol/business stav dokumentu.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID dokumentu

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/documents/inbox/clx9abc123/acknowledge \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Spracovanie zaznamenane alebo uz bolo zaznamenane
{ "documentId":"clx9abc123", "status":"ACKNOWLEDGED", "clientAckedAt":"2025-04-01T11:00:00.000Z", "acknowledgedAt":"2025-04-01T11:00:00.000Z", "idempotent":false }

Odpovede

  • 200Spracovanie zaznamenane alebo uz bolo zaznamenane
  • 401Missing or invalid API key
  • 403Dokument nepatri vasej firme alebo API plan je vyzadovany
  • 404Dokument nenajdeny alebo nie je inbound
  • 422Dokument nie je v stave, ktory mozno lokalne potvrdit (potvrdit sa daju stavy received, acknowledged, validation_deferred, validation_failed, accepted, rejected, paid, approved, exported, archived, overdue a failed)
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/documents/inbox/allStabilný, bez nových funkcií

Cross-firm inbox

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /inbound/documents

Returns received documents across all assigned firms. No X-Firm-Id header needed. Requires a JWT minted from an sk_int_* key.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
offsetinteger (query)optionalPagination offset (min 0) (default: 0)
limitinteger (query)optionalMaximum number of documents to return. Values above 100 are accepted and clamped to 100; page further with offset. (1–200) (default: 50)
statusstring (query)optionalFilter by document status (povolené: RECEIVED, ACKNOWLEDGED, ACCEPTED, REJECTED, PAID, VALIDATION_FAILED, FAILED)
sincedatetime (query)optionalReturn only documents received after this ISO 8601 timestamp
firm_iduuid (query)optionalFilter by firm UUID

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/documents/inbox/all" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Príklady odpovedí

200 List of received documents across all firms
{
  "documents": [{
    "firm_id": "b1022d80-5016-4dad-a8d2-53685cab1701",
    "firm_name": "Kaja Solutions s.r.o.",
    "id": "clx9abc123",
    "number": "FAK-2025-001",
    "status": "received",
    "direction": "inbound",
    "doc_type": "invoice",
    "issue_date": "2025-04-01",
    "due_date": "2025-04-15",
    "currency": "EUR",
    "supplier": {"name":"...","ico":"...","peppol_id":"0245:9876543210"},
    "customer": {"name":"...","ico":"...","peppol_id":"0245:0000000001"},
    "totals": {"without_vat":1000.00,"vat":230.00,"with_vat":1230.00},
    "peppol_message_id": "msg_peppol_xyz",
    "created_at": "2025-04-01T10:00:00.000Z"
  }],
  "total": 42,
  "limit": 50,
  "offset": 0
}

Odpovede

  • 200List of received documents across all firms
  • 401Unauthorized
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/peppol-documentsStabilný, bez nových funkcií

List non-billing Peppol documents

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /documents/outbox

List endpoint for non-billing Peppol doctypes (Order, OrderResponse, DespatchAdvice, Catalogue, CatalogueResponse, OrderAgreement, AdvancedOrdering family, PunchOut). Lives in its own peppol_documents table to avoid changing the /documents/inbox//documents/outbox Invoice-shaped contract. Requires documents:read scope and an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
directionstring (query)optional (povolené: inbound, outbound)
doctypeKeystring (query)optionalSpecific non-billing doctype key (see registry)
statusstring (query)optional
sincedatetime (query)optional
peppolMessageIdstring (query)optional
offsetinteger (query)optionalmin 0 (default: 0)
limitinteger (query)optional1–100 (default: 20)

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/peppol-documents" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Non-billing Peppol documents
  • 401Invalid or missing token
  • 403Plan does not allow this endpoint
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.

Webhooky a udalosti

Notifikácie v reálnom čase. Vyžadujú aktívne firemné API oprávnenie; partnerské volanie navyše aktívny súhlas firmy, správny rozsah a X-Firm-Id. Podpis HMAC-SHA256. Udalosti: document.sent, document.received, document.delivered, document.delivery_failed, document.mls_received, document.rejected, document.response_received. document.mls_received pokrýva AP, AB aj RE; Invoice Response je samostatná document.response_received udalosť, okrem odmietnutia (RE), ktoré vždy príde ako document.rejected (MLS RE aj Invoice Response RE; rozlíšite ich v payloade); odoberajte obe. Retry policy (od 2026-05-12, Retry-After rešpektovaný od 2026-05-14) rozlišuje stavové kódy: 408, 425, 429, 502, 503, 504 a sieťové chyby opakujeme najviac desaťkrát s ohraničeným rozstupom 30 s → 30 s → 2 min → 10 min → 30 min → 2 h → 6 h → 12 h → 24 h. Retry-After rešpektujeme najviac do 24 hodín na pokus. Terminálne kódy 400/401/403/404/405/410/413/415/422/500/501 končia bez opakovania. Časový limit požiadavky je 10 sekúnd a odber sa vypne po 20 po sebe idúcich terminálnych zlyhaniach bez úspechu.

Choose push or pull

Webhooky sú push kanál; Events pull je preferovaný pull kanál pre tímy bez verejného receivera.

  • Push delivery vyžaduje HMAC verifikáciu a verejný HTTPS endpoint.
  • Pull ack robte až po lokálnom commite v ERP.
  • Cross-firm webhook-queue/all ostáva dostupný pre integrátorov.

Operate failures

História doručení a dead letters patria do prevádzky webhookov, nie do business payload validácie.

  • Retry-After sa rešpektuje pri retryable odpovediach.
  • Terminálne chyby zastavia delivery bez ďalšieho retry.
Push vs pull — Každá subscription je buď push (POST na vašu URL) alebo pull (event v queue, ktorú periodicky čítate cez GET /api/v1/events/pull). Subscription s url je push-only; subscription bez url (null) je pull-only. Jedna subscription = jeden kanál; ak chcete oba, vytvorte dve subscriptiony. Push deliveries sa nezapisujú do pull queue a naopak — kanály sú navzájom oddelené.
Integrátori — Pre spravovanú firmu vytvorte pull subscription cez POST /api/v1/webhooks so svojím sk_int_* JWT, hlavičkou X-Firm-Id danej firmy a telom { url: null, events: [...] }. Až nové udalosti po tomto nastavení sa objavia v /api/v1/webhook-queue/all. Staršie odoslania sa do queue spätne nedopĺňajú.
Tvar payloadu (v1) — Telo POSTu / položka v pull queue obsahuje obálku { event, event_version: "1", webhook_id, webhook_event_id, timestamp, data }. webhook_event_id je stabilný UUID dedup key a pre pull subscription zároveň eventId pre POST /api/v1/events/{eventId}/ack. data závisí od typu udalosti.
Polia v data — Každá udalosť o doklade nesie tieto spoločné polia: document_id, document_number, direction (inbound alebo outbound), doctype_key, status, previous_status, total_amount (reťazec), currency, issue_date, due_date, sender_peppol_id, receiver_peppol_id a referencie buyer_reference, order_reference, contract_reference, project_reference. Pole, ktoré doklad nemá, je null. Voliteľné polia: businessType (len pri doklade s podtypom debit_note, prepayment_invoice, correction alebo advance_payment; doctype_key je vtedy invoice; názov je zámerne camelCase) a as4_message_id (keď je známe). Navyše podľa udalosti: document.sent: sent_at. document.received: received_at. document.delivered: delivered_at, napr. { "delivered_at": "2026-05-12T10:00:00.000Z" } document.delivery_failed: failure_reason, failure_code, error_code a attempts (každé len keď je známe), napr. { "failure_reason": "Sample failure", "failure_code": "transport_failed", "error_code": "AS4_SEND_FAILED", "attempts": 5 } document.mls_received: mls_code (AB, AP alebo RE), delivery_outcome (confirmed, forwarded_unconfirmed alebo rejected), mls_message_id, original_message_id, response_reason (keď je známy) a mls_received_at, napr. { "mls_code": "AB", "delivery_outcome": "forwarded_unconfirmed", "mls_message_id": "mls-1", "original_message_id": "msg-1", "mls_received_at": "2026-05-12T10:00:00.000Z" } document.rejected: response_code (vždy RE), response_reason (keď je známy), responder (peer_ap, buyer alebo loopback) a rejected_at, napr. { "response_code": "RE", "response_reason": "Wrong amount", "responder": "buyer", "rejected_at": "2026-05-12T10:00:00.000Z" } document.response_received: response_code (AB, IP, UQ, CA, AP alebo PD), response_reason (keď je známy) a responded_at, napr. { "response_code": "AP", "responded_at": "2026-05-12T10:00:00.000Z" }
Hlavičky a overenie podpisu — Každý webhook obsahuje HMAC-SHA256 podpis. X-Webhook-Timestamp je Unix timestamp v sekundách. Podpisovaný vstup tvoria presné raw bajty X-Webhook-Timestamp + "." + rawBody ešte pred parsovaním JSON. Výsledný hexadecimálny digest, v ktorom sú písmená a–f malé, odošleme ako X-Webhook-Signature: sha256= nasledované 64 hex znakmi. Očakávanú a prijatú hodnotu porovnajte konštantným časom a odmietnite požiadavku, ak sa timestamp líši od aktuálneho času o viac ako 5 minút. Ďalšie hlavičky (od 2026-05-12): X-Webhook-Event-Id (UUID, dedup key, identická cez všetky retry — odporúčaný primárny dedup), X-Webhook-Id (per-delivery, identifikuje konkrétny webhook_deliveries riadok), X-Webhook-Event (typ event-u), X-Webhook-Attempt (1-based číslo pokusu, mení sa medzi retry-mi), X-Webhook-Max-Attempts (celkový počet pokusov v retry okne).
GET/api/v1/webhooks

Zoznam webhookov

Vrati vsetky webhook odoberania pre vasu firmu. Vyzaduje API pristup: api-enterprise priamo alebo integrator-managed cez spravujuceho integratora.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Príklady volania

cURL
curl https://epostak.sk/api/v1/webhooks -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Zoznam webhookov
{"data":[{"id":"wh_abc123","url":"https://your-app.com/webhook","events":["document.received"],"isActive":true,"failedAttempts":0,"createdAt":"2025-04-01T10:00:00.000Z"}]}

Odpovede

  • 200Zoznam webhookov
  • 401Missing or invalid API key
  • 403API plan je vyzadovany
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/webhooksCore

Vytvoriť webhook

Zaregistruje novu webhook URL alebo pull-only subscription pre vybrane udalosti. Subscription je forward-only: zaradia sa iba udalosti vytvorene po jej aktivacii; historicke sender-side ani receiver-side udalosti sa spatne nedoplnaju. Push URL musi byt HTTPS a nesmie byt localhost ani privatna siet (SSRF ochrana). Max 10 subscriptions per firma. Vyzaduje API pristup: api-enterprise priamo alebo integrator-managed cez spravujuceho integratora. Predvolenych 7 aktivnych udalosti: document.sent, document.received, document.delivered, document.delivery_failed, document.mls_received, document.rejected, document.response_received. Hodnoty document.created a document.validated sa nadalej prijimaju pre kompatibilitu v1, ale aktualne produkcne flow ich neemituju. Secret pre overenie podpisu je zobrazený iba raz. Push požiadavka nesie Unix timestamp v sekundách v X-Webhook-Timestamp a X-Webhook-Signature v tvare sha256=&lt;64 hex znakov a–f malými písmenami&gt;; HMAC-SHA256 sa počíta nad presnými raw bajtmi timestamp + '.' + rawBody ešte pred parsovaním JSON. Secret má 64 hex znakov bez predpony; ako kľúč HMAC použite tento text tak, ako je (UTF-8), nedekódujte ho z hex. Každý webhook má vlastný secret.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
urlstringoptionalOptional public HTTPS receiver URL. Omit it or send null for a pull-only subscription whose events are read with GET /events/pull. When supplied, HTTP is rejected, as are credentials, query strings, fragments, and private, loopback or metadata addresses (SSRF filter).
eventsstring[]optionalAccepted event filters. If omitted, subscribes to the 7 live event types. document.created and document.validated are accepted for v1 request compatibility but are not emitted by current production flows.

Príklady volania

cURL
# Push subscription
curl -X POST https://epostak.sk/api/v1/webhooks \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"url":"https://your-app.com/webhook","events":["document.received"]}'

# Pull-only subscription
curl -X POST https://epostak.sk/api/v1/webhooks \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"url":null,"events":["document.received","document.sent"]}'

# Integrator-managed firm pull subscription
curl -X POST https://epostak.sk/api/v1/webhooks \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "X-Firm-Id: 03023594-57ff-451f-a743-b9fe139dd58b" \
  -H "Content-Type: application/json" \
  -d '{"url":null,"events":["document.sent","document.received","document.delivered","document.delivery_failed","document.mls_received","document.rejected","document.response_received"]}'

Príklady odpovedí

201 Webhook vytvoreny
{"id":"wh_abc123","url":"https://your-app.com/webhook","events":["document.received"],"secret":"a1b2c3d4e5f6…(64 hex)","isActive":true,"createdAt":"2025-04-01T10:00:00.000Z"}

Odpovede

  • 201Webhook vytvoreny
  • 400Missing or malformed X-Firm-Id header. Returned when the bearer JWT was minted from an integrator key (sk_int_*) and X-Firm-Id is absent or not a UUID (code BAD_REQUEST). Request-body and query validation failures are reported as 422 VALIDATION_ERROR, not 400.
  • 401Missing or invalid API key
  • 403API plan je vyzadovany
  • 422Validation failed (VALIDATION_ERROR): invalid JSON or non-object body, url not a string or null or rejected by the HTTPS/SSRF filter, events not an array of strings or containing unknown event names, or the active-webhook limit per firm reached.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/webhooks/{id}

Detail + doručenia

Vrati detaily webhooku vratane poslednych 20 doruceni. Vyzaduje API pristup: api-enterprise priamo alebo integrator-managed cez spravujuceho integratora.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID webhooku

Príklady volania

cURL
curl https://epostak.sk/api/v1/webhooks/wh_abc123 -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Detail webhooku
{
  "id":"wh_abc123",
  "url":"https://your-app.com/webhook",
  "events":["document.received"],
  "isActive":true,
  "failedAttempts":0,
  "createdAt":"2025-04-01T10:00:00.000Z",
  "deliveries":[{
    "id":"d1f2e3",
    "webhookId":"whk_5f6a7b",
    "event":"document.received",
    "status":"SUCCESS",
    "attempts":1,
    "responseStatus":200,
    "createdAt":"2025-04-01T10:00:00.000Z"
  }]
}

Odpovede

  • 200Detail webhooku
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Webhook nenajdeny
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
PATCH/api/v1/webhooks/{id}

Upraviť webhook

Aktualizuje URL, zoznam udalosti alebo aktivny stav webhooku. Vsetky polia su volitelne. Vyzaduje API pristup: api-enterprise priamo alebo integrator-managed cez spravujuceho integratora.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID webhooku
urlstringoptionalNew HTTPS receiver URL. PATCH cannot clear the URL (null is rejected with 422); set isActive to false or delete the webhook instead.
eventsstring[]optional
isActivebooleanoptional

Príklady volania

cURL
curl -X PATCH https://epostak.sk/api/v1/webhooks/wh_abc123 \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" -d '{"isActive":false}'

Príklady odpovedí

200 Webhook aktualizovany
{"id":"wh_abc123","url":"https://your-app.com/webhook","events":["document.received"],"isActive":false,"failedAttempts":0,"createdAt":"2025-04-01T10:00:00.000Z"}

Odpovede

  • 200Webhook aktualizovany
  • 400Missing or malformed X-Firm-Id header. Returned when the bearer JWT was minted from an integrator key (sk_int_*) and X-Firm-Id is absent or not a UUID (code BAD_REQUEST). Request-body and query validation failures are reported as 422 VALIDATION_ERROR, not 400.
  • 401Missing or invalid API key
  • 403Pristup odmietnuty alebo API plan vyzadovany
  • 404Webhook nenajdeny
  • 422Validation failed (VALIDATION_ERROR): invalid JSON or non-object body, url not a string (null is rejected) or rejected by the HTTPS/SSRF filter, isActive not a boolean, events invalid, or re-activation would exceed the active-webhook limit per firm.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
DELETE/api/v1/webhooks/{id}

Zmazať webhook

Trvalo zmaze webhook. Vyzaduje API pristup: api-enterprise priamo alebo integrator-managed cez spravujuceho integratora.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQID webhooku

Príklady volania

cURL
curl -X DELETE https://epostak.sk/api/v1/webhooks/wh_abc123 -H "Authorization: Bearer eyJhbGc..."

Odpovede

  • 204Webhook zmazany (prazdne telo odpovede)
  • 401Missing or invalid API key
  • 403Pristup odmietnuty alebo API plan vyzadovany
  • 404Webhook nenajdeny
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/webhooks/{id}/test

Poslať testovaciu udalosť

Dispatches one or more synthetic test payloads to the webhook URL with fresh HMAC signatures. Returns HTTP 200 with a result envelope regardless of whether delivery succeeded — inspect success, succeeded, failed, and statusCodes. One aggregate webhook_deliveries row is written so the test run appears in /webhooks/{id}/deliveries. Requires an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQWebhook ID
eventstring (query)optionalEvent type to simulate. Takes precedence over the request body field. Default: document.sent (povolené: document.created, document.sent, document.received, document.delivered, document.delivery_failed, document.mls_received, document.rejected, document.response_received, document.validated)
countinteger (query)optionalNumber of synthetic webhook POSTs. Default 1. Maximum 10 in the default direct mode and 100 with mode=queued; a larger value returns 422. Takes precedence over the request body field. (1–30000) (default: 1)
modestring (query)optionaldirect (default) sends the requests synchronously and returns 200 with the result envelope. queued stores the deliveries, enqueues them on the diagnostic queue and returns 202 with testRunId and deliveryIds. Takes precedence over the request body field. (default: direct) (povolené: direct, queued)

Príklady volania

cURL 1
# Preferred: pass event as query parameter (PR #114)
curl -X POST "https://epostak.sk/api/v1/webhooks/wh_abc123/test?event=document.received" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Test dispatched (check <code>success</code> for delivery outcome)
{"success":true,"statusCode":200,"responseTime":142,"webhookId":"whk_test_5f6a","event":"document.sent","requested":1,"sent":1,"succeeded":1,"failed":0}
202 mode=queued: deliveries stored and enqueued. Follow the run with GET /webhooks/{id}/deliveries?testRunId=...
{"success":true,"mode":"queued","testRunId":"wht_5f6a7b","event":"document.received","requested":20,"queued":20,"deliveryIdsTruncated":false,"deliveriesUrl":"/api/v1/webhooks/wh_abc123/deliveries?testRunId=wht_5f6a7b"}

Odpovede

  • 200Test dispatched (check <code>success</code> for delivery outcome)
  • 202mode=queued: deliveries stored and enqueued. Follow the run with GET /webhooks/{id}/deliveries?testRunId=...
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 404Webhook not found
  • 422Invalid event, count (1-10 direct, 1-100 queued) or mode, a disabled subscription, or a pull-only subscription (url null) that cannot be tested (VALIDATION_ERROR).
  • 429Webhook test quota exceeded; respect Retry-After.
GET/api/v1/webhooks/{id}/deliveries

História doručení

Returns the full delivery log for a webhook (test deliveries included). Supports status + event filters. responseBody is omitted by default because a legitimate webhook receiver may echo sensitive content (PII, tokens) in its 4xx/5xx body. Pass ?includeResponseBody=true (or ?include=responseBody) to opt in. The first 200 chars are stored at delivery time — older deliveries written before this cap shipped may be longer. Requires an API-eligible actor: api-enterprise directly, or integrator-managed through the managing integrator.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQWebhook ID
limitinteger (query)optional1–100 (default: 20)
offsetinteger (query)optionalmin 0 (default: 0)
statusstring (query)optionalFilter by delivery status (UPPERCASE enum) (povolené: PENDING, SUCCESS, FAILED, RETRYING)
eventstring (query)optionalFilter by event name
includeResponseBodyboolean (query)optionalSet to true to include the (truncated, 200-char) responseBody field on each delivery. Default false to avoid leaking content from receivers that echo sensitive data. (default: false)
includestring (query)optionalAlternative spelling: ?include=responseBody is equivalent to ?includeResponseBody=true. (povolené: responseBody)

Príklady volania

cURL 1
curl "https://epostak.sk/api/v1/webhooks/wh_abc123/deliveries?status=FAILED&limit=50" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Delivery list
{
  "deliveries": [{
    "id":"d1f2e3",
    "webhookId":"whk_5f6a7b",
    "event":"document.received",
    "status":"SUCCESS",
    "attempts":1,
    "responseStatus":200,
    "lastAttemptAt":"2025-04-01T10:00:15.000Z",
    "nextRetryAt":null,
    "createdAt":"2025-04-01T10:00:00.000Z"
  }],
  "total":142,
  "limit":20,
  "offset":0,
  "nextCursor": null
}

Odpovede

  • 200Delivery list
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 404Webhook not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/webhook-dead-letterStabilný, bez nových funkcií

Webhook dead-letter queue

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /webhooks/{id}/deliveries

Returns unresolved terminally failed push deliveries across your firm's webhooks. Use it for ERP runbooks: what needs replay or manual resolution.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
limitinteger (query)optional1–100 (default: 20)
offsetinteger (query)optionalmin 0 (default: 0)
eventstring (query)optionalFilter by event name
subscriptionIdstring (query)optionalFilter to one webhook subscription
includeResponseBodyboolean (query)optionalSet to true to include the last ERP endpoint response body. (default: false)

Príklady volania

cURL
curl "https://epostak.sk/api/v1/webhook-dead-letter?includeResponseBody=true&limit=50" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Dead-letter delivery list
{
  "items": [{
    "id": "22222222-2222-2222-2222-222222222222",
    "webhookId": "whk_5f6a7b",
    "webhookEventId": "55555555-5555-5555-5555-555555555555",
    "event": "document.sent",
    "status": "FAILED",
    "attempts": 10,
    "responseStatus": 503,
    "responseBody": "Receiver unavailable",
    "lastAttemptAt": "2026-05-17T10:01:00.000Z",
    "nextRetryAt": null,
    "createdAt": "2026-05-17T10:00:00.000Z"
  }],
  "total": 1,
  "limit": 20,
  "offset": 0
}

Odpovede

  • 200Dead-letter delivery list
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/webhook-dead-letter/{deliveryId}/replay

Replay zlyhaného webhooku

Creates a new PENDING delivery from the original FAILED row and enqueues it. The original row remains in audit history and is marked resolved by replay. webhook_event_id stays stable; webhook_id is a new per-delivery identifier.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
deliveryIduuidREQDelivery ID from GET /webhook-dead-letter

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/webhook-dead-letter/22222222-2222-2222-2222-222222222222/replay \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

202 Replay accepted
{"replayedFrom":"22222222-2222-2222-2222-222222222222","deliveryId":"77777777-7777-7777-7777-777777777777","webhookId":"whk_9a8b7c","webhookEventId":"55555555-5555-5555-5555-555555555555"}

Odpovede

  • 202Replay accepted
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 404Dead-letter delivery not found
  • 422Delivery cannot be replayed
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/webhook-dead-letter/{deliveryId}/resolve

Označiť webhook zlyhanie ako vyriešené

Hides a failed delivery from the dead-letter queue without deleting or overwriting audit history. Use when the state was handled manually in the ERP or replay is no longer needed.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
deliveryIduuidREQDelivery ID from GET /webhook-dead-letter
reasonstringoptionalmax 500 znakov / chars

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/webhook-dead-letter/22222222-2222-2222-2222-222222222222/resolve \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"reason":"Handled in ERP manually"}'

Príklady odpovedí

200 Resolved
{"resolved":true}

Odpovede

  • 200Resolved
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 404Dead-letter delivery not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/webhooks/{id}/rotate-secret

Rotovať podpisový secret

Generates a new 64-char hex secret and immediately discards the old one. In-flight deliveries signed with the old secret will fail signature verification at the receiver. Returns the new secret ONCE.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
idstringREQWebhook ID

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/webhooks/wh_abc123/rotate-secret \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Secret rotated
{"id":"wh_abc123","secret":"9f8e7d6c5b4a…(64 hex)","message":"Secret rotated. Save it — it will not be shown again. The previous secret is now invalid."}

Odpovede

  • 200Secret rotated
  • 401Invalid or missing API key
  • 403Access denied or API plan required
  • 404Webhook not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/events/pullCore

Stiahnuť udalosti

Canonical Events endpoint for polling queued webhook events in the Enterprise reliability contract. The queue is forward-only: only events created while a matching pull subscription is active are queued; older sender-side and receiver-side events are not backfilled. After send, poll unacknowledged events and acknowledge after local commit in the ERP; if processing fails, leave the event unacknowledged and pull it again. The server keeps state through acknowledgements, so clients do not need client-side cursor bookkeeping. The retired /webhook-queue alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
limitinteger (query)optionalMaximum number of events to return, default 20. Values outside 1-100 are clamped; a non-numeric value falls back to 20. (1–100) (default: 20)
event_typestring (query)optionalReturn only events of this type (exact match on the event field, e.g. document.received). Omit for all event types.

Príklady volania

cURL
curl "https://epostak.sk/api/v1/events/pull?limit=10" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Zoznam cakajucich udalosti
{
  "events": [{
    "event_id": "11111111-1111-1111-1111-111111111111",
    "firm_id": "b1022d80-5016-4dad-a8d2-53685cab1701",
    "event": "document.received",
    "created_at": "2026-05-12T10:00:00.000Z",
    "payload": {
      "event": "document.received",
      "event_version": "1",
      "webhook_id": null,
      "webhook_event_id": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2026-05-12T10:00:00.000Z",
      "data": {
        "document_id": "d8f6dfa3-d76a-4278-8464-936741e1c0e1",
        "document_number": "e-FV-dev-2026-1010",
        "direction": "inbound",
        "doctype_key": "invoice",
        "status": "received",
        "previous_status": null,
        "total_amount": "409.59",
        "currency": "EUR",
        "issue_date": "2026-05-10",
        "due_date": "2026-05-24",
        "sender_peppol_id": "0245:1122334455",
        "receiver_peppol_id": "0245:0000000001",
        "received_at": "2026-05-12T10:00:00.000Z"
      }
    }
  }],
  "has_more": false
}

Odpovede

  • 200Zoznam cakajucich udalosti
  • 401Missing or invalid API key
  • 403API plan je vyzadovany
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/events/{eventId}/ack

Potvrdiť event

Canonical Events endpoint for acknowledging one queued event. The retired /webhook-queue/{eventId} DELETE alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
eventIdstringREQID udalosti

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/events/11111111-1111-1111-1111-111111111111/ack \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Udalost potvrdena
{ "acknowledged": true }

Odpovede

  • 200Udalost potvrdena
  • 401Missing or invalid API key
  • 403API plan je vyzadovany
  • 404Udalost nenajdena
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/events/batch-ackCore

Batch potvrdenie eventov

Canonical Events endpoint for batch acknowledgement. Enterprise reliability contract: acknowledge after local commit, not when the event is fetched. Use this after a batch import commit; on retry, leave events unacknowledged and read them again from /events/pull. The retired /webhook-queue/batch-ack alias is no longer served.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
event_idsstring[]REQEvent IDs (UUID, the event_id from GET /events/pull) to acknowledge. Empty array: 200 with acknowledged 0. Non-UUID values or more than 1000 items: 422. (max 1000 položiek / items)

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/events/batch-ack \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"event_ids":["11111111-1111-1111-1111-111111111111","22222222-2222-2222-2222-222222222222"]}'

Príklady odpovedí

200 Events acknowledged (acknowledged counts only events that belong to the firm and were not yet acknowledged; 0 for an empty list)
{ "acknowledged": 2 }

Odpovede

  • 200Events acknowledged (acknowledged counts only events that belong to the firm and were not yet acknowledged; 0 for an empty list)
  • 400Missing or malformed X-Firm-Id header. Returned when the bearer JWT was minted from an integrator key (sk_int_*) and X-Firm-Id is absent or not a UUID (code BAD_REQUEST). Request-body and query validation failures are reported as 422 VALIDATION_ERROR, not 400.
  • 401Missing or invalid API key
  • 403API plan je vyzadovany
  • 413Request body exceeds 64 KB (PAYLOAD_TOO_LARGE).
  • 422Validation failed (VALIDATION_ERROR): invalid JSON, event_ids missing or not an array, more than 1000 items, a non-string element, or a value that is not a UUID. An empty event_ids array is not an error (200, acknowledged 0).
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/webhook-queue/allStabilný, bez nových funkcií

Cross-firm webhook queue

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /events/pull

Poll pending webhook events across all assigned firms. No X-Firm-Id header needed. Requires a JWT minted from an sk_int_* key.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
limitinteger (query)optionalMaximum number of events to return (max 500) (1–500) (default: 100)
sincedatetime (query)optionalReturn only events created after this ISO 8601 timestamp

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/webhook-queue/all" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Príklady odpovedí

200 Pending webhook events across all firms
{
  "items": [{
    "event_id": "11111111-1111-1111-1111-111111111111",
    "firm_id": "b1022d80-5016-4dad-a8d2-53685cab1701",
    "event": "document.received",
    "payload": {
      "event": "document.received",
      "event_version": "1",
      "webhook_id": null,
      "webhook_event_id": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2026-05-12T10:00:00.000Z",
      "data": {
        "document_id": "d8f6dfa3-d76a-4278-8464-936741e1c0e1",
        "document_number": "e-FV-dev-2026-1010",
        "direction": "inbound",
        "doctype_key": "invoice",
        "status": "received",
        "previous_status": null,
        "total_amount": "409.59",
        "currency": "EUR",
        "issue_date": "2026-05-10",
        "due_date": "2026-05-24",
        "sender_peppol_id": "0245:1122334455",
        "receiver_peppol_id": "0245:0000000001",
        "received_at": "2026-05-12T10:00:00.000Z"
      }
    },
    "created_at": "2026-05-12T10:00:00.000Z"
  }],
  "has_more": false,
  "limit": 100,
  "offset": 0,
  "next_cursor": null
}

Odpovede

  • 200Pending webhook events across all firms
  • 401Unauthorized
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/webhook-queue/all/batch-ackStabilný, bez nových funkcií

Hromadné potvrdenie udalostí

Stabilný, bez nových funkcií. Odporúčaná náhrada: POST /events/batch-ack

Acknowledge multiple webhook events across all firms in a single request. Maximum 1000 event IDs.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
event_idsuuid[]REQEvent IDs (UUID, the event_id returned by GET /events/pull) to acknowledge. An empty array is accepted and returns 200 with acknowledged 0. More than 1000 items, a non-string element or a value that is not a UUID is rejected with 422 VALIDATION_ERROR. (max 1000 položiek / items)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/webhook-queue/all/batch-ack" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "event_ids": [
    "uuid-1",
    "uuid-2"
  ]
}'

Príklady odpovedí

200 Number of events acknowledged
{
  "acknowledged": 5
}

Odpovede

  • 200Number of events acknowledged
  • 401Unauthorized
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 422Validation error
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.

Peppol

Vyhľadávanie v Peppol sieti — SMP lookup, adresár, overenie firmy a jej schopností.

Authoritative checks

Pred sendom overte presného účastníka a document type cez SMP/capability flow.

  • SMP lookup je pre presné Peppol ID.
  • Capabilities vracajú networkReady a matchedDocumentTypes.

Discovery vs routing

Directory search pomáha nájsť firmu; send rozhodnutie robte až po capability/preflight.

  • Adresár môže byť neúplný alebo oneskorený.
  • Preflight je finálna kontrola pred ostrým sendom.
GET/api/v1/peppol/participants/{scheme}/{identifier}

SMP capability lookup

Vyhlada Peppol ucastnika v SMP (Service Metadata Publisher) podla scheme a identifikatora.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
schemestringREQICD scheme code, exactly 4 digits (e.g. 0245 for Slovak DIC). Anything else returns 422.
identifierstringREQIdentifier in the given scheme, 1-100 characters from A-Z a-z 0-9 : . _ - . Anything else returns 422.

Príklady volania

cURL
curl https://epostak.sk/api/v1/peppol/participants/0245/2020298610 \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Participant is registered; the lookup result (found true; accepts says whether the default invoice capability is supported)
{
  "found": true,
  "accepts": true,
  "routingStatus": "ready",
  "participantId": "0245:2020298610",
  "scheme": "0245",
  "identifier": "2020298610",
  "accessPoint": {
    "url": "https://ap.provider.com/as4",
    "transportProfile": "peppol-transport-as4-v2_0"
  },
  "certificate": {"present": true, "valid": true},
  "supportedDocumentTypes": ["urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##...", "urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##..."],
  "source": "sml"
}

Odpovede

  • 200Participant is registered; the lookup result (found true; accepts says whether the default invoice capability is supported)
  • 401Missing or invalid API key
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404Participant is not registered in the Peppol network. The live body is the lookup result in the SmpLookupResponse shape (found false, routingStatus participant_not_found), not the ErrorResponse envelope; the schema below keeps the released 1.14.0 contract.
  • 422scheme is not a 4-digit ISO 6523 code or identifier contains invalid characters (VALIDATION_ERROR).
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503The SMP lookup failed temporarily, so registration is unknown (do not treat it as not registered). The body is the lookup result with routingStatus lookup_failed, found false, accepts false and temporaryFailure true. Retry after the number of seconds in the Retry-After header (30).
GET/api/v1/peppol/participants/resolve

Resolve firmy na Peppol účastníka

One-step lookup for ERP integrations: pass exactly one identifier (ico, dic, icDph, peppolId, or scheme + identifier). The endpoint enriches Slovak company data when available and checks the exact Peppol routing capability for documentTypeId + processId. Use this before preflight/send when the ERP knows IČO or DIČ, not the final Peppol ID. An integrator JWT needs documents:read, but no individual firm consent.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
icostring (query)optionalSlovak IČO, 6-8 digits or 12 digits (organisational unit; 12 digits are never padded). Mutually exclusive with other identifiers.
dicstring (query)optionalSlovak DIČ, 10 digits. Mutually exclusive with other identifiers. A DIČ that is not in the FS SR register still resolves: company is null and routing is checked for 0245:{dic}, the same answer as peppolId=0245:{dic}.
icDphstring (query)optionalVAT ID, e.g. SK2020123456. Mutually exclusive with other identifiers.
peppolIdstring (query)optionalDirect Peppol participant ID.
schemestring (query)optionalISO 6523 scheme when using scheme+identifier.
identifierstring (query)optionalParticipant identifier when using scheme+identifier.
documentTypeIdstring (query)optionalPeppol document type URN. Defaults to BIS Billing 3.0 Invoice.
processIdstring (query)optionalPeppol process ID. Defaults to BIS Billing 3.0.

Príklady volania

cURL
curl "https://epostak.sk/api/v1/peppol/participants/resolve?ico=12345678" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Company and Peppol routing capability
{
  "query": {"type":"ico","value":"12345678"},
  "nextAction": "sendable",
  "company": {
    "ico": "12345678",
    "dic": "2020123456",
    "icDph": "SK2020123456",
    "name": "Demo s.r.o.",
    "address": {"street":"Hlavna 1","city":"Bratislava","zip":"81101","country":"SK"},
    "active": true,
    "inPeppol": true,
    "source": "merged"
  },
  "participant": {
    "peppolId": "0245:2020123456",
    "scheme": "0245",
    "identifier": "2020123456",
    "registered": true,
    "source": "sml",
    "accessPoint": {"url":"https://ap.receiver.example/as4","transportProfile":"peppol-transport-as4-v2_0"},
    "certificate": {"present":true,"serviceExpirationDate":"2099-01-01T00:00:00Z"},
    "supportedDocumentTypes": ["urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##...", "urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##..."]
  },
  "capability": {
    "documentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##...",
    "processId": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
    "accepts": true,
    "routingStatus": "ready",
    "networkReady": true
  }
}

Odpovede

  • 200Company and Peppol routing capability
  • 400Not returned by the current implementation: query validation failures are reported as 422 VALIDATION_ERROR. The status stays documented for contract compatibility.
  • 401Invalid or missing API key
  • 403API plan required
  • 404Company not found for <code>ico</code> or <code>icDph</code>, or no participant candidate could be derived
  • 422Validation failed (VALIDATION_ERROR): not exactly one of peppolId, scheme+identifier, ico, dic or icDph, scheme without identifier (or vice versa), or a malformed ico (6-8 or 12 digits), dic (10 digits), icDph or Peppol ID.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/peppol/directory/search

Hľadať v adresári

Prehladava Peppol Business Card directory podla nazvu firmy, krajiny a inych kriterii.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
qstring (query)optionalVyhladavaci vyraz (nazov firmy, ICO)
countrystring (query)optionalFiltrovanie podla kodu krajiny (ISO 3166-1 alpha-2)
pageinteger (query)optionalCislo strany (min 1) (default: 1)
page_sizeinteger (query)optionalPocet vysledkov na stranu (1–100) (default: 20)

Príklady volania

cURL
curl "https://epostak.sk/api/v1/peppol/directory/search?q=Kaja&country=SK" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Vysledky vyhladavania
{
  "items": [{
    "participantId": "0245:2020298610",
    "name": "Kaja Solutions s.r.o.",
    "countryCode": "SK",
    "registrationDate": "2024-01-15"
  }],
  "page": 1,
  "page_size": 20,
  "has_next": false
}

Odpovede

  • 200Vysledky vyhladavania
  • 400Neplatne parametre
  • 401Missing or invalid API key
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/company/lookup/{ico}

Info o firme + Peppol status

Vyhlada verejne informacie o firme podla ICO (slovensky obchodny register).

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
icostringREQICO firmy (8 cislic)

Príklady volania

cURL
curl https://epostak.sk/api/v1/company/lookup/52819886 \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Informacie o firme
{
  "ico": "52819886",
  "name": "Kaja Solutions s.r.o.",
  "address": {"street":"Hlavna 1","city":"Bratislava","zip":"811 01","country":"SK"},
  "dic": "2021234567",
  "icDph": "SK2021234567",
  "peppolRegistered": true,
  "peppolId": "0245:2021234567"
}

Odpovede

  • 200Informacie o firme
  • 401Missing or invalid API key
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 404Firma s danym ICO nenajdena
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/peppol/capabilitiesCore

Zistiť podporované dokumenty

Storecove-style discovery/receives: given a participant + optional candidate document type + process id, answer whether the receiver accepts it. Enterprise reliability contract starts here: before building the payload, read networkReady and matchedDocumentTypes, then continue capability -&gt; preflight -&gt; send -&gt; events -&gt; support. When documentType or processId are omitted, the endpoint defaults to BIS Billing 3.0 Invoice over the BIS Billing process. Response matchedDocumentType is the probed document type when accepted, otherwise null. Send documentTypes[] to check 1-20 document type URNs in one request; the response includes capabilities[] and matchedDocumentTypes[]. Required scope: documents:read or documents:send (a send-only key may check the recipient before sending).

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
participantobjectREQ
participant.schemestringREQ4-digit ISO 6523 ICD scheme (SK = 0245)
participant.identifierstringREQ
documentTypestringoptionalBIS 3.0 document type ID. Defaults to Peppol BIS Billing 3.0 Invoice when omitted.
documentTypesstring[]optionalOptional batch probe. When supplied, each document type is checked with the same participant/processId and the response includes capabilities[] and matchedDocumentTypes[]. (max 20 položiek / items)
processIdstringoptionalOptional BIS 3.0 process ID filter.

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/peppol/capabilities \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"participant":{"scheme":"0245","identifier":"2020298610"},"documentType":"urn:cen.eu:en16931:2017"}'

Príklady odpovedí

200 Lookup result
{
  "found": true,
  "accepts": true,
  "participant": {"scheme":"0245","identifier":"2020298610","id":"0245:2020298610"},
  "accessPoint": {"url":"https://epostak.sk/as4","transportProfile":"peppol-transport-as4-v2_0"},
  "internal": true,
  "supportedDocumentTypes": [
    "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1",
    "urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##..."
  ],
  "matchedDocumentType": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1",
  "matchedDocumentTypes": [
    "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"
  ],
  "capabilities": [
    {
      "documentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##...",
      "processId": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
      "found": true,
      "accepts": true,
      "routingStatus": "ready",
      "networkReady": true
    }
  ],
  "source": "smp"
}

Odpovede

  • 200Lookup result
  • 401Invalid or missing API key
  • 403API plan required
  • 404Participant not registered in Peppol network
  • 422Invalid scheme/identifier format
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503The SMP lookup failed temporarily (routingStatus <code>lookup_failed</code>), so the receiver registration is unknown. This is not a "not registered" answer: retry after the number of seconds in the Retry-After header (30). The body is a CapabilitiesResponse with found false, accepts false, temporaryFailure true, retryable true and retry_after_seconds 30.
POST/api/v1/peppol/participants/batch

Hromadné overenie max 100

Pre-check a list of recipients before fan-out send. Max 100 per batch. Individual results are cached so repeat queries are cheap.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
participantsobject[]REQmax 50 položiek / items
participants[].schemestringREQ
participants[].identifierstringREQ

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/peppol/participants/batch \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"participants":[
    {"scheme":"0245","identifier":"2020298610"},
    {"scheme":"0245","identifier":"0000000001"}
  ]}'

Príklady odpovedí

200 Batch results
{
  "total": 2,
  "found": 2,
  "notFound": 0,
  "lookupFailed": 0,
  "results": [
    {"index":0,"participant":{"scheme":"0245","identifier":"2020298610","id":"0245:2020298610"},"found":true,"accepts":true,"routingStatus":"ready","accessPoint":{"url":"https://epostak.sk/as4","transportProfile":"peppol-transport-as4-v2_0"},"internal":false,"supportedDocumentTypes":["..."],"source":"sml","temporaryFailure":false,"lookupFailed":false},
    {"index":1,"participant":{"scheme":"0245","identifier":"0000000001","id":"0245:0000000001"},"found":true,"accepts":false,"routingStatus":"document_type_not_supported","accessPoint":null,"internal":false,"supportedDocumentTypes":[],"source":"sml","temporaryFailure":false,"lookupFailed":false}
  ]
}

Odpovede

  • 200Batch results
  • 401Invalid or missing API key
  • 403API plan required
  • 422participants[] missing/empty or &gt; 100
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/validate

Peppol BIS 3.0 validácia (verejné)

Public endpoint — NOT under /api/v1/. Full path: https://epostak.sk/api/validate. Validator-as-a-service. Anyone can POST UBL XML (or { xml: "..." } JSON) and get back the full 3-layer report our own send pipeline runs: UBL 2.1 XSD, EN 16931, Peppol BIS 3.0 schematrons. Rate-limited per-IP to 20/min. Body cap: 2 MB. Designed as a dry-run hook for integrators pre-signup. Server: https://epostak.sk (override the /api/v1 server shown elsewhere). Verejný nástroj — môžu ho volať aj neregistrovaní integrátori pred sign-upom. Bez autentifikácie. Rate-limit 20 požiadaviek za minútu na IP adresu. Maximum 2 MB. Vráti trojvrstvový Peppol BIS 3.0 validation report: (1) UBL 2.1 XSD, (2) EN 16931 sémantické pravidlá, (3) Peppol schematron.

Hlavičky

NázovTypPovinnéPopis
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
bodyapplication/xmlREQ
xmlstringREQ

Príklady volania

cURL
curl -X POST https://epostak.sk/api/validate \
  -H "Content-Type: application/xml" \
  --data-binary "@invoice.xml"

Príklady odpovedí

200 Validation report (3-layer)
{
  "valid": false,
  "profile": "peppol-bis-billing-3.0",
  "layers": {
    "xsd": {"valid":true,"errors":[]},
    "en16931": {"valid":true,"errors":[]},
    "peppol": {"valid":false,"errors":[{"rule":"PEPPOL-EN16931-R053","location":"/Invoice/...","message":"Only one tax total..."}]}
  },
  "errorCount": 1,
  "warningCount": 0
}

Odpovede

  • 200Validation report (3-layer)
  • 400Malformed request body
  • 413Payload too large (&gt; 2 MB)
  • 422body.xml is required or empty body
  • 429Rate limit exceeded (20/min/IP)
  • 503ion-docval unreachable
GET/api/v1/company/search

Search companies by name

Searches active subjects in the Financial Administration (FS SR) tax register whose name starts with q (case-insensitive, minimum 2 characters). Names where q is a whole word come first (bali → BALI s. r. o., exe → exe, a.s.), then shorter names, then the rest alphabetically. Page with offset; a page shorter than limit is the last one. Auth: scope documents:read, API-eligible actor.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
qstring (query)REQSearch query (company name, minimum 2 chars)
limitinteger (query)optionalMaximum number of results, 1 to 25 (default 10). The server clamps the value to that range: anything above 25 returns at most 25 results, anything below 1 is treated as 1. (min 1) (default: 10)
offsetinteger (query)optionalNumber of results to skip, for paging (default 0). The server clamps the value to 0 to 1000; for results beyond that, type more of the name. (0–1000) (default: 0)

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/company/search?q=<q>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Company search results
  • 401Invalid or missing API key / JWT
  • 403Insufficient plan or scope (requires api-enterprise directly or integrator-managed through the managing integrator, scope documents:read)
  • 429Rate limit exceeded

Firmy

Správa firiem priradených k vášmu integrátorskému účtu. Existujúci Enterprise kontrakt používa sk_int_* JWT, aktívny súhlas a X-Firm-Id na firm-scoped volaniach; Connector je additívny customerRef flow.

Managed firms

Toto je partner/admin vrstva pre integrátorov, ktorí spravujú viac klientov.

  • Ak si klient zvolil ePošťák, firma sa priraďuje po súhlase vlastníka. Ak si zvolil schváleného White Label poskytovateľa, participant sa zapisuje cez /white-label/participants/registrations s verification_token z provider webhooku FS SR a bez účtu ePošťák.
  • X-Firm-Id určuje cieľovú firmu pri sk_int_* Enterprise firm-scoped volaniach; Connector používa customerRef.

Access boundaries

Admin endpointy nikdy nemajú byť skratka na claimnutie cudzej firmy bez jej vedomia.

  • Audit a licenses držia prevádzkovú stopu partnera.
  • Plaintext secret sa nikdy nevracia opakovane.
GET/api/v1/firms

Zoznam prístupných firiem

Vrati zoznam firiem, ku ktorym ma API kluc pristup. Relevantne pre multi-tenant API kluce.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl https://epostak.sk/api/v1/firms \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Zoznam firiem
{"firms":[{"id":"firm_abc123","name":"Klient s.r.o.","ico":"12345678","peppolId":"0245:0000000001","peppolStatus":"active"}]}

Odpovede

  • 200Zoznam firiem
  • 401Missing or invalid API key
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/white-label/participants

Zoznam spravovaných participantov

Potrebný scope: participants:read

Lists only participants currently bound to the authenticated White Label integrator. Requires an active White Label production entitlement and an integrator JWT with participants:read. Do not send X-Firm-Id. ePošťák sends no platform email to White Label end customers; the integrator owns all customer email communication and delivery.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
limitinteger (query)optional1–100 (default: 50)
cursorstring (query)optional

Príklady volania

cURL
curl "https://epostak.sk/api/v1/white-label/participants?limit=50" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Visible managed participants
{"participants":[{"id":"56c3f40a-2bd8-44b8-9bbc-3e044cdf4a40","customerRef":"klient-001","firmId":"b1022d80-5016-4dad-a8d2-53685cab1701","operationId":"286f34ec-553b-48ec-bfef-71e6e1222041","legalName":"Klient s.r.o.","ico":"12345678","dic":"2020123456","icDph":"SK2020123456","vatRegType":"§7a","isVatPayer":false,"peppolId":"0245:2020123456","status":"registered","authorizationSource":"fs_verification_token","endpointProfile":"managed_by_epostak","managedSince":"2026-08-17T10:00:00.000Z"}],"nextCursor":null}

Odpovede

  • 200Visible managed participants
  • 400Invalid cursor or limit
  • 401Missing or invalid integrator JWT
  • 403White Label entitlement or scope is not active
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/white-label/participants/registrations

Registrovať participanta z webhooku FS SR

Potrebný scope: participants:write

Creates an accountless White Label participant from the verification_token delivered to the intermediary's signed FS SR provider webhook. ePošťák passes the token to SMP as dic_verification_code and stores only a domain-separated keyed HMAC digest. A local firm and tenant binding are committed only after SMP confirms success. An SMP 409 never proves ownership and never reuses the existing participant. Do not send X-Firm-Id.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringREQUnique retry key for this command. Reuse the same key and identical body until a terminal result; never retry an unknown SMP result with a new key. (max 255 znakov / chars)

Parametre

NázovTypPovinnéPopis
customerRefstringREQmax 128 znakov / chars
dicstringREQpattern ^[0-9]{10}$
companyEmailstringREQIdentity-only contact email from the provider flow, stored for provisioning and audit. ePošťák never uses it for White Label end-customer email delivery; the integrator owns all customer email communication and delivery. (max 320 znakov / chars)
verificationTokenstringREQToken received by the intermediary from the signed FS SR provider webhook. Never log it. (max 8192 znakov / chars)
publishInPeppolDirectorybooleanoptionalPublish the participant's SMP business card in the Peppol Directory (directory.peppol.eu). Defaults to true; send false only when the customer does not want to be listed. Inbound migrations keep the Directory state the participant already has on the SMP. (default: true)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/white-label/participants/registrations" \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Idempotency-Key: fs-aktivacia-2020123456-1" \
  -H "Content-Type: application/json" \
  -d '{"customerRef":"klient-001","dic":"2020123456","companyEmail":"fakturacia@klient.sk","verificationToken":"TOKEN_Z_FS_SR"}'

Príklady odpovedí

201 SMP registration and local binding succeeded
{"id":"286f34ec-553b-48ec-bfef-71e6e1222041","operationType":"registration","status":"succeeded","customerRef":"klient-001","dic":"2020123456","peppolId":"0245:2020123456","legalName":"Klient s.r.o.","companyEmail":"fakturacia@klient.sk","firmId":"b1022d80-5016-4dad-a8d2-53685cab1701","participantId":"56c3f40a-2bd8-44b8-9bbc-3e044cdf4a40","reviewRequired":false,"error":null,"createdAt":"2026-08-17T10:00:00.000Z","completedAt":"2026-08-17T10:00:01.000Z"}

Odpovede

  • 200Idempotent replay of a completed operation
  • 201SMP registration and local binding succeeded
  • 202Resolve the relative Location operation path against the public request URL, poll it, and do not retry with a new key
  • 400Invalid request or missing Idempotency-Key
  • 401Missing or invalid integrator JWT
  • 403White Label entitlement or scope is not active
  • 409Participant, authorization, idempotency, or tenant conflict
  • 422Company verification or SMP authorization was rejected
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/white-label/participants/migrations

Prevziať participanta migračným kódom

Potrebný scope: participants:migrate

Uses an SMP migration code to take over an existing participant. The code is sent only to SMP and stored only as a digest. A local tenant binding is created only after SMP confirms the migration. Do not send X-Firm-Id. DEV supports migration from a separate test SMP provider using its real test migration code and an unused local synthetic identity. Existing local identities and internal same-SMP integrator handoff remain rejected. Both inbound and outbound migration verify the owning test SMP account before network access.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringREQUnique retry key for this command. Reuse the same key and identical body until a terminal result; never retry an unknown SMP result with a new key. (max 255 znakov / chars)

Parametre

NázovTypPovinnéPopis
customerRefstringREQmax 128 znakov / chars
dicstringREQpattern ^[0-9]{10}$
companyEmailstringREQIdentity-only contact email from the migration flow, stored for provisioning and audit. ePošťák never uses it for White Label end-customer email delivery; the integrator owns all customer email communication and delivery. (max 320 znakov / chars)
migrationCodestringREQSMP migration code from the current provider. Never log it. (max 4096 znakov / chars)
verificationTokenstringoptionalFS verification token (content of the VerifikacnyUdaj file from the FS portal) for the 0245:DIČ participant. The SMP refuses a transfer from another provider without it. When omitted, ePošťák uses the token FS sent when the firm chose ePošťák on the FS portal; if there is none either, a transfer from another provider is refused with 422 VERIFICATION_TOKEN_REQUIRED before anything reaches the SMP, so the same migration code can be sent again with the token. Whitespace is ignored. Never log it. (max 9000 znakov / chars)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/white-label/participants/migrations" \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Idempotency-Key: migracia-2020123456-1" \
  -H "Content-Type: application/json" \
  -d '{"customerRef":"klient-001","dic":"2020123456","companyEmail":"fakturacia@klient.sk","migrationCode":"MIGRACNY_KOD"}'

Odpovede

  • 200Idempotent replay
  • 201Migration and local binding succeeded
  • 202Result requires polling or manual review
  • 400Invalid request
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 409Participant, tenant, idempotency, or migration state conflict
  • 422Migration code or company verification was rejected
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/white-label/participants/{participantId}/migration-code

Vyžiadať kód pre odchod participanta

Potrebný scope: participants:migrate

Requests a migration code only for a participant currently managed by the authenticated White Label tenant. The returned code is never stored in readable form. Requesting a code does not itself release ownership; release completes only after SMP confirms transfer. If the request key was lost while this tenant still has the migration active, a new request with any Idempotency-Key returns the same live code (200, Idempotent-Replay: true) instead of 409 PROVIDER_MIGRATION_ALREADY_ACTIVE.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringREQUnique retry key for this command. Reuse the same key and identical body until a terminal result; never retry an unknown SMP result with a new key. (max 255 znakov / chars)

Parametre

NázovTypPovinnéPopis
participantIduuidREQ

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/white-label/participants/56c3f40a-2bd8-44b8-9bbc-3e044cdf4a40/migration-code" \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Idempotency-Key: odchod-56c3f40a-1"

Príklady odpovedí

201 Migration code requested
{"operation":{"id":"31f9cf79-cc49-4db7-a356-595d63666bf8","operationType":"migration_out","status":"succeeded"},"migrationCode":"MIGRACNY_KOD"}

Odpovede

  • 200Idempotent replay while the code remains available from SMP
  • 201Migration code requested
  • 202SMP result requires manual review
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 404Participant is absent or belongs to another tenant
  • 409Migration code is unavailable or the idempotency key conflicts
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
DELETE/api/v1/white-label/participants/{participantId}/migration-code

Zrušiť odchod participanta

Potrebný scope: participants:migrate

Cancels the outgoing provider migration this White Label tenant started with POST .../migration-code. The SMP migration code stops working and the participant stays with the partner. Only a migration started by this tenant can be cancelled.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
participantIduuidREQ

Príklady volania

cURL
curl -X DELETE "https://epostak.sk/api/v1/white-label/participants/56c3f40a-2bd8-44b8-9bbc-3e044cdf4a40/migration-code" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Migration cancelled
{"participantId":"56c3f40a-2bd8-44b8-9bbc-3e044cdf4a40","firmId":"0d6a1f7e-4b8c-4f0e-9a51-2a7c3e9b1d22","peppolId":"0245:2020123456","migration":{"status":"cancelled","cancelledAt":"2026-11-05T10:00:00.000Z"}}

Odpovede

  • 200Migration cancelled
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 404Participant is absent, belongs to another tenant, or PROVIDER_MIGRATION_NOT_ACTIVE: no active migration started by this tenant
  • 409PARTICIPANT_TRANSITION_CONFLICT: another change of this participant is in progress
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503MIGRATION_CANCEL_UNAVAILABLE: the SMP did not confirm the cancellation; the migration code may still be valid. Retry shortly.
DELETE/api/v1/white-label/participants/{participantId}

Ukončiť participanta bez prechodu

Potrebný scope: participants:write

Ends a participant managed by the authenticated White Label tenant when the firm leaves Peppol (for example it ceased trading) and is not moving to another provider. The participant is removed from the SMP, the partner relationship ends and the participant.released webhook is sent. 200 = removed at once; 202 = the SMP removal is retried by a scheduled job, poll GET /white-label/participants/{participantId} or wait for the webhook. Repeating the call while the removal is in progress returns the same request. A participant with an active outgoing migration must have it cancelled first (DELETE .../migration-code). To move the firm to another provider use POST .../migration-code instead.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
participantIduuidREQ

Príklady volania

cURL
curl -X DELETE "https://epostak.sk/api/v1/white-label/participants/56c3f40a-2bd8-44b8-9bbc-3e044cdf4a40" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Participant removed from the SMP and released
{"participantId":"56c3f40a-2bd8-44b8-9bbc-3e044cdf4a40","firmId":"0d6a1f7e-4b8c-4f0e-9a51-2a7c3e9b1d22","peppolId":"0245:2020123456","status":"released","requestedAt":"2026-11-05T10:00:00.000Z"}

Odpovede

  • 200Participant removed from the SMP and released
  • 202Removal accepted; the SMP removal is retried by a scheduled job
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 404Participant is absent or belongs to another tenant
  • 409PROVIDER_MIGRATION_ALREADY_ACTIVE: an outgoing migration is active, cancel it first; PARTICIPANT_TRANSITION_CONFLICT: another change of this participant is in progress
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/firms/{id}

Detail firmy

Vrati detailne informacie o konkretnej firme vratane typu registracie DPH, odvodeneho priznaku platitela a Peppol statusu. Samotne IC DPH neznamena platitela podla paragrafu 4; registracie podla paragrafu 7 a 7a vracaju isVatPayer=false. Integratorsky JWT vyzaduje aktivny suhlas danej firmy pre Enterprise API a scope firms:manage; hlavicka X-Firm-Id nie je potrebna.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
idstringREQID firmy

Príklady volania

cURL
curl https://epostak.sk/api/v1/firms/firm_abc123 \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Detail firmy
{
  "id": "firm_abc123",
  "name": "Klient s.r.o.",
  "ico": "12345678",
  "dic": "2021234567",
  "icDph": "SK2021234567",
  "vatRegType": "§7a",
  "isVatPayer": false,
  "address": {"street":"Hlavna 1","city":"Bratislava","zip":"811 01"},
  "peppolId": "0245:0000000001",
  "peppolStatus": "active",
  "plan": "api-enterprise",
  "createdAt": "2025-01-01T00:00:00.000Z"
}

Odpovede

  • 200Detail firmy
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Firma nenajdena
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/firms/{id}/peppol-identifiers

Registrovat Peppol ID

Priama zakaznicka cesta na registraciu noveho Peppol identifikatora (scheme:identifier) pre vlastnu firmu v SMP. Nie je dostupna pre sk_int integratorske kluce ani White Label onboarding. White Label integrator musi pouzit POST /white-label/participants/registrations s verification_token z vlastneho podpisaneho webhooku FS SR alebo s SMP migration code. Priamy firemný endpoint: zaregistruje Peppol ID iba pre firmu, ktorej patrí použitý firemný API kľúč. Integrátorské sk_int_* kľúče vrátane White Label sú zakázané. White Label integrátor musí použiť POST /api/v1/white-label/participants/registrations s verification_token z vlastného provider webhooku alebo POST /api/v1/white-label/participants/migrations s migračným kódom; následne vytvorí zákazníka cez POST /api/v1/customers. Pri priamej registrácii prebehne zápis v SMP do 24 hodín. Pre scheme 0245 (slovenské DIČ) musí byť identifier zhodný s firm.dic; nesúlad vráti 422 VALIDATION_ERROR. Pre iné schémy prebehne iba formátová validácia.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
idstringREQID firmy
schemestringREQICD scheme kod. Slovenske firmy pouzivaju 0245; ostatne podporovane ICD kody su napr. 0088, 0192, 0208 (zoznam vo validacii trasy).
identifierstringREQIdentifikator v danej scheme: najviac 50 znakov z mnoziny pismena, cislice a : . - _. Pre scheme 0245 musi presne zodpovedat DIC firmy (10 cislic) evidovanemu v ePostaku.

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/firms/firm_abc123/peppol-identifiers \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"scheme":"0245","identifier":"2020298610"}'

Príklady odpovedí

201 Peppol identifikator zaregistrovany
{
  "peppolId": "0245:2020298610",
  "registrationStatus": "pending",
  "message": "Peppol ID registration requested. We will register you in SMP within 24 hours."
}
409 Peppol identifikator uz je registrovany inou firmou. Chybovy kod je PEPPOL_ID_IN_USE v standardnej obalke ErrorResponse.
{
  "error": {
    "code": "PEPPOL_ID_IN_USE",
    "message": "Peppol identifier 0245:2020298610 is already registered by another firm.",
    "requestId": "7f3c1d52-9a0e-4f4b-8c55-3b1f6e2a9d10"
  }
}

Odpovede

  • 201Peppol identifikator zaregistrovany
  • 400Neplatny scheme alebo identifikator
  • 401Missing or invalid API key
  • 403Pristup odmietnuty (iny firm_id, integratorsky kluc alebo chybajuci plan)
  • 404Firma neexistuje (NOT_FOUND)
  • 409Peppol identifikator uz je registrovany inou firmou. Chybovy kod je PEPPOL_ID_IN_USE v standardnej obalke ErrorResponse.
  • 413Telo poziadavky je vacsie ako 8 KiB
  • 422VALIDATION_ERROR: neplatne JSON telo, chybajuci scheme/identifier, nepodporovany scheme, identifikator nezodpoveda DIC firmy (scheme 0245), neplatny format identifikatora alebo Peppol ID je uz registrovane/aktivne pre tuto firmu.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/customers

Vytvoriť zákazníka (White Label)

Potrebný scope: firms:manage

Creates or idempotently returns a represented Enterprise API customer from an independently collected, auditable customer mandate. This endpoint never performs ePostak PFS customer registration, never registers a Peppol participant, and does not consume the FS SR verification_token. For a new live Slovak White Label customer, the integrator first receives verification_token on its own signed FS SR provider webhook, calls POST /white-label/participants/registrations, waits for successful SMP registration, and then calls or retries this endpoint. customerAuthorization alone cannot activate a live Slovak White Label firm. Requires a JWT minted from an active sk_int_* key with firms:manage, an active White Label entitlement, and Enterprise API production authorization. Do not send X-Firm-Id; use the returned firmId as X-Firm-Id on subsequent firm-scoped Enterprise API calls. In DEV, explicit Enterprise White Label sandbox activation and a succeeded registration or inbound migration with the same customerRef and identity are required. The operation reuses that authorized synthetic firm; it never performs registry lookup or creates another firm.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringoptionalRecommended retry key. Reusing the same customerRef with identical data is also idempotent. (max 255 znakov / chars)

Parametre

NázovTypPovinnéPopis
customerRefstringREQStable customer identifier from the integrator system. (max 128 znakov / chars)
relationshipstringREQ (povolené: represented)
countrystringREQpattern ^[A-Z]{2}$
companyIdstringoptionalCompany registration identifier; IČO for Slovak companies. (max 64 znakov / chars)
taxIdstringoptionalTax identifier; DIČ for Slovak companies. (max 64 znakov / chars)
vatIdstringoptionalVAT identifier; IČ DPH for Slovak companies. (max 64 znakov / chars)
contactEmailstringREQmax 320 znakov / chars
returnUrlstringoptionalOptional HTTPS URL without embedded credentials. (max 2048 znakov / chars)
customerAuthorizationobjectREQ
customerAuthorization.confirmedbooleanREQConfirms that the integrator holds a separate customer mandate. For a live Slovak White Label customer this is not participant ownership evidence and cannot replace verification_token or an SMP migration code. (povolené: true)
customerAuthorization.evidenceReferencestringREQIntegrator-side reference to the auditable mandate evidence. (max 255 znakov / chars)

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/customers \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Idempotency-Key: customer-erp-klient-42" \
  -H "Content-Type: application/json" \
  -d '{
    "customerRef": "erp-klient-42",
    "relationship": "represented",
    "country": "SK",
    "taxId": "2120000000",
    "companyId": "12345678",
    "contactEmail": "firma@example.sk",
    "customerAuthorization": {
      "confirmed": true,
      "evidenceReference": "mandate-2026-0042"
    }
  }'

Príklady odpovedí

201 Customer created and verified
{
  "id": "mc_01J...",
  "firmId": "firm_abc123",
  "customerRef": "erp-klient-42",
  "relationship": "represented",
  "country": "SK",
  "taxId": "2120000000",
  "companyId": "12345678",
  "status": "active",
  "policy": {
    "sendMode": "automatic",
    "ublHandling": "strict",
    "ocrAutoSend": false,
    "attachSourceFile": "when_ocr",
    "locale": "sk",
    "version": 1
  },
  "version": 1,
  "createdAt": "2026-10-08T10:00:00.000Z",
  "updatedAt": "2026-10-08T10:00:00.000Z"
}

Odpovede

  • 200Idempotent replay of an existing customer
  • 201Customer created and verified
  • 400Invalid JSON or customer authorization
  • 401Missing or invalid integrator JWT
  • 403White Label, Enterprise API, or required scope is not active
  • 409Conflicting customer reference, idempotency key, or account state
  • 413Request exceeds 32 KiB
  • 415Content-Type is not application/json
  • 422Registry validation or customer identity failed
  • 429Rate limit exceeded
  • 503Company registry is temporarily unavailable
GET/api/v1/customers

Zoznam zákazníkov (White Label)

Potrebný scope: firms:manage

Lists customer companies managed by the authenticated White Label integrator. Requires a JWT minted from an active sk_int_* key with firms:manage, an active White Label entitlement, and Enterprise API production authorization. This is a cross-firm operation: do not send X-Firm-Id. DEV requires explicit Enterprise White Label sandbox activation and lists only customers of that sandbox account.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
statusstring (query)optional (povolené: action_required, activating, active, suspended, blocked)
limitinteger (query)optional1–200 (default: 100)
cursorstring (query)optional

Príklady volania

cURL
curl "https://epostak.sk/api/v1/customers?status=active&limit=50" \
  -H "Authorization: Bearer eyJhbGc..."

Odpovede

  • 200Visible White Label customers
  • 400Invalid query
  • 401Missing or invalid integrator JWT
  • 403White Label, Enterprise API, or required scope is not active
  • 409Managed customer account is not ready
  • 429Rate limit exceeded
POST/api/v1/firms/assign

Priradiť firmu podľa DIČ alebo IČO

Assign a firm link in the pending state to the Enterprise API account by its DIC or ICO. DIC is preferred because Slovak PFS/SMP and Peppol use 0245:DIC. An active link is already assigned only when it authorizes Enterprise API through a valid relationship and includes firms:manage. An interface or relationship mismatch returns API_INTERFACE_NOT_AUTHORIZED. FIRM_ACTIVATION_PENDING means a dedicated entitlement or payer-change workflow is still finalizing the link. This endpoint never rewrites the integration path or bypasses a controlled lifecycle state. Requires a JWT minted from an sk_int_* key. No X-Firm-Id header needed. Aktivuje iba existujúcu väzbu firmy v stave pending podľa DIČ alebo IČO v štandardnom, ne-White Label Enterprise režime. DIČ je primárny identifikátor pre PFS/SMP a Peppol ID 0245:DIČ; IČO zostáva podporované kvôli lookupu a spätnej kompatibilite. Vyžaduje JWT získané z sk_int_* kľúča. Odpoveď 409 „firma je už priradená“ sa vráti iba pre aktívnu väzbu, ktorá oprávňuje Enterprise API cez platný vzťah a obsahuje firms:manage. Nezhoda rozhrania alebo vzťahu vráti 403 API_INTERFACE_NOT_AUTHORIZED. Stav FIRM_ACTIVATION_PENDING znamená, že oprávnenie alebo zmenu platcu dokončuje osobitný proces. Endpoint existujúcu väzbu, jej integračnú cestu ani riadený aktivačný stav automaticky nemení. DÔLEŽITÉ: Aktívny White Label účet dostane WHITE_LABEL_PARTICIPANT_WORKFLOW_REQUIRED. Nepoužíva owner-consent ani assign; prijme verification_token na vlastnom provider webhooku, zavolá /api/v1/white-label/participants/registrations alebo /migrations a potom /api/v1/customers. Iba štandardný integrátor pre novú alebo odvolanú produkčnú firmu vytvorí jednorazový odkaz cez POST /api/v1/firms/consent-link. Stav overíte cez GET /api/v1/firms/consent-status; plán firmy sám osebe nie je súhlas konkrétnemu integrátorovi.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
dicstringoptional10-digit Slovak tax identifier (DIČ), preferred for PFS/SMP and Peppol 0245:DIČ (max 10 znakov / chars, pattern ^\d{10}$)
icostringoptional8-digit (12-digit for an organisational unit) company registration number (IČO), fallback for lookup/backward compatibility (max 12 znakov / chars, pattern ^(\d{8}|\d{12})$)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/firms/assign" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "dic": "0000000001"
}'

Príklady odpovedí

201 Firm assigned successfully (plan automatically promoted to <code>integrator-managed</code>)
{
  "firm": {
    "id": "b1022d80-5016-4dad-a8d2-53685cab1701",
    "name": "Kaja Solutions s.r.o.",
    "ico": "52345678",
    "dic": "2122701339",
    "peppol_id": "0245:2122701339",
    "peppol_status": "active"
  },
  "status": "active"
}
403 Missing <code>firms:manage</code> scope, absent/currently insufficient firm consent, or API_INTERFACE_NOT_AUTHORIZED because the stored firm link does not authorize Enterprise API through the current relationship
{
  "error": {
    "code": "CONSENT_REQUIRED",
    "message": "First-time firm claim requires an accepted owner/admin integrator consent request.",
    "docs": "/api/docs/enterprise#ep-firms-consent-status"
  }
}

Odpovede

  • 201Firm assigned successfully (plan automatically promoted to <code>integrator-managed</code>)
  • 400Invalid JSON body
  • 401Invalid or missing integrator token
  • 403Missing <code>firms:manage</code> scope, absent/currently insufficient firm consent, or API_INTERFACE_NOT_AUTHORIZED because the stored firm link does not authorize Enterprise API through the current relationship
  • 404Firm not found
  • 409Already assigned with a valid active link, current agreement missing, or FIRM_ACTIVATION_PENDING while a controlled entitlement/payer workflow finalizes the link
  • 422UNPROCESSABLE_ENTITY — provide a 10-digit DIC or 8-digit ICO
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/firms/assign/batch

Hromadné priradenie firiem

Assign multiple pending firm links at once. Prefer dics; icos remains supported for backward compatibility. An item is already_assigned only when its active link authorizes Enterprise API through a valid relationship and includes firms:manage. Interface or relationship mismatches are returned per item as API_INTERFACE_NOT_AUTHORIZED with the reason and required interface. FIRM_ACTIVATION_PENDING means a controlled entitlement or payer-change workflow must finish that item. Links and lifecycle states are never rewritten automatically. Maximum 50 identifiers per request. Hromadne aktivuje až 50 už oprávnených firiem s väzbou v stave pending podľa DIČ alebo IČO pre štandardný, ne-White Label Enterprise režim. Preferujte dics; icos držíme kvôli spätnej kompatibilite. Výsledok already_assigned sa vráti iba pre aktívnu väzbu oprávňujúcu Enterprise API cez platný vzťah a s firms:manage. Nezhoda sa vráti pri konkrétnej položke ako API_INTERFACE_NOT_AUTHORIZED. Aktívny White Label účet dostane pri každej položke WHITE_LABEL_PARTICIPANT_WORKFLOW_REQUIRED a musí použiť provider webhook, /api/v1/white-label/participants/registrations alebo /migrations a potom /api/v1/customers. Pre novú alebo odvolanú firmu v štandardnom režime vytvorte nový odkaz cez POST /api/v1/firms/consent-link.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
dicsstring[]optionalPreferred list of DIČ identifiers. (max 50 položiek / items)
icosstring[]optionalFallback list of IČO identifiers for backward compatibility. (max 50 položiek / items)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/firms/assign/batch" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "dics": [
    "0000000001",
    "0000000002"
  ]
}'

Príklady odpovedí

200 Batch assignment results per DIC/ICO, including consent and interface-authorization errors per item
{
  "results": [
    { "identifier":"2122701339", "dic":"2122701339", "firm":{"id":"b1022d80-5016-4dad-a8d2-53685cab1701","name":"Kaja Solutions s.r.o.","ico":"52345678","dic":"2122701339","peppol_id":"0245:2122701339","peppol_status":"active"}, "status":"active" },
    { "ico":"99887766", "error":"NOT_FOUND", "message":"No firm with ICO 99887766" },
    { "ico":"11223344", "error":"API_INTERFACE_NOT_AUTHORIZED", "message":"Firm consent does not authorize Enterprise API through the current partner relationship.", "reason":"interface_mismatch", "required_interface":"enterprise_api", "required_scopes":["firms:manage"] }
  ]
}

Odpovede

  • 200Batch assignment results per DIC/ICO, including consent and interface-authorization errors per item
  • 401Unauthorized
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 422Validation error
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/integrator/keysCore

Zoznam integrátorských kľúčov

Potrebný scope: keys:manage

Requires a JWT from an unrestricted sk_int_* key with keys:manage. Browser sessions, direct firm credentials and firm-scoped keys are not accepted. Shared Enterprise Core operation, including for SAPI partners; it does not grant additional document interfaces. Returns metadata only, never secrets. scopedFirmId=null means all currently authorized firms.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl https://epostak.sk/api/v1/integrator/keys \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Integrator API keys
{
  "keys": [{
    "id": "11111111-1111-4111-8111-111111111111",
    "keyPrefix": "sk_int_xxxxx...abcd",
    "name": "OAuth: BNS Sandbox firma 1",
    "scopes": ["firms:manage","documents:send","documents:read"],
    "ipAllowlist": [],
    "isActive": true,
    "lastUsedAt": null,
    "createdAt": "2026-05-22T10:00:00.000Z"
  }]
}

Odpovede

  • 200Integrator API keys
  • 401Invalid or missing token
  • 403Missing keys:manage, restricted key, or missing current partner authorization
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
DELETE/api/v1/integrator/keysCore

Zneplatniť integrátorský kľúč

Potrebný scope: keys:manage

Requires a JWT from an unrestricted sk_int_* key with keys:manage. Browser sessions, direct firm credentials and firm-scoped keys are not accepted. Shared Enterprise Core operation, including for SAPI partners; it does not grant additional document interfaces. Legacy body-based revoke. Only the last active unrestricted main key is protected; the last firm-scoped key may be revoked. Revocation also invalidates existing JWTs.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
keyIduuidoptionalUUID from GET /api/v1/integrator/keys.
client_idstringoptionalsk_int_* keyPrefix/client_id returned by /api/oauth/token.

Príklady volania

cURL
curl -X DELETE https://epostak.sk/api/v1/integrator/keys \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{"client_id":"sk_int_xxxxx...abcd"}'

Príklady odpovedí

200 API key deactivated
{
  "success": true,
  "message": "API key deactivated."
}

Odpovede

  • 200API key deactivated
  • 400Invalid body, already inactive, or last active unrestricted main key
  • 401Invalid or missing token
  • 403Missing keys:manage, restricted key, or missing current partner authorization
  • 404API key not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/onboarding-requestsSúkromný pilot

Request send-only onboarding (controlled preview)

Potrebný scope: firms:manage

Controlled preview, disabled by default. One onboarding request registers and links a company to an integrator or technical partner with a current Enterprise API production contract. Requires unrestricted partner credentials. The verified PFS contact confirms the exact partner, send-only service and payer in one screen. technical_delegation is firm-paid; a standard price-list order activates right after the company signs, a non-standard one stays activating for provider review; managed_service uses an existing active signed integrator billing account. Existing valid exact grants are reused. No user account, dashboard or SMP change. contactEmail is not identity evidence. Poll for active, or subscribe to status events via PUT /onboarding-requests/webhook, then create a firm-scoped key via POST /integrator/keys.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringREQmax 128 znakov / chars, pattern ^[A-Za-z0-9_.:-]+$

Parametre

NázovTypPovinnéPopis
serviceModestringREQ (povolené: send_only)
customerRefstringREQmax 128 znakov / chars
dicstringREQpattern ^[0-9]{10}$
contactEmailstringREQmax 255 znakov / chars
relationshipModestringoptional (default: technical_delegation) (povolené: technical_delegation, managed_service)

Príklady volania

cURL
curl -X POST "https://epostak.sk/api/v1/onboarding-requests" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "serviceMode": "send_only",
  "customerRef": "string",
  "dic": "string",
  "contactEmail": "string"
}'

Odpovede

  • 202Request created or replayed. An already authorized exact grant may return active; otherwise firmId and keyCreation remain null.
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403Partner not authorized
  • 409Idempotency key or customer reference conflicts
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503Preview disabled
GET/api/v1/onboarding-requests/{id}Súkromný pilot

Read own send-only onboarding status (controlled preview)

Potrebný scope: firms:manage

Controlled preview, disabled by default. One onboarding request registers and links a company to an integrator or technical partner with a current Enterprise API production contract. Requires unrestricted partner credentials. The verified PFS contact confirms the exact partner, send-only service and payer in one screen. technical_delegation is firm-paid; a standard price-list order activates right after the company signs, a non-standard one stays activating for provider review; managed_service uses an existing active signed integrator billing account. Existing valid exact grants are reused. No user account, dashboard or SMP change. contactEmail is not identity evidence. Poll for active, or subscribe to status events via PUT /onboarding-requests/webhook, then create a firm-scoped key via POST /integrator/keys.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
iduuidREQ

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/onboarding-requests/<id>" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Only the requesting partner can read this request.
  • 401Missing, expired, or invalid API key or access token. Get a new access token and retry; the error code says which credential was rejected.
  • 403Partner not authorized
  • 404Request not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503Preview disabled
GET/api/v1/onboarding-requests/webhookSúkromný pilot

Read the partner onboarding webhook (controlled preview)

Potrebný scope: webhooks:read

One partner-level onboarding webhook per integrator (no firm context). It receives the send-only onboarding lifecycle events (onboarding.*) for the partner's own onboarding requests, the consent events (consent.accepted, consent.revoked, consent.expired, consent.declined, consent.awaiting_pfs, consent.scopes_updated) for the partner's own consent offers, and webhook.disabled when another of the partner's webhook endpoints was switched off after repeated failed deliveries (never sent to the endpoint that was switched off). Every consent event carries data.nextAction and data.clientMessage {sk, en}; consent.declined has nextAction contact_client and data.declinedAt, data.reason declined_by_firm; consent.awaiting_pfs has nextAction select_provider_on_pfs; consent.scopes_updated has data.previousScopes, data.currentScopes and data.change (narrowed, widened or changed); webhook.disabled has data.subscriptionId, data.url, data.reason consecutive_failures, data.failedAttempts, data.disabledAt, data.nextAction fix_endpoint_and_reactivate and data.message {sk, en}. White Label partners also receive participant.released when a participant they managed moved to another provider or its service was terminated: data.participantId, data.customerRef, data.firmId, data.dic, data.peppolId, data.operationId, data.status released, data.reason (provider_changed or service_terminated) and data.releasedAt. Requires unrestricted partner credentials and either the same Enterprise API partner authorization as POST /onboarding-requests or active White Label participant access (in the DEV sandbox an activated White Label sandbox). The signing secret is returned only when the subscription is created or re-created after DELETE; later PUT calls update url and events and keep the secret.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/onboarding-requests/webhook" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200The current subscription, or null when none is configured. The secret is never returned here.
  • 401Missing or invalid partner credentials
  • 403Partner not authorized, restricted key or missing scope
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503Preview disabled
PUT/api/v1/onboarding-requests/webhookSúkromný pilot

Create or replace the partner onboarding webhook (controlled preview)

Potrebný scope: webhooks:write

One partner-level onboarding webhook per integrator (no firm context). It receives the send-only onboarding lifecycle events (onboarding.*) for the partner's own onboarding requests, the consent events (consent.accepted, consent.revoked, consent.expired, consent.declined, consent.awaiting_pfs, consent.scopes_updated) for the partner's own consent offers, and webhook.disabled when another of the partner's webhook endpoints was switched off after repeated failed deliveries (never sent to the endpoint that was switched off). Every consent event carries data.nextAction and data.clientMessage {sk, en}; consent.declined has nextAction contact_client and data.declinedAt, data.reason declined_by_firm; consent.awaiting_pfs has nextAction select_provider_on_pfs; consent.scopes_updated has data.previousScopes, data.currentScopes and data.change (narrowed, widened or changed); webhook.disabled has data.subscriptionId, data.url, data.reason consecutive_failures, data.failedAttempts, data.disabledAt, data.nextAction fix_endpoint_and_reactivate and data.message {sk, en}. White Label partners also receive participant.released when a participant they managed moved to another provider or its service was terminated: data.participantId, data.customerRef, data.firmId, data.dic, data.peppolId, data.operationId, data.status released, data.reason (provider_changed or service_terminated) and data.releasedAt. Requires unrestricted partner credentials and either the same Enterprise API partner authorization as POST /onboarding-requests or active White Label participant access (in the DEV sandbox an activated White Label sandbox). The signing secret is returned only when the subscription is created or re-created after DELETE; later PUT calls update url and events and keep the secret.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
urlstringREQPublic HTTPS endpoint. (pattern ^https://)
eventsstring[]REQ

Príklady volania

cURL
curl -X PUT "https://epostak.sk/api/v1/onboarding-requests/webhook" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "string",
  "events": [
    "onboarding.pfs_received"
  ]
}'

Odpovede

  • 200Existing subscription updated. The signing secret is unchanged and not returned.
  • 201Subscription created (or re-created after DELETE). secret is the HMAC signing secret and is shown only once.
  • 400Invalid JSON, url or events
  • 401Missing or invalid partner credentials
  • 403Partner not authorized, restricted key or missing scope
  • 413Request body too large
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503Preview disabled
DELETE/api/v1/onboarding-requests/webhookSúkromný pilot

Delete the partner onboarding webhook (controlled preview)

Potrebný scope: webhooks:write

One partner-level onboarding webhook per integrator (no firm context). It receives the send-only onboarding lifecycle events (onboarding.*) for the partner's own onboarding requests, the consent events (consent.accepted, consent.revoked, consent.expired, consent.declined, consent.awaiting_pfs, consent.scopes_updated) for the partner's own consent offers, and webhook.disabled when another of the partner's webhook endpoints was switched off after repeated failed deliveries (never sent to the endpoint that was switched off). Every consent event carries data.nextAction and data.clientMessage {sk, en}; consent.declined has nextAction contact_client and data.declinedAt, data.reason declined_by_firm; consent.awaiting_pfs has nextAction select_provider_on_pfs; consent.scopes_updated has data.previousScopes, data.currentScopes and data.change (narrowed, widened or changed); webhook.disabled has data.subscriptionId, data.url, data.reason consecutive_failures, data.failedAttempts, data.disabledAt, data.nextAction fix_endpoint_and_reactivate and data.message {sk, en}. White Label partners also receive participant.released when a participant they managed moved to another provider or its service was terminated: data.participantId, data.customerRef, data.firmId, data.dic, data.peppolId, data.operationId, data.status released, data.reason (provider_changed or service_terminated) and data.releasedAt. Requires unrestricted partner credentials and either the same Enterprise API partner authorization as POST /onboarding-requests or active White Label participant access (in the DEV sandbox an activated White Label sandbox). The signing secret is returned only when the subscription is created or re-created after DELETE; later PUT calls update url and events and keep the secret.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Príklady volania

cURL
curl -X DELETE "https://epostak.sk/api/v1/onboarding-requests/webhook" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 204Deleted, or no subscription existed.
  • 401Missing or invalid partner credentials
  • 403Partner not authorized, restricted key or missing scope
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503Preview disabled
GET/api/v1/white-label/participants/{participantId}

Get one managed White Label participant

Potrebný scope: participants:read

Returns a participant only when it belongs to the authenticated White Label tenant.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
participantIduuidREQ

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/white-label/participants/<participantId>" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Managed participant
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 404Participant is absent or belongs to another tenant
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/white-label/participants/{participantId}/directory-publication

Read Peppol Directory publication

Potrebný scope: participants:read

Returns whether the participant is published in the Peppol Directory (directory.peppol.eu), as stored on the SMP, for a participant managed by the authenticated White Label tenant.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
participantIduuidREQ

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/white-label/participants/<participantId>/directory-publication" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Current Peppol Directory publication
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 404Participant is absent or belongs to another tenant
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503DIRECTORY_PUBLICATION_UNAVAILABLE: the SMP did not answer; nothing was changed. Retry shortly.
PATCH/api/v1/white-label/participants/{participantId}/directory-publication

Publish or hide the participant in the Peppol Directory

Potrebný scope: participants:write

Switches Peppol Directory publication for a participant managed by the authenticated White Label tenant. The firm keeps receiving documents either way; only its listing in directory.peppol.eu changes. The SMP stores the value at once, the public Directory follows within minutes to hours. Sending the same value again is safe. New registrations choose it with publishInPeppolDirectory.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
participantIduuidREQ
publishedbooleanREQtrue = list the firm in the Peppol Directory, false = hide it.

Príklady volania

cURL
curl -X PATCH "https://epostak.sk/api/v1/white-label/participants/<participantId>/directory-publication" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "published": false
}'

Odpovede

  • 200Stored Peppol Directory publication
  • 400INVALID_WHITE_LABEL_REQUEST: published must be a boolean
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 404Participant is absent or belongs to another tenant
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
  • 503DIRECTORY_PUBLICATION_UNAVAILABLE: the SMP did not answer; nothing was changed. Retry shortly.
GET/api/v1/white-label/operations/{operationId}

Get White Label participant operation status

Potrebný scope: participants:read

Returns only operations owned by the authenticated White Label tenant. Resolve the relative Location returned by 202 responses against the public request URL before polling.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
operationIduuidREQ

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/white-label/operations/<operationId>" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Odpovede

  • 200Operation status
  • 401Missing or invalid JWT
  • 403White Label entitlement or scope is not active
  • 404Operation is absent or belongs to another tenant
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/firms/{id}/documentsStabilný, bez nových funkcií

Dokumenty firmy

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /documents/outbox

Vrati strankovany zoznam dokumentov (odoslanych aj prijatych) pre danu firmu. Strankovanie: limit a offset (odpoved vracia total, limit, offset); starsie page a page_size funguju dalej. Odpoved obsahuje aj objekt pagination (total, page, page_size, has_next); nextCursor sa na tomto endpointe nevracia.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
idstringREQID firmy
offsetinteger (query)optionalPocet preskocenych zaznamov (najviac 999900) (min 0) (default: 0)
limitinteger (query)optionalPocet vratenych zaznamov (1-100, predvolene 20; vyssia hodnota sa orezava na 100). Bez limit a offset plati page/page_size. (1–100) (default: 20)
directionstring (query)optionalFilter podla smeru (povolené: inbound, outbound)

Príklady volania

cURL
curl "https://epostak.sk/api/v1/firms/firm_abc123/documents?direction=inbound&page=1" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Zoznam dokumentov firmy
{"documents":[{"id":"clx9abc123","status":"RECEIVED","direction":"inbound"}],"pagination":{"total":42,"page":1,"pageSize":20,"totalPages":3}}

Odpovede

  • 200Zoznam dokumentov firmy
  • 401Missing or invalid API key
  • 403Pristup odmietnuty
  • 404Firma nenajdena
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/integrator/licenses/infoStabilný, bez nových funkcií

Plán a agregovaná spotreba

Stabilný, bez nových funkcií. Odporúčaná náhrada: GET /licenses/info

Returns the integrator plan, current-period usage aggregated across managed firms, and the exact signed pricing snapshot used for billing. Outbound and inbound documents are tiered separately; under V1.2, document 20,001 and every later document in either direction is €0.04 without a custom order. **Requires account:read scope on a sk_int_* integrator key.** No X-Firm-Id header — the endpoint is integrator-scoped, not firm-scoped.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
offsetinteger (query)optionalPagination offset for the per-firm list. Default 0. (min 0) (default: 0)
limitinteger (query)optionalPage size for the per-firm list. Max 100. Default 50. (1–100) (default: 50)

Príklady volania

cURL
curl https://epostak.sk/api/v1/integrator/licenses/info \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Plan + aggregate usage snapshot
{
  "integrator": {"id":"int_abc","name":"Demo Integrátor","plan":"integrator","monthlyDocumentLimit":null},
  "period": "2026-04",
  "nextResetAt": "2026-05-01T00:00:00.000Z",
  "billable": {
    "managedFirms":42,"outboundCount":1850,"inboundApiCount":320,
    "outboundCharge":168.00,"inboundApiCharge":25.60,"totalCharge":193.60,"currency":"EUR"
  },
  "sandbox": {
    "firms":2,"outboundCount":120,"inboundApiCount":30,
    "outboundCharge":12.00,"inboundApiCharge":2.40,"totalCharge":14.40,"currency":"EUR"
  },
  "productionEstimate": {
    "managedFirms":44,"outboundCount":1970,"inboundApiCount":350,
    "outboundCharge":177.60,"inboundApiCharge":28.00,"totalCharge":205.60,"currency":"EUR"
  },
  "nonManaged": {"firms":3,"outboundCount":120,"inboundApiCount":15},
  "exceedsAutoTier": false,
  "contactThreshold": 20000,
  "pricing": {
    "scheduleVersion":"pricing-v1.2-2026-07-24","model":"tiered","currency":"EUR","thresholdScope":"per_direction","marginalBandStartsAt":20001,
    "outboundTiers":[
      {"upTo":1000,"rate":0.10},
      {"upTo":2000,"rate":0.08},
      {"upTo":5000,"rate":0.06},
      {"upTo":20000,"rate":0.05},
      {"upTo":null,"rate":0.04,"label":"20 001+","contactRequired":false}
    ],
    "inboundApiTiers":[
      {"upTo":1000,"rate":0.08},
      {"upTo":2000,"rate":0.07},
      {"upTo":5000,"rate":0.06},
      {"upTo":20000,"rate":0.05},
      {"upTo":null,"rate":0.04,"label":"20 001+","contactRequired":false}
    ]
  },
  "firms":[
    {"firmId":"firm_a","name":"Klient A s.r.o.","ico":"12345678","managed":true,"outboundCount":312,"inboundApiCount":41}
  ],
  "pagination":{"limit":50,"offset":0,"total":45}
}

Odpovede

  • 200Plan + aggregate usage snapshot
  • 401Invalid or missing token
  • 403Missing <code>account:read</code> scope or non-integrator key
  • 404Integrator not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.

Reporty

Štatistiky a prehľady o odoslaných a prijatých dokumentoch.

Usage statistics

Reporty sú prevádzkový a billing povrch, nie náhrada detailného document lifecycle.

  • Použite ich na kontrolu objemov a fakturácie.
  • Pre konkrétny incident použite document status/events/support-packet.
GET/api/v1/reporting/statistics

Štatistiky dokumentov

Vrati agregovane statistiky odoslanych a prijatych dokumentov za zvolene obdobie.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.

Parametre

NázovTypPovinnéPopis
fromdate (query)optionalZaciatok obdobia (YYYY-MM-DD)
todate (query)optionalKoniec obdobia (YYYY-MM-DD)

Príklady volania

cURL
curl "https://epostak.sk/api/v1/reporting/statistics?period=month" \
  -H "Authorization: Bearer eyJhbGc..."

Príklady odpovedí

200 Statistiky dokumentov
{
  "period": {"from":"2025-04-01","to":"2025-04-30"},
  "sent": {"total":47,"by_type":{"invoice":45,"credit_note":2}},
  "received": {"total":12,"by_type":{"invoice":12}},
  "delivery_rate": 0.979,
  "top_recipients": [{"name":"ABC s.r.o.","peppol_id":"0245:SK...","count":10}],
  "top_senders": []
}

Odpovede

  • 200Statistiky dokumentov
  • 401Missing or invalid API key
  • 403The credential is valid but lacks the required scope, firm access, or plan entitlement for this operation. Retrying with the same credential does not help.
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.

Export do účtovných programov

Doklady firmy ako súbor pre POHODA, KROS Omega, Money S3, MRP, ABRA Flexi, DUEL, PROLUC, MKsoft, SAP IDoc, ISDOC alebo CSV, s nastaveniami firmy. Rovnaký výstup ako export v dashboarde.

GET/api/v1/accounting-exports/formats

Formáty účtovných programov

Potrebný scope: documents:read

Formats ePošťák can export documents to. status preview means the output passes the vendor schemas but has not yet been confirmed by a real import in the program; check the first imports by hand. directions says whether the format also carries issued documents.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Príklady volania

cURL
curl https://epostak.sk/api/v1/accounting-exports/formats \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..."

Príklady odpovedí

200 Formats
{ "formats": [{ "id": "pohoda", "name": "POHODA", "directions": ["received", "issued"], "supportsSettings": true, "status": "stable" }, { "id": "money_s3", "name": "Money S3", "directions": ["received"], "supportsSettings": true, "status": "preview" }] }

Odpovede

  • 200Formats
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
POST/api/v1/accounting-exports

Vytvoriť export do účtovného programu

Potrebný scope: documents:read

Builds an accounting program file from the firm's documents: either a list of IDs (documentIds, at most 1000) or a period (period, at most 366 days and 1000 documents). Uses the firm's settings for that program (series, posting rules, VAT codes, supplier rules). A document the program cannot take is left out and listed in skipped with a code and hint; the rest is exported. dryRun only checks the selection and stores nothing. markExported (default true) marks the documents exported, the same as the dashboard export, and needs the documents:write scope. Download the file through GET /accounting-exports/{id}/file within 7 days. Every received document in the file counts as API access, the same as GET /documents/{id}/ubl. When the selection holds no document, the response is 200 with status empty and no file.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
Idempotency-KeystringoptionalRepeating the POST with the same key and body returns the same export (200, Idempotent-Replayed header). The same key with another body returns 409 IDEMPOTENCY_KEY_REUSED. (max 128 znakov / chars, pattern ^[A-Za-z0-9._:-]{8,128}$)
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
formatstringREQ (povolené: pohoda, omega, isdoc, money_s3, money_s3_isdoc, mrp, abra_flexi, duel, proluc, sap_idoc, mksoft, oberon, alfa-plus, csv)
documentIdsuuid[]optionalmax 1000 položiek / items
periodobjectoptional
period.fromdateREQ
period.todateREQInclusive
period.dateBasisstringoptional (default: issue_date) (povolené: issue_date, received_at)
directionstringoptionalPeriod only. Default all; formats for received documents only (money_s3, mrp, proluc, sap_idoc) require received. (povolené: received, issued, all)
onlyNotExportedbooleanoptionalPeriod only: only documents not exported yet (default: false)
markExportedbooleanoptional (default: true)
dryRunbooleanoptional (default: false)

Príklady volania

cURL
curl -X POST https://epostak.sk/api/v1/accounting-exports \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pohoda-2026-09" \
  -d '{"format":"pohoda","period":{"from":"2026-09-01","to":"2026-09-30"},"direction":"received","onlyNotExported":true}'

Príklady odpovedí

201 Export created
{ "id": "6f1c…", "status": "completed", "format": "pohoda", "documentCount": 41, "exportedDocumentIds": ["…"], "skipped": [{ "documentId": "…", "invoiceNumber": "FV-2026-118", "severity": "error", "code": "missing_exchange_rate", "message": "…", "hint": "…" }], "warnings": [], "markExported": true, "selection": { "from": "2026-09-01", "to": "2026-09-30", "dateBasis": "issue_date", "direction": "received", "onlyNotExported": true }, "file": { "filename": "pohoda-2026-09.xml", "contentType": "application/xml", "sizeBytes": 183422, "sha256": "…", "expiresAt": "2026-10-22T08:00:00.000Z", "available": true }, "createdAt": "2026-10-15T08:00:00.000Z" }

Odpovede

  • 200Replayed Idempotency-Key, dryRun result, or empty selection
  • 201Export created
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404A document does not exist or is not visible to the key
  • 409IDEMPOTENCY_KEY_REUSED
  • 413Request body too large
  • 422VALIDATION_ERROR, TOO_MANY_DOCUMENTS or EXPORT_BLOCKED (no document can be exported; skipped, errors and warnings are in error)
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/accounting-exports

Export history

Potrebný scope: documents:read

The firm's exports created through the API, newest first. Page with cursor (nextCursor of the previous response).

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
limitinteger (query)optional1–100 (default: 20)
cursoruuid (query)optionalnextCursor of the previous page

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/accounting-exports" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200History page
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 422Invalid limit or cursor
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/accounting-exports/{id}

Get an export

Potrebný scope: documents:read

Export state, skipped documents, warnings and file details. status expired means the file is no longer available.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQExport ID

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/accounting-exports/<id>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Export
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404Export not found
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/accounting-exports/{id}/file

Stiahnuť súbor exportu

Potrebný scope: documents:read

The accounting program file (XML, ZIP, CSV or DBF depending on the format). The X-Content-SHA256 header carries the file hash.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
iduuidREQExport ID

Príklady volania

cURL
curl https://epostak.sk/api/v1/accounting-exports/6f1c…/file \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
  --output pohoda-2026-09.xml

Odpovede

  • 200Export file
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404Export not found
  • 410EXPORT_EXPIRED: the file is no longer available
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/accounting-exports/settings/{format}

Get firm export settings

Potrebný scope: documents:read

Series, posting rule, VAT codes and the legacy supplier-number key for one program. These are the same settings the dashboard export uses.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
formatstringREQAccounting program that has settings (povolené: pohoda, money_s3, mrp, omega, proluc, mksoft, sap_idoc)

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/accounting-exports/settings/<format>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Settings
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404SETTINGS_NOT_SUPPORTED: the format has no settings
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
PUT/api/v1/accounting-exports/settings/{format}

Nastavenia exportu firmy

Potrebný scope: documents:write

Replaces the firm's settings for one program. The change also applies to the dashboard export and is written to the firm's audit log.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
formatstringREQAccounting program that has settings (povolené: pohoda, money_s3, mrp, omega, proluc, mksoft, sap_idoc)
legacySupplierNumberKeybooleanoptionalAlso write the supplier's invoice number as the program's own document number (behaviour before 2026-10) (default: false)
documentSeriesstringoptionalSeries of received documents (max 32 znakov / chars)
postingRulestringoptionalPosting rule of received documents (max 32 znakov / chars)
vatCodesobjectoptionalKey &lt;received|issued&gt;:&lt;VAT case&gt; -&gt; the program's code. An empty string removes the code.

Príklady volania

cURL
curl -X PUT https://epostak.sk/api/v1/accounting-exports/settings/pohoda \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{"documentSeries":"PF","postingRule":"3Fv","vatCodes":{"received:standard":"PD"}}'

Odpovede

  • 200Saved settings
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404SETTINGS_NOT_SUPPORTED
  • 413Request body too large
  • 422Invalid settings
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
GET/api/v1/accounting-exports/settings/{format}/supplier-rules

Supplier rules

Potrebný scope: documents:read

Posting rule or series for received documents of one supplier; they take precedence over the firm's settings.

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
formatstringREQAccounting program that has settings (povolené: pohoda, money_s3, mrp, omega, proluc, mksoft, sap_idoc)

Príklady volania

cURL
curl -X GET "https://epostak.sk/api/v1/accounting-exports/settings/<format>/supplier-rules" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Rules
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404SETTINGS_NOT_SUPPORTED
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
PUT/api/v1/accounting-exports/settings/{format}/supplier-rules/{ico}

Save a supplier rule

Potrebný scope: documents:write

Creates or replaces the rule for one supplier (at most 500 per program).

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
formatstringREQAccounting program that has settings (povolené: pohoda, money_s3, mrp, omega, proluc, mksoft, sap_idoc)
icostringREQSupplier company ID (IČO) (max 20 znakov / chars)
postingRulestringoptionalmax 32 znakov / chars
documentSeriesstringoptionalmax 32 znakov / chars

Príklady volania

cURL
curl -X PUT "https://epostak.sk/api/v1/accounting-exports/settings/<format>/supplier-rules/<ico>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID" \
  -H "Content-Type: application/json" \
  -d '{}'

Odpovede

  • 200Saved rule
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404SETTINGS_NOT_SUPPORTED
  • 409SUPPLIER_RULE_LIMIT
  • 413Request body too large
  • 422Invalid company ID or rule
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.
DELETE/api/v1/accounting-exports/settings/{format}/supplier-rules/{ico}

Delete a supplier rule

Potrebný scope: documents:write

Delete a supplier rule

Hlavičky

NázovTypPovinnéPopis
AuthorizationstringREQBearer &lt;JWT&gt; získaný cez POST /api/v1/auth/token z kľúča sk_live_* (priamy prístup firmy) alebo sk_int_* (integrátor; vtedy aj X-Firm-Id). Surový API kľúč ako Bearer server odmietne s 401.
X-Firm-IduuidoptionalManaged firm UUID. Required when the bearer token is a JWT minted from an integrator key (sk_int_*): a request without it returns 400 BAD_REQUEST ("X-Firm-Id header is required when using JWT issued from an integrator key (sk_int_*).") and a value that is not a UUID returns 400 BAD_REQUEST ("X-Firm-Id must be a valid UUID"). The firm must be actively linked to the integrator for this interface, otherwise authorization fails (401 UNAUTHORIZED, or 403 API_INTERFACE_NOT_AUTHORIZED when the firm's consent does not cover the interface). Ignored for firm credentials (sk_live_* and JWTs minted from them), which are bound to their own firm.

Parametre

NázovTypPovinnéPopis
formatstringREQAccounting program that has settings (povolené: pohoda, money_s3, mrp, omega, proluc, mksoft, sap_idoc)
icostringREQSupplier company ID (IČO) (max 20 znakov / chars)

Príklady volania

cURL
curl -X DELETE "https://epostak.sk/api/v1/accounting-exports/settings/<format>/supplier-rules/<ico>" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Firm-Id: $FIRM_ID"

Odpovede

  • 200Rule deleted
  • 401Missing or invalid API key
  • 403The key lacks the scope, or the plan has no API access
  • 404Rule or format not found
  • 422Invalid company ID
  • 429Rate limit exceeded. Wait until X-RateLimit-Reset (or the Retry-After header when present) and retry; reuse the same Idempotency-Key for a write.

Advanced

Plná expert referencia je jeden klik od Core. Použite ju, keď potrebujete vlastný lifecycle, batch operácie, multi-firma administráciu, push webhooks alebo dôkazové artefakty.

Enterprise Full

Čistý Enterprise kontrakt bez Connector ciest: filtrovaný pohľad na ten istý Enterprise OpenAPI dokument. Compatibility aliasy ostávajú počas riadeného notice window.

Outbound JSON alebo UBL

JSON nechá ePošťák vytvoriť UBL; XML mode zachová hotový Peppol BIS dokument. V oboch prípadoch preflight, stabilný idempotency key a status ostávajú rovnaké.

Inbound fetch a lokálny ack

Čítajte cursor-based inbound feed, durable uložte dokument a až potom potvrďte lokálne spracovanie. Ack neposiela obchodnú odpoveď protistrane.

Push webhook + pull reconciliation

Push prijmite durable pred 2xx a deduplikujte podľa event ID. Pull používajte ako reconciliation checkpoint; kanály nezdieľajú tú istú subscription.

Failed delivery a support

Uložte requestId, documentId a messageId. Pred eskaláciou stiahnite support packet; neposielajte secret ani celý UBL, ak stačí hash.

Multi-firma credentials a scopes

sk_int_* mintne integrátorský JWT. Každý firm-scoped Enterprise request nesie X-Firm-Id autorizovanej firmy a kľúč má iba potrebné scopes. Cross-firm operácie ho nepoužívajú podľa Full kontraktu.

Compatibility

Iba pre existujúce integrácie a migračné porovnanie. T0 ešte nezačalo, preto dnes neexistuje retirement deadline; najskorší sunset môže byť až po 30 plných dňoch od operátorom aktivovaného notice timestampu.

Enterprise OpenAPI (všetky operácie) — jeden dokument, tri URL

Jediný zdrojový Enterprise dokument so všetkými operáciami vrátane Connector ciest; Core a Full sú jeho filtrované pohľady na vlastných URL. Existujúca URL ostáva stabilná pre súčasné codegen klienty. Nový Enterprise kód začína Core alebo Full.

Deväť pripravovaných mapovaní

POST /extract → /payloads/extract; POST /extract/batch → /payloads/extract/batch; POST /documents/parse → /payloads/parse; POST /documents/convert → /payloads/convert; POST /documents/validate → /payloads/validate; GET /webhook-queue → /events/pull; DELETE /webhook-queue/{eventId} → POST /events/{eventId}/ack; POST /webhook-queue/batch-ack → /events/batch-ack; GET /documents/{id}/evidence-bundle → /documents/{id}/support-packet.

Pagination dialects — nemenia sa v tomto sunset programe

Core events/pull nemá cursor: vracia events + has_more a server drží ack state. Inbound/outbound pull posiela ?since=<opaque next_cursor> a vracia next_cursor + has_more. /documents/inbox preferuje ?cursor a vracia nextCursor, pričom offset/limit zostáva kompatibilný; /documents/outbox a dead-letter používajú offset/limit. Connector, ako samostatný produkt, používa cursor → nextCursor + hasMore. Cursor nikdy neparsujte ani neprekladajte medzi feedmi.

Acknowledge nie je Invoice Response

POST /inbound/documents/{id}/ack iba uloží, že ERP dokument lokálne spracovalo; protistrane nič neposiela. POST /documents/{id}/respond je samostatná pokročilá business operácia, ktorá odošle Invoice Response. V Connectore platí rovnaká hranica medzi acknowledge a respond.

Referencia

Cenník, uchovávanie dát a chybové kódy. Väčšina endpointov vracia chybu vo formáte {"error":{"code":"...","message":"...","requestId":"..."}}.

Error contract

Integrátori majú branchovať podľa error.code a ukladať requestId pre support.

  • 422 nie je jeden typ chyby; rozlišujte validation, UBL a idempotency.
  • Retry pravidlá sú súčasťou API kontraktu.

Commercial and retention

Pricing, archív a cieľ dostupnosti patria do reference časti, aby implementačný flow ostal ľahký.

  • Enterprise API archív je viazaný na aktívny kontrakt.
  • Objemové sadzby sa počítajú naprieč spravovanými firmami.
Kanonický Enterprise kontrakt. Payloady používajú /api/v1/payloads/*, pull udalosti /api/v1/events/* a dôkazný balík /api/v1/documents/{id}/support-packet. Tieto trasy sú jediným podporovaným povrchom pre nové aj existujúce pre-launch integrácie.
Error handling contract. Integrácie majú branchovať podľa error.code, nie iba podľa HTTP statusu. Každý supportovateľný incident ukladajte s requestId, documentId/submissionId, messageId a payloadSha256; pri reklamácii priložte support-packet namiesto celého XML, ak stačí hash a dôkazový balík.
Pravidlá opakovania. 422 VALIDATION_ERROR, UBL_VALIDATION_ERROR a IDEMPOTENCY_KEY_MISMATCH neopakujte bez opravy dát. Pri 429 rešpektujte Retry-After; 502/503 opakujte s backoffom a rovnakým Idempotency-Key, ak ide o ten istý payload.

Cenník

Transparentné ceny bez skrytých poplatkov.

Sandbox

Testovacie prostredie pre integráciu.

ObjemCena
Neobmedzenezadarmo

Odoslané

Cena za dokument odoslaný cez Peppol.

ObjemCena
1 – 1 0000,10 €
1 001 – 2 0000,08 €
2 001 – 5 0000,06 €
5 001 – 20 0000,05 €
20 001+individuálne

Prijaté cez API

Cena za dokument prijatý a sprístupnený cez API.

ObjemCena
1 – 1 0000,08 €
1 001 – 2 0000,07 €
2 001 – 5 0000,06 €
5 001 – 20 0000,05 €
20 001+individuálne

Objemové zľavy sa počítajú naprieč všetkými spravovanými firmami, nie per-firma. Ceny sú bez DPH. Platí sa len za dokumenty skutočne doručené cez Peppol.

Rate limity

Limitácia požiadaviek na API kľúč.

Pravidlá

  • Štandardné endpointy3000 požiadaviek / 60 sekúnd na kľúč
  • POST /documents/send600 požiadaviek / 60 sekúnd
  • POST /documents/send/batch10 požiadaviek / 60 sekúnd (až 50 faktúr na požiadavku)
  • GET /documents/{id}/status400 požiadaviek / 60 sekúnd
  • POST /documents/status/batch300 požiadaviek / 60 sekúnd (až 100 stavov na požiadavku)
  • POST /payloads/extract (alias aj /extract OCR)10 požiadaviek / 60 sekúnd
  • POST /payloads/extract/batch (alias aj /extract/batch)3 požiadavky / 60 sekúnd
  • POST /firms/assign a /firms/assign/batch10 požiadaviek / 60 sekúnd
  • POST /validate (verejné)20 požiadaviek / 60 sekúnd na IP

Hlavičky odpovede (HTTP 429)

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset
  • Retry-After

Hlavičky sa vracajú v odpovediach z API; pri HTTP 429 aj Retry-After. Odporúčame implementovať exponenciálny backoff. Aktuálny limit pre konkrétny endpoint sa zobrazí v X-RateLimit-Limit hlavičke pri 429 odpovedi.

Chybové kódy

Chyby sa vracajú vo formáte {"error":{"code":"...","message":"...","requestId":"..."}}. Kódy označené ako retryable je bezpečné opakovať s exponenciálnym backoffom.

StatusKódPopis
400BAD_REQUESTNeplatné JSON telo alebo chýbajúce pole
400INVALID_PARAMNeplatná hodnota query parametra
401UNAUTHORIZEDChýbajúci alebo neplatný API kľúč. Pri platnom alebo expirovanom tokene môže telo navyše obsahovať reason (napr. token_expired, key_revoked, account_not_active) a fix_hint / fix_hint_sk
403FORBIDDENNedostatočný scope alebo prístup k cudzej firme; alebo firma nemá API-eligible plán. Pri vlastnej väzbe integrátora na firmu telo navyše obsahuje reason (consent_pending, consent_revoked, separation_scheduled, firm_not_approved, env_mismatch, agreement_not_effective) a fix_hint / fix_hint_sk; stav súhlasu overíte cez GET /api/v1/firms/consent-status
404NOT_FOUNDProstriedok neexistuje alebo nepatrí vašej firme
409CONFLICTDuplikát (OAuth klient, priradenie firmy, idempotency in-flight)
409CONFLICTretryableRovnaký Idempotency-Key už spracúva rovnaký payload; po čase z hlavičky Retry-After zopakujte s rovnakým kľúčom
409CONNECTOR_LEGACY_IDEMPOTENCY_OWNER_UNPROVENLegacy Connector send nevie bezpečne potvrdiť vlastníka idempotency kľúča spred nasadenia: pri retryable=true počkajte 30 sekúnd a zopakujte presne rovnaký kľúč aj telo; nikdy nevytvárajte nový kľúč. Pri retryable=false doklad znovu neposielajte a kontaktujte podporu na zosúladenie historického stavu.
409AUTOPILOT_REPLAY_MISMATCHAutopilot referencia bola použitá s iným príkazom alebo je rezervovaná v inom/nepreukázanom vlastníckom priestore. Bez Retry-After: konflikt neobchádzajte novým kľúčom; najprv zosúlaďte existujúci run.
422AUTOPILOT_IDEMPOTENCY_REQUIREDAutopilot nemá stabilnú ERP referenciu potrebnú na bezpečný retry: send vyžaduje idempotencyKey v tele alebo hlavičke; stage vyžaduje idempotencyKey alebo externalId. Nič sa neuložilo ani neodoslalo. Historický keyless send neopakujte s novým kľúčom; najprv zosúlaďte /connector/sync alebo kontaktujte podporu.
409CONNECTOR_OUTBOX_REFERENCE_RESERVEDHistorická outbox položka bez preukázaného integrátorského vlastníka už rezervuje ERP referenciu. Nová položka ju neprevezme; najprv zosúlaďte historický stav.
413PAYLOAD_TOO_LARGETelo požiadavky presahuje povolený limit. POST /documents/send: telo najviac 25 MB, UBL v XML režime najviac 22 MB (fields[].path = xml), prílohy v JSON režime spolu najviac 15 MB. Väčšie podklady priložte odkazom cac:ExternalReference
422VALIDATION_ERROR / UNPROCESSABLE_ENTITYJSON alebo povinné polia neprešli vstupnou validáciou; opravte payload
422UBL_VALIDATION_ERRORGenerátor UBL z JSON zistil porušenie EN 16931 pravidla ešte pred validáciou; pravidlo je v error.rule (napr. BR-06)
422IDEMPOTENCY_KEY_MISMATCHRovnaký Idempotency-Key bol znovu použitý s iným kanonizovaným telom
422participant_not_foundKatalóg príjemcov: prijímateľ sa nenašiel v Peppol/SMP; retryable=false; fix_hint=zmeňte alebo overte Peppol ID príjemcu
422receiver_unsupported_document_typeKatalóg príjemcov: prijímateľ existuje, ale nepodporuje zvolený document type/profile; retryable=false; fix_hint=zmeňte typ dokladu alebo capability
422validation_failedValidácia payloadu: UBL/JSON sémantická validácia zlyhala; retryable=false; fix_hint=opravte payload podľa details/rule
502temporary_transport_errorretryableTransport: AP alebo sieťová závislosť dočasne zlyhala; retryable=true; fix_hint=opakujte s rovnakým Idempotency-Key
409delivery_dead_letteredDoručenie: všetky pokusy o doručenie sa vyčerpali; retryable=false; fix_hint=pozrite events/support-packet a opakujte manuálne alebo kontaktujte support
422duplicate_idempotency_keyIdempotencia: rovnaký Idempotency-Key bol použitý s iným telom; retryable=false; fix_hint=pošlite pôvodné telo alebo nový kľúč pre zmenený payload
429RATE_LIMITEDretryablePrekročený rate limit
500INTERNAL_ERRORretryableNeočakávaná chyba servera
422VALIDATION_FAILEDUBL neprešiel Peppol validáciou (schematron). Každá chyba vo fields[] má pravidlo (rule, napr. BR-CO-15, PEPPOL-EN16931-R003, UBL-CR-001), miesto v XML (path), text a slovenské vysvetlenie (message_sk)
409RECIPIENT_NOT_FOUNDPríjemca nie je v sieti Peppol. Doklad je uložený a TDD nahlásený, cez Peppol sa nedoručí; ak sa odberateľ zaregistruje do 15 dní, pošlite rovnaký doklad s novým Idempotency-Key
409VAT_PERIOD_CLOSEDObdobie DPH dátumu zdaniteľného plnenia je už podané; opravte dátum alebo vystavte doklad s dátumom v otvorenom období. Telo má štandardný objekt error (code, message, fix_hint, retryable) a tie isté polia aj na najvyššej úrovni
409TDD_IN_FLIGHTretryableTDD predchádzajúceho pokusu sa ešte odosiela finančnej správe; po čase z Retry-After zopakujte s rovnakým Idempotency-Key
400INVALID_JSONTelo požiadavky nie je platný JSON
401TOKEN_REVOKEDPrístupový token bol zrušený; vyžiadajte si nový cez POST /api/v1/auth/token
403INSUFFICIENT_SCOPEToken nemá scope, ktorý endpoint vyžaduje; chýbajúci scope je v tele a v hlavičke WWW-Authenticate
403IP_NOT_ALLOWEDAdresa volajúceho nie je v zozname povolených IP kľúča; client_ip v tele uvádza adresu, ktorú sme videli
503SEND_FAILEDOdoslanie dokladu iného typu ako faktúra (napr. objednávka) definitívne zlyhalo; neposielajte znova, kontaktujte podporu s documentId. Dočasné zlyhanie vráti 202 so status SEND_PENDING a doklad sa odošle automaticky
503SEND_FAILEDOdoslanie faktúry cez Peppol AP zlyhalo. S documentId a retryable false zlyhalo definitívne: deliveryFailure.code v GET /documents/{id}/status udáva príčinu; nezmenený doklad možno poslať znova s novým Idempotency-Key a ponechá si documentId aj číslo. Bez documentId sa doklad nepodarilo zaradiť: zopakujte s novým Idempotency-Key po Retry-After. Zlyhanie prvého pokusu, ktoré sa opakuje automaticky, vráti 202 so status sending a upozornením
503VALIDATION_UNAVAILABLEretryableValidácia pri odoslaní je dočasne nedostupná; zopakujte s rovnakým Idempotency-Key
503IDEMPOTENCY_STORE_UNAVAILABLEretryableDočasne nedostupný idempotency store; opakujte s rovnakým Idempotency-Key
503VALIDATION_SERVICE_UNAVAILABLEretryableDočasne nedostupný validačný engine; opakujte s backoffom

Uchovávanie dát

Prevádzková dostupnosť počas kontraktu

Enterprise API prevádzkovo sprístupňuje dokumenty počas aktívneho kontraktu — obsah (UBL/XML), štruktúrované dáta faktúr aj transportné metadata (Peppol message ID, časové pečiatky, AS4 potvrdenia, MLS). Read-only exportné endpointy /documents/{id}, /documents/{id}/ubl, /documents/{id}/pdf, /documents/{id}/evidence, /documents/{id}/evidence-bundle a /documents/{id}/envelope ostávajú dostupné počas aktívneho kontraktu a 30 dní po jeho ukončení na export. Opätovné stiahnutie dostupného dokumentu sa osobitne nespoplatňuje. Táto prevádzková dostupnosť nie je dlhodobý zákaznícky archív; ten sa v prípade potreby objednáva ako platený doplnok podľa aktuálneho Cenníka alebo individuálnej objednávky. Poskytovateľ vyvíja primerané úsilie na cieľ dostupnosti 99,5 % podľa VOP bez service creditov alebo automatických náhrad; Peppol sieť, FR SR, SMP/SML, OpenPeppol, cudzie Access Pointy a prijímacie systémy sú externé vrstvy mimo priamej kontroly ePošťáka.

Uchovávanie dát

Prevádzkové dáta API a technické zálohy sú viazané na zmluvný vzťah: počas aktívneho kontraktu a 30 dní po ukončení na export, audit alebo migráciu. Parametre samostatne objednaného zákazníckeho archívu určuje Cenník alebo individuálna objednávka. Signované AS4 obálky a transportné dôkazy uchovávame ako infraštruktúru Access Pointu, no Enterprise API ani platený zákaznícky archív automaticky nepreberajú zákonnú účtovnú archiváciu zákazníka. Po 30-dňovej exportnej lehote sa bežný API prístup k exportom uzatvára, ak samostatná objednávka neurčuje inak.

Zodpovednosť za účtovnú archiváciu

Zákonná povinnosť uchovávať daňové doklady podľa účtovných a daňových predpisov zostáva na vystaviteľovi/príjemcovi faktúry. ePošťák poskytuje exporty a dôkazné podklady počas aktívneho kontraktu a 30 dní po jeho ukončení na export, no formálne nepreberá povinnosť účtovnej archivácie zákazníka.