NICEPAY API
...
API GPN
Registration - API GPN
11 min
about api for gpn registration on , gets a lot of benefits other than accessibility and efficiency because can use an atm card with logo for any using an edc machine from any throughout api for gpn registration registration aims to connect to available on so that prepares and hosts from side can integrate with api endpoint /nicepay/direct/v2/registration request method post post description performs transaction regist to merchant token sha256( timestamp + imid + referenceno + amt + merchantkey ) request format application/json visit docid\ e4q7ba jvpfrfbuijrryy to learn general related request parameter for gpn registration the following is a list of s for requesting registration of this is used through platform as one of stages so that 's can connect with s the cartdata detail is optional to be added parameter type size description example / notes timestamp required required n 14 request timestamp ( yyyymmddhh24miss ) 20200813103605 imid required required an 10 id ionpaytest paymethod required required n 2 docid\ ek 0djw7nuhytcda4sa3p 09 currency required required a 3 currency idr amt required required n 12 amount 1000 referenceno required required ans 40 's reference number order12345 goodsnm required required an 100 goods name testing normal full payment billingnm required required a 100 buyer name name billingphone required required n 15 buyer phone number 12345678 billingemail required required ans 40 buyer e mail email\@merchant com billingcity required required a 50 buyer city jakarta billingstate required required a 50 billing state dki jakarta billingpostcd required required n 10 billing post number 12345 billingcountry required required a 10 billing country cartdata required required jsonstring 4000 cart data optional instmnttype required required n 2 docid\ wfsinjxqc2s9yubbybpep 1 instmntmon required required n 2 installment month 1 recurropt required required n 2 0 automatic cancel 1 do not cancel 2 do not make token 2 dbprocessurl ans 255 notification url https //ptsv2 com/t/rizal/post merchanttoken an 255 token 129b8f6ce5c94e7c6200dee63a42a05caa4175ba4523068651d3e17a3208772c userip an 15 user ip 127 0 0 1 response parameter for gpn registration the following is response from result of request to register on parameter type size description example / notes resultcd n 4 docid 2r5sr3xvppu1eju1nitg 0000 resultmsg an 255 result message docid 4 fpewlvczfhcvygxwck9 success txid an 30 transaction id ionpaytest09202212070935176733 referenceno ans 40 reference number order12345 paymethod n 2 docid\ ek 0djw7nuhytcda4sa3p 09 amt n 12 amount 1000 transdt n 8 transaction date ( yyyymmdd ) 20221207 transtm n 6 transaction time ( hh24miss ) 093518 description an 100 transaction description null vacctno n 20 va number null mitracd a 4 docid 0upx1lyg1o2f4biu3ssp null payno n 12 cvs number null currency a 3 currency null goodsnm an 100 goods name null billingnm a 100 buyer name null vacctvaliddt n 8 va expiry date ( yyyymmdd ) null vacctvalidtm n 6 va expiry time ( hh24miss ) null payvaliddt n 8 expiry date ( yyyymmdd ) null payvalidtm n 6 expiry time ( hh24miss ) null requesturl ans 360 request url null paymentexpdt n 6 qr expiry date ( yyyymmdd ) null paymentexptm n 6 qr expiry time ( hh24miss ) null qrcontent ans 360 qr string in plain text null qrurl ans 360 url for qr image, valid for 5 minutes null sample json for gpn registration json request { "timestamp" "20200813103605", "imid" "ionpaytest", "paymethod" "09", "currency" "idr", "amt" "1000", "referenceno" "order12345", "goodsnm" "testing normal full payment gpn", "billingnm" "customer name", "billingphone" "12345678", "billingemail" "email\@merchant com", "billingcity" "jakarta", "billingstate" "dki jakarta", "billingpostcd" "12345", "billingcountry" "indonesia", "dbprocessurl" "https //ptsv2 com/t/rizal/post", "merchanttoken" "129b8f6ce5c94e7c6200dee63a42a05caa4175ba4523068651d3e17a3208772c", "userip" "127 0 0 1", "instmnttype" "1", 	"instmntmon" "1", 	"recurropt" "1" } json response { 	"resultcd" "0000", 	"resultmsg" "success", 	"txid" "ionpaytest09202212070935176733", 	"referenceno" "order12345", 	"paymethod" "09", 	"amt" "1000", 	"transdt" "20221207", 	"transtm" "093518", 	"description" null, 	"bankcd" null, 	"vacctno" null, 	"mitracd" null, 	"payno" null, 	"currency" null, 	"goodsnm" null, 	"billingnm" null, 	"vacctvaliddt" null, 	"vacctvalidtm" null, 	"payvaliddt" null, 	"payvalidtm" null, 	"requesturl" null, 	"paymentexpdt" null, 	"paymentexptm" null, 	"qrcontent" null, 	"qrurl" null } java request //gpn registration// nicepay settimestamp("20221202141217"); nicepay setimid("ionpaytest"); nicepay setpaymethod("09"); nicepay setcurrency("idr"); nicepay setamt("5000"); nicepay setreferenceno("ordno20221202141217"); nicepay setdecription("test gpn"); nicepay setinstmnttype("1"); nicepay setinstmntmon("1"); nicepay setmerchanttoken(nicepay maketoken(nicepay getmerchanttoken()); nicepay setgoodsnm("testing registration gpn"); nicepay setbillingnm("john doe"); nicepay setbillingphone("081288998899"); nicepay setbillingemail("john doe\@example com"); nicepay setbillingaddr("jln raya kasablanka kav 88"); nicepay setbillingcity("south jakarta"); nicepay setbillingstate("dki jakarta"); nicepay setbillingcountry("indonesia"); nicepay setbillingpostcd("12800"); nicepay setdbprocessurl("http //ptsv2 com/t/merchant/post"); nicepay setcarddata("{\\"count\\" 1,\\"item\\" \[{\\"img url\\" \\"http \\\\\\/\\\\\\/www jamgora com\\\\\\/media\\\\\\/avatar\\\\\\/noimage png\\",\\"goods name\\" \\"hoodie\\",\\"goods detail\\" \\"hoodie\\",\\"goods amt\\" \\"5000\\"}]}"); // request gpn registration nicepay gpnregist(); // 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 paymethod = nicepay get("paymethod"); string amt = nicepay get("amt"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); cart data gpn registration cartdata in registration is useful for declaring what items will be checked out along with item details and price for each item parameter description example count the total number of all card data 2 item it is divided into 4 kinds of s, namely img url , goods name , goods detail , and goods amt detailed explanation on item s parameter description example img url url goods picture (size 50px x 50px) htttps\ //www merchant com/image goods1 jpg goods name goods name nama item 1 goods detail goods detail description detail item 1 goods amt goods price 1000 cartdata gpn registration { "count" "2", "item" \[ { "img url" "http //www merchant com/image goods1 jpg", "goods name" "item 1 name", "goods detail" "item 1 detail", "goods amt" "1000" }, { "img url" "http //www merchant com/image goods2 jpg", "goods name" "item 2 name", "goods detail" "item 2 detail", "goods amt" "1000" } ] }