> ## 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.

# Initial Setup

> Create your merchant account, get API keys, and run your first test payment in about 5 minutes.

## Prerequisites

* A Tribridge merchant account (free, created below).
* A server or backend that can make HTTPS requests and keep secrets (API keys must never live in frontend code).
* An HTTPS endpoint of your own if you want to receive webhooks (for local development, a tunnel like ngrok works).

<Steps>
  <Step title="Create an account">
    Sign up at [tribridge.tech/signup](https://tribridge.tech/signup) and verify your email. This unlocks the merchant dashboard.

    Then add a **payout wallet** for each chain you want to accept — this is the destination address where your settled funds are paid out. Your payout wallet remains a destination only you control.
  </Step>

  <Step title="Generate your API keypair">
    In the dashboard, open **API Keys** and generate a keypair. You receive two keys at once, each shown **exactly once**:

    | Key | Prefix | What it does |
    | - | - | - |
    | Test key | `tri_test_...` | Simulated payments. No real funds move. Build and validate webhooks with this. |
    | Live key | `tri_live_...` | Real on-chain payments on mainnet. Switch to this only after test mode works. |

    Save both somewhere safe — a secrets manager or environment variables, never in git:

    ```bash .env theme={null}
    TRIBRIDGE_TEST_KEY=tri_test_your_key_here
    TRIBRIDGE_LIVE_KEY=tri_live_your_key_here
    ```
  </Step>

  <Step title="Create your first test payment">
    Call `POST /payments` with your **test** key. A success response contains a `checkout_url`:

    ```bash cURL theme={null}
    curl -X POST https://tribridge.onrender.com/payments \
      -H "Content-Type: application/json" \
      -H "x-api-key: tri_test_your_key_here" \
      -d '{
        "amount": 25.00,
        "currency": "USD",
        "redirect_url": "https://yoursite.com/success"
      }'
    ```

    Open the returned `checkout_url` (it looks like `https://tribridge.onrender.com/gateway?payment_id=...`), pick a chain, and click the **Simulate Payment** button — test mode only. The payment drives straight to `completed` and Tribridge fires your **test** webhook, exactly like a live payment would.
  </Step>

  <Step title="Go live">
    Once your webhook handler verifies correctly in test mode:

    1. Swap `tri_test_...` for `tri_live_...` in your server config.
    2. Register a **live** webhook endpoint (`POST /webhooks` with `is_test: false`).
    3. Accept your first real payment.

    No code changes beyond the key swap are needed.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Creating Payments" icon="credit-card" href="/payments">
    Full reference for POST /payments — headers, fields, and responses.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/webhooks">
    Register endpoints and verify signatures before going live.
  </Card>
</CardGroup>


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