Skip to content
KOI Games Developer

Wallet callbacks

Bonus win

When a free-bet bonus ends, KOI calls your rewards endpoint once with the total win of its rounds. This is the only callback a bonus produces: its rounds never send bet or win callbacks.

http
POST <your rewards URL>
Content-Type: application/json
X-Koi-Signature: <signature>

The endpoint is the same as for Win. Tell them apart by action.

Payload

FieldTypeDescription
actionstringAlways bonus_win.
provider_tx_idnumberKOI transaction ID of this payment. One per bonus. Use it as your idempotency key.
bonus_codestring | nullThe bonus_code of the grant. null only for bonuses created by KOI promotions.
user_idstringYour player ID.
amountnumberTotal win of the bonus rounds, stake included. Can be 0.
currencystringCurrency of the rounds.
gamestringGame slug.
round_idstringround_id of the last round played.
rounds_playednumberRounds played in this bonus.
rounds_remainingnumberRounds left unplayed when the bonus ended (expired or cancelled). 0 when all were played.
modestringAlways free.
session_tokenstringKOI session token of the last round. The session may have expired.
extra_datastring | nullThe extra_data from request-access.
providerstringAlways koi.
aggregatorstringYour KOI account ID.

There is no linked_tx_id: a bonus win does not pay any bet you processed.

json
{
  "action": "bonus_win",
  "provider_tx_id": 208114,
  "bonus_code": "WELCOME-10",
  "user_id": "player-123",
  "amount": 12.5,
  "currency": "BRL",
  "game": "aviator-wars",
  "round_id": "0b6f1e7a-3c55-4f0e-9d0c-6a3f2b1c9e44",
  "rounds_played": 10,
  "rounds_remaining": 0,
  "mode": "free",
  "session_token": "b3e1f6d2c9a84f0e",
  "extra_data": "brand=acme;device=mobile",
  "provider": "koi",
  "aggregator": "7"
}

What to do

  1. Verify X-Koi-Signature.
  2. If you already processed this provider_tx_id, return the original result.
  3. Credit amount, even if amount is 0 and even if the session has expired. Apply your own bonus rules (for example wagering requirements) to the credited amount.
  4. Answer 200 with old_balance, new_balance and operator_tx_id.

Timeout and retries

KOI waits up to 80 seconds and retries exactly like a Win: once immediately on a technical failure, then through reconciliation with the same body and signature. If it still cannot be delivered, the payment stays pending and KOI support follows up with you. See Idempotency & retries.