BillOS v1
Console llms.txt OpenAPI
POST/businesses/{bid}/appointments/{id}/document

Open the draft document that bills it

POST /businesses/{bid}/appointments/{id}/document

Requires the businesses scope.

A DRAFT with the customer and one line (the title and the day, at the appointment's price), filed under externalRef: appointment:<id>. Default type: an invoice-receipt (320), a receipt (400) for a עוסק פטור. A second call returns the open draft or the issued document. Issuing is the ordinary issue call. Needs documents on top of businesses.

Path parameters

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

Body (optional)

FieldTypeDescription
docTypeintegerAny type the business may issue.
paymentsarray of Payment
documentDatestringDefault: today.

Response

201: { "ok": true, … }

FieldTypeDescription
okbooleanrequired
documentDocumentrequiredA draft is freely mutable. An issued document is immutable forever, blocked at the database engine, not merely in application code.

Errors: 400, 401, 403, 404, 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}/appointments/{id}/document
curl -X POST "$BASE/businesses/$BID/appointments/$DOC_ID/document" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "payments": [
      {
        "method": 3,
        "amount": 120000
      }
    ]
  }'
const res = await fetch(`${BASE}/businesses/${BID}/appointments/${DOC_ID}/document`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "payments": [
      {
        "method": 3,
        "amount": 120000
      }
    ]
  }),
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/appointments/{DOC_ID}/document",
    headers={"X-Api-Key": KEY},
    json={
      "payments": [
        {
          "method": 3,
          "amount": 120000
        }
      ]
    },
)
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.