NICEPAY API
...
API QRIS SNAP
Refund Transaction - API QRIS SNAP
11 min
about refund transaction api qris snap this api with snap standards uses to refund transactions on the qris payment method refund transaction api qris snap please request the access token firsthand before executing the refund transaction api through the docid 92feymrqs iebhxrfgxuq section 180,555,117 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type request header parameter for refund transaction api qris snap 174,91,107,222 true unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type request body parameter for refund transaction api qris snap 161,0,109,192,177,180 true unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type response parameter for refund transaction api qris snap 181,105,105,201,188,162 true unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type left unhandled content type left unhandled content type unhandled content type unhandled content type unhandled content type sample parameter for refund transaction api qris snap request parameter curl curl x post \\ 'https //dev nicepay co id/nicepay/api/v1 0/qr/qr mpm refund' \\ 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 ionpaytest' \\ h 'x external id exid202402111402271707638098' \\ h 'channel id ionpaytest' \\ d '{"originalreferenceno" "ncpy20221017161458","originalpartnerreferenceno" "ionpaytest08202106091121206416","partnerrefundno" "ncpy20221017161458","merchantid" "ionpaytest","externalstoreid" "nicepay","refundamount" {"value" "10000 00","currency" "idr"},"reason" "refund trans","additionalinfo" {"canceltype" "1"}}' node js // data from the qris refund request const partnerid = "ionpaytest"; const channelid= "ionpaytest"; const externalid = "exid202402111402271707638098"; const timestamp = "2024 12 31t10 11 40+07 00"; const accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; // step 1 configure the config const config = { isproduction false, privatekey "merchant private key", clientsecret "merchant client secret", clientid partnerid, iscloudserver false, }; // step 2 define the qris refund request parameters let parameterrefund = { body { originalreferenceno "ncpy20221017161458", originalpartnerreferenceno "ionpaytest08202106091121206416", partnerrefundno "ncpy20221017161458", merchantid partnerid, externalstoreid "nicepay", refundamount { value "10000 00", currency "idr", }, reason "refund trans", additionalinfo { canceltype "1", }, }, headers { x timestamp timestamp, x partner id partnerid, x external id externalid, channel id channelid, }, }; // step 3 execute the refund request let endpoint = `/api/v1 0/qr/qr mpm refund`; let snap = new snap(config); let response = snap requestsnaptransaction(parameterrefund, endpoint, accesstoken, "post");string accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; // step 1 initialize the nicepay configuration nicepay config = nicepay builder() isproduction(false) clientsecret("your client secret") // placeholder for actual secret partnerid("ionpaytest") externalid("exid202402111402271707638098") timestamp("2024 12 31t10 11 40+07 00") privatekey("your private key") // placeholder for actual key build(); // step 2 define the qris refund request body cancel requestdata = cancel builder() merchantid("ionpaytest") externalstoreid("nicepay") originalreferenceno("ncpy20221017161458") originalpartnerreferenceno("ionpaytest08202106091121206416") partnerrefundno("ncpy20221017161458") reason("refund trans") refundamount("10000 00", "idr") additionalinfo(map of("canceltype", "1")) build(); // step 3 execute the qris refund nicepayresponse result = snapcancelservice callserviceqrisrefund(requestdata, accesstoken, config); client id = "ionpaytest" external store id = "nicepay" original ref no = "ncpy20221017161458" original partner ref no = "ionpaytest08202106091121206416" partner refund no = "ncpy20221017161458" refund reason = "refund trans" refund value = "10000 00" bodycreatetoken = ( builderaccesstoken buildaccesstoken() setgranttype("client credentials") setadditionalinfo("") build() ) refundamount = { "value" refund value, "currency" "idr" } additionalinfo = { "canceltype" "1" } bodyqrisinquiry = ( builderqris buildqrisrefund() setmerchantid(client id) setexternalstoreid(external store id) setoriginalreferenceno(original ref no) setoriginalpartnerreferenceno(original partner ref no) setpartnerrefundno(partner refund no) setrefundamount(refundamount) setreason(refund reason) setadditionalinfo(additionalinfo) build() ) environment = (builderenvironment buildenvironment() iscloud(false) isproduction(false) build()) result = snapservice servicetransaction(bodycreatetoken jsonaccesstoken(), bodyqrisinquiry jsonqrisrefund(), constantsendpoints refundqris(), environment) c# const string new client id = "ionpaytest"; const string new external id = "exid202402111402271707638098"; const string new channel id = "ionpaytest"; const string refund amount = "10000 00"; const string refund currency = "idr"; const string original ref no = "ncpy20221017161458"; const string original partner ref no = "ionpaytest08202106091121206416"; const string external store id = "nicepay"; const string cancel type = "1"; const string reason = "refund trans"; testingconstant config = new testingconstant(); string privatekey = ; string timestamp = datetimeoffset now\ tostring("yyyy mm ddthh\ mm\ sszzz"); string clientsecret = config clientsecret; string channelid = new channel id; string random = signaturegeneratorutils generaterandomnumberstring(8); bool isproduction = false; bool iscloudserver = true; string signature = signaturegeneratorutils generatesignature(privatekey, new client id, timestamp); var tokenrequester = new accesstokenrequester(); string accesstokenresponse = await tokenrequester getaccesstokenasync(new client id, signature, timestamp, isproduction, iscloudserver); dynamic accesstokenobject = jobject parse(accesstokenresponse); string accesstoken = accesstokenobject accesstoken; console writeline("inquiry ewallet akses token " + accesstoken); apiendpoints apiendpoints = new apiendpoints(); apiservice qrisservice = new apiservice(apiendpoints, clientsecret, new client id, channelid, isproduction, iscloudserver); snapqrisservices snapqrisservices = new snapqrisservices(new client id); string createrequestbody = snapqrisservices generaterefundqris( originalreferenceno original ref no, originalpartnerreferenceno original partner ref no, merchantid new client id, partnerrefundno "rfnd" + random, externalstoreid external store id, value refund amount, canceltype cancel type, currency refund currency, reason reason ); string externalid = new external id; string createresponse = await qrisservice sendpostrequest(apiendpoints refundqris, accesstoken, timestamp, createrequestbody, externalid); console writeline("refund qris response " + createresponse); laravel protected $useprod = false; protected $usecloud = false; protected $refund qris endpoint = "/api/v1 0/qr/qr mpm refund"; // credential protected $client id = "ionpaytest"; protected $key = " private key merchant"; protected $client secret = " client secret merchant"; protected $access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; protected $store id = "nicepay"; $url = httputil getnicepaydomain($this >useprod, $this >usecloud) $this >refund qris endpoint; $helper = new helpers(); $http method = "post"; $x time stamp = "2024 12 31t10 11 40+07 00"; $partner id = $this >client id; $client secret = $this >client secret; $access token = $this >access token; $store id = $this >store id; $external id = "exid202402111402271707638098"; $channel id = "ionpaytest"; $refundamount = \[ "value" => "10000 00", "currency" => "idr" ]; $additionalinfo = \[ "canceltype" => "1" ]; $body = \[ "originalreferenceno" => "ncpy20221017161458", "originalpartnerreferenceno" => "ionpaytest08202106091121206416", "partnerrefundno" => "ncpy20221017161458", "merchantid" => $partner id, "externalstoreid" => $store id, "refundamount" => $refundamount, "reason" => "refund trans", "additionalinfo" => $additionalinfo ]; $string to sign = $helper >generatestringtosign( $http method, $this >refund qris 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 ); try { $response = httputil postjsonrequestwithheader($url, $body, $header); } catch (exception $e) { // handle exception } php native $config = nicepay builder() >setisproduction(false) >setprivatekey(" your private key ") >setclientsecret(" your client secret ") >setpartnerid("ionpaytest") >setexternalid("exid202402111402271707638098") >settimestamp("2024 12 31t10 11 40+07 00") >build(); $requestbody = cancel builder() >setoriginalreferenceno("ncpy20221017161458") >setoriginalpartnerreferenceno("ionpaytest08202106091121206416") >setpartnerrefundno("ncpy20221017161458") >setmerchantid("ionpaytest") >setexternalstoreid("nicepay") >setrefundamount("10000 00", "idr") >setreason("refund trans") >setadditionalinfo( \["canceltype" => "1"] ) >build(); $accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; $qrisservice = new snapqrisservice($config); $response = $qrisservice >refund($requestbody, $accesstoken);const val access token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8=" // step 1 initialize the nicepay configuration var config nicepay = nicepay builder() isproduction(false) clientsecret("your client secret") partnerid("ionpaytest") externalid("exid202402111402271707638098") timestamp("2024 12 31t10 11 40+07 00") privatekey("your private key") // placeholder build() // step 2 define the qris refund request body val refundqris snapcancel = snapcancel builder() merchantid("ionpaytest") originalpartnerreferenceno("ionpaytest08202106091121206416") originalreferenceno("ncpy20221017161458") partnerrefundno("ncpy20221017161458") externalstoreid("nicepay") refundamount("10000 00", "idr") reason("refund trans") additionalinfo( mapof( "canceltype" to "1" ) ) build() // step 3 execute the refund val response nicepayresponse? = snapqrisservice refund(refundqris, access token, config) codeigniter $config = nicepay builder() >setisproduction(false) >setiscloudserver(iscloudserver true) >setprivatekey(" your private key ") >setclientsecret(" your client secret ") >setpartnerid("ionpaytest") >setexternalid("exid202402111402271707638098") >settimestamp("2024 12 31t10 11 40+07 00") >build(); $requestbody = refundqris builder() >setoriginalreferenceno("ncpy20221017161458") >setoriginalpartnerreferenceno("ionpaytest08202106091121206416") >setpartnerrefundno("ncpy20221017161458") >setmerchantid("ionpaytest") >setexternalstoreid("nicepay") >setrefundamount("10000 00", "idr") >setreason("refund trans") >setadditionalinfo(\["canceltype" => "1"]) >build(); $accesstoken = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9 eyjzdwiioijjt05qqvlurvnuiiwiaxnzijoitkldrvbbwsisim5hbwuioijcukloiiwizxhwijoimjaync0wmi0xmvqwodowotoznvoifq== aiyblx36dywffvw7dcoenxkoe2eawiyq84ztpuif3k8="; $snapqrisservice = new snapqrisservice($config); try { $response = $snapqrisservice >refund($requestbody, $accesstoken, $config); } catch (\exception $e) { // handle exception } response parameter sample response { "responsecode" "2007800", "responsemessage" "successful", "originalreferenceno" "ncpy20221017161458", "originalpartnerreferenceno" "ionpaytest08202106091121206416", "referenceno" "ionpaytest08202106091121206416", "partnerrefundno" "ncpy20221017161458", "refundamount" { "value" "10000 00", "currency" "idr" }, "refundtime" "2022 07 20t07 15 00+07 00", "additionalinfo" { "canceltrxsn" "07202210051341224326" } }