> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zuba.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Money amounts are always major-unit decimal strings (e.g. "1000.00"), never floats and never minor units, in every request, response, and webhook payload.
> Authentication is an API key sent as Authorization: Bearer <key> on every request, with no token exchange. Keys start with zk_test_ in sandbox and zk_live_ in production. A key issued with a Client ID can still use the retiring client-credentials token exchange.
> Set a unique clientRef on every money-moving request; it is the idempotency key, and retries return the original resource.
> Quotes are single-use, intent-locked, and expire fast: always read expiresAt, consume the quote with the executor matching its intent, and re-quote on expiry instead of retrying.
> Prefer webhooks over polling for payout, order, application, and virtual-account status tracking.
> Use the sandbox (api.sandbox.zuba.com) with its deterministic magic values before touching production.

# Developer Fees

> Charge your own fee on payouts your sub-accounts send: set a default per currency pair, override or waive it per payout, and track what you have earned

If your workspace is a financial institution with sub-accounts, you can charge your own fee on the payouts those sub-accounts send. Zuba adds the fee to the sub-account's debit, holds it while the payout is in flight, and pays it to your main balance once the payout is paid. If the payout fails, is cancelled or is returned, the fee goes back to the sub-account.

You can set a fee in two ways:

* **A default per currency pair.** Set it once with `PUT /v1/developer-fees` (or in the dashboard) and every payout on that pair from any of your sub-accounts carries it.
* **An override per payout.** Send `developerFee` on `POST /v1/payouts` to replace the default for that one payout, or to waive it.

Payouts sent from your main balance (no `Zuba-Account-Id` header) never carry a developer fee.

## Prerequisites

