- A sandbox key (
cleo_test_...) with the scopescontacts:read,payables:read,payables:write,payments:initiateandpayments:read. - A verified sandbox business with at least one active vendor contact.
1
Check that the business can pay
setupStage, paymentsLocked and the rails array. If setupStage is not READY, or no rail has canSend: true, send your user to dashboardUrl to finish setup. This call works with any valid key, even before verification.2
Pick the vendor
id. Check paymentReadiness: it says whether each rail can reach the vendor’s bank right now.3
Create the bill and submit it
submit: true sends the bill into the business’s approval flow. Without it, the bill is a draft that you can submit later with POST /v1/payables/{payableId}/submit. If the business’s rules need a person to approve, approve the bill in the Cleo web app before you pay it.4
Choose what to pay from
rail, a kind, canPay, and a pay object. Pick an item with canPay: true and copy its pay fields into the payment.5
Pay the bill
This example pays from the Cleo Pay balance:To pay from a Dwolla bank, send
"paymentRail": "DWOLLA" and that bank’s bankAccountId instead. Idempotency-Key is required on this call. If the request times out, send it again with the same key and the same body: you get the first answer, and the bill is not paid twice.6
Follow the payment
pending or processing to completed. It can also end held, failed, returned, cancelled, refund_pending or refunded. To get told instead of polling, register a webhook endpoint for payment.* events.If a call is refused
Every refusal has a machine-readablecode. The ones you are most likely to see here:
See Errors for the full list.
Next steps
- Payments: statuses, holds, cancel and retry.
- Funding sources: how the rail is chosen.
- MCP server: do the same from an AI agent.