{"openapi":"3.1.0","info":{"title":"SAPIPlus v1 — rozšírenia Postar-Cloud nad SAPI-SK","version":"1.0.0","contact":{"name":"E-Works s.r.o. — podpora Postar-Cloud","email":"podpora@postar-cloud.sk"},"description":"Rozšírená plocha `/sapi/plus/v1/` pre potreby, ktoré štandard SAPI-SK 1.0.0 nepokrýva. Štandardná plocha `/sapi/` nedostáva nové cesty — všetko navyše žije tu, s vlastným verzovaním v ceste. Breaking zmena znamená `v2` a staré `v1` beží súbežne po dohodnutú dobu.\n\n**Jediné rozšírenie štandardnej požiadavky: `senderPerson`.** V tele `POST /sapi/document/send` je povinné pole `senderPerson` — meno a priezvisko osoby, ktorá doklad v systéme klienta odosiela. SAPI-SK identifikáciu osoby nemá (token identifikuje softvér), overenie odosielateľa ju vyžaduje (FAQ Finančnej správy č. 73). Bez neho je odoslanie `403`, `SAPI-AUTH-008`.\n\n**Autentifikácia, token, logovanie aj rate limit sú spoločné so štandardom:** ten istý `client_id`/`client_secret`, ten istý Bearer token z `POST /sapi/auth/token`. Rozdiel je len v scope kľúča — `plus:inbox` a `plus:webhooks` si kľúč pri vzniku v portáli musí vyžiadať.\n\nChybové odpovede majú rovnaký tvar ako v štandarde: `{error: SAPIError}` so stabilným kódom, `retryable` a `correlation_id` (to isté ID je v hlavičke `X-Correlation-Id`)."},"servers":[{"url":"https://zk.postar-cloud.sk/sapi/plus/v1","description":"Postar-Cloud (E-Works) — SAPIPlus v1"}],"tags":[{"name":"Inbox","description":"Stránkovaný a filtrovaný prehľad prenosov firmy (prijaté aj odoslané)."},{"name":"Webhooks","description":"Registrácia URL, na ktoré backend posiela udalosti podpísané HMAC-SHA256."},{"name":"Documents","description":"Stav odoslaného dokladu a validácia pred odoslaním. Názvy ciest sú z návrhu rozšírení SAPI-SK."},{"name":"Participants","description":"Overenie, či je príjemca v sieti Peppol a čo vie prijať."}],"security":[{"bearerAuth":[]}],"paths":{"/inbox":{"get":{"tags":["Inbox"],"summary":"Stránkovaný inbox prenosov","operationId":"plusInbox","description":"Štandardný `GET /sapi/document/receive` vracia plochý zoznam a podľa špecifikácie tak musí zostať. Tento endpoint pridáva stránkovanie a filtre. Vyžaduje scope `plus:inbox`. Vracia prenosy firmy, ku ktorej patrí kľúč — prijaté aj odoslané, vrátane MLS, Invoice Response a SK TDD hlásení.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Počet položiek na stránku (max 200)."},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"direction","in":"query","schema":{"type":"string","enum":["in","out"]},"description":"Smer prenosu."},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","sending","sent","delivered","failed","delivery_uncertain"]},"description":"Stav doručenia (`delivery_status`)."},{"name":"kind","in":"query","schema":{"type":"string","enum":["invoice","credit_note","mls","invoice_response","tax_report","unknown"]},"description":"Druh prenosu."},{"name":"from","in":"query","schema":{"type":"integer"},"description":"Unix čas; prenosy s `created_at >= from`."},{"name":"to","in":"query","schema":{"type":"integer"},"description":"Unix čas; prenosy s `created_at <= to`."}],"responses":{"200":{"description":"Stránka prenosov","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"Webhooky tohto kľúča","operationId":"plusWebhookList","description":"Webhook patrí kľúču, nie firme: iný kľúč tej istej firmy svoje webhooky spravuje sám. Odpoveď obsahuje aj zoznam udalostí, ktoré táto verzia podporuje. Vyžaduje scope `plus:webhooks`.","responses":{"200":{"description":"Zoznam webhookov a podporovaných udalostí","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"tags":["Webhooks"],"summary":"Registrácia webhooku","operationId":"plusWebhookCreate","description":"URL musí byť HTTPS na verejnú adresu. `secret` na overovanie podpisu doručení sa vracia **jediný raz** — v tejto odpovedi; backend si ukladá len jeho hash. Vyžaduje scope `plus:webhooks`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}}},"responses":{"201":{"description":"Webhook založený","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"description":"Neplatná URL alebo nepodporovaná udalosť","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/webhooks/{id}":{"delete":{"tags":["Webhooks"],"summary":"Zrušenie webhooku","operationId":"plusWebhookDelete","description":"Zruší webhook tohto kľúča. Nedoručené pokusy sa už nevykonajú. Vyžaduje scope `plus:webhooks`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Zrušené","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/document/send/{providerDocumentId}/status":{"get":{"tags":["Documents"],"summary":"Stav odoslaného dokladu","operationId":"plusDocumentStatus","description":"Stav dokladu odoslaného cez `POST /sapi/document/send`. Spája technický prenos na našom Access Pointe, MLS od Access Pointu príjemcu (potvrdenie alebo odmietnutie doručenia) a SK TDD hlásenie Finančnej správe. Hodnoty `status` sú z návrhu rozšírenia SAPI-SK. Vyžaduje scope `document:send`. Pre push namiesto pollingu použite webhook `transmission.status_changed`.","parameters":[{"name":"providerDocumentId","in":"path","required":true,"schema":{"type":"string"},"description":"`providerDocumentId` z odpovede `POST /sapi/document/send`."}],"responses":{"200":{"description":"Stav dokladu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Doklad neexistuje alebo nepatrí firme kľúča.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/document/validation":{"post":{"tags":["Documents"],"summary":"Validácia dokladu bez odoslania","operationId":"plusDocumentValidation","description":"Overí UBL rovnako, ako sa overuje pri odoslaní: štruktúra lokálne a plná Peppol BIS validácia (Schematron) na našom Access Pointe. Nič neodosiela ani neukladá. Vyžaduje scope `document:send`. Ak plná validácia práve nie je dostupná, odpoveď je `503` s `retryable: true` — nikdy nie čiastočné „platné“.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationRequest"}}}},"responses":{"200":{"description":"Výsledok validácie (aj pre neplatný doklad)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResult"}}}},"400":{"description":"Telo nezodpovedá schéme alebo je nad 10 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/participants/{participantId}":{"get":{"tags":["Participants"],"summary":"Je príjemca v sieti Peppol?","operationId":"plusParticipant","description":"Vyhľadá účastníka v sieti Peppol (SML → SMP) a vráti, či je registrovaný a ktoré doklady vie prijať. Výsledok sa cachuje (nájdený hodinu, nenájdený 10 minút). Neregistrovaný účastník je `200` s `registered: false`. Vyžaduje scope `document:send`.","parameters":[{"name":"participantId","in":"path","required":true,"schema":{"type":"string","examples":["0245:1234567890"]},"description":"Peppol ID v tvare `schéma:hodnota`."}],"responses":{"200":{"description":"Profil účastníka","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"400":{"description":"Nesprávny tvar `participantId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}}}}},"webhooks":{"document.received":{"post":{"tags":["Webhooks"],"summary":"Prijatý doklad bol naimportovaný","description":"Odošle sa po uložení dokladu prijatého z Peppol siete pre firmu kľúča. Doručenie je HTTP POST na registrovanú URL; telo je JSON, podpis v hlavičke `X-Postar-Signature`. Odpoveď 2xx znamená doručené; inak sa pokus opakuje s rozostupmi 1 min → 5 min → 30 min → 2 h → 12 h a potom končí ako `failed`.","parameters":[{"$ref":"#/components/parameters/XPostarEvent"},{"$ref":"#/components/parameters/XPostarDelivery"},{"$ref":"#/components/parameters/XPostarSignature"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentReceivedEvent"}}}},"responses":{"200":{"description":"Prijaté — akýkoľvek 2xx stav."}}}},"transmission.status_changed":{"post":{"tags":["Webhooks"],"summary":"Odoslaný prenos zmenil stav","description":"Odošle sa, keď odoslaný prenos prejde na `sent`, `delivered`, `failed` alebo `delivery_uncertain` — vrátane stavov preklopených z Access Pointu dodatočne (dead letter, neisté doručenie). Rovnaké pravidlá doručenia a podpisu ako pri `document.received`.","parameters":[{"$ref":"#/components/parameters/XPostarEvent"},{"$ref":"#/components/parameters/XPostarDelivery"},{"$ref":"#/components/parameters/XPostarSignature"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionStatusChangedEvent"}}}},"responses":{"200":{"description":"Prijaté — akýkoľvek 2xx stav."}}}},"invoice_response.received":{"post":{"tags":["Webhooks"],"summary":"Odberateľ poslal Invoice Response","description":"Odošle sa, keď odberateľ pošle Invoice Response (Peppol BIS Invoice Response 3.0) k dokladu, ktorý ste odoslali — napr. odmietnutie (RE), prijatie (AP) alebo úhradu (PD). Odberateľ odkazuje na faktúru jej číslom; spárovanie na váš doklad robí Poštár Cloud podľa čísla, odberateľa, dátumu vystavenia a typu dokladu. `match: ambiguous` znamená, že rovnaké číslo ste tomu istému odberateľovi poslali viackrát a odpoveď bola priradená k poslednému odoslaniu. Rovnaké pravidlá doručenia a podpisu ako pri `document.received`.","parameters":[{"$ref":"#/components/parameters/XPostarEvent"},{"$ref":"#/components/parameters/XPostarDelivery"},{"$ref":"#/components/parameters/XPostarSignature"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponseReceivedEvent"}}}},"responses":{"200":{"description":"Prijaté — akýkoľvek 2xx stav."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Access token z `POST /sapi/auth/token` (štandard SAPI-SK). Platnosť 15 minút, viazaný na IP, z ktorej bol vydaný."}},"parameters":{"XPostarEvent":{"name":"X-Postar-Event","in":"header","schema":{"type":"string","enum":["document.received","transmission.status_changed","invoice_response.received"]},"description":"Názov udalosti."},"XPostarDelivery":{"name":"X-Postar-Delivery","in":"header","schema":{"type":"string"},"description":"Identifikátor doručenia; pri opakovanom pokuse zostáva rovnaký — slúži na deduplikáciu."},"XPostarSignature":{"name":"X-Postar-Signature","in":"header","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"},"description":"`sha256=<hex>` — HMAC-SHA256 surového tela požiadavky kľúčom `secret` z registrácie. Klient podpis prepočíta a nesediace doručenie zahodí."}},"responses":{"Unauthorized":{"description":"Chýbajúci, neplatný alebo exspirovaný token; kľúč neschválený (`pending`), pozastavený alebo zrušený.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Forbidden":{"description":"IP mimo allow-listu kľúča, alebo kľúč nemá scope pre túto operáciu.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"Webhook s týmto id nepatrí kľúču.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"TooManyRequests":{"description":"Prekročený limit 60 požiadaviek za minútu na jednu IP (spoločný so štandardom).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unavailable":{"description":"Access Point alebo vyhľadanie v sieti je dočasne nedostupné (`SAPI-TEMP-002`, `retryable: true`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"schemas":{"ErrorEnvelope":{"type":"object","required":["error"],"description":"Rovnaká obálka ako v štandarde SAPI-SK (`ErrorResponseEnvelope`).","properties":{"error":{"$ref":"#/components/schemas/SAPIError"}},"examples":[{"error":{"category":"AUTH","code":"SAPI-AUTH-004","message":"Kľúč nemá oprávnenie plus:webhooks.","details":[{"field":"scope","issue":"Missing scope","value":"plus:webhooks"}],"retryable":false,"correlation_id":"550e8400-e29b-41d4-a716-446655440000"}}]},"SAPIError":{"type":"object","required":["category","code","message","retryable","correlation_id"],"properties":{"category":{"type":"string","enum":["AUTH","VALIDATION","PROCESSING","TEMPORARY","PERMANENT"]},"code":{"type":"string","description":"Stabilný kód, napr. SAPI-AUTH-004, SAPI-VAL-001. Zoznam je v implementačných poznámkach na /sapi/docs."},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"issue":{"type":"string"},"value":{"type":"string"}}}},"retryable":{"type":"boolean","description":"Opakovať len pri true, s exponenciálnym odstupom."},"correlation_id":{"type":"string","format":"uuid","description":"To isté ID je v hlavičke X-Correlation-Id."}}},"DocumentStatus":{"type":"object","required":["providerDocumentId","status","deliveryStatus","receivedAt","updatedAt"],"properties":{"providerDocumentId":{"type":"string"},"status":{"type":"string","enum":["ACCEPTED","SENT","DELIVERED","REJECTED","VALIDATION_FAILED","SEND_FAILED","DELIVERY_UNCERTAIN"],"description":"ACCEPTED = prevzaté, čaká na odovzdanie; SENT = odovzdané Access Pointu príjemcu (AS4 receipt); DELIVERED = príjemca potvrdil MLS (AP/AB); REJECTED = príjemca odmietol MLS (RE); VALIDATION_FAILED = doklad neprešiel validáciou; SEND_FAILED = doručenie zlyhalo (napr. príjemca nie je v sieti); DELIVERY_UNCERTAIN = výsledok doručenia nie je známy, automaticky sa neopakuje (riziko duplicity)."},"deliveryStatus":{"type":"string","description":"Interný technický stav prenosu (pending, sending, sent, delivered, failed, delivery_uncertain)."},"receivedAt":{"type":"string","format":"date-time"},"sentAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"failure":{"type":["object","null"],"properties":{"layer":{"type":"string","examples":["SMP_LOOKUP","REMOTE_AP_AS4","PAYLOAD_VALIDATION"]},"reason":{"type":"string"}}},"messageLevelStatus":{"type":["object","null"],"description":"MLS od Access Pointu príjemcu, ak už prišla.","properties":{"responseCode":{"type":"string","enum":["AP","AB","RE"]},"reason":{"type":["string","null"]},"receivedAt":{"type":"string","format":"date-time"}}},"taxReport":{"type":["object","null"],"description":"SK TDD hlásenie Finančnej správe k tomuto dokladu (vzniká automaticky pri vydaných faktúrach platiteľov DPH).","properties":{"status":{"type":"string"},"taxAuthorityResponseCode":{"type":["string","null"],"enum":["AP","AB","RE",null]},"reason":{"type":["string","null"]},"respondedAt":{"type":["string","null"],"format":"date-time"}}},"invoiceResponse":{"oneOf":[{"$ref":"#/components/schemas/InvoiceResponse"},{"type":"null"}],"description":"Posledná obchodná odpoveď odberateľa (Invoice Response). `status` zostáva technický stav doručenia."},"invoiceResponseHistory":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceResponse"},"description":"Všetky odpovede odberateľa chronologicky (napr. UQ → AP → PD)."}}},"InvoiceResponse":{"type":"object","properties":{"responseCode":{"type":["string","null"],"enum":["AB","IP","UQ","CA","RE","AP","PD",null],"description":"UNCL4343 subset podľa Peppol BIS Invoice Response 3.0."},"description":{"type":["string","null"],"examples":["Odmietnuté"]},"statusReasonCodes":{"type":"array","items":{"type":"string"},"description":"OPStatusReason, napr. NON, REF, LEG, REC, QUA, DEL, PRI, QTY, ITM, PAY, UNR, FIN, PPD, OTH."},"reason":{"type":["string","null"],"description":"Text odberateľa (Status/StatusReason, Description)."},"responseNumber":{"type":["string","null"],"description":"Číslo Invoice Response u odberateľa."},"responseIssueDate":{"type":["string","null"],"format":"date"},"receivedAt":{"type":"string","format":"date-time"}}},"ValidationRequest":{"type":"object","required":["payload"],"properties":{"payload":{"type":"string","description":"UBL XML v UTF-8, rovnako ako v `SendDocumentRequest.payload`. Najviac 10 MB."},"payloadFormat":{"type":"string","enum":["XML"],"default":"XML"}}},"ValidationIssue":{"type":"object","properties":{"ruleId":{"type":"string","examples":["PEPPOL-EN16931-R001","BR-CO-15"]},"message":{"type":"string"},"location":{"type":["string","null"],"description":"XPath miesta chyby, ak je známe."}}},"ValidationResult":{"type":"object","required":["valid","errors","warnings","validatedAt"],"properties":{"valid":{"type":"boolean","description":"true = doklad by prešiel validáciou pri odoslaní."},"documentType":{"type":["string","null"],"examples":["Invoice","CreditNote"]},"ruleSet":{"type":["string","null"],"description":"Sada pravidiel Peppol BIS, proti ktorej sa validovalo."},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"}},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"}},"validatedAt":{"type":"string","format":"date-time"}}},"Participant":{"type":"object","required":["participantId","registered","canReceive","documentTypes","checkedAt"],"properties":{"participantId":{"type":"string"},"registered":{"type":"boolean"},"canReceive":{"type":"object","properties":{"invoice":{"type":"boolean"},"creditNote":{"type":"boolean"},"selfBillingInvoice":{"type":"boolean"},"selfBillingCreditNote":{"type":"boolean"},"invoiceResponse":{"type":"boolean"},"messageLevelStatus":{"type":"boolean"}}},"documentTypes":{"type":"array","items":{"type":"object","properties":{"documentTypeId":{"type":"string"},"processIds":{"type":"array","items":{"type":"string"}}}}},"checkedAt":{"type":"string","format":"date-time"}}},"InboxPage":{"type":"object","required":["items","total","limit","offset"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InboxTransmission"}},"total":{"type":"integer","description":"Celkový počet položiek vyhovujúcich filtru."},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"InboxTransmission":{"type":"object","properties":{"transmission_id":{"type":"integer"},"document_id":{"type":["integer","null"],"description":"Doklad v Postar-Cloud; pri MLS alebo TDD bez vlastného dokladu `null`."},"kind":{"type":"string","enum":["invoice","credit_note","mls","invoice_response","tax_report","unknown"]},"direction":{"type":"string","enum":["in","out"]},"sender_id":{"type":["string","null"],"examples":["0245:1234567890"]},"receiver_id":{"type":["string","null"]},"document_type":{"type":["string","null"],"description":"Peppol document type identifier (skrátený na 255 znakov)."},"status":{"type":"string","enum":["pending","sending","sent","delivered","failed","delivery_uncertain"]},"sbdh_instance_identifier":{"type":["string","null"],"description":"SBDH InstanceIdentifier — ten istý, na ktorý odkazuje MLS protistrany."},"created_at":{"type":"integer","description":"Unix čas."},"updated_at":{"type":["integer","null"],"description":"Unix čas."}}},"Webhook":{"type":"object","properties":{"id":{"type":"integer"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["document.received","transmission.status_changed","invoice_response.received"]}},"active":{"type":"boolean","description":"Pozastavený alebo zrušený kľúč umlčí aj svoje webhooky."},"lastSuccessAt":{"type":["integer","null"],"description":"Unix čas posledného úspešného doručenia."},"lastFailureAt":{"type":["integer","null"]},"lastError":{"type":["string","null"],"description":"Posledná chyba doručenia, napr. HTTP stav alebo timeout."},"createdAt":{"type":"integer"}}},"WebhookList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"events":{"type":"array","items":{"type":"string"},"description":"Udalosti podporované touto verziou."}}},"WebhookCreateRequest":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","examples":["https://erp.example.sk/postar/webhook"],"description":"HTTPS na verejnú adresu."},"events":{"type":"array","minItems":1,"items":{"type":"string","enum":["document.received","transmission.status_changed","invoice_response.received"]}}}},"WebhookCreated":{"type":"object","properties":{"success":{"type":"boolean","const":true},"webhook":{"$ref":"#/components/schemas/Webhook"},"secret":{"type":"string","description":"Kľúč na overovanie `X-Postar-Signature`. Vracia sa jediný raz."}}},"DocumentReceivedEvent":{"type":"object","required":["event","occurredAt","companyId","document"],"properties":{"event":{"type":"string","const":"document.received"},"occurredAt":{"type":"integer","description":"Unix čas emisie."},"companyId":{"type":"integer"},"document":{"type":"object","properties":{"id":{"type":"integer","description":"Id dokladu; detail cez `GET /sapi/document/receive/{id}`."},"externalNumber":{"type":["string","null"],"description":"Číslo dokladu od dodávateľa."},"supplierName":{"type":["string","null"]},"amountTotal":{"type":["number","null"]},"receivedAt":{"type":["integer","null"]},"decisionDueAt":{"type":["integer","null"],"description":"Lehota na rozhodnutie o doklade (Invoice Response)."}}}}},"TransmissionStatusChangedEvent":{"type":"object","required":["event","occurredAt","companyId","transmission"],"properties":{"event":{"type":"string","const":"transmission.status_changed"},"occurredAt":{"type":"integer"},"companyId":{"type":"integer"},"transmission":{"type":"object","properties":{"id":{"type":"integer"},"documentId":{"type":["integer","null"]},"kind":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"deliveryStatus":{"type":"string","enum":["pending","sending","sent","delivered","failed","delivery_uncertain"]}}}}},"InvoiceResponseReceivedEvent":{"type":"object","required":["event","occurredAt","companyId","transmission","invoiceResponse"],"properties":{"event":{"type":"string","const":"invoice_response.received"},"occurredAt":{"type":"integer"},"companyId":{"type":"integer"},"transmission":{"type":"object","description":"Váš odoslaný doklad; `id` je `providerDocumentId` z odoslania.","properties":{"id":{"type":"integer"},"documentId":{"type":["integer","null"]},"kind":{"type":"string","enum":["invoice","credit_note"]}}},"invoiceResponse":{"type":"object","properties":{"responseCode":{"type":["string","null"],"enum":["AB","IP","UQ","CA","RE","AP","PD",null]},"description":{"type":["string","null"]},"statusReasonCodes":{"type":"array","items":{"type":"string"}},"reason":{"type":["string","null"]},"responseNumber":{"type":["string","null"]},"responseIssueDate":{"type":["string","null"]},"receivedAt":{"type":"integer","description":"Unix čas."},"documentNumber":{"type":["string","null"],"description":"Číslo faktúry, na ktoré odberateľ odkazuje."},"match":{"type":"string","enum":["matched","ambiguous"]}}}}}}}}