Debit
Debit
Operation executed by GPAS when the player performs a game action corresponding to a bet. This should decrement the user’s balance in the wallet accordingly, and return an up-to-date balance. If the user’s balance is insufficient, an error response should be returned instead.
Endpoint Details
- Method: POST
- URL:
/movements/debit
Request Parameters
| Name | Type | Request | Description |
|---|---|---|---|
| walletSessionId | String | QueryString | Wallet Session |
| x-parent-system-id | String | Header | Unique GPAS identifier in the operator system |
| x-signature | String | Header | Signature of the message for communication security, it must be in capital letters |
| externalReference | String | Body | Identifies the vendor’s unique transaction |
| value | Decimal | Body | The value of the user’s bet corresponding to the currency associated with the user’s account |
| description | String | Body | Description corresponding to the debit of the bet |
| typeCode | String | Body | Represents the type of transaction that is being sent (GAME_DEBIT, GAME_CREDIT) |
| tags | Dictionary | Body | This parameter is used to group transactions, a dictionary with key value is sent, keep in mind that it is dynamic |
Response Parameters
| Name | Type | Request | Description |
|---|---|---|---|
| status | String | Body | Identifies the status of the transaction |
| movementId | String | Body | A unique identifier for the current accounting transaction in Operator Account System |
| leftBalance | Decimal | Body | Total user balance |
| amountBonus | Decimal | Body | Amount of bonus balance that was debited |
| subWalletsSummary | List | Body | Identify how the user’s balance is made up |
Request Example
POST /movements/debit?walletSessionId=3fa85f64-5717-4562-b3fc-2c963f66afa6HEADERx-parent-system-id: BL13GTx-signature: SHA1(body + secret key)Example Signature
- Body: It is reported below
- SecretKey:
Ax34deSfgdB - SHA1: Encryption Function
- SHA1(
{"externalReference":"agt-b7219c1d2d5e1bd40a508ef19a672d06","value":"100","description":"Debit game move for customer id 6df5sd made by gpas","typeCode":"GAME_DEBIT","tags":{"gpasSessionId":"gpas-bfd9516b-c51f-4bd5-ab83-8899100dc636","gameid":"agt-13"}}Ax34deSfgdB) - Signature:
963510BBB54BFB7916BF7D5937539A8AB5E3A633
Request Body
{ "externalReference": "agt-b7219c1d2d5e1bd40a508ef19a672d06", "value": 100, "description": "Debit game move for customer id 6df5sd made by gpas", "typeCode": "GAME_DEBIT", "tags": { "gpasSessionId": "gpas-bfd9516b-c51f-4bd5-ab83-8899100dc636", "gameid": "agt-13", "roundid": "agt-311502", "closeRound": "false" }}Response Example
{ "status": "CONFIRMED", "movementId": "53rr34pq-flll-5rbe-q975-3824lx339855", "leftBalance": 9050, "amountBonus": 100, "subWalletsSummary": [ { "code": "REAL", "leftBalance": 9000, "subWalletsSummary": null }, { "code": "BONUS", "leftBalance": 50, "subWalletsSummary": null } ]}Implementation Notes
- This method should check if the player has sufficient balance before processing the debit
- If the balance is insufficient, an error response should be returned (see Error Response)
- The response should include the updated balance after the debit operation
- The
externalReferenceshould be stored for potential future rollback operations - All debit operations must be idempotent (see Idempotence)