Signatures
Every call carries a hash, in both directions: you sign your launch and close, we sign every wallet callback. One rule covers all of them.
The signing rule
- Take every field except
hash. Leave out a field that is empty or absent. - Sort the fields by name and join them as
name=valuewith&. Use the plain values, before any URL encoding. A number signs as its text. - Append your secret key and take the MD5 of the result (UTF-8), as lowercase hex.
All the field names of this protocol sort the same in ASCII order and in JavaScript’s localeCompare.
Changed in v1.1: providerId is gone from every call. Do not send it and do not expect it. See
Changes from v1.0.
Field order of each call
The order does not change the signature (rule 2 sorts), but it is the order we send.
| Call | Fields, in the order sent |
|---|---|
/markets/start, /sessions/close | any order: you send them as JSON |
/authenticate | token, operatorId, userId, gameId, hash |
/balance | hash, userId |
/bet | hash, userId, token, gameId, roundId, amount, reference, timestamp, roundDetails |
/result | hash, userId, gameId, roundId, amount, reference, timestamp, roundDetails |
/refund | hash, userId, reference, amount, gameId, roundId, timestamp |
/session/expired | hash, sessionId, playerId |
A field we send empty (roundDetails=) is on the wire but not in the signature.
Verifying a call
- Ours to you. URL-decode the form body, recompute the hash over every field you received with your secret key, and compare it with
hashin constant time. Refuse the call when they differ. - Yours to us. We recompute it the same way, against your current key and, during a rotation’s grace, the previous one. A mismatch answers
401 Invalid signature(refusals).
Worked examples
Every example on this guide is signed with the test secret key test-secret-0007. Each one shows the request, then the string the hash is the MD5 of before the key is appended. If your code gets a different hash, your code is wrong.
POST /markets/start
Content-Type: application/json
{
"secureLogin": "demo-operator",
"externalPlayerId": "player-1001",
"currency": "TRY",
"language": "TR",
"lobbyUrl": "https://operator.example/lobby",
"cashierUrl": "https://operator.example/cashier",
"marketId": "btc-above-100k-2026-12-31",
"playMode": "REAL",
"theme": "hera-dark",
"hash": "eb7e53a6861c66db89be02682331ef1a"
}cashierUrl=https://operator.example/cashier¤cy=TRY&externalPlayerId=player-1001&language=TR&lobbyUrl=https://operator.example/lobby&marketId=btc-above-100k-2026-12-31&playMode=REAL&secureLogin=demo-operator&theme=hera-darkPOST /authenticate
Content-Type: application/x-www-form-urlencoded
token=5f2b9c0e7a1d4b3f8e6c2a9d0b7f4e1c&operatorId=3f1c2b7e-8a4d-4e6b-9c1a-2d5e7f0a1b3c&userId=player-1001&gameId=prediction&hash=2bda678a708026b28f2c4d320d49ee2dgameId=prediction&operatorId=3f1c2b7e-8a4d-4e6b-9c1a-2d5e7f0a1b3c&token=5f2b9c0e7a1d4b3f8e6c2a9d0b7f4e1c&userId=player-1001POST /bet
Content-Type: application/x-www-form-urlencoded
hash=682833f2db99bbf90975d9f4273d8c82&userId=player-1001&token=5f2b9c0e7a1d4b3f8e6c2a9d0b7f4e1c&gameId=btc-above-100k-2026-12-31&roundId=btc-above-100k-2026-12-31&amount=12.50&reference=7c9e6679-7425-40de-944b-e07fc1f90ae7×tamp=1793793600000&roundDetails=%7B%22action%22%3A%22BUY%22%2C%22outcomeKey%22%3A%22yes%22%2C%22amount%22%3A%2212.50%22%7Damount=12.50&gameId=btc-above-100k-2026-12-31&reference=7c9e6679-7425-40de-944b-e07fc1f90ae7&roundDetails={"action":"BUY","outcomeKey":"yes","amount":"12.50"}&roundId=btc-above-100k-2026-12-31×tamp=1793793600000&token=5f2b9c0e7a1d4b3f8e6c2a9d0b7f4e1c&userId=player-1001Key rotation
Your operator admin (or we) can rotate your secret key in the backoffice; the new key is shown once. Your calls signed with the previous key are accepted for the grace you choose (24 hours by default, at most 7 days, 0 to stop it at once). Our calls are signed with the new key from the moment of rotation, and every player session opened before it ends with a /session/expired.