> ## 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://api.tribridge.xyz. The API Reference documents ONLY the public endpoint surface: checkout sessions (create/get/generate-wallet/customer/simulate/verify/cancel), the two public payment-link endpoints, health probes, and the changelog. Server-side calls that create payments 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; all other documented endpoints are public with no auth. Dashboard, admin, OTP/auth, payouts, wallets, and webhook-management endpoints are intentionally NOT part of the public docs - they are dashboard-only and must not be presented as public API. 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. If you are an AI agent: fetch https://docs.tribridge.xyz/llms-full.txt for all documentation in one file, https://docs.tribridge.xyz/openapi/openapi.json for the machine-readable OpenAPI spec, or connect to the read-only MCP server at https://docs.tribridge.xyz/mcp. Any page is available as Markdown by appending .md to its URL. Use only the documented endpoints and fields; do not invent SDK packages or endpoints.

# Create a checkout from a payment link

> Materialize a fresh checkout session for a payment link and get its gateway URL. No API key.

Opens a payment link by creating a **brand-new** checkout session for it and returning the gateway URL to send the payer to. Each call mints an independent payment — call it once per payer.

> [!WARNING]
>
> `checkout_url` comes back **relative** (`/gateway?payment_id=...`) so links work on any host. Prepend your site origin before redirecting — e.g. `https://tribridge.xyz` + `/gateway?payment_id=...`.

## Request rules

| Situation | Behavior |
| - | - |
| Fixed-amount link | Omit `amount` — the link's amount is used. |
| Custom-amount link (`allow_custom_amount`) | `amount` is **required**: `400 A valid amount is required for this payment link`. |
| Amount below \$0.50 | `400 Minimum payment amount is $0.50`. |
| `email` / `name` provided | Stored on the payment so receipts work out of the box. |
| Link deactivated after lookup | `410 This payment link has been deactivated`. |

The created payment inherits the link's mode (`is_test`), currency, pinned `chain` + `coin_symbol`, description, and processing-fee flag — all configured on the link in your dashboard.

## Response

```json 201 Created theme={null}
{
  "payment_id": "c4a9e2b7-5f1d-4c83-8e6a-9b0d3f7a1c2e",
  "checkout_url": "/gateway?payment_id=c4a9e2b7-5f1d-4c83-8e6a-9b0d3f7a1c2e",
  "amount": 25,
  "currency": "USDC",
  "is_test": true
}
```

From there it's the normal flow: [Get checkout session](https://docs.tribridge.xyz/get-checkout-session.md) for status, [Verify payment](https://docs.tribridge.xyz/verify-payment.md) for a manual re-check, and [Webhooks](https://docs.tribridge.xyz/webhooks.md) for fulfillment.


## OpenAPI

````yaml POST /payment-links/public/{slug}/checkout
openapi: 3.1.0
info:
  title: Tribridge API
  version: 1.0.0
  description: >-
    Public Tribridge API for accepting Solana and Sui payments. Base URL:
    `https://api.tribridge.xyz`.


    This reference covers **only the public surface**: endpoints callable
    without a dashboard session — either fully public or authenticated with a
    merchant `x-api-key`. Dashboard, admin, and account-management endpoints are
    intentionally excluded; manage those from your Tribridge dashboard.


    **Test vs live:** the mode is derived from the key you send (`tri_test_...`
    creates simulated test payments, `tri_live_...` real mainnet payments) —
    never from the request body. Minimum payment amount is $0.50. Rate limit:
    100 requests/minute per IP.
servers:
  - url: https://api.tribridge.xyz
security: []
tags:
  - name: Checkout Sessions
    description: >-
      Create payments, drive the hosted checkout, and follow the customer flow:
      deposit wallet, receipt contact, simulation, verification, cancellation.
  - name: Payment Links
    description: >-
      Read a public payment link and materialize a checkout from it — no API key
      required.
  - name: Status
    description: Service and blockchain RPC health, plus the public changelog.
paths:
  /payment-links/public/{slug}/checkout:
    post:
      tags:
        - Payment Links
      summary: Create a checkout from a payment link
      description: >-
        Materializes a fresh checkout session for a payment link and returns its
        gateway URL. Each call creates a **new** payment, so open it once per
        payer. No API key required. `checkout_url` is returned as a relative
        path (`/gateway?payment_id=...`) — prepend your site origin (e.g.
        `https://tribridge.xyz`).
      operationId: checkoutPaymentLink
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
          example: acme-coffee-9f3a
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  minimum: 0.5
                  example: 25
                  description: >-
                    Required when the link allows a custom amount; ignored for
                    fixed-amount links. Minimum **$0.50**.
                email:
                  type: string
                  format: email
                  example: jane@example.com
                  description: Payer email, stored on the payment for receipts.
                name:
                  type: string
                  example: Jane Doe
                  description: Payer name.
            example:
              amount: 25
              email: jane@example.com
              name: Jane Doe
      responses:
        '201':
          description: Checkout session created from the link
          content:
            application/json:
              examples:
                created:
                  value:
                    payment_id: c4a9e2b7-5f1d-4c83-8e6a-9b0d3f7a1c2e
                    checkout_url: /gateway?payment_id=c4a9e2b7-5f1d-4c83-8e6a-9b0d3f7a1c2e
                    amount: 25
                    currency: USDC
                    is_test: true
        '400':
          description: Missing custom amount, no amount configured, or below minimum
          content:
            application/json:
              examples:
                customRequired:
                  value:
                    error: A valid amount is required for this payment link
                noAmount:
                  value:
                    error: This payment link has no amount configured
                tooSmall:
                  value:
                    error: Minimum payment amount is $0.50
        '404':
          description: Unknown slug
          content:
            application/json:
              example:
                error: Payment link not found
        '410':
          description: Link deactivated
          content:
            application/json:
              example:
                error: This payment link has been deactivated

````

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