What you’ll need
- Your secret key. Every call in this guide authenticates with it.
- An account in the currency you are buying, to settle into. See Get Balances.
- A buyer’s mobile money number on a supported provider.
Use test mode while you follow this guide. No real money moves and no real phone is
charged.
The shape of the flow
1
Create an intent
You say what you want to trade and at what rate. You get a quote back.
2
Pick a mobile money provider
You look up which providers work for the buyer’s currency.
3
Accept the quote with the buyer's payment details
This locks the trade and charges the buyer’s phone in one call.
4
Authorize with the OTP
The buyer gets a code and you pass it back.
5
Watch the payment, then complete the trade
You poll until the payment succeeds, then finalise.
Step 1: Create a marketplace intent
An intent is your side of the deal: the two currencies, how much, and the rate. Check the rate first:The parameters are
base and quote, not source and destination.quoteId — every later call needs it.
Two things to read carefully:
allocationResultshows who is filling your trade.fullAllocation: truemeans the whole amount was matched. The rate you get isweightedAverageRate, which comes from the liquidity available and can differ from the rate you asked for.ttlis how many seconds the quote lives. Here, 899.
Step 2: Find the buyer’s mobile money provider
Check which currencies can be paid by mobile money:code is what you pass in the next step. Codes are lowercase.
References: List Mobile Money Currencies ·
List Mobile Money Providers
Step 3: Accept the quote and charge the buyer
This one call does two things: it locks in the trade, and it starts the mobile money charge on the buyer’s phone.AWAITING_PAYMENT and the buyer gets a prompt on their phone.
authorizationMode tells you what the provider wants next — otp here.
ttl resets on accept. It was 899 seconds on the quote; now it is 3599.Step 4: Authorize with the OTP
The buyer reads the code off their phone and gives it to you.metadata.mobileMoneyPayIn:
Step 5: Watch the payment
Poll until the payment settles.metadata.mobileMoneyPayIn.status, not the top-level status. The payment
status moves inProgress → successful while the quote itself stays on
AWAITING_PAYMENT until you complete it in the next step.
In test mode the payment settles in a few seconds. Poll every few seconds rather than
in a tight loop.
Step 6: Complete the trade
Once the payment readssuccessful, finalise it.
status reads SUCCESSFUL and ttl is 0. The trade is done.
Check your balances and you will see the money move — the destination account up by
totalDestinationAmount, the source account down by totalSourceAmount:
When things go wrong
See Error Codes for the full list.
What to do next
- Take a quote in one call — skip the separate intent step
- Get Balances — confirm the trade landed
- Pay out to a bank — move the proceeds on