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

> ## Agent Instructions
> Tribridge is a crypto payment gateway for Solana and Sui (TON is coming soon). API base URL is https://tribridge.onrender.com. Server-side calls authenticate with the x-api-key header using a tri_test_... key (fully simulated test mode, no real funds) or tri_live_... key (real mainnet payments) — never expose keys client-side. Merchant test mode is simulated, not testnet. Refunds are automatic only (underpaid/overpaid), there is no manual refund endpoint. Always verify webhook HMAC-SHA256 signatures from the X-Tribridge-Signature header before trusting payloads.

# Payouts

> Withdraw your settled balance to a linked wallet, confirmed with a one-time email code.

Every merchant gets **one free scheduled payout per day** — Tribridge covers the network gas. Need funds sooner? Request an additional payout any time; only the network gas is deducted from your balance. Tribridge never charges a withdrawal fee.

All payouts are confirmed with a one-time email code, and executed **from the Tribridge vault** on-chain.

## How it works

<Steps>
  <Step title="Balance settles">
    Collected payments are confirmed and settled into your available balance (net of prior payouts).
  </Step>

  <Step title="Check context">
    Call `GET /payouts/context` to see per-chain available and pending balances plus your linked payout wallets.
  </Step>

  <Step title="Request a code">
    Call `POST /payouts/request-otp`. Tribridge emails a 6-digit confirmation code to your account. A destination wallet is required before a code is issued — either a **linked payout wallet** or an explicit `destination_address`.
  </Step>

  <Step title="Execute the payout">
    Call `POST /payouts` with the code. The payout is executed on-chain from the vault to your destination.
  </Step>
</Steps>

## Get payout context

`GET /payouts/context` — Everything the payout UI needs in one call: available balance per chain (net of prior payouts), pending balance, and your linked payout wallets. Add `?mode=live|test` to scope it.

```json Example response theme={null}
{
  "total_available": 9.5,
  "balances": [
    { "chain": "solana", "available": 5.5, "pending": 0 },
    { "chain": "sui",    "available": 4.0, "pending": 1 }
  ],
  "wallets": [
    { "chain": "solana", "address": "6nvzJiGH…" }
  ]
}
```

## Request a confirmation code

`POST /payouts/request-otp` — Emails a payout confirmation code to your account. Call this before `POST /payouts`.

```bash cURL theme={null}
curl -X POST https://tribridge.onrender.com/payouts/request-otp \
  -H "Authorization: Bearer <JWT>"
```

<Note>
  Dashboard sessions use your login JWT (`Authorization: Bearer`) for payout endpoints — not the `x-api-key`. API keys authenticate merchant server integrations; payouts are a dashboard-level money movement, hence the extra email-code step.
</Note>

## Execute a payout

`POST /payouts` — Creates and executes a payout. Requires the confirmation code from the previous step.

| Field | Type | Required | Description |
| - | - | - | - |
| `chain` | string | Yes | `solana` or `sui`. |
| `coin_symbol` | string | Yes | `USDC` / `USDT`. |
| `amount` | number | Yes | Amount to withdraw. Must not exceed the available balance. |
| `destination_address` | string | No | Defaults to your linked payout wallet for that chain. |
| `otp` | string | Yes | The emailed 6-digit confirmation code. |

```bash cURL theme={null}
curl -X POST https://tribridge.onrender.com/payouts \
  -H "Authorization: Bearer <JWT>" \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "solana",
    "coin_symbol": "USDC",
    "amount": 5.00,
    "otp": "123456"
  }'
```

## List payouts

`GET /payouts` — Lists your payouts, newest first, with status, amount, destination, and transaction hash.


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