Quickstart

Make your first authenticated call in five minutes.

1. Get a sandbox key

Create a test secret key (sk_test_…) in your dashboard. Test keys only work on the sandbox; live keys (sk_live_…) only work in production.

2. Authenticate

Every request carries your secret key as a bearer token:

curl https://api-sandbox.starpay.example/api/v1/ping \
  -H "Authorization: Bearer sk_test_your_key"

Successful responses use the standard envelope:

{ "status": true, "message": "pong", "data": { "pong": true, "livemode": false } }

Errors use the same envelope with status: false and a stable error.code — see the Errors reference.

3. Get your first quote

The flagship flow is quote → execute a stablecoin trade. First, make sure your merchant is approved on the sandbox ladder (see Authentication → Service access), then price a buy:

curl -X POST https://api-sandbox.starpay.example/api/v1/trades/quote \
  -H "Authorization: Bearer sk_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "side": "buy", "asset": "USDT", "network": "TRC20", "fiat_amount": 250000 }'

Amounts are integer minor units (pesewas) — 250000 means GHS 2,500.00. The response carries a reference and an expires_at (default 45s). Execute it with POST /api/v1/trades (that call additionally needs an HMAC signature and an Idempotency-Key) before it expires. See Trading for the full flow.

Next steps