Skip to main content
Every PeerPesa ramp runs in two calls: create a quote to lock the exchange rate and fee breakdown, then confirm the quote to start the onramp or offramp. A quote stays valid for exactly 30 minutes, so show the user the rate, fees, and final amount, and confirm only after they accept.
1

Create a quote

POST /quotes returns the locked rate, fee breakdown, amounts, and expires_at (30 minutes after creation).
2

Show the quote to your user

Display rate, fee.total, and destination_amount, plus a countdown to expires_at.
3

Confirm the quote

POST /quotes/{id}/confirm with the wallet address (onramp) or beneficiary (offramp). PeerPesa creates the transaction and returns it.
Quotes expire after 30 minutes. Confirming an expired quote returns 422 quote_expired, and confirming a quote twice returns 409 quote_already_used. Create a new quote in either case.

Create a quote

POST /quotes Locks a rate and fee breakdown for a specific network, asset, fiat currency, amount, and method.

Request body

string
required
Ramp type: onramp (fiat to crypto) or offramp (crypto to fiat).
string
required
Blockchain network: stellar or celo.
string
required
Asset code on the network. Stellar: XLM, USDC. Celo: CELO, USDT, USDC, CUSD.
string
required
Fiat currency code: KES, TZS, NGN, ZAR, ZMW.
string
required
Amount as a decimal string, for example "100.00".
string
required
Currency the amount refers to: the asset code or the fiat_currency code.
string
required
Payin or payout method: mobile_money or bank_transfer. Availability varies by country.

Request

Response

Response fields

string
Unique quote identifier, for example qt_8f2k.... Use it to confirm the quote.
string
onramp or offramp.
string
Locked exchange rate as a decimal string.
string
Amount on the source side before fees, in source_currency.
object
Fee charged for processing this quote.
string
Final amount the recipient receives after fees, in destination_currency.
string
active, confirmed, or expired.
string
ISO 8601 UTC timestamp when the quote expires, 30 minutes after created_at.

Confirm a quote

POST /quotes/{id}/confirm Accepts an active quote and creates the ramp transaction at the locked rate and fee. The body depends on the quote type.

Path parameters

string
required
ID of an active quote, for example qt_8f2k3m9n1p0q.

Request body

string
required
Address on the quote’s network that receives the crypto.
string
Stellar memo to attach to the payout, if the receiving wallet needs one.
object
required
Who pays the fiat. For mobile_money, include phone_number. For bank_transfer, include account_name.
string
Your own identifier, returned on the transaction.

Request

Response

Returns the transaction created from the quote. Onramps start in awaiting_payment with payment_instructions. Offramps start in awaiting_deposit with a deposit object. See Onramp and Offramp for the full transaction fields.

Retrieve a quote

GET /quotes/{id} Returns a quote with its current status and expires_at. The response has the same shape as the create response.

Quote statuses

Errors

See Error Codes for the full list.