BillOS v1
Console llms.txt OpenAPI
POST/businesses/{bid}/expenses/{id}/record

Record an expense

POST /businesses/{bid}/expenses/{id}/record

Requires the expenses scope.

Writes the immutable ledger row. A non-ILS expense without amountIls is refused: the ledger sums agorot without looking at currency, and the row cannot be edited afterwards.

Path parameters

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

Response

201: { "ok": true, … }

FieldTypeDescription
okbooleanrequired
expenseExpenserequiredThe purchase side of the ledger. A recorded expense is immutable; correct it with a storno.

Errors: 400, 401, 403, 404, 409, 429. Every failure answers { "error": …, "reason": … }. Branch on reason.

POST /businesses/{bid}/expenses/{id}/record
curl -X POST "$BASE/businesses/$BID/expenses/$DOC_ID/record" \
  -H "X-Api-Key: $KEY"
const res = await fetch(`${BASE}/businesses/${BID}/expenses/${DOC_ID}/record`, {
  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}/expenses/{DOC_ID}/record",
    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.