Skip to main content

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..."
  }
}
FieldTypeRequiredNotes
wallet_idstringWallet to debit or credit
typestringincome, expense, or transfer
amountintegerSmallest unit of the asset. Must be positive.
assetstringMust match the wallet’s asset
descriptionstringMax 500 characters
categorystringFreeform tag
referencestringExternal reference (order ID, tx hash, etc.)
occurred_atstringISO 8601. Defaults to request time.
metadataobjectKey/value pairs (max 20 keys, max 256 chars each)

Transfer type

For type: "transfer" also include:
FieldTypeRequiredNotes
destination_wallet_idstringTarget wallet (must share the same asset)

Response 201 Created

Returns the full operation object (see Get Operation).

Errors

CodeHTTPCause
VALIDATION_ERROR400Missing or invalid fields
NOT_FOUND404wallet_id not found
ASSET_MISMATCH422asset does not match wallet’s asset
INSUFFICIENT_BALANCE422Wallet 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"
  }'