Rollback transaction request
A request to rollback the transaction is executed when:
- there was an error of crediting funds to our system
- there was an unrecognizable error from an external system in response to getCash query
Rollback transactions in the Seamless wallet are enabled by default.
Request header (HTTP Header)
Parameter Name | Description | Optional / Mandatory | Data type |
---|---|---|---|
sign | Request signature | Mandatory | string |
Request parameters
Parameter Name | Description | Optional / Mandatory | Data type |
---|---|---|---|
method | Rollback | Mandatory | string |
userId | User identifier | Mandatory | string |
amount | Amount of rollback in Cents | Mandatory | integer |
currency | ISO currency code | Mandatory | string |
transactionId | Transaction ID | Mandatory | string |
referenceTransactionId | identifier of transaction from getCash request | Mandatory | string |
Request validation
Upon receipt it is required to validate the request according to the following rules:
- Request parameters, marked as Mandatory, must be passed in the request. If not, then the error "Invalid request params" is returned.
- sign. Request signature should correspond to the parameters passed. If not, then the error "Invalid signature" must be returned.
- userId must exist. If a player does not exist, then the error "Player not found" must be returned.
- currency should have a valid ISO-code used in your system. If not, then the error "Invalid request params" must be returned.
- amount must always be a positive integer. If not, then the error "Invalid request params" must be returned.
- if a transaction with passed transactionId has already been handled on your side, then it is required to return errorCode = 0 with the comment "Transaction already processed". You should not process the transaction for the second time.
- if reference transaction does not exist, then the error "Reference transaction does not exist" must be returned.
- if amount, currency of userId of reference transaction are different from the data of rollback transaction, then the error "Reference transaction has incompatible data" must be returned.
If the error "Transaction already processed" occurs, it is required to return all parameters. If other errors occur, you should only return the parameters errorCode and errorDescription.
Response parameters
A response to request is expected to be made in JSON format. Response Parameters:
Parameter Name | Description | Optional / Mandatory | Data type |
---|---|---|---|
balance | Current player’s balance in Cents (after the changes, if deposit/withdrawal was successfully completed) | Mandatory | integer |
errorCode | Error code if the request does not come through successfully, and 0 in any other case. | Mandatory | integer |
errorDescription | Error description in case the request has not been successfully processed. | Optional | string |
Request example
{
"method": "Rollback",
"userId": 123456,
"amount": 15000,
"currency":"USD",
"transactionId":"123456788",
"referenceTransactionId": "123456787",
}
Response example
{
"balance": 12300,
"errorCode": 0,
"errorDescription":"",
}
Resending the request
The request is not resent in any situation.