{"openapi":"3.1.0","info":{"title":"Računi AI API","version":"1.0.0","description":"Invoices for Slovenian and Croatian issuers: PDF, UPN QR / HUB-3 slips, email delivery, Stripe payment links, webhooks. Read https://app.racuni-ai.si/llms-full.txt for concepts and examples."},"servers":[{"url":"https://app.racuni-ai.si"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"rk_test_… or rk_live_…"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"},"doc_url":{"type":"string"}},"required":["type","code","message"]}}}}},"paths":{"/v1/accounts":{"post":{"summary":"Create an account and get a test API key (public)","operationId":"post_accounts","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":200,"description":"Owner email. Receives a link to set a password and open the dashboard."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Account (organisation) name, e.g. the app or company name."}},"required":["email","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"get":{"summary":"Get the account, mode and credit balance","operationId":"get_account","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/issuers":{"get":{"summary":"List issuers","operationId":"get_issuers","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 20","schema":{"type":"string"}},{"name":"starting_after","in":"query","required":false,"description":"Id of the last object of the previous page","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an issuer","operationId":"post_issuers","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"type":"string","enum":["SI","HR"],"description":"Issuer country. Decides invoice language, rules and payment slip type."},"name":{"type":"string","minLength":1,"maxLength":140,"description":"Legal name printed on invoices, e.g. 'ŠD Primer' or 'Primer d.o.o.'."},"tax_id":{"type":"string","minLength":8,"maxLength":16,"description":"SI: 8-digit davčna številka. HR: 11-digit OIB. Validated with the check digit."},"registration_number":{"type":"string","maxLength":20,"description":"SI matična številka / HR MB (optional)."},"address_line":{"type":"string","minLength":1,"maxLength":140,"description":"Street and number."},"postal_code":{"type":"string","minLength":3,"maxLength":10},"city":{"type":"string","minLength":1,"maxLength":80},"iban":{"type":"string","minLength":15,"maxLength":40,"description":"Account receiving payments. Must be a valid IBAN; printed on invoices and payment slips."},"bic":{"type":"string","maxLength":11},"email":{"type":"string","format":"email","description":"Reply-To address for invoice emails."},"phone":{"type":"string","maxLength":40},"website":{"type":"string","maxLength":120},"vat_registered":{"type":"boolean","description":"true if the issuer is registered for VAT (SI: ID za DDV, HR: u sustavu PDV-a). Non-VAT issuers print an exemption note and cannot charge VAT."},"vat_exemption_note":{"type":"string","maxLength":300,"description":"Override the default note printed when VAT is not charged."},"subject_to_fiscalization":{"type":"boolean","description":"Required. true if this issuer must fiscalise invoices (SI: davčno potrjevanje for cash/card payments; HR: Fiskalizacija 2.0 — VAT, profit or income tax payers). v1 does not fiscalise: SI issuers with true cannot use payment links (bank transfer only); HR issuers with true cannot issue invoices. A non-profit club collecting membership fees is usually false — ask the user if unsure."},"default_due_days":{"type":"integer","minimum":0,"maximum":365,"description":"Payment term used when an invoice has no due_date. Default 15."},"invoice_footer":{"type":"string","maxLength":300,"description":"Extra text in the PDF footer, e.g. court register data."},"number_format":{"type":"string","maxLength":40,"description":"Invoice number format. Tokens {YYYY} {YY} {SEQ} {SEQ:n}. Default '{YYYY}-{SEQ:4}' → 2026-0001. Numbering restarts every year."},"metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"description":"Up to 20 string key/value pairs for your own use (e.g. your member id). Returned as-is. Use opaque ids, not personal data."}},"required":["country","name","tax_id","address_line","postal_code","city","iban","vat_registered","subject_to_fiscalization"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/issuers/{id}":{"get":{"summary":"Get an issuer","operationId":"get_issuers_id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update an issuer","operationId":"patch_issuers_id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":140,"description":"Legal name printed on invoices, e.g. 'ŠD Primer' or 'Primer d.o.o.'."},"tax_id":{"type":"string","minLength":8,"maxLength":16,"description":"SI: 8-digit davčna številka. HR: 11-digit OIB. Validated with the check digit."},"registration_number":{"type":"string","maxLength":20,"description":"SI matična številka / HR MB (optional)."},"address_line":{"type":"string","minLength":1,"maxLength":140,"description":"Street and number."},"postal_code":{"type":"string","minLength":3,"maxLength":10},"city":{"type":"string","minLength":1,"maxLength":80},"iban":{"type":"string","minLength":15,"maxLength":40,"description":"Account receiving payments. Must be a valid IBAN; printed on invoices and payment slips."},"bic":{"type":"string","maxLength":11},"email":{"type":"string","format":"email","description":"Reply-To address for invoice emails."},"phone":{"type":"string","maxLength":40},"website":{"type":"string","maxLength":120},"vat_registered":{"type":"boolean","description":"true if the issuer is registered for VAT (SI: ID za DDV, HR: u sustavu PDV-a). Non-VAT issuers print an exemption note and cannot charge VAT."},"vat_exemption_note":{"type":"string","maxLength":300,"description":"Override the default note printed when VAT is not charged."},"subject_to_fiscalization":{"type":"boolean","description":"Required. true if this issuer must fiscalise invoices (SI: davčno potrjevanje for cash/card payments; HR: Fiskalizacija 2.0 — VAT, profit or income tax payers). v1 does not fiscalise: SI issuers with true cannot use payment links (bank transfer only); HR issuers with true cannot issue invoices. A non-profit club collecting membership fees is usually false — ask the user if unsure."},"default_due_days":{"type":"integer","minimum":0,"maximum":365,"description":"Payment term used when an invoice has no due_date. Default 15."},"invoice_footer":{"type":"string","maxLength":300,"description":"Extra text in the PDF footer, e.g. court register data."},"number_format":{"type":"string","maxLength":40,"description":"Invoice number format. Tokens {YYYY} {YY} {SEQ} {SEQ:n}. Default '{YYYY}-{SEQ:4}' → 2026-0001. Numbering restarts every year."},"metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"description":"Up to 20 string key/value pairs for your own use (e.g. your member id). Returned as-is. Use opaque ids, not personal data."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/issuers/{id}/logo":{"put":{"summary":"Upload the issuer logo","operationId":"put_issuers_id_logo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","enum":["image/png","image/jpeg"]},"data_base64":{"type":"string","minLength":10,"description":"Base64 of a PNG or JPEG, max 1 MB."}},"required":["content_type","data_base64"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/issuers/{id}/stripe_onboarding":{"post":{"summary":"Get a Stripe Connect onboarding link for payment links","operationId":"post_issuers_id_stripe_onboarding","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices":{"get":{"summary":"List invoices","operationId":"get_invoices","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 20","schema":{"type":"string"}},{"name":"starting_after","in":"query","required":false,"description":"Id of the last object of the previous page","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter","schema":{"type":"string"}},{"name":"issuer","in":"query","required":false,"description":"Filter","schema":{"type":"string"}},{"name":"batch","in":"query","required":false,"description":"Filter","schema":{"type":"string"}},{"name":"number","in":"query","required":false,"description":"Filter","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create (finalise, send) an invoice","operationId":"post_invoices","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issuer":{"type":"string","description":"Issuer id (iss_…). May be omitted when the account has exactly one issuer."},"customer":{"type":"object","properties":{"type":{"type":"string","enum":["person","company"],"description":"Default person."},"name":{"type":"string","minLength":1,"maxLength":140,"description":"Printed on the invoice and the payment slip (payer)."},"email":{"type":"string","format":"email","maxLength":200,"description":"Where the invoice is emailed. Not printed."},"phone":{"type":"string","maxLength":40,"description":"For SMS/WhatsApp later. Not printed."},"address_line":{"type":"string","maxLength":140},"postal_code":{"type":"string","maxLength":10},"city":{"type":"string","maxLength":80},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO country code, default SI."},"tax_id":{"type":"string","maxLength":20,"description":"Recipient tax number (companies)."},"vat_id":{"type":"string","maxLength":20},"language":{"type":"string","enum":["sl","hr","en"],"description":"Email and hosted page language. Default: issuer country language."}},"required":["name"],"additionalProperties":false,"description":"The recipient, inline on every invoice. Računi does not store customers: keep your own member directory and put your id in invoice metadata (e.g. metadata.member_id)."},"items":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500,"description":"What is invoiced, e.g. 'Članarina december 2026'."},"quantity":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000,"description":"Default 1. Up to 3 decimals."},"unit":{"type":"string","maxLength":10,"description":"Unit of measure, e.g. 'kos', 'ura', 'mes'."},"unit_price":{"type":"number","minimum":0,"maximum":10000000,"description":"Price per unit in EUR with at most 2 decimals, e.g. 45.50 (not cents)."},"discount_percent":{"type":"number","minimum":0,"maximum":100},"vat_rate":{"type":"number","minimum":0,"maximum":30,"description":"VAT % for VAT-registered issuers. SI: 22, 9.5, 5, 0. HR: 25, 13, 5, 0. Default: country standard rate. Omit for non-VAT issuers."}},"required":["description","unit_price"],"additionalProperties":false},"minItems":1,"maxItems":200},"issue_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Default: today (Europe/Ljubljana) at finalisation."},"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Default: issue_date + due_days (or issuer default_due_days)."},"due_days":{"type":"integer","minimum":0,"maximum":365},"service_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date of supply. Default: issue_date. Use service_period for periods (e.g. a month of training)."},"service_period":{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},"prices_include_vat":{"type":"boolean","description":"Only for VAT-registered issuers: unit_price already includes VAT. Default false."},"note":{"type":"string","maxLength":1000,"description":"Free text printed on the invoice."},"payment_reference":{"type":"string","maxLength":22,"description":"Reference body without model, digits and up to 2 hyphens (e.g. '2026-0042'). Default: derived from the invoice number."},"payment_purpose":{"type":"string","maxLength":42,"description":"Payment purpose on the slip. Default 'Račun <number>'."},"payment_slip":{"type":"boolean","description":"Add the UPN QR (SI) / HUB-3 barcode (HR) slip to the PDF. Default true."},"payment_link":{"type":"boolean","description":"Add a card payment link (Stripe, money goes to the issuer's own Stripe account). Default false."},"finalize":{"type":"boolean","description":"Default true: assign a number and create the PDF. false keeps a draft you can change and finalize later."},"send":{"anyOf":[{"type":"boolean"},{"type":"object","properties":{"channels":{"type":"array","items":{"type":"string","enum":["email"]},"minItems":1,"description":"Delivery channels. Only 'email' in v1; SMS/WhatsApp later."},"to":{"type":"string","format":"email","description":"Override recipient email (default: customer.email)."}},"additionalProperties":false}],"description":"true (or {channels, to}) to deliver right after finalising. Default false."},"metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"description":"Up to 20 string key/value pairs for your own use (e.g. your member id). Returned as-is. Use opaque ids, not personal data."}},"required":["customer","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/batch":{"post":{"summary":"Create up to 500 invoices asynchronously","operationId":"post_invoices_batch","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoices":{"type":"array","items":{"type":"object","properties":{"issuer":{"type":"string","description":"Issuer id (iss_…). May be omitted when the account has exactly one issuer."},"customer":{"type":"object","properties":{"type":{"type":"string","enum":["person","company"],"description":"Default person."},"name":{"type":"string","minLength":1,"maxLength":140,"description":"Printed on the invoice and the payment slip (payer)."},"email":{"type":"string","format":"email","maxLength":200,"description":"Where the invoice is emailed. Not printed."},"phone":{"type":"string","maxLength":40,"description":"For SMS/WhatsApp later. Not printed."},"address_line":{"type":"string","maxLength":140},"postal_code":{"type":"string","maxLength":10},"city":{"type":"string","maxLength":80},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO country code, default SI."},"tax_id":{"type":"string","maxLength":20,"description":"Recipient tax number (companies)."},"vat_id":{"type":"string","maxLength":20},"language":{"type":"string","enum":["sl","hr","en"],"description":"Email and hosted page language. Default: issuer country language."}},"required":["name"],"additionalProperties":false,"description":"The recipient, inline on every invoice. Računi does not store customers: keep your own member directory and put your id in invoice metadata (e.g. metadata.member_id)."},"items":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500,"description":"What is invoiced, e.g. 'Članarina december 2026'."},"quantity":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000,"description":"Default 1. Up to 3 decimals."},"unit":{"type":"string","maxLength":10,"description":"Unit of measure, e.g. 'kos', 'ura', 'mes'."},"unit_price":{"type":"number","minimum":0,"maximum":10000000,"description":"Price per unit in EUR with at most 2 decimals, e.g. 45.50 (not cents)."},"discount_percent":{"type":"number","minimum":0,"maximum":100},"vat_rate":{"type":"number","minimum":0,"maximum":30,"description":"VAT % for VAT-registered issuers. SI: 22, 9.5, 5, 0. HR: 25, 13, 5, 0. Default: country standard rate. Omit for non-VAT issuers."}},"required":["description","unit_price"],"additionalProperties":false},"minItems":1,"maxItems":200},"issue_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Default: today (Europe/Ljubljana) at finalisation."},"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Default: issue_date + due_days (or issuer default_due_days)."},"due_days":{"type":"integer","minimum":0,"maximum":365},"service_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date of supply. Default: issue_date. Use service_period for periods (e.g. a month of training)."},"service_period":{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},"prices_include_vat":{"type":"boolean","description":"Only for VAT-registered issuers: unit_price already includes VAT. Default false."},"note":{"type":"string","maxLength":1000,"description":"Free text printed on the invoice."},"payment_reference":{"type":"string","maxLength":22,"description":"Reference body without model, digits and up to 2 hyphens (e.g. '2026-0042'). Default: derived from the invoice number."},"payment_purpose":{"type":"string","maxLength":42,"description":"Payment purpose on the slip. Default 'Račun <number>'."},"payment_slip":{"type":"boolean","description":"Add the UPN QR (SI) / HUB-3 barcode (HR) slip to the PDF. Default true."},"payment_link":{"type":"boolean","description":"Add a card payment link (Stripe, money goes to the issuer's own Stripe account). Default false."},"metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"description":"Up to 20 string key/value pairs for your own use (e.g. your member id). Returned as-is. Use opaque ids, not personal data."}},"required":["customer","items"],"additionalProperties":false},"minItems":1,"maxItems":500},"send":{"type":"boolean","description":"Send every invoice by email after finalising. Default false."}},"required":["invoices"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}":{"get":{"summary":"Get an invoice","operationId":"get_invoices_id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a draft invoice","operationId":"patch_invoices_id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issuer":{"type":"string","description":"Issuer id (iss_…). May be omitted when the account has exactly one issuer."},"customer":{"type":"object","properties":{"type":{"type":"string","enum":["person","company"],"description":"Default person."},"name":{"type":"string","minLength":1,"maxLength":140,"description":"Printed on the invoice and the payment slip (payer)."},"email":{"type":"string","format":"email","maxLength":200,"description":"Where the invoice is emailed. Not printed."},"phone":{"type":"string","maxLength":40,"description":"For SMS/WhatsApp later. Not printed."},"address_line":{"type":"string","maxLength":140},"postal_code":{"type":"string","maxLength":10},"city":{"type":"string","maxLength":80},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO country code, default SI."},"tax_id":{"type":"string","maxLength":20,"description":"Recipient tax number (companies)."},"vat_id":{"type":"string","maxLength":20},"language":{"type":"string","enum":["sl","hr","en"],"description":"Email and hosted page language. Default: issuer country language."}},"required":["name"],"additionalProperties":false,"description":"The recipient, inline on every invoice. Računi does not store customers: keep your own member directory and put your id in invoice metadata (e.g. metadata.member_id)."},"items":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500,"description":"What is invoiced, e.g. 'Članarina december 2026'."},"quantity":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000,"description":"Default 1. Up to 3 decimals."},"unit":{"type":"string","maxLength":10,"description":"Unit of measure, e.g. 'kos', 'ura', 'mes'."},"unit_price":{"type":"number","minimum":0,"maximum":10000000,"description":"Price per unit in EUR with at most 2 decimals, e.g. 45.50 (not cents)."},"discount_percent":{"type":"number","minimum":0,"maximum":100},"vat_rate":{"type":"number","minimum":0,"maximum":30,"description":"VAT % for VAT-registered issuers. SI: 22, 9.5, 5, 0. HR: 25, 13, 5, 0. Default: country standard rate. Omit for non-VAT issuers."}},"required":["description","unit_price"],"additionalProperties":false},"minItems":1,"maxItems":200},"issue_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Default: today (Europe/Ljubljana) at finalisation."},"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Default: issue_date + due_days (or issuer default_due_days)."},"due_days":{"type":"integer","minimum":0,"maximum":365},"service_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date of supply. Default: issue_date. Use service_period for periods (e.g. a month of training)."},"service_period":{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},"prices_include_vat":{"type":"boolean","description":"Only for VAT-registered issuers: unit_price already includes VAT. Default false."},"note":{"type":"string","maxLength":1000,"description":"Free text printed on the invoice."},"payment_reference":{"type":"string","maxLength":22,"description":"Reference body without model, digits and up to 2 hyphens (e.g. '2026-0042'). Default: derived from the invoice number."},"payment_purpose":{"type":"string","maxLength":42,"description":"Payment purpose on the slip. Default 'Račun <number>'."},"payment_slip":{"type":"boolean","description":"Add the UPN QR (SI) / HUB-3 barcode (HR) slip to the PDF. Default true."},"payment_link":{"type":"boolean","description":"Add a card payment link (Stripe, money goes to the issuer's own Stripe account). Default false."},"metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"description":"Up to 20 string key/value pairs for your own use (e.g. your member id). Returned as-is. Use opaque ids, not personal data."}},"additionalProperties":false,"description":"Only drafts can be updated."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a draft invoice","operationId":"delete_invoices_id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/pdf":{"get":{"summary":"Download the PDF","operationId":"get_invoices_id_pdf","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/pdf":{}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/payment_code":{"get":{"summary":"PNG of the UPN QR (SI) / HUB-3 barcode (HR)","operationId":"get_invoices_id_payment_code","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"image/png":{}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/finalize":{"post":{"summary":"Finalise a draft (number + PDF)","operationId":"post_invoices_id_finalize","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/send":{"post":{"summary":"Send (or resend) by email","operationId":"post_invoices_id_send","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"string","enum":["email"]},"minItems":1},"to":{"type":"string","format":"email"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/mark_paid":{"post":{"summary":"Mark as paid","operationId":"post_invoices_id_mark_paid","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paid_at":{"type":"string","format":"date-time","description":"ISO timestamp, default now."},"method":{"type":"string","enum":["bank_transfer","cash","card","other"],"description":"Default bank_transfer."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/void":{"post":{"summary":"Void an undelivered invoice","operationId":"post_invoices_id_void","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batches/{id}":{"get":{"summary":"Get a batch and per-item results","operationId":"get_batches_id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook_endpoints":{"get":{"summary":"List webhook endpoints","operationId":"get_webhook_endpoints","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a webhook endpoint (returns the secret once)","operationId":"post_webhook_endpoints","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":500,"description":"HTTPS URL receiving POSTed events (test mode also accepts http)."},"events":{"type":"array","items":{"type":"string"},"description":"Event types to receive, or ['*'] (default) for all."},"description":{"type":"string","maxLength":200}},"required":["url"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook_endpoints/{id}":{"delete":{"summary":"Delete a webhook endpoint","operationId":"delete_webhook_endpoints_id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"summary":"List events","operationId":"get_events","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 20","schema":{"type":"string"}},{"name":"starting_after","in":"query","required":false,"description":"Id of the last object of the previous page","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"description":"Filter by event type","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deliveries":{"get":{"summary":"Delivery log","operationId":"get_deliveries","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 20","schema":{"type":"string"}},{"name":"starting_after","in":"query","required":false,"description":"Id of the last object of the previous page","schema":{"type":"string"}},{"name":"invoice","in":"query","required":false,"description":"Filter","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"summary":"Credit balance and live usage (30 days)","operationId":"get_usage","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/test_helpers/invoices/{id}/simulate":{"post":{"summary":"Test mode: simulate delivered/opened/bounced/paid","operationId":"post_test_helpers_invoices_id_simulate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe (24 h).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["delivered","opened","bounced","paid"]}},"required":["event"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}