Skip to main content

Credit

/credit

The Credit API enables the HPGames platform to deposit funds to the player’s wallet via the Merchant system. This transaction is performed when a bet reaches its final state (win or lose). If the Player loses the bet, the credit request will be sent with an amount of 0.

The sequence diagram below illustrates the communication flow between HPGames and the Merchant for debit and credit operations.

Credit


Credit Request

ParameterTypeDescriptionRequired
merchantIdUUIDMerchant identifierYes
timestampLongUNIX timestamp in millisecondsYes
betIdUUIDUnique HPGames bet identifierYes
transactionIdUUIDUnique HPGames transaction identifierYes
amountDecimalAmount to be credited to the player’s walletYes
currencyStringCurrency code (ISO 4217)Yes
createdDateTimeBet creation timestamp (ISO 8601 format in UTC timezone (e.g. 2026-03-19T13:42:35.091483Z))Yes
gameIdIntegerUnique HPGames game identifierYes
typeStringDefines the type of the transaction [REGULAR, REWARD, JACKPOT]Yes
playerIdStringMerchant’s unique identification for the PlayerYes
authTokenStringGame session identifierYes
hashStringHMAC SHA256 signature used to verify the requestYes
rewardIdStringReward identifier assigned to PlayerNo
rewardTypeStringReward type [FREE_BET]No
jackpotIdUUIDJackpot identifierNo

Hash Fields

The hash is calculated by concatenating the following fields in the exact order:

  • merchantId
  • betId
  • amount
  • transactionId
  • timestamp

For details on how the hash is generated, see Hash Algorithm.

Request Example

{
"merchantId": "1387a6cc-3651-4473-ae52-e415caea3395",
"timestamp": 1773935126789,
"betId": "3f9c2d1a-8b7e-4c5d-a123-6f9e2b7d8c11",
"transactionId": "9c8b7a6d-5e4f-3210-a987-6b5c4d3e2f11",
"amount": 5.0,
"currency": "EUR",
"created": "2026-03-19T15:46:10.654321Z",
"gameId": 1,
"type": "REWARD",
"rewardId": "a9f1c2d3-4b5e-6789-8abc-def012345678",
"rewardType": "FREE_BET",
"authToken": "5f6e7d8c-9b0a-4c3d-8e1f-2a3b4c5d6e7f",
"playerId": "c8d9e0f1-2345-4a6b-8c9d-0e1f2a3b4c5d",
"hash": "7b1c3d5e9f2a4c6e8d0b1a3f5c7e9d2b4a6c8e0f1d3b5a7c9e2f4d6b8a0c1e3f"
}

Credit Response

ParameterTypeDescriptionRequired
errorCodeIntegerError code (default 0, indicates success)No
errorTextStringError messageNo
balanceDecimalPlayer’s wallet balanceYes
currencyStringCurrency code (ISO 4217)Yes
transactionIdUUIDUnique HPGames transaction identifierYes (returned in both success and error cases)
accountTransactionIdStringMerchant’s internal transaction identifierYes

Response Example

{
"errorCode": 0,
"errorText": "",
"balance": 1000.55,
"currency": "EUR",
"transactionId": "9c8b7a6d-5e4f-3210-a987-6b5c4d3e2f11",
"accountTransactionId": "fbd0d754-6264-474f-9175-22ddc92c4061"
}

Bulk Credit

/bulkCredit

Each credit request within the bulk request must be signed individually.

Hash is calculated individually for each request object.


Bulk Credit Request

ParameterTypeDescriptionRequired
creditRequestsList<CreditRequest>List of Credit RequestsYes

Request Example

{
"creditRequests": [
{
"merchantId": "1387a6cc-3651-4473-ae52-e415caea3395",
"timestamp": 1773935126789,
"betId": "3f9c2d1a-8b7e-4c5d-a123-6f9e2b7d8c11",
"transactionId": "9c8b7a6d-5e4f-3210-a987-6b5c4d3e2f11",
"amount": 5.0,
"currency": "EUR",
"created": "2026-03-19T15:46:10.654321Z",
"gameId": 1,
"type": "REWARD",
"rewardId": "a9f1c2d3-4b5e-6789-8abc-def012345678",
"rewardType": "FREE_BET",
"authToken": "5f6e7d8c-9b0a-4c3d-8e1f-2a3b4c5d6e7f",
"playerId": "c8d9e0f1-2345-4a6b-8c9d-0e1f2a3b4c5d",
"hash": "7b1c3d5e9f2a4c6e8d0b1a3f5c7e9d2b4a6c8e0f1d3b5a7c9e2f4d6b8a0c1e3f"
}
]
}

Bulk Credit Response

ParameterTypeDescriptionRequired
creditResponsesList<CreditResponse>List of Credit ResponsesYes

Response Example

{
"creditResponses": [
{
"errorCode": 0,
"errorText": "",
"balance": 1000.55,
"currency": "EUR",
"transactionId": "9c8b7a6d-5e4f-3210-a987-6b5c4d3e2f11",
"accountTransactionId": "fbd0d754-6264-474f-9175-22ddc92c4061"
}
]
}