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 Request
| Parameter | Type | Description | Required |
|---|---|---|---|
| merchantId | UUID | Merchant identifier | Yes |
| timestamp | Long | UNIX timestamp in milliseconds | Yes |
| betId | UUID | Unique HPGames bet identifier | Yes |
| transactionId | UUID | Unique HPGames transaction identifier | Yes |
| amount | Decimal | Amount to be credited to the player’s wallet | Yes |
| currency | String | Currency code (ISO 4217) | Yes |
| created | DateTime | Bet creation timestamp (ISO 8601 format in UTC timezone (e.g. 2026-03-19T13:42:35.091483Z)) | Yes |
| gameId | Integer | Unique HPGames game identifier | Yes |
| type | String | Defines the type of the transaction [REGULAR, REWARD, JACKPOT] | Yes |
| playerId | String | Merchant’s unique identification for the Player | Yes |
| authToken | String | Game session identifier | Yes |
| hash | String | HMAC SHA256 signature used to verify the request | Yes |
| rewardId | String | Reward identifier assigned to Player | No |
| rewardType | String | Reward type [FREE_BET] | No |
| jackpotId | UUID | Jackpot identifier | No |
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
| Parameter | Type | Description | Required |
|---|---|---|---|
| errorCode | Integer | Error code (default 0, indicates success) | No |
| errorText | String | Error message | No |
| balance | Decimal | Player’s wallet balance | Yes |
| currency | String | Currency code (ISO 4217) | Yes |
| transactionId | UUID | Unique HPGames transaction identifier | Yes (returned in both success and error cases) |
| accountTransactionId | String | Merchant’s internal transaction identifier | Yes |
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
| Parameter | Type | Description | Required |
|---|---|---|---|
| creditRequests | List<CreditRequest> | List of Credit Requests | Yes |
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
| Parameter | Type | Description | Required |
|---|---|---|---|
| creditResponses | List<CreditResponse> | List of Credit Responses | Yes |
Response Example
{
"creditResponses": [
{
"errorCode": 0,
"errorText": "",
"balance": 1000.55,
"currency": "EUR",
"transactionId": "9c8b7a6d-5e4f-3210-a987-6b5c4d3e2f11",
"accountTransactionId": "fbd0d754-6264-474f-9175-22ddc92c4061"
}
]
}