NICEPAY API
...
API E-Wallet (Direct Debit) SN...
Check Status Transaction - API E-Wallet (Direct Debit) SNAP
11 min
about check status transaction api e wallet (direct debit) snap this api uses to check the payment transaction status on the e wallet payment method with direct debit host to host feature based on the snap bi standard check status transaction api e wallet (direct debit) snap please request the access token firsthand before performing the authentication through the docid 92feymrqs iebhxrfgxuq section service code 55 api endpoint /api/v1 0/debit/status https //dev nicepay co id/nicepay/api/v1 0/debit/status http method post description request check status for authentication content type application/json request header parameter for check status transaction api e wallet (direct debit) snap parameter type length required description example content type string 127 mandatory application/json authorization string variable mandatory bearer “ access token ” 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 x signature string variable mandatory signature will be generated by merchant docid\ uzex33relyenkogbjjnyp x partner id string 20 mandatory x partner id = client id x external id string 40 mandatory unique reference number ( 41807553358950093184 ) channel id string 5 mandatory unique channel merchant credential id number client id + "01" = channel id "ionpaytest" + "01" = "ionpaytest01" ionpaytest01 request body parameter for check status transaction api e wallet (direct debit) snap parameter type required length description or example merchantid string mandatory 10 merchant identifier that is unique per each merchant submerchantid string o 32 sub merchant id originalreferenceno string mandatory 40 original transaction identifier on service provider system originalpartnerreferenceno string mandatory 40 original transaction identifier on consumer system externalstoreid string o 32 unique identifier of shop id in client system servicecode string mandatory 2 transaction type indicator (service code of the original transaction request) amount array of json object mandatory variable amount of transaction "amount" { "value" "12345678 00", "currency" "idr" } value string mandatory 12 value currency string mandatory 3 currency transactiondate string optional 25 transaction date iso8601, in format yyyymmddthh mm\ ss+07 00 time must be in gmt+7 (jakarta time) additionalinfo json object optional variable additional information response parameter for check status transaction api e wallet (direct debit) snap parameter type required length description or example responsecode string mandatory 7 refer to docid\ bjr4kjamzcknln 5zrnvw list responsemessage string mandatory 150 refer to docid\ bjr4kjamzcknln 5zrnvw list originalreferenceno string mandatory 40 original transaction identifier on service provider system originalpartnerreferenceno string mandatory 40 original transaction identifier on service provider system must be filled upon successful transaction servicecode string mandatory 2 transaction type indicator (service code of the original transaction request) latesttransactionstatus string mandatory 2 category code for the status of the transaction example 00 success 01 initiated 02 paying 03 pending 04 refunded 05 canceled 06 failed 07 not found transactionstatusdesc string optional 50 description status transaction transamount array of json object mandatory variable amount of transaction "transamount" { "currency" "idr", "value" "239 00" } value string mandatory 12 value currency string mandatory 3 currency additionalinfo json object optional variable additional information "additionalinfo" { } mitra cd string mandatory 4 docid 6go07owr b22bafuetehl example indomaret indo alfamart alma ovo ovoe linkaja link dana dana shopeepay eshp jenius jenc kredivo kdvi akulaku aklp indodana idna qris qshp goodsnm string mandatory 200 goods name billingnm string mandatory 100 buyer name billingphone string mandatory 20 buyer phone number sample parameter for check status transaction api e wallet (direct debit) snap request parameter curl curl x post \\ 'https //dev nicepay co id/nicepay/api/v1 0/debit/status' \\ h 'content type application/json' \\ h 'authorization bearer eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8=' \\ h 'x timestamp 2024 12 31t10 11 40+07 00' \\ h 'x signature ufbw7r8rhw79ioiv/hlv607m60qzaybv8uzmbsryb6/thlo/fhqvp4xryeluehoss9o+qs6vwtkb/ygtucc+tq==' \\ h 'x partner id tniceew051' \\ h 'x external id txid202402111402271707638100' \\ h 'channel id tniceew05101' \\ d '{"merchantid" "23489182303312","submerchantid" "23489182303312","originalpartnerreferenceno" "2020102900000000000001","originalreferenceno" "tniceew05105202210141451109841","servicecode" "54","transactiondate" "2020 12 21t14 56 11+07 00","externalstoreid" "239840198240795109","amount" {"value" "12345678 00","currency" "idr"},"additionalinfo" {}}' node js // debit payment status data (tniceew051 context) const partner id = "tniceew051"; const access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; const x timestamp = "2024 12 31t10 11 40+07 00"; const x external id = "txid202402111402271707638100"; const channel id = "tniceew05101"; const merchant id body = "23489182303312"; const store id = "239840198240795109"; const sub merchant id = "23489182303312"; const partner ref no = "2020102900000000000001"; const original ref no = "tniceew05105202210141451109841"; const service code = "54"; const transaction date = "2020 12 21t14 56 11+07 00"; const amount value = "12345678 00"; // step 1 configure the sdk const config = { isproduction false, privatekey cons privatekey, clientsecret cons clientsecret, clientid partner id, // tniceew051 iscloudserver false, }; // step 2 define the debit status inquiry request parameters let paramcheckstatus = { body { merchantid merchant id body, submerchantid sub merchant id, originalpartnerreferenceno partner ref no, originalreferenceno original ref no, servicecode service code, transactiondate transaction date, externalstoreid store id, amount { value amount value, currency "idr", }, additionalinfo {} }, headers { x external id x external id, channel id channel id, }, }; let snap = new snap(config); let endpoint = `/api/v1 0/debit/status`; let response = snap requestsnaptransaction(paramcheckstatus, endpoint, access token, "post");final string partner id = "tniceew05"; // x partner id from curl final string x external id = "txid202402111402271707638100"; final string x timestamp = "2024 12 31t10 11 40+07 00"; final string access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; // step 1 configuration (tniceew05 context) final nicepay config2 = nicepay builder() isproduction(false) clientsecret("your client secret") partnerid(partner id) externalid(x external id) timestamp(x timestamp) privatekey("your private key") build(); final var accesstoken = access token; // step 2 request body (debit status inquiry payload) final inquirystatus requestdata = inquirystatus builder() merchantid("23489182303312") // merchantid from curl body submerchantid("23489182303312") // submerchantid from curl body originalpartnerreferenceno("2020102900000000000001") originalreferenceno("tniceew05105202210141451109841") servicecode("54") transactiondate("2020 12 21t14 56 11+07 00") externalstoreid("239840198240795109") amount("12345678 00", "idr") // additionalinfo is implicitly an empty object as per curl build(); // step 3 execute the inquiry nicepayresponse response = snapinquirystatusservice callserviceewalletcheckstatus(requestdata, accesstoken, config2);partner id = "tniceew051" sub merchant id = "23489182303312" original ref no = "tniceew05105202210141451109841" original partner ref no = "2020102900000000000001" service code = "54" transaction date = "2020 12 21t14 56 11+07 00" external store id = "239840198240795109" amount value = "12345678 00" bodycreatetoken = ( builderaccesstoken buildaccesstoken() setgranttype("client credentials") setadditionalinfo({}) build() ) amount = { "value" amount value, "currency" "idr" } additionalinfo = {} bodydirectdebitinquiry = ( builderdirectdebit builddirectdebitinquiry() setmerchantid(partner id) setsubmerchantid(sub merchant id) setoriginalpartnerreferenceno(original partner ref no) setoriginalreferenceno(original ref no) setservicecode(service code) settransactiondate(transaction date) setexternalstoreid(external store id) setamount(amount) setadditionalinfo(additionalinfo) build() ) environment = (builderenvironment buildenvironment() iscloud(false) isproduction(false) build()) result = snapservice servicetransaction(bodycreatetoken jsonaccesstoken(), bodydirectdebitinquiry jsondirectdebitinquiry(), constantsendpoints inquirydirectdebit(), environment) c# const string partner id = "tniceew051"; const string channel id = "tniceew05101"; const string x timestamp = "2024 12 31t10 11 40+07 00"; const string x external id = "txid202402111402271707638100"; const string access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; string privatekey = config privatekey; string clientsecret = config clientsecret; string clientid = partner id; string timestamp = x timestamp; string channelid = channel id; string random = signaturegeneratorutils generaterandomnumberstring(8); bool isproduction = false; bool iscloudserver = false; string signature = signaturegeneratorutils generatesignature(privatekey, clientid, timestamp); // create ewallet service apiendpoints apiendpoints = new apiendpoints(); apiservice ewalletservice = new apiservice(apiendpoints, clientsecret, clientid, channelid, isproduction, iscloudserver); snapewalletservices snapewalletservices = new snapewalletservices(clientid); string createrequestbody = snapewalletservices generatestatusewalletrequest( merchantid "23489182303312", submerchantid "23489182303312", originalpartnerreferenceno "2020102900000000000001", originalreferenceno "tniceew05105202210141451109841", servicecode "54", transactiondate datetime parse("2020 12 21t14 56 11+07 00"), externalstoreid "239840198240795109", amountvalue "12345678 00", currency "idr" ); console writeline("inquiry ewallet request " + createrequestbody); // send post request string externalid = x external id; string createresponse = await ewalletservice sendpostrequest(apiendpoints statusewallet, accesstoken, timestamp, createrequestbody, externalid); console writeline("inquiry ewallet response " + createresponse); laravel const string access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; const string x timestamp = "2024 12 31t10 11 40+07 00"; const string x external id = "txid202402111402271707638100"; const string channel id = "tniceew05101"; protected $useprod = false; protected $usecloud = false; protected $inquiry ewallet endpoint = "/api/v1 0/debit/status"; // corrected endpoint for status inquiry // credential protected $client id = "tniceew051"; protected $key = " private key merchant"; protected $client secret = " client secret merchant"; protected $access token = access token; protected $store id = "239840198240795109"; $url = httputil getnicepaydomain($this >useprod, $this >usecloud) $this >inquiry ewallet endpoint; $helper = new helpers(); $http method = "post"; $x time stamp = x timestamp; $partner id = $this >client id; $client secret = $this >client secret; $access token = $this >access token; $store id = $this >store id; $external id = x external id; $channel id = channel id; $amount = \[ "value" => "12345678 00", "currency" => "idr" ]; $additionalinfo = new \stdclass(); $body = \[ "merchantid" => "23489182303312", // merchantid from curl body "submerchantid" => "23489182303312", "originalpartnerreferenceno" => "2020102900000000000001", "originalreferenceno" => "tniceew05105202210141451109841", "servicecode" => "54", "transactiondate" => "2020 12 21t14 56 11+07 00", "externalstoreid" => "239840198240795109", "amount" => $amount, "additionalinfo" => $additionalinfo ]; $string to sign = $helper >generatestringtosign( $http method, $this >inquiry ewallet endpoint, $access token, $body, $x time stamp ); $signature = $helper >hmacsha512encoded( $string to sign, $client secret, openssl algo sha512 ); $header = $helper >generateheader( $access token, $x time stamp, $signature, $partner id, $external id, $channel id ); print r($string to sign); print r("\r\n"); print r($header); print r($body); try { $response = httputil postjsonrequestwithheader($url, $body, $header); } catch (exception $e) { // handle exception } php native $config = nicepay builder() >setisproduction(false) >setprivatekey($this >oldkeyformat) >setclientsecret($this >clientsecret) >setpartnerid("tniceew051") >setexternalid("txid202402111402271707638100") >settimestamp("2024 12 31t10 11 40+07 00") >build(); $accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; $requestbody = inquirystatus builder() >setmerchantid("23489182303312") >setsubmerchantid("23489182303312") >setoriginalpartnerreferenceno("2020102900000000000001") >setoriginalreferenceno("tniceew05105202210141451109841") >setservicecode("54") >settransactiondate("2020 12 21t14 56 11+07 00") >setexternalstoreid("239840198240795109") >setamount("12345678 00", "idr") >setadditionalinfo(\[]) >build(); $snapewalletservice = new snapewalletservice($config); $response = $snapewalletservice >inquirystatus($requestbody, $accesstoken);const val partner id = "tniceew051" const val x external id = "txid202402111402271707638100" const val x timestamp = "2024 12 31t10 11 40+07 00" const val access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8=" // step 1 initialize the nicepay configuration (header context) var config nicepay = nicepay builder() isproduction(false) clientsecret("your client secret") partnerid(partner id) externalid(x external id) timestamp(x timestamp) privatekey("your private key") build() // step 2 define the static status request body val checkstatusewallet snapcheckstatus = snapcheckstatus builder() merchantid("23489182303312") submerchantid("23489182303312") originalpartnerreferenceno("2020102900000000000001") originalreferenceno("tniceew05105202210141451109841") servicecode("54") transactiondate("2020 12 21t14 56 11+07 00") externalstoreid("239840198240795109") amount("12345678 00", "idr") build() // step 3 execute the inquiry (removed dynamic token fetching) val response nicepayresponse? = snapewalletservice checkstatus(checkstatusewallet, access token, config) codeigniter $config = nicepay builder() >setisproduction(false) >setiscloudserver(iscloudserver true) >setprivatekey($this >oldkeyformat) >setclientsecret($this >clientsecret) >setpartnerid("tniceew051") >setexternalid("txid202402111402271707638100") >settimestamp("2024 12 31t10 11 40+07 00") >build(); $accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; $requestbody = inquirystatusewallet builder() >setmerchantid("23489182303312") >setsubmerchantid("23489182303312") >setoriginalpartnerreferenceno("2020102900000000000001") >setoriginalreferenceno("tniceew05105202210141451109841") >setservicecode("54") >settransactiondate("2020 12 21t14 56 11+07 00") >setexternalstoreid("239840198240795109") >setamount("12345678 00", "idr") >setadditionalinfo(\[]) >build(); $snapewalletservice = new snapewalletservice(); try { $response = $snapewalletservice >inquirystatusewallet($requestbody, $accesstoken, $config); } catch (\exception $e) { // handle exception } response parameter sample response { "responsecode" "2005500", "responsemessage" "successful", "originalpartnerreferenceno" "2020102900000000000001", "originalreferenceno" "tniceew05105202210141451109841", "servicecode" "55", "latesttransactionstatus" "00", "transactionstatusdesc" "success", "transamount" { "currency" "idr", "value" "239 00" }, "additionalinfo" { "mitra cd" "dana", "goodsnm" "merchant goods 1", "billingnm" "buyer name", "billingphone" "02112345678" } }