> For the complete documentation index, see [llms.txt](https://docs-processing.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-processing.crypto-chief.com/payments/creating-a-payout.md). Agents can also search and read this documentation through its [MCP server](https://docs-processing.crypto-chief.com/~gitbook/mcp).

# Creating a PayOut

## PayOut: Withdrawals & Settlements

The PayOut API enables automated withdrawals from your Master Wallets to external addresses (Cold Wallets). Unlike incoming payments, payouts require active liquidity management. The platform handles gas estimation, automatic refuels, and complex routing strategies to ensure successful delivery.

{% hint style="info" %}
**Paying many recipients at once?** Use **Mass Payout** — a single request creates or estimates up to 50 payouts, each processed by the same engine described below. See Batch Estimate and Batch Execute, or jump to 3. Mass Payout (Batch).
{% endhint %}

#### 1. Overview & Mechanics

**1.1 Wallet Roles**

Payouts spend from your project's **master wallets**. For a token payout, the selected master must hold the token and have enough native coin for fees by the time it sends the transfer.

CryptoChief signs for an `internal` master. For an `external` master, CryptoChief sends the transfer to that wallet's `signing_callback_url` during payout processing. Keep the signer available after you submit the payout. The payout's `url_callback` receives status notifications. [External wallet signing](https://docs-processing.crypto-chief.com/pages/D8comWIqzrtjDHcsSrEk#id-3.-receive-a-signing-request)

**1.2 Gas Protection & Auto-Refuel**

Token transfers (e.g. USDT) require network fees paid in the native coin of the blockchain. Before executing any payout, the system performs a pre-flight check to estimate the required gas and verify availability.

If the Master Wallet does not have enough native balance, the platform may automatically perform a gas refuel operation. To protect against unexpected costs, the payout is rejected if the total required amount (network fee + refuel) exceeds the configured `max_fee_amount_fiat`.

**Fee Handling Modes**

The platform supports multiple fee handling strategies that define how network fees are funded:

**client**\
Network fees are paid using the client's own Master Wallet.\
If the target wallet lacks native balance, the system attempts to refuel it from the client's Master Wallet.

**service**\
Network fees are paid by the platform.\
Gas is supplied from the project's service wallet, and the equivalent amount is deducted from API Credits.

**mix**\
A hybrid approach for maximum reliability.\
The system first attempts the client flow; if it fails (for example, due to insufficient master balance), it automatically falls back to the service flow.

**1.3 Liquidity Aggregation (Multi-Source)**

If a single wallet cannot cover the requested amount, you can enable Multi-Source Mode.

* Logic: The system scans all available Master Wallets.
* Plan: It splits the payout into multiple transactions (e.g., 60 USDT from Wallet A + 40 USDT from Wallet B).
* Result: The recipient receives the total requested amount in multiple transfers.

**1.4 Double-Spend Protection (Locked Funds)**

The system tracks "Pending Payouts" in real-time. Even if the blockchain balance hasn't updated yet, funds reserved for queued tasks are subtracted from the available balance. This prevents creating orders that would overdraft your wallets.

#### 2. PayOut Methods

The PayOut flow is split into **two explicit steps**:\
**Estimate** and **Execute**.\
This separation allows you to preview costs and feasibility before committing funds on-chain.

**2.1 Estimate PayOut**

**Purpose**\
The Estimate method simulates a payout without creating any blockchain transactions.\
It allows you to understand **fees, routing, and liquidity availability** in advance.

**What it does**

* Calculates the required **network fee** (gas)
* Checks **native coin balance** for gas payment
* Plans **auto-refuel operations** if needed
* Evaluates **multi-source splitting** (if enabled)
* Verifies the `max_fee_amount_fiat` constraint
* Returns a full execution plan

**Important**

* No funds are locked
* No transactions are sent
* The result is informational only

[**Documentation**](https://docs-processing.crypto-chief.com/payments/creating-a-payout/estimate.md)

**2.2 Execute PayOut**

**Purpose**\
The Execute method creates and submits a real payout order based on the validated parameters.

**What it does**

* Locks required funds immediately (pending payout protection)
* Executes auto-refuel operations if required
* Sends one or multiple on-chain transactions
* Tracks execution status until completion or failure

**Execution guarantees**

* Double-spend protection via locked balances
* Gas sufficiency ensured before token transfer
* Multi-source payouts executed atomically at the planning level

**Important**

* Funds are reserved immediately
* Blockchain transactions are created
* The operation is irreversible once broadcasted

[**Documentation**](https://docs-processing.crypto-chief.com/payments/creating-a-payout/execute.md)

**Recommended Flow**

1. Call **Estimate PayOut** to validate cost and feasibility
2. Review the returned plan and fees
3. Call **Execute PayOut** using the same parameters to perform the withdrawal

This two-step model provides **maximum transparency, safety, and cost control** for automated payouts.

#### 3. Mass Payout (Batch)

Need to pay out to many recipients at once? The **Mass Payout** endpoints create or estimate **many payouts in a single request** — ideal for bulk settlements, mass user withdrawals, and scheduled payout runs.

Each item in the batch is processed by **exactly the same engine** as a single payout, so everything above — fee modes, gas auto-refuel, multi-source aggregation and double-spend protection — applies to every item unchanged. Each item becomes a normal, independent payout you can track via PayOut Information / PayOut History, and each fires its own PayOut Webhook.

**3.1 Best-Effort Processing**

A batch is **best-effort**: a failing item (for example, insufficient funds or an asset that isn't enabled) is reported in its own `items[].error` and **does not block the rest**. Only structural problems with the whole request — an empty list, too many items, or a duplicate `order_id` — reject the entire call.

**3.2 Limits & Ordering**

* Up to **50 items** per request (server-configurable).
* Items are processed **sequentially**: an item's plan already sees funds locked by earlier items in the same batch, so Double-Spend Protection holds **within** the batch as well.
* Each item is **idempotent** by `order_id` (which must be unique within the batch), so re-sending an entire batch after a network error is safe — already-created items return their current state instead of being duplicated.

**3.3 Billing**

Each Mass Payout call is billed as a **single API action** — a flat fee per request, regardless of how many recipients the batch contains:

| Action                       | API Credits | USD    |
| ---------------------------- | ----------- | ------ |
| Estimate Mass Payout (batch) | 30,000      | $0.003 |
| Create Mass Payout (batch)   | 180,000     | $0.018 |

Because the fee is flat per call, larger batches cost less per recipient than issuing each payout individually. Network fees follow the same fee-handling modes (client / service / mix) as single payouts. See the [pricing page](https://crypto-chief.com/pricing/) for the authoritative table.

**3.4 Methods**

* **Batch Estimate** — preview fees, routing and feasibility for every item, without creating anything. **Documentation**
* **Batch Execute** — create all payouts; returns a `batch_uuid` and a per-item status (`queue` with a payout `uuid`, or `error`). **Documentation**

**Recommended Flow (Batch)**

1. Call **Batch Estimate** to validate cost and feasibility for the whole list
2. Review `total_estimated_fee_fiat` and the per-item plans
3. Call **Batch Execute** with the same items to perform the withdrawals
4. Track each accepted payout by its `uuid` (PayOut Information / History and webhooks)

For very large payout runs, split them into several batches of up to 50 items each.
