BillOS v1
Console llms.txt OpenAPI
POST/businesses/{bid}/documents/{id}/validate

Check a draft without issuing it

POST /businesses/{bid}/documents/{id}/validate

Requires the documents scope.

A dry run of issue. Runs every check issuing runs (account standing, the dealer type, totals, payments against the total, the allocation-number rule, the exchange rate, what a receipt settles) and stops before the first write: no number is taken, nothing is signed, the draft is unchanged. Answers what the issued document would be, or the exact refusal issuing would give, with its hint and param.

Call it before issue whenever the caller cannot afford a permanent mistake: an issued document is corrected only by a credit note.

Path parameters

NameTypeDescription
bidstringrequiredBusiness id, from POST /businesses.
idstringrequiredDocument id.

Body (optional)

FieldTypeDescription
brandingBrandingAppearance of the rendered PDF. Stored once per business; a logo is stored as a file and referenced by hash, never re-frozen into each document.

Response

200: { "ok": true, … }

FieldTypeDescription
okbooleanrequired
validbooleanrequired
wouldIssueobjectrequiredThe figures the issued document would carry.
wouldIssue.docTypeintegerDocument type code.
wouldIssue.currencystringISO currency of the document.
wouldIssue.totalExVatintegerTotal before VAT, as the ledger would record it. Integer agorot (₪1 = 100).
wouldIssue.vatAmountintegerVAT. Integer agorot (₪1 = 100).
wouldIssue.totalIncVatintegerTotal including VAT. Integer agorot (₪1 = 100).
wouldIssue.fxRatenumberOn a foreign-currency document: the rate that would be used (ILS per 1 unit).
wouldIssue.fxTotalIncVatintegerOn a foreign-currency document: the total in that currency's minor unit.
wouldIssue.allocationstringWhether an allocation number (מספר הקצאה) is in play. One of: not_required, will_be_requested, missing.
warningsarray of stringWhat issue would warn about (allocation_missing, check_details_missing, unsigned).

Errors: 400, 401, 403, 404, 409, 422, 429. Every failure answers { "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }: branch on reason, and read hint for what to change (https://docs.billos.co.il/errors.md).

POST /businesses/{bid}/documents/{id}/validate
curl -X POST "$BASE/businesses/$BID/documents/$DOC_ID/validate" \
  -H "X-Api-Key: $KEY"
const res = await fetch(`${BASE}/businesses/${BID}/documents/${DOC_ID}/validate`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/documents/{DOC_ID}/validate",
    headers={"X-Api-Key": KEY},
)
data = res.json()
Set BASE to https://api.billos.co.il/v1 and KEY to your bk_live_… key, or a bk_test_… key to run it against the sandbox.
Manage your businesses, keys and webhooks in the BillOS Console.