---
title: "Make your first payout"
description: "Add test money, add a recipient, get a quote and send a payout in the sandbox."
---

<Info>
  The steps below use the sandbox. Sandbox access comes with the Enterprise plan.
</Info>

Keys → test money → recipient → quote → payout → webhook. All calls below go to the sandbox.

<Steps>
  <Step title="Get a token">
    Create a sandbox API key in **Developers → API keys**, then:

    ```bash
    curl -X POST https://api.sandbox.storspay.com/v1/oauth/token \
      -u "$STORSPAY_CLIENT_ID:$STORSPAY_CLIENT_SECRET" \
      -d grant_type=client_credentials
    ```

    Keep the `accessToken` and send it as `Authorization: Bearer <accessToken>`. See [Authentication](/get-started/authentication).
  </Step>
  <Step title="Add test money">
    ```bash
    curl -X POST https://api.sandbox.storspay.com/v1/sandbox/deposits \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{ "amount": "500.00", "currency": "USD" }'
    ```

    Amounts are always strings. See [Money and amounts](/concepts/money-and-amounts).
  </Step>
  <Step title="Add a recipient (beneficiary)">
    Find the bank code with `GET /v1/banks?country=NGA`, and the exact fields with `GET /v1/payouts/requirements?country=NGA&currency=NGN&route=bank`. The account number `9900000000` ends in `00`, so the sandbox pays it.

    ```bash
    curl -X POST https://api.sandbox.storspay.com/v1/beneficiaries \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "individual",
        "name": "Test Recipient",
        "country": "NGA",
        "currency": "NGN",
        "route": "bank",
        "bankCode": "<bankCode from GET /v1/banks>",
        "accountNumber": "9900000000"
      }'
    ```

    The same details sent twice return the existing beneficiary (`200`, `deduplicated: true`).
  </Step>
  <Step title="Get a quote">
    ```bash
    curl -X POST https://api.sandbox.storspay.com/v1/quotes \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "intent": "payout",
        "sourceCurrency": "USD",
        "destinationCurrency": "NGN",
        "amount": "100.00",
        "amountType": "send",
        "country": "NGA",
        "route": "bank",
        "beneficiaryId": "ben_…"
      }'
    ```

    The quote holds the amounts, the rate, our fee, any platform fee, the total and `expiresAt`. A payout quote lasts 5 minutes and is used once. You never send a rate or a fee.
  </Step>
  <Step title="Send the payout">
    ```bash
    curl -X POST https://api.sandbox.storspay.com/v1/payouts \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{ "quoteId": "qt_…", "beneficiaryId": "ben_…", "clientRef": "payout-0001" }'
    ```

    ```json
    { "id": "po_8F2K1M3QZ", "clientRef": "payout-0001", "status": "created", "cancellable": true, "legs": 1 }
    ```

    `clientRef` is your own unique reference. On a timeout or a 5xx, retry with the same `clientRef`: you will never pay twice. See [Idempotency](/concepts/idempotency).
  </Step>
  <Step title="Follow the status">
    `GET /v1/payouts/{id}`, or receive `payout.created`, `payout.processing` and `payout.paid` on your webhook endpoint. See [Webhooks](/get-started/webhooks) and [Payout statuses](/concepts/payout-statuses).
  </Step>
</Steps>

## Try a failure

Change the last two digits of the account number: `9900000001` fails with `technical_error`, `9900000002` fails with `recipient_details`, `9900000005` waits 60 s in `created` so you can cancel it. All values: [Sandbox and magic values](/get-started/sandbox).
