OnLink
API reference

Create a buy order (KES in, USDT out)

Consumes a buy quote and debits the KES directly from your own VA balance — there is nothing to send and no payment instructions to read. Delivery is asynchronous: nothing is sent until the debit is confirmed and the order reaches a terminal state. Register a webhook endpoint rather than assuming a create means the trade is done. Retry-safe: creating twice with the same partnerReference returns the original order rather than a second one.

POST
/v1/orders/buy

Authorization

partner-key
X-OnLink-Key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/orders/buy" \  -H "Content-Type: application/json" \  -d '{    "quoteId": "string",    "partnerReference": "string"  }'
{  "orderId": "9c1e4b07-6d52-4a83-91fe-40ab72c5d318",  "status": "funds_reserved",  "kesAmount": "1281000.00",  "usdtAmount": "10000.000000",  "rate": "128.1000",  "kesTotalAmount": "1305339.30",  "fee": {    "kesAmount": "24339.30",    "currency": "KES",    "percentBps": 190,    "flatKesAmount": "0.30",    "capKesAmount": null  },  "expiresAt": "2026-09-02T09:30:00.000Z",  "kesDebit": {    "status": "reserved"  }}