NICEPAY API
...
API Version 2 (V2)
Checkout API
Registration - API Checkout
17min
about registration api checkout the purpose of this step on registration api checkout is to register a {{checkout}} request from your {{customer}} to us so that your {{customer}} can pay {{the}} {{transaction}} amount billed on {{the}} {{payment}} {{page}} provided by {{nicepay}} based on {{the}} principle, all {{paymethod}} s on {{the}} {{checkoutproduct}} {{api}} have {{the}} same {{process}} the difference is just {{the}} {{parameter}} on each {{paymethod}} when {{the}} {{customer}} {{proceed}} s with {{the}} {{checkoutproduct}} {{process}} , {{the}} {{system}} {{proceed}} s {{the}} {{order}} registration firsthand before {{the}} {{customer}} can do {{the}} {{payment}} {{process}} on {{the}} chosen {{paymethod}} through {{the}} received {{payment}} link {{please}} visit {{the}} payment api checkout docid\ edzoz4vkv 1afv7hzbq5y {{page}} to know further explanations related {{api}} specific for {{payment}} registration api checkout (all payment method) to be able uses all {{paymethod}} s on {{checkoutproduct}} {{api}} , you are required to register {{the}} {{transaction}} with this {{checkoutproduct}} registration {{api}} here are {{the}} {{parameter}} s api url /nicepay/redirect/v2/registration request method post post header content type application/json merchant token sha256 ( timestamp + imid + referenceno + amt + merchantkey ) request parameter for api checkout registration parameter type size description remark imid required required an 10 {{merchant}} id ionpaytest timestamp required required n 14 request timestamp ( yyyymmddhh24miss ) 20230516660517 paymethod required required n 2 payment method code docid\ iifmsruuw7j9vmwefjz97 00 bankcd a 4 bank code docid\ qbeq29lj53z vbvxtvb7l cena currency required required an 3 currency idr amt required required n 12 transaction amount 10000 referenceno required required ans 40 {{merchant}} order number merchantreferencenumber001 merchanttoken required required an 255 {{merchant}} token 4686062c297a3e48cf385953f411bbd48753bb70b041f2113a3e7c2e99c54f3c callbackurl required required an 255 {{paymentproduct}} result forward url https //www merchant com/callbackurl/ dbprocessurl required required an 255 {{paymentproduct}} notification url https //www merchant com/dbprocessurl goodsnm required required an 100 goods name merchant goods 1 mitracd required for cvs, e wallet & payloan required for cvs, e wallet & payloan an 4 mitra code docid\ tm257gq3dxgzf98uz0l33 dana vacctvaliddt required for va required for va n 8 va expiry date ( yyyymmdd ) 20230531 vacctvalidtm required for va required for va n 8 va expiry time ( hh24miss ) 235959 description required required an 100 transaction description this is the description of the {{paymentproduct}} billingnm required required a 100 billing name john doe billingphone required required n 15 billing phone 08123456789 billingemail required required an 40 billing e mail john doe\@example com billingaddr an 100 billing address jln raya casablanka kav 88 billingcity required required a 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 userip an 15 user ip 127 0 0 1 cartdata required required an 4000 cart data {\\"count\\" \\"1\\",\\"item\\" \[{\\"goods id\\" \\"bb12345678\\",\\"goods detail\\" \\"bb123456\\",\\"goods name\\" \\"iphone5s\\",\\"goods amt\\" \\"10000\\",\\"goods type\\" \\"smartphone\\",\\"goods url\\" \\"http //merchant com/cellphones/iphone5s 64g\\",\\"goods quantity\\" \\"1\\",\\"goods sellers id\\" \\"sel123\\",\\"goods sellers name\\" \\"sellers1\\"}]} deliverynm a 30 delivery name {{merchant}} 's name deliveryphone n 15 delivery phone 08123456789 deliveryaddr an 100 delivery address jln dr saharjo no 88 deliverycity a 50 delivery city south jakarta deliverystate a 50 delivery state dki jakarta deliverypostcd n 10 delivery post number 10201 deliverycountry a 10 delivery country {{indonesia}} vat n 12 value added tax ( {{vat}} ) fee n 12 service fee notaxamt n 12 tax free amount reqdt n 8 request date ( yyyymmdd ) reqtm n 6 request time ( hh24miss ) reqdomain an 100 request domain merchant com reqserverip an 15 request server ip 127 0 0 1 reqclientver an 50 request client version usersessionid an 100 user session id useragent an 100 user agent information userlanguage a 2 user language sellers required for payloan required for payloan json string 4000 seller data \[{"sellersid" "sel123","sellersnm" "sellers 1","sellersemail" "sellers\@test com","sellersaddress" {"sellernm" "sellers","sellerlastnm" "1","selleraddr" "jalan berbangsa 1","sellercity" "jakarta barat","sellerpostcd" "12344","sellerphone" "08123456789","sellercountry" "id"}}] instmnttype required for cc & payloan required for cc & payloan n 2 installment type code docid\ rt2c32s9hfl aohyoebv5 1 (for pre auth & recurring default 1) instmntmon required for cc & payloan required for cc & payloan n 2 installment month 1 1 month/full {{paymentproduct}} , if instmnttype null /1 1 (for pre auth & recurring default 1) recurropt required for cc required for cc n 2 0 automatic cancel 1 do not cancel 2 do not make token 2 merfixacctid required for va (fixed type) required for va (fixed type) an 40 {{merchant}} reserved va id (max 8 digit numbers) payvaliddt required for cvs required for cvs n 8 cvs expiry date ( yyyymmdd ) 20221212 payvalidtm required for cvs required for cvs n 6 cvs expiry time ( hh24miss ) 201012 paymentexpdt required for qris required for qris n 8 qr {{paymentproduct}} expiry date ( yyyymmdd ) 20221208 paymentexptm required for qris required for qris n 6 qr {{paymentproduct}} expiry time ( hh24miss ) 092330 shopid required for qris required for qris an 25 shop id 216660000000833315280 response parameters for api checkout registration parameter type size description remark resultcd n 4 result code docid 2r5sr3xvppu1eju1nitg 0000 resultmsg an 255 error code docid 4 fpewlvczfhcvygxwck9 success txid an 30 transaction id ionpaytest00202305161555223616 when success referenceno ans 40 {{merchant}} order number merchantreferencenumber001 paymethod n 2 payment method code docid\ ek 0djw7nuhytcda4sa3p 00 when success amt n 12 amount 10000 when success transdt n 8 transaction date ( yyyymmdd ) 20230516 when success transtm n 6 transaction time ( hh24miss ) 135959 when success description an 100 transaction description this is the description of the {{paymentproduct}} when success currency an 3 currency idr when success goodsnm an 100 goods name {{merchant}} goods 1 when success billingnm a 100 buyer name john doe when success payvaliddt n 8 cvs expiry date ( yyyymmdd ) null payvalidtm n 6 cvs expiry time ( hh24miss ) null paymenturl an 40 redirect url {{nicepay}} https //www nicepay co id/nicepay/redirect/v2/payment after your {{transaction}} has been registered, direct your {{customer}} to our {{paymentproduct}} {{page}} to {{proceed}} with {{the}} {{payment}} {{please}} check {{the}} payment api checkout docid\ edzoz4vkv 1afv7hzbq5y {{page}} to view {{the}} details sample json api checkout registration json request { 	"timestamp" "20250211090266", 	"imid" "ionpaytest", 	"paymethod" "00", 	"currency" "idr", 	"amt" "10000", 	"referenceno" "ord20250211090266", 	"goodsnm" "jhon doe", 	"billingnm" "jhon doe", 	"billingphone" "08123456789", 	"billingemail" "jhondoe\@gmail com", 	"billingaddr" "jalan bukit berbunga 22", 	"billingcity" "jakarta", 	"billingstate" "dki jakarta", 	"billingpostcd" "12345", 	"billingcountry" "indonesia", 	"deliverynm" "jhondoe\@gmail com", 	"deliveryphone" "08123456789", 	"deliveryaddr" "jalan bukit berbunga 22", 	"deliverycity" "jakarta", 	"deliverystate" "dki jakarta", 	"deliverypostcd" "12345", 	"deliverycountry" "indonesia", 	"dbprocessurl" "http //ptsv2 com/t/merchant/post", "callbackurl" "https //www nicepay co id/ionpay client/paymentresult jsp", 	"vat" "", 	"fee" "", 	"notaxamt" "", 	"description" "test transaction nicepay", 	"merchanttoken" "d339576df6d69763073b626fc88b0bbe9e0f9023d376d37372e1af96dde7d059", 	"reqdt" "", 	"reqtm" "", 	"reqdomain" "merchant com", 	"reqserverip" "127 0 0 1", 	"reqclientver" "", 	"userip" "127 0 0 1", 	"usersessionid" "697d6922c961070967d3ba1ba5699c2c", 	"useragent" "mozilla/5 0 (windows nt 10 0; win64; x64) applewebkit/537 36 (khtml,like gecko) chrome/60 0 3112 101 safari/537 36", 	"userlanguage" "ko kr,en us;q=0 8,ko;q=0 6,en;q=0 4", 	"cartdata" "{\\"count\\" \\"1\\",\\"item\\" \[{\\"goods id\\" \\"bb12345678\\",\\"goods detail\\" \\"bb12345678\\",\\"goods name\\" \\"pasar modern\\",\\"goods amt\\" \\"10000\\",\\"goods type\\" \\"sembako\\",\\"goods url\\" \\"http \\/\\/merchant com\\/cellphones\\/iphone5s 64g\\",\\"goods quantity\\" \\"1\\",\\"goods sellers id\\" \\"sel123\\",\\"goods sellers name\\" \\"sellers 1\\"}]}", 	"sellers" "\[{\\"sellersid\\" \\"sel123\\",\\"sellersnm\\" \\"sellers 1\\",\\"sellersemail\\" \\"sellers\@test com\\",\\"sellersaddress\\" {\\"sellernm\\" \\"sellers\\",\\"sellerlastnm\\" \\"1\\",\\"selleraddr\\" \\"jalan berbangsa 1\\",\\"sellercity\\" \\"jakarta barat\\",\\"sellerpostcd\\" \\"12344\\",\\"sellerphone\\" \\"08123456789\\",\\"sellercountry\\" \\"id\\"}}]", 	"instmnttype" "2", 	"instmntmon" "1", 	"recurropt" "1", 	"bankcd" "", "vacctvaliddt" "", "vacctvalidtm" "", "payvaliddt" "", "payvalidtm" "", 	"merfixacctid" "", 	"mitracd" "", 	"paymentexpdt" "", "paymentexptm" "", 	"shopid" "" } json response { "resultcd" "0000", "resultmsg" "success", "txid" "ionpaytest00202502110934549268", "referenceno" "ord20250211090266", "paymethod" "00", "amt" "10000", "transdt" "20250211", "transtm" "093454", "description" "test transaction nicepay", "currency" "idr", "goodsnm" "jhon doe", "billingnm" "jhon doe", "payvaliddt" null, "payvalidtm" null, "paymenturl" "https //dev nicepay co id/nicepay/redirect/v2/payment" } java request //checkout registration// nicepay settimestamp("20250211090266"); nicepay setimid("ionpaytest"); nicepay setpaymethod("00"); nicepay setcurrency("idr"); nicepay setamt("10000"); nicepay setreferenceno("ord20250211090266"); nicepay setgoodsnm("testing transaction"); nicepay setbillingnm("jhon doe"); nicepay setbillingphone("08123456789"); nicepay setbillingemail("john doe\@example com"); nicepay setbillingaddr("jalan bukit berbunga 22"); nicepay setbillingcity("jakarta"); nicepay setbillingstate("dki jakarta"); nicepay setbillingcountry("indonesia"); nicepay setbillingpostcd("12345"); nicepay setdeliverynm("john doe"); nicepay setdeliveryphone("08123456789"); nicepay setdeliveryaddr("jalan bukit berbunga 22"); nicepay setdeliverycity("jakarta"); nicepay setdeliverystate("dki jakarta"); nicepay setdeliverycountry("indonesia"); nicepay setdeliverypostcd("12345"); nicepay setdbprocessurl("http //ptsv2 com/t/merchant/post"); nicepay setcallbackurl("https //www nicepay co id/ionpay client/paymentresult jsp"); nicepay setvat(""); nicepay setfee(""); nicepay setnotaxamt(""); nicepay setdescirption("test transaction nicepay"); nicepay setmerchanttoken(nicepay maketoken(nicepay getmerchanttoken()); nicepay setreqdt(""); nicepay setreqtm(""); nicepay setreqdomain("merchant com"); nicepay setreqserverip("127 0 0 1"); nicepay setreqclientver(""); nicepay setuserip("127 0 0 1"); nicepay setusersessionid("697d6922c961070967d3ba1ba5699c2c"); nicepay setcartdata("{\\"count\\" 3,\\"item\\" \[{\\"goods id\\" 30,\\"goods name\\" \\"beanie\\",\\"goods type\\" \\"accessories\\",\\"goods amt\\" 1000,\\"goods sellers id\\" \\"nicepay namamerchant\\",\\"goods sellers name\\" \\"nicepayshop\\",\\"goods quantity\\" 1,\\"goods url\\" \\"http //www nicestore com/product/beanie/\\"},{\\"goods id\\" 31,\\"goods name\\" \\"belt\\",\\"goods type\\" \\"accessories\\",\\"goods amt\\" 5000,\\"goods sellers id\\" \\"nicepay namamerchant\\",\\"goods sellers name\\" \\"nicepayshop\\",\\"goods quantity\\" 1,\\"goods url\\" \\"http //www nicestore store/product/belt/\\"},{\\"img url\\" \\"http //www jamgora com/media/avatar/noimage png\\",\\"goods name\\" \\"shipping fee\\",\\"goods id\\" \\"shipping for ref no 278\\",\\"goods detail\\" \\"flat rate\\",\\"goods type\\" \\"shipping with flat rate\\",\\"goods amt\\" \\"4000\\",\\"goods sellers id\\" \\"nicepay namamerchant\\",\\"goods sellers name\\" \\"nicepayshop\\",\\"goods quantity\\" \\"1\\",\\"goods url\\" \\"https //wwww nicestore store\\"}]}"); nicepay setsellers("\[{\\"sellersid\\" \\"sel123\\",\\"sellersnm\\" \\"sellers 1\\",\\"sellersemail\\" \\"sellers\@test com\\",\\"sellersaddress\\" {\\"sellernm\\" \\"sellers\\",\\"sellerlastnm\\" \\"1\\",\\"selleraddr\\" \\"jalan berbangsa 1\\",\\"sellercity\\" \\"jakarta barat\\",\\"sellerpostcd\\" \\"12344\\",\\"sellerphone\\" \\"08123456789\\",\\"sellercountry\\" \\"id\\"}}]"); nicepay setinstmnttype("2"); nicepay setinstmntmon("1"); nicepay setrecurropt("1"); nicepay setbankcd(""); nicepay setvacctvaliddt(""); nicepay setvacctvalidtm(""); nicepay setpayvaliddt(""); nicepay setpayvalidtm(""); nicepay setmerfixacctid(""); nicepay setmitracd(""); nicepay setpaymentexpdt(""); nicepay setpaymentexptm(""); nicepay setshopid(""); // request checkout registration nicepay redirectregist(); // 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"); string description = nicepay get("description"); string currency = nicepay get("currency"); string goodsnm = nicepay get("goodsnm"); string billingnm = nicepay get("billingnm"); string payvaliddt = nicepay get("payvaliddt"); string payvalidtm = nicepay get("payvalidtm"); string paymenturl = nicepay get("paymenturl"); cart data, payloan cart data and payloan seller data chekout api the card data on {{checkoutproduct}} {{api}} is useful for declaring what items will be checked out along with item details and prices per item this card data applies to all {{paymethod}} s, except {{paymethod}} using {{payloan}} because {{the}} {{payloan}} {{paymethod}} has special cart data cart data cartdata must be released in {{the}} string form special characters are not supported in cartdata make sure that count is {{the}} same as {{the}} number of item object make sure that goods amt x goods quantity is {{the}} same as {{the}} amt {{parameter}} parameter description remark count total number of all cart data 2 item divided into 5 kinds of {{parameter}} s, namely img url , goods name , goods detail , goods amt , and goods quantity detailed explanation of the item parameters parameter description remark img url goods image url (size 50px x 50px) http //img aaa com/ima1 jpg goods name goods name item 1 name goods detail goods detail description item 1 detail goods amt goods amount 700 goods quantity goods quantity 1 card data { "count" "2", "item" \[ { "img url" "http //img aaa com/ima1 jpg", "goods name" "item 1 name", "goods detail" "item 1 detail", "goods amt" "700", "goods quantity" "1" }, { "img url" "http //img aaa com/ima2 jpg", "goods name" "item 2 name", "goods detail" "item 2 detail", "goods amt" "300", "goods quantity" "1" } ] } payloan cart data parameter description count total cart data count item list of goods item > goods id goods id item > goods detail goods detail item > goods name goods name item > goods amt goods amount item > goods type goods type item > goods url goods url item > goods quantity goods quantity item > goods sellers id seller's id item > goods sellers name seller's name cartdata is mandatory to be released in {{the}} string form { "count" "2", "item" \[ { "goods id" "bb12345678", "goods detail" "bb123456", "goods name" "iphone 5s", "goods amt" "6000000", "goods type" "smartphone", "goods url" "http //merchant com/cel lphones/iphone5s 64g", "goods quantity" "1", "goods sellers id" "sel123", "goods sellers name" "sellers 1" }, { "goods id" "az14565678", "goods name" "hailee sneakers blink silver", "goods amt" "250000", "goods url" "http //merchant com/fashion/shoes/sneakers blinkshoes", "goods type" "sneakers", "goods quantity" "2", "goods sellers id" "sel124", "goods sellers name" "sellers 2" } ] } cartdata is specifically for {{payloan}} make sure {{the}} count {{parameter}} s are based on {{the}} goods' type number make sure {{the}} goods sellers id and goods sellers name are contained according to {{the}} sellers on registration payloan sellers data parameter description sellersid seller's id sellersnm seller's name sellersemail seller's e mail sellersurl seller's url sellersaddress > sellernm seller's name sellersaddress > sellerlastnm seller's last name sellersaddress > selleraddr seller's address sellersaddress > sellercity seller's city sellersaddress > sellerpostcd seller's postal code sellersaddress > sellerphone seller's phone sellersaddress > sellercountry seller's country \[ { "sellersid" "sel123", "sellersnm" "sellers 1", "sellersemail" "sellers\@test com", "sellersurl" "http //nicestore store", "sellersaddress" { "sellernm" "sellers", "sellerlastnm" "1", "selleraddr" "jalan berbangsa 1", "sellercity" "jakarta barat", "sellerpostcd" "12344", "sellerphone" "08123456789", "sellercountry" "id" } }, { "sellersid" "sel124", "sellersnm" "sellers 2", "sellersemail" "sellers2\@test com", "sellersurl" "http //nicestore store", "sellersaddress" { "sellernm" "sellers", "sellerlastnm" "2", "selleraddr" "jalan berkelok 3", "sellercity" "jakarta utara", "sellerpostcd" "12222", "sellerphone" "081255556789", "sellercountry" "id" } } ]