# PUT /api/v1/transactions/{transaction_id}

> Update transaction

- **Tag:** transactions
- **Operation ID:** `update_transaction`

## Description

Update a transaction's description, counterparty, review status and other editable fields. A field that is not listed is rejected with 400, never ignored.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `transaction_id` (path, string, required)

## Request body

Schema: `TransactionUpdateRequest`

- `amount` (integer) — Amount in cents.
- `datetime` (string · date) — Transaction date.
- `description` (string) — Transaction description.
- `counterparty` (string) — Counterparty / merchant name. Applied to this transaction as a manual rename (the row is then left alone by automatic renaming).
- `remember` (boolean) — With counterparty: also save the rename for the business, so its other rows under the same name and future ones show it (the same as bulk_update_counterparty remember=true). Default false renames this transaction only.
- `meta` (object) — Metadata JSON object for storing additional transaction details.
- `categorization_method` (string) — How this transaction was categorized: 'ai', 'rules' (a bank rule), 'similarity', 'transfer_between_accounts', 'uncategorized', 'user', 'historical', 'global_pattern', 'merchant', 'pfc', 'account_type', or 'counterparty_default'.
- `posted_status` (string) — Posting status: 'not_posted', 'posted', or 'deleted'.
- `review_status` (string) — Review status: 'unreviewed' or 'reviewed'.
- `opposing_line_entry_ids` (array · string) — UUIDs of opposing line entries for double-entry accounting.
- `personal` (boolean) — Mark as personal expense (not business-related).
- `journal_entry_id` (string) — UUID of linked journal entry for categorization.
- `external_source_account_id` (string) — External source account ID.
- `ledger_id` (string) — UUID of the ledger (bank account) this transaction belongs to.
- `reconciled` (boolean) — Mark transaction as reconciled with bank statement.
- `invoice_id` (string) — UUID of linked invoice (for payment transactions).
- `assigned_to_user_id` (string) — Assign to this business member's user UUID; null unassigns.

## Example request

```json
{
  "description": "Updated: Office supplies - Staples receipt #12345",
  "reconciled": true,
  "review_status": "reviewed"
}
```

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_TransactionResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (TransactionResponse)

### 400 — Bad Request - Invalid input

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 404 — Not Found - Resource does not exist

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/transactions/{transaction_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "Updated: Office supplies - Staples receipt #12345",
  "reconciled": true,
  "review_status": "reviewed"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/transactions/{transaction_id}', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "description": "Updated: Office supplies - Staples receipt #12345",
  "reconciled": true,
  "review_status": "reviewed"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {'description': 'Updated: Office supplies - Staples receipt #12345',
 'reconciled': True,
 'review_status': 'reviewed'}

response = httpx.put("https://api.ondayzero.com/api/v1/transactions/{transaction_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/transactions/update-transaction
- OpenAPI slice: https://www.ondayzero.com/docs/reference/transactions/update-transaction/openapi.json
- Other endpoints in **transactions**: https://www.ondayzero.com/docs/reference/transactions (markdown bundle: https://www.ondayzero.com/docs/reference/transactions.md, OpenAPI: https://www.ondayzero.com/docs/reference/transactions/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
