NICEPAY API
...
API Virtual Account
Cancel - API Virtual Account
13 min
about api virtual account cancel this uses by s to integrate cancel for s transaction cancellation happens from either side or if changes their mind after ing with and requests cancellation from before ing with if there is a technical or non technical issue when es 's s can use this so that issue can't be used anymore s can only canceled before being paid before is executed if has ed with , paid bill can't be canceled or refunded to through api virtual account cancel the cancel is used for cancel on api endpoint /nicepay/direct/v2/cancel request method post post header content type application/json merchant token sha256( timestamp + imid + txid + amt + merchantkey ) payment methods available for cancel code paymethod 01 02 virtual account virtual account 03 04 05 06 08 09 request parameters for virtual account cancel the following is a list of s for activating cancel on these s are used via platform parameter type size description example / notes timestamp required required n 14 request 20220623100659 txid required required an 30 transaction id normaltest02202212150941111979 imid required required an 10 id normaltest paymethod required required n 2 docid\ ek 0djw7nuhytcda4sa3p 02 canceltype required required n 2 docid\ ly9czdrbjtw3rjv3l7r6v 1 merchanttoken required required an 255 token 94acd9768557df77de675b7b97658d6a743cc0675f4eb681c871c4e1b56c0b0f amt required required n 12 amount 10000 cancelmsg an 255 cancel message testing cancel of preauthtoken an 100 pre auth token d4ef98b26f917a697691807cf cancelserverip an 15 server ip 127 0 0 1 canceluserid an 30 user id canceluserip an 15 user ip 127 0 0 1 canceluserinfo an 100 user information cancelretrycnt 	 n 2 retry count worker an 10 worker response parameters for virtual account cancel the following is a response from request results for cancel parameter type size description example / notes resultcd n 4 docid 2r5sr3xvppu1eju1nitg https //app archbee com/docs/36sm2oxriwwbi9inlqmtp/wpcemazro xvnxz 1zaib 0000 resultmsg an 255 result message docid 4 fpewlvczfhcvygxwck9 success txid an 30 transaction id normaltest02202212150941111979 when success referenceno ans 40 order number ordno20221215091261 when success transdt n 8 transaction date 20221215 when success transtm n 6 transaction time 094111 when success description an 255 description testing cancel of when success amt n 12 amount 10000 when success response parameter for virtual account cancel json request { "timestamp" "20220623100659", "imid" "normaltest", "txid" "normaltest02202212150941111979", "paymethod" "02", "merchanttoken" "94acd9768557df77de675b7b97658d6a743cc0675f4eb681c871c4e1b56c0b0f", "amt" "10000", "canceltype" "1", "cancelmsg" "testing cancel of virtual account", "canceluserid" "", "canceluserip" "127 0 0 1", "cancelserverip" "127 0 0 1", "canceluserinfo" "", "cancelretrycnt" "", "worker" "" } json response { "txid" "normaltest02202212150941111979", "referenceno" "", "resultcd" "0000", "resultmsg" "success", "transdt" "20221215", "transtm" "094111", "description" "testing cancel of virtual account", "amt" "10000" } java request //virtual account cancel// nicepay settimestamp("20220623100659"); nicepay settxid("normaltest02202212150941111979"); nicepay setimid("normaltest"); nicepay setpaymethod("02"); nicepay setmerchanttoken(nicepay maketoken(nicepay getmerchanttoken()); nicepay setamt("10000"); nicepay setcanceltype("1"); nicepay setcancelmsg("testing cancel of virtual account"); nicepay setcanceluserip("127 0 0 1"); nicepay setcancelserverip("127 0 0 1"); //request virtual account cancel nicepay vacancel(); // response string // system out println("final response string " + nicepay getresponsestring()); string resultcd = nicepay get("resultcd"); string resultmsg = nicepay get("resultmsg"); string txid = nicepay get("txid"); string referenceno = nicepay get("referenceno"); string description = nicepay get("description"); string amt = nicepay get("amt"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm");