Skip to main content

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 NameDescriptionOptional / MandatoryData type
signRequest signatureMandatorystring

Request parameters

Parameter NameDescriptionOptional / MandatoryData type
methodRollbackMandatorystring
userIdUser identifierMandatorystring
amountAmount of rollback in CentsMandatoryinteger
currencyISO currency codeMandatorystring
transactionIdTransaction IDMandatorystring
referenceTransactionIdidentifier of transaction from getCash requestMandatorystring

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 NameDescriptionOptional / MandatoryData type
balanceCurrent player’s balance in Cents (after the changes, if deposit/withdrawal was successfully completed)Mandatoryinteger
errorCodeError code if the request does not come through successfully, and 0 in any other case.Mandatoryinteger
errorDescriptionError description in case the request has not been successfully processed.Optionalstring

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.