Skip to main content

3.Payment Confirmation API Details

This API serves as the channel for payment confirmation from NEPALPAY QR engine after successful QR transaction. It is specifically designed for service providers who have integrated NEPALPAY Dynamic QR as their payment instrument. The respective merchant service providers must have exposed the API according to the following specification.

POST URL: {base_url}/nepalpay/confirm-payment

Authorization : Basic Auth

Request Signature Generation:

The signature string is the combination of response parameters in the following format.

Signature String = <merchantBillNo>+”,” +<merchantId>+”,” +<merchantName>+”,” +<paymentRef>+”,” +<channel>+”,” +<payerMobileNumber>+”,” +<sessionNo>
  1. Sign the token string using the digital certificate private key (pfx file/keystore). The digital signature algorithm will be the SHA256 with RSA.
  2. Convert the signed token above in step 2 to base64 encoding.
  3. Pass this signature string to the “signature” field of the request message

Response Token Generation:

The signature string is the combination of response parameters in the following format.

Token String = < txnDate >+”,” +< status >+”,” +< message >+”,” +< mchantBillNo >+”,” +< paymentRef >
  1. Sign the token string using the digital certificate private key (pfx file/keystore). The digital signature algorithm will be the SHA256 with RSA.
  2. Convert the signed token above in step 2 to base64 encoding.
  3. Pass this signature string to the “signature” field of the request message

Request Parameters:

#ParamsTypeLengthPresence Description
1txnDate String MTransaction date. Format (yyyy-MM-dd HH:mm:ss)
2 txnAmount Numeric 12,2MTransaction amount
3 chargeAmtNumeric 12,2MCharge amount
4 merchantId String25 MMerchant code
5storeLabel String25OStore label of QR code
6terminalId String10OTerminal label of QR code
7 merchantName String25 MMerchant name
8rpstxnIdNumeric MTransaction id from Network side
9validationTraceId String20MUnique QR validation Id provided by NCHL during QR generation.It will be used for end to end reporting and reconciliation.
10paymentRefAlpha-Numeric35 MUnique QR validation Id.It will be used for end to end reporting and reconciliation. i.e (‘NQR-TXN ID’)
11merchantBillNo String MBill no./ Unique code or Id enough for transaction reconciliation
12 status String10 MTransaction status (SUCCESS|PENDING|FAILED)
13statusDesc String50 MTransaction status description
14 remarks String100 MRemarks for transaction
15signature String MSHA256 signature token
16channel String10 MIssuer channel e.g. CIPS|MOB|WAL
17 payerMobile String10 MPayer Mobile Number
18 sessionNo Numeric MUnique session id
19extraPaymentParams Map(K,V) MExtra parameters to identify transaction. Params can be in the form of key-value pair

Sample Request

{
"statusDesc": "SUCCESS",
"chargeAmt": 0,
"signature": "axPUj41hD38LeIUzbH2Qq/UQJofo1obu9ZHNEqS7hPAwyV5+/Gco8QTsHJVhnyTce888ZK4xe47bebnD4nlO/f9eKy8quGw32mnyI1cM+MxeQPHoegjptOnbnCnFpoF+TiBu/P9mZpDYqzl2MjzpkJealsgqt24Kt/UexhIgAYc=",
"rpstxnId": "13249559",
"channel": "CIPS",
"terminalId": "Terminal1",
"storeLabel": "Store1",
"sessionNo": "5446",
"issuer": "00001801",
"merchantName": "Quantum Labs",
"merchantBillNo": "NA",
"paymentRef": "2411100000067378ZHU",
"payerMobile": "+977-9843705813",
"extraPaymentParams": {
"address": "NCHL",
"txnCrncy": "NPR",
"customerName": "Bajrang Steels Pvt Ltd"
},
"merchantId": "0010SVQNL9H",
"validationTraceId": "2411100000241841VML",
"instructionId": "CIPS-68109",
"txnDate": "2024-11-10 01:35:31",
"txnAmount": 50,
"remarks": "NEPALPAYQR-512727",
"status": "SUCCESS"

}

Sample Response

{
"txnDate": "2024-11-10 01:35:31",
"status": "SUCCESS",
"message": "TRANSACTION SUCCESSFUL",
"merchantBillNo": "NA",
"paymentRef": "2411100000067378ZHU",
"signature": "Ghxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}