onari

Quickstart

Send your first event, win a sandbox reward, and open the Rewards Hub. About 10 minutes.

View as Markdown

Everything here happens in sandbox: no real players, no real money, nothing your customers can see.

Get a sandbox key

In the dashboard, switch to Sandbox (top right), then go to Developers → API keys → New key. Copy the key (sk_test_…); it's shown once. Keep it on your server only.

export ONARI_KEY=sk_test_...

Check your events list

Go to Developers → Events. Your workspace starts with the usual events for your industry (for example order.placed, transfer.completed or airtime.recharged). Add your own if something's missing. Onari only accepts event types on this list, which catches typos early.

Launch a sandbox challenge

Go to Campaigns → New campaign. Pick a challenge such as "do order.placed 2 times", choose a reward (cashback is the simplest to test), set a small budget, and launch it.

Send events

curl https://api.onari.xyz/v1/events \
  -H "Authorization: Bearer $ONARI_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "order.placed", "player_id": "test_player_1", "amount": 1250000 }'

The response shows the player's progress. Send it a second time and the response includes the reward:

{
  "event_id": 1042,
  "player_id": "test_player_1",
  "campaigns": [{ "campaign_id": "6f1c…", "progress": 2, "goal": 2 }],
  "rewards": [{ "id": "a91e…", "campaign": "Weekend challenge", "reason": "challenge", "kind": "cashback", "value": 50000, "currency": "NGN", "status": "issued" }]
}

Receive the webhook

In Developers → Webhooks, add a URL (a request-bin site works for a first look) and click Send a test. Win again with another player ID and you'll see reward.issued arrive. See Webhooks to handle it properly.

Open the Rewards Hub

curl https://api.onari.xyz/v1/hub/sessions \
  -H "Authorization: Bearer $ONARI_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "player_id": "test_player_1" }'

Open the url from the response in a browser: that's what your customer sees inside your app. Or use Rewards Hub → Try your Hub in the dashboard.

Going live

Create a live key (sk_live_…), set a live webhook URL, and launch your campaign in live. Sandbox and live share nothing: players, campaigns, keys and webhooks are separate.

On this page