NICEPAY API
...
Payment API
API Credit Card
Cancel - API Credit Card
8 min
about api credit card cancel this {{api}} uses by {{merchant}} to cancel {{the}} paid {{transaction}} if you cancel before {{the}} settlement {{process}} is complete, then {{the}} {{transaction}} is considered void and {{the}} {{transaction}} funds will be returned to your {{customer}} however, cancellations after {{the}} settlement {{process}} is complete are included in {{the}} refund category {{please}} visit credit card transaction settlement docid 3qalqxg5pvrrg7euemdy {{page}} to find out more about {{the}} terms void or refund api credit card cancel the {{cc}} cancel {{api}} uses to cancel {{the}} {{process}} of {{payment}} s via {{cc}} api end point /nicepay/direct/v2/cancel request method post post header content type application/json merchant token sha256( timestamp + imid + txid + amt + merchantkey ) request parameters for credit card cancel the following is a list of request {{parameter}} s in {{the}} cancel {{cc}} {{api}} to {{process}} cancel {{transaction}} s for {{cc}} {{paymethod}} s this {{parameter}} s uses through {{the}} {{api}} {{testing}} platform parameter type size description example / notes timestamp required required n 14 {{api}} request timestamp 20221214111239 txid required required an 30 transaction id ionpaytest01202212141146401456 imid required required an 10 {{merchant}} id ionpaytest paymethod required required n 2 payment method code docid\ ek 0djw7nuhytcda4sa3p 01 canceltype required required n 2 cancel type code docid\ ly9czdrbjtw3rjv3l7r6v 2 merchanttoken required required an 255 {{merchant}} token ff139e49606387091cd9baeadff3161aff6afd9406e1f481e0fdb8b46d1ae5ae referenceno ans 40 reference number ordno20221214111208 amt required required n 12 {{paymentproduct}} amount 1000 cancelmsg an 255 cancel message cancellation of transaction {{cc}} cancelserverip an 15 server ip 127 0 0 1 canceluserid an 30 user id admin canceluserip an 15 user ip 127 0 0 1 canceluserinfo an 100 user information test cancel cancelretrycnt 	 n 2 retry count 5 worker an 10 worker worker response parameter for credit card cancel the following is a list of response parameter or {{the}} result from {{the}} request parameter for {{cc}} cancel handling 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 ionpaytest01202212141146401456 referenceno ans 40 {{merchant}} order number ordno20221214111208 transdt n 8 transaction date 20221214 transtm n 6 transaction time 114640 amt n 12 amount 5000 cancelreferenceno optional for cc optional for cc an 40 {{merchant}} cancel number ordno20221214111208 acquirerdata only for cc only for cc array 20 a dynamic array consisting of a unique reference number rrn that is provided by {{the}} {{bank}} ing {{partner}} when a refund is {{process}} ed this reference number can be used by {{the}} {{customer}} to track {{the}} {{status}} of {{the}} refund with {{the}} {{bank}} "acquirerdata" { "rrn" "332608321717" } sample json for credit card cancel json request { "timestamp" "20221214111239", "paymethod" "01", "txid" "ionpaytest01202212141146401456", "imid" "ionpaytest", "merchanttoken" "ff139e49606387091cd9baeadff3161aff6afd9406e1f481e0fdb8b46d1ae5ae", "referenceno" "ordno20221214111208", "amt" "5000", "canceltype" "2", "cancelmsg" "cancellation of transaction credit card", "cancelserverip" "127 0 0 1", "canceluserid" "", "canceluserip" "127 0 0 1", "canceluserinfo" "", "cancelretrycnt" "", "worker" "" } json response { "txid" "ionpaytest01202212141146401456", "referenceno" "ordno20221214111208", "resultcd" "0000", "resultmsg" "success", "transdt" "20221214", "transtm" "114640", "amt" "5000", "cancelreferenceno" "ordno20221214111208", } java request //credit card cancel// nicepay settimestamp("20221214111239"); nicepay setpaymethod("01"); nicepay settxid("ionpaytest01202212141146401456"); nicepay setimid("ionpaytest"); nicepay setmerchanttoken(nicepay maketoken(nicepay getmerchanttoken()); nicepay setreferenceno("ordno20221214111208"); nicepay setamt("5000"); nicepay setcanceltype("2"); nicepay setcancelmsg("cancellation of transaction credit card"); nicepay setserverip("127 0 0 1"); //request credit card cancel nicepay cccancel(); // 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 cancelreferenceno = nicepay get("cancelreferenceno"); string amt = nicepay get("amt"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm");