Skip to content

Credit

Credit

Operation executed by the GPAS when the player is awarded a prize during the game. This should increment the user’s balance in the wallet accordingly, and return an up-to-date balance.

Endpoint Details

  • Method: POST
  • URL: /movements/credit

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 win corresponding to the currency associated with the user’s account
descriptionStringBodyDescription corresponding to the credit of the win
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 credited
subWalletsSummaryListBodyIdentify how the user’s balance is made up

Request Example

POST /movements/credit?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-n1572n6e5e5w2mw13l867azo4b381t27","value":"200","description":"Credit game move for customer id 6df5sd made by gpas","typeCode":"GAME_CREDIT","tags":{"gpasSessionId":"gpas-bfd9516b-c51f-4bd5-ab83-8899100dc636","gameid":"agt-13"}}Ax34deSfgdB)
  • Signature: ADC0C7E5A925645EED839485C12F0DFDFEEA257F

Request Body

{
"externalReference": "agt-n1572n6e5e5w2mw13l867azo4b381t27",
"value": 200,
"description": "Credit game move for customer id 6df5sd made by gpas",
"typeCode": "GAME_CREDIT",
"tags": {
"gpasSessionId": "gpas-bfd9516b-c51f-4bd5-ab83-8899100dc636",
"gameid": "agt-13",
"roundid": "agt-311502",
"closeRound": "true",
"externalReferenceBet": "agt-53rr34pq-flll-5rbe-q975-3824lx339855"
}
}

Response Example

{
"status": "CONFIRMED",
"movementId": "28rr37mq-fl47-2rrt-q614-81249a258311",
"leftBalance": 9250,
"amountBonus": 50,
"subWalletsSummary": [
{
"code": "REAL",
"leftBalance": 9150,
"subWalletsSummary": null
},
{
"code": "BONUS",
"leftBalance": 100,
"subWalletsSummary": null
}
]
}

Implementation Notes

  • This method should increment the player’s balance by the specified amount
  • The response should include the updated balance after the credit operation
  • The externalReference should be stored for potential future rollback operations
  • The externalReferenceBet tag can be used to associate this credit with a previous debit operation
  • All credit operations must be idempotent (see Idempotence)
  • The closeRound tag indicates whether this credit operation closes the current game round