Mark an income transaction as a refund
const url = 'http://localhost:8000/api/v1/transactions/1/refund';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"client_id":"example","original_transaction_id":1,"original_client_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/v1/transactions/1/refund \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "client_id": "example", "original_transaction_id": 1, "original_client_id": "example" }'Mark an income transaction as a refund, optionally linking it to the original expense it refunded. Only income transactions can be refunds; the original (if provided) must be an expense owned by the same user.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body
Section titled “Request Body ”object
Client-generated ID for the new refund row
Server id of the expense being refunded
Client id of the expense being refunded (used when original has not synced yet)
Example generated
{ "client_id": "example", "original_transaction_id": 1, "original_client_id": "example"}Responses
Section titled “ Responses ”Refund marked
object
A Refund row marks an income transaction as refunding money received
back from a prior expense. The original_transaction_id link is
optional — users sometimes log a refund without remembering or caring
which specific expense it came from. See the Refundable trait on
Transaction for the query helpers.
The income transaction marked as a refund
Optional link to the expense being refunded
Example generated
{ "id": 1, "refund_transaction_id": 1, "original_transaction_id": 1, "client_generated_id": "example", "last_synced_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z", "updated_at": "2026-04-15T12:00:00Z"}Transaction not found
Only income transactions can be refunds, or invalid original