Suggest Bill Line Accounts
POST/api/bills/ocr/suggest-accounts
Suggest an expense account (nominal code) for each line of a bill being entered, with the reason for each suggestion. Writes nothing.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Suggestions come, in order, from: an account already on the line (never replaced), the accounts this supplier's recent bills booked the same description to, the line's cost category default account, and the account this supplier is usually booked to.
Body:
supplier_id(optional, integer, nullable) - an existing supplier; without it only the cost category default can be used.lines(required, array, 1-500 items):lines.*.description(required key, string or null, max 500) - the line description.lines.*.nominal_code_id(optional, integer, nullable) - an account already chosen for the line.lines.*.cost_category_id(optional, integer, nullable) - the line's cost category.
Response: data has one entry per line, in the order sent:
nominal_code_id,nominal_code_label- the suggested account, or null when there is nothing to go on.confidence(0-100).source-chosen,supplier_history,cost_category_default,supplier_usualornone.reason- a plain-language explanation.needs_confirmation- true whenconfidenceis belowmeta.confirm_below: a person should pick or confirm the account.
meta.confirm_below is the confidence threshold (70) and meta.history_bills the number of the supplier's recent bills considered (12).
Authentication: Requires Bearer token. Permission: create bills (bills.create). Scope: purchase-orders (read/write).
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.