payables:write · Idempotency-Key: optional
Submits a draft the business created. It runs the same submit as the Cleo web app, so the business’s approval rules apply. The body is optional. Use it to answer custom fields before the bill is submitted.
string
required
The draft’s
id.Body
array
Answers to the business’s bill-level (
ROOT) custom fields: [{ fieldId, value }]. Each answer replaces the draft’s stored answer to the same field. The draft’s other answers stay. See Write answers for the value shapes.array
Answers to line-level (
INVOICE_ITEM) custom fields, by line item: [{ id, customFields }]. id is the line item’s id from the payable’s items. Each answer replaces the line’s stored answer to the same field. Lines you leave out keep their answers. The lines themselves are not changed.400 validation_error.
Required custom fields
Every required, turned-on bill-level field must have an answer after your answers are merged with the stored ones. The422 names each missing field by label and id. Answers are checked before anything is written, so a refused request changes nothing.
Example
Response
200 with the payable, including items, attachments and the merged customFields.