1. Home
  2. Fintech Card Processing (Spec Document)
  3. API Specification
  4. Debit Lien

Debit Lien

e. Debit Lien

This describes the request and response for the debit lien. It will be good to explain that the amount in the debit lien request can be different from the amount that was placed on lien.

This means that there are 3 main cases here;

  1. where the debit lien amount is equal to the amount placed on lien
  2. where the debit lien amount is greater than the amount placed on lien
  3. where the debit lien amount is lesser than the amount placed on lien

Each of these cases are handled differently as explained below;

  1. when the debit lien amount is equal to the amount placed on lien, then the amount is just debited.
  2. when the debit lien amount is greater than the amount that was placed on lien, in this case the customer’s total balance (balance + amount placed on lien) is computed and if this total balance is greater than or equal to the debit lien amount, then the amount is debited and a success response code is returned. But if this total balance is less than the debit lien amount, then an insufficient fund response is returned.
  3. when the debit lien amount is less than the amount that was placed on lien, in this case the debit lien amount is just debited from the placed lien and the remaining lien amount returned to the customer’s balance. A special case to this can be when the debit lien amount is 0, this is also very possible and in fact is how the placed lien is reverted. In the case of a 0 amount, the placed lien is just removed and the place lien amount added back to the customer’s balance.  

Request

POST /lien/debit

Request attributes

AttributeTypeDescriptionRequired
requestIdStringA unique id for every request sent across. Very necessary for the macTrue
walletIdStringThe wallet id of the wallet to debit lien onTrue
amountLongThe actual amount to be debited, in minor. Amount can also be 0, in which case the lien is removed and no value is debited.True
transactionReferenceStringThe reference that can be used to retrieve the transaction. The transaction reference is the same as the transaction reference of the request that places the lien.True
macStringThe hash included in every request that is used to make sure the request is fromthe actual source, and has not been tampered withTrue
transactionDateTimeLocalDateTimeThis is the date and time the transaction occurredFalse
terminalIdStringThis is an identifier for the terminal the transaction came fromTrue
terminalTypeStringA 2 digit string that defines the type of terminal.True
merchantIdStringThe merchant that accepted the cardTrue
acquiringInstitutionIdStringAn id to identify the institution that acquired the transactionFalse
currencyCodeStringA code that identifies the currency the transaction was done onTrue
cardAcceptorNameLocationStringThe name and location of the card acceptorTrue
rrnStringThis is the Retrieval Ref NumberTrue
stanStringThis is the System Trace Audit NumberTrue
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

requestId

walletId

rrn

stan

amount

currencyCode

Response atrributes

AttributeTypeDescriptionRequired
requestIdStringThe request id that came with the request.True
responseCodeStringThe code that signifies the status of the operation.True
amountLongThe amount that came with the request.True
transactionReferenceStringThe reference that came with the requestTrue
macStringThe 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 withTrue
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 debit 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": "1fds5d6f7g8hijokmojih6f5d",
"walletId": "1234567894","amount": 100,
"transactionReference": "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"}

Response

{"amount"100,"responseCode""00","transactionReference""11123456789","requestId""1","mac""hexdigest"}
Invalid mac

Request

{"requestId": "1fds5d6f7g8hijokmojih6f5d",
"walletId": "1234567894","amount": 1000,"transactionReference": "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"}

Response

{"amount"1000,"responseCode""12","transactionReference""11123456789","requestId""1","mac""hexdigest"}
Insufficient funds

Request

{"requestId": "1fds5d6f7g8hijokmojih6f5d","walletId": "1234567894","amount": 1000,"transactionReference": "11123456789",
"mac": "hexdigest","transactionDateTime": "2020-05-15T13:32:9",
"terminalId": "3IWPDVNA","terminalType": "21",
"merchantId": "WEBPAYDIRECTVNA",
"acquiringInstitutionId": "428051043",
"currencyCode": "566",
"cardAcceptorNameLocation": "MATRIX ENERGY LIMITE   LA           LANG","rrn" : "000111000111",
"stan" : "000018"}

Response

{"amount"1000,"responseCode""51","transactionReference""11123456789","requestId""1","mac""hexdigest"}
Was this article helpful to you? Yes No

How can we help?