NICEPAY API
...
Payment API
API Virtual Account
Cancel - API Virtual Account
13min
about api virtual account cancel this {{api}} uses by {{merchant}} s to integrate {{the}} cancel {{system}} for {{va}} {{paymethod}} s transaction cancellation happens from either {{the}} {{customer}} side or {{the}} {{merchant}} if {{the}} {{customer}} changes their mind after {{proceed}} ing with {{the}} {{order}} and requests cancellation from {{the}} {{merchant}} before {{proceed}} ing with {{the}} {{payment}} {{process}} if there is a technical or non technical issue when {{the}} {{merchant}} {{process}} es {{the}} {{customer}} 's {{order}} {{merchant}} s can use this {{api}} so that {{the}} {{va}} issue can't be used anymore {{va}} s can only canceled before being paid before {{the}} {{payment}} {{process}} is executed if {{the}} {{customer}} has {{proceed}} ed with {{the}} {{payment}} {{process}} , {{the}} paid bill can't be canceled or refunded to {{the}} {{customer}} through {{api}} api virtual account cancel the {{va}} cancel {{api}} is used for {{the}} cancel {{system}} on {{va}} {{payment}} 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 {{cc}} 02 virtual account virtual account 03 {{cvs}} 04 {{directdebit}} 05 {{ewallet}} 06 {{payloan}} 08 {{qris}} 09 {{gpn}} request parameters for virtual account cancel the following is a list of {{parameter}} s for activating {{the}} cancel {{system}} on {{the}} {{va}} {{paymethod}} these {{parameter}} s are used via {{the}} {{api}} {{testing}} platform parameter type size description example / notes timestamp required required n 14 {{api}} request 20220623100659 txid required required an 30 transaction id normaltest02202212150941111979 imid required required an 10 {{merchant}} id normaltest paymethod required required n 2 payment method code docid\ ek 0djw7nuhytcda4sa3p 02 canceltype required required n 2 cancel type code docid\ ly9czdrbjtw3rjv3l7r6v 1 merchanttoken required required an 255 {{merchant}} token 94acd9768557df77de675b7b97658d6a743cc0675f4eb681c871c4e1b56c0b0f amt required required n 12 {{paymentproduct}} amount 10000 cancelmsg an 255 cancel message testing cancel of {{va}} 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 {{parameter}} response from {{the}} {{parameter}} request results for cancel {{va}} {{integration}} parameter type size description example / notes resultcd n 4 result code docid 2r5sr3xvppu1eju1nitg 0000 resultmsg an 255 result message error code docid 4 fpewlvczfhcvygxwck9 success txid an 30 transaction id normaltest02202212150941111979 when success referenceno ans 40 {{merchant}} 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 {{va}} 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");