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

Create and record in one call

POST /businesses/{bid}/expenses/record

Requires the expenses scope.

A complete receipt in hand and no draft to keep: the same input the record step takes, recorded in one round-trip. Idempotent on the key.

Path parameters

NameTypeDescription
bidstringrequiredBusiness id, from POST /businesses.

Headers

NameTypeDescription
Idempotency-KeystringYour own stable id for this call. A retry returns the same row with deduped: true instead of creating a duplicate. Interchangeable with externalRef in the body.

Body

FieldTypeDescription
inputobjectrequiredSame fields as creating an expense.

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