{"openapi":"3.1.0","info":{"title":"Invoicora API","version":"1.1.0","description":"Create invoices, quotations, receipts and credit notes as PDFs. Every money value is an integer in minor units: 1250 means 12.50, never 12.5. The free generator at www.invoicora.com needs no account and uploads nothing; this API is the optional, account-based side of the product.\n\nThere are two ways to use it. `POST /render` and `POST /calculate` store nothing and are the whole API if all you want is a PDF. Everything else belongs to a workspace: documents are numbered, kept, rendered once, reachable at a hosted link and tracked through issued, sent, viewed and paid.","license":{"name":"Proprietary"}},"servers":[{"url":"https://app.invoicora.com/api/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Documents","description":"Stateless rendering and totals."},{"name":"Stored documents","description":"Numbered, kept, rendered once and reachable at a hosted link."},{"name":"Clients","description":"The people you invoice."},{"name":"Business profiles","description":"The business doing the invoicing."},{"name":"Number series","description":"How a document gets its number."},{"name":"Webhooks","description":"Where to tell you something happened."},{"name":"Schedules","description":"Documents that repeat."},{"name":"API keys","description":"Keys for this workspace."},{"name":"Workspace","description":"The account behind the key."}],"paths":{"/render":{"post":{"tags":["Documents"],"operationId":"renderDocument","summary":"Render a document to a PDF","description":"Takes a document and returns the PDF. Nothing is stored: no row, no file and no record of the contents. The PDF is byte for byte the document the browser builds from the same input.","parameters":[{"name":"format","in":"query","required":false,"description":"Set to `json` to receive the PDF base64 encoded inside a JSON envelope instead of as a file.","schema":{"type":"string","enum":["json"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}}}},"responses":{"200":{"description":"The rendered PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer"},"pdfBase64":{"type":"string"}},"required":["fileName","contentType","bytes","pdfBase64"]}}}},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. `Retry-After` says how long to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calculate":{"post":{"tags":["Documents"],"operationId":"calculateTotals","summary":"Work out the totals without rendering","description":"Returns the subtotal, discount, tax bands and total for a document, in minor units and as formatted strings. Meant for a live preview inside someone else's form.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}}}},"responses":{"200":{"description":"The totals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Totals"}}}},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. `Retry-After` says how long to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents":{"get":{"tags":["Stored documents"],"operationId":"listDocuments","summary":"List documents","description":"Newest first, paged with a cursor. Pass the previous page's `nextCursor` as `cursor`. A cursor is used rather than an offset so a document created between two pages cannot make a row appear twice or not at all.","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["draft","issued","sent","viewed","paid","partially_paid","overdue","void"]}},{"name":"clientId","in":"query","schema":{"type":"string"}},{"name":"externalRef","in":"query","description":"The id this document has in your own system.","schema":{"type":"string"}},{"name":"issuedFrom","in":"query","schema":{"type":"string","format":"date"}},{"name":"issuedTo","in":"query","schema":{"type":"string","format":"date"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"A page of documents.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Stored documents"],"operationId":"createDocument","summary":"Create a document","description":"Creates a draft, or an issued document when `issue` is true. The seller may be left out when the workspace has a default business profile, and the buyer when `clientId` names a client.\n\nSend an `Idempotency-Key` header. A retry with the same key returns the document the first call created rather than making a second one, which is what stops a timed out request becoming two invoices with two numbers. The same key with a different body is an error.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string you can reproduce on a retry, for example your own order id.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentCreateInput"}}}},"responses":{"200":{"description":"The document an earlier call with this Idempotency-Key created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace is over its monthly allowance for issued documents. Drafts, rendering and totals are unaffected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. `Retry-After` says how long to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}":{"get":{"tags":["Stored documents"],"operationId":"getDocument","summary":"Fetch a document and its timeline","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The document, with `events`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Stored documents"],"operationId":"updateDocument","summary":"Change a draft","description":"Drafts only. Once a document is issued its number is out in the world, and quietly changing what that number refers to is how an invoice stops being evidence of anything. Void it and create a new one instead.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPatchInput"}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}/issue":{"post":{"tags":["Stored documents"],"operationId":"issueDocument","summary":"Issue a draft","description":"Allocates the number from the document's series, inside a transaction holding a lock on that series, so two callers issuing at the same moment cannot be given the same number.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace is over its monthly allowance for issued documents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}/void":{"post":{"tags":["Stored documents"],"operationId":"voidDocument","summary":"Void a document","description":"The row and its number stay. A gap in a numbering series is a question an auditor will ask, and `void` is a better answer than a missing row.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Voided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}/payments":{"post":{"tags":["Stored documents"],"operationId":"recordPayment","summary":"Record a payment","description":"Sets `partially_paid` or `paid` from the amounts. The status is derived rather than sent, so nothing can be marked paid without saying what was paid.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentInput"}}}},"responses":{"200":{"description":"Recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}/pdf":{"get":{"tags":["Stored documents"],"operationId":"getDocumentPdf","summary":"Fetch the PDF","description":"Rendered on first request and kept, so the bytes never change under a client who downloaded it last month.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}/events":{"get":{"tags":["Stored documents"],"operationId":"listDocumentEvents","summary":"The timeline","description":"Append only, oldest first: created, issued, sent, viewed, paid, voided.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The events."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}/send":{"post":{"tags":["Stored documents"],"operationId":"sendDocument","summary":"Email the document","description":"Sends a short summary in the document's own language, the hosted link, and the PDF attached. From `documents@invoicora.com` with reply-to set to the workspace address. A `ik_test_` key writes the same log row and sends nothing, so an integration can be exercised without mailing real customers.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendDocumentInput"}}}},"responses":{"200":{"description":"Sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"operationId":"listWebhooks","summary":"List endpoints","description":"The secret is never in a listing: it is returned once, when the endpoint is created.","responses":{"200":{"description":"The endpoints."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"operationId":"createWebhook","summary":"Add an endpoint","description":"Events: document.created, document.issued, document.sent, document.viewed, document.paid, document.partially_paid, document.overdue, document.voided, document.restored, schedule.ran. An empty `events` list means every event.\n\nEvery delivery carries `Invoicora-Signature: t=<unix seconds>,v1=<hmac>`, an HMAC-SHA256 over `{timestamp}.{body}` using the secret. Verify it over the raw body, in constant time, and reject a timestamp more than a few minutes old. `@invoicora/node` exports `verifyWebhook` which does all three.\n\nA failed delivery is retried with exponential backoff for about 21 hours, then kept so it can be resent by hand.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"201":{"description":"Created, with the secret shown once."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}":{"get":{"tags":["Webhooks"],"operationId":"getWebhook","summary":"Fetch one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Found."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Webhooks"],"operationId":"updateWebhook","summary":"Change one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"200":{"description":"Changed."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"operationId":"deleteWebhook","summary":"Remove one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/deliveries":{"get":{"tags":["Webhooks"],"operationId":"listWebhookDeliveries","summary":"The delivery log","description":"Every attempt, newest first, with the response status and the error if there was one.","parameters":[{"name":"webhookId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"The log."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/deliveries/{id}/resend":{"post":{"tags":["Webhooks"],"operationId":"resendWebhookDelivery","summary":"Send it again","description":"Replays the same payload with a fresh timestamp and signature, including one that was given up on.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Attempted."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules":{"get":{"tags":["Schedules"],"operationId":"listSchedules","summary":"List schedules","responses":{"200":{"description":"The schedules."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Schedules"],"operationId":"createSchedule","summary":"Create a schedule","description":"A document template plus a cadence and a timezone. The timezone decides what `the 1st of the month` means: a schedule in Asia/Karachi runs on its own 1st, not UTC's. A run is identified by its period, so repeated or overlapping scheduler passes create exactly one document per period.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleInput"}}}},"responses":{"201":{"description":"Created."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules/{id}":{"get":{"tags":["Schedules"],"operationId":"getSchedule","summary":"Fetch one, with whether it is due now","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Found."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Schedules"],"operationId":"updateSchedule","summary":"Change one, or pause it with `paused`","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleInput"}}}},"responses":{"200":{"description":"Changed."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Schedules"],"operationId":"deleteSchedule","summary":"Remove one. The documents it created stay","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace":{"get":{"tags":["Workspace"],"operationId":"getWorkspace","summary":"The account behind the key","responses":{"200":{"description":"The workspace."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Workspace"],"operationId":"updateWorkspace","summary":"Change its name, reply-to address or reminder rules","description":"A reminder rule is an offset in days from the due date: -3 is three days before, 0 is on the day, 7 is a week after. The daily job reads them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePatchInput"}}}},"responses":{"200":{"description":"Changed."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leads":{"post":{"tags":["Workspace"],"operationId":"createLead","summary":"Ask to be told when something exists","description":"The one endpoint with no API key, for the notify-me forms on www.invoicora.com, which is a static site with nowhere else to post. An email address, which page asked, and an optional sentence. Answers 202 whatever happens next.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"},"company":{"type":"string"},"source":{"type":"string","enum":["api","pricing","integrations","recurring","email"]},"note":{"type":"string"}},"required":["email"]}}}},"responses":{"202":{"description":"Noted."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. `Retry-After` says how long to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/clients":{"get":{"tags":["Clients"],"operationId":"listClients","summary":"List the people you invoice","responses":{"200":{"description":"The list.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Clients"],"operationId":"createClient","summary":"Create the people you invoice","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientInput"}}}},"responses":{"201":{"description":"Created."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/clients/{id}":{"get":{"tags":["Clients"],"operationId":"getClient","summary":"Fetch one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Found."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Clients"],"operationId":"updateClient","summary":"Change one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientInput"}}}},"responses":{"200":{"description":"Changed."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Clients"],"operationId":"deleteClient","summary":"Delete one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/business-profiles":{"get":{"tags":["Business profiles"],"operationId":"listBusinessProfiles","summary":"List the business doing the invoicing","responses":{"200":{"description":"The list.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Business profiles"],"operationId":"createBusinessProfile","summary":"Create the business doing the invoicing","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessProfileInput"}}}},"responses":{"201":{"description":"Created."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/business-profiles/{id}":{"get":{"tags":["Business profiles"],"operationId":"getBusinessProfile","summary":"Fetch one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Found."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Business profiles"],"operationId":"updateBusinessProfile","summary":"Change one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessProfileInput"}}}},"responses":{"200":{"description":"Changed."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Business profiles"],"operationId":"deleteBusinessProfile","summary":"Delete one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/number-series":{"get":{"tags":["Number series"],"operationId":"listNumberSeriess","summary":"List how a document gets its number","responses":{"200":{"description":"The list.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Number series"],"operationId":"createNumberSeries","summary":"Create how a document gets its number","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberSeriesInput"}}}},"responses":{"201":{"description":"Created."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/number-series/{id}":{"get":{"tags":["Number series"],"operationId":"getNumberSeries","summary":"Fetch one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Found."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Number series"],"operationId":"updateNumberSeries","summary":"Change one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberSeriesInput"}}}},"responses":{"200":{"description":"Changed."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Number series"],"operationId":"deleteNumberSeries","summary":"Delete one","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api-keys":{"get":{"tags":["API keys"],"operationId":"listApiKeys","summary":"List this workspace's keys","description":"A listing carries each key's prefix, never the key and never its hash, so a leaked list is an inconvenience rather than a breach.","responses":{"200":{"description":"The keys."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The bootstrap key has no workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["API keys"],"operationId":"createApiKey","summary":"Create a key","description":"The key is in this response and nowhere else, ever. Only a SHA-256 hash of it is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"mode":{"type":"string","enum":["live","test"]}},"required":["name"]}}}},"responses":{"201":{"description":"Created, with the key shown once."},"400":{"description":"The body did not validate. `fields` names each problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api-keys/{id}":{"delete":{"tags":["API keys"],"operationId":"revokeApiKey","summary":"Revoke a key","description":"Revokes rather than deletes, so `which key did this?` still has an answer after the key stops working.","parameters":[{"name":"id","in":"path","required":true,"description":"The resource id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked."},"401":{"description":"The API key is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Send your key as `Authorization: Bearer <key>`. A `ik_test_` key marks everything it creates as a test and never sends real email."}},"schemas":{"DocumentInput":{"type":"object","properties":{"docType":{"default":"invoice","type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"country":{"default":null,"anyOf":[{"type":"string","pattern":"^[a-z]{2}$"},{"type":"null"}]},"languages":{"default":["en"],"anyOf":[{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":1,"maxItems":1},{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]},{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":2,"maxItems":2}]},"numerals":{"type":"string","enum":["latn","arab"]},"number":{"type":"string","maxLength":60},"issueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"default":"USD","type":"string","pattern":"^[A-Z]{3}$"},"paperSize":{"type":"string","enum":["a4","letter"]},"seller":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"buyer":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"description":{"default":"","type":"string","maxLength":500},"quantity":{"default":1,"type":"number","minimum":0},"unit":{"type":"string","maxLength":30},"unitPriceMinor":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"discountPct":{"type":"number","minimum":0,"maximum":100},"taxRatePct":{"type":"number","minimum":0,"maximum":100}}}},"discount":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"percent"},"value":{"type":"number","minimum":0,"maximum":100}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","amountMinor"]}]},"taxMode":{"default":"none","type":"string","enum":["per-line","overall","none"]},"taxRatePct":{"type":"number","minimum":0,"maximum":100},"notes":{"type":"string","maxLength":2000},"terms":{"type":"string","maxLength":2000},"payment":{"type":"object","properties":{"bankName":{"type":"string","maxLength":120},"accountName":{"type":"string","maxLength":120},"accountNumber":{"type":"string","maxLength":60},"iban":{"type":"string","maxLength":60},"swift":{"type":"string","maxLength":20},"other":{"type":"string","maxLength":500}}},"signature":{"type":"string"},"stamp":{"type":"string"},"template":{"default":"minimal","type":"string","enum":["minimal","classic","modern-accent","bold-header","bilingual-split","gulf-tax-invoice","corporate","creative","compact-receipt","elegant-serif"]},"accentColor":{"default":"lilac","type":"string","enum":["lilac","lime","pink","cream","mint","coral","navy","ink"]},"references":{"type":"object","properties":{"originalInvoiceNumber":{"type":"string","maxLength":60},"source":{"type":"object","properties":{"docType":{"type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"number":{"type":"string","maxLength":60}},"required":["docType","number"]}}},"details":{"type":"object","propertyNames":{"type":"string","enum":["orderReference","vehicleNumber","receivedBy","shipTo","paymentMethod","paymentReference","approvedBy","property","rentPeriod"]},"additionalProperties":{"type":"string","maxLength":200}},"wordsScale":{"type":"string","enum":["international","south-asian"]},"hidePrices":{"type":"boolean"}},"required":["issueDate","seller","buyer","items"]},"DocumentCreateInput":{"type":"object","properties":{"docType":{"default":"invoice","type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"country":{"default":null,"anyOf":[{"type":"string","pattern":"^[a-z]{2}$"},{"type":"null"}]},"languages":{"default":["en"],"anyOf":[{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":1,"maxItems":1},{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]},{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":2,"maxItems":2}]},"numerals":{"type":"string","enum":["latn","arab"]},"number":{"type":"string","maxLength":60},"issueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"default":"USD","type":"string","pattern":"^[A-Z]{3}$"},"paperSize":{"type":"string","enum":["a4","letter"]},"seller":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"buyer":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"description":{"default":"","type":"string","maxLength":500},"quantity":{"default":1,"type":"number","minimum":0},"unit":{"type":"string","maxLength":30},"unitPriceMinor":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"discountPct":{"type":"number","minimum":0,"maximum":100},"taxRatePct":{"type":"number","minimum":0,"maximum":100}}}},"discount":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"percent"},"value":{"type":"number","minimum":0,"maximum":100}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","amountMinor"]}]},"taxMode":{"default":"none","type":"string","enum":["per-line","overall","none"]},"taxRatePct":{"type":"number","minimum":0,"maximum":100},"notes":{"type":"string","maxLength":2000},"terms":{"type":"string","maxLength":2000},"payment":{"type":"object","properties":{"bankName":{"type":"string","maxLength":120},"accountName":{"type":"string","maxLength":120},"accountNumber":{"type":"string","maxLength":60},"iban":{"type":"string","maxLength":60},"swift":{"type":"string","maxLength":20},"other":{"type":"string","maxLength":500}}},"signature":{"type":"string"},"stamp":{"type":"string"},"template":{"default":"minimal","type":"string","enum":["minimal","classic","modern-accent","bold-header","bilingual-split","gulf-tax-invoice","corporate","creative","compact-receipt","elegant-serif"]},"accentColor":{"default":"lilac","type":"string","enum":["lilac","lime","pink","cream","mint","coral","navy","ink"]},"references":{"type":"object","properties":{"originalInvoiceNumber":{"type":"string","maxLength":60},"source":{"type":"object","properties":{"docType":{"type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"number":{"type":"string","maxLength":60}},"required":["docType","number"]}}},"details":{"type":"object","propertyNames":{"type":"string","enum":["orderReference","vehicleNumber","receivedBy","shipTo","paymentMethod","paymentReference","approvedBy","property","rentPeriod"]},"additionalProperties":{"type":"string","maxLength":200}},"wordsScale":{"type":"string","enum":["international","south-asian"]},"hidePrices":{"type":"boolean"},"clientId":{"type":"string","maxLength":80},"businessProfileId":{"type":"string","maxLength":80},"numberSeriesId":{"type":"string","maxLength":80},"externalRef":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"issue":{"default":false,"type":"boolean"}},"required":["items"]},"DocumentPatchInput":{"type":"object","properties":{"docType":{"default":"invoice","type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"country":{"default":null,"anyOf":[{"type":"string","pattern":"^[a-z]{2}$"},{"type":"null"}]},"languages":{"default":["en"],"anyOf":[{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":1,"maxItems":1},{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]},{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":2,"maxItems":2}]},"numerals":{"type":"string","enum":["latn","arab"]},"number":{"type":"string","maxLength":60},"issueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"default":"USD","type":"string","pattern":"^[A-Z]{3}$"},"paperSize":{"type":"string","enum":["a4","letter"]},"seller":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"buyer":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"description":{"default":"","type":"string","maxLength":500},"quantity":{"default":1,"type":"number","minimum":0},"unit":{"type":"string","maxLength":30},"unitPriceMinor":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"discountPct":{"type":"number","minimum":0,"maximum":100},"taxRatePct":{"type":"number","minimum":0,"maximum":100}}}},"discount":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"percent"},"value":{"type":"number","minimum":0,"maximum":100}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","amountMinor"]}]},"taxMode":{"default":"none","type":"string","enum":["per-line","overall","none"]},"taxRatePct":{"type":"number","minimum":0,"maximum":100},"notes":{"type":"string","maxLength":2000},"terms":{"type":"string","maxLength":2000},"payment":{"type":"object","properties":{"bankName":{"type":"string","maxLength":120},"accountName":{"type":"string","maxLength":120},"accountNumber":{"type":"string","maxLength":60},"iban":{"type":"string","maxLength":60},"swift":{"type":"string","maxLength":20},"other":{"type":"string","maxLength":500}}},"signature":{"type":"string"},"stamp":{"type":"string"},"template":{"default":"minimal","type":"string","enum":["minimal","classic","modern-accent","bold-header","bilingual-split","gulf-tax-invoice","corporate","creative","compact-receipt","elegant-serif"]},"accentColor":{"default":"lilac","type":"string","enum":["lilac","lime","pink","cream","mint","coral","navy","ink"]},"references":{"type":"object","properties":{"originalInvoiceNumber":{"type":"string","maxLength":60},"source":{"type":"object","properties":{"docType":{"type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"number":{"type":"string","maxLength":60}},"required":["docType","number"]}}},"details":{"type":"object","propertyNames":{"type":"string","enum":["orderReference","vehicleNumber","receivedBy","shipTo","paymentMethod","paymentReference","approvedBy","property","rentPeriod"]},"additionalProperties":{"type":"string","maxLength":200}},"wordsScale":{"type":"string","enum":["international","south-asian"]},"hidePrices":{"type":"boolean"},"clientId":{"type":"string","maxLength":80},"businessProfileId":{"type":"string","maxLength":80},"numberSeriesId":{"type":"string","maxLength":80},"externalRef":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}},"ClientInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"country":{"anyOf":[{"type":"string","pattern":"^[a-z]{2}$"},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"locale":{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]},"notes":{"type":"string","maxLength":2000},"externalRef":{"type":"string","maxLength":200}},"required":["name"]},"BusinessProfileInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"},"country":{"anyOf":[{"type":"string","pattern":"^[a-z]{2}$"},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"locale":{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]},"template":{"type":"string","enum":["minimal","classic","modern-accent","bold-header","bilingual-split","gulf-tax-invoice","corporate","creative","compact-receipt","elegant-serif"]},"accentColor":{"type":"string","enum":["lilac","lime","pink","cream","mint","coral","navy","ink"]},"payment":{"type":"object","properties":{"bankName":{"type":"string","maxLength":120},"accountName":{"type":"string","maxLength":120},"accountNumber":{"type":"string","maxLength":60},"iban":{"type":"string","maxLength":60},"swift":{"type":"string","maxLength":20},"other":{"type":"string","maxLength":500}}},"isDefault":{"type":"boolean"}},"required":["name"]},"NumberSeriesInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"pattern":{"type":"string","minLength":1,"maxLength":60},"nextValue":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"reset":{"default":"never","type":"string","enum":["never","yearly"]},"isDefault":{"type":"boolean"}},"required":["name","pattern"]},"PaymentInput":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":"string","maxLength":60},"reference":{"type":"string","maxLength":120},"note":{"type":"string","maxLength":500}},"required":["amountMinor"]},"SendDocumentInput":{"type":"object","properties":{"to":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"cc":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","maxLength":200},"message":{"type":"string","maxLength":2000},"locale":{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]},"attachPdf":{"default":true,"type":"boolean"}},"required":["to"]},"WebhookInput":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"events":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","enum":["document.created","document.issued","document.sent","document.viewed","document.paid","document.partially_paid","document.overdue","document.voided","document.restored","schedule.ran"]}},"active":{"default":true,"type":"boolean"}},"required":["url"]},"ScheduleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"clientId":{"type":"string","maxLength":80},"numberSeriesId":{"type":"string","maxLength":80},"template":{"type":"object","properties":{"docType":{"default":"invoice","type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"country":{"default":null,"anyOf":[{"type":"string","pattern":"^[a-z]{2}$"},{"type":"null"}]},"languages":{"default":["en"],"anyOf":[{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":1,"maxItems":1},{"type":"array","prefixItems":[{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]},{"type":"string","enum":["en","ar","id","es","pt","fr","de","it","nl","pl","tr","ro","cs","sv","hu","ms","vi","sw","ru","uk","el","zh","zh-tw","ja","ko","th","hi","bn","ur","fa","he"]}],"items":false,"minItems":2,"maxItems":2}]},"numerals":{"type":"string","enum":["latn","arab"]},"number":{"type":"string","maxLength":60},"issueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"default":"USD","type":"string","pattern":"^[A-Z]{3}$"},"paperSize":{"type":"string","enum":["a4","letter"]},"seller":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"buyer":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"type":"string","maxLength":500},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"taxIds":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":60}},"logo":{"type":"string"}},"required":["name"]},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"description":{"default":"","type":"string","maxLength":500},"quantity":{"default":1,"type":"number","minimum":0},"unit":{"type":"string","maxLength":30},"unitPriceMinor":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"discountPct":{"type":"number","minimum":0,"maximum":100},"taxRatePct":{"type":"number","minimum":0,"maximum":100}}}},"discount":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"percent"},"value":{"type":"number","minimum":0,"maximum":100}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","amountMinor"]}]},"taxMode":{"default":"none","type":"string","enum":["per-line","overall","none"]},"taxRatePct":{"type":"number","minimum":0,"maximum":100},"notes":{"type":"string","maxLength":2000},"terms":{"type":"string","maxLength":2000},"payment":{"type":"object","properties":{"bankName":{"type":"string","maxLength":120},"accountName":{"type":"string","maxLength":120},"accountNumber":{"type":"string","maxLength":60},"iban":{"type":"string","maxLength":60},"swift":{"type":"string","maxLength":20},"other":{"type":"string","maxLength":500}}},"signature":{"type":"string"},"stamp":{"type":"string"},"template":{"default":"minimal","type":"string","enum":["minimal","classic","modern-accent","bold-header","bilingual-split","gulf-tax-invoice","corporate","creative","compact-receipt","elegant-serif"]},"accentColor":{"default":"lilac","type":"string","enum":["lilac","lime","pink","cream","mint","coral","navy","ink"]},"references":{"type":"object","properties":{"originalInvoiceNumber":{"type":"string","maxLength":60},"source":{"type":"object","properties":{"docType":{"type":"string","enum":["invoice","tax-invoice","quotation","proforma","receipt","credit-note","export-invoice","nota","kwitansi","purchase-order","delivery-challan","payment-voucher","rent-receipt"]},"number":{"type":"string","maxLength":60}},"required":["docType","number"]}}},"details":{"type":"object","propertyNames":{"type":"string","enum":["orderReference","vehicleNumber","receivedBy","shipTo","paymentMethod","paymentReference","approvedBy","property","rentPeriod"]},"additionalProperties":{"type":"string","maxLength":200}},"wordsScale":{"type":"string","enum":["international","south-asian"]},"hidePrices":{"type":"boolean"}},"required":["seller","buyer","items"]},"cadence":{"type":"string","enum":["weekly","monthly","yearly"]},"cadenceDay":{"type":"integer","minimum":1,"maximum":31},"timezone":{"default":"UTC","type":"string","maxLength":60},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"autoSend":{"default":false,"type":"boolean"},"paused":{"default":false,"type":"boolean"}},"required":["name","template","cadence","startDate"]},"WorkspacePatchInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"reminders":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"offsetDays":{"type":"integer","minimum":-60,"maximum":180}},"required":["offsetDays"]}}}},"Document":{"$ref":"#/$defs/Document"},"Totals":{"$ref":"#/$defs/Totals"},"Error":{"$ref":"#/$defs/Error"}}}}