Request
POST /reversal |
Request atrributes
Attribute | Type | Description | Required |
---|---|---|---|
requestId | String | A unique id for every request sent across. Very necessary for the mac | True |
walletId | String | The wallet id of the wallet to reverse an amount on | True |
amount | Long | The amount to be reversed (in minor) | True |
transactionReference | String | The transaction reference of this transaction | True |
originalTransactionReference | String | The transaction reference of the transaction to reverse | True |
mac | String | The hash included in every request that is used to make sure the request is fromthe actual source it should be and has not been tampered with | True |
transactionDateTime | LocalDateTime | This is the date and time the transaction occurred | False |
terminalId | String | This is an identifier for the terminal the transaction came from | False |
terminalType | String | A 2 digit string that defines the type of terminal. | False |
merchantId | String | The merchant that accepted the card | False |
acquiringInstitutionId | String | An id to identify the institution that acquired the transaction | False |
currencyCode | String | A code that identifies the currency the transaction was done on | True |
cardAcceptorNameLocation | String | The name and location of the card acceptor | True |
rrn | String | This is the Retrieval Ref Number | True |
stan | String | This is the System Trace Audit Number | True |
transactionFee | Long | The transaction fee in minor | True |
additionalFields | Map | Any other Iso field needed by a fintech | False |
Request Mac
The request mac is generated by concatenating the following attributes in the order which they occur, generate a HMAC using the shared private key and get the hex string of the result. More details about the MAC in section 1.0
transactionReference
originalTransactionReference
requestId
walletId
amount
currencyCode
stan
rrn
transactionFee
Response atrributes
Attribute | Type | Description | Required |
---|---|---|---|
requestId | String | The request id that came with the request. | True |
responseCode | String | The code that signifies the status of the operation. | True |
amount | Long | The amount that came with the request. | True |
transactionReference | String | The reference that came with the request | True |
originalTransactionReference | String | The original transaction reference that came with the request | True |
mac | String | The hash included in every response that is used to make sure the request is fromthe actual source it should be and has not been tampered with | True |
Response Mac
The response mac is generated by concatenating the following attributes in the order which they occur, generate a HMAC using the shared private key and get the hex string of the result. More details about the MAC in section 1.0
transactionReference
requestId
responseCode
Sample requests
The sample requests for the reversal only covers for 3 scenarios. It should be noted that the difference with a response from the other is just the response code. The response code table in section 4.0 can be used to know the response code that can be used for other scenarios that might not be covered in the sample requests.
Successful
Request
{"requestId": "1", "walletId": "1234567894", "amount": 100, "transactionReference": "11123456789", "originalTransactionReference": "11123456789", "mac": "hexdigest", "transactionDateTime": "2020-05-15T13:32:09", "terminalId": "3IWPDVNA", "terminalType": "21", "merchantId": "WEBPAYDIRECTVNA", "acquiringInstitutionId": "428051043", "currencyCode": "566", "cardAcceptorNameLocation": "MATRIX ENERGY LIMITE LA LANG", "rrn" : "000111000111", "stan" : "000018", "additionalFields={"processingCode":"000000","merchantType":"8850"}} |
Response
{"amount": 100, "responseCode": "00", "transactionReference": "11123456789", "originalTransactionReference": "11123456789", "requestId": "1", "mac": "hexdigest"} |
Invalid mac
Request
{"requestId": "1", "walletId": "1234567894", "amount": 1000, "transactionReference": "11123456789", "originalTransactionReference": "11123456789", "mac": "hexdigest", "transactionDateTime": "2020-05-15T13:32:09", "terminalId": "3IWPDVNA", "terminalType": "21", "merchantId": "WEBPAYDIRECTVNA", "acquiringInstitutionId": "428051043", "currencyCode": "566", "cardAcceptorNameLocation": "MATRIX ENERGY LIMITE LA LANG", "rrn" : "000111000111", "stan" : "000018", "additionalFields={"processingCode":"000000","merchantType":"8850"}} |
Response
{"amount": 1000, "responseCode": "12", "transactionReference": "11123456789", "originalTransactionReference": "11123456789", "requestId": "1", "mac": "hexdigest"} |
Original transaction not found
Request
{"requestId": "1", "walletId": "1234567894", "amount": 1000, "transactionReference": "11123456789", "originalTransactionReference": "11123456700", "mac": "hexdigest", "transactionDateTime": "2020-05-15T13:32:09", "terminalId": "3IWPDVNA", "terminalType": "21", "merchantId": "WEBPAYDIRECTVNA", "acquiringInstitutionId": "428051043", "currencyCode": "566", "cardAcceptorNameLocation": "MATRIX ENERGY LIMITE LA LANG", "rrn" : "000111000111", "stan" : "000018", "additionalFields={"processingCode":"000000","merchantType":"8850"}} |
Response
{"amount": 1000, "responseCode": "05", "transactionReference": "11123456789", "originalTransactionReference": "11123456700", "requestId": "1", "mac": "hexdigest"} |