On-Ramp / Off-Ramp
On-ramp buys crypto with fiat, delivered on-chain straight to a wallet address. Off-ramp sells crypto for fiat, paid out to a recipient bank account. Both move crypto on-chain per order — unlike Scan-to-Pay and Cashout, neither touches your crypto fund.
The sequence
quote → create → pay in or send → poll or webhook
Quote — on-ramp ·
off-ramp. Previews the crypto amount, the fiat
amount, and the fee. Send either cryptoAmount or fiatAmount, never both — the quote returns the
other side.
Create — on-ramp ·
off-ramp. The response comes back immediately
with status PROCESSING and the instructions for the next step — a fiat payment for on-ramp, a
crypto deposit for off-ramp.
Pay in or send. An on-ramp order returns payment: the bank details and, where the provider
supports it, a QR code to pay the fiat with. An off-ramp order returns deposit: the address and
network to send the crypto to, plus a memo when the network needs one. The payment window is 15
minutes: send the exact amount the order specifies before its expiresAt passes.
Track — on-ramp ·
off-ramp, or a
webhook. On-ramp and off-ramp orders do not take a webhookSecretKey:
register your endpoint once in the AliX management portal, and every order fires it automatically.
Status
| Status | Meaning |
|---|---|
PROCESSING | The order exists and is waiting on the fiat payment or crypto deposit, or the resulting delivery/payout is in flight. Not terminal. |
SUCCESS | On-ramp: the crypto has landed in the wallet address. Off-ramp: the recipient has been paid. Terminal. |
FAILED | The order did not complete. Terminal. |
Only SUCCESS and FAILED are terminal, and only terminal states fire a webhook.
Amounts and fees
Every quote and order carries a fees breakdown: processingFee, our service fee, and
systemFee, which includes the network fee. The two directions apply it in opposite directions —
an on-ramp fiatAmount is what you pay, fees included; an off-ramp fiatAmount is what gets paid
out, fees already deducted. Either way, the response always returns both the crypto and fiat side,
so you never compute one from the other.
A fiatAmount follows Amount precision. A cryptoAmount
takes at most 6 decimal places; extra digits are cut off.
An on-ramp in PHP is charged in whole pesos:
- Quoted by
fiatAmount: the amount is cut to a whole peso.1012.34becomes1012. - Quoted by
cryptoAmount: the peso total is rounded up to a whole peso, and the user receives the crypto that whole amount buys. A quote for20USDT comes back as1174PHP for20.006379USDT.
Locking the rate
Send lock: true with a quote to hold its rate and fees for five minutes. The quote then returns a
quoteId and its expiresAt. Create the order with that quoteId and the same currency, network,
and amount, and the order is priced exactly as quoted. The order returns the locked rate under
quote.
A locked quote is good for one order. When it has been used, has expired, or does not match the
order, the call fails with a QUOTE_* code, and you request
a new locked quote. A quote stays used even if the order created from it later fails.
Without lock, the order is re-priced when you create it, so its cryptoAmount, fiatAmount, and
fees can differ slightly from the quote. Lock the quote whenever you show its numbers as final. Once
the order exists, read its amounts rather than the quote's.
Currencies, networks, and limits
cryptoCurrency defaults to USDT if omitted. network is required on every call — it fixes the
network fee and, for on-ramp, where the crypto is delivered. List what you can trade before you
quote: on-ramp ·
off-ramp. Each item is one
fiatCurrency + cryptoCurrency + network pair with the network fee, whether that network needs a
memo, and the minAmount / maxAmount in crypto for that fiat currency. The fiatCurrency,
cryptoCurrency and network filters are all optional, so you can pick in either order: the fiat
currency first and then a crypto currency, or a crypto currency first and then the fiat currencies
available for it. Outside those bounds the quote or order fails with
BUY_AMOUNT_BELOW_MIN / BUY_AMOUNT_ABOVE_MAX on-ramp, or SELL_AMOUNT_BELOW_MIN /
SELL_AMOUNT_ABOVE_MAX off-ramp.
Collecting the off-ramp recipient
An off-ramp order pays out to recipient, and its shape depends on the fiat currency's provider —
call destination-fields for the fiat
currency first, and build the recipient form from what it returns rather than assuming
bankCode / accountNumber / accountName. accountName is optional for VND, and required for
every other fiat currency.
orderId is your idempotency key
Same rule as Scan-to-Pay and Cashout: you choose orderId, reusing one is rejected with
DUPLICATE_TRANSACTION_ID (HTTP 409), and a request that times out should be retried with the same
id rather than a new one. See Scan-to-Pay & Cashout for the
full pattern.