payables:write · Idempotency-Key: optional, recommended
Body
An existing contact to bill from. Links the vendor so the bill can be submitted and paid. The contact must be active, not archived, and set to
bidirectional or can_pay, or the call answers 409 contact_not_payable.true creates the bill submitted, not as a draft, and sends it into the business’s approval flow. Requires contactId, a total of at least $1.00 (100 cents), and at least one item with a name, a quantity above 0 and a unitAmountCents of at least 1.Line items. Each takes
name, description, quantity (integer, default 1), unitAmountCents (integer) and customFields, the line’s answers to line-level (INVOICE_ITEM) fields in the same shape as the bill’s.Answers to the business’s bill-level (
ROOT) custom fields: [{ fieldId, value }]. Take each fieldId from GET /v1/payable-custom-fields. The shape of value depends on the field’s type. See Write answers. Requires contactId.400 validation_error. The body takes no category or tags.
Required custom fields
submit: true. Every required, turned-on bill-level field needs an answer. The422names each missing field by label and id.- A draft that sends no bill-level answer. Required fields are not checked. Answer them when you submit.
- A draft that sends any bill-level answer. It must answer every required bill-level field, as on the Cleo web app’s bill form.
Example
evt-100 is the externalId of an option on the bill-level Event dropdown, and the line answers a short-text field.
Response
201 with the payable, including items, category, tags, customFields, attachments, createdAt and updatedAt. A submitted bill is pending_approval, or approved when the business’s rules approve it without a person.
Errors
Without an
Idempotency-Key, each retry creates another bill.