NICEPAY API
...
API QRIS SNAP
Check Status Transaction - API QRIS SNAP
11 min
tentang check status transaction api qris snap api dengan standar snap ini digunakan untuk memeriksa status transaksi pembayaran pada metode pembayaran qris check status transaction api qris snap silakan mengajukan akses token terlebih dahulu sebelum melakukan pemeriksaan status transaksi (check status transaction api) melalui bagian docid\ gcgqbiyxg1etcd0ji9chx service code 47 api endpoint /nicepay/api/v1 0/qr/qr mpm query http method post description check status transaction api content type application/json request header parameter for check status transaction api qris snap nama parameter header tipe kebutuhan deskripsi contoh content type string (127) mandatory type of the content application/json x timestamp string (25) mandatory using iso 8601 as timestamp format transaction date time, in format yyyymmddthh\ mm\ ss+07 00 time must be in gmt+7 (jakarta time) 2022 03 21t10 11 40+07 00 authorization string (variable) mandatory "bearer" + { access token } x signature string (variable) mandatory signature will be generated by merchant docid\ uzex33relyenkogbjjnyp x partner id string(20) mandatory nicepay client id ( mid ) ionpaytest x external id string (40) mandatory unique messaging reference id generated by merchant numeric string reference number that should be unique in every transaction in one day channel id string (20) mandatory unique channel merchant credential id number client id + "01" = channel id "ionpaytest" + "01" = "ionpaytest01" ionpaytest01 request body parameter for check status transaction api qris snap nama parameter bi tipe parameter kebutuhan parameter nicepay deskripsi contoh originalreferenceno string (40) mandatory txid nicepay transaction id or identifier ionpaytest08202106091121206416 originalpartnerreferenceno string (40) mandatory referenceno unique transaction id from merchant ncpy20221017161458 merchantid string (10) mandatory imid nicepay merchant id ionpaytest externalstoreid string (32) mandatory storecd merchant id from acquirer pay side nicepay servicecode string (2) mandatory transaction type indicator (service code of the original transaction request) 47 additionalinfo object mandatory "additionalinfo" { } response parameter for check status transaction api qris snap nama parameter bi tipe parameter kebutuhan parameter nicepay deskripsi contoh responsecode string (7) mandatory responsecd error code to specify the error returned docid\ lkqjxsl5cmkdxyxxhyyss 2005100 responsemessage string (150) mandatory responsemsg debug message to provide more information successful originalreferenceno string (40) mandatory txid nicepay transaction id or identifier ionpaytest08202106091121206416 originalpartnerreferenceno string (40) mandatory referenceno unique transaction id from merchant ncpy20221017161458 servicecode string (2) mandatory transaction type indicator (service code of the original transaction request) 47 latesttransactionstatus string (2) mandatory status docid\ xxlwrb0q8xvksmao7ti9a 00 paidtime string (25) mandatory transdt , transtm transaction date using iso 8601 format yyyy mm ddthh\ mm\ ss 2022 07 20t07 15 00+07 00 amount object mandatory "amount" { } value string (12) mandatory amt transaction amount note amount format, currently only supported idr (indonesian currency rupiah) then value includes 2 decimal digits which are separated by a dot ( ) 10000 00 currency string (3) mandatory currency default value idr idr additionalinfo object mandatory "additionalinfo" { } merchantid string (10) mandatory imid nicepay merchant id ionpaytest paymenttrxsn string (32) mandatory paymenttrxsn payment transaction number from acquirer side 07202210051341224326 canceltrxsn string (32) conditional canceltrxsn cancel transaction number from acquirer side if payment has been cancelled 07202210051341224326 cancelamt string (12) conditional transaction amount note amount format, currently only supported idr (indonesian currency rupiah) then value includes 2 decimal digits which are separated by a dot ( ) 10000 00 requesttime string (25) mandatory reqdt , reqtm transaction date using iso 8601 format yyyy mm ddthh\ mm\ ss 2022 07 20t07 15 00+07 00 goodsnm string (200) mandatory goods name merchant goods 1 billingnm string (100) mandatory buyer name buyer name userid string (128) mandatory userid qris user id 213nauasiqbih341bdjashf1204gkjbcasc externalstoreid string (32) mandatory storecd merchant id from acquirer pay side nicepay sample parameter for check status transaction api qris snap request parameter curl curl x post \\ 'https //dev nicepay co id/nicepay/api/v1 0/qr/qr mpm query' \\ h 'content type application/json' \\ h 'authorization bearer eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek=' \\ h 'x timestamp 2024 04 18t09 00 40+07 00' \\ h 'x signature xvvjtqccts7cfxp4fe8aqtqitg0ostthfxe4rftireuu9cnvthkh7elbtidmueha2y0plync7+goqsqwyf1wha==' \\ h 'x partner id tniceqr081' \\ h 'x external id 11044820240418' \\ h 'channel id tniceqr08101' \\ d '{"originalreferenceno" "tniceqr08108202404181012168473","originalpartnerreferenceno" "ordno2022120215134035","merchantid" "tniceqr081","externalstoreid" "nicepaystoreid1","servicecode" "47","additionalinfo" {}}' node js // this configuration should be initialized with your actual credentials const config = { isproduction false, privatekey "your private key", // replace with your actual private key clientsecret "your client secret", // replace with your actual client secret clientid "tniceqr081", iscloudserver false, }; const accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek="; let paramquery = { body { originalreferenceno "tniceqr08108202404181012168473", originalpartnerreferenceno "ordno2022120215134035", merchantid "tniceqr081", externalstoreid "nicepaystoreid1", servicecode "47", additionalinfo {} }, headers { x external id "11044820240418", channel id "tniceqr08101", }, }; let snap = new snap(config); let endpoint = `/api/v1 0/qr/qr mpm query`; let response = snap requestsnaptransaction(paramquery, endpoint, accesstoken, "post"); nicepay config = nicepay builder() isproduction(false) iscloudserver(false) clientsecret(client secret) partnerid("tniceqr081") externalid("11044820240418") timestamp("2024 04 18t09 00 40+07 00") privatekey(private key) build(); string accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek="; inquirystatus requestdata = inquirystatus builder() merchantid("tniceqr081") originalpartnerreferenceno("ordno2022120215134035") originalreferenceno("tniceqr08108202404181012168473") externalstoreid("nicepaystoreid1") servicecode("47") build(); nicepayresponse result = snapinquirystatusservice callserviceqrischeckstatus(requestdata, accesstoken, config);bodycreatetoken = ( builderaccesstoken buildaccesstoken() setgranttype("client credentials") setadditionalinfo("") build() ) additionalinfo = { } bodyqrisinquiry = ( builderqris buildqrisinquiry() setmerchantid("tniceqr081") setexternalstoreid("nicepaystoreid1") setoriginalreferenceno("tniceqr08108202404181012168473") setoriginalpartnerreferenceno("ordno2022120215134035") setservicecode("47") setadditionalinfo(additionalinfo) build() ) environment = (builderenvironment buildenvironment() iscloud(false) isproduction(false) build()) \# the service call to execute the transaction result = snapservice servicetransaction(bodycreatetoken jsonaccesstoken(), bodyqrisinquiry jsonqrisinquiry(), constantsendpoints inquiryqris(), environment) c# string clientid = "tniceqr081"; string privatekey = "your private key"; // replace with your actual private key string clientsecret = "your client secret"; // replace with your actual client secret string channelid = "tniceqr08101"; bool isproduction = false;// set true for production bool iscloudserver = false; // values from the curl command string timestamp = "2024 04 18t09 00 40+07 00"; string externalid = "11044820240418"; string accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek="; apiendpoints apiendpoints = new apiendpoints(); apiservice qrisservice = new apiservice(apiendpoints, clientsecret, clientid, channelid, isproduction, iscloudserver); snapqrisservices snapqrisservices = new snapqrisservices(clientid); var inquirybody = new { originalreferenceno = "tniceqr08108202404181012168473", originalpartnerreferenceno = "ordno2022120215134035", merchantid = "tniceqr081", externalstoreid = "nicepaystoreid1", servicecode = "47", additionalinfo = new {} }; string requestbodyjson = newtonsoft json jsonconvert serializeobject(inquirybody); string endpoint = apiendpoints statusqris; string inquiryresponse = await qrisservice sendpostrequest(endpoint, accesstoken, timestamp, requestbodyjson, externalid); console writeline("inquiry qris response " + inquiryresponse); laravel protected $useprod = false; protected $usecloud = false; protected $inquiry qris endpoint = "/api/v1 0/qr/qr mpm query"; // credential protected $client id = "tniceqr081"; protected $key = " private key merchant"; protected $client secret = " client secret merchant"; protected $access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek="; // authorization bearer protected $store id = "nicepaystoreid1"; $url = httputil getnicepaydomain($this >useprod, $this >usecloud) $this >inquiry qris endpoint; $helper = new helpers(); $http method = "post"; $x time stamp = '2024 04 18t09 00 40+07 00'; $date = carbon parse($x time stamp); $time stamp = $date >format("ymdhis"); $partner id = $this >client id; $client secret = $this >client secret; $access token = $this >access token; $store id = $this >store id; $external id = "11044820240418"; $original reference no = "tniceqr08108202404181012168473"; $reference no = "ordno2022120215134035"; $additionalinfo = (object)\[]; $body = \[ "originalreferenceno" => $original reference no, "originalpartnerreferenceno" => $reference no, "merchantid" => $partner id, "externalstoreid" => $store id, "servicecode" => "47", "additionalinfo" => $additionalinfo ]; $string to sign = $helper >generatestringtosign( $http method, $this >inquiry qris endpoint, $access token, $body, $x time stamp ); $signature = $helper >hmacsha512encoded( $string to sign, $client secret, openssl algo sha512 ); $channel id = "tniceqr08101"; $header = $helper >generateheader( $access token, $x time stamp, $signature, $partner id, $external id, $channel id ); $response = httputil postjsonrequestwithheader($url, $body, $header); php native $partnerid = "tniceqr081"; $externalid = "11044820240418"; $timestamp = '2024 04 18t09 00 40+07 00'; $originalreferenceno = "tniceqr08108202404181012168473"; $originalpartnerreferenceno = "ordno2022120215134035"; $externalstoreid = "nicepaystoreid1"; $servicecode = "47"; $accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek="; // step 1 configure the sdk $config = nicepay builder() >setisproduction(false) >setprivatekey("merchant private key") >setclientsecret("merchant client secret") >setpartnerid($partnerid) >setexternalid($externalid) >settimestamp($timestamp) >build(); // step 2 define the request body $requestbody = inquirystatus builder() >setoriginalreferenceno($originalreferenceno) >setoriginalpartnerreferenceno($originalpartnerreferenceno) >setmerchantid($partnerid) >setexternalstoreid($externalstoreid) >setservicecode($servicecode) >setadditionalinfo((object)\[]) >build(); // step 3 execute the request try { $qrisservice = new snapqrisservice($config); $response = $qrisservice >inquirystatus($requestbody, $accesstoken); } catch (\exception $e) { // handle exceptions }val config nicepay = nicepay builder() isproduction(false) clientsecret(client secret) partnerid("tniceqr081") externalid("11044820240418") timestamp("2024 04 18t09 00 40+07 00") privatekey(private key) build() val accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek=" val checkstatusrequest snapcheckstatus = snapcheckstatus builder() merchantid("tniceqr081") originalpartnerreferenceno("ordno2022120215134035") originalreferenceno("tniceqr08108202404181012168473") servicecode("47") externalstoreid("nicepaystoreid1") build() val response nicepayresponse? = snapqrisservice checkstatus(checkstatusrequest, accesstoken, config) codeigniter $partnerid = "tniceqr081"; $externalid = "11044820240418"; $timestamp = '2024 04 18t09 00 40+07 00'; $originalreferenceno = "tniceqr08108202404181012168473"; $originalpartnerreferenceno = "ordno2022120215134035"; $externalstoreid = "nicepaystoreid1"; $servicecode = "47"; $accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijutkldrvfsmdgxiiwiaxnzijoitkldrvbbwsisim5hbwuioijosunfuefziiwizxhwijoimjaync0wnc0xofqwntowmzo1nloifq== in mypmwhwgxrywntbz7rdgg6 uqjzslfux9ayn37ek="; // hardcoded bearer token // step 1 configure the config $config = nicepay builder() >setiscloudserver(iscloudserver false) >setprivatekey("merchant private key") >setclientsecret("merchant client secret") >setpartnerid($partnerid) >setexternalid($externalid) >settimestamp($timestamp) >build(); // step 2 define the inquiry request body $requestbody = inquirystatusqris builder() >setoriginalreferenceno($originalreferenceno) >setoriginalpartnerreferenceno($originalpartnerreferenceno) >setmerchantid($partnerid) >setexternalstoreid($externalstoreid) >setservicecode($servicecode) >setadditionalinfo(\[]) >build(); // step 3 execute the request $snapqrisservice = new snapqrisservice(); // call the inquirystatusqris function $response = $snapqrisservice >inquirystatusqris($requestbody, $accesstoken, $config); response parameter sample response { "responsecode" "2005100", "responsemessage" "successful", "originalreferenceno" "tniceqr08108202404181012168473", "originalpartnerreferenceno" "ordno2022120215134035", "servicecode" "47", "latesttransactionstatus" "00", "paidtime" "2024 04 18t10 14 07+07 00", "amount" { "value" "100 00", "currency" "idr" }, "additionalinfo" { "goodsnm" "test snap transaction nicepay", "billingnm" "john doe", "merchantid" "tniceqr081", "paymenttrxsn" "101378968850945616", "canceltrxsn" "", "userid" "101378968850945616", "externalstoreid" "nicepaystoreid1", "requesttime" "2024 04 18t10 12 16+07 00" } }