Record a payment on an invoice
developers-record-paymentOn this page
Record money received outside Skeduler against an issued invoice. Nothing is charged.
Use this to record a payment that already happened (cash, bank transfer, cheque, a card taken on a terminal, direct debit). Nothing is ever charged. Your app needs write:payments. In the examples, $SKEDULER_API is your Skeduler API address. Contact Skeduler support if you don't have it. In the JavaScript and PHP tabs, the same names in capitals (SKEDULER_API, ACCESS_TOKEN and so on) are variables you set.
Who can do this: Owners and Admins with the Manage Developer Tools permission.
curl
curl -s -X POST "$SKEDULER_API/api/v1/invoices/$INVOICE_ID/payments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
-d '{"amount_cents":17000,"method":"bank_transfer","paid_on":"2026-12-01","auth_no":"BANK-1001"}'
JavaScript (fetch)
const res = await fetch(`${SKEDULER_API}/api/v1/invoices/${INVOICE_ID}/payments`, {
method: "POST",
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({"amount_cents": 17000, "method": "bank_transfer", "paid_on": "2026-12-01", "auth_no": "BANK-1001"}),
});
const data = await res.json();
PHP (Guzzle)
$client = new \GuzzleHttp\Client();
$res = $client->request('POST', "$SKEDULER_API/api/v1/invoices/$INVOICE_ID/payments", [
'headers' => [
'Authorization' => "Bearer $ACCESS_TOKEN",
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
'json' => ['amount_cents' => 17000, 'method' => 'bank_transfer', 'paid_on' => '2026-12-01', 'auth_no' => 'BANK-1001'],
]);
$data = json_decode((string) $res->getBody(), true);
| Field | Meaning |
|---|---|
amount_cents | Whole cents, no more than what's still due. |
method | bank_transfer, cheque, credit_card, cash or direct_debit. credit_card means a card taken outside Skeduler. |
paid_on | The day the money was received, YYYY-MM-DD. |
auth_no | Optional. Your reference, such as a bank reference or receipt number. |
The key is required
An Idempotency-Key is required here. Without it you get invalid_idempotency_key. A retried payment is then replayed, never recorded twice.
If a request is refused with 422, the refusal is stored. Fix the problem and send the corrected payment with a new key. See What happens if I reuse an idempotency key with a different body?.
What happens
The invoice's paid amount and status are recalculated. A draft, void or cancelled invoice can't take a payment, and an amount over what's due is validation_failed. An invoice from another organisation (or an archived one) is not_found.
Webhooks: invoice.paid fires when the payment settles the invoice, but not to your own app's subscriptions. See Will I get webhooks for my own changes?.
Related
In this section
- Change a job's status
- Create a job and book a visit from your own system
- Push leads from your website into Skeduler
- Read a job's notes
- Read technicians' leave and time blocks
- API reference
- Authentication API
- Contacts API
- Credit Notes API
- Customers API
- Estimates API
- Invoices API
- Jobs API
- Payments API
- Schedule blocks API
- Technicians API
- Visits API
- Webhooks API
- Customers or contacts, which endpoint do I use?