Convert a customer balance
Convert a customer’s GBP, EUR or USD to KES, or KES to any of them, at your rate, attach your own fee, and know exactly what the customer was paid.
A customer conversion takes money from one of your customer's accounts in one
currency and pays it into the same customer's account in another. The pairs are a
foreign currency against KES, in either direction: GBP, EUR or USD to KES, and
KES to GBP, EUR or USD. Between two foreign currencies (GBP to EUR, USD to
GBP, …) there is no direct pair: convert through KES in two steps, and a request that
names two foreign currencies is refused 422 CONVERSION_PAIR_UNSUPPORTED with that
message.
These calls are on a Remittance account and need their own scopes:
customer_transfers:write to convert and customer_transfers:read to quote and read a
conversion back. A key that holds only conversions:* (which convert your own
balance, see Convert USD to KES) or customer_accounts:*
is refused 403 insufficient_scope, and errorCode names the scope it lacks. See
Products and scopes.
The customer must be verified and hold an account in both currencies: a customer who
is suspended or closed is refused 409 CUSTOMER_NOT_ACTIVE (details.status says where
the customer is). The customer is checked once more just before the money is taken: if they
are no longer verified by then, the conversion ends failed with customer_not_active and
nothing is taken. Once the money has left, the conversion runs to its end whatever happens
to the customer. Every customer belongs to you alone: another partner's customer id
reads exactly like one that does not exist. A conversion needs no confirmation code:
it moves money between two accounts of the same customer, and your signed request is the
authorisation.
1. Ask for a quote (optional)
Send from, to and amount as query parameters, for example
?from=GBP&to=KES&amount=100.00:
GET /v1/customers/{id}/conversions/quoteThe answer:
{
"rate": "170.00",
"source": "100.00",
"target": "17000.00",
"indicative": true,
"asOf": "2026-11-19T10:00:00.000Z"
}rateis the KES per one unit of the foreign currency, to 2 decimal places, in both directions: what the customer would be paid per unit going to KES, or pays per unit coming from KES. It is the rate set for your account.targetissource × rate(foreign to KES) orsource ÷ rate(KES to foreign), rounded down to the cent.- A quote is indicative. It does not hold a rate and it does not reserve money. The rate is fixed when the conversion executes.
- A pair with no rate configured for your account yet is refused
503 FX_RATE_NOT_CONFIGURED, anddetails.pairnames it (GBP-KES,EUR-KESorUSD-KES). Nothing is guessed and nothing is borrowed from another pair: contact us to have a rate configured. Retrying will not clear it.
2. Create the conversion
POST /v1/customers/{id}/conversions
Content-Type: application/json{
"from": "GBP",
"to": "KES",
"amount": "100.00",
"partnerReference": "remit-2026-11-19-0007",
"idempotencyKey": "cnv-2026-11-19-0001",
"partnerFee": { "amount": "1.50", "currency": "GBP" }
}The answer is a 202. The conversion has been accepted and is running:
{
"id": "7d0a2f4e-3c1b-4b8e-9a52-6e1f0c3d8a17",
"status": "processing"
}amountis a decimal string in the currency you convert from, with at most two decimal places. Never a JSON number.partnerReferenceis your own reference, up to 64 characters, echoed on every read.idempotencyKeymakes the create safe to retry. The same key with the same customer, body and fee returns the same conversion, and never converts twice. The same key with anything different (another customer, amount, fee amount or fee currency, or a conversion of your own balance) is refused422 IDEMPOTENCY_KEY_REUSED. 8 to 64 characters fromA-Z a-z 0-9 _ -.partnerFeeis optional: see Your fee. Any field the call does not take is400 UNKNOWN_BODY_FIELD.- The write is limited to ten a minute per partner.
- Before accepting, we check that the customer's account in the currency you convert from
holds the
amountplus your fee, after everything already in flight on that account (payouts, transfers, other conversions and fees waiting to be paid). If it does not, the create is refused422 CONVERSION_INSUFFICIENT_BALANCEand nothing moves. The amount and your fee are held on the account until the conversion ends. - The minimum is 1.00 of a foreign currency, or KES 100.00 when you convert from KES
(
CONVERSION_AMOUNT_BELOW_MINIMUM). There is one maximum per conversion (CONVERSION_AMOUNT_ABOVE_MAXIMUM): it is the same for every partner and is not set on your account. For USD it is a USD amount. A GBP or EUR conversion is held to the same size worth of KES, at the current rates, so the largest GBP or EUR amount moves a little with the market: quote it first, and split a larger conversion into several. If the rate needed to size it cannot be read right now you get503 CONVERSION_RATE_UNAVAILABLE; retry with the sameidempotencyKey.
3. Wait for the result
A conversion ends in one of two states, and both are announced by one event,
customer.conversion.updated, whose
data.status tells them apart:
status | What it means |
|---|---|
processing | Still running. Wait for the webhook or read it back again later. If it is still processing 30 minutes after you created it, contact us and quote the conversion id. |
settled | The money left the customer's from account and is in their to account. Your fee, if you attached one, is paid to your account after this. |
failed | Nothing was paid into the customer's to account. Any money it took has been returned to their from account, and no fee is owed. failureReason (and reason) says why. |
A customer conversion never sends conversion.settled or conversion.failed: those are
the events of conversions of your own balance. Read it back with
GET /v1/customers/{id}/conversions/{conversionId}:
GET /v1/customers/{id}/conversions/{conversionId}{
"id": "7d0a2f4e-3c1b-4b8e-9a52-6e1f0c3d8a17",
"status": "settled",
"from": "GBP",
"to": "KES",
"source": "100.00",
"target": "17000.00",
"rate": "170.00",
"partnerReference": "remit-2026-11-19-0007",
"failureReason": null,
"createdAt": "2026-11-19T10:00:00.000Z",
"settledAt": "2026-11-19T10:00:41.000Z",
"failedAt": null,
"customerId": "a9c1d2e3-0000-4000-8000-000000000020",
"partnerFee": "1.50"
}rate and target are null until the rate is fixed; once set they never change.
partnerFee is your fee in the currency converted from (from), "0.00" when none. On a
conversion that failed, partnerFee is always "0.00", both here and on its
customer.conversion.updated event: no fee is charged on a conversion that does not
happen, whatever fee you asked for. While a conversion is still processing it shows the
fee you asked for. A conversion that is not this customer's, or not yours, reads
404 CONVERSION_NOT_FOUND.
Why a conversion fails
failureReason (and reason on the event) is one of:
| Reason | What happened | The customer's money |
|---|---|---|
insufficient_balance | The account no longer held the amount when the conversion ran. | Never taken |
debit_refused | The money could not be taken from the customer's account. | Never taken |
fx_unavailable | The exchange could not be made. | Taken and returned |
provider_otp_not_received | The exchange could not be authorised in time. | Taken and returned |
rate_moved_beyond_tolerance | The rate moved too far between your create and the exchange, so we did not trade. | Taken and returned |
customer_not_active | The customer was suspended or closed after you created the conversion, before it started. | Never taken |
In every case nothing was paid into the account the customer converts to, and you can
create a new conversion with a new idempotencyKey. A conversion is reported failed
only once any money it took is back.
A conversion is not a deposit
The money a conversion pays into the customer's account is OnLink's own movement, never an
outside payment. It is not announced as
customer.deposit.received: count a
conversion once, on customer.conversion.updated's target, and never as a deposit.
4. Your fee
A partnerFee is your fee on converting a customer's money. It is in the currency you
convert from (the same currency as amount), is taken from the customer's account and
paid to your own account in that currency after the conversion settles, and is never owed
on a conversion that fails.
{ "partnerFee": { "amount": "1.50", "currency": "GBP" } }partnerFee.currencymust equalfrom; any other currency is422 PARTNER_FEE_CURRENCY_MISMATCH.- The fee is at most the lower of a share of the amount and a ceiling, both set for your
account. With no terms set only
"0.00"is accepted. Over the limit is422 PARTNER_FEE_OVER_CAP, anddetails.capis the largest fee that would have passed. Whendetailssays no fee can be carried at all: if bothdetails.capBpsanddetails.capAbsoluteare zero, no fee terms are set for that currency (contact us); otherwise your terms are set and the amount is too small to carry a fee, so send a fee of zero ("0.00"). - A malformed fee is
422 PARTNER_FEE_AMOUNT_INVALID. - If your own account in that currency cannot receive the fee the create is refused
409 PARTNER_FEE_ACCOUNT_UNAVAILABLE: send"0.00", or contact us. - The fee is judged inside the create, after your partner account is locked, so a change to your terms can never land between the check and the money.
Errors worth handling
Every code on these routes is catalogued in Errors.
| Status | Code | Meaning |
|---|---|---|
404 | CUSTOMER_NOT_FOUND | No customer with that id belongs to you. |
409 | CUSTOMER_NOT_ACTIVE | The customer is not verified. details.status says where they are. |
409 | MONEY_MODE_MISMATCH | The customer's money (live or sandbox) is not the same kind as your conversions'. The quote refuses it too, so it never promises what the create would refuse. |
409 | ACCOUNT_NOT_READY | One of the two accounts cannot move money yet. details.reason and details.currency say which and why. |
422 | CONVERSION_PAIR_UNSUPPORTED | Not a foreign currency against KES. Between two foreign currencies the message says to convert through KES in two steps. |
422 | CONVERSION_INSUFFICIENT_BALANCE | The account does not hold the amount and your fee after what is already in flight. Nothing moved. |
422 | PARTNER_FEE_OVER_CAP and the other fee codes | The fee is over the cap, in another currency, or malformed. |
503 | FX_RATE_NOT_CONFIGURED | No rate is configured for that pair on your account yet. details.pair names it. Nothing moved; contact us. |
503 | CONVERSION_RATE_UNAVAILABLE, CONVERSION_BALANCE_UNAVAILABLE | A rate or the balance could not be read right now. Retry with the same idempotencyKey. |
Pay out from a customer account
Send a customer’s money to a bank account or mobile wallet over the same rails as your own payouts, confirm it with a code, and attach your own fee.
Read your customers’ transactions
List the transfers, payouts, conversions and deposits of one customer or of all of them, filter by type, status and date, and page through the result.