Skip to content

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

NameTypeRequestDescription
walletSessionIdStringQueryStringWallet Session
x-parent-system-idStringHeaderUnique GPAS identifier in the operator system
x-signatureStringHeaderSignature of the message for communication security, it must be in capital letters
externalReferenceStringBodyIdentifies the vendor’s unique transaction
valueDecimalBodyThe value of the user’s bet corresponding to the currency associated with the user’s account
descriptionStringBodyDescription corresponding to the debit of the bet
typeCodeStringBodyRepresents the type of transaction that is being sent (GAME_DEBIT, GAME_CREDIT)
tagsDictionaryBodyThis parameter is used to group transactions, a dictionary with key value is sent, keep in mind that it is dynamic

Response Parameters

NameTypeRequestDescription
statusStringBodyIdentifies the status of the transaction
movementIdStringBodyA unique identifier for the current accounting transaction in Operator Account System
leftBalanceDecimalBodyTotal user balance
amountBonusDecimalBodyAmount of bonus balance that was debited
subWalletsSummaryListBodyIdentify how the user’s balance is made up

Request Example

POST /movements/debit?walletSessionId=3fa85f64-5717-4562-b3fc-2c963f66afa6
HEADER
x-parent-system-id: BL13GT
x-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 externalReference should be stored for potential future rollback operations
  • All debit operations must be idempotent (see Idempotence)