Skip to Content
Indexify
Trading

Trading and wallet operations

POST
/api/txn.php

Handles all trading actions (swap, balance inquiries, withdrawals, key export). The specific operation is selected via the action query parameter. All actions require authentication.

Authorization

ApiKeyAuth
headerX-API-KEY<token>

API key with the ix_ prefix. You can generate an API Key by navigating to Settings -> API Key in the web app. Pass it in the X-API-KEY header on every request.

Query Parameters

action*string

The trading action to perform.

Value in"swap""rebalance""balance""usdc_balance""total_balance""address""withdraw_usdc""withdraw_evm""bridge""bridge_status""pending_bridges""export_key""export_evm_key"
intent_id?string

Trustware bridge intent id. Required for action=bridge_status; ignored otherwise.

limit?integer

Max rows for action=pending_bridges (clamped to 1..50); ignored otherwise.

Range1 <= value <= 50
Default20

Request Body

application/json
  1. body
stack_id*integer

ID of the stack to trade.

amount*number

For buys (cue=fromUSDC): USDC amount to spend. For sells (cue=toUSDC): percentage of holdings to sell (1-100). A sell is refused with a 400 when the share being sold is worth less than the minimum sell value ($0.01 by default) or would not cover the platform fee.

cue*string

Direction of the swap.

Value in"fromUSDC""toUSDC"

Response Body

Successful response. Shape depends on action.

application/json
  1. response
order_id?string

Unique identifier for the created order.

geo_blocked?

Present only when the Robinhood-RWA jurisdiction gate blocked the caller on a MIXED stack (RWA + unrestricted assets). The order was placed for the unrestricted tokens; the listed RWA tokens were not traded (their legs are recorded failed with note geo_blocked_rwa) and the order will settle PARTIAL. An all-RWA stack is refused with 403 instead.

Example Request
curl -X POST 'https://api.indexify.finance/api/txn.php?action=swap' \  -H 'Content-Type: application/json' \  -d '{  "stack_id": 0,  "amount": 0,  "cue": "fromUSDC"}'
Example Response
{  "order_id": "string",  "geo_blocked": {    "reason": "region_restricted",    "message": "string",    "token_addresses": [      "string"    ]  }}