Skip to main content

2. API For Bulk Merchant Upload

2.1. API To Register Merchant On NEPALPAYQR

The "Merchant Bulk Upload on QR" feature helps to streamline and simplify the process of onboarding multiple merchants or businesses into NEPALPAYQR while seamlessly assigning them unique QR codes for identification and payment acceptance.

Post: /api/merchant/bulk-upload

Request parameters:

#Data ItemsTypeLengthRequired Remarks
1fullname String25M Merchant Common Name
2legalName StringM Full Name of the Merchant
3merchantCategoryCode String4M Merchant Category Code (MCC)
4district StringM Merchant Address
5 provinceStringM Merchant Address
6 registrationTypeStringM Registration type of merchant - sole-proprietorship - partnership - public - private
7idDocNumberString MMerchant PAN number.
8ownerNameString CRequired depends on registration type Required for - sole-proprietorship - private partnership
9 genderenum CRequired depends on registration type Required for - sole-proprietorship - private - partnership Values: - MALE - FEMALE
10firstname String MMerchant Owner Registered Name
11middlename String O Merchant Owner Registered Name
12lastname String MMerchant Owner Registered Name
13 mobileNumberString MMerchant Owner Mobile Number
14 email String MMerchant Owner Email Address
15accountNumber String MMerchant Account Number
16accountName String MMerchant Account Name
17bankCode String 4MMerchant Bank Code
18currency String 3MCurrency symbol (e.g. NPR)
19 userString MNPI User ID
20 identificationCodeString MAcquirer Code
21 subIdentificationCodeString MWAL in case of wallet

Sample Request

{
"merchantDetailBulk":[
{
"merchantDetailDto":{
"fullname":"Nepal Farm House",
"legalName":"Nepal Farm House Limited",
"idDocNumber":"505693548",
"registrationType":"private",
"merchantCategoryCode":"5021",
"district":"Kathmandu",
"province":"3",
"merchantOwnerDetailsDto":{
"ownerName":"Ramesh Malla",
"gender":"MALE"
}
},
"userDetailDtos":[
{
"firstname":"Saurav",
"middlename":"",
"lastname":"Khatri",
"mobileNumber":"98XXXXXXX",
"email":"test1@gmail.com.np"
}
],
"accountDetailDtos":[
{
"accountNumber":"XXXXXXXXXXXXXX",
"accountName":"Pankaj Singh",
"bankCode":"1121",
"branchCode":"2",
"currency":"NPR"
}
]
},
{
"merchantDetailDto":{
"fullname":"Nepal Wood House",
"legalName":"Nepal Wood House Limited",
"idDocNumber":"51616161",
"registrationType":"private",
"merchantCategoryCode":"5021",
"district":"Kathmandu",
"province":"3",
"merchantOwnerDetailsDto":{
"ownerName":"Hira Shrestha",
"gender":"FEMALE"
}
},
"userDetailDtos":[
{
"firstname":"Rjish ",
"middlename":"",
"lastname":"Singh",
"mobileNumber":"98XXXXXXX",
"email":"test1@gmail.com.np"
}
],
"accountDetailDtos":[
{
"accountNumber":"XXXXXXXXXXXXXX",
"accountName":"Rashmi Paula",
"bankCode":"0521",
"branchCode":"2",
"currency":"NPR"
}
]
}
],
"requestUserDetailDto":{
"user":"TEST@",
"identificationCode":"00021000",
"subIdentificationCode":"WAL"
},
"token":"HmKKt047G+Wflk9a2jLBV3F7ecAgE4lJqRQGqQYBOJu+wVcjI/hdYHQTJ4h1ES4/Up7a9/ng5U7ca/4Y1pSulx0FaSxhczbnFjsbTILPP7/GmgtxtdPiWIswsmnBXM0EAYnJZhAtFXUWmSALPctjCnBWoUdAZ80OUx3IYEQ2QEM="
}

Token Generation Process:

Token string generation

The token string is created by appending the merchant and user detail fields. Following will be the procedure for token string generation: For each Merchant Detail data section, follow format, including the enclosed curly bracers:

<idDocNumber>:<idDocNumber>,<merchantCategoryCode><mobileNumber>, <email>,<accountNumber>,<currency>,<bankCode>

For NPI User Detail data section, follow format, including the enclosed curly bracers:

requestUserDetailDto:<identificationCode>, <user>

For the finalized session token, follow format:

Token String = <MerchantDetailSection-1>,....,<MerchantDetailSection-N>,<UserDetailSection>
  1. Generate signed hash value of token string using private key of provided certificate.
  2. Send the generate hash value in “token” field.

Sample Token String:

