NICEPAY API
...
API Versi 2
Checkout API
Registration - API Checkout
17 min
tentang registration api checkout langkah pada registration api checkout ini berfungsi untuk mendaftarkan sebuah request checkout belanja dari {{pelanggan}} {{anda}} kepada kami sehingga {{pelanggan}} {{anda}} dapat membayar jumlah {{transaksi}} yang ditagihkan pada payment page {{yang}} {{nicepay}} sediakan pada prinsipnya, semua {{metodebayar}} pada {{checkoutproduct}} {{api}} memiliki {{proses}} {{yang}} sama hanya saja {{yang}} membedakan adalah {{parameter}} pada setiap {{metodebayar}} pada saat {{pelanggan}} melakukan {{proses}} {{checkoutproduct}} , {{sistem}} melakukan {{proses}} pendaftaran pesanan sebelum {{pelanggan}} dapat melakukan {{proses}} {{pembayaran}} pada {{metodebayar}} {{yang}} diinginkan melalui tautan {{pembayaran}} {{yang}} didapatkan {{silakan}} kunjungi {{halaman}} payment api checkout docid\ iewj7vv ejtgaa2m7o5p2 untuk mengetahui penjelasan lebih rinci terkait {{api}} khusus {{pembayaran}} registration api checkout (all payment method) untuk dapat menggunakan seluruh {{metodebayar}} pada {{api}} {{checkoutproduct}} kecuali {{qris}} , {{anda}} diperlukan untuk mendaftarkan {{transaksi}} tersebut dengan {{api}} registrasi {{checkoutproduct}} ini berikut {{parameter}} nya api url /nicepay/redirect/v2/registration method post post header content type application/json merchant token sha256 ( timestamp + imid + referenceno + amt + merchantkey ) request parameter for api checkout registration parameter tipe ukuran deskripsi contoh / catatan 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\ ky4ppujot06atnie easf 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 & required for cvs, e wallet & payloan 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 (maks 8 digit angka) 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 tipe ukuran deskripsi contoh / catatan resultcd n 4 result code docid 7o8nl7guqp asiwfdqi3v 0000 resultmsg an 255 error code docid\ wpcemazro xvnxz 1zaib success txid an 30 transaction id ionpaytest00202305161555223616 when success referenceno ans 40 {{merchant}} order number {{merchant}} referencenumber001 paymethod n 2 payment method code docid\ iifmsruuw7j9vmwefjz97 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 setelah {{transaksi}} {{anda}} sudah didaftarkan, arahkan {{pelanggan}} {{anda}} langsung menuju {{halaman}} {{paymentproduct}} kami untuk melakukan {{proses}} {{pembayaran}} {{silakan}} periksa {{halaman}} payment api checkout docid\ iewj7vv ejtgaa2m7o5p2 untuk mengetahui penjelasan lebih rinci 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, dan payloan seller data chekout api cart data pada {{checkoutproduct}} {{api}} berguna untuk mendeklarasikan item apa saja {{yang}} akan di checkout beserta rincian dan harga per item cart data ini berlaku untuk semua {{metodebayar}} , kecuali {{metodebayar}} menggunakan {{payloan}} dikarenakan {{metodebayar}} {{payloan}} memiliki cart data khusus cart data cartdata harus dilepas dalam bentuk string karakter spesial tidak didukung dalam cartdata pastikan bahwa count sama dengan jumlah object item pastikan bahwa goods amt x goods quantity sama dengan {{parameter}} amt parameter deskripsi contoh count total jumlah dari keseluruhan cart data 2 item terbagi menjadi 5 macam {{parameter}} , yaitu img url , goods name , goods detail , goods amt , dan goods quantity penjelasan detail pada parameter item parameter deskripsi contoh img url url gambar barang (ukuran 50px x 50px) http //img aaa com/ima1 jpg goods name nama barang item 1 name goods detail deskripsi detail barang item 1 detail goods amt harga barang 700 goods quantity jumlah barang 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 deskripsi 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 wajib dilepas dalam format string { "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 secara spesifik untuk {{payloan}} pastikan {{parameter}} {{parameter}} count berdasarkan dengan nomor tipe barang barang pastikan goods sellers id dan goods sellers name berisi sesuai dengan sellers pada registration payloan sellers data parameter deskripsi 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" } } ]