ResourcesAPI ReferenceOrders, Wallet & Transactions
API Reference

Orders, Wallet & Transactions

Read orders and poll async results, query wallet balance snapshots, and retrieve full ledger transaction history.

Orders, Wallet & Transactions

All endpoints on this page are read-only. Use them to poll async operation results, check balances, and retrieve transaction history.


GET /orders — list orders

Ability: orders.read

QueryTypeDescription
page / per_pageintPagination (per_page default 50)
statusstringStatus filter (see Order status)
typestringType filter (see Order type)

Each order row:

FieldTypeNotes
uuiduuid
typestringSee Order type
statusstringSee Order status
failure_reasonstring?Null unless failed — see Failure reason
held_amount / currencystring
created_atdatetime

GET /orders/{uuid} — get one order

Ability: orders.read

Response: 200 order detail (same fields as the list, used to poll async results) / 404 order.not_found

Polling pattern: call this endpoint every 2–5 seconds until status becomes completed or failed.


GET /wallet — wallet balance

Ability: wallet.read

Success 200:

{
  "data": {
    "workspace_id": 12,
    "wallets": [
      {
        "currency": "USD",
        "balance": "880.00",
        "held_balance": "106.00",
        "available": "774.00",
        "frozen_at": null,
        "frozen_reason": null,
        "last_reconciled_at": "2026-06-08T00:00:00+00:00"
      }
    ]
  }
}

wallets is an array of per-currency balances. All amounts are decimal strings. available = balance − held_balance.


GET /transactions — wallet ledger

Ability: transactions.read

QueryTypeDescription
page / per_pageintPagination (per_page default 50)
reasonstringFilter by ledger reason code (see Ledger reason)
reference_typestringFilter by reference type (e.g. Card, Ticket, Subscription)
reference_uuiduuidFilter by reference UUID
from / todatetimeTime window (ISO 8601)

Each ledger row:

FieldTypeNotes
idint
txn_group_idstringGroups the double-entry pair
reason_codestringLedger reason — see Ledger reason
directionint1 = Debit, 2 = Credit (integer, not a string)
direction_labelstring"Debit" / "Credit"
amount / currencystringAmount is always positive; side given by direction
account_codestring?
account_card_uuiduuid?UUID of the related card, if any
reference_typestring?Type of the related object (e.g. Card, Ticket)
reference_uuiduuid?UUID of the related object — use to deep-link to card detail, ticket, etc.
descriptionstring?
created_atdatetime

⚠️ direction is returned as an integer (1/2), not a snake_case string. This is the one exception to the general convention. Always check direction_label for a human-readable label.


Enum reference

Order status

ValueMeaning
pendingCreated, not yet processing
processingProcessing with the supplier
awaiting_platformAwaiting platform intervention (admin retry / async fallback)
completedCompleted (terminal ✓)
failedFailed (terminal ✗)

Order type

ValueMeaning
issue_cardIssue a card
topup_cardTop up a card
close_cardClose a card
freezeFreeze a card
unfreezeUnfreeze a card

Order failure reason

⚠️ These API strings differ slightly from internal storage — the API returns supplier5xx / business4xx (no underscore before the digits).

ValueMeaning
supplier5xxSupplier returned a 5xx (transient; auto-retried)
timeoutRequest timed out (transient; auto-retried)
networkNetwork error (transient; auto-retried)
signatureSignature verification issue (transient; auto-retried)
business4xxSupplier business rejection (terminal; needs admin)
not_foundSupplier reports not found (terminal; needs admin)
preempted_by_riskPreempted by the risk engine
admin_refund_closeAdmin refund-closed the order
async_issue_failedAsynchronous issuance failed

Ledger reason code

ValueMeaning
card_issue_heldFirst top-up at issuance — funds parked in held
card_topup_heldSubsequent top-up — funds parked in held
held_captureHeld → final destination (card held + platform revenue)
held_releaseHeld → workspace balance (supplier failed)
held_release_adminHeld → workspace balance via admin queue
card_issue_feeCard-issue fee → platform revenue
card_topup_feeCard top-up fee → platform revenue
card_close_refundCard closure: card held → workspace balance
usdt_depositUSDT deposit → workspace balance
usdt_deposit_feeUSDT inflow channel fee → platform revenue
withdrawal_heldWithdrawal hold: balance → held
withdrawal_completedWithdrawal paid out: held → pool + revenue
withdrawal_canceledOwner cancelled withdrawal: held → balance
withdrawal_rejectedAdmin rejected withdrawal: held → balance
card_spendCard spend settled — held → platform (card debit leg)
card_spend_refundCard spend refund — platform → workspace
card_spend_reversalCard spend reversal — platform → workspace
card_post_close_clawbackPost-close clawback — workspace → platform (late charge after card closed)
card_post_close_refundPost-close refund — platform → workspace
card_reconcile_adjustmentManual reconciliation adjustment (admin only)
subscription_chargeSubscription charge → platform revenue
risk_penaltyRisk-engine penalty fee per declined transaction (may push wallet negative)
reversalReversal / red-letter correction (admin only)

Ledger direction

direction (int)direction_labelMeaning
1"Debit"Debit side (+Asset / +Expense)
2"Credit"Credit side (−Asset / −Expense)

Schema: Order

FieldTypeNotes
uuiduuidOrder identifier
typestringSee Order type
statusstringSee Order status
related_card_uuiduuid?UUID of the related card, if any
held_amountstringHeld amount, e.g. "106.00"
currencystringe.g. "USD"
created_atdatetime