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

> Update transaction

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

## Description

Update transaction metadata like tags, review status, or description.

## 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 override.
- `meta` (object) — Metadata JSON object for storing additional transaction details.
- `categorization_method` (string) — How this transaction was categorized: 'ai', 'rules', 'similarity', 'transfer_between_accounts', 'uncategorized', 'user', 'historical', or 'global_pattern'.
- `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.
- `teal_source_account_id` (string) — Teal accounting system 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).

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_TransactionResponse_`

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

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

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

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## 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 '{
  "amount": 0,
  "datetime": "2026-01-01",
  "description": "string",
  "counterparty": "string",
  "meta": {},
  "categorization_method": "string"
}'
```

### 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({
  "amount": 0,
  "datetime": "2026-01-01",
  "description": "string",
  "counterparty": "string",
  "meta": {},
  "categorization_method": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "amount": 0,
  "datetime": "2026-01-01",
  "description": "string",
  "counterparty": "string",
  "meta": {},
  "categorization_method": "string"
}

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