{"505693548":"505693548,5021,9843705813,sauravkhatri@nchl.com.np,0100200000009020,NPR,0301","r
equestUserDetailDto":"00021000,WAL,SAURAV@999"}

Sample Response


{
"responseCode":"000",
"responseMessage":"Merchants successfully uploaded.",
"responseData":[
{
"merchantCode":"1000NOUOFMB",
"qrString":"01021129270023NCHL000210001000NOUOFMB52045021530352454010560105802NP5920NepalClearingHouse6009Kathmandu6244010100306Store10709Terminal10812Billpayment64060002en63045AC6",
"fullName":"Nepal Clearing House"
}
],
"responseErrors":null,
"responseStatus":null
}

Failed Response

{
"timeStamp":"2023-10-04 01:58:47",
"statusCode":"400",
"status":null,
"messages":[
{
"field":"merchantDetailBulk[0].merchantDetailDto.panNumber",
"message":"Merchant with pan number '52873162' already exist."
}
],
"responseMsg":"Duplicate Merchant Found",
"responseData":null
}

2.2. API To Download QR String

The "API to Download QR String" is a crucial component of our application's functionality that allows the acquirer to retrieve QR code strings for various purposes. This API endpoint serves as a bridge between our system and external applications or devices, enabling seamless integration and generation of NQR of the enrolled merchant’s

Post: /api/merchant/info

Sample Request

{
"merchantCode":"1000NOUOFMB",
"requestUserDetailDto":{
"user":"SAURAV@999",
"identificationCode":"00021000",
"subIdentificationCode":"WAL"
},
"token":"HkfZqIsPSaqK7jy0JfPgrBI8vpESUl9cy1GXTXHw23MI6MTKpTgbSSEcPRIz9IJzaRCUkQYChTncNeoHTCR5ItuXv2gert3YsJoUZ03FHst4KqJ1ZNy1/ze3lMsShzOSJ7nCRPcwyx0xzPbTYTUXPYWLYjVqgxIwT6eZCFpcBgs="
}

Sample Response

{
"responseCode":"000",
"responseMessage":null,
"responseData":{
"merchantCode":"1000NOUOFMB",
"acquirerId":"00021000",
"legalName":"Nepal Clearing House Limited",
"createdAt":"2024-01-25T11:05:32.907+00:00",
"status":"APPROVED",
"qrString":"01021129270023NCHL000210001000NOUOFMB52045021530352454010560105802NP5920NepalClearingHouse6009Kathmandu6244010100306Store10709Terminal10812Billpayment64060002en63045AC6"
},
"responseErrors":null,
"responseStatus":null
}

TOKEN STRING: merchantCode,identificationCode,user

Eg:1000NOUOFMB,00021000,SAURAV@999

2.3. API To Fetch Transaction Reports

NEPALPAY QR Network members will have access to various reporting API related to Transaction and Reconciliation report, session query, etc. for the purpose of reporting and reconciliation of the transactions and payments.

Example Image

Post: /nQR/v1/settledsession

This reporting API is used to fetch the list of sessions in Retail Payment Switch(RPS) and their status based on settlement data and session serial. Sessions with status SETTLED to be considered for the reconciliation of QR transactions.

Request parameters

#Data ItemsTypeLengthRequired Remarks
1 sessionSrlno Integer CSession number to enquiry the status
2dateSettled StringCYYYY-MM-dd Format date to get all the sessions settled on that date.

Response parameters

#Data ItemsTypeLengthRequired Remarks
1sessionSrlnoD M Session number
2StatusStringMSession Status (e.g. “ACTIVE”,” SETTLED”). In order to cancel a transaction, the session must be in “ACTIVE” status
3dateSettledStringCYYYY-MM-dd Format date to get all the sessions settled on that date.

Sample request:

{
"dateSettled":"2021-11-15"
}

Sample response:

 {
"timestamp":"2022-01-16T07:33:08.383+0000",
"responseCode":"200",
"responseStatus":"SUCCESS",
"responseMessage":null,
"responseBody":[
{
"sessionSrlNo":1559,
"status":"GENERATED",
"settlementDate":"2021-12-18",
"dateSettled":null
},
{
"sessionSrlNo":1563,
"status":"SETTLED",
"settlementDate":"2021-12-18",
"dateSettled":null
}
]
}

2.3.1 Reconciliation report specifications

Post: /nQR/v1/report

This reporting API is used to fetch the list of all transactions of settled session based on session serial of particular issuer & acquirer.

Request Parameters

#Data ItemsTypeLengthRequired Remarks
1 sessionSrlno Integer MSession number to enquiry the status
2issuerId or acquirerId StringMNEPALPAY Issuer Id

Response Parameters

#Data ItemsTypeLengthRequired Remarks
1sessionSrlno StringSession number for the transaction
2recDate Date Date of transaction recording
3instructionId String20Unique reference id to trace the request by issuer/acquirer
4nQrTxnId String20Unique payment transaction id generated by NCHL.
5 acquirerIdStringAcquirer of the QR code
6issuerId StringIssuer id
7network StringNetwork of the QR code
8issuerNetwork StringNetwork of the issuer.
9amount Numeric(12,2)Amount
10interchangeFee Numeric(10,2) Charge if applicable else 0.00
11 transactionFeeNumeric(10,2) IF additional cost to be paid by the customer for the transaction. else 0.00
12 debitStatusStringPayer Account Debit status
13creditStatus StringReceiver Account Credit status
14PayerName String200Name of the payer
15transactionType StringPMT-Payment, RFND-Refund
16 payerMobileNumberMobile No of Payer
17merchantName String
18merchantTxnRef String
19 terminalStringTerminal id of the QR code
20merchantBillNo StringBill No of merchant

Request sample:

{
"sessionSrlNo":"1542",
"issuerId or acquirerId ":"00004501"
}

Response Sample:

{
"timestamp":"2021-08-10T11:14:41.893+0545",
"responseCode":"200",
"responseMessage":"SUCCESS",
"responseBody":[
{
"nQrTxnId":"2107230000000003XBI",
"tranType":"PMT",
"instructionId":"HBLQR-1191982838",
"issuerId":"00000701",
"acquirerId":"00000701",
"amount":2200.11,
"transactionFee":0.00,
"interchangeFee":15.00,
"merchantName":"Merchant Name",
"merchantBillNo":"44454",
"merchantTxnRef":null,
"payerName":"Kiran Maharjan",
"payerMobileNumber":"+977-9849752010",
"debitStatus":"000",
"creditStatus":"DEFER",
"sessionSrlNo":1214,
"recDate":"2021-07-23",
"terminal":"MOB",
"network":"NQR",
"issuerNetwork":"NQR"
},
{
"nQrTxnId":"2107230000000005LGB",
"tranType":"PMT",
"instructionId":"MBLQR-4589756",
"issuerId":"00001501",
"acquirerId":"00000701",
"amount":10000.00,
"transactionFee":0.00,
"interchangeFee":53.25,
"merchantName":"Merchant Name",
"merchantBillNo":"0",
"merchantTxnRef":"56555",
"payerName":"Sudip Shah",
"payerMobileNumber":"+977-9851011596",
"debitStatus":"000",
"creditStatus":"CNCL",
"sessionSrlNo":1214,
"recDate":"2021-07-23",
"terminal":"CIPS",
"network":"NQR",
"issuerNetwork":"NQR"
},
{
"nQrTxnId":"2107230000000004BIJ",
"tranType":"RFND",
"instructionId":"MOCO_RFND-12358",
"issuerId":"00001601",
"acquirerId":"00000701",
"amount":500.00,
"transactionFee":0.00,
"interchangeFee":0.00,
"merchantName":"Merchant Name",
"merchantBillNo":"0",
"merchantTxnRef":"21072300000000423KIO",
"payerName":"Rakesh Pokheral",
"payerMobileNumber":"+977-9849752010",
"debitStatus":"000",
"creditStatus":"000",
"sessionSrlNo":1214,
"recDate":"2021-07-23",
"terminal":"WAL",
"network":"NQR",
"issuerNetwork":"NQR"
},
{
"nQrTxnId":"2107230000000002FRR",
"tranType":"PMT",
"instructionId":"EVRSTQR-4545544",
"issuerId":"00001001",
"acquirerId":"00000701",
"amount":300.25,
"transactionFee":5.25,
"interchangeFee":2.50,
"merchantName":"Merchant Name",
"merchantBillNo":"jjhd6",
"merchantTxnRef":null,
"payerName":"Jeevan Shrestha",
"payerMobileNumber":"+977-9851752010",
"debitStatus":"000",
"creditStatus":"DEFER",
"sessionSrlNo":1214,
"recDate":"2021-07-23",
"terminal":"MOB",
"network":"NQR",
"issuerNetwork":"XXX"
}
]
}

2.4. API To Fetch Merchant Category Code

Post: /api/merchant/merchantcategorycodes

{
"requestUserDetailDto":{
"user":"SAURAV@999",
"identificationCode":"00021000",
"subIdentificationCode":"WAL"
},
"token":"TSorsyJY3g57B313hEKOfGJFBbw0W8mS8ClHv8l4zwSRleEtmJgaEdXp/3hzlF9ON4owmLb3Jpmem4rAnrZA0NwvsaBETVw+ZujQupuM/avjAXXLo2rfX61W/fYshupOKcWW7CapaSJw4QHmJlxdlilKxy1W3isG2POcfd4DlHc="
}

TOKEN STRING: identificationCode,user Eg:00021000,SAURAV@999

2.5. Annexure

Following are the list of response codes used in Open NPI that could be technical and business. HTTP Reason codes FORBIDDEN, BAD REQUEST and INTERNAL SERVER ERROR are exceptional cases which requires the exact technical setups and message structures mentioned in the document. These HTTP statuses contains same response message format as mentioned below with response code. All technically valid messages will be responded with HTTP status OK which has a fixed format and doesn’t change. Technical Response Format (FORBIDDEN, BAD REQUEST and INTERNAL SERVER ERROR):

{
"responseCode": "<Response Code>",
"responseDescription": "<Response Messages>",
"fieldErrors": [],
}

Technical Error Codes

Reason CodeReason DescriptionRemarks
000SuccessSuccess Enrollment, Merchant Fetch.
E003Invalid Request TokenDigital Signature in the token is not matching
E007Technical Validation FailedTechnical invalid request to the API. Please check response Description for further details.
E001Invalid IP AddressIP address from NPI API is not whitelisted
E010Merchant Not Found The record of the merchant is not found
B106Invalid AcquirerAcquirer does not exist