API Documentation

Create Checkout Order

3min
this api creates a payin order to enable users to make checkout transactions it accepts amount and currency details on creating an order a dynamic token is returned from this api which is required to be passed to pay3 android sdk this api requires access token that can be generated using access token docid\ lq v6ff 2i h1o3xd5kka api signature generation the request for creating checkout order requires a header signature this can be generated using following code snippet import javax crypto mac import javax crypto spec secretkeyspec class signature { fun getpay3signature(secretkey string, requestid string, fiatamount string, currencyid string) string { return try { val stringtosign = "currencyid=$currencyid\&fiatamount=$fiatamount\&requestid=$requestid" val mac = mac getinstance("hmacsha256") val secretkeyspec = secretkeyspec(secretkey tobytearray(), "hmacsha256") mac init(secretkeyspec) val hash = mac dofinal(stringtosign tobytearray(charsets utf 8)) base64 getencoder() encodetostring(hash) } catch (e exception) { throw runtimeexception("error generating signature", e) } } }const crypto = require('crypto'); // required parameters const secretkey="api secret provided by pay3"; const fiatamount = "0 02"; const requestid = "order id generated by application"; const clientid = "your client id"; const accesstoken = "dynamic access token"; const getsignature = (secretkey, fiatamount, requestid) => { // prepare the string to sign in same format // fiatamount followed by requestid const stringtosign = 'fiatamount=' + fiatamount + '\&requestid=' + requestid; // generating signature using sha256 and provided secret and // base64 encode the result const mac = crypto createhmac('sha256', secretkey); return mac update(stringtosign) digest('base64'); } // generate signature const signature = getsignature(secretkey, fiatamount, requestid);