NICEPAY API
...
Checkout API
Status Inquiry - API Checkout
12 min
about status inquiry api checkout after you integrate successfully with {{nicepay}} docid 066dopsepwv3fgkypjzaf , your {{business}} is ready to do {{transaction}} s in real with your {{customer}} however, {{nicepay}} recommend you to performs other docid\ zze5wxfg69spzsgehotnu {{integration}} like this inquiry {{api}} this {{api}} uses to check on {{transaction}} {{status}} you are requested on {{the}} previous docid 066dopsepwv3fgkypjzaf such as successful or failed {{transaction}} {{status}} when {{the}} {{transaction}} is completed, you will automatically get {{notification}} from us {{nicepay}} strongly recommend you to re check {{the}} {{transaction}} {{status}} using docid 7thqvphz6emwezw5 d4an status inquiry api checkout api url /nicepay/direct/v2/inquiry request method post header content type application/json merchant token sha256 ( timestamp + imid + referenceno + amt + merchantkey ) when {{notification}} received to your dbprocessurl , we strongly recommend {{merchant}} to verify {{the}} notification using docid 7thqvphz6emwezw5 d4an notification handling notification handling is useful to minimalize fraud actions, we strongly recommend {{merchant}} s to verify {{the}} notification handling request parameters for status inquiry api checkout parameter type size description remark timestamp required required n 14 {{api}} request date ( yyyymmddhh24miss ) 20221012080918 txid required required an 30 transaction id ionpaytest00202212191025073439 imid required required an 10 {{merchant}} id ionpaytest referenceno required required ans 40 {{merchant}} order number order20221012080918 amt required required n 12 transaction amount 10000 merchanttoken required required an 255 {{merchant}} token d8d0968892c568bc6ff5adc17cd755f85334a0b58fce85392682993a9ba653ed response parameters parameter type size description remark resultcd n 4 docid 2r5sr3xvppu1eju1nitg 0000 resultmsg an 255 result message docid 4 fpewlvczfhcvygxwck9 (empty) txid an 30 transaction id ionpaytest00202212191025073439 imid an 10 {{merchant}} id ionpaytest referenceno ans 40 {{merchant}} order number order20221012080918 paymethod n 2 docid\ ek 0djw7nuhytcda4sa3p 00 amt n 12 {{paymentproduct}} amount 10000 cancelamt n 12 cancel amount null reqdt n 8 transaction request date ( yyyymmdd ) 20221219 reqtm n 6 transaction request time ( hh24miss ) 102507 transdt n 8 transaction date ( yyyymmdd ) null transtm n 6 transaction time ( hh24miss ) null depositdt n 8 transaction deposit date ( yyyymmdd ) null deposittm n 6 transaction deposit time ( hh24miss ) null currency a 3 currency idr goodsnm an 100 goods name test transaction {{nicepay}} billingnm a 100 buyer name john doe status n 1 docid\ allhyf9mj hw8 mpz4tmu null additional credit card parameter type size description remark authno n 10 approval number issubankcd a 4 docid\ qbeq29lj53z vbvxtvb7l acqubankcd a 4 docid\ qbeq29lj53z vbvxtvb7l acqubanknm a 255 acquiring {{bank}} name issubanknm a 255 issuing {{bank}} name cardno ans 20 card number ith masking cardexpyymm n 4 card expiration ( yymm ) instmntmon n 2 installment month 1 1 month/full {{paymentproduct}} , if instmnttype null/1 3 3 months 6 6 months 12 12 months instmnttype n 2 docid\ wfsinjxqc2s9yubbybpep preauthtoken an 255 pre auth token (needed for capture {{paymentproduct}} ) recurringtoken an 255 recurring token (needed for recurring {{paymentproduct}} ) cctranstype n 2 credit card transaction type acqustatus n 2 purchase status 1 normal 2 recurring 3 pre auth 4 capture acquirerdata array 20 a dynamic array consisting of a unique reference number rrn that is provided by {{the}} {{bank}} ing {{partner}} when a refund is {{process}} ed this reference number can be used by {{the}} {{customer}} to track {{the}} {{status}} of {{the}} refund with {{the}} {{bank}} "acquirerdata" { "rrn" "332608321717" } latestfailhistory array object failed records are only displayed if the transaction fails and 1 transaction may have more than 1 failed record if the merchant has a retry mechanism "latestfailhistory" \[ { "resultcd" "1231", "resultmsg" "fail 3ds", "transdt" "20240707", "transtm" "121213" } ] vat n 12 {{vat}} fee n 12 service fee notaxamt n 12 tax fee amount additional virtual account parameter type size description remark bankcd a 4 docid\ qbeq29lj53z vbvxtvb7l vacctno n 16 {{bank}} {{va}} number vacctvaliddt n 8 va expiry date ( yyyymmdd ) vacctvalidtm n 6 va expiry time ( hh24miss ) additional others for status inquiry api checkout parameter type size description remark mitracd a 4 docid 0upx1lyg1o2f4biu3ssp (cvs, {{directdebit}} , {{ewallet}} , {{payloan}} ) payno n 12 cvs number (cvs) payvaliddt n 8 cvs expiry date ( yyyymmdd ) (cvs) payvalidtm n 6 cvs expiry time ( hh24miss ) (cvs) receiptcode ans 20 authorization code (cvs) mrefno an 20 {{bank}} reference number ( {{directdebit}} ) sample parameter for status inquiry api checkout request parameter for status inquiry api checkout curl curl location 'https //dev nicepay co id/nicepay/direct/v2/inquiry' \\ \ header 'content type application/json' \\ \ data '{ "timestamp" "20251111021168", "imid" "ionpaytest", "txid" "ionpaytest02202511110206549179", "referenceno" "ordno20251111021198", "amt" "10000", "merchanttoken" "3c88adc387f1971beccc7189779281756c11ffcf9337f7ab5e8c8e5e1947be08" }' node js const secondapiversion = require(" /lib/secondapiversion js"); const cons = require(" /sharedconfig js"); const config = { isproduction false, iscloudserver false, merchantkey cons merchantkey, }; const parameter = { "timestamp" "20251111021168", "imid" "ionpaytest", "txid" "ionpaytest02202511110206549179", "referenceno" "ordno20251111021198", "amt" "10000" }; let secondversion = new secondapiversion(config); let response = secondversion requestapi(parameter, "/direct/v2/inquiry");config =nicepay builder() isproduction(false) iscloudserver(false) clientsecret(client secret) partnerid(partner id) externalid(testingconstants external id) timestamp(timestamp) privatekey(private key cloud) build(); string timestamp = "20251111021168"; string imid = "ionpaytest"; string txid = "ionpaytest02202511110206549179"; string reffno = "ordno20251111021198"; string amount = "10000"; inquirystatus requestdata = inquirystatus builder() timestamp(timestamp) txid(txid) imid(imid) merchanttoken(timestamp, imid, reffno, amount, testingconstants merchant key) referenceno(reffno) amt(amount) build(); nicepayresponsev2 result = v2inquirystatusservice callv2inquirystatus(requestdata, config);from python nicepay data builder import builderenvironment from python nicepay data builder v2 professional import builderinquiry from python nicepay data builder v2 professional datagenerator import datagenerator from python nicepay service v2enterpriseservice import servicenicepay bodyinquiry = ( builderinquiry buildinquiry() settxid("ionpaytest02202511110206549179") setreferenceno("ordno20251111021198") setamt("10000") build() ) environment = (builderenvironment buildenvironment() iscloud(false) isproduction(false) build()) response = servicenicepay serviceinquiry(datagenerator getinquirybody(bodyinquiry jsoninquiry()), environment) c# testingconstantservice config = new testingconstantservice(); string merchantkey = config merkey; string clientid = "ionpaytest"; string timestamp = "20251111021168"; string refno = "ordno20251111021198"; string amount = "10000"; bool isproduction = false; bool iscloudserver = false; var builder = new merchanttokenbuilder() settimestamp(timestamp) setimid(clientid) setrefno(refno) setamount(amount) setmerchantkey(merchantkey); // act menghasilkan merchanttoken string merchanttoken = builder buildmerchanttoken(); var bodybuilder = new nicepayrequestbuilder() setcheckstatus( imid clientid, timestamp timestamp, txid "ionpaytest02202511110206549179", amt amount, referenceno refno, merchanttoken merchanttoken ); apiendpoints apiendpoints = new apiendpoints(); dictionary\<string, object> payload = bodybuilder build(); string jsonpayload = newtonsoft json jsonconvert serializeobject(payload); var registrationservice = new nicepayregistrationservice(apiendpoints,isproduction, iscloudserver); var result = await registrationservice sendpostasync(apiendpoints inquiryv2,payload); laravel // endpoint $url = httputil getnicepaydomain($this >useprod, $this >usecloud) $this >inquiry endpoint; // request body parameter $timestamp = "20251111021168"; $txid = "ionpaytest02202511110206549179"; $reference no = "ordno20251111021198"; $amt = "10000"; $merchant token = $this >generatemerchanttoken($timestamp, $this >imid, $reference no, $this >amt, $this >mer key); $body = \[ "timestamp" => $timestamp, "txid" => $txid, "imid" => $this >imid, "merchanttoken" => $merchant token, "referenceno" => $reference no, "amt" => $amt, ]; try { $response = httputil postjsonrequest($url, $body); } catch (throwable $th) { return $this >generateerrorresponse($th); } php native $imidtest = "ionpaytest"; $merchantkey = testconst $merchant key; $config = nicepay builder() >setisproduction(false) >build(); $timestamp = "20251111021168"; $reffno = "ordno20251111021198"; $amount = "10000"; $parameter = inquirystatus builder() >settimestamp($timestamp) >settxid("ionpaytest02202511110206549179") >setimid($imidtest) >setmerchanttoken($timestamp, $imidtest, $reffno, $amount, $this >merchantkey) >setreferenceno($reffno) >setamt($amount) >build(); try { $v2redirectservice = new v2redirectservice($config); $response = $v2redirectservice >inquirystatus($parameter); } catch (nicepayerror $e) { }var config nicepay? = nicepay builder() isproduction(false) clientsecret(testingconstants client secret) partnerid(testingconstants partner id) externalid(testingconstants external id) timestamp(testingconstants timestamp) privatekey(testingconstants private key) build() val timestamp = "20251111021168" val txid = "ionpaytest02202511110206549179" val imid = "ionpaytest" val referenceno = "ordno20251111021198" val amount = "10000" val request directv2checkstatus = directv2checkstatus builder() timestamp(timestamp) txid(txid) imid(imid) merchantkey(default merchant key) referenceno(referenceno) amt(amount) build() val response nicepayresponsev2 = v2virtualaccountservice checkstatus(request, config)!! codeigniter $imidtest = "ionpaytest"; $this >merchantkey = $testconst imid common merchant key; $this >v2config = nicepay builder() >setisproduction(false) >build(); $timestamp = "20251111021168"; $reffno = "ordno20251111021198"; $amount = "10000"; $config = $this >v2config; $parameter = inquirystatus builder() >settimestamp($timestamp) >settxid("ionpaytest02202511110206549179") >setimid($this >imidtest) >setmerchanttoken($timestamp, $this >imidtest, $reffno, $amount, $this >merchantkey) >setreferenceno($reffno) >setamt($amount) >build(); try { $v2vaservice = new v2vaservice($config); // you can use chosen payment method service $response = $v2vaservice >inquirystatus($parameter); } catch (exception $e) { } response parameter sample response { "txid" "ionpaytest02202511110206549179", "imid" "ionpaytest", "currency" "idr", "amt" "10000", "instmntmon" null, "instmnttype" "1", "referenceno" "ordno20251111021198", "goodsnm" "goods", "paymethod" "02", "billingnm" "hantu kesorean", "reqdt" "20251111", "reqtm" "020654", "status" "0", "resultcd" "0000", "resultmsg" "paid", "cardno" null, "preauthtoken" null, "acqubankcd" null, "issubankcd" null, "vacctvaliddt" "20280128", "vacctvalidtm" "235959", "vacctno" "7812001000000605", "bankcd" "ibbk", "payno" null, "mitracd" null, "receiptcode" null, "cancelamt" null, "transdt" "20251111", "transtm" "020654", "recurringtoken" null, "cctranstype" null, "payvaliddt" null, "payvalidtm" null, "mrefno" null, "acqustatus" null, "cardexpyymm" null, "acqubanknm" null, "issubanknm" null, "depositdt" "20251111", "deposittm" "020705", "paymentexpdt" null, "paymentexptm" null, "paymenttrxsn" null, "canceltrxsn" null, "userid" null, "shopid" null }