Skip to main content
You’ll need your Stockly API key. Send it as the x-api-key header on every request. Replace https://api.stockly.com below with your Stockly API base URL.

1. Create a user

Provide an email, your own externalId, or both. Stockly provisions a Solana wallet for the user as part of the call.
curl -s -X POST https://api.stockly.com/v1/users \
  -H "content-type: application/json" \
  -H "x-api-key: $STOCKLY_API_KEY" \
  -d '{ "email": "jane@example.com", "externalId": "acme-user-42" }'
The response includes the new user and their wallet (with the solanaAddress). Keep the user.id — you’ll reference it when recording rewards.

2. Give stock

Give a user $1 of Apple. Pick assetSymbol from the catalog (GET /v1/assets) and generate a fresh idempotencyKey per award (a UUID works well).
curl -s -X POST https://api.stockly.com/v1/rewards \
  -H "content-type: application/json" \
  -H "x-api-key: $STOCKLY_API_KEY" \
  -d '{
    "userId": "6f1d2a3b-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
    "idempotencyKey": "order-1001-reward",
    "amountUsd": 1,
    "assetSymbol": "AAPL",
    "source": "cashback"
  }'
The award comes back with status recorded. Stockly then executes the on-chain purchase and delivers the stock to the user’s wallet.

3. Track the award

Poll the award to watch it go from recorded to executed and grab the on-chain transaction:
cURL
curl -s https://api.stockly.com/v1/rewards/b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e \
  -H "x-api-key: $STOCKLY_API_KEY"
Once executed, the award includes status: "executed", a txSignature, and an explorerUrl linking to the swap on a Solana explorer.
That’s it — you created a user, gave them stock, and tracked the award. Open the API Reference tab for every endpoint, field, and an interactive playground.