NICEPAY API
...
Checkout API
Registration - API Checkout
19 min
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}} 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 registration api checkout 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 docid\ iifmsruuw7j9vmwefjz97 00 bankcd a 4 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 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 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 docid 2r5sr3xvppu1eju1nitg 0000 resultmsg an 255 docid 4 fpewlvczfhcvygxwck9 success txid an 30 transaction id ionpaytest00202305161555223616 when success referenceno ans 40 {{merchant}} order number merchantreferencenumber001 paymethod n 2 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}} docid\ edzoz4vkv 1afv7hzbq5y {{page}} to view {{the}} details sample parameter for registration api checkout request parameter curl curl location 'https //dev nicepay co id/nicepay/redirect/v2/registration' \\ \ header 'content type application/json' \\ \ data raw '{ "timestamp" "20251110141120", "imid" "ionpaytest", "paymethod" "00", "currency" "idr", "referenceno" "ordno20251110141120", "merchanttoken" "9da3d4c498aab78d9aa5f320713d3fffad1d50acd4d2d1ea9d18bb164bbf0d60", "mitracd" "", "amt" "10000", "instmnttype" "1", "instmntmon" "1", "callbackurl" "https //dev nicepay co id/ionpay client/paymentresult jsp", "dbprocessurl" "https //ptsv2 com/t/sibedul/post", "goodsnm" "goods", "billingnm" "hantu kesorean", "billingphone" "081234567890", "billingemail" "sample\@mail com", "billingaddr" "jl sample address", "billingcity" "south jakarta", "billingstate" "dki jakarta", "billingcountry" "indonesia", "billingpostcd" "12800", "deliverynm" "john doe", "deliveryphone" "081234567890", "deliveryaddr" "jln sample address", "deliverycity" "west jakarta", "deliverystate" "dki jakarta", "deliverycountry" "indonesia", "deliverypostcd" "12800", "description" "testing checkout api", "userip" "127 0 0 1", "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\\" \\"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\\"}]}", "sellers" "\[{\\"sellersid\\" \\"sel123\\",\\"sellersnm\\" \\"sellers1\\",\\"sellersemail\\" \\"sellers\@test com\\",\\"sellersurl\\" \\"http //nicestore store\\",\\"sellersaddress\\" {\\"sellernm\\" \\"sellers\\",\\"sellerlastnm\\" \\"1\\",\\"selleraddr\\" \\"jalanberbangsa1\\",\\"sellercity\\" \\"jakartabarat\\",\\"sellerpostcd\\" \\"12344\\",\\"sellerphone\\" \\"08123456789\\",\\"sellercountry\\" \\"id\\"}}]", "msid" "", "msfee" "", "msfeetype" "", "escrowcl" "" }' node js const secondapiversion = require(" /lib/secondapiversion js"); const config = { isproduction false, iscloudserver false, merchantkey "your merchant key", }; const parameter = { timestamp "20251110141120", imid "ionpaytest", paymethod "00", currency "idr", referenceno "ordno20251110141120", mitracd "", amt "10000", instmnttype "1", instmntmon "1", callbackurl "https //dev nicepay co id/ionpay client/paymentresult jsp", dbprocessurl "https //ptsv2 com/t/sibedul/post", goodsnm "goods", billingnm "hantu kesorean", billingphone "081234567890", billingemail "sample\@mail com", billingaddr "jl sample address", billingcity "south jakarta", billingstate "dki jakarta", billingcountry "indonesia", billingpostcd "12800", deliverynm "john doe", deliveryphone "081234567890", deliveryaddr "jln sample address", deliverycity "west jakarta", deliverystate "dki jakarta", deliverycountry "indonesia", deliverypostcd "12800", description "testing checkout api", userip "127 0 0 1", 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" "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"}]}', sellers '\[{"sellersid" "sel123","sellersnm" "sellers1","sellersemail" "sellers\@test com","sellersurl" "http //nicestore store","sellersaddress" {"sellernm" "sellers","sellerlastnm" "1","selleraddr" "jalanberbangsa1","sellercity" "jakartabarat","sellerpostcd" "12344","sellerphone" "08123456789","sellercountry" "id"}}]', msid "", msfee "", msfeetype "", escrowcl "", }; let secondversion = new secondapiversion(config); let response = secondversion requestapi(parameter, "/redirect/v2/registration");config = nicepay builder() isproduction(false) iscloudserver(false) build(); string timestamp = "20251110141120"; string imid = "ionpaytest"; string reffno = "ordno20251110141120"; string amount = "10000"; redirect request = redirect builder() timestamp(timestamp) imid(imid) paymethod("00") currency("idr") amt(amount) referenceno(reffno) goodsnm("goods") billingnm("hantu kesorean") billingphone("081234567890") billingemail("sample\@mail com") billingaddr("jl sample address") billingcity("south jakarta") billingstate("dki jakarta") billingpostcd("12800") billingcountry("indonesia") deliverynm("john doe") deliveryphone("081234567890") deliveryaddr("jln sample address") deliverycity("west jakarta") deliverystate("dki jakarta") deliverypostcd("12800") deliverycountry("indonesia") dbprocessurl("https //ptsv2 com/t/sibedul/post") callbackurl("https //dev nicepay co id/ionpay client/paymentresult jsp") vat("") fee("") notaxamt("") description("testing checkout api") merchanttoken(timestamp, imid, reffno, amount, merchant key) reqtm("") reqdt("") reqdomain("") reqserverip("") reqclientver("") userip("127 0 0 1") usersessionid("") useragent("") 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\\" \\"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\\"}]}") sellers("\[{\\"sellersid\\" \\"sel123\\",\\"sellersnm\\" \\"sellers1\\",\\"sellersemail\\" \\"sellers\@test com\\",\\"sellersurl\\" \\"http //nicestore store\\",\\"sellersaddress\\" {\\"sellernm\\" \\"sellers\\",\\"sellerlastnm\\" \\"1\\",\\"selleraddr\\" \\"jalanberbangsa1\\",\\"sellercity\\" \\"jakartabarat\\",\\"sellerpostcd\\" \\"12344\\",\\"sellerphone\\" \\"08123456789\\",\\"sellercountry\\" \\"id\\"}}]") mitracd("") instmnttype("1") instmntmon("1") recurropt("") bankcd("") vacctvaliddt("") vacctvalidtm("") payvaliddt("") paymentexptm("") merfixacctid("") paymentexpdt("") payvalidtm("") shopid("") msid("") msfee("") msfeetype("") escrowcl("") build(); nicepayresponsev2 response = v2redirectservice callv2redirectregistration(request, config);amt = "10000" itemcartdata = { "goods id" "bb12345678", "goods name" "iphone5s", "goods detail" "bb123456", "goods amt" amt, "goods quantity" "1", "goods type" "smartphone", "goods url" "http //merchant com/cellphones/iphone5s 64g", "goods sellers id" "sel123", "goods sellers name" "sellers1" } itemsellersaddress = { "sellernm" "sellers", "sellerlastnm" "1", "selleraddr" "jalanberbangsa1", "sellercity" "jakartabarat", "sellerpostcd" "12344", "sellercountry" "id", "sellerphone" "08123456789" } bodycartdata = ( buildercartdata buildcartdata() setcount("1") setitem(itemcartdata) build() ) bodysellers = ( buildersellers buildsellers() setsellerid("sel123") setsellernm("sellers1") setselleremail("sellers\@test com") setsellerurl("http //nicestore store") setselleraddress(itemsellersaddress) build() ) bodyrequest = ( builderrequest buildrequest() setpaymethod("00") setinstmnttype("1") setinstmntmon("1") setrecurropt("") setbankcd("") setmitracd("") setvacctvaliddt("") setvacctvalidtm("") setmerfixacctid("") setpayvaliddt("") setpayvalidtm("") setpaymentexpdt("") setpaymentexptm("") setamt(amt) build() ) environment = (builderenvironment buildenvironment() iscloud(false) isproduction(false) build()) response = servicenicepay serviceredirect(datagenerator gettransactionbody(bodyrequest jsonrequest(), bodycartdata jsoncartdata(), bodysellers jsonsellers()), environment) c# string merchantkey = "your merchant key"; string clientid = "ionpaytest"; string timestamp = "20251110141120"; string refno = "ordno20251110141120"; string amount = "10000"; bool isproduction = false; bool iscloudserver = false; var builder = new merchanttokenbuilder() settimestamp(timestamp) setimid(clientid) setrefno(refno) setamount(amount) setmerchantkey(merchantkey); // act menghasilkan merchanttoken string merchanttoken = builder buildmerchanttoken(); var cartdata = new { count = "1", item = new\[] { new { goods id = "bb12345678", goods detail = "bb123456", goods name = "iphone5s", goods amt = amount, goods type = "smartphone", goods url = "http //merchant com/cellphones/iphone5s 64g", goods quantity = "1", goods sellers id = "sel123", goods sellers name = "sellers1" } } }; string cartdatajson = jsonconvert serializeobject(cartdata); string sellersjson = "\[{\\"sellersid\\" \\"sel123\\",\\"sellersnm\\" \\"sellers1\\",\\"sellersemail\\" \\"sellers\@test com\\",\\"sellersurl\\" \\"http //nicestore store\\",\\"sellersaddress\\" {\\"sellernm\\" \\"sellers\\",\\"sellerlastnm\\" \\"1\\",\\"selleraddr\\" \\"jalanberbangsa1\\",\\"sellercity\\" \\"jakartabarat\\",\\"sellerpostcd\\" \\"12344\\",\\"sellerphone\\" \\"08123456789\\",\\"sellercountry\\" \\"id\\"}}]"; var bodybuilder = new nicepayrequestbuilder() // base request mandatory setcommonfields( imid clientid, timestamp timestamp, paymethod "00", currency "idr", amt amount, referenceno refno, goodsnm "goods", merchanttoken merchanttoken ) setuserinfo( userip "127 0 0 1", usersessionid "", useragent "", userlanguage "ko kr,en us;q=0 8,ko;q=0 6,en;q=0 4" ) setcallbackurl(callbackurl "https //dev nicepay co id/ionpay client/paymentresult jsp") setdbprocessurl("https //ptsv2 com/t/sibedul/post") setcartdata(cartdata cartdatajson) setsellers(sellersjson) // assuming a setsellers() method exists setbillinginfo( billingnm "hantu kesorean", billingphone "081234567890", billingemail "sample\@mail com", billingaddr "jl sample address", billingcity "south jakarta", billingstate "dki jakarta", billingpostcd "12800", billingcountry "indonesia" ) // for va setbankcd(bankcd "") setvaexpiry( vacctvaliddt "", vacctvalidtm "" ) // for ewallet setmitracd(mitracd "") //for cc setcreditcard( instmnttype "1", instmntmon "1", recurropt "" ) //for qris setpaymentexp( paymentexpdt "", paymentexptm "" ) setdeliveryinfo( deliverynm "john doe", deliveryphone "081234567890", deliveryaddr "jln sample address", deliverycity "west jakarta", deliverystate "dki jakarta", deliverypostcd "12800", deliverycountry "indonesia" ); apiendpoints apiendpoints = new apiendpoints(); dictionary\<string, object> payload = bodybuilder build(); string jsonpayload = newtonsoft json jsonconvert serializeobject(payload); var registrationservice = new nicepayregistrationservice(apiendpoints, isproduction, iscloudserver); var result = await registrationservice sendpostasync(apiendpoints registredirectv2, payload); laravel $url = httputil getnicepaydomain($this >useprod, $this >usecloud) $this >registration endpoint; $timestamp = "20251110141120"; $reference no = "ordno20251110141120"; $amt = $this >amt; $merchant token = $this >generatemerchanttoken($timestamp, $this >imid, $reference no, $amt, $this >mer key); $cartdata = '{"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"}]}'; $sellers = '\[{"sellersid" "sel123","sellersnm" "sellers1","sellersemail" "sellers\@test com","sellersurl" "http //nicestore store","sellersaddress" {"sellernm" "sellers","sellerlastnm" "1","selleraddr" "jalanberbangsa1","sellercity" "jakartabarat","sellerpostcd" "12344","sellerphone" "08123456789","sellercountry" "id"}}]'; $body = \[ "timestamp" => $timestamp, "imid" => $this >imid, "paymethod" => "00", "currency" => "idr", "referenceno" => $reference no, "merchanttoken" => $merchant token, "mitracd" => "", "amt" => $this >amt, "instmnttype" => "1", "instmntmon" => "1", "callbackurl" => "https //dev nicepay co id/ionpay client/paymentresult jsp", "dbprocessurl" => "https //ptsv2 com/t/sibedul/post", "goodsnm" => "goods", "billingnm" => "hantu kesorean", "billingphone" => "081234567890", "billingemail" => "sample\@mail com", "billingaddr" => "jl sample address", "billingcity" => "south jakarta", "billingstate" => "dki jakarta", "billingcountry" => "indonesia", "billingpostcd" => "12800", "deliverynm" => "john doe", "deliveryphone" => "081234567890", "deliveryaddr" => "jln sample address", "deliverycity" => "west jakarta", "deliverystate" => "dki jakarta", "deliverycountry" => "indonesia", "deliverypostcd" => "12800", "description" => "testing checkout api", "userip" => "127 0 0 1", "userlanguage" => "ko kr,en us;q=0 8,ko;q=0 6,en;q=0 4", "cartdata" => $cartdata, "sellers" => $sellers, "msid" => "", "msfee" => "", "msfeetype" => "", "escrowcl" => "" ]; try { $response = httputil postjsonrequest($url, $body); } catch (throwable $th) { return httputil generateerrorresponse($th); } php native $timestamp = helper getformattedtimestampv2(); $referenceno = "ordno20251110141120"; $amount = "10000"; $config = nicepay builder() >setisproduction(false) >settimestamp($timestamp) >build(); $parameter = redirect builder() >settimestamp($timestamp) >setimid(testconst $imid test) >setpaymethod("00") >setcurrency("idr") >setreferenceno($referenceno) >setamt($amount) >setmerchanttoken($timestamp, testconst $imid test, $referenceno, $amount, $this >merchantkey) >setcallbackurl("https //dev nicepay co id/ionpay client/paymentresult jsp") >setdbprocessurl("https //ptsv2 com/t/sibedul/post") >setgoodsnm("goods") >setbillingnm("hantu kesorean") >setbillingphone("081234567890") >setbillingemail("sample\@mail com") >setbillingaddr("jl sample address") >setbillingcity("south jakarta") >setbillingstate("dki jakarta") >setbillingcountry("indonesia") >setbillingpostcd("12800") >setdeliverynm("john doe") >setdeliveryphone("081234567890") >setdeliveryaddr("jln sample address") >setdeliverycity("west jakarta") >setdeliverystate("dki jakarta") >setdeliverycountry("indonesia") >setdeliverypostcd("12800") >setdescription("testing checkout api") >setuserip("127 0 0 1") >setuserlanguage("ko kr,en us;q=0 8,ko;q=0 6,en;q=0 4") >setcartdata( "{\\"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\\"}]}" ) >setsellers("\[{\\"sellersid\\" \\"sel123\\",\\"sellersnm\\" \\"sellers1\\",\\"sellersemail\\" \\"sellers\@test com\\",\\"sellersurl\\" \\"http //nicestore store\\",\\"sellersaddress\\" {\\"sellernm\\" \\"sellers\\",\\"sellerlastnm\\" \\"1\\",\\"selleraddr\\" \\"jalanberbangsa1\\",\\"sellercity\\" \\"jakartabarat\\",\\"sellerpostcd\\" \\"12344\\",\\"sellerphone\\" \\"08123456789\\",\\"sellercountry\\" \\"id\\"}}]") >setmitracd("") >setinstmnttype("1") >setinstmntmon("1") >build(); $v2redirectservice = new v2redirectservice($config); try { $response = $v2redirectservice >registration($parameter); } catch (nicepayerror $e) { $this >fail("exception thrown " $e >getmessage()); } codeigniter $timestamp = "20251110141120"; $configbuilder = nicepay builder(); $config = $configbuilder >setisproduction(false) >setiscloudserver(false) >build(); $reffno = "ordno20251110141120"; $amount = "10000"; $cartdata = \[ "count" => "1", "item" => \[\[ "goods id" => "bb12345678", "goods detail" => "bb123456", "goods name" => "iphone5s", "goods amt" => $amount, // replace dynamically if needed "goods type" => "smartphone", "goods url" => "http //merchant com/cellphones/iphone5s 64g", "goods quantity" => "1", "goods sellers id" => "sel123", "goods sellers name" => "sellers1" ]] ]; $sellers = "\[{\\"sellersid\\" \\"sel123\\",\\"sellersnm\\" \\"sellers1\\",\\"sellersemail\\" \\"sellers\@test com\\",\\"sellersurl\\" \\"http //nicestore store\\",\\"sellersaddress\\" {\\"sellernm\\" \\"sellers\\",\\"sellerlastnm\\" \\"1\\",\\"selleraddr\\" \\"jalanberbangsa1\\",\\"sellercity\\" \\"jakartabarat\\",\\"sellerpostcd\\" \\"12344\\",\\"sellerphone\\" \\"08123456789\\",\\"sellercountry\\" \\"id\\"}}]"; $redirectbuilder = redirect builder(); $parameter = $redirectbuilder >settimestamp($timestamp) >setimid("ionpaytest") >setpaymethod("00") >setcurrency("idr") >setdescription("testing checkout api") >setbankcd("") >setamt($amount) >setreferenceno($reffno) >setmerchanttoken($timestamp, $this >imidtest, $reffno, $amount, $this >merchantkey) // unchanged as requested >setvacctvaliddt("") >setvacctvalidtm("") >setmerfixacctid("") >setdbprocessurl("https //ptsv2 com/t/sibedul/post") >setcallbackurl("https //dev nicepay co id/ionpay client/paymentresult jsp") >setgoodsnm("goods") >setcartdata(json encode($cartdata)) >setsellers($sellers) >setbillingnm("hantu kesorean") >setbillingphone("081234567890") >setbillingemail("sample\@mail com") >setbillingaddr("jl sample address") >setbillingcity("south jakarta") >setbillingstate("dki jakarta") >setbillingpostcd("12800") >setbillingcountry("indonesia") >setuserip("127 0 0 1") >setuserlanguage("ko kr,en us;q=0 8,ko;q=0 6,en;q=0 4") >setdeliverynm("john doe") >setdeliveryphone("081234567890") >setdeliveryaddr("jln sample address") >setdeliverycity("west jakarta") >setdeliverystate("dki jakarta") >setdeliverypostcd("12800") >setdeliverycountry("indonesia") >setinstmnttype("1") >setinstmntmon("1") >setmitracd("") >setmsid("") >setmsfee("") >setmsfeetype("") >setescrowcl("") >build(); $v2vaservice = new v2redirectservice($config); try { $response = $v2vaservice >registration($parameter); } response parameter sample response { "resultcd" "0000", "resultmsg" "success", "txid" "ionpaytest00202511101446495037", "referenceno" "ordno20251110141120", "paymethod" "00", "amt" "10000", "transdt" "20251110", "transtm" "144649", "description" "testing checkout api", "currency" "idr", "goodsnm" "goods", "billingnm" "hantu kesorean", "payvaliddt" null, "payvalidtm" null, "paymenturl" "https //dev nicepay co id/nicepay/redirect/v2/payment" } cart data, payloan cart data & payloan seller data for registration api checkout 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 for registration api checkout 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 for registration api checkout 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 payloan cart data { "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 for for registration api checkout 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 payloan sellers data \[ { "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" } } ]