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

# Quickstart

> Authenticate, confirm your account, and run a direct-route or Treasury workflow.

Start with an authenticated read, then choose direct customer payment routes or the prefunded Treasury
workflow.

<Note>
  **Sandbox:** `https://api.sandbox.rails.wayex.com` · **Production:** `https://api.rails.wayex.com`
  — all current endpoints are versioned under `/v1`. Examples use the sandbox base URL; swap in the
  production URL and a production key when you go live.
</Note>

## Connect

<Steps>
  <Step title="Get the correct API key">
    Sign in to the intended tenant account and open **Developers → API keys**. Use a secret key
    (`sk_…`) on your server. Store each tenant account's key separately; a key never switches
    accounts.
  </Step>

  <Step title="Read an indicative rate">
    Confirm authentication with a read-only request:

    ```bash theme={null}
    curl "https://api.sandbox.rails.wayex.com/v1/rates?source=aud&destination=usdc" \
      -H "Authorization: Bearer $WAYEX_SECRET_KEY"
    ```

    This rate is indicative — it locks nothing, and the executed rate can differ. For direct
    routes, the binding rate is struck the moment your customer's funds arrive. For Treasury,
    lock an exact price by requesting and accepting a short-lived conversion quote.
  </Step>

  <Step title="Choose the workflow">
    Continue with a direct customer route when every funding belongs to an onboarded customer. Use
    Treasury when your organisation prefunds its own isolated wallet and explicitly pays, converts,
    or withdraws.
  </Step>
</Steps>

## Treasury: fund and pay

Wayex enables Treasury for your tenant account and sets its policy — fees, limits, and which
capabilities (funding, payouts, conversions, withdrawals) are switched on. Requests against a
capability that is not enabled are refused. Reads need the `treasury:read` scope; writes need
`treasury:write`.

<Steps>
  <Step title="Check the account and balance">
    ```bash theme={null}
    curl https://api.sandbox.rails.wayex.com/v1/treasury \
      -H "Authorization: Bearer $WAYEX_SECRET_KEY"
    ```

    Confirm the tenant account, enabled rails/networks, and the wallet's `available`, `reserved`, and
    `pending` amounts. The API key determines the account.
  </Step>

  <Step title="Fund the wallet">
    Fetch or create an AUD BSB/account funding instrument or stablecoin address. Send only to the
    exact instructions for this account, then wait until the net credit appears in `available`.
    See [Funding and balances](/treasury/funding-and-balances).
  </Step>

  <Step title="Create a beneficiary">
    This example creates an individual BSB/account recipient. The external reference is optional;
    Wayex generates one when you omit it.

    ```bash theme={null}
    curl -X POST https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries \
      -H "Authorization: Bearer $WAYEX_SECRET_KEY" \
      -H "Idempotency-Key: beneficiary-transfer-aud-001" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "individual",
        "destination": {
          "type": "bank_account",
          "bsb": "062000",
          "accountNumber": "12345678",
          "accountName": "Ava Williams"
        },
        "firstName": "Ava",
        "lastName": "Williams",
        "dateOfBirth": "1991-05-14",
        "address": "100 Market Street, Sydney NSW 2000"
      }'
    ```

    If your account is configured to require reusable identity evidence, add a `sumsub` object
    with a single-use share token to this request: `"sumsub": { "shareToken": "…" }`. Without it,
    beneficiary creation fails with `sumsub_evidence_required`. The evidence attaches to the
    beneficiary — payout requests never carry the token.
  </Step>

  <Step title="Submit an AUD payout">
    Reuse the beneficiary ID and give the payout a new external reference and idempotency key:

    ```bash theme={null}
    curl -X POST https://api.sandbox.rails.wayex.com/v1/treasury/payouts \
      -H "Authorization: Bearer $WAYEX_SECRET_KEY" \
      -H "Idempotency-Key: payout-submit-transfer-aud-001" \
      -H "Content-Type: application/json" \
      -d '{
        "beneficiaryId": "ben_123",
        "amount": "250.00",
        "currency": "AUD",
        "externalReference": "payout-9172",
        "purpose": "Customer withdrawal"
      }'
    ```
  </Step>

  <Step title="Track settlement">
    `accepted` means the full source debit was durably reserved; it is not bank settlement. Subscribe
    to `treasury.payout.updated` and fetch `GET /v1/treasury/payouts/{id}` until the payout settles,
    fails, or returns.
  </Step>
</Steps>

## Direct route: onboard and fund

<Steps>
  <Step title="Create and verify a customer">
    Create a customer with `POST /v1/customers`, issue a hosted verification link, and wait until
    the required entitlement is `approved`.
  </Step>

  <Step title="Create a payment route">
    Create an on-ramp or off-ramp route under the customer. The response provides reusable AUD or
    stablecoin funding instructions.
  </Step>

  <Step title="Fund the route">
    When the customer funds those instructions, Wayex prices at the live rate, creates a transfer,
    converts, and delivers the destination funds. You do not create or accept a direct-route quote.
  </Step>

  <Step title="Track the transfer">
    Subscribe to transfer webhooks and fetch the transfer for its authoritative lifecycle. See
    [Payment routes](/console/payment-routes).
  </Step>
</Steps>

## Before sending funds

<Warning>
  Sandbox never moves real funds — its provider rails are fully simulated. Production does. Before
  your first production funding, confirm the limits and exact asset/network with Wayex in writing.
</Warning>

<CardGroup cols={2}>
  <Card title="Treasury workflows" icon="wallet" href="/treasury/overview">
    Fund, pay, convert, withdraw, track, and reconcile.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/overview">
    Every endpoint explains prerequisites, balance effect, states, and safe retries.
  </Card>

  <Card title="Postman" icon="paper-plane" href="/postman">
    Run the client API collection with tenant-bound environment variables.
  </Card>

  <Card title="Errors" icon="triangle-alert" href="/errors">
    Handle stable error codes and unknown outcomes safely.
  </Card>
</CardGroup>
