Requires payments:write, and payment records switched on for the environment (else 503). The key's account must be a sole practitioner or a team administrator. Records a refund you have already made against a payment recorded with POST /invoices/payment-records. Rehab Guru refunds nothing, raises no credit note and sends nothing to an accounting system. The amount must fit what is left of the payment (else 409 balance_conflict). A refund puts its amount back on the invoice as owed. Once every payment record on the invoice has been refunded in full, nothing is left on it and it can be voided, provided the other conditions of POST /invoices/{invoiceId}/void are met (among them no Healthcode connection and no Effra integration at the practice). Until then it cannot be voided, and there is no credit note through the API: after a part refund the practice closes the invoice in the web app with a credit note for what it still owes. From then on the invoice takes no further payment, refund or void record (422). An unknown payment answers 404; retry after recording the payment. refundDate is an RFC 3339 date-time of a real calendar date, no more than 24 hours in the future. Repeating a request with the same Idempotency-Key and body answers 200 with replayed true. 422 unsupported_configuration is answered when the practice has a live Xero connection or webhooks on invoices, payments, payment sources or payment lines, the invoice has a credit note or is linked to a payment provider, or the key's account holds a membership of a team role that no longer exists.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400Invalid fields, identifiers or monetary amount.
403Current financial write authority or role refused.
404Current payment or linked reference not accessible.
409The amount is more than is left of the payment (balance_conflict), or the Idempotency-Key or externalReference was used with another request.
422The practice or the invoice cannot take refund records (unsupported_configuration): see the description.
503Payment records are not switched on for the environment, or the invoice is being written by another request: retry.
