Documentation Index
Fetch the complete documentation index at: https://docs.sertexity.com/llms.txt
Use this file to discover all available pages before exploring further.
Create Operation
Record a new financial operation against a wallet.
POST /operations · 🔒 Auth required
Request
{
"wallet_id": "wal_01hy2c4n8j5r3d6e",
"type": "expense",
"amount": 150000,
"asset": "BTC",
"description": "Hardware wallet purchase",
"category": "equipment",
"reference": "ORD-8821",
"occurred_at": "2024-09-15T10:30:00Z",
"metadata": {
"tx_hash": "0x4e3a..."
}
}
| Field | Type | Required | Notes |
|---|
wallet_id | string | ✅ | Wallet to debit or credit |
type | string | ✅ | income, expense, or transfer |
amount | integer | ✅ | Smallest unit of the asset. Must be positive. |
asset | string | ✅ | Must match the wallet’s asset |
description | string | ❌ | Max 500 characters |
category | string | ❌ | Freeform tag |
reference | string | ❌ | External reference (order ID, tx hash, etc.) |
occurred_at | string | ❌ | ISO 8601. Defaults to request time. |
metadata | object | ❌ | Key/value pairs (max 20 keys, max 256 chars each) |
Transfer type
For type: "transfer" also include:
| Field | Type | Required | Notes |
|---|
destination_wallet_id | string | ✅ | Target wallet (must share the same asset) |
Response 201 Created
Returns the full operation object (see Get Operation).
Errors
| Code | HTTP | Cause |
|---|
VALIDATION_ERROR | 400 | Missing or invalid fields |
NOT_FOUND | 404 | wallet_id not found |
ASSET_MISMATCH | 422 | asset does not match wallet’s asset |
INSUFFICIENT_BALANCE | 422 | Wallet balance too low |
Example
curl -X POST https://api.sertexity.com/v1/operations \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"wallet_id": "wal_01hy2c4n8j5r3d6e",
"type": "expense",
"amount": 150000,
"asset": "BTC",
"description": "Hardware wallet purchase"
}'