{"openapi":"3.0.3","info":{"title":"DACO Partner API","version":"1.3.0","description":"API for DACO customers. This version lets you fetch your net prices and the current stock for up to 500 product codes per request (`POST /prices`), verify your API key and account (`/me`) and check the service and data status (`/status`). You can also place orders (`POST /orders`, with an `Idempotency-Key` header), list them (`GET /orders`) and follow their status (`GET /orders/{orderNo}`).\n\nList your invoices and corrections (`GET /invoices`) and fetch one document with its lines (`GET /invoices/{id}`) — headers and contents only, no PDF or XML files (the original is in KSeF; `ksefNumber` gives its number). A head office sees the documents of its branches as well. Invoice data is refreshed every 5 to 10 minutes; `/invoices` answers `503` when it is older than 50 minutes.\n\n**Authentication:** `Authorization: Bearer <key>`. Keys are issued by your DACO account manager. `dk_test_…` keys are sandbox keys for testing your integration; their responses carry the header `x-daco-sandbox: 1`. Prices and stock returned for a sandbox key are the real figures of your account. An order sent with a sandbox key is fully checked but never placed (`200`, `status: validated`).\n\n**Limits:** 60 requests per minute per key (`429` with `Retry-After`); up to 500 product codes per price request; request body up to 256 KB.\n\n**Data freshness:** prices and discounts are refreshed about once a minute, stock about every 30 seconds. `dataAgeSec` is the age, in seconds, of the oldest data set used for the response (prices, discounts, stock). When the data is older than 5 minutes the API answers `503` (`UNAVAILABLE`) instead of returning outdated figures.\n\n**Errors:** always `{ \"error\": { \"code\", \"message\", \"details\"? } }`. Codes are stable; messages are in English, or in Polish when `Accept-Language` starts with `pl`."},"servers":[{"url":"https://api.daco-germany.de/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED","FORBIDDEN","CREDIT_BLOCKED","VALIDATION","NOT_FOUND","CONFLICT","RATE_LIMIT","UNAVAILABLE","INTERNAL"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}},"Account":{"type":"object","properties":{"customerCode":{"type":"string","example":"012345"},"name":{"type":"string"},"currency":{"type":"string","example":"PLN"},"sandbox":{"type":"boolean"},"profile":{"type":"string","enum":["hurt","sklep"],"description":"Customer type set by DACO: `hurt` = wholesaler, `sklep` = retail shop. The values are fixed identifiers."}}},"PriceRequest":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"maxLength":40},"description":"DACO product codes. Leading and trailing whitespace is ignored and letter case does not matter. Repeated codes are merged (the first occurrence is kept). At most 500 different codes per request.","example":["329986","BA0210","XX1"]}}},"InvoiceRef":{"type":"object","nullable":true,"required":["id","number"],"properties":{"id":{"type":"string"},"number":{"type":"string","nullable":true}},"description":"A document referenced by a correction."},"InvoiceOrder":{"type":"object","required":["orderNo","reference","erpNumber"],"properties":{"orderNo":{"type":"string","nullable":true,"description":"Order number on the DACO platform (for example `B2B-…`)."},"reference":{"type":"string","nullable":true,"description":"Your own order reference, when the order has one."},"erpNumber":{"type":"string","nullable":true,"description":"Order number in the DACO ERP."}}},"Invoice":{"type":"object","required":["id","number","type","issueDate","dueDate","currency","exchangeRate","net","vat","gross","outstanding","paymentMethod","ksefNumber","customer","isCorrection","correctionReason","correctedInvoice","originalInvoice","orders"],"properties":{"id":{"type":"string","description":"Document identifier; use it with `GET /invoices/{id}`."},"number":{"type":"string","nullable":true,"example":"D0C/26/10112/FS"},"type":{"type":"string","description":"`FS` invoice, `FSK` correction, `FE` / `FEK` export invoice and its correction; other types are possible."},"issueDate":{"type":"string","format":"date","nullable":true},"dueDate":{"type":"string","format":"date","nullable":true},"currency":{"type":"string","example":"PLN","description":"Document currency (`PLN` or `EUR`)."},"exchangeRate":{"type":"number","nullable":true,"description":"Exchange rate from the document; `null` when it has none."},"net":{"type":"number","description":"Net amount in the document currency, 2 decimal places. Negative in a correction that reduces the amount."},"vat":{"type":"number"},"gross":{"type":"number"},"outstanding":{"type":"number","description":"Amount to settle. `0` = settled; negative = an unsettled credit from a correction."},"paymentMethod":{"type":"string","nullable":true,"enum":["transfer","cash","card","cash_on_delivery","other",null]},"ksefNumber":{"type":"string","nullable":true,"description":"The document number in KSeF."},"customer":{"type":"object","required":["code","name"],"description":"Buyer. A head office sees its branches here too.","properties":{"code":{"type":"string","nullable":true,"example":"012345"},"name":{"type":"string","nullable":true}}},"isCorrection":{"type":"boolean","description":"`true` for a correction (`FSK`, `FEK` and other correction types)."},"correctionReason":{"type":"string","nullable":true,"description":"Corrections only: the reason from the document (the same text as in KSeF), in Polish or English."},"correctedInvoice":{"$ref":"#/components/schemas/InvoiceRef"},"originalInvoice":{"$ref":"#/components/schemas/InvoiceRef"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceOrder"},"description":"Orders on this document; empty for a correction."}}},"InvoiceList":{"type":"object","required":["dataAgeSec","from","to","total","limit","offset","nextOffset","items"],"properties":{"dataAgeSec":{"type":"integer","description":"The age, in seconds, of the oldest invoice data set used for the response. Never more than 3000: older data is answered with `503`."},"from":{"type":"string","format":"date","nullable":true,"description":"First issue date applied; `null` = no limit."},"to":{"type":"string","format":"date","nullable":true,"description":"Last issue date applied; `null` = no limit."},"total":{"type":"integer","description":"Number of all matching documents."},"limit":{"type":"integer"},"offset":{"type":"integer"},"nextOffset":{"type":"integer","nullable":true,"description":"`offset` of the next page; `null` on the last page."},"items":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"},"description":"Documents from the oldest, by issue date."}}},"LineState":{"type":"object","required":["qty","netPrice","netValue"],"properties":{"qty":{"type":"number"},"netPrice":{"type":"number"},"netValue":{"type":"number"}}},"LineCorrection":{"type":"object","nullable":true,"required":["before","after","difference"],"description":"Correction lines only: the line before and after the correction (value = quantity × price, 2 decimal places) and the difference (the value difference comes from the document). `null` in an invoice, and in corrections issued before this data was available.","properties":{"before":{"$ref":"#/components/schemas/LineState"},"after":{"$ref":"#/components/schemas/LineState"},"difference":{"$ref":"#/components/schemas/LineState"}}},"InvoiceItem":{"type":"object","required":["line","code","name","qty","unit","netPrice","netValue","vatRate","correction"],"properties":{"line":{"type":"integer","minimum":1},"code":{"type":"string","nullable":true},"name":{"type":"string","nullable":true,"description":"In Polish."},"qty":{"type":"number","description":"Quantity; in a correction, the change in quantity (usually negative)."},"unit":{"type":"string","nullable":true,"example":"SZT"},"netPrice":{"type":"number","description":"Net unit price (after the correction in a correction)."},"netValue":{"type":"number","description":"Net line value from the document; in a correction, the change in value (a price correction has `qty` 0)."},"vatRate":{"type":"number","nullable":true,"description":"VAT rate in percent."},"correction":{"$ref":"#/components/schemas/LineCorrection"}}},"InvoiceDetail":{"allOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"object","required":["dataAgeSec","items"],"properties":{"dataAgeSec":{"type":"integer","description":"The age, in seconds, of the oldest invoice data set used for the response. Never more than 3000."},"items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"}}}}]},"PriceItem":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"The code as sent in the request (trimmed)."},"name":{"type":"string","description":"Product name (in Polish). Absent for `NOT_FOUND`."},"netPrice":{"type":"number","description":"Your net unit price in the response `currency`, 2 decimal places. Absent when `error` is set."},"stock":{"type":"integer","minimum":0,"description":"Quantity available in the DACO warehouse. Absent for `NOT_FOUND`."},"carton":{"type":"object","required":["qty","netPrice"],"description":"Present only when a carton price applies to your account and this product.","properties":{"qty":{"type":"integer","description":"Pieces in a full carton."},"netPrice":{"type":"number","description":"Net unit price for pieces ordered in full cartons."}}},"error":{"type":"string","enum":["NOT_FOUND","NO_PRICE"],"description":"`NOT_FOUND` = unknown product code (no other fields). `NO_PRICE` = the product exists, but there is no net price for your account; `name` and `stock` are still returned. Absent when the item is priced."}}},"OrderRequest":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":500,"description":"Order lines, at most 500. Each product code may appear only once (`DUPLICATE_ITEM`).","items":{"type":"object","required":["code","qty"],"properties":{"code":{"type":"string","minLength":1,"maxLength":40,"description":"DACO product code (trimmed, case-insensitive)."},"qty":{"type":"integer","minimum":1,"maximum":100000,"description":"Quantity in pieces."}}}},"partial":{"type":"boolean","default":true,"description":"`true` (default): accept what can be delivered and reject the rest with a reason. `false`: all or nothing — any rejected line returns `409` (`ITEMS_REJECTED`) and nothing is placed."},"reference":{"type":"string","maxLength":50,"description":"Your own order number; returned in responses and stored with the order at DACO."},"note":{"type":"string","maxLength":500,"description":"A note for the order."}}},"OrderLine":{"type":"object","required":["code","qty","netPrice"],"properties":{"code":{"type":"string"},"qty":{"type":"integer"},"netPrice":{"type":"number","description":"Net unit price, 2 decimal places."},"carton":{"type":"boolean","description":"Present (`true`) when the line is full cartons at the carton price."}}},"RejectedLine":{"type":"object","required":["code","qty","reason"],"properties":{"code":{"type":"string"},"qty":{"type":"integer","description":"Rejected quantity."},"reason":{"type":"string","enum":["NOT_FOUND","NO_PRICE","STOCK"],"description":"`NOT_FOUND` = unknown code (or a brand not available on your account), `NO_PRICE` = no net price for your account, `STOCK` = not enough stock."},"available":{"type":"integer","minimum":0,"description":"Quantity in stock; present for `STOCK` and `NO_PRICE`."}}},"OrderResponse":{"type":"object","required":["orderNo","status","sandbox","reference","currency","totalNet","createdAt","accepted","rejected"],"properties":{"orderNo":{"type":"string","nullable":true,"example":"API-261028-8F2K","description":"DACO order number; `null` for a sandbox key."},"status":{"type":"string","enum":["queued","validated"],"description":"`queued` = accepted; `validated` = sandbox key, checked only."},"sandbox":{"type":"boolean"},"reference":{"type":"string","nullable":true},"currency":{"type":"string","example":"PLN"},"totalNet":{"type":"number","description":"Net value of the accepted lines."},"createdAt":{"type":"string","format":"date-time","nullable":true,"description":"ISO 8601 in UTC; `null` for a sandbox key."},"accepted":{"type":"array","items":{"$ref":"#/components/schemas/OrderLine"}},"rejected":{"type":"array","items":{"$ref":"#/components/schemas/RejectedLine"}}}},"OrderStatus":{"type":"string","enum":["queued","sent_to_erp","accepted","rejected","cancelled"],"description":"`queued` = waiting to be passed to DACO, `sent_to_erp` = passed, the DACO order is usually created within minutes, `accepted` = the order exists at DACO, `rejected` = DACO did not take the order, `cancelled` = cancelled at DACO."},"OrderSummary":{"type":"object","properties":{"orderNo":{"type":"string"},"channel":{"type":"string","enum":["api","b2b"],"description":"`api` = placed through this API, `b2b` = placed on the B2B platform."},"status":{"$ref":"#/components/schemas/OrderStatus"},"reference":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"totalNet":{"type":"number"},"lines":{"type":"integer"},"erpNumber":{"type":"string","nullable":true,"description":"Order number at DACO, once known."}}},"OrderDetail":{"type":"object","properties":{"orderNo":{"type":"string"},"channel":{"type":"string","enum":["api","b2b"]},"status":{"$ref":"#/components/schemas/OrderStatus"},"reference":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"sentAt":{"type":"string","format":"date-time","nullable":true},"currency":{"type":"string"},"totalNet":{"type":"number"},"erpNumber":{"type":"string","nullable":true},"items":{"type":"array","description":"Lines as sent to DACO.","items":{"$ref":"#/components/schemas/OrderLine"}},"erp":{"type":"object","nullable":true,"description":"The order at DACO once it exists; quantities can be lower than sent.","properties":{"number":{"type":"string","nullable":true},"state":{"type":"string","nullable":true,"enum":["open","in_progress","completed","cancelled"]},"invoiced":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderLine"}}}}}},"PricesResponse":{"type":"object","required":["currency","dataAgeSec","items"],"properties":{"currency":{"type":"string","example":"PLN","description":"Currency of every price in this response (your account currency)."},"dataAgeSec":{"type":"integer","description":"The age, in seconds, of the oldest data set used for the response (prices, discounts, stock). Never more than 300: older data is answered with `503`."},"items":{"type":"array","items":{"$ref":"#/components/schemas/PriceItem"},"description":"One entry per requested code, in the order of the request (after merging repeated codes)."}}}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/status":{"get":{"summary":"API and data health (no key required)","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"]},"apiVersion":{"type":"string"},"dataAgeSec":{"type":"integer","nullable":true,"description":"The age, in seconds, of the oldest data set used for the response (prices, discounts, stock); `null` when it is unknown."}}}}}},"503":{"description":"`status` is `degraded`: the data is older than 5 minutes or its age is unknown, so `POST /prices` would answer `503` as well"}}}},"/me":{"get":{"summary":"Check your key: account, currency, sandbox mode","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"apiVersion":{"type":"string"},"account":{"$ref":"#/components/schemas/Account"},"key":{"type":"object","properties":{"prefix":{"type":"string"},"label":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2026-10-08T17:47:05Z","description":"When the key was created: ISO 8601 in UTC."}}},"dataAgeSec":{"type":"integer","nullable":true,"description":"The age, in seconds, of the oldest data set used for the response (prices, discounts, stock); `null` when it is unknown."}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"description":"`INTERNAL`. Server error. Retry later; if it persists, contact your DACO account manager.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/prices":{"post":{"summary":"Net prices and stock for up to 500 product codes","description":"Returns one entry per requested code, in request order. A code that cannot be priced does not fail the request: its entry carries `error` (`NOT_FOUND` or `NO_PRICE`) instead of `netPrice`. All prices are net, in the account currency given in `currency`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceRequest"},"example":{"items":["329986","BA0210","XX1"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricesResponse"},"example":{"currency":"PLN","dataAgeSec":45,"items":[{"code":"329986","name":"Klocki hamulcowe","netPrice":19.74,"stock":4158,"carton":{"qty":10,"netPrice":19.15}},{"code":"BA0210","name":"Zacisk hamulcowy","stock":3,"error":"NO_PRICE"},{"code":"XX1","error":"NOT_FOUND"}]}}}},"400":{"description":"`VALIDATION`. `details.reason` tells what is wrong: `INVALID_JSON` (the body is empty or is not valid JSON), `BODY_TOO_LARGE` (the body is larger than `details.maxBytes` = 262144 bytes, that is 256 KB), `ITEMS_REQUIRED` (`items` is missing, not an array or empty), `TOO_MANY_ITEMS` (more than `details.max` = 500 different codes), `INVALID_ITEM` (the element at position `details.index`, counted from 0, is not a string, is empty or is longer than 40 characters).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"description":"`INTERNAL`. Server error. Retry later; if it persists, contact your DACO account manager.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`UNAVAILABLE`. Prices and stock cannot be served right now, for example because the data is older than 5 minutes. Retry in a few minutes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"post":{"summary":"Place an order","description":"Prices and stock are worked out exactly as in `/prices`; prices in the request are not accepted. Account status and credit limit are checked with the value of this order (limit − balance − open orders − this order, gross). Accepted pieces are reserved at once. **Idempotency:** the `Idempotency-Key` header is required; the same key with the same body returns the same order (`201`, header `idempotent-replayed: true`), with a different body `409` (`IDEMPOTENCY_KEY_REUSED`). With a sandbox key the order is checked but not placed (`200`, `status: validated`).","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"example":"4f1c0e7a-2b3d-4c5e-8f90-1a2b3c4d5e6f","schema":{"type":"string","minLength":8,"maxLength":100,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Unique per order, ideally a UUID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"},"example":{"reference":"PO-2026-1028","note":"Delivery to branch 2","partial":true,"items":[{"code":"329986","qty":25},{"code":"BA0210","qty":3},{"code":"XX1","qty":1}]}}}},"responses":{"200":{"description":"Sandbox key: the order was checked, not placed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"},"example":{"orderNo":null,"status":"validated","sandbox":true,"reference":"PO-2026-1028","currency":"PLN","totalNet":548.36,"createdAt":null,"accepted":[{"code":"329986","qty":20,"netPrice":19.15,"carton":true},{"code":"329986","qty":5,"netPrice":19.74},{"code":"BA0210","qty":1,"netPrice":66.66}],"rejected":[{"code":"BA0210","qty":2,"reason":"STOCK","available":1},{"code":"XX1","qty":1,"reason":"NOT_FOUND"}]}}}},"201":{"description":"Order accepted","headers":{"Location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"},"example":{"orderNo":"API-261028-8F2K","status":"queued","sandbox":false,"reference":"PO-2026-1028","currency":"PLN","totalNet":548.36,"createdAt":"2026-10-28T09:41:07Z","accepted":[{"code":"329986","qty":20,"netPrice":19.15,"carton":true},{"code":"329986","qty":5,"netPrice":19.74},{"code":"BA0210","qty":1,"netPrice":66.66}],"rejected":[{"code":"BA0210","qty":2,"reason":"STOCK","available":1},{"code":"XX1","qty":1,"reason":"NOT_FOUND"}]}}}},"400":{"description":"`VALIDATION`. `details.reason`: `INVALID_JSON`, `BODY_TOO_LARGE`, `ITEMS_REQUIRED`, `TOO_MANY_ITEMS` (`details.max`), `INVALID_ITEM` / `DUPLICATE_ITEM` (`details.index`), `INVALID_FIELD` (`details.field`), `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"description":"`FORBIDDEN` (account not available) or `CREDIT_BLOCKED`: order dispatch is on hold — `details.reason` `BLOCKED` (account blocked or invoices overdue) or `CREDIT_LIMIT` (`details.available`, `details.orderGross`, `details.currency`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`CONFLICT`. `details.reason`: `IDEMPOTENCY_KEY_REUSED`, `ITEMS_REJECTED` (with `partial: false`; `details.rejected`) or `NO_ACCEPTED_ITEMS` (`details.rejected`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/Error"},"500":{"description":"`INTERNAL`. Server error. Retry later; if it persists, contact your DACO account manager.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`UNAVAILABLE`. The data is older than 5 minutes, or the account status cannot be checked. Retry with the same `Idempotency-Key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List your orders (API and B2B platform), newest first","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Orders created on or after this date (YYYY-MM-DD). Default: 30 days back; at most 180 days back."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/OrderSummary"}}}},"example":{"currency":"PLN","orders":[{"orderNo":"API-261028-8F2K","channel":"api","status":"accepted","reference":"PO-2026-1028","createdAt":"2026-10-28T09:41:07Z","totalNet":548.36,"lines":3,"erpNumber":"D0C/26/62817/TK"},{"orderNo":"B2B-261027-41C0","channel":"b2b","status":"queued","reference":null,"createdAt":"2026-10-27T15:02:44Z","totalNet":98.7,"lines":1,"erpNumber":null}]}}}},"400":{"description":"`VALIDATION`, `details.reason` = `INVALID_PARAM`, `details.param` = `from` or `limit`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"description":"`INTERNAL`. Server error. Retry later; if it persists, contact your DACO account manager.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{orderNo}":{"get":{"summary":"Status and lines of one order","parameters":[{"name":"orderNo","in":"path","required":true,"schema":{"type":"string"},"example":"API-261028-8F2K"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDetail"},"example":{"orderNo":"API-261028-8F2K","channel":"api","status":"accepted","reference":"PO-2026-1028","createdAt":"2026-10-28T09:41:07Z","sentAt":"2026-10-28T09:41:22Z","currency":"PLN","totalNet":548.36,"erpNumber":"D0C/26/62817/TK","items":[{"code":"329986","qty":20,"netPrice":19.15},{"code":"329986","qty":5,"netPrice":19.74},{"code":"BA0210","qty":1,"netPrice":66.66}],"erp":{"number":"D0C/26/62817/TK","state":"in_progress","invoiced":false,"items":[{"code":"329986","qty":20,"netPrice":19.15},{"code":"329986","qty":5,"netPrice":19.74},{"code":"BA0210","qty":1,"netPrice":66.66}]}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"description":"`NOT_FOUND`. No such order on your account (an order of another account is answered the same way).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/Error"},"500":{"description":"`INTERNAL`. Server error. Retry later; if it persists, contact your DACO account manager.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices":{"get":{"summary":"Invoices and corrections of your account (headers)","description":"Without `from` and `to`: the last 90 days; with `open=true` or `number`: the whole history available (the last 2 years plus older documents with an amount to settle). A range is at most 366 days. Sorted from the oldest by issue date. No files: the API returns no PDF or XML.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First issue date, inclusive."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last issue date, inclusive. Defaults to today."},{"name":"open","in":"query","required":false,"schema":{"type":"boolean"},"description":"`true`: only documents with an amount to settle; `false`: only settled ones."},{"name":"type","in":"query","required":false,"schema":{"type":"string","example":"FS,FSK"},"description":"Document types, comma-separated (at most 10)."},{"name":"correction","in":"query","required":false,"schema":{"type":"boolean"},"description":"`true`: corrections only; `false`: invoices only, without corrections."},{"name":"number","in":"query","required":false,"schema":{"type":"string","example":"D0C/26/10112/FS"},"description":"The exact document number (letter case does not matter)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"description":"Page size."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Documents to skip; use `nextOffset`."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceList"},"example":{"dataAgeSec":240,"from":"2026-07-31","to":"2026-10-28","total":2,"limit":100,"offset":0,"nextOffset":null,"items":[{"id":"2610181214510438538E69B0CF25","number":"D0C/26/10112/FS","type":"FS","issueDate":"2026-10-18","dueDate":"2026-11-17","currency":"PLN","exchangeRate":null,"net":1000,"vat":230,"gross":1230,"outstanding":1230,"paymentMethod":"transfer","ksefNumber":"1234567890-20261018-0123456789AB-CD","customer":{"code":"012345","name":"Przykładowa Hurtownia Sp. z o.o."},"isCorrection":false,"correctionReason":null,"correctedInvoice":null,"originalInvoice":null,"orders":[{"orderNo":"B2B-261017-1F4E","reference":"ZAM-KLIENTA-123","erpNumber":"70078"}]},{"id":"2610271206006432264970000001","number":"D0C/26/02565/FSK","type":"FSK","issueDate":"2026-10-27","dueDate":"2026-11-26","currency":"PLN","exchangeRate":null,"net":-105.2,"vat":-24.2,"gross":-129.4,"outstanding":-129.4,"paymentMethod":"transfer","ksefNumber":"1234567890-20261027-0123456789EF-01","customer":{"code":"012345","name":"Przykładowa Hurtownia Sp. z o.o."},"isCorrection":true,"correctionReason":"Zwrot towaru","correctedInvoice":{"id":"2610181214510438538E69B0CF25","number":"D0C/26/10112/FS"},"originalInvoice":{"id":"2610181214510438538E69B0CF25","number":"D0C/26/10112/FS"},"orders":[]}]}}}},"400":{"description":"`VALIDATION`. `details.reason`: `INVALID_PARAM` (`details.param` is malformed), `RANGE_INVALID` (`from` is after `to`), `RANGE_TOO_LONG` (longer than `details.maxDays` = 366 days), `FROM_TOO_OLD` (earlier than `details.minFrom`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"description":"`INTERNAL`. Server error. Retry later; if it persists, contact your DACO account manager.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`UNAVAILABLE`. The invoice data is older than 50 minutes or its age is unknown. Retry in a few minutes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{id}":{"get":{"summary":"One invoice or correction with its lines","description":"`id` comes from `GET /invoices`. A document of another account answers `404`, exactly like a missing one.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9]{1,64}$","example":"2610181214510438538E69B0CF25"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"},"examples":{"invoice":{"value":{"dataAgeSec":240,"id":"2610181214510438538E69B0CF25","number":"D0C/26/10112/FS","type":"FS","issueDate":"2026-10-18","dueDate":"2026-11-17","currency":"PLN","exchangeRate":null,"net":1000,"vat":230,"gross":1230,"outstanding":1230,"paymentMethod":"transfer","ksefNumber":"1234567890-20261018-0123456789AB-CD","customer":{"code":"012345","name":"Przykładowa Hurtownia Sp. z o.o."},"isCorrection":false,"correctionReason":null,"correctedInvoice":null,"originalInvoice":null,"orders":[{"orderNo":"B2B-261017-1F4E","reference":"ZAM-KLIENTA-123","erpNumber":"70078"}],"items":[{"line":1,"code":"329986","name":"Klocki hamulcowe","qty":40,"unit":"SZT","netPrice":19.74,"netValue":789.6,"vatRate":23,"correction":null},{"line":2,"code":"BA0210","name":"Zacisk hamulcowy","qty":2,"unit":"SZT","netPrice":105.2,"netValue":210.4,"vatRate":23,"correction":null}]}},"correction":{"value":{"dataAgeSec":240,"id":"2610271206006432264970000001","number":"D0C/26/02565/FSK","type":"FSK","issueDate":"2026-10-27","dueDate":"2026-11-26","currency":"PLN","exchangeRate":null,"net":-105.2,"vat":-24.2,"gross":-129.4,"outstanding":-129.4,"paymentMethod":"transfer","ksefNumber":"1234567890-20261027-0123456789EF-01","customer":{"code":"012345","name":"Przykładowa Hurtownia Sp. z o.o."},"isCorrection":true,"correctionReason":"Zwrot towaru","correctedInvoice":{"id":"2610181214510438538E69B0CF25","number":"D0C/26/10112/FS"},"originalInvoice":{"id":"2610181214510438538E69B0CF25","number":"D0C/26/10112/FS"},"orders":[],"items":[{"line":1,"code":"BA0210","name":"Zacisk hamulcowy","qty":-1,"unit":"SZT","netPrice":105.2,"netValue":-105.2,"vatRate":23,"correction":{"before":{"qty":2,"netPrice":105.2,"netValue":210.4},"after":{"qty":1,"netPrice":105.2,"netValue":105.2},"difference":{"qty":-1,"netPrice":0,"netValue":-105.2}}}]}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"description":"`NOT_FOUND`. There is no such document, or it belongs to another account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/Error"},"500":{"description":"`INTERNAL`. Server error. Retry later; if it persists, contact your DACO account manager.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`UNAVAILABLE`. The invoice data is older than 50 minutes or its age is unknown. Retry in a few minutes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}