Inquiry

How to Inquire about a Payment?

To Inquire a transaction you have to send the paymentType as IN.

The paymentID or merchantTransactionIdhas to be send with a POST request over HTTPS to the /transactionServices/REST/v1/inquiry endpoint.

The merchant can retrieve detailed information of previously placed transactions through the Inquiry/ Status request.



Request specification.

Parameter Description Format Required
authentication.memberId Unique merchant member ID provided by TWPayz. N10
[0-9]{1,10}
Yes
authentication.checksum MD5 checksum generated using merchant credentials for request authentication. AN32
[a-fA-F0-9]{32}
Yes
paymentType Request to inquire the detail information of the previously placed transaction. A2
((IN))
Yes
idType Unique transaction reference generated by the merchant. AN1024
[a-zA-Z0-9\\p{Space}\\-_.]{1,1024}
Yes
merchantTransactionId This reference number is provided by the merchant, should be unique for the transactions and is visible on the end customer’s statement. AN100
[.\\p[0-9a-zA-Z\\p{Space}\\-]{0,100}
Yes

Response specification.

Parameter Description Format Required
paymentId Unique payment identifier generated by TWPayz. N10
[0-9]
Yes
paymentBrand Payment brand used for the transaction. A50
[A-Za-z]
Yes
paymentMode It specifies the mode of payment for the request A10
[a-zA-Z0-9] {1,10}
Yes
amount Transaction request amount. Decimal format needs to be followed. N13
[0-9]{1,10}\.[0-9]{2}
Yes
descriptor Transaction descriptor displayed for the payment. AN127
[a-zA-Z0-9\\p{Space}\\,]+[a-zA-Z0-9\\p{Space}\\,]+
Yes
result.code Response code indicating the transaction status. AN11
[0-9\.]{2,11}
Yes
result.description Description corresponding to the response code. AN255
[a-zA-Z0-9\\p{Space}\\,]+[a-zA-Z0-9\\p{Space}\\,]+
Yes
card.bin First six digits (BIN) of the payment card. N6
[0-9]{6}
Yes
card.last4Digits Last four digits of the payment card. N4
[0-9]{4}
Yes
card.holder Name of the customer on card. AN255
[a-zA-Z0-9]
Yes
card.expiryMonth Expiry month on card.. N2
[0-9]
Yes
card.expiryYear Expiry year on card. N4
[0-9]
Yes
timestamp Shows at what time the transaction has been placed. date
yyyy-MM-dd hh:mm:ss
Yes
transactionStatus Status of the transaction processed. Possible values are,
‘Y’ – Successfully processed
‘N’ – Failed
‘P’ – Pending
‘3D’ – Pending for 3D authentication
‘C’ – Cancelled
A2
[Y|N|P|3D|C]
Yes
merchantTransactionId Unique ID sent at the time of transaction. AN100
[.\\p[0-9a-zA-Z\\p{Space}\\-]{0,100}
Yes
remark Transaction remark from respective gateway. AN255
[a-zA-Z0-9]
Yes
currency Currency of the transaction. A3
[a-zA-Z\\p{Space}\\,]+
Yes
tmpl_currency Currency of the customized amount to facilitate customer, template currency can be same as transaction currency, Accept only 3 character currency code in capital letters. A3
[A-Z]{3}
No
tmpl_amount Customized amount of customer, template amount can be same as transaction amount. N13
[0-9]{1,10}\\.[0-9]{2}
No
firstName First name of the customer. AN
[a-zA-Z0-9\\p{Space}\\,.:'"-=+)({}[]]+
No
lastname Last name or surname of the customer. AN
[a-zA-Z0-9\\p{Space}\\,.:'"-=+)({}[]]+
No
orderDescription Description of the order or transaction. AN255
[a-zA-Z0-9\\p{Space}\\,.:'&()/_-]{1,255}
No
companyName Name of the merchant company A255
[A-Za-z0-9]
No
merchantContact Name of the Merchant's main contact person A255
[A-Za-z0-9]
No

Sample Request


Sample Response


Hashing Rule

TWPayz is supporting MD5 Cryptographic Hash for the authenticity of payment request send to the server.


Below are the description of fields used for generating checksum:
  • memberId <Merchant ID as shared by TWPayz>
  • secureKey <Secure Key that can be generated through TWPayz's dashboard>
  • paymentId <Id of previous transaction>

How to generate Checksum?

Checksum has to be calculated with following combination & needs to be send along with the authentication parameters in each server-to-server request:

Inquiry:
<memberId>|<secureKey>|<paymentId>


Sample Code