Partner API

Lock a USDT/KES rate

Returns a single-use, time-limited quote. Quotes are only issued off a live rate — a degraded rate source returns 503 rather than a locked rate we could not honour.

post/v1/quotes

Request

  • Base URL
    https://sandbox.onlink.africa
  • Auth
    API key in header X-OnLink-Key

Request body

side'buy' | 'sell' required

buy: you pay KES and receive USDT (on-ramp). sell: you send USDT and receive KES (off-ramp).

kesAmountstring

KES amount as a decimal string, max 2 decimal places. Provide exactly one of kesAmount or usdtAmount.

usdtAmountstring

USDT amount as a decimal string, max 6 decimal places (Tron USDT precision). Provide exactly one of kesAmount or usdtAmount.

Example request

{
  "kesAmount": "10000.00",
  "usdtAmount": "100.000000"
}

Response

Quote locked

quoteIdstring uuid required

The quote id. Single-use: pass it to POST /v1/orders/sell, which consumes it.

side'buy' | 'sell' required

Echoes the side you asked for. buy prices the on-ramp, sell the off-ramp — a sell order will not consume a buy quote (409).

kesAmountstring required

The trade PRINCIPAL in KES, decimal string, always 2 decimal places (KES cents). Never a JSON number. Whichever leg you did not supply is the derived one, and it rounds in OnLink’s favour. kesAmount × rate ↔ usdtAmount holds exactly — the fee is not folded into either. The one exception: a buy named by kesAmount whose USDT is delivered to your own wallet has its usdtAmount rounded down to 2 decimal places (by less than 0.01 USDT; kesAmount is unchanged). What moves is kesTotalAmount.

usdtAmountstring required

USDT leg, decimal string, always 6 decimal places (Tron USDT precision). Never a JSON number.

ratestring required

KES per USDT at 2 decimal places, the rate this quote is locked at. Quotes are only ever issued off a live rate source.

kesTotalAmountstring required

The KES that actually moves, decimal string, 2 decimal places. buy: kesAmount + fee.kesAmount — this is what is debited from your KES balance. sell: kesAmount − fee.kesAmount — this is what we pay you. This is the figure that appears on a bank statement, so it is the one to reconcile against.

expiresAtstring date-time required

When the locked rate stops being executable, ISO 8601 UTC. Short by design — a long-lived locked rate is a free option against us.

settlementEstimateSeconds1800 | 21600 | 86400 required

How long settlement is expected to take once your funds are confirmed, in whole seconds. A different clock from expiresAt — that is how long you have to send, this is how long settlement then takes. One of a small set of published bands rather than a continuously varying figure, so treat it as a band and not as a precise duration. An integer, not a string: unlike the amounts, it is not money.

Example response

{
  "quoteId": "f1c0a5d2-3b4e-4a71-9c8d-0e1f2a3b4c5d",
  "side": "buy",
  "kesAmount": "1281000.00",
  "usdtAmount": "10000.000000",
  "rate": "128.10",
  "kesTotalAmount": "1293820.00",
  "fee": {
    "kesAmount": "12820.00",
    "currency": "KES",
    "percentBps": 100,
    "flatKesAmount": "10.00"
  },
  "expiresAt": "2026-08-31T09:31:30.000Z",
  "settlementEstimateSeconds": 21600
}

Changes

No recorded changes to this operation across all 1 revision of this API.