Trade
Place and cancel limit and market orders, read balances, orders and fills.
Run a trading bot on the shilling order book, or let customers pay your shop from their Axio balance. One signed API, keys you control.
Place and cancel limit and market orders, read balances, orders and fills.
Create an invoice, send your customer the link, get a signed webhook when it is paid. Fee 0.5%, paid by the shop.
Keys can never withdraw or send money. Trading keys only work from IP addresses you list. Secrets are encrypted at rest.
Send three headers. The signature is HMAC-SHA256 with your secret over the timestamp, method, path with query, and the raw body. Requests older than 15 seconds, or repeated, are refused.
X-AXIO-KEY: ak_... your key ID
X-AXIO-TS: 1767225600000 time in milliseconds
X-AXIO-SIGN: hex(HMAC_SHA256(secret, TS + METHOD + PATH + BODY))
// Node.js 18+
import { createHmac } from "node:crypto";
const KEY = process.env.AXIO_KEY, SECRET = process.env.AXIO_SECRET;
async function axio(method, path, body) {
const raw = body ? JSON.stringify(body) : "";
const ts = String(Date.now());
const sign = createHmac("sha256", SECRET).update(ts + method + path + raw).digest("hex");
const r = await fetch("https://YOUR-AXIO-DOMAIN" + path, { method, body: raw || undefined,
headers: { "content-type": "application/json", "x-axio-key": KEY, "x-axio-ts": ts, "x-axio-sign": sign } });
if (!r.ok) throw new Error((await r.json()).error);
return r.json();
}
await axio("POST", "/api/orders", { market: "BTC-KES", side: "buy", type: "limit", price: "9500000", amount: "0.001" });| Call | Permission | What it does |
|---|---|---|
GET /api/markets, /api/tickers, /api/depth/BTC-KES, /api/trades/BTC-KES, /api/candles/BTC-KES?interval=1h | Public | Markets, prices, order book, recent trades, candles |
GET /api/balances | read | Available and held balance for each asset |
GET /api/orders?status=open, GET /api/my-trades, GET /api/history | read | Your orders, fills and money movements |
POST /api/orders | trade | { market, side: "buy"|"sell", type: "limit"|"market", price?, amount, total? } |
DELETE /api/orders/:id | trade | Cancel an open order |
POST /api/quick | trade | Instant buy or sell at the best price, 0.5% fee |
POST /api/merchant/invoices | pay | { asset: "KES"|"USDT", amount, reference?, description?, callbackUrl?, expiresInMinutes? } |
GET /api/merchant/invoices/:id | pay | Invoice status: pending, paid or expired |
Amounts are strings in whole units, for example "0.001" BTC or "1500" KES. Errors come back as { "error": "message" } with a 4xx status.
payPath.https://YOUR-AXIO-DOMAIN + payPath. They log in, check your shop name and amount, and pay from their balance.{ "event": "invoice.paid", id, amount, asset, reference, paidAt } to your callbackUrl, signed with the same headers and your key secret. Check the signature, then ship the order.Callback URLs must be public https:// addresses. A paid invoice can't be paid twice. Money lands in your Axio balance at once, minus 0.5%, and you can cash out to M-PESA.
Give an AI assistant or trading bot an agent key (App → Account → AI agents). Axio checks every trading call against the key's limits before it runs. The agent never sees your password and can never withdraw or send money.
| Limit | What happens when it's hit |
|---|---|
| Markets | 403 "Agent limit: this key can only trade BTC-KES" |
| Biggest order, total per 24 hours, open orders | 403 with the limit in the message. Cancelling is always allowed. |
| Ask me first above an amount | 428 with { "status": "needs_approval", "approvalId" }. The owner approves in the app with a passkey. Poll GET /api/agents/approvals/:id (read). When it says approved, send the same request again with header X-AXIO-APPROVAL: <approvalId>. Within 30 minutes, once. |
| End date, pause, pause-all | 401 "This key has expired" or 403 "paused". The owner can stop every agent with one tap. |
Tell your agent: never put the key secret in a prompt, a chat or a log. Keep it in the agent's secret settings.
Ask support for a test account before you go live with real money.
30 orders per 10 seconds per account and 600 invoices per hour. Ask support if you need more.
No. Withdrawals and transfers only work in the app, confirmed with your passkey or 2FA code. Agent keys can't either.
Delete the key in the app at once. It stops working immediately. Then create a new one.