{"openapi":"3.1.0","info":{"title":"PeppolKit REST API","version":"1.0.0","summary":"Send paid orders, get correct invoices, delivered over Peppol.","description":"Send every paid order to PeppolKit; it makes the invoice, mails it to the customer and sends it over Peppol to business customers. JSON in and out, over https, with your key in the Authorization header. A test key (pk_test_…) works on the same addresses with the same checks in a test environment of its own: nothing is mailed, nothing goes over Peppol and nothing counts for your plan. Guide: https://peppolkit.com/en/connect-api/","contact":{"name":"PeppolKit support","email":"support@peppolkit.com","url":"https://peppolkit.com/en/contact/"},"termsOfService":"https://peppolkit.com/en/terms/"},"servers":[{"url":"https://app.peppolkit.com/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Orders","description":"Orders, invoices in JSON and refunds: each becomes an invoice or a credit note."},{"name":"Invoices","description":"The documents PeppolKit made, their PDF, and sending them again."},{"name":"Documents","description":"UBL invoices and credit notes from your own software, checked and sent over Peppol unchanged."},{"name":"Settings","description":"Company details, plan and usage."},{"name":"Lookups","description":"Is a company on Peppol, is a VAT number valid: public, read-only checks, also with a test key."},{"name":"Received","description":"Invoices your suppliers sent you over Peppol (Belgian shops on SUPER PDP)."},{"name":"Webhooks","description":"Where PeppolKit reports events, and the events themselves."},{"name":"Connection","description":"For plugins: connecting a shop, signing in to the dashboard, disconnecting."}],"paths":{"/orders":{"post":{"operationId":"createOrder","tags":["Orders"],"summary":"Send a paid order","description":"Makes the invoice for a paid order, mails it to the customer and sends it over Peppol when the customer has a Peppol address. Idempotent per order id: the same id again returns the existing invoice with status \"exists\".","x-test-key":true,"parameters":[{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["nl","fr","en","de"],"default":"nl"},"description":"Language of the warnings."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"example":{"id":1001,"name":"#1001","currency":"EUR","taxes_included":true,"created_at":"2026-11-18T10:00:00+01:00","email":"inkoop@example.com","billing_address":{"name":"An Peeters","company":"Testbedrijf BV","address1":"Kerkstraat 1","zip":"9000","city":"Gent","country_code":"BE"},"line_items":[{"id":1,"title":"Kettingset 11-speed","sku":"KS-11","quantity":1,"price":"121.00","tax_lines":[{"rate":0.21,"price":"21.00"}]}],"shipping_lines":[],"note_attributes":[{"name":"VAT number","value":"BE0000000097"}],"total_price":"121.00"}}}},"responses":{"200":{"description":"The invoice was made (issued) or already existed (exists).","content":{"application/json":{"schema":{"type":"object","required":["ok","status","warnings","invoice"],"properties":{"ok":{"const":true},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"status":{"type":"string","enum":["issued","exists"]},"warnings":{"type":"array","items":{"type":"string"}},"invoice":{"oneOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"null"}]}}},"example":{"ok":true,"test":true,"status":"issued","warnings":[],"invoice":{"number":"TEST-2026-00001","type":"invoice","orderId":"1001","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":"pending","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true}}}}},"400":{"description":"The body is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Body must be JSON"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"402":{"description":"The plan's monthly limit is reached; the order waits.","content":{"application/json":{"schema":{"type":"object","required":["ok","waiting","error"],"properties":{"ok":{"const":false},"waiting":{"const":true},"error":{"type":"string"}}},"example":{"ok":false,"waiting":true,"error":"Monthly limit of 20 invoices reached. The order waits and gets its invoice after an upgrade or at the start of next month."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"409":{"description":"Company details are missing. A live order waits; a test order does not.","content":{"application/json":{"schema":{"type":"object","required":["ok","waiting","error"],"properties":{"ok":{"const":false},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"waiting":{"type":"boolean"},"error":{"type":"string"}}},"example":{"ok":false,"waiting":true,"error":"Save your company details first. The order waits and gets its invoice as soon as they are saved."}}}},"422":{"description":"The order is not valid.","content":{"application/json":{"schema":{"type":"object","required":["ok","error","issues"],"properties":{"ok":{"const":false},"error":{"type":"string"},"issues":{"type":"array","items":{"type":"object"},"description":"Per field what is wrong (path, message)."}}},"example":{"ok":false,"error":"Invalid order","issues":[{"expected":"number","code":"invalid_type","path":["id"],"message":"Invalid input: expected number, received string"}]}}}}}}},"/refunds":{"post":{"operationId":"createRefund","tags":["Orders"],"summary":"Send a refund","description":"Makes a credit note against the order's invoice. Idempotent per refund id. orderTotal (optional) is the order's total as your shop charged it, used to scale the credit when the invoice total differs (reverse charge).","x-test-key":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["refund"],"properties":{"refund":{"$ref":"#/components/schemas/Refund"},"orderTotal":{"type":"number"}}},"example":{"refund":{"id":7001,"order_id":1001,"created_at":"2026-11-20T14:00:00+01:00","refund_line_items":[{"line_item_id":1,"quantity":1}],"transactions":[{"kind":"refund","status":"success","amount":"121.00"}]}}}}},"responses":{"200":{"description":"The credit note was made, or already existed.","content":{"application/json":{"schema":{"type":"object","required":["ok","status","creditNote"],"properties":{"ok":{"const":true},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"status":{"type":"string","enum":["issued","exists","no_settings","nothing_refunded"]},"creditNote":{"oneOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"null"}]}}},"example":{"ok":true,"test":true,"status":"issued","creditNote":{"number":"TEST-2026-00002","type":"credit_note","orderId":"1001/refund/7001","issueDate":"2026-11-20","total":121,"currency":"EUR","peppolStatus":"pending","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true}}}}},"400":{"description":"The body is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Body must be JSON"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"There is no invoice for this order.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"No invoice for this order"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"422":{"description":"The refund is not valid.","content":{"application/json":{"schema":{"type":"object","required":["ok","error","issues"],"properties":{"ok":{"const":false},"error":{"type":"string"},"issues":{"type":"array","items":{"type":"object"},"description":"Per field what is wrong (path, message)."}}},"example":{"ok":false,"error":"Invalid refund","issues":[{"expected":"number","code":"invalid_type","path":["id"],"message":"Invalid input: expected number, received string"}]}}}}}}},"/invoices":{"get":{"operationId":"listInvoices","tags":["Invoices"],"summary":"List invoices","description":"Invoices and credit notes, newest first. With orderId: every document of that order (its invoice and credit notes), unpaged. Otherwise one page (50 by default, at most 100) filtered by issue date, type, customer, Peppol and e-mail state, attention or a search; total and pageCount say how many match. A wrong filter value answers 400 and names the parameter.","x-test-key":true,"parameters":[{"name":"orderId","in":"query","required":false,"schema":{"type":"string"},"description":"The order id (or invoice reference) you sent.","example":"1001"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Earliest issue date (inclusive).","example":"2026-11-01"},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Latest issue date (inclusive).","example":"2026-11-30"},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["invoice","credit_note"]}},{"name":"customer","in":"query","required":false,"schema":{"type":"string","enum":["business","consumer"]},"description":"business: the buyer has a VAT number."},{"name":"peppol","in":"query","required":false,"schema":{"type":"string","enum":["pending","sent","delivered","failed","not_on_peppol","none"]},"description":"none: no Peppol delivery applies."},{"name":"email","in":"query","required":false,"schema":{"type":"string","enum":["sent","failed","none"]}},{"name":"payment","in":"query","required":false,"description":"open: invoices not paid yet (created with paid false and not marked paid since); overdue: those past their due date.","schema":{"type":"string","enum":["open","overdue"]}},{"name":"attention","in":"query","required":false,"schema":{"type":"boolean"},"description":"Only documents that need attention (warning, failed rule check, failed mail or Peppol delivery)."},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Search in number, order, customer name, e-mail address and VAT number.","example":"Peeters"},{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["nl","fr","en","de"],"default":"nl"},"description":"Language of the warnings."}],"responses":{"200":{"description":"The documents.","content":{"application/json":{"schema":{"type":"object","required":["invoices"],"properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"page":{"type":"integer","description":"Not with orderId."},"limit":{"type":"integer"},"total":{"type":"integer","description":"Documents matching the filters."},"pageCount":{"type":"integer"},"hasMore":{"type":"boolean","description":"There is a next page."}}},"example":{"invoices":[{"number":"TEST-2026-00001","type":"invoice","orderId":"1001","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":"pending","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true}],"page":1,"limit":50,"total":1,"pageCount":1,"hasMore":false}}}},"400":{"description":"A filter has a wrong value (named in the error).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invalid peppol: expected pending, sent, delivered, failed, not_on_peppol, none"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}}}},"post":{"operationId":"createInvoice","tags":["Orders"],"summary":"Send an invoice in JSON","description":"For software that bills on its own (a booking system, a SaaS, an ERP) rather than through a webshop order: your reference, the buyer, lines with VAT rates, optional shipping, paid or with a due date. PeppolKit numbers it, applies the VAT rules, checks it against EN 16931 and Peppol BIS, mails it and sends it over Peppol when the buyer is on it, exactly as for an order. An unpaid invoice gets a due date (default 30 days), your IBAN with the invoice number as payment reference, and the payment QR on the PDF. Idempotent per reference.","x-test-key":true,"parameters":[{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["nl","fr","en","de"],"default":"nl"},"description":"Language of the warnings."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceInput"},"example":{"reference":"SUB-2026-11-0042","buyer":{"company":"Afnemer NV","vatNumber":"BE0202239951","email":"facturen@afnemer.be","address":{"line1":"Markt 1","postcode":"9000","city":"Gent","country":"BE"}},"lines":[{"description":"Abonnement november","quantity":1,"unitPrice":49,"vatRate":21},{"description":"Extra gebruikers","quantity":3,"unitPrice":"5.00","vatRate":21}]}}}},"responses":{"200":{"description":"The invoice was made (issued) or already existed for this reference (exists).","content":{"application/json":{"schema":{"type":"object","required":["ok","status","warnings","invoice"],"properties":{"ok":{"const":true},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"status":{"type":"string","enum":["issued","exists"]},"warnings":{"type":"array","items":{"type":"string"}},"invoice":{"oneOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"null"}]}}},"example":{"ok":true,"test":true,"status":"issued","warnings":[],"invoice":{"number":"TEST-2026-00001","type":"invoice","orderId":"SUB-2026-11-0042","issueDate":"2026-11-18","total":77.44,"currency":"EUR","peppolStatus":"pending","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true}}}}},"400":{"description":"The body is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Body must be JSON"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"402":{"description":"The plan's monthly limit is reached; the invoice waits.","content":{"application/json":{"schema":{"type":"object","required":["ok","waiting","error"],"properties":{"ok":{"const":false},"waiting":{"const":true},"error":{"type":"string"}}},"example":{"ok":false,"waiting":true,"error":"Monthly limit of 20 invoices reached. The order waits and gets its invoice after an upgrade or at the start of next month."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"409":{"description":"Company details are missing. A live invoice waits; a test one does not.","content":{"application/json":{"schema":{"type":"object","required":["ok","waiting","error"],"properties":{"ok":{"const":false},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"waiting":{"type":"boolean"},"error":{"type":"string"}}},"example":{"ok":false,"waiting":true,"error":"Save your company details first. The order waits and gets its invoice as soon as they are saved."}}}},"422":{"description":"The invoice is not valid; issues name each field.","content":{"application/json":{"schema":{"type":"object","required":["ok","error","issues"],"properties":{"ok":{"const":false},"error":{"type":"string"},"issues":{"type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}},"example":{"ok":false,"error":"Invalid invoice","issues":[{"path":"lines.0.unitPrice","message":"expected a non-negative amount with at most 2 decimals"}]}}}}}}},"/invoices/{number}":{"get":{"operationId":"getInvoice","tags":["Invoices"],"summary":"Get one invoice with its status","description":"One invoice or credit note by its number: the fields of GET /invoices plus buyer, amounts, the EN 16931 / Peppol BIS rule check, the e-mail and the Peppol delivery (status, time, error) and attentionReasons, the same rules as the dashboard's \"needs attention\". A test key sees test documents only.","x-test-key":true,"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice or credit note number, as in GET /invoices.","example":"TEST-2026-00001"},{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["nl","fr","en","de"],"default":"nl"},"description":"Language of the warnings."}],"responses":{"200":{"description":"The document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"},"example":{"number":"TEST-2026-00001","type":"invoice","orderId":"1001","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":"delivered","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true,"orderName":"#1001","buyerName":"Testbedrijf BV","buyerVatNumber":"BE0000000097","buyerCountry":"BE","business":true,"net":100,"vat":21,"needsAttention":false,"attentionReasons":[],"validation":{"checked":true,"valid":true,"issues":[]},"delivery":{"email":{"to":null,"sentAt":null,"error":null,"viaShopMail":null},"peppol":{"status":"delivered","sentAt":"2026-11-18T10:00:05.000Z","error":null}}}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this number in this shop.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invoice not found"}}}}}}},"/invoices/{number}/pdf":{"get":{"operationId":"getInvoicePdf","tags":["Invoices"],"summary":"Download the PDF","description":"The PDF of one invoice or credit note, the same file as the signed pdfUrl. With ?mail=1 a plugin says it attaches the PDF to the shop's own order mail now (409 if PeppolKit already mailed the customer); ?mail=again is a resend the merchant asked for.","x-test-key":true,"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice or credit note number, as in GET /invoices.","example":"TEST-2026-00001"},{"name":"mail","in":"query","required":false,"schema":{"type":"string","enum":["1","again"]}}],"responses":{"200":{"description":"The PDF.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"TEST-2026-00001.pdf\""}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invoice not found"}}}},"409":{"description":"?mail=1, and PeppolKit already mailed the customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Already mailed by PeppolKit"}}}}}}},"/invoices/{number}/email":{"post":{"operationId":"emailInvoice","tags":["Invoices"],"summary":"Mail the invoice again","description":"Mails the document to the customer again. Test documents are never mailed: the answer says so.","x-test-key":true,"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice or credit note number, as in GET /invoices.","example":"TEST-2026-00001"}],"responses":{"200":{"description":"Mailed (or, for a test document, not).","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"emailed":{"type":"boolean"},"note":{"type":"string"},"error":{"type":"string"},"noAddress":{"type":"boolean"}}},"example":{"ok":true,"test":true,"emailed":false,"note":"Test documents are never mailed to customers."}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invoice not found"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"502":{"description":"The mail could not be sent.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"noAddress":{"type":"boolean"}}},"example":{"ok":false,"error":"Geen e-mailadres bij deze bestelling","noAddress":true}}}}}}},"/invoices/{number}/paid":{"post":{"operationId":"markInvoicePaid","tags":["Invoices"],"summary":"Mark an invoice paid","description":"For an invoice created with paid false: marks it paid today. Automatic payment reminders (Starter and up, switched on in the dashboard settings) stop for it.","x-test-key":true,"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice or credit note number, as in GET /invoices.","example":"TEST-2026-00001"}],"responses":{"200":{"description":"Marked paid.","content":{"application/json":{"schema":{"type":"object","required":["ok","number","paid","paidAt"],"properties":{"ok":{"type":"boolean"},"number":{"type":"string"},"paid":{"type":"boolean"},"paidAt":{"type":["string","null"],"format":"date-time"}}},"example":{"ok":true,"number":"2026-00042","paid":true,"paidAt":"2026-11-24T10:00:00.000Z"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invoice not found"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"409":{"description":"Nothing to mark.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"This document was paid when it was made, or is a credit note: there is nothing to mark."}}}}}}},"/invoices/{number}/unpaid":{"post":{"operationId":"markInvoiceUnpaid","tags":["Invoices"],"summary":"Mark an invoice open again","description":"Undoes /paid: the invoice is open again and, when it is past its due date, gets the remaining automatic reminders.","x-test-key":true,"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice or credit note number, as in GET /invoices.","example":"TEST-2026-00001"}],"responses":{"200":{"description":"Open again.","content":{"application/json":{"schema":{"type":"object","required":["ok","number","paid","paidAt"],"properties":{"ok":{"type":"boolean"},"number":{"type":"string"},"paid":{"type":"boolean"},"paidAt":{"type":["string","null"],"format":"date-time"}}},"example":{"ok":true,"number":"2026-00042","paid":false,"paidAt":null}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invoice not found"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"409":{"description":"Nothing to mark.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"This document was paid when it was made, or is a credit note: there is nothing to mark."}}}}}}},"/invoices/{number}/peppol":{"post":{"operationId":"sendInvoicePeppol","tags":["Invoices"],"summary":"Send over Peppol again","description":"(Re)sends the document over Peppol. With a test key the delivery is simulated.","x-test-key":true,"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice or credit note number, as in GET /invoices.","example":"TEST-2026-00001"}],"responses":{"200":{"description":"What happened; ok is true when it was sent.","content":{"application/json":{"schema":{"type":"object","required":["ok","status","invoice"],"properties":{"ok":{"type":"boolean"},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"status":{"type":"string","enum":["sent","pending","failed","skipped","not_on_peppol"]},"error":{"type":"string"},"invoice":{"oneOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"null"}]}}},"example":{"ok":true,"test":true,"status":"sent","invoice":{"number":"TEST-2026-00001","type":"invoice","orderId":"1001","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":"sent","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true}}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invoice not found"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}}}}},"/stats":{"get":{"operationId":"getStats","tags":["Invoices"],"summary":"Invoice statistics","description":"Counts and amounts for a period by issue date: invoices and credit notes, business and consumer, totals and VAT per currency, Peppol and e-mail states, documents that need attention and documents received, with a row per month. Without dates: this month so far. At most 3 years in one call. For a dashboard of your own, or an agency with one key per shop.","x-test-key":true,"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Default the first day of this month.","example":"2026-01-01"},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Default today.","example":"2026-12-31"}],"responses":{"200":{"description":"The numbers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"},"example":{"from":"2026-11-01","to":"2026-11-18","invoices":42,"creditNotes":2,"business":9,"consumer":33,"attention":1,"totals":[{"currency":"EUR","invoiced":6230.5,"credited":121,"net":6109.5,"vat":1060.29}],"peppol":{"pending":0,"sent":1,"delivered":8,"failed":0,"notOnPeppol":1},"email":{"sent":40,"failed":1},"received":3,"months":[{"month":"2026-11","invoices":42,"creditNotes":2,"totals":[{"currency":"EUR","net":6109.5,"vat":1060.29}]}]}}}},"400":{"description":"from or to is not a date YYYY-MM-DD, from is after to, or the period is longer than 3 years.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"from must be a date YYYY-MM-DD."}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}}}}},"/documents":{"get":{"operationId":"listDocuments","tags":["Documents"],"summary":"List your own documents","description":"The UBL documents you sent through POST /documents, newest first, 50 a page.","x-test-key":true,"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"One page.","content":{"application/json":{"schema":{"type":"object","required":["documents","page","pageCount","total","hasMore"],"properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"page":{"type":"integer"},"pageCount":{"type":"integer"},"total":{"type":"integer"},"hasMore":{"type":"boolean"},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."}}},"example":{"documents":[{"id":"cmx1u9p2k0003abcd5678wxyz","type":"invoice","number":"F-2026-0042","issueDate":"2026-11-18","currency":"EUR","total":121,"buyerName":"Afnemer NV","receiver":"0208:0202239951","status":"delivered","error":null,"sentAt":"2026-11-18T10:00:00.000Z","createdAt":"2026-11-18T10:00:00.000Z","test":true}],"page":1,"pageCount":1,"total":1,"hasMore":false,"test":true}}}},"400":{"description":"page is not a whole number from 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"page must be a whole number from 1."}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}}}},"post":{"operationId":"sendDocument","tags":["Documents"],"summary":"Send your own UBL over Peppol","description":"A Peppol BIS Billing 3.0 UBL invoice or credit note made in your own software, as the request body (Content-Type: application/xml) or as JSON {\"xml\": \"<Invoice …>\"}, at most 2 MB. PeppolKit checks that the supplier is your company (Peppol address and VAT number), that the EN 16931 and Peppol BIS rules pass and that the buyer has a Peppol address, then sends the document unchanged through your access point (SUPER PDP or your Peppyrus account). PeppolKit does not number it, make a PDF or mail it. An invoice counts toward your plan's monthly number. Idempotent per type and number. When it cannot be sent at all (no access point, Peppol off) nothing is stored: fix that and send again. Delivery states follow in GET /documents/{id}. With a test key the checks are the same and the delivery is simulated at once (the buyer 0208:0000000196 rejects).","x-test-key":true,"requestBody":{"required":true,"content":{"application/xml":{"schema":{"type":"string","description":"The UBL document."}},"application/json":{"schema":{"type":"object","required":["xml"],"properties":{"xml":{"type":"string","description":"The UBL document."}}}}}},"responses":{"200":{"description":"A document with this type and number was sent before; nothing new is sent.","content":{"application/json":{"schema":{"type":"object","required":["ok","status","document"],"properties":{"ok":{"const":true},"status":{"const":"exists"},"document":{"$ref":"#/components/schemas/Document"}}},"example":{"ok":true,"status":"exists","document":{"id":"cmx1u9p2k0003abcd5678wxyz","type":"invoice","number":"F-2026-0042","issueDate":"2026-11-18","currency":"EUR","total":121,"buyerName":"Afnemer NV","receiver":"0208:0202239951","status":"delivered","error":null,"sentAt":"2026-11-18T10:00:00.000Z","createdAt":"2026-11-18T10:00:00.000Z","test":true}}}}},"201":{"description":"Checked and handed to the Peppol network (ok false when the access point refused it; the reason is in document.error).","content":{"application/json":{"schema":{"type":"object","required":["ok","status","document"],"properties":{"ok":{"type":"boolean"},"status":{"type":"string","enum":["sent","delivered","failed","not_on_peppol"]},"document":{"$ref":"#/components/schemas/Document"}}},"example":{"ok":true,"status":"delivered","document":{"id":"cmx1u9p2k0003abcd5678wxyz","type":"invoice","number":"F-2026-0042","issueDate":"2026-11-18","currency":"EUR","total":121,"buyerName":"Afnemer NV","receiver":"0208:0202239951","status":"delivered","error":null,"sentAt":"2026-11-18T10:00:00.000Z","createdAt":"2026-11-18T10:00:00.000Z","test":true}}}}},"400":{"description":"No body, or JSON without xml.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Send the UBL document as the request body (Content-Type: application/xml)."}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"402":{"description":"The plan's monthly number is reached.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"Monthly limit of 20 invoices reached. Upgrade, or send again next month."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"409":{"description":"Company details missing, Peppol off or no access point connected; nothing was sent.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"Peppol sending is off in your settings; nothing was sent."}}}},"413":{"description":"Larger than 2 MB.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"The document is larger than 2 MB."}}}},"422":{"description":"Not a Peppol BIS UBL, the supplier is not your company, the buyer has no Peppol address, or the rules fail. Nothing was sent.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"issues":{"type":"array","items":{"type":"object","required":["id","text","ruleset"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"ruleset":{"type":"string"}}},"description":"The failed EN 16931 / Peppol BIS rules."}}},"example":{"ok":false,"error":"The document fails the EN 16931 or Peppol BIS rules; nothing was sent.","issues":[{"id":"BR-CO-15","ruleset":"EN16931","text":"Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110)."}]}}}}}}},"/documents/{id}":{"get":{"operationId":"getDocument","tags":["Documents"],"summary":"Get one of your documents","description":"One document from POST /documents with its current Peppol state.","x-test-key":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id from POST or GET /documents.","example":"cmx1u9p2k0003abcd5678wxyz"}],"responses":{"200":{"description":"The document.","content":{"application/json":{"schema":{"type":"object","required":["document"],"properties":{"document":{"$ref":"#/components/schemas/Document"}}},"example":{"document":{"id":"cmx1u9p2k0003abcd5678wxyz","type":"invoice","number":"F-2026-0042","issueDate":"2026-11-18","currency":"EUR","total":121,"buyerName":"Afnemer NV","receiver":"0208:0202239951","status":"delivered","error":null,"sentAt":"2026-11-18T10:00:00.000Z","createdAt":"2026-11-18T10:00:00.000Z","test":true}}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this id in this shop.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Document not found"}}}}}}},"/documents/{id}/xml":{"get":{"operationId":"getDocumentXml","tags":["Documents"],"summary":"Download the UBL","description":"The document exactly as it was sent.","x-test-key":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id from POST or GET /documents.","example":"cmx1u9p2k0003abcd5678wxyz"}],"responses":{"200":{"description":"The UBL.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"F-2026-0042.xml\""}},"content":{"application/xml":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No document with this id in this shop.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Document not found"}}}}}}},"/peppol/lookup":{"get":{"operationId":"lookupPeppol","tags":["Lookups"],"summary":"Is a company on Peppol?","description":"Looks a company up in the public Peppol network (SML and SMP): can it receive invoices, under which participant ID, at which SMP, for which document types. Give vat (a Belgian or Dutch VAT number: the usual IDs are tried) or id (any participant ID). Answers are cached for 6 hours. At most 20 lookups a minute per key. A test key asks the real network too: a lookup only reads public data and sends nothing.","x-test-key":true,"parameters":[{"name":"vat","in":"query","required":false,"schema":{"type":"string"},"description":"A Belgian (BE…) or Dutch (NL…) VAT number. Not together with id.","example":"BE0202239951"},{"name":"id","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}:[^\\s:]{1,100}$"},"description":"A Peppol participant ID \"<scheme>:<value>\". Not together with vat.","example":"0208:0202239951"}],"responses":{"200":{"description":"The answer; reachable false when no ID receives invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeppolLookup"},"example":{"reachable":true,"participantId":"0208:0202239951","checked":[{"participantId":"0208:0202239951","registered":true,"accessPointSmp":"smp.example.eu","receivesInvoices":true,"receivesCreditNotes":true,"documentTypes":["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##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"]},{"participantId":"9925:BE0202239951","registered":false}],"test":true}}}},"400":{"description":"Neither or both of vat and id, an id that is not a participant ID, or a VAT number that is not valid or not Belgian or Dutch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Give either vat or id, not both."}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"429":{"description":"More than 20 lookups of this kind in a minute with this key. Wait retryAfter seconds (Retry-After header).","content":{"application/json":{"schema":{"type":"object","required":["error","retryAfter"],"properties":{"error":{"type":"string"},"retryAfter":{"type":"integer","description":"Seconds to wait; also in the Retry-After header."}}},"example":{"error":"Too many lookups in the last minute. Try again after retryAfter seconds.","retryAfter":42}}}},"503":{"description":"The SML or the SMP did not answer, so the answer is unknown (never shown as not on Peppol).","content":{"application/json":{"schema":{"type":"object","required":["error","retryAfter"],"properties":{"error":{"type":"string"},"retryAfter":{"type":"integer","description":"Seconds; also in the Retry-After header."}}},"example":{"error":"The Peppol network could not be reached. Try again after retryAfter seconds.","retryAfter":60}}}}}}},"/vat/check":{"get":{"operationId":"checkVat","tags":["Lookups"],"summary":"Check a VAT number in VIES","description":"Checks an EU VAT number in the European Commission's VIES service: valid or not, the registered name and address when the member state discloses them, and VIES's time stamp. Answers are cached for 10 minutes. At most 20 checks a minute per key. A test key asks the real VIES too: a check only reads public data.","x-test-key":true,"parameters":[{"name":"vat","in":"query","required":true,"schema":{"type":"string"},"description":"The VAT number with its two-letter prefix; spaces and dots are fine.","example":"BE0202239951"}],"responses":{"200":{"description":"The VIES answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VatCheck"},"example":{"vatNumber":"BE0202239951","valid":true,"status":"valid","name":"BV VELO ATELIER","address":"Dorpsstraat 1\n9000 Gent","checkedAt":"2026-11-18T10:00:00.000+01:00","test":true}}}},"400":{"description":"vat is missing or not in the format of its country.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"status":{"const":"syntax_error"}}},"example":{"error":"Not a valid VAT number: \"12\" is not a valid BE VAT number format","status":"syntax_error"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"429":{"description":"More than 20 lookups of this kind in a minute with this key. Wait retryAfter seconds (Retry-After header).","content":{"application/json":{"schema":{"type":"object","required":["error","retryAfter"],"properties":{"error":{"type":"string"},"retryAfter":{"type":"integer","description":"Seconds to wait; also in the Retry-After header."}}},"example":{"error":"Too many lookups in the last minute. Try again after retryAfter seconds.","retryAfter":42}}}},"503":{"description":"VIES or the member state's service is down (this happens, mostly at night and in weekends). Try again later.","content":{"application/json":{"schema":{"type":"object","required":["error","status","reason","retryAfter"],"properties":{"error":{"type":"string"},"status":{"const":"unavailable"},"reason":{"type":"string","description":"What VIES said, as it said it."},"retryAfter":{"type":"integer","description":"Seconds; also in the Retry-After header."}}},"example":{"error":"VIES or the member state's service is not answering right now. Try again after retryAfter seconds.","status":"unavailable","reason":"MS_UNAVAILABLE","retryAfter":60}}}}}}},"/received":{"get":{"operationId":"listReceived","tags":["Received"],"summary":"List received invoices","description":"The invoices and credit notes your suppliers sent you over Peppol, newest issue date first, 50 a page. Receiving works for Belgian shops connected to SUPER PDP; receiving says whether the shop receives through PeppolKit. A shop that does not gets an empty list. A test key reads the test environment, which never receives: an empty list with receiving false.","x-test-key":true,"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Earliest issue date (inclusive).","example":"2026-11-01"},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Latest issue date (inclusive).","example":"2026-11-30"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"A page past the last gives the last page."}],"responses":{"200":{"description":"One page.","content":{"application/json":{"schema":{"type":"object","required":["receiving","total","page","pageCount","pageSize","received"],"properties":{"receiving":{"type":"boolean","description":"The shop receives Peppol invoices through PeppolKit."},"total":{"type":"integer","description":"Documents matching from/to."},"page":{"type":"integer"},"pageCount":{"type":"integer"},"pageSize":{"type":"integer","const":50},"received":{"type":"array","items":{"$ref":"#/components/schemas/ReceivedInvoiceItem"}},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."}}},"example":{"receiving":true,"total":1,"page":1,"pageCount":1,"pageSize":50,"received":[{"id":"cmx0r3c9e0001abcd1234efgh","number":"F2026-118","type":"invoice","issueDate":"2026-11-17","dueDate":"2026-12-17","supplier":{"name":"Leverancier NV","vatNumber":"BE0123456749"},"total":242,"totalNet":200,"totalVat":42,"currency":"EUR","receivedAt":"2026-11-18T09:12:00.000Z","originalType":"xml","originalUrl":"https://app.peppolkit.com/api/v1/received/cmx0r3c9e0001abcd1234efgh/original","pdfUrl":"https://app.peppolkit.com/api/v1/received/cmx0r3c9e0001abcd1234efgh/pdf"}]}}}},"400":{"description":"from or to is not a date YYYY-MM-DD, from is after to, or page is not a whole number from 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"from must be a date YYYY-MM-DD."}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}}}}},"/received/{id}":{"get":{"operationId":"getReceived","tags":["Received"],"summary":"Get one received invoice","description":"One received document, as in GET /received, plus when it was forwarded to your bookkeeping inbox.","x-test-key":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id from GET /received.","example":"cmx0r3c9e0001abcd1234efgh"}],"responses":{"200":{"description":"The document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivedInvoiceItem"},"example":{"id":"cmx0r3c9e0001abcd1234efgh","number":"F2026-118","type":"invoice","issueDate":"2026-11-17","dueDate":"2026-12-17","supplier":{"name":"Leverancier NV","vatNumber":"BE0123456749"},"total":242,"totalNet":200,"totalVat":42,"currency":"EUR","receivedAt":"2026-11-18T09:12:00.000Z","originalType":"xml","originalUrl":"https://app.peppolkit.com/api/v1/received/cmx0r3c9e0001abcd1234efgh/original","pdfUrl":"https://app.peppolkit.com/api/v1/received/cmx0r3c9e0001abcd1234efgh/pdf","forwardedToAccountingAt":"2026-11-18T09:12:05.000Z"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No received document with this id in this shop.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Received invoice not found"}}}}}}},"/received/{id}/original":{"get":{"operationId":"getReceivedOriginal","tags":["Received"],"summary":"Download the original file","description":"The file as your supplier sent it, the legal document: the UBL or CII XML (originalType xml), or a Factur-X PDF (originalType pdf).","x-test-key":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id from GET /received.","example":"cmx0r3c9e0001abcd1234efgh"}],"responses":{"200":{"description":"The file.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"Leverancier-NV-F2026-118.xml\""}},"content":{"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No received document with this id in this shop.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Received invoice not found"}}}}}}},"/received/{id}/pdf":{"get":{"operationId":"getReceivedPdf","tags":["Received"],"summary":"Download a readable PDF","description":"A PDF of the received document: the original when it is one, otherwise rendered by SUPER PDP. 404 when there is none (pdfUrl is null then).","x-test-key":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id from GET /received.","example":"cmx0r3c9e0001abcd1234efgh"}],"responses":{"200":{"description":"The PDF.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"Leverancier-NV-F2026-118.pdf\""}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"No received document with this id in this shop, or it has no PDF.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This received invoice has no PDF; get the original"}}}}}}},"/settings":{"get":{"operationId":"getSettings","tags":["Settings"],"summary":"Get settings and plan","description":"Company details, plan and this month's usage. With a test key: the live settings (read only), the usage of the test documents, and test: true.","x-test-key":true,"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settings"},"example":{"shop":"api:veloatelier.be","test":true,"configured":true,"seller":{"name":"Velo Atelier BV","address":{"street":"Dorpsstraat 1","city":"Gent","postalCode":"9000","country":"BE"},"vatNumber":"BE0202239951","registrationNumber":"0202239951","email":"info@veloatelier.be","endpoint":{"schemeId":"0208","value":"0202239951"}},"plan":{"name":"Gratis","invoicesPerMonth":20,"peppolIncluded":0,"peppolEveryInvoice":false},"emailCustomers":true,"customerMailVia":"peppolkit","pdfReady":true,"iban":"BE68539007547034","invoicePrefix":"","ossRegistered":false,"belowMicroThreshold":true,"language":"auto","peppolSend":true,"smallBusiness":false,"cashAccounting":false,"peppolVia":"recommand","peppolActive":false,"peppyrusParticipant":null,"peppolKitOffered":false,"usage":{"invoicesThisMonth":0,"peppolThisMonth":0},"threshold":{"year":2026,"thisYearCents":0,"lastYearCents":0,"state":"below"}}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}}}},"put":{"operationId":"updateSettings","tags":["Settings"],"summary":"Save company details","description":"Saves the company details and invoice settings, with the same checks as the dashboard. With a test key the body is checked exactly as live and nothing is saved.","x-test-key":true,"x-also-accepts":["POST"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsInput"},"example":{"name":"Velo Atelier BV","street":"Dorpsstraat 1","postalCode":"9000","city":"Gent","country":"BE","vatNumber":"BE0202239951","registrationNumber":"0202239951","email":"info@veloatelier.be","iban":"BE68539007547034","language":"auto","emailCustomers":true,"peppolSend":true}}}},"responses":{"200":{"description":"Saved (live) or checked (test).","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"saved":{"type":"boolean","description":"false with a test key: nothing was saved."}}},"example":{"ok":true,"test":true,"saved":false}}}},"400":{"description":"The body is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Body must be JSON"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"PUT only"}}}},"422":{"description":"The details are not valid; errors names each field.","content":{"application/json":{"schema":{"type":"object","required":["ok","errors"],"properties":{"ok":{"const":false},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"errors":{"type":"array","items":{"type":"string"}}}},"example":{"ok":false,"test":true,"errors":["vatNumber: \"0123\" is not a valid BE VAT number format"]}}}}}}},"/billing":{"get":{"operationId":"getBilling","tags":["Settings"],"summary":"Get plan and prices","description":"The current plan and the paid plans with their prices for this shop (euro cents, VAT for the shop's country).","x-test-key":false,"responses":{"200":{"description":"Plan and prices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"},"example":{"available":true,"current":"Gratis","status":null,"plans":[{"name":"Starter","invoicesPerMonth":100,"peppolIncluded":25,"peppolEveryInvoice":true,"net":900,"vat":0,"gross":900,"currency":"EUR"},{"name":"Groei","invoicesPerMonth":500,"peppolIncluded":100,"peppolEveryInvoice":true,"net":1900,"vat":0,"gross":1900,"currency":"EUR"},{"name":"Pro","invoicesPerMonth":null,"peppolIncluded":300,"peppolEveryInvoice":true,"net":4900,"vat":0,"gross":4900,"currency":"EUR"}]}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}}}},"post":{"operationId":"changePlan","tags":["Settings"],"summary":"Start or cancel a paid plan","description":"Starts a paid plan: the answer has the Mollie checkout to send the merchant to. {\"plan\": \"Gratis\"} cancels; a paid year runs until endsAt.","x-test-key":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string"},"redirectUrl":{"type":"string","format":"uri"},"interval":{"type":"string","enum":["month","year"]}}},"example":{"plan":"Starter","redirectUrl":"https://shop.example/admin/peppolkit"}}}},"responses":{"200":{"description":"The checkout to open, or the plan after cancelling.","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true},"checkoutUrl":{"type":"string","format":"uri"},"plan":{"type":"string"},"endsAt":{"type":"string","format":"date-time"}}},"example":{"ok":true,"checkoutUrl":"https://www.mollie.com/checkout/…"}}}},"400":{"description":"plan or redirectUrl missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"plan and redirectUrl required"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"422":{"description":"The plan cannot be started.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"Save your company details first"}}}},"503":{"description":"Paid plans are switched off.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"Paid plans are not available yet"}}}}}}},"/webhook":{"get":{"operationId":"getWebhook","tags":["Webhooks"],"summary":"Get the webhook","description":"The shop's webhook endpoint, or null. The signing secret is never returned here.","x-test-key":false,"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"type":"object","required":["webhook"],"properties":{"webhook":{"oneOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"null"}]}}},"example":{"webhook":{"url":"https://jouwserver.example/peppolkit","events":["invoice.created","invoice.failed"],"enabled":true,"createdAt":"2026-11-18T10:00:00.000Z"}}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}}}},"put":{"operationId":"saveWebhook","tags":["Webhooks"],"summary":"Set the webhook","description":"Makes or changes the endpoint: an https address on the public internet. events left out means all of them. secret is in the answer only when this call made the endpoint, or with rotateSecret: true. Test-key events go to this same endpoint, with test: true.","x-test-key":false,"x-also-accepts":["POST"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"enabled":{"type":"boolean"},"rotateSecret":{"type":"boolean"}}},"example":{"url":"https://jouwserver.example/peppolkit","events":["invoice.created","invoice.failed"],"enabled":true}}}},"responses":{"200":{"description":"Saved.","content":{"application/json":{"schema":{"type":"object","required":["ok","webhook"],"properties":{"ok":{"const":true},"webhook":{"$ref":"#/components/schemas/WebhookEndpoint"},"secret":{"type":"string","description":"whsec_…, shown once."}}},"example":{"ok":true,"webhook":{"url":"https://jouwserver.example/peppolkit","events":["invoice.created","invoice.failed"],"enabled":true,"createdAt":"2026-11-18T10:00:00.000Z"},"secret":"whsec_…"}}}},"400":{"description":"The body is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Body must be JSON"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"PUT or DELETE only"}}}},"422":{"description":"The address or the events are not valid.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"url must start with https://"}}}}}},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Remove the webhook","description":"Removes the endpoint with its delivery log.","x-test-key":false,"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"type":"object","required":["ok","deleted"],"properties":{"ok":{"const":true},"deleted":{"type":"boolean","description":"false: there was none."}}},"example":{"ok":true,"deleted":true}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}}}}},"/received/test":{"post":{"operationId":"testReceived","tags":["Received"],"summary":"Receive a test invoice","description":"Test key only: a made-up purchase invoice (Leverancier Test BV, EUR 121.00) arrives in your test environment and the invoice.received webhook goes out with test: true, to your webhook and to Zapier and Make subscriptions. At most 10 in 10 minutes.","x-test-key":true,"responses":{"200":{"description":"Received in the test environment.","content":{"application/json":{"schema":{"type":"object","required":["ok","test","received"],"properties":{"ok":{"const":true},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"received":{"type":"object"}}},"example":{"ok":true,"test":true,"received":{"id":"cmx0r3c9e0001abcd1234efgh","number":"TEST-IN-0001","type":"invoice","issueDate":"2026-11-22","dueDate":"2026-12-22","supplier":{"name":"Leverancier Test BV","vatNumber":"BE0000000097"},"total":121,"totalNet":100,"totalVat":21,"currency":"EUR","receivedAt":"2026-11-22T10:00:00.000Z"}}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Only with a test key (pk_test_…): a live shop receives real invoices over Peppol."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"429":{"description":"Too many test invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Too many test invoices, try again in a few minutes"}}}}}}},"/hooks":{"get":{"operationId":"listHooks","tags":["Webhooks"],"summary":"List subscriptions","description":"The subscriptions automation tools made (Zapier, Make). Your own webhook is not in this list.","x-test-key":false,"responses":{"200":{"description":"The subscriptions.","content":{"application/json":{"schema":{"type":"object","required":["hooks"],"properties":{"hooks":{"type":"array","items":{"$ref":"#/components/schemas/Hook"}}}},"example":{"hooks":[{"id":"cm3hook","url":"https://hooks.zapier.com/hooks/standard/1/abc/","events":["invoice.created"],"source":"zapier","createdAt":"2026-11-21T22:00:00.000Z"}]}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}}}},"post":{"operationId":"subscribeHook","tags":["Webhooks"],"summary":"Subscribe an automation tool","description":"For Zapier, Make and similar tools: one subscription per Zap or scenario, next to your own webhook, with the same events, body and signature. events left out means all of them. The same url again gives the existing subscription (200). An address that answers 410 Gone is unsubscribed. At most 50 per shop.","x-test-key":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"source":{"type":"string","enum":["zapier","make","other"]}}},"example":{"url":"https://hooks.zapier.com/hooks/standard/1/abc/","events":["invoice.created"],"source":"zapier"}}}},"responses":{"200":{"description":"Already subscribed.","content":{"application/json":{"schema":{"type":"object","required":["ok","hook"],"properties":{"ok":{"const":true},"hook":{"$ref":"#/components/schemas/Hook"}}},"example":{"ok":true,"hook":{"id":"cm3hook","url":"https://hooks.zapier.com/hooks/standard/1/abc/","events":["invoice.created"],"source":"zapier","createdAt":"2026-11-21T22:00:00.000Z"}}}}},"201":{"description":"Subscribed.","content":{"application/json":{"schema":{"type":"object","required":["ok","hook"],"properties":{"ok":{"const":true},"hook":{"$ref":"#/components/schemas/Hook"}}},"example":{"ok":true,"hook":{"id":"cm3hook","url":"https://hooks.zapier.com/hooks/standard/1/abc/","events":["invoice.created"],"source":"zapier","createdAt":"2026-11-21T22:00:00.000Z"}}}}},"400":{"description":"The body is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Body must be JSON"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"422":{"description":"The address or the events are not valid.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"example":{"ok":false,"error":"url must start with https://"}}}}}}},"/hooks/events":{"get":{"operationId":"listHookEvents","tags":["Webhooks"],"summary":"Latest events of one type","description":"The latest events of one type that were sent to your webhook or to the subscriptions of automation tools, newest first, each exactly the body that was sent (test documents included, with test: true). Zapier and Make use it to show real examples while you set up a Zap or scenario.","x-test-key":false,"parameters":[{"name":"type","in":"query","required":true,"schema":{"$ref":"#/components/schemas/WebhookEventType"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":3}}],"responses":{"200":{"description":"The events, newest first; empty when there are none yet.","content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"type":"object","description":"The event body, as in the webhooks section."}}}},"example":{"events":[{"id":"evt_0f3c2b1a","type":"invoice.delivered","created":"2026-11-22T09:06:31.000Z","shop":"winkel.example","data":{"number":"2026-00042","type":"invoice","peppolStatus":"delivered"}}]}}}},"400":{"description":"type or limit is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"type must be one of invoice.created, credit_note.created, invoice.delivered, invoice.failed, invoice.received"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}}}}},"/hooks/{id}":{"delete":{"operationId":"unsubscribeHook","tags":["Webhooks"],"summary":"Unsubscribe an automation tool","description":"Removes one subscription. Your own webhook is never removed this way.","x-test-key":false,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"type":"object","required":["ok","deleted"],"properties":{"ok":{"const":true},"deleted":{"type":"boolean","description":"false: there was no such subscription."}}},"example":{"ok":true,"deleted":true}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"DELETE only"}}}}}}},"/webhook/test":{"post":{"operationId":"testWebhook","tags":["Webhooks"],"summary":"Send a test event","description":"Sends one webhook.test event to the endpoint now, not retried, also while it is switched off. With a test key it goes to the same endpoint with test: true. httpStatus is your server's answer. At most 10 in 10 minutes.","x-test-key":true,"responses":{"200":{"description":"Sent; ok says whether your server took it.","content":{"application/json":{"schema":{"type":"object","required":["ok","httpStatus","error"],"properties":{"ok":{"type":"boolean","description":"Your server answered 2xx."},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"httpStatus":{"type":["integer","null"]},"error":{"type":["string","null"]}}},"example":{"ok":true,"test":true,"httpStatus":200,"error":null}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"404":{"description":"There is no endpoint yet.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"error":{"type":"string"}}},"example":{"ok":false,"test":true,"error":"No webhook endpoint yet. Set one with PUT /api/v1/webhook (live key) or in the dashboard under API, Webhooks."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"429":{"description":"Too many test events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Too many test events, try again in a few minutes"}}}}}}},"/connect":{"post":{"operationId":"connectShop","tags":["Connection"],"summary":"Connect a shop (plugins)","description":"Called once by a plugin when the merchant connects: returns the shop's API key. A shop that is already known only gets a new key with its current key in the Authorization header, or after the owner confirmed by mail (409 until then, with a message to show as it is). At most 10 an hour per address.","x-test-key":false,"security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["platform","siteUrl"],"properties":{"platform":{"type":"string","enum":["woocommerce","lightspeed","prestashop","magento","drupal","opencart","joomla"]},"siteUrl":{"type":"string","format":"uri","description":"The shop's http(s) address."},"email":{"type":"string","format":"email"}}},"example":{"platform":"woocommerce","siteUrl":"https://winkel.example","email":"eigenaar@winkel.example"}}}},"responses":{"200":{"description":"Connected.","content":{"application/json":{"schema":{"type":"object","required":["shop","apiKey"],"properties":{"shop":{"type":"string"},"apiKey":{"type":"string","description":"pk_…, returned only here."}}},"example":{"shop":"woo:winkel.example","apiKey":"pk_…"}}}},"400":{"description":"The body is not valid.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"code":{"type":"string"}}},"example":{"error":"siteUrl: Invalid url"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}},"409":{"description":"The shop is already connected.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string","enum":["already_connected","confirm_by_email"]}}},"example":{"error":"Deze winkel is al gekoppeld. We hebben een bevestigingsmail gestuurd naar e***@winkel.example.","code":"confirm_by_email"}}}},"429":{"description":"Too many connections from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Too many connections, try again later"}}}}}}},"/dashboard-link":{"post":{"operationId":"dashboardLink","tags":["Connection"],"summary":"Get a dashboard sign-in link","description":"A one-click sign-in to the web dashboard, valid for 5 minutes. page (optional) is the dashboard page to open, e.g. settings.","x-test-key":false,"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z/-]*(\\?tab=[a-z]+)?$"}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},"example":{"url":"https://app.peppolkit.com/d/login?t=…"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}}}}},"/disconnect":{"post":{"operationId":"disconnectShop","tags":["Connection"],"summary":"Disconnect the shop","description":"Called by a plugin when the merchant disconnects or removes it. The shop's data is deleted 30 days later unless it connects again.","x-test-key":false,"responses":{"200":{"description":"Disconnected.","content":{"application/json":{"schema":{"type":"object","required":["ok","purgeAt"],"properties":{"ok":{"const":true},"purgeAt":{"type":"string","format":"date-time"}}},"example":{"ok":true,"purgeAt":"2026-12-18T10:00:00.000Z"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"403":{"description":"A test key (pk_test_…) on a call that needs the live key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This call is not available with a test key (pk_test_…). Use your live key."}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}}}}},"/peppol":{"post":{"operationId":"registerPeppol","tags":["Connection"],"summary":"Register at the old access point","deprecated":true,"description":"No longer used: Peppol is connected in the dashboard. Kept for the first WooCommerce plugin versions, and always answers unavailable.","x-test-key":true,"responses":{"200":{"description":"Always this.","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"const":"unavailable"}}},"example":{"status":"unavailable"}}}},"401":{"description":"The key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing API key"}}}},"405":{"description":"Wrong HTTP method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"POST only"}}}}}}}},"webhooks":{"invoice.created":{"post":{"operationId":"webhook_invoice_created","summary":"An invoice was made","description":"data is the invoice as GET /invoices gives it.","tags":["Webhooks"],"parameters":[{"name":"PeppolKit-Event","in":"header","required":true,"schema":{"type":"string","const":"invoice.created"}},{"name":"PeppolKit-Delivery","in":"header","required":true,"schema":{"type":"string"},"description":"The id of this delivery; a retry has the same id."},{"name":"PeppolKit-Signature","in":"header","required":true,"schema":{"type":"string"},"example":"t=1795521600,v1=5f2b0c…"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"invoice.created"},"data":{"$ref":"#/components/schemas/Invoice"}}}]},"example":{"id":"evt_c1aa45148e3a990f7151aa9d42689128","type":"invoice.created","created":"2026-11-18T10:00:00.000Z","shop":"api:veloatelier.be","test":true,"data":{"number":"TEST-2026-00001","type":"invoice","orderId":"1001","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":"pending","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true}}}}},"responses":{"2XX":{"description":"Received. Any other answer, or none within 10 seconds, is tried again after 1 min, 5 min, 30 min, 2 h and 12 h."}}}},"credit_note.created":{"post":{"operationId":"webhook_credit_note_created","summary":"A credit note was made","description":"data is the credit note as GET /invoices gives it.","tags":["Webhooks"],"parameters":[{"name":"PeppolKit-Event","in":"header","required":true,"schema":{"type":"string","const":"credit_note.created"}},{"name":"PeppolKit-Delivery","in":"header","required":true,"schema":{"type":"string"},"description":"The id of this delivery; a retry has the same id."},{"name":"PeppolKit-Signature","in":"header","required":true,"schema":{"type":"string"},"example":"t=1795521600,v1=5f2b0c…"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"credit_note.created"},"data":{"$ref":"#/components/schemas/Invoice"}}}]},"example":{"id":"evt_8d1f…","type":"credit_note.created","created":"2026-11-20T13:00:00.000Z","shop":"api:veloatelier.be","data":{"number":"2026-00043","type":"credit_note","orderId":"1001/refund/7001","issueDate":"2026-11-20","total":121,"currency":"EUR","peppolStatus":"pending","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[]}}}}},"responses":{"2XX":{"description":"Received. Any other answer, or none within 10 seconds, is tried again after 1 min, 5 min, 30 min, 2 h and 12 h."}}}},"invoice.delivered":{"post":{"operationId":"webhook_invoice_delivered","summary":"Peppol delivery confirmed","description":"The customer's access point confirmed the delivery. Also for credit notes: data.type says which it is.","tags":["Webhooks"],"parameters":[{"name":"PeppolKit-Event","in":"header","required":true,"schema":{"type":"string","const":"invoice.delivered"}},{"name":"PeppolKit-Delivery","in":"header","required":true,"schema":{"type":"string"},"description":"The id of this delivery; a retry has the same id."},{"name":"PeppolKit-Signature","in":"header","required":true,"schema":{"type":"string"},"example":"t=1795521600,v1=5f2b0c…"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"invoice.delivered"},"data":{"$ref":"#/components/schemas/Invoice"}}}]},"example":{"id":"evt_2b9e…","type":"invoice.delivered","created":"2026-11-18T10:00:30.000Z","shop":"api:veloatelier.be","test":true,"data":{"number":"TEST-2026-00001","type":"invoice","orderId":"1001","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":"delivered","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true}}}}},"responses":{"2XX":{"description":"Received. Any other answer, or none within 10 seconds, is tried again after 1 min, 5 min, 30 min, 2 h and 12 h."}}}},"invoice.failed":{"post":{"operationId":"webhook_invoice_failed","summary":"Peppol delivery failed","description":"Peppol refused the document; peppolError says why, as the dashboard shows it.","tags":["Webhooks"],"parameters":[{"name":"PeppolKit-Event","in":"header","required":true,"schema":{"type":"string","const":"invoice.failed"}},{"name":"PeppolKit-Delivery","in":"header","required":true,"schema":{"type":"string"},"description":"The id of this delivery; a retry has the same id."},{"name":"PeppolKit-Signature","in":"header","required":true,"schema":{"type":"string"},"example":"t=1795521600,v1=5f2b0c…"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"invoice.failed"},"data":{"allOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"object","properties":{"peppolError":{"type":"string"}}}]}}}]},"example":{"id":"evt_77c0…","type":"invoice.failed","created":"2026-11-18T10:00:30.000Z","shop":"api:veloatelier.be","test":true,"data":{"number":"TEST-2026-00001","type":"invoice","orderId":"1001","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":"failed","emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…","ublUrl":"https://app.peppolkit.com/i/cmwmju0je0000ru9mzgqsb0xk.1797624213.qwA1qR_poEsHC5gzm18L…?format=xml","warnings":[],"test":true,"peppolError":"Rejected by the receiver (test)"}}}}},"responses":{"2XX":{"description":"Received. Any other answer, or none within 10 seconds, is tried again after 1 min, 5 min, 30 min, 2 h and 12 h."}}}},"invoice.received":{"post":{"operationId":"webhook_invoice_received","summary":"A Peppol invoice arrived","description":"A supplier's invoice or credit note arrived over Peppol (Belgian shops on SUPER PDP). The facts, not the file: that stays in the dashboard.","tags":["Webhooks"],"parameters":[{"name":"PeppolKit-Event","in":"header","required":true,"schema":{"type":"string","const":"invoice.received"}},{"name":"PeppolKit-Delivery","in":"header","required":true,"schema":{"type":"string"},"description":"The id of this delivery; a retry has the same id."},{"name":"PeppolKit-Signature","in":"header","required":true,"schema":{"type":"string"},"example":"t=1795521600,v1=5f2b0c…"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"invoice.received"},"data":{"$ref":"#/components/schemas/ReceivedInvoice"}}}]},"example":{"id":"evt_41aa…","type":"invoice.received","created":"2026-11-18T09:12:00.000Z","shop":"api:veloatelier.be","data":{"number":"F2026-118","type":"invoice","issueDate":"2026-11-17","dueDate":"2026-12-17","supplier":{"name":"Leverancier NV","vatNumber":"BE0123456749"},"total":242,"totalNet":200,"totalVat":42,"currency":"EUR","receivedAt":"2026-11-18T09:12:00.000Z"}}}}},"responses":{"2XX":{"description":"Received. Any other answer, or none within 10 seconds, is tried again after 1 min, 5 min, 30 min, 2 h and 12 h."}}}},"webhook.test":{"post":{"operationId":"webhook_webhook_test","summary":"Test event","description":"Sent by POST /webhook/test and the dashboard's test button, never retried. data is a sample invoice without links.","tags":["Webhooks"],"parameters":[{"name":"PeppolKit-Event","in":"header","required":true,"schema":{"type":"string","const":"webhook.test"}},{"name":"PeppolKit-Delivery","in":"header","required":true,"schema":{"type":"string"},"description":"The id of this delivery; a retry has the same id."},{"name":"PeppolKit-Signature","in":"header","required":true,"schema":{"type":"string"},"example":"t=1795521600,v1=5f2b0c…"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"webhook.test"},"data":{"type":"object","description":"A sample invoice: the fields of Invoice, with pdfUrl and ublUrl null."}}}]},"example":{"id":"evt_test_5d0e3c1b9a7f00112233aabb","type":"webhook.test","created":"2026-11-18T10:00:00.000Z","shop":"api:veloatelier.be","test":true,"data":{"number":"TEST-0001","type":"invoice","orderId":"test","issueDate":"2026-11-18","total":121,"currency":"EUR","peppolStatus":null,"emailedAt":null,"emailTo":null,"emailError":null,"pdfUrl":null,"ublUrl":null,"warnings":[]}}}}},"responses":{"2XX":{"description":"Received. Any other answer, or none within 10 seconds, is tried again after 1 min, 5 min, 30 min, 2 h and 12 h."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key: pk_… (live) or pk_test_… (test environment). Make it in the dashboard under API."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Why the call failed, in English."}}},"Invoice":{"type":"object","description":"An invoice or credit note as the API returns it, with signed links to the PDF and the UBL file that work for 30 days.","required":["number","type","orderId","issueDate","total","currency","peppolStatus","emailedAt","emailTo","emailError","pdfUrl","ublUrl","warnings"],"properties":{"number":{"type":"string","description":"The invoice number. Test documents: TEST-2026-00001 and on.","examples":["2026-00042"]},"type":{"type":"string","enum":["invoice","credit_note"]},"orderId":{"type":"string","description":"The order id you sent; a credit note has \"<order id>/refund/<refund id>\"."},"issueDate":{"type":"string","format":"date"},"total":{"type":"number","description":"Total including VAT, in the currency."},"currency":{"type":"string","minLength":3,"maxLength":3},"peppolStatus":{"type":["string","null"],"enum":["pending","sent","delivered","failed","not_on_peppol",null],"description":"How the Peppol delivery went; null when the document did not go over Peppol."},"emailedAt":{"type":["string","null"],"format":"date-time","description":"When the document was mailed to the customer."},"emailTo":{"type":["string","null"]},"emailError":{"type":["string","null"],"description":"Why the mail did not go out, when it did not."},"pdfUrl":{"type":"string","format":"uri"},"ublUrl":{"type":"string","format":"uri"},"warnings":{"type":"array","items":{"type":"string"},"description":"Points to check (VAT, VIES), in the language of ?lang=."},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."}}},"Order":{"type":"object","description":"A paid order in the PeppolKit order format: the Shopify REST order shape. Money fields are decimal strings with a dot (\"39.00\"). Fields PeppolKit does not know are ignored.","required":["id","name","currency","taxes_included","created_at","line_items","total_price"],"properties":{"id":{"type":"integer","description":"The order id in your system. The same id again makes no second invoice (status \"exists\")."},"name":{"type":"string","description":"The order number as the customer sees it, e.g. #1042."},"currency":{"type":"string","minLength":3,"maxLength":3},"taxes_included":{"type":"boolean","description":"true when prices include VAT."},"created_at":{"type":"string","description":"Date and time of the order (ISO 8601)."},"processed_at":{"type":["string","null"]},"email":{"type":["string","null"],"description":"Where the invoice is mailed."},"financial_status":{"type":["string","null"]},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/OrderAddress"},{"type":"null"}]},"shipping_address":{"oneOf":[{"$ref":"#/components/schemas/OrderAddress"},{"type":"null"}]},"customer":{"oneOf":[{"type":"object","properties":{"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"email":{"type":["string","null"]},"tax_exempt":{"type":"boolean"}}},{"type":"null"}]},"line_items":{"type":"array","minItems":1,"items":{"type":"object","required":["id","title","quantity","price"],"properties":{"id":{"type":"integer"},"title":{"type":"string"},"variant_title":{"type":["string","null"]},"sku":{"type":["string","null"]},"quantity":{"type":"integer"},"price":{"$ref":"#/components/schemas/Money","description":"Unit price before discounts; includes VAT when taxes_included."},"requires_shipping":{"type":"boolean"},"supply_type":{"type":"string","enum":["goods","service","digital_service"],"description":"What is supplied, for the VAT decision of this line. Default: goods when requires_shipping is not false, otherwise a digital service."},"taxable":{"type":"boolean"},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"},"description":"The VAT of the whole line."},"discount_allocations":{"type":"array","items":{"type":"object","required":["amount"],"properties":{"amount":{"$ref":"#/components/schemas/Money"}}}}}}},"shipping_lines":{"type":"array","items":{"type":"object","required":["title","price"],"properties":{"title":{"type":"string"},"price":{"$ref":"#/components/schemas/Money"},"discounted_price":{"$ref":"#/components/schemas/Money"},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}}}}},"note_attributes":{"type":"array","description":"The VAT number of a business customer goes here, with the name \"VAT number\". Test key: BE0000000097 accepts over Peppol, BE0000000196 rejects.","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"value":{"type":["string","null"]}}}},"note":{"type":["string","null"],"description":"The order's note; a VAT number written here is found too."},"customer_locale":{"type":["string","null"],"description":"The language the customer shopped in, e.g. fr-BE."},"total_price":{"$ref":"#/components/schemas/Money"},"total_tax":{"$ref":"#/components/schemas/Money"}},"example":{"id":1001,"name":"#1001","currency":"EUR","taxes_included":true,"created_at":"2026-11-18T10:00:00+01:00","email":"inkoop@example.com","billing_address":{"name":"An Peeters","company":"Testbedrijf BV","address1":"Kerkstraat 1","zip":"9000","city":"Gent","country_code":"BE"},"line_items":[{"id":1,"title":"Kettingset 11-speed","sku":"KS-11","quantity":1,"price":"121.00","tax_lines":[{"rate":0.21,"price":"21.00"}]}],"shipping_lines":[],"note_attributes":[{"name":"VAT number","value":"BE0000000097"}],"total_price":"121.00"}},"OrderAddress":{"type":"object","properties":{"name":{"type":["string","null"]},"company":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"city":{"type":["string","null"]},"zip":{"type":["string","null"]},"country_code":{"type":["string","null"],"minLength":2,"maxLength":2,"description":"Two letters, e.g. BE."}}},"TaxLine":{"type":"object","required":["rate","price"],"properties":{"title":{"type":"string"},"rate":{"type":"number","minimum":0,"description":"A fraction: 0.21 is 21 %."},"price":{"$ref":"#/components/schemas/Money"}}},"Money":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"A decimal string with a dot, e.g. \"39.00\"."},"Refund":{"type":"object","description":"A refund in the PeppolKit refund format (the Shopify REST refund shape).","required":["id","order_id","created_at"],"properties":{"id":{"type":"integer","description":"The refund id. The same id again makes no second credit note."},"order_id":{"type":"integer","description":"The id of the order you sent to POST /orders."},"created_at":{"type":"string"},"processed_at":{"type":["string","null"]},"refund_line_items":{"type":"array","items":{"type":"object","required":["line_item_id","quantity"],"properties":{"line_item_id":{"type":"integer","description":"The id of the line in the order."},"quantity":{"type":"integer"}}}},"transactions":{"type":"array","description":"What was paid back: transactions with kind \"refund\" and status \"success\" count.","items":{"type":"object","required":["kind","amount"],"properties":{"kind":{"type":"string"},"status":{"type":["string","null"]},"amount":{"type":["string","number"]}}}}}},"Party":{"type":"object","required":["name","address"],"properties":{"name":{"type":"string"},"address":{"type":"object","required":["street","city","postalCode","country"],"properties":{"street":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}}},"vatNumber":{"type":"string"},"registrationNumber":{"type":"string"},"taxNumber":{"type":"string","description":"German sellers: the Steuernummer."},"email":{"type":"string","format":"email"},"endpoint":{"type":"object","description":"The Peppol address (ISO 6523 scheme and value).","required":["schemeId","value"],"properties":{"schemeId":{"type":"string","pattern":"^\\d{4}$"},"value":{"type":"string"}}}}},"SettingsInput":{"type":"object","required":["name","street","postalCode","city","country"],"properties":{"name":{"type":"string","minLength":1},"street":{"type":"string","minLength":1},"postalCode":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"country":{"type":"string","minLength":2,"maxLength":2,"description":"The shop's country: NL, BE, FR, DE, LU, GB, IE, AT or NO."},"vatNumber":{"type":"string","description":"Required, except for a German seller that sends taxNumber instead."},"taxNumber":{"type":"string","description":"German sellers: the Steuernummer, instead of or next to the VAT number."},"registrationNumber":{"type":"string","description":"KvK or enterprise number; in BE and NL it becomes your Peppol address."},"registerCourt":{"type":"string","maxLength":80,"description":"Austrian shops: the Firmenbuch court, shown with the Firmenbuchnummer (for example Handelsgericht Wien). Ignored for other countries."},"email":{"type":"string","format":"email"},"iban":{"type":"string"},"invoicePrefix":{"type":"string","maxLength":20},"ossRegistered":{"type":"boolean"},"belowMicroThreshold":{"type":"boolean","description":"Cross-border sales to consumers stay below EUR 10 000 a year."},"emailCustomers":{"type":"boolean"},"language":{"type":"string","enum":["auto","nl","fr","en","de"]},"peppolSend":{"type":"boolean"},"smallBusiness":{"type":"boolean","description":"Small-business scheme (BE, NL, DE, LU; AT once PeppolKit serves Austrian shops): invoices without VAT with the scheme's mention."},"cashAccounting":{"type":"boolean","description":"Luxembourg shops under the cash-accounting regime (art. 25 LTVA): invoices state \"Comptabilité de caisse\". Ignored for other countries."},"customerMailVia":{"type":"string","enum":["peppolkit","shop"],"description":"\"shop\" only for the plugin platforms."}},"example":{"name":"Velo Atelier BV","street":"Dorpsstraat 1","postalCode":"9000","city":"Gent","country":"BE","vatNumber":"BE0202239951","registrationNumber":"0202239951","email":"info@veloatelier.be","iban":"BE68539007547034","language":"auto","emailCustomers":true,"peppolSend":true}},"Settings":{"type":"object","required":["shop","configured","seller","plan","emailCustomers","customerMailVia","pdfReady","iban","invoicePrefix","ossRegistered","belowMicroThreshold","language","peppolSend","smallBusiness","cashAccounting","peppolVia","peppolActive","peppyrusParticipant","peppolKitOffered","usage","threshold"],"properties":{"shop":{"type":"string","description":"Your shop's key at PeppolKit."},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."},"configured":{"type":"boolean","description":"Company details are saved."},"seller":{"oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"plan":{"type":"object","required":["name","invoicesPerMonth","peppolIncluded","peppolEveryInvoice"],"properties":{"name":{"type":"string"},"invoicesPerMonth":{"type":["integer","null"],"description":"null: unlimited."},"peppolIncluded":{"type":["integer","null"]},"peppolEveryInvoice":{"type":"boolean"}}},"emailCustomers":{"type":"boolean"},"customerMailVia":{"type":"string","enum":["peppolkit","shop"]},"pdfReady":{"type":"boolean","const":true},"iban":{"type":"string"},"invoicePrefix":{"type":"string"},"ossRegistered":{"type":"boolean"},"belowMicroThreshold":{"type":"boolean"},"language":{"type":"string","enum":["auto","nl","fr","en","de"]},"peppolSend":{"type":"boolean"},"smallBusiness":{"type":"boolean"},"cashAccounting":{"type":"boolean"},"peppolVia":{"type":"string","enum":["recommand","peppyrus","superpdp","dokapi"],"description":"\"recommand\" means: no access point connected yet. \"dokapi\": Peppol through PeppolKit (see peppolKitOffered)."},"peppolActive":{"type":"boolean"},"peppyrusParticipant":{"type":["string","null"]},"peppolKitOffered":{"type":"boolean","description":"Peppol through PeppolKit is offered for the seller's country now: the Netherlands, Germany and Luxembourg, and the United Kingdom, Ireland, Austria and Norway once PeppolKit's Peppol partner registers companies there. False elsewhere (Belgian shops send through SUPER PDP, French shops through a Plateforme Agréée)."},"usage":{"type":"object","required":["invoicesThisMonth","peppolThisMonth"],"properties":{"invoicesThisMonth":{"type":"integer"},"peppolThisMonth":{"type":"integer"}}},"threshold":{"oneOf":[{"type":"object","description":"Cross-border B2C sales in euro cents for the EUR 10 000 threshold, from PeppolKit's own invoices.","required":["year","thisYearCents","lastYearCents","state"],"properties":{"year":{"type":"integer"},"thisYearCents":{"type":"integer"},"lastYearCents":{"type":"integer"},"state":{"type":"string","enum":["below","near","over","over_last_year"]}}},{"type":"null"}]}}},"WebhookEndpoint":{"type":"object","required":["url","events","enabled","createdAt"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"Hook":{"type":"object","required":["id","url","events","source","createdAt"],"description":"A subscription of an automation tool (Zapier, Make): one per Zap or scenario, next to your own webhook.","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"source":{"type":"string","enum":["zapier","make","other"]},"createdAt":{"type":"string","format":"date-time"}}},"WebhookEventType":{"type":"string","enum":["invoice.created","credit_note.created","invoice.delivered","invoice.failed","invoice.received"]},"Price":{"type":"object","required":["net","vat","gross"],"properties":{"net":{"type":"integer"},"vat":{"type":"integer"},"gross":{"type":"integer"}},"description":"In euro cents."},"Billing":{"type":"object","required":["available","current","status","plans"],"properties":{"available":{"type":"boolean","description":"Paid plans can be started now."},"current":{"type":"string","description":"The plan the shop is on."},"status":{"type":["string","null"],"description":"The subscription's state, null without one."},"interval":{"type":"string","enum":["month","year"],"description":"Only once yearly plans are live."},"renewsAt":{"type":["string","null"],"format":"date-time","description":"Only once yearly plans are live."},"plans":{"type":"array","items":{"type":"object","required":["name","invoicesPerMonth","peppolIncluded","peppolEveryInvoice","net","vat","gross","currency"],"properties":{"name":{"type":"string"},"invoicesPerMonth":{"type":["integer","null"]},"peppolIncluded":{"type":["integer","null"]},"peppolEveryInvoice":{"type":"boolean"},"net":{"type":"integer","description":"Price a month in euro cents, without VAT."},"vat":{"type":"integer"},"gross":{"type":"integer"},"yearly":{"$ref":"#/components/schemas/Price"},"currency":{"type":"string","const":"EUR"}}}}}},"WebhookEvent":{"type":"object","description":"The body of every webhook. Signed in the PeppolKit-Signature header: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"t.<raw body>\" with your signing secret>.","required":["id","type","created","shop","data"],"properties":{"id":{"type":"string","description":"The same event always has the same id: use it to skip doubles."},"type":{"type":"string","enum":["invoice.created","credit_note.created","invoice.delivered","invoice.failed","invoice.received","webhook.test"]},"created":{"type":"string","format":"date-time"},"shop":{"type":"string"},"test":{"type":"boolean","const":true,"description":"Only on events of the test environment."},"data":{"type":"object"}}},"InvoiceDetail":{"description":"An invoice or credit note with its full status: the fields of Invoice plus buyer, amounts, rule check and both deliveries.","allOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"object","required":["orderName","buyerName","buyerVatNumber","buyerCountry","business","net","vat","needsAttention","attentionReasons","validation","delivery"],"properties":{"orderName":{"type":"string","description":"The order number as the customer saw it."},"buyerName":{"type":"string"},"buyerVatNumber":{"type":["string","null"]},"buyerCountry":{"type":["string","null"],"description":"Two letters, e.g. BE."},"business":{"type":"boolean","description":"The buyer gave a VAT number."},"net":{"type":"number","description":"Total without VAT."},"vat":{"type":"number","description":"The VAT amount."},"needsAttention":{"type":"boolean","description":"As the dashboard's \"needs attention\": a warning, a failed rule check or a failed delivery."},"attentionReasons":{"type":"array","items":{"type":"string"},"description":"Why it needs attention, one line per reason; empty when it does not."},"validation":{"type":"object","required":["checked","valid","issues"],"properties":{"checked":{"type":"boolean","description":"The EN 16931 / Peppol BIS rule check ran."},"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","required":["id","text"],"properties":{"id":{"type":"string","description":"The rule, e.g. BR-CO-15."},"text":{"type":"string"}}}}}},"delivery":{"type":"object","required":["email","peppol"],"properties":{"email":{"type":"object","required":["to","sentAt","error","viaShopMail"],"properties":{"to":{"type":["string","null"]},"sentAt":{"type":["string","null"],"format":"date-time"},"error":{"type":["string","null"]},"viaShopMail":{"type":["string","null"],"enum":["waiting","shop","peppolkit",null],"description":"With \"the shop mails the invoice\": waiting for the shop's own mail, sent with it (shop), or mailed by PeppolKit as the fallback. null otherwise."}}},"peppol":{"type":"object","required":["status","sentAt","error"],"properties":{"status":{"type":["string","null"],"enum":["pending","sent","delivered","failed","not_on_peppol",null]},"sentAt":{"type":["string","null"],"format":"date-time"},"error":{"type":["string","null"],"description":"Why Peppol refused it, when it did."}}}}}}}]},"ParticipantCheck":{"description":"The answer for one Peppol participant ID.","oneOf":[{"type":"object","required":["participantId","registered","accessPointSmp","receivesInvoices","receivesCreditNotes"],"properties":{"participantId":{"type":"string"},"registered":{"const":true},"accessPointSmp":{"type":"string","description":"The SMP host that publishes the ID (its access point's)."},"receivesInvoices":{"type":"boolean","description":"Accepts Peppol BIS Billing 3.0 invoices."},"receivesCreditNotes":{"type":"boolean"},"documentTypes":{"type":"array","items":{"type":"string"},"description":"Every document type ID the SMP publishes for the ID, as written there."}}},{"type":"object","required":["participantId","registered"],"properties":{"participantId":{"type":"string"},"registered":{"const":false}}},{"type":"object","required":["participantId","registered","error"],"properties":{"participantId":{"type":"string"},"registered":{"type":"null","description":"Could not be checked."},"error":{"type":"string"}}}]},"PeppolLookup":{"type":"object","required":["reachable","participantId","checked"],"properties":{"reachable":{"type":"boolean","description":"The company can receive invoices over Peppol under one of the IDs."},"participantId":{"type":["string","null"],"description":"The ID to send to: the first that receives invoices, else the first registered one; null when none is registered."},"checked":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantCheck"},"description":"Each ID that was tried. A VAT number tries the usual IDs: BE 0208:<enterprise number> and 9925:BE…, NL 9944:NL…."},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."}}},"VatCheck":{"type":"object","required":["vatNumber","valid","status","name","address","checkedAt"],"properties":{"vatNumber":{"type":"string","description":"The number as VIES knows it, with its prefix (EL for Greece)."},"valid":{"type":"boolean"},"status":{"type":"string","enum":["valid","invalid"]},"name":{"type":["string","null"],"description":"The registered name, when the member state discloses it."},"address":{"type":["string","null"],"description":"The registered address, when the member state discloses it."},"checkedAt":{"type":["string","null"],"format":"date-time","description":"VIES's time stamp of the check: keep it as proof. Answers are cached for 10 minutes, so it can be up to 10 minutes old."},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."}}},"ReceivedInvoiceItem":{"description":"A received invoice or credit note: the fields of the invoice.received webhook, its id and its files. originalUrl and pdfUrl are API calls that need your key in the Authorization header, not public links.","allOf":[{"$ref":"#/components/schemas/ReceivedInvoice"},{"type":"object","required":["id","originalType","originalUrl","pdfUrl"],"properties":{"id":{"type":"string"},"originalType":{"type":"string","enum":["xml","pdf"],"description":"xml: UBL or CII; pdf: a Factur-X PDF."},"originalUrl":{"type":"string","format":"uri","description":"GET /received/{id}/original: the file as it arrived, the legal document."},"pdfUrl":{"type":["string","null"],"format":"uri","description":"GET /received/{id}/pdf: a readable PDF; null when there is none."},"forwardedToAccountingAt":{"type":["string","null"],"format":"date-time","description":"Only in GET /received/{id}: when it went to the bookkeeping inbox."}}}]},"ReceivedInvoice":{"type":"object","required":["number","type","issueDate","dueDate","supplier","total","totalNet","totalVat","currency","receivedAt"],"properties":{"number":{"type":"string"},"type":{"type":"string","enum":["invoice","credit_note"]},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"supplier":{"type":"object","required":["name","vatNumber"],"properties":{"name":{"type":"string"},"vatNumber":{"type":["string","null"]}}},"total":{"type":["number","null"]},"totalNet":{"type":["number","null"]},"totalVat":{"type":["number","null"]},"currency":{"type":"string"},"receivedAt":{"type":"string","format":"date-time"}}},"InvoiceInput":{"type":"object","required":["reference","buyer","lines"],"description":"An invoice in JSON (POST /invoices). PeppolKit numbers it, applies the VAT rules and makes the PDF and UBL, as for an order.","properties":{"reference":{"type":"string","maxLength":100,"description":"Your own reference (your invoice or order id). The same reference never gives a second invoice. Shares one namespace with the order ids of POST /orders."},"issueDate":{"type":"string","format":"date","description":"Default today. Not in the future, at most 31 days back."},"dueDate":{"type":"string","format":"date","description":"Only for an unpaid invoice; default 30 days after the issue date."},"supplyDate":{"type":"string","format":"date","description":"When the goods were supplied or the service was done, if that differs from the issue date (printed as the date of supply, BT-72). At most two years back. Default: the issue date."},"paid":{"type":"boolean","default":false,"description":"false: still to be paid (due date, your IBAN and the payment QR). true: printed as paid, nothing payable."},"currency":{"type":"string","default":"EUR","example":"EUR"},"pricesIncludeVat":{"type":"boolean","default":false,"description":"Whether unitPrice, discount and the shipping price include VAT."},"language":{"type":"string","enum":["nl","fr","en","de"],"description":"Invoice language; default your setting."},"buyerReference":{"type":"string","maxLength":200,"description":"The buyer's purchase order or reference (Peppol BT-10); default your reference."},"note":{"type":"string","maxLength":1000,"description":"Free text on the invoice."},"buyer":{"type":"object","required":["address"],"description":"Give name or company (or both). With a valid VAT number of a company the invoice goes over Peppol when the company is on it.","properties":{"name":{"type":"string"},"company":{"type":"string"},"vatNumber":{"type":"string","example":"BE0202239951"},"email":{"type":"string","format":"email","description":"Where the invoice is mailed (when mailing customers is on)."},"address":{"type":"object","required":["line1","postcode","city","country"],"properties":{"line1":{"type":"string"},"line2":{"type":"string"},"postcode":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","description":"ISO 3166 code, e.g. BE."}}}}},"lines":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","required":["description","quantity","unitPrice","vatRate"],"properties":{"description":{"type":"string"},"quantity":{"type":"integer","minimum":1},"unitPrice":{"oneOf":[{"type":"number","minimum":0},{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"}],"description":"At most 2 decimals; a number or a decimal string."},"vatRate":{"type":"number","minimum":0,"maximum":30,"description":"VAT in percent, e.g. 21 or 5.5. PeppolKit still applies the rules (reverse charge, OSS, export) as for an order."},"sku":{"type":"string"},"discount":{"oneOf":[{"type":"number","minimum":0},{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"}],"description":"Discount on the whole line, same basis as unitPrice."},"supply":{"type":"string","enum":["goods","services"],"description":"goods or services. Goods to an EU business are an exempt intra-Community supply, goods outside the EU an export; services to an EU business are reverse charged. Default: a digital service (as before 2026-11-24); give services for other services, which are taxed where you are when sold to consumers."}}}},"shipping":{"type":"object","required":["price","vatRate"],"properties":{"description":{"type":"string","default":"Shipping"},"price":{"oneOf":[{"type":"number","minimum":0},{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"}],"description":"At most 2 decimals; a number or a decimal string."},"vatRate":{"type":"number","minimum":0,"maximum":30}}}},"example":{"reference":"SUB-2026-11-0042","buyer":{"company":"Afnemer NV","vatNumber":"BE0202239951","email":"facturen@afnemer.be","address":{"line1":"Markt 1","postcode":"9000","city":"Gent","country":"BE"}},"lines":[{"description":"Abonnement november","quantity":1,"unitPrice":49,"vatRate":21},{"description":"Extra gebruikers","quantity":3,"unitPrice":"5.00","vatRate":21}]}},"Stats":{"type":"object","required":["from","to","invoices","creditNotes","business","consumer","attention","totals","peppol","email","received","months"],"properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"invoices":{"type":"integer","description":"Invoices issued in the period (issue date)."},"creditNotes":{"type":"integer"},"business":{"type":"integer","description":"Invoices to a buyer with a VAT number."},"consumer":{"type":"integer"},"attention":{"type":"integer","description":"Documents that need attention (a warning, a failed rule check, mail or Peppol delivery), as in the dashboard."},"totals":{"type":"array","description":"Per currency, EUR first. Amounts incl. VAT; net = invoiced - credited.","items":{"type":"object","required":["currency","invoiced","credited","net","vat"],"properties":{"currency":{"type":"string"},"invoiced":{"type":"number"},"credited":{"type":"number"},"net":{"type":"number"},"vat":{"type":"number"}}}},"peppol":{"type":"object","required":["pending","sent","delivered","failed","notOnPeppol"],"properties":{"pending":{"type":"integer"},"sent":{"type":"integer"},"delivered":{"type":"integer"},"failed":{"type":"integer"},"notOnPeppol":{"type":"integer"}}},"email":{"type":"object","required":["sent","failed"],"properties":{"sent":{"type":"integer"},"failed":{"type":"integer"}}},"received":{"type":"integer","description":"Documents received from suppliers over Peppol in the period."},"months":{"type":"array","items":{"type":"object","required":["month","invoices","creditNotes","totals"],"properties":{"month":{"type":"string","example":"2026-11"},"invoices":{"type":"integer"},"creditNotes":{"type":"integer"},"totals":{"type":"array","items":{"type":"object","required":["currency","net","vat"],"properties":{"currency":{"type":"string"},"net":{"type":"number"},"vat":{"type":"number"}}}}}}},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."}},"example":{"from":"2026-11-01","to":"2026-11-18","invoices":42,"creditNotes":2,"business":9,"consumer":33,"attention":1,"totals":[{"currency":"EUR","invoiced":6230.5,"credited":121,"net":6109.5,"vat":1060.29}],"peppol":{"pending":0,"sent":1,"delivered":8,"failed":0,"notOnPeppol":1},"email":{"sent":40,"failed":1},"received":3,"months":[{"month":"2026-11","invoices":42,"creditNotes":2,"totals":[{"currency":"EUR","net":6109.5,"vat":1060.29}]}]}},"Document":{"type":"object","required":["id","type","number","issueDate","currency","total","buyerName","receiver","status","error","sentAt","createdAt"],"description":"A UBL invoice or credit note from your own software, sent over Peppol through POST /documents.","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["invoice","credit_note"]},"number":{"type":"string","description":"cbc:ID of your document."},"issueDate":{"type":"string","format":"date"},"currency":{"type":"string"},"total":{"type":"number","description":"PayableAmount."},"buyerName":{"type":"string"},"receiver":{"type":"string","description":"The buyer's Peppol address, scheme:value."},"status":{"type":"string","enum":["sent","delivered","failed","not_on_peppol"],"description":"sent: handed to the Peppol network; delivered: the buyer's access point took it; not_on_peppol: the buyer cannot receive it (nothing sent)."},"error":{"oneOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","const":true,"description":"Only present on answers to a test key (pk_test_…)."}},"example":{"id":"cmx1u9p2k0003abcd5678wxyz","type":"invoice","number":"F-2026-0042","issueDate":"2026-11-18","currency":"EUR","total":121,"buyerName":"Afnemer NV","receiver":"0208:0202239951","status":"delivered","error":null,"sentAt":"2026-11-18T10:00:00.000Z","createdAt":"2026-11-18T10:00:00.000Z","test":true}}}}}