> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.0x.org/llms.txt.
> For full documentation content, see https://docs.0x.org/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.0x.org/_mcp/server.

# Multi-Fee Support

> Collect fees for multiple recipients in a single swap using the Swap and Gasless APIs.

The Swap and Gasless APIs support collecting fees for **multiple recipients in a single transaction**. This is useful for use cases like revenue sharing between a protocol and a frontend, splitting fees between partners, or distributing fees across multiple treasury addresses — all without requiring multiple transactions or custom contracts.

## Overview

Fee splitting is controlled by three query parameters that work together:

* `swapFeeRecipient` — one or more wallet addresses (comma-separated) that receive fees at settlement
* `swapFeeBps` — one or more fee amounts in basis points (comma-separated), defining how much each recipient earns
* `swapFeeToken`*(optional)* — the token fees are collected in; can be omitted or set to either the address of `buyToken` or `sellToken`

`swapFeeRecipient` and `swapFeeBps` are positionally matched and co-dependent. The first value in `swapFeeBps` applies to the first address in `swapFeeRecipient`, the second to the second, and so on. Both must be present and the same length.\
\
Use `swapFeeToken` to specify which token fees are collected in — either the `buyToken` or `sellToken`. If omitted, 0x defaults to the buy token, unless the sell token has higher priority (e.g., stablecoins or a more liquid asset) or the buy token is ineligible.

## Parameters

The wallet address(es) to receive trading fees. Accepts a single address or multiple comma-separated addresses.

**Example:** `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359`

When providing multiple values, the list must be the same length as `swapFeeBps`. You must also specify `swapFeeBps` to use this parameter.

The fee amount(s) in basis points (Bps) to charge per recipient. Accepts a single value or multiple comma-separated values.

**Example:** `5,10`

When providing multiple values, the list must be the same length as `swapFeeRecipient`. The default maximum is **1000 Bps** per recipient. [Contact us](mailto:support@0x.org) if your integration requires a higher limit.

The contract address of the token to collect trading fees in. Accepts a single address or multiple comma-separated addresses.

**Format:** `^\s*0x(?!0{40})[a-fA-F0-9]{40}(\s*,\s*0x(?!0{40})[a-fA-F0-9]{40})*\s*$`

Each value must be set to either the address of the `buyToken` or the `sellToken`. When multiple values are provided, the list must be the same length as `swapFeeBps`.

If omitted, 0x selects the fee token from the trade. The buy token is used by default unless the sell token has higher priority (e.g., stablecoins or more liquid assets) or the buy token is ineligible.

You must also specify `swapFeeRecipient` and `swapFeeBps` to use this parameter.

`swapFeeRecipient` and `swapFeeBps` are co-dependent — you must specify both
together. When using multiple fees, both lists must be the same length and
positionally matched (index 0 of `swapFeeBps` applies to index 0 of
`swapFeeRecipient`, and so on). `swapFeeToken` must also match this length
when multiple values are provided.

## Example Request

The following example splits fees between two recipients on a USDC → USDT swap — 5 Bps to the platform and 10 Bps to a distribution partner. `swapFeeToken` is omitted, so fees default to the buy token (USDT).

```bash cURL
curl "https://api.0x.org/swap/allowance-holder/price\
?chainId=1\
&buyToken=0xdac17f958d2ee523a2206206994597c13d831ec7\
&sellToken=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\
&sellAmount=100000000\
&taker=0x70a9f34f9b34c64957b9c401a97bfed35b95049e\
&swapFeeRecipient=0xPLATFORM_ADDRESS,0xPARTNER_ADDRESS\
&swapFeeBps=5,10" \
-H "0x-api-key: <YOUR_API_KEY>"
```

```typescript TypeScript
const params = new URLSearchParams({
  chainId: "1",
  buyToken: "0xdac17f958d2ee523a2206206994597c13d831ec7",
  sellToken: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  sellAmount: "100000000",
  taker: "0x70a9f34f9b34c64957b9c401a97bfed35b95049e",
  swapFeeRecipient: [
    "0xPLATFORM_ADDRESS", // index 0 — earns 5 Bps
    "0xPARTNER_ADDRESS", // index 1 — earns 10 Bps
  ].join(","),
  swapFeeBps: "5,10",
  // swapFeeToken (optional)
});

const response = await fetch(
  `https://api.0x.org/swap/allowance-holder/price?${params}`,
  {
    headers: {
      "0x-api-key": process.env.ZEROX_API_KEY!,
      "0x-version": "v2",
    },
  },
);

const data = await response.json();

// Access full fee breakdown
data.fees.integratorFees.forEach((fee, i) => {
  console.log(`Recipient ${i}: ${fee.amount} of ${fee.token}`);
});
```

```python Python
import os
import requests

params = {
    "chainId": "1",
    "buyToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "sellToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "sellAmount": "100000000",
    "taker": "0x70a9f34f9b34c64957b9c401a97bfed35b95049e",
    "swapFeeRecipient": ",".join(["0xPLATFORM_ADDRESS", "0xPARTNER_ADDRESS"]),
    "swapFeeBps": "5,10",
    # swapFeeToken (optional)
}

response = requests.get(
    "https://api.0x.org/swap/allowance-holder/price",
    params=params,
    headers={"0x-api-key": os.environ["ZEROX_API_KEY"]},
)

data = response.json()

# Access full fee breakdown
for i, fee in enumerate(data["fees"]["integratorFees"]):
    print(f"Recipient {i}: {fee['amount']} of {fee['token']}")
```

## Example Response

When multiple fees are configured, the response includes both the legacy `integratorFee` field (containing the first fee, for backwards compatibility) and the new `integratorFees` array (containing all fees):

```json
{
  "fees": {
    "integratorFee": {
      "amount": "49989",
      "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "type": "volume"
    },
    "integratorFees": [
      {
        "amount": "49989",
        "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "type": "volume"
      },
      {
        "amount": "99978",
        "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "type": "volume"
      }
    ],
    "zeroExFee": {
      "amount": "149968",
      "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "type": "volume"
    },
    "gasFee": null
  }
}
```

`fees.integratorFee` is retained for backwards compatibility and always
reflects the **first** fee in the list. Use `fees.integratorFees` to access
the full breakdown of all fees.

Each entry in `integratorFees` corresponds positionally to the `swapFeeRecipient` and `swapFeeBps` values in your request:

| Index | Recipient            | Fee (Bps) | Amount (in buy token) |
| ----- | -------------------- | --------- | --------------------- |
| 0     | `0xPLATFORM_ADDRESS` | 5         | 49,989                |
| 1     | `0xPARTNER_ADDRESS`  | 10        | 99,978                |