How to return the 0x swap fees to your end-users
Last updated: June 25, 2026
You can display swap fees to your users by reading the fee information returned in the API quote response. The 0x Swap API includes a fees object in every quote response that contains the breakdown of all applicable fees.
Fee Information in the Quote Response
When you include affiliate fee parameters in your Swap API request, the response will contain a fees object with an integratorFee field:
"fees": {
"integratorFee": {
"amount": "1000000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "volume"
}
}
The fees object can also include:
integratorFee | Your affiliate fee amount and token
zeroExFee | 0x protocol fee, if applicable
bridgeNativeFee | Additional bridge infrastructure cost (cross-chain only)
How to Display Fees in the UI
There are two recommended methods to display fees to your users:
- Display the fees.integratorFee.amount value (make sure to account for the token's base units/decimals)
- Display the swapFeeBps percentage and the swapFeeToken symbol separately
How the Fee Amount Is Calculated
The integratorFee.amount is calculated as:
amount = (swapFeeBps / 10000) * sellAmount
For example, for a 1% fee (swapFeeBps=100) on selling 100 USDC (sellAmount=100000000):
Fee amount = 1000000 = 1 USDC
Setting Up Affiliate Fees
To enable fees in the first place, include these parameters in your Swap API request:
swapFeeRecipient — wallet address to receive the fees
swapFeeBps — fee amount in basis points (0–1000 bps = 0–10%)
swapFeeToken — token address for fee payment; must be either buyToken or sellToken
&swapFeeRecipient=$INTEGRATOR_WALLET_ADDRESS
&swapFeeBps=100
&swapFeeToken=0x6B175474E89094C44Da98b954EedeAC495271d0F
Note that swapFeeBps has a default limit of 1000 bps for security. If you need a higher value, you'll need to contact 0x support.
In summary, the fee data is readily available in the fees.integratorFee object of the quote response — you just need to parse it and display it in your UI, taking care to format the amount correctly using the token's decimal precision.