PATCH /v1/transactions/{id}
Edit a transaction. Manual and Apple Pay entries can change every field; bank transactions can change only category and note. Sending any other field to a bank transaction returns 400.
Auth. Send the token in the X-Ledger-Token header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | required |
Request body
application/json: object
| Field | Type | Required | Description |
|---|---|---|---|
amount_cents | integer | optional | Manual and Apple Pay entries only. Non-zero, magnitude up to 10000000. |
posted | string (date) | optional | Manual and Apple Pay entries only. Cannot be cleared. |
merchant | string | optional | Manual and Apple Pay entries only. Cannot be cleared. |
payee | string or null | optional | Manual and Apple Pay entries only. |
memo | string or null | optional | Manual and Apple Pay entries only. |
account_id | string or null | optional | Manual and Apple Pay entries only. Must match an existing account. |
category | string or null | optional | Must be on the category list. null clears it. |
note | string or null | optional |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | The updated transaction | Transaction |
400 | Request rejected | Error |
404 | Request rejected | Error |
409 | Request rejected | Error |
429 | Too many requests from this client address. Wait the number of seconds in Retry-After, then try again. | Error |
Example response
{
"id": 0,
"source": "manual",
"external_id": "string",
"account_id": "string",
"posted": "2026-10-11",
"transacted_at": "2026-10-11T00:00:00Z",
"amount_cents": 0,
"merchant": "string",
"payee": "string",
"memo": "string",
"category": "string",
"category_source": "manual",
"rule_id": 0,
"note": "string"
}
Code samples
Set KEY to your own token first.
curl
curl \
-X PATCH \
-H X-Ledger-Token:$KEY \
-H "Content-Type: application/json" \
-d '{"amount_cents": 0, "posted": "2026-10-11", "merchant": "string", "payee": "string", "memo": "string", "account_id": "string", "category": "string", "note": "string"}' \
"https://api.sasek.org/ledger/v1/transactions/{id}"
JavaScript
const res = await fetch("https://api.sasek.org/ledger/v1/transactions/{id}", {
method: "PATCH",
headers: { "X-Ledger-Token": KEY, "Content-Type": "application/json" },
body: JSON.stringify({
"amount_cents": 0,
"posted": "2026-10-11",
"merchant": "string",
"payee": "string",
"memo": "string",
"account_id": "string",
"category": "string",
"note": "string"
}),
});
const data = await res.json();
Python
import json
import os
import urllib.request
payload = { 'amount_cents': 0,
'posted': '2026-10-11',
'merchant': 'string',
'payee': 'string',
'memo': 'string',
'account_id': 'string',
'category': 'string',
'note': 'string'}
request = urllib.request.Request(
"https://api.sasek.org/ledger/v1/transactions/{id}",
method="PATCH",
headers={
"X-Ledger-Token": os.environ["KEY"],
"Content-Type": "application/json",
},
data=json.dumps(payload).encode(),
)
with urllib.request.urlopen(request) as response:
print(json.load(response))