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

Create an expense

POST /businesses/{bid}/expenses

Requires the expenses scope.

Opens a draft, or records in one call when the body is complete. amountIncVat is the GROSS (Israeli prices include VAT) and vatAmount is the portion inside it. Never add the two.

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
supplierNamestring
supplierTaxIdstring
documentDatestring
documentNumberstring
amountIncVatintegerGross, VAT included. Integer agorot (₪1 = 100).
vatAmountintegerThe portion inside the gross. Integer agorot (₪1 = 100).
deductibleVatBpintegerBasis points; 10000 = fully deductible.
currencystringISO 4217, default ILS.
amountIlsintegerRequired to record a non-ILS expense. Integer agorot (₪1 = 100).
fxRatenumberRate used for amountIls.
categoryKeystring
externalRefstringIdempotency key.
recordbooleanRecord immediately instead of leaving a draft.

Response

201: { "ok": true, … }

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

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

POST /businesses/{bid}/expenses
curl -X POST "$BASE/businesses/$BID/expenses" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalRef": "order-8812"
  }'
const res = await fetch(`${BASE}/businesses/${BID}/expenses`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "externalRef": "order-8812"
  }),
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/expenses",
    headers={"X-Api-Key": KEY},
    json={
      "externalRef": "order-8812"
    },
)
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.