request_id. Network timeouts, gateway hiccups, or internal PlayStarters retries can cause the same request to arrive at your endpoint more than once. Your implementation must handle this without re-applying the financial movement.
The rule
If you receive a request with arequest_id you have already processed, do not reapply the movement. Return HTTP 200 OK with the player’s current balance.
Recommended implementation
Store processed request_ids
On every successful
BET, WIN, or VOID, persist the request_id together with the resulting balance in a transactions table or cache. Use a unique index/constraint on request_id to prevent duplicates at the database level.Check before applying
Before applying a new transaction, look up the
request_id. If it already exists, skip the movement and return the previously stored balance.