Debit
Wallet API
Debit
Debits the specified amount to the player’s balance.
Debit
Documentation Index
Fetch the complete documentation index at: https://docs.game-services.work/llms.txt
Use this file to discover all available pages before exploring further.
POST /debit
This operation is idempotent.
Headers
| Name | Type | Description |
|---|---|---|
| X-Auth-Token | string | Custom authentication header in the format X-Auth-Token: your_token_here. This token is required to authorize API requests. |
Request Parameters
| Name | Type | Description |
|---|---|---|
| playerId | string | Unique identifier of the player. |
| amount | decimal | Amount to debit. |
| gameUuid | string | Unique identifier of the game. |
| sessionId | string | Unique identifier of the player session. |
| promotionExternalId | string | External identifier of the promotion session. This field must be sent for promo or free bet requests and omitted for regular game requests. |
| roundId | string | Unique identifier of the game round. |
| transactionId | string | Unique identifier of the game round transaction. |
| transactionType | string | Type of transaction, e.g., ‘DEBIT_SPIN’. |
| transactionTimestamp | integer | Timestamp of the transaction in milliseconds. |
| roundFinished | boolean | Flag indicating finish of the round. |
| currency | string | Currency code of the player. |
DEBIT_SPIN: A regular spin-based transaction.DEBIT_JACKPOT: A transaction where the player receives a jackpot payout.FREEBET_DEBIT_SPIN: A free bet spin transaction.
Response Parameters
| Name | Type | Description |
|---|---|---|
| balance | decimal | The updated balance of the player. |
Error
If an error occurs while processing a request, the API must return a response with
HTTP Status Code: 400 Bad Request| Name | Type | Description |
|---|---|---|
| error_code | string | Error code describing the specific issue. |
The wallet platform must verify that the incoming playerId and roundId correspond to a previously placed wager. If this validation fails, the debit request must be refused. If
promotionExternalId is present, the wallet platform must validate that it belongs to the active promotion session for the player and use it as the promo wallet context.
If the roundFinished has been marked as true, the platform must close the round, ensuring that no new Credit, Debit or Rollback operations can be performed on it.