Fee products
How fees are calculated
For each transaction, PeerPesa calculates the fee from the fee product that matches the transaction type, the asset or fiat currency, and the network:Fee formula
percentageandfixedare applied to the transaction amount, in the fee product’sfee_currency.- The result is raised to
min_feeor lowered tomax_feewhen it falls outside the caps. network_feeis the current blockchain fee for the network and changes with network conditions.
Fee products show indicative pricing. The exact fee for a transaction is the
fee object returned by the quote or estimate, which stays fixed for the quote’s 30-minute validity.The fee product object
string
Unique identifier, for example
fee_offramp_kes.string
Transaction type the fee applies to:
onramp, offramp, buy, withdraw, swap, send, internal_transfer, or deposit.string
Display name, for example
Offramp to KES.string | null
Network the fee applies to:
stellar, celo, or btc. null when it applies to all networks.string | null
Asset the fee applies to, for example
USDC. null when it applies to all assets.string | null
Fiat currency for fiat products:
KES, TZS, NGN, ZAR, or ZMW. null for crypto-only products.string | null
Fiat payment method the fee applies to:
bank_account or phone_number. null when it applies to all methods.string
Currency the fixed, minimum, and maximum fees are expressed in.
string
Percentage fee charged on the amount, for example
"1.00" for 1%.string
Flat fee added to every transaction.
string
Minimum processing fee charged.
string | null
Maximum processing fee charged.
null for no cap.object | null
Current network fee, or
null when no on-chain transaction is involved.object
Transaction amount limits for this product.
string
active or inactive. Inactive products cannot be used for new transactions.string
ISO 8601 timestamp of the last pricing change.
GET /fees
Lists fee products. Supports pagination and filters.string
Filter by product, for example
offramp. Comma-separate to match several.string
Filter by network:
stellar, celo, or btc.string
Filter by asset, for example
USDC.string
Filter by fiat currency, for example
KES.string
Filter by
bank_account or phone_number.string
default:"active"
active, inactive, or all.integer
default:"1"
Page number to return.
integer
default:"20"
Results per page, up to
100. limit is accepted as an alias.Response
GET /fees/{id}
Retrieves one fee product. Returns404 with code not_found if the ID does not exist.
cURL
POST /fees/calculate
Calculates the fee for an amount without creating a quote or locking a rate. Use it to show a live fee preview while a user types an amount.string
required
Fee product, for example
offramp or swap.string
required
Transaction amount as a decimal string.
string
required
Currency of
amount, for example USDC.string
Network:
stellar, celo, or btc. Required for products with a network fee.string
Fiat currency. Required for
onramp, offramp, buy, and withdraw.string
bank_account or phone_number. Required when pricing differs by method.string
Target asset. Required for
swap.Response
string
Amount left after fees, in
currency.object
How the processing fee was derived, including whether the minimum or maximum cap was applied.
Errors
Create a quote
Lock the exact rate and fee for 30 minutes.
Check rates
Get live exchange rates before quoting.
