NICEPAY API
...
V1 Enterprise
Credit Card - V1 Enterprise
56 min
credit card transaction flow request onepasstoken redirect to 3ds / migs {{page}} {{customer}} input otp on 3ds {{page}} {{merchant}} register {{transaction}} {{nicepay}} send {{notification}} credit card flow v1 enterprise {{cc}} flow the {{customer}} does {{checkout}} the {{customer}} requests {{checkout}} from {{merchant}} the {{merchant}} registers {{checkout}} data the {{merchant}} sends response, card data based, to {{customer}} the {{customer}} inputs card data the {{customer}} sends data card data {{information}} to {{merchant}} the {{merchant}} sends request by using regist {{api}} to {{nicepay}} {{nicepay}} saves {{order}} detail {{nicepay}} sends response to {{merchant}} the {{merchant}} requests {{payment}} using {{paymentproduct}} {{api}} to {{nicepay}} {{nicepay}} requests 3ds to {{bank}} {{bank}} verifies {{the}} request {{bank}} sends 3ds url response to {{nicepay}} {{nicepay}} sends authentication {{page}} to {{customer}} the {{bank}} sends otp to {{customer}} the {{customer}} input otp and send {{the}} data to {{bank}} {{bank}} validates otp {{bank}} sends 3ds result to {{nicepay}} {{nicepay}} calculates fds {{nicepay}} requests {{payment}} to {{bank}} {{bank}} {{process}} es {{the}} {{payment}} {{bank}} sends {{payment}} response to {{nicepay}} {{nicepay}} sends {{payment}} {{notification}} using callbackurl and dbprocessurl to {{merchant}} the {{merchant}} receives {{notification}} the {{merchant}} requests {{status}} checking to {{nicepay}} {{nicepay}} sends checking {{status}} response to {{merchant}} the {{merchant}} receives final {{status}} the {{merchant}} sends {{order}} result to {{customer}} request token {{merchant}} need to request onepasstoken for each credit card {{transaction}} using {{api}} v1 enterprise api specifications request token api endpoint /nicepay/api/onepasstoken do request method application/x www form urlencoded application/x www form urlencoded post post description request onepasstoken for {{cc}} transaction merchant token sha256 ( imid + referenceno + amt + merchantkey ) payment methods 01 {{cc}} request parameter request token the parameters below must be sent inside ‘jsondata’ {{parameter}} and formatted as json token request curl location request post 'https //www nicepay co id/nicepay/api/onepasstoken do' \\ \ header 'content type application/x www form urlencoded' \\ \ data urlencode 'jsondata={"imid" "ionpaytest","referenceno" "merchantreferencenumber001","amt" "10000","cardholdernm" "john doe","cardholderemail" "johndoe\@gmail com","cardno" "5123450000000008","cardexpyymm" "3901","merchanttoken" "f5d1a08fd497bf3f39e9a0027c0a6822109903cd95140c36db537b5977fb9652"} parameter type size description example value imid required required an 10 {{merchant}} id ionpaytest merchanttoken required required an 255 {{merchant}} token f5d1a08fd497bf3f39e9a0027c0a6822109903cd95140c36db537b5977fb9652 cardno required required n 16 card number 5123450000000008 cardexpyymm required required n 4 card expiry ( yymm ) 3901 cardholdernm required required an 45 card holder name john doe only alphabet allowed cardholderemail required required ans 100 card holder email johndoe\@gmail com amt required required n 12 {{paymentproduct}} amount 10000 referenceno required required ans 40 {{merchant}} order number merchantreferencenumber001 instmnttype n 2 docid\ pnv6uw k42cisgzemke y 1 instmntmon n 2 installment month 1 response parameter request token sample json response { "resultcd" "0000", "cardtoken" "c3a4e1223361ce6b0ab92d9248152ebeb02ad1a8274ac20599d25da1d755254b", "resultmsg" "success", "paymenttype" "1" } parameter type size description resultcd n 4 docid\ pnv6uw k42cisgzemke y resultmsg an 255 docid\ pnv6uw k42cisgzemke y cardtoken an 64 one time use transaction token paymenttype n 1 cc authorization type kindly check {{the}} paymenttype {{parameter}} from onepasstoken do response this will be needed for {{the}} next step to determine whether to use 3ds or migs paymenttype description 1 3d secure 2 keyin (proceed to registration without 3ds/migs) 3 migs 3ds request proceed with this {{api}} when you get paymenttype = 1 from onepasstoken do response 3ds steps send request parameters to 3ds request {{api}} {{customer}} will be redirect to 3ds {{page}} {{customer}} input otp {{nicepay}} will send response parameter to callbackurl api specification 3ds api endpoint /nicepay/api/secureverequest do method application/x www form urlencoded application/x www form urlencoded pop up pop up or redirect redirect description request 3d {{page}} for paymenttype = 1 merchant token sha256 ( imid + referenceno + amt + merchantkey ) request parameter 3ds https //www nicepay co id/nicepay/api/secureverequest do?country={{country}}\&callbackurl={callbackurl}\&onepasstoken={onepasstoken} parameter type size description example country required required n 3 country 360 callbackurl required required ans 200 callback url http //merchant com/callback onepasstoken required required an 64 one time use {{transaction}} token c5bd0b91bcc3d21358cd004c60e54 579441c23aa8e7553b41ce3402db1113fff response parameter 3ds https //www merchant com/callbackurl?resultcd={resultcd}\&resultmsg={resultmsg}\&referenceno={referenceno}\&merchanttoken={merchanttoken} parameter type size description resultcd n 4 docid logd 07e0vrfugu0nldf resultmsg an 255 docid logd 07e0vrfugu0nldf referenceno ans 40 {{merchant}} order number merchanttoken an 255 {{merchant}} token migs request migs (mastercard internet gateway service) is a {{service}} from mastercard to refund and monitor {{the}} {{transaction}} report based on {{the}} {{transaction}} between {{merchant}} and {{customer}} currently, {{nicepay}} using mpgs (mastercard {{paymentproduct}} gateway service) that {{the}} latest version of migs to increase {{the}} {{transaction}} security with 3ds 2 0 feature although, migs api still used on mpgs {{system}} use this {{api}} if get paymenttype = 3 from onepasstoken do response steps send request parameters to migs request {{api}} {{customer}} will be redirect to migs {{page}} {{customer}} input otp {{nicepay}} will send response parameter to callbackurl api specifications migs api url /nicepay/api/migsrequest do request method application/x www form urlencoded application/x www form urlencoded post post or redirect redirect description request migs {{page}} for paymenttype = 3 merchant token sha256 ( imid + referenceno + amt + merchantkey ) payment methods 01 {{cc}} request parameter migs sample url parameter migs request https //www nicepay co id/nicepay/api/migsrequest do?instmnttype=1\&instmntmon=1\&referenceno={referenceno}\&cardcvv={cardcvv}\&callbackurl={callbackurl}\&onepasstoken={onepasstoken} parameter type size description example instmnttype required required n 2 docid logd 07e0vrfugu0nldf 1 instmntmon n 2 installment month 1 referenceno required required ans 40 {{merchant}} order number merchantreferencenumber001 cardcvv n 3 card cvv 100 callbackurl required required ans 200 callback url for result http //merchant com/callbackurl onepasstoken required required an 64 one time use transaction token d12b153b3dd50b1875e64ac17288a7cd33fd5511cf01924cac2ca7f345de8f08 response parameter migs sample url parameter migs response https //www merchant com/callbackurl?resultcd={resultcd}\&resultmsg={resultmsg}\&referenceno={referenceno}\&merchanttoken={merchanttoken} parameter type size description resultcd n 4 docid logd 07e0vrfugu0nldf resultmsg an 255 docid logd 07e0vrfugu0nldf credit card payment api specifications credit card payment api endpoint /nicepay/api/onepass do request method application/x www form urlencoded application/x www form urlencoded post post description register transaction and charge {{cc}} using onepasstoken merchant token sha256 ( imid + referenceno + amt + merchantkey ) payment methods 01 {{cc}} request parameter credit card registration sample api payment imid "ionpaytest" paymethod "01" currency "idr" amt "10000" referenceno "merchantreferencenumber001" goodsnm "merchant goods 1" billingnm "john doe" billingphone "08123456789" billingemail "john doe\@example com" billingaddr "jln raya kasablanka kav 88" billingcity "south jakarta" billingstate "dki jakarta" billingpostcd "10200" billingcountry "indonesia" callbackurl "https //www merchant com/callbackurl/" dbprocessurl "https //www merchant com/dbprocessurl/" description "this is the description of the payment" merchanttoken "2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1" userip " 1" cartdata "{}" instmnttype "1" instmntmon "1" onepasstoken "9338d54573688ae18e175240b0257de48d89c6ef1c9c7b5c094dc4beed9e435f" cardcvv "100" recurropt "1" sample java request credi card // payment mandatory field nicepay setpaymethod("01"); nicepay setcurrency("idr"); nicepay setamt("10000"); nicepay setinstmntmon("1"); nicepay setreferenceno("merchantreferencenumber001"); nicepay setgoodsnm("merchant goods 1"); nicepay setbillingnm("john doe"); nicepay setbillingemail("john doe\@example com"); nicepay setbillingphone("08123456789"); nicepay setbillingaddr("jln raya kasablanka kav 88"); nicepay setbillingcity("south jakarta"); nicepay setbillingstate("dki jakarta"); nicepay setbillingpostcd("10200"); nicepay setbillingcountry("indonesia"); nicepay setdeliverynm("merchant's name"); nicepay setdeliveryphone("08123456789"); nicepay setdeliveryaddr("jln dr saharjo no 88"); nicepay setdeliverycity("south jakarta"); nicepay setdeliverystate("dki jakarta"); nicepay setdeliverypostcd("10201"); nicepay setdeliverycountry("indonesia"); nicepay setcallbackurl(merchantdomain + "callback"); nicepay setdbprocessurl(merchantdomain + "dbprocess"); nicepay setvat("0"); nicepay setfee("0"); nicepay setnotaxamt("0"); nicepay setdescription("this is the description of the payment"); nicepay setuserip("127 0 0 1"); nicepay setmerchanttoken(nicepay maketoken(nicepay getamt(), nicepay getreferenceno())); nicepay setcartdata("{}"); nicepay setinstmntmon("1"); nicepay setinstmnttype("1"); nicepay setrecurropt("1"); // for recurring only nicepay setcardcvv("100"); nicepay setonepasstoken("9338d54573688ae18e175240b0257de48d89c6ef1c9c7b5c094dc4beed9e435f"); nicepay setcardexpyymm("3901") // payment optional field nicepay setreqdt("20230516"); nicepay setreqtm("135959"); nicepay setreqdomain("merchant com"); nicepay setreqserverip("127 0 0 1"); nicepay setreqclientver("1 0"); nicepay setusersessionid("usersessionid"); nicepay setuseragent("mozilla"); nicepay setuserlanguage("en us"); nicepay setmerfixacctid("00000001"); nicepay setpaymentexpirydt("20230531"); nicepay setpaymentexpirytm("235959"); // payment request nicepay payment(); // payment response system out println("response string " + nicepay getresponsestring()); // json in string format string cctranstype = nicepay get("cctranstype"); string fee = nicepay get("fee"); string txid = nicepay get("txid"); string description = nicepay get("description"); string notaxamt = nicepay get("notaxamt"); string cardno = nicepay get("cardno"); string issubankcd = nicepay get("issubankcd"); string cardexpyymm = nicepay get("cardexpyymm"); string acqubanknm = nicepay get("acqubanknm"); string paymethod = nicepay get("paymethod"); string callbackurl = nicepay get("callbackurl"); string instmntmon = nicepay get("instmntmon"); string currency = nicepay get("currency"); string issubanknm = nicepay get("issubanknm"); string resultcd = nicepay get("resultcd"); string amount = nicepay get("amount"); string goodsnm = nicepay get("goodsnm"); string referenceno = nicepay get("referenceno"); string transtm = nicepay get("transtm"); string authno = nicepay get("authno"); string recurringtoken = nicepay get("recurringtoken"); //only for recurring string preauthtoken = nicepay get("preauthtoken"); //only for pre auth string vat = nicepay get("vat"); string instmnttype = nicepay get("instmtntype"); string resultmsg = nicepay get("resultmsg"); string billingnm = nicepay get("billingnm"); string acqubankcd = nicepay get("acqubankcd"); string transdt = nicepay get("transdt"); parameter type size description example / notes imid required required an 2 {{merchant}} id ionpaytest paymethod required required n 2 docid logd 07e0vrfugu0nldf 01 currency required required a 40 currency idr amt required required n 12 goods amount 10000 referenceno required required ans 40 {{merchant}} order number merchantreferencenumber001 goodsnm required required an 100 goods name {{merchant}} goods 1 billingnm required required a 30 billing name john doe billingphone required required n 15 billing phone number 08123456789 billingemail required required ans 40 billing e mail john doe\@example com billingcity required required n 50 billing city south jakarta billingstate required required a 50 billing state dki jakarta billingpostcd required required n 10 billing post number 10200 billingcountry required required a 10 billing country {{indonesia}} callbackurl required required ans 255 {{paymentproduct}} result forward url (on browser) https //www mechant com/callbackurl dbprocessurl required required ans 255 {{paymentproduct}} result receive url (server side) https //www merchant com/dbprocessurl description required required an 100 description this is the description of the {{paymentproduct}} merchanttoken required required an 255 {{merchant}} token 2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1 userip required required ans 15 user ip 127 0 0 1 cartdata required required ans 4000 cart data (json format) {} instmnttype required required n 2 docid logd 07e0vrfugu0nldf 1 instmntmon required required n 2 installment month 1 cardcvv n 3 card cvv 100 onepasstoken required required an one time use transaction token 9338d54573688ae18e175240b0257de48d89c6ef1c9c7b5c094dc4beed9e435f recurropt required for recurring cc required for recurring cc n 2 0 automatic cancel 1 do not cancel 2 do not make token 1 billingaddr an 255 billing address jln raya kasablanka kav 88 deliverynm a 30 delivery name {{merchant}} 's name deliveryphone n 15 delivery phone 08123456789 deliveryaddr an 100 delivery address jln dr saharjo no 88 deliveryemail an 100 delivery e mail example\@merchant com deliverycity a 50 delivery city south jakarta deliverystate a 50 delivery state dki jakarta deliverypostcd n 10 delivery post number 10201 deliverycountry a a delivery country {{indonesia}} vat n 12 {{vat}} 0 fee n 12 service tax 0 notaxamt n 12 tax free amount 0 reqdt n n request date ( yyyymmdd ) 20230516 reqtm n n request time ( hh24miss ) 135959 reqdomain ans 100 request domain www merchant com reqserverip ans 15 request server ip 127 0 0 1 reqclientver ans 50 request client version 1 0 usersessionid an 100 user session id usersessionid useragent ans 100 user agent information mozilla userlanguage ans 2 user language en us response parameter credit card payment sample respone payment { "cctranstype" "1", "fee" null, "txid" "ionpaytest01202305162316067832", "description" "description", "notaxamt" null, "cardno" "51234500 0008", "issubankcd" "cena", "preauthtoken" null, "cardexpyymm" "3901", "acqubanknm" "cimb", "paymethod" "01", "callbackurl" "https //www merchant com/callback/", "instmntmon" "1", "currency" "idr", "issubanknm" "bca", "resultcd" "0000", "amount" "10000", "goodsnm" "merchant goods 1", "referenceno" "merchantreferencenumber001", "transtm" "231641", "authno" "041385", "recurringtoken" "88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a" //only for recurring, "preauth" "c2921cc7a1967f905fd4f895f22f06c02d24adf8c9f7b169d6ef0c2c0b128549" //only for preauth, "vat" null, "instmnttype" "1", "resultmsg" "success", "billingnm" "john doe", "acqubankcd" "bnia", "transdt" "20230516" } parameter type size description resultcd n 4 docid logd 07e0vrfugu0nldf resultmsg an 255 docid logd 07e0vrfugu0nldf txid an 30 transaction id referenceno ans 40 {{merchant}} order number paymethod n 2 docid logd 07e0vrfugu0nldf amount n 12 transaction amount currency an 3 currency goodsnm n 100 goods name billingnm n 30 buyer name transdt n 8 transaction date ( yyyymmdd ) transtm n 6 transaction time ( hh24miss ) description an 100 transaction description callbackurl ans 100 callback url authno n 10 authorization number issubankcd a 4 docid logd 07e0vrfugu0nldf issubanknm a 255 issuing {{bank}} name acqubankcd a 4 docid logd 07e0vrfugu0nldf acqubanknm a 255 acquiring {{bank}} name cardno ans 20 card number (masked) instmntmon n 2 installment month instmnttype n 2 installment type recurringtoken an 64 token for recurring {{paymentproduct}} preauthtoken an 64 token for preauth {{paymentproduct}} cctranstype n 2 docid 7pas vd5ylg4vdurmygwo vat n 12 {{vat}} number fee n 12 service fee notaxamt n 12 tax free amount credit card recurring when {{the}} {{merchant}} signs contract as recurring , {{nicepay}} give a recurringtoken to {{the}} {{paymentproduct}} {{api}} response the {{merchant}} can use recurringtoken for {{the}} next {{paymentproduct}} {{api}} request without input card detail, except cardcvv (mandatory) recurring issue to do {{the}} recurring {{payment}} , {{the}} {{system}} need recurringtoken own from {{the}} {{customer}} to use {{the}} {{customer}} {{information}} continuously without reinputting {{the}} card data multiple times recurringtoken receives after {{the}} {{customer}} {{proceed}} s {{the}} initial {{payment}} following are {{the}} steps to get {{the}} recurringtoken the {{customer}} will input {{the}} data card such as cardno and exymmyy through {{api}} request token ( onepasstoken do ) the {{customer}} will get cardtoken recurring {{payment}} {{process}} on v1 enterprise divide into 2 {{process}} , direct 3ds and direct non 3ds if going through {{the}} 3ds {{process}} , then {{the}} card data will going through {{the}} security verification from {{api}} 3ds request ( secureverequest do ) with an otp also fds ( fraud detection system ) {{nicepay}} security if not going through 3ds {{process}} , then will not going through {{the}} security verification the {{customer}} does {{payment}} with {{api}} {{cc}} {{paymentproduct}} ( onepass do ) and get recurringtoken to {{proceed}} {{the}} recurring {{payment}} api specification recurring issue api endpoint /nicepay/api/recurringtoken do request method application/x www form urlencoded application/x www form urlencoded post post description recurringtoken do almost similar to onepasstoken do {{the}} difference whether use {{the}} card info or recurring token merchant token sha256 ( merchant id + reference number + amount + merchant key ) request parameter recurring issue the {{parameter}} below must send on ' jsondata ' {{parameter}} and with json format sample request recurring issue curl location request post 'https //www nicepay co id/nicepay/api/onepasstoken do' \\ \ header 'content type application/x www form urlencoded' \\ \ data urlencode 'jsondata={"imid" "ionpaytest","merchanttoken" "baf19eaed10d8539498cbe06ed19c50a60a587416d9c980abbb3c06b4eee51f5","referenceno" "merchantreferencenumber001","amt" "10000","recurringtoken" "88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a","instmnttype" "1","instmntmon" "1"}' parameter type size description example / notes amt required required n 12 amount 10000 referenceno required required an 40 {{merchant}} order number merchantreferencenumber001 merchanttoken required required an 255 {{merchant}} token baf19eaed10d8539498cbe06ed19c50a60a587416d9c980abbb3c06b4eee51f5 imid required required an 10 {{merchant}} id ionpaytest recurringtoken required required an 100 recurring token 88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a instmnttype required required an 2 docid logd 07e0vrfugu0nldf 1 instmntmon required required n 2 installment month 1 cardholdernm required required an 45 card holder name john doe only alphabet allowed cardholderemail required required ans 100 card holder email johndoe\@gmail com response parameter recurring issue sample response parameter { "resultcd" "0000", "cardtoken" "9338d54573688ae18e175240b0257de48d89c6ef1c9c7b5c094dc4beed9e435f", "resultmsg" "success", "paymenttype" "1" } parameter type size description remark resultcd n 4 docid logd 07e0vrfugu0nldf 0000 resultmsg an 255 docid logd 07e0vrfugu0nldf success cardtoken an 64 recurring token c954f03ef83a363f94fa26bef6ec4d08fa7693590a735386fcce6e2ef1caae8a paymenttype an 1 docid logd 07e0vrfugu0nldf 1 3ds 2 keyin recurring payment after get {{the}} recurringtoken from {{the}} initial {{payment}} success or result from card registration {{process}} , {{the}} {{system}} will use that recurringtoken to execute {{the}} next schedule following is {{the}} {{payment}} steps on {{the}} {{system}} using {{the}} recurringtoken {{input}} recurringtoken gain from {{the}} initial {{payment}} {{process}} ( recurringtoken do ) or {{the}} result from card registration {{process}} ( tokenize do ) next, cardtoken will gain and save on {{the}} database to use on {{the}} next {{payment}} special for {{the}} 3ds {{process}} , card data will go through {{the}} security verification from {{api}} 3ds request ( secureverequest do ) with an otp also fds (fraud detection system) {{nicepay}} security using cardtoken gain from {{the}} previous step the {{payment}} will {{proceed}} using {{api}} recurring {{paymentproduct}} ( recurringtrans do ) this {{process}} will {{proceed}} continuously on {{the}} recurring period on {{the}} next recurring {{payment}} , recurringtoken will originate from recurringtoken do onepass do only use during {{the}} first recurring {{payment}} api specifications recurring payment api endpoint /nicepay/api/recurringtrans do method application/x www form urlencoded application/x www form urlencoded post post merchant token sha256( merchant id + reference number + amount + merchantkey ) description the {{api}} {{paymentproduct}} for {{cc}} recurring or {{payment}} with recurring token request parameter recurring payment sample request recurring payment imid "ionpaytest" paymethod "01" currency "idr" amt "10000" referenceno "merchantreferencenumber001" goodsnm "merchant goods 1" billingnm "john doe" billingphone "08123456789" billingemail "john doe\@example com" billingaddr "jln raya kasablanka kav 88" billingcity "south jakarta" billingstate "dki jakarta" billingpostcd "10200" billingcountry "indonesia" callbackurl "https //www merchant com/callbackurl/" dbprocessurl "https //www merchant com/dbprocessurl/" description "this is the description of the payment" merchanttoken "2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1" userip " 1" cartdata "{}" instmnttype "1" instmntmon "1" recurringtoken "88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a" cardcvv "100" recurropt "1" sample java request recurring paymen // payment mandatory field nicepay setpaymethod("01"); nicepay setcurrency("idr"); nicepay setamt("10000"); nicepay setinstmntmon("1"); nicepay setreferenceno("merchantreferencenumber001"); nicepay setgoodsnm("merchant goods 1"); nicepay setbillingnm("john doe"); nicepay setbillingemail("john doe\@example com"); nicepay setbillingphone("08123456789"); nicepay setbillingaddr("jln raya kasablanka kav 88"); nicepay setbillingcity("south jakarta"); nicepay setbillingstate("dki jakarta"); nicepay setbillingpostcd("10200"); nicepay setbillingcountry("indonesia"); nicepay setdeliverynm("merchant's name"); nicepay setdeliveryphone("08123456789"); nicepay setdeliveryaddr("jln dr saharjo no 88"); nicepay setdeliverycity("south jakarta"); nicepay setdeliverystate("dki jakarta"); nicepay setdeliverypostcd("10201"); nicepay setdeliverycountry("indonesia"); nicepay setcallbackurl(merchantdomain + "callback"); nicepay setdbprocessurl(merchantdomain + "dbprocess"); nicepay setvat("0"); nicepay setfee("0"); nicepay setnotaxamt("0"); nicepay setdescription("this is the description of the payment"); nicepay setuserip("127 0 0 1"); nicepay setmerchanttoken(nicepay maketoken(nicepay getamt(), nicepay getreferenceno())); nicepay setcartdata("{}"); nicepay setinstmntmon("1"); nicepay setinstmnttype("1"); nicepay setrecurropt("1"); // for recurring only nicepay setcardcvv("100"); nicepay setrecurringtoken("88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a"); nicepay setcardexpyymm("3901") // payment optional field nicepay setreqdt("20230516"); nicepay setreqtm("135959"); nicepay setreqdomain("merchant com"); nicepay setreqserverip("127 0 0 1"); nicepay setreqclientver("1 0"); nicepay setusersessionid("usersessionid"); nicepay setuseragent("mozilla"); nicepay setuserlanguage("en us"); nicepay setmerfixacctid("00000001"); nicepay setpaymentexpirydt("20230531"); nicepay setpaymentexpirytm("235959"); // payment request nicepay payment(); // payment response system out println("response string " + nicepay getresponsestring()); // json in string format string cctranstype = nicepay get("cctranstype"); string fee = nicepay get("fee"); string txid = nicepay get("txid"); string description = nicepay get("description"); string notaxamt = nicepay get("notaxamt"); string cardno = nicepay get("cardno"); string issubankcd = nicepay get("issubankcd"); string cardexpyymm = nicepay get("cardexpyymm"); string acqubanknm = nicepay get("acqubanknm"); string paymethod = nicepay get("paymethod"); string callbackurl = nicepay get("callbackurl"); string instmntmon = nicepay get("instmntmon"); string currency = nicepay get("currency"); string issubanknm = nicepay get("issubanknm"); string resultcd = nicepay get("resultcd"); string amount = nicepay get("amount"); string goodsnm = nicepay get("goodsnm"); string referenceno = nicepay get("referenceno"); string transtm = nicepay get("transtm"); string authno = nicepay get("authno"); string vat = nicepay get("vat"); string instmnttype = nicepay get("instmtntype"); string resultmsg = nicepay get("resultmsg"); string billingnm = nicepay get("billingnm"); string acqubankcd = nicepay get("acqubankcd"); string transdt = nicepay get("transdt"); parameter type size description example / notes imid required required an 2 {{merchant}} id ionpaytest paymethod required required n 2 docid logd 07e0vrfugu0nldf 01 currency required required a 40 currency idr amt required required n 12 goods amount 10000 referenceno required required ans 40 {{merchant}} order number merchantreferencenumber001 goodsnm required required an 100 goods name {{merchant}} goods 1 billingnm required required a 30 billing name john doe billingphone required required n 15 billing phone number 08123456789 billingemail required required ans 40 billing e mail john doe\@example com billingcity required required n 50 billing city south jakarta billingstate required required a 50 billing state dki jakarta billingpostcd required required n 10 billing post number 10200 billingcountry required required a 10 billing country {{indonesia}} callbackurl required required ans 255 {{paymentproduct}} result forward url (on browser) https //www mechant com/callbackurl dbprocessurl required required ans 255 {{paymentproduct}} result receive url (server side) https //www merchant com/dbprocessurl description required required an 100 description this is the description of the {{paymentproduct}} merchanttoken required required an 255 {{merchant}} token 2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1 userip required required ans 15 user ip 127 0 0 1 cartdata required required ans 4000 cart data (json format) {} instmnttype required required n 2 docid logd 07e0vrfugu0nldf 1 instmntmon required required n 2 installment month 1 cardcvv n 3 card cvv 100 recurringtoken required required an 64 recurring token 88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a recurropt required for recurring cc required for recurring cc n 2 0 automatic cancel 1 do not cancel 2 do not make token 1 billingaddr an 255 billing address jln raya kasablanka kav 88 deliverynm a 30 delivery name {{merchant}} 's name deliveryphone n 15 delivery phone 08123456789 deliveryaddr an 100 delivery address jln dr saharjo no 88 deliveryemail ans 100 delivery e mail example\@merchant com deliverycity a 50 delivery city south jakarta deliverystate a 50 delivery state dki jakarta deliverypostcd n 10 delivery post number 10201 deliverycountry a a delivery country {{indonesia}} vat n 12 {{vat}} 0 fee n 12 service tax 0 notaxamt n 12 tax free amount 0 reqdt n n request date ( yyyymmdd ) 20230516 reqtm n n request time ( hh24miss ) 135959 reqdomain ans 100 request domain www merchant com reqserverip ans 15 request server ip 127 0 0 1 reqclientver ans 50 request client version 1 0 usersessionid an 100 user session id usersessionid useragent ans 100 user agent information mozilla userlanguage ans 2 user language en us response parameter recurring payment sample response recurring payment { "issubanknm" "bca", "resultcd" "0000", "amount" "10000", "cctranstype" "2", "authno" "048797", "referenceno" "merchantreferencenumber001", "transtm" "224646", "fee" null, "vat" null, "txid" "ionpaytest01202305212240279260", "description" "this is the description of the payment", "notaxamt" null, "cardno" "51234500 0008", "issubankcd" "cena", "instmnttype" "1", "resultmsg" "success", "acqubankcd" "bnia", "cardexpyymm" "3901", "acqubanknm" "cimb", "paymethod" "01", "callbackurl" "https //www merchant com/callbackurl/", "instmntmon" "1", "transdt" "20230516" } parameter type size description resultcd n 4 docid logd 07e0vrfugu0nldf resultmsg an 255 docid logd 07e0vrfugu0nldf txid an 30 transaction id referenceno ans 40 {{merchant}} order number paymethod n 2 docid logd 07e0vrfugu0nldf amount n 12 transaction amount currency an 3 currency goodsnm n 100 goods name billingnm n 30 buyer name transdt n 8 transaction date ( yyyymmdd ) transtm n 6 transaction time ( hh24miss ) description an 100 transaction description callbackurl ans 100 callback url authno n 10 authorization number issubankcd a 4 docid logd 07e0vrfugu0nldf issubanknm a 255 issuing {{bank}} name acqubankcd a 4 docid logd 07e0vrfugu0nldf acqubanknm a 255 acquiring {{bank}} name cardno ans 20 card number (masked) instmntmon n 2 installment month instmnttype n 2 docid\ pnv6uw k42cisgzemke y cctranstype n 2 {{cc}} transaction type vat n 12 {{vat}} number fee n 12 service fee notaxamt n 12 tax free amount generate recurring token without first payment this {{api}} uses specific on {{cc}} with recurring type to create {{the}} recurringtoken without doing {{the}} {{payment}} {{transaction}} {{process}} beforehand, but only going through {{the}} card {{information}} registration {{process}} recurringtoken that created successfully can be used for {{transaction}} {{process}} ( recurringtrans do ) api specification generate recurring token without first payment api endpoint /nicepay/api/tokenize do method application/x www form urlencoded application/x www form urlencoded post post description to generate {{cc}} 's recurring token without {{proceed}} through {{the}} {{payment}} {{process}} beforehand merchant token sha256 ( merchant id + card no + card exp yymm + merchant key ) request parameter generate recurring token sample java request generate recurring token // request mandatory field nicepay setimid("ionpaytest"); nicepay setcardno ("5289190008221516"); nicepay setcardexpyymm ("2012"); nicepay setbillingnm("anyone"); nicepay setmerchanttoken(nicepay maketoken(nicepay getcardno(), nicepay getcardexpyymm())); // optional field nicepay setcardholdernm("john doe"); nicepay setcardholderemail("jhondoe\@gmail com"); // payment response system out println("response string " + nicepay getresponsestring()); // json in string format string resultcd = nicepay get("resultcode"); string resultmsg = nicepay get("resultmsg"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); string recurringtoken = nicepay get("recurringtoken"); parameter ty pe size description contoh / catatan imid required required an 10 {{merchant}} id ionpaytest merchanttoken required required an 255 {{merchant}} token b63d66156715bf8c9d851e76 e61a42ce7efb815a91843b75 35c5bcde8490cb4d cardno required required n 16 card number 552103 6573 cardexpyymm required required n 4 card expired yy/mm 2012 billingnm required required a 30 billing name john doe cardholdernm required required an 45 card holder name john doe cardholderemail required required ans 100 cardholder email johndoe\@gmail com response parameter generate recurring token sample java response generate recurring token string resultcd = nicepay get("resultcode"); string resultmsg = nicepay get("resultmsg"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); string recurringtoken = nicepay get("recurringtoken"); parameter type size description example / notes resultcode n 4 docid logd 07e0vrfugu0nldf 0000 resultmsg an 255 result message success transdt n 8 transaction date 20180604 when success transtm n 6 transaction time 141806 when success recurringtoken an 10 recurring token 75d5220c439b83359ed440ab 12b713ed273feb455cc278fe0 0209e57dfe84cjk when success check recurring token api specification check recurring token api endpoint /nicepay/api/checktoken do method application/x www form urlencoded application/x www form urlencoded post post merchant token sha256( merchant id + recurring token + merchantkey ) deskripsi to check {{the}} recurring token on {{cc}} {{payment}} request parameter check recurring token sample java request check recurring token // request mandatory field nicepay setimid("ionpaytest"); nicepay setrecurringtoken("f46225e4bb06745ef2e238ddb65ceab1ba4556578bf3b3452964e488f0c8ec36"); nicepay setmerchanttoken(nicepay maketoken(nicepay getrecurringtoken())); // payment response system out println("response string " + nicepay getresponsestring()); // json in string format string resultcd = nicepay get("resultcode"); string resultmsg = nicepay get("resultmsg"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); string recurringtoken = nicepay get("recurringtoken"); string billingnm= nicepay get("billingnm"); string billingemail = nicepay get("billingemail"); parameter type size description example / notes imid required required an 10 {{merchant}} id ionpaytest merchanttoken required required an 64 {{merchant}} token b63d66156715bf8c9d851e76 e61a42ce7efb815a91843b75 35c5bcde8490cb4d recurringtoken required required an 64 recurring token 75d5220c439b83359ed440ab 12b713ed273feb455cc278fe0 0209e57dfe84c7a response parameter check recurring token sample java response check recurring token string resultcd = nicepay get("resultcode"); string resultmsg = nicepay get("resultmsg"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); string recurringtoken = nicepay get("recurringtoken"); string billingnm= nicepay get("billingnm"); string billingemail = nicepay get("billingemail"); parameter type size description example / notes resultcode required required n 4 docid logd 07e0vrfugu0nldf 0000 resultmsg required required an 255 result message success transdt required required n 8 transaction date 20180604 transtm required required n 6 transaction time 141806 when success recurringtoken required required an 60 authorization number 75d5220c439b83359ed440ab 12b713ed273feb455cc278fe0 0209e57dfe84cjk when success billingemail required required an 40 billing email when success billingnm required required a 30 billing name when success remove recurring token api specification remove recurring token api endpoint /nicepay/api/removetoken do method application/x www form urlencoded application/x www form urlencoded post post merchant token sha256( merchant id + recurring token + merchantkey ) deskripsi to remove {{the}} recurring token on {{cc}} {{payment}} request parameter remove recurring token sample java request remove recurring token // request mandatory field nicepay setimid("ionpaytest"); nicepay setrecurringtoken("f46225e4bb06745ef2e238ddb65ceab1ba4556578bf3b3452964e488f0c8ec36"); nicepay setmerchanttoken(nicepay maketoken(nicepay getrecurringtoken())); // payment response system out println("response string " + nicepay getresponsestring()); // json in string format string resultcd = nicepay get("resultcode"); string resultmsg = nicepay get("resultmsg"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); parameter type size description example / notes imid required required an 10 {{merchant}} id ionpaytest merchanttoken required required an 64 {{merchant}} token b63d66156715bf8c9d851e76 e61a42ce7efb815a91843b75 35c5bcde8490cb4d recurringtoken required required an 64 recurring token 75d5220c439b83359ed440ab 12b713ed273feb455cc278fe0 0209e57dfe84c7a response parameter remove recurring token sample java response remove recurring token string resultcd = nicepay get("resultcode"); string resultmsg = nicepay get("resultmsg"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); parameter type size description example / notes resultcode n 4 docid logd 07e0vrfugu0nldf 0000 resultmsg an 255 result message success transdt n 8 transaction date 20180604 when success transtm n 6 transaction time 141806 when success credit card pre auth to do pre auth & capture {{payment}} , {{the}} {{system}} need preauthtoken to {{proceed}} {{the}} capture {{process}} that {{process}} only can {{proceed}} during {{the}} preauthtoken validity period following are {{the}} {{payment}} steps on {{the}} {{system}} using pre auth token the {{customer}} will input {{the}} data card such as cardno and exymmyy through {{api}} request token ( onepasstoken do ) the {{customer}} will get cardtoken the pre auth {{process}} on v1 enterprise divides into 2 {{process}} es, direct 3ds, and direct non 3ds if going through {{the}} 3ds {{process}} , then {{the}} card data will go through {{the}} security verification from {{api}} 3ds request ( secureverequest do) with an otp also fds (fraud detection system) {{nicepay}} security if not go through {{the}} 3ds {{process}} , then will not go through {{the}} security verification the {{customer}} does a {{payment}} with {{api}} {{cc}} {{paymentproduct}} ( onepass do ) the {{system}} does hold {{process}} and gets preauthtoken to {{proceed}} with {{the}} {{process}} the capture amount {{process}} will use {{api}} pre auth (capturetrans do) by input preauthtoken and cvv if preauthtoken expired, then {{payment}} will become void and {{the}} balance will refund to {{the}} {{customer}} api specification pre auth api endpoint /nicepay/api/capturetrans do method application/x www form urlencoded application/x www form urlencoded post post merchant token sha256( merchant id + reference number + amount + merchantkey ) deskripsi {{api}} {{paymentproduct}} for {{cc}} pre auth using preauthtoken request parameter pre auth sample request pre auth imid "ionpaytest" paymethod "01" currency "idr" amt "10000" referenceno "merchantreferencenumber001" goodsnm "merchant goods 1" billingnm "john doe" billingphone "08123456789" billingemail "john doe\@example com" billingaddr "jln raya kasablanka kav 88" billingcity "south jakarta" billingstate "dki jakarta" billingpostcd "10200" billingcountry "indonesia" callbackurl "https //www merchant com/callbackurl/" dbprocessurl "https //www merchant com/dbprocessurl/" description "this is the description of the payment" merchanttoken "2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1" userip " 1" cartdata "{}" instmnttype "1" instmntmon "1" preauthtoken "c2921cc7a1967f905fd4f895f22f06c02d24adf8c9f7b169d6ef0c2c0b128549" sample java request pre auth // payment mandatory field nicepay setpaymethod("01"); nicepay setcurrency("idr"); nicepay setamt("10000"); nicepay setinstmntmon("1"); nicepay setreferenceno("merchantreferencenumber001"); nicepay setgoodsnm("merchant goods 1"); nicepay setbillingnm("john doe"); nicepay setbillingemail("john doe\@example com"); nicepay setbillingphone("08123456789"); nicepay setbillingaddr("jln raya kasablanka kav 88"); nicepay setbillingcity("south jakarta"); nicepay setbillingstate("dki jakarta"); nicepay setbillingpostcd("10200"); nicepay setbillingcountry("indonesia"); nicepay setdeliverynm("merchant's name"); nicepay setdeliveryphone("08123456789"); nicepay setdeliveryaddr("jln dr saharjo no 88"); nicepay setdeliverycity("south jakarta"); nicepay setdeliverystate("dki jakarta"); nicepay setdeliverypostcd("10201"); nicepay setdeliverycountry("indonesia"); nicepay setcallbackurl(merchantdomain + "callback"); nicepay setdbprocessurl(merchantdomain + "dbprocess"); nicepay setvat("0"); nicepay setfee("0"); nicepay setnotaxamt("0"); nicepay setdescription("this is the description of the payment"); nicepay setuserip("127 0 0 1"); nicepay setmerchanttoken(nicepay maketoken(nicepay getamt(), nicepay getreferenceno())); nicepay setcartdata("{}"); nicepay setinstmntmon("1"); nicepay setinstmnttype("1"); nicepay setcardcvv("100"); nicepay setpreauthtoken("c2921cc7a1967f905fd4f895f22f06c02d24adf8c9f7b169d6ef0c2c0b128549"); nicepay setcardexpyymm("3901") // payment optional field nicepay setreqdt("20230516"); nicepay setreqtm("135959"); nicepay setreqdomain("merchant com"); nicepay setreqserverip("127 0 0 1"); nicepay setreqclientver("1 0"); nicepay setusersessionid("usersessionid"); nicepay setuseragent("mozilla"); nicepay setuserlanguage("en us"); nicepay setmerfixacctid("00000001"); nicepay setpaymentexpirydt("20230531"); nicepay setpaymentexpirytm("235959"); // payment request nicepay payment(); // payment response system out println("response string " + nicepay getresponsestring()); // json in string format string cctranstype = nicepay get("cctranstype"); string fee = nicepay get("fee"); string txid = nicepay get("txid"); string description = nicepay get("description"); string notaxamt = nicepay get("notaxamt"); string cardno = nicepay get("cardno"); string issubankcd = nicepay get("issubankcd"); string cardexpyymm = nicepay get("cardexpyymm"); string acqubanknm = nicepay get("acqubanknm"); string paymethod = nicepay get("paymethod"); string callbackurl = nicepay get("callbackurl"); string instmntmon = nicepay get("instmntmon"); string currency = nicepay get("currency"); string issubanknm = nicepay get("issubanknm"); string resultcd = nicepay get("resultcd"); string amount = nicepay get("amount"); string goodsnm = nicepay get("goodsnm"); string referenceno = nicepay get("referenceno"); string transtm = nicepay get("transtm"); string authno = nicepay get("authno"); string recurringtoken = nicepay get("recurringtoken"); //only for recurring string preauthtoken = nicepay get("preauthtoken"); //only for pre auth string vat = nicepay get("vat"); string instmnttype = nicepay get("instmtntype"); string resultmsg = nicepay get("resultmsg"); string billingnm = nicepay get("billingnm"); string acqubankcd = nicepay get("acqubankcd"); string transdt = nicepay get("transdt"); parameter type size description example / notes imid required required an 2 {{merchant}} id ionpaytest paymethod required required n 2 docid logd 07e0vrfugu0nldf 01 currency required required a 40 currency idr amt required required n 12 goods amount 10000 referenceno required required ans 40 {{merchant}} order number merchantreferencenumber001 goodsnm required required an 100 goods name {{merchant}} goods 1 billingnm required required a 30 billing name john doe billingphone required required n 15 billing phone number 08123456789 billingemail required required ans 40 billing e mail john doe\@example com billingcity required required n 50 billing city south jakarta billingstate required required a 50 billing state dki jakarta billingpostcd required required n 10 billing post number 10200 billingcountry required required a 10 billing country {{indonesia}} callbackurl required required ans 255 {{paymentproduct}} result forward url (on browser) https //www mechant com/callbackurl dbprocessurl required required ans 255 {{paymentproduct}} result receive url (server side) https //www merchant com/dbprocessurl description required required an 100 description this is the description of the {{paymentproduct}} merchanttoken required required an 255 {{merchant}} token 2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1 userip required required ans 15 user ip 127 0 0 1 cartdata required required ans 4000 cart data (json format) {} instmnttype required required n 2 docid logd 07e0vrfugu0nldf 1 instmntmon required required n 2 installment month 1 cardcvv n 3 card cvv 100 preauthtoken required required an 255 pre auth token c2921cc7a1967f905fd4f895f22f06c02d24adf8c9f7b169d6ef0c2c0b128549 recurropt required for recurring cc required for recurring cc n 2 0 automatic cancel 1 do not cancel 2 do not make token 1 billingaddr an 255 billing address jln raya kasablanka kav 88 deliverynm a 30 delivery name {{merchant}} 's name deliveryphone n 15 delivery phone 08123456789 deliveryaddr an 100 delivery address jln dr saharjo no 88 deliveryemail an 100 delivery e mail example\@merchant com deliverycity a 50 delivery city south jakarta deliverystate a 50 delivery state dki jakarta deliverypostcd n 10 delivery post number 10201 deliverycountry a a delivery country {{indonesia}} vat n 12 {{vat}} 0 fee n 12 service tax 0 notaxamt n 12 tax free amount 0 reqdt n n request date ( yyyymmdd ) 20230516 reqtm n n request time ( hh24miss ) 135959 reqdomain ans 100 request domain www merchant com reqserverip ans 15 request server ip 127 0 0 1 reqclientver ans 50 request client version 1 0 usersessionid an 100 user session id usersessionid useragent ans 100 user agent information mozilla userlanguage ans 2 user language en us response parameter pre auth sample response pre auth { "issubanknm" "bca", "resultcd" "0000", "amount" "1000", "cctranstype" "4", "authno" "051837", "referenceno" "merchantreferencenumber001", "transtm" "234619", "fee" null, "vat" null, "txid" "ionpaytest01202305212346199270", "description" "this is the description of the payment", "notaxamt" null, "cardno" "51234500 0008", "issubankcd" "cena", "instmnttype" "1", "resultmsg" "success", "acqubankcd" "bnia", "cardexpyymm" "3901", "acqubanknm" "cimb", "paymethod" "01", "callbackurl" "https //www merchant com/callbackurl", "instmntmon" "1", "transdt" "20230516" } parameter type size description resultcd n 4 docid\ pnv6uw k42cisgzemke y resultmsg an 255 docid\ pnv6uw k42cisgzemke y txid an 30 transaction id referenceno ans 40 {{merchant}} order number paymethod n 2 docid\ pnv6uw k42cisgzemke y amount n 12 transaction amount currency an 3 currency goodsnm n 100 goods name billingnm n 30 buyer name transdt n 8 transaction date ( yyyymmdd ) transtm n 6 transaction time ( hh24miss ) description an 100 transaction description callbackurl ans 100 callback url authno n 10 authorization number issubankcd a 4 docid\ pnv6uw k42cisgzemke y issubanknm a 255 issuing {{bank}} name acqubankcd a 4 docid\ pnv6uw k42cisgzemke y acqubanknm a 255 acquiring {{bank}} name cardno ans 20 card number (masked) instmntmon n 2 installment month instmnttype n 2 docid\ pnv6uw k42cisgzemke y cctranstype n 2 docid logd 07e0vrfugu0nldf vat n 12 {{vat}} number fee n 12 service fee notaxamt n 12 tax free amount