* **A financial-institution workspace with sub-accounts.** Developer fees apply only to payouts sent from a sub-account (see [Sending from a sub-account](https://docs.zuba.com/concepts/payouts.md#sending-from-a-sub-account)). Any other workspace gets `403 developer_fees_not_available` on every developer fee endpoint. Contact your account manager to get set up.
* **An API key with the developer fee scopes.** Reading fees needs `read:developer_fees`; setting or removing one needs `write:developer_fees` (see [Scopes](https://docs.zuba.com/authentication.md#scopes)).

The examples below use the sandbox host `https://api.sandbox.zuba.com`. In production, swap it for `https://api.zuba.com`; everything else is identical.

## How a fee is calculated

A fee has a `percentage`, a `fixed` amount, or both:

* `percentage` is a percent of the payout amount, from `0` to `100` with at most 2 decimal places. `"0.5"` is 0.5%.
* `fixed` is an amount in the payout's **source currency** (the currency debited), with no more decimal places than that currency has (2 for USD, 8 for USDC and USDT).

When both are set they are added together. The result is rounded up to the source currency's smallest unit.

| Payout | Fee terms | Developer fee | Total debited from the sub-account |
| - | - | - | - |
| 1,000.00 USD to NGN | `percentage: "0.5"` | 5.00 USD | 1,000.00 USD + Zuba's fee + 5.00 USD |
| 1,000.00 USD to NGN | `fixed: "10"` | 10.00 USD | 1,000.00 USD + Zuba's fee + 10.00 USD |
| 1,000.00 USD to NGN | `percentage: "0.5"`, `fixed: "10"` | 15.00 USD | 1,000.00 USD + Zuba's fee + 15.00 USD |

The developer fee is charged on top of the payout and Zuba's fee. The payout's `totalDebit` is the full amount taken from the sub-account, developer fee included.

## Step 1: See which pairs you can set a fee on

A fee can be set on any currency pair your workspace has enabled for payouts. List them:

```bash theme={"dark"}
curl "https://api.sandbox.zuba.com/v1/developer-fees/pairs" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

```json theme={"dark"}
{
  "object": "developer_fee_pair.list",
  "data": [
    { "from": "USD", "to": "GHS" },
    { "from": "USD", "to": "NGN" }
  ],
  "hasMore": false,
  "nextCursor": null
}
```

All pairs come back in one page, sorted by `from` then `to`.

## Step 2: Set a default fee for a pair

```bash theme={"dark"}
curl -X PUT "https://api.sandbox.zuba.com/v1/developer-fees" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "USD",
    "to": "NGN",
    "fees": { "percentage": "0.5", "fixed": "10" }
  }'
```

```json theme={"dark"}
{
  "from": "USD",
  "to": "NGN",
  "fees": { "percentage": "0.5", "fixed": "10" },
  "enabled": true,
  "createdAt": "2026-11-02T18:00:00.000Z",
  "updatedAt": "2026-11-02T18:00:00.000Z"
}
```

`PUT` creates the fee or replaces the one already set on the pair. There is one fee per pair, and it applies to every sub-account. Sending the same fee again changes nothing.

To list every fee you have set:

```bash theme={"dark"}
curl "https://api.sandbox.zuba.com/v1/developer-fees?limit=50" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

The list is newest first and paginated with `cursor` and `limit`, like other list endpoints. A fee on a pair that is no longer enabled for payouts stays in the list with `enabled: false`. It is kept, but charges nothing.

## Step 3: Send a payout from a sub-account

Send the payout as usual with the sub-account's ID in `Zuba-Account-Id`. The default fee for its pair applies on its own:

```bash theme={"dark"}
curl -X POST "https://api.sandbox.zuba.com/v1/payouts" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Zuba-Account-Id: SUB_ACCOUNT_ID" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

The payout carries a `developerFee` object:

```json theme={"dark"}
{
  "developerFee": {
    "amount": "15.00",
    "currency": "USD",
    "percentage": "0.5",
    "fixed": "10",
    "source": "default",
    "status": "held"
  }
}
```

| Field | Meaning |
| - | - |
| `amount` | The fee charged, in `currency` |
| `currency` | The payout's source currency |
| `percentage`, `fixed` | The terms the fee was priced with, or `null` for a term that was not set |
| `source` | `default` when the pair's fee applied, `override` when the payout request sent its own |
| `status` | `held` until the fee reaches your main balance, which is no earlier than the payout being paid; `earned` once it has; `refunded` when the payout failed, was cancelled or was returned |

A returned payout refunds the developer fee even when it keeps Zuba's fee. `developerFee` is `null` on a payout that carries no developer fee. The same object is on `GET /v1/payouts/{id}` and in [payout webhook events](https://docs.zuba.com/guides/webhooks.md).

## Override or waive the fee on one payout

Send `developerFee` in the `POST /v1/payouts` body to price one payout differently from the pair's default:

```json theme={"dark"}
{
  "developerFee": { "percentage": "1" }
}
```

To waive the fee on a payout, send zero for both terms:

```json theme={"dark"}
{
  "developerFee": { "percentage": "0", "fixed": "0" }
}
```

A waived fee has an `amount` of `0` and is never held: its status reads `earned` unless the payout failed, was cancelled or was returned.

An override with a `fixed` amount other than zero needs the source currency, so on a payout other than crypto the request must also carry `inputCurrency` or a `quoteId`. Without one it is refused with `422 input_currency_required`. A waiver needs neither, since a zero fixed amount is the same in every currency.

## Remove a fee

```bash theme={"dark"}
curl -X DELETE "https://api.sandbox.zuba.com/v1/developer-fees?from=USD&to=NGN" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

A successful removal returns `204`. Payouts on that pair then carry no developer fee unless the request sends its own.

## Managing fees in the dashboard

Owners and admins of a financial-institution workspace can also set, change and remove fees in the dashboard under **Accounts → Developer fees**. It lists every enabled pair with its fee, or "No fee", and the fee on a 1,000 payout. Other roles see the fees read-only.

## Errors

| Status | `error` | When |
| - | - | - |
| `400` | `BAD_REQUEST` | The body or query is malformed: a bad currency code, `fees` sets neither `percentage` nor `fixed`, `percentage` is outside 0 to 100 or has more than 2 decimal places, or `fixed` is negative |
| `403` | `developer_fees_not_available` | Developer fees are not available to the workspace, or a payout override was sent on a payout that is not from a sub-account |
| `403` | `insufficient_scope` | The API key lacks `read:developer_fees` or `write:developer_fees` |
| `404` | `developer_fee_not_found` | `DELETE` named a pair that has no fee set |
| `422` | `pair_not_enabled` | `PUT` named a pair that is not enabled for payouts on your workspace |
| `422` | `developer_fee_precision_exceeded` | `fixed` has more decimal places than the source currency allows |
| `422` | `input_currency_required` | A payout override with a `fixed` amount other than zero was sent without `inputCurrency` or a `quoteId` |

See [Error handling](https://docs.zuba.com/guides/error-handling.md) for the general error format.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.