API Documentation
Create Crypto Payout Order
2 min
this api creates a payout order to enable users to withdraw funds it accepts address , currency , clientid and amount this api requires access token that can be generated using access token docid\ lq v6ff 2i h1o3xd5kka api { "name" "create crypto payout order", "method" "post", "url" "https //your hostname pay3 app/v1/client/crypto payout/create order", "description" "create an order with payin details from application's backend", "tab" "examples", "examples" { "languages" \[ { "id" "nyfshp7j nrsuqth3fw7t", "language" "curl", "code" "curl location 'https //api dev pay3 app/v1/client/crypto payout/create order' \\\\\n header 'signature {{signature}}' \\\\\n header 'access token {dynamic access toke}' \\\\\n header 'content type application/json' \\\\\n data '{\n \\"clientid\\" \\"52e6b785 afa2 4e8a 9a9d cb86408c5af6\\",\n \\"requestid\\" \\"f5bb66a0 298f 4016 9681 beecfa6b7459\\",\n \\"amount\\" \\"3 14\\",\n \\"currency\\" \\"usdc amoy\\",\n \\"address\\" \\"0x5fc0d01a67e756a15b8eb56937fcb382637e8d2\\",\n \\"mode\\" \\"returnurl\\"\n }", "customlabel" "" } ], "selectedlanguageid" "nyfshp7j nrsuqth3fw7t" }, "results" { "languages" \[ { "id" "vqyrchsr38ubbehatupjh", "language" "200", "customlabel" "", "code" "{\n \\"token\\" \\"b5ed337a e299 4f2b aa76 50c68097d9c1\\",\n \\"requestid\\" \\"447cc3d0 0432 4c24 b515 1ea0a6c2888e\\",\n \\"url\\" \\"https //dev ui pay3 app/web sdk crypto/52e6b785 afa2 4e8a 9a9d cb86408c5af6?referrer=https //dev ui pay3 app\&action=crypto payout\&data=eyjyzxf1zxn0swqioii0nddjyznkmc0wndmyltrjmjqtyjuxns0xzwewytzjmjg4oguilcj0b2tlbii6imi1zwqzmzdhlwuyotktngyyyi1hytc2ltuwyzy4mdk3zdljmsj9\&lang=en\\"\n}" }, { "id" "tivoqbuskgnrqallvndvq", "language" "401", "customlabel" "", "code" "{\n error {\n code '7001',\n message 'order already exists for given requestid'\n }\n}" } ], "selectedlanguageid" "vqyrchsr38ubbehatupjh" }, "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "name" "signature", "kind" "required", "type" "string", "description" "signature generated with sha256 followed by base64 encoding check below section for more details", "children" \[] }, { "name" "access token", "kind" "required", "type" "string", "description" "access token received from access token api you can reuse the access token across multiple api calls till it is expired", "children" \[] } ], "bodydataparameters" \[ { "name" "requestid", "kind" "required", "type" "string", "description" "identifier that is created by client application's backend this will be passed in relevant events and webhooks from pay3 to application", "children" \[] }, { "name" "address", "kind" "required", "type" "string", "description" "the address is the destination wallet address where the crypto token currency will be deposited after the payout is processed (user's wallet address should be passed in this)", "" "the address is the destination wallet address where the crypto token currency will be deposited after the payout is processed (user's wallet address should be passed in this)" }, { "name" "currency", "kind" "required", "type" "string", "description" "the currency is pay3's unique string id denoting the token that needs to be purchased example value are btc bitcoin, usdt polygon, uni eth " }, { "name" "amount", "kind" "required", "type" "string", "description" "the amount in ethereum / btc user needs to pay ", "" "the amount in ethereum / btc user needs to pay " }, { "name" "clientid", "kind" "required", "type" "string", "description" "client id application's identifier", "children" \[] }, { "name" "mode", "kind" "optional", "type" "string", "description" "when the mode is set to returnurl, the api response includes an additional field url, which provides a direct checkout page link for accepting crypto payments the supported values for mode are returnurl and default \n", "" "when the mode is set to returnurl, the api response includes an additional field url, which provides a direct checkout page link for accepting crypto payments the supported values for mode are returnurl and default \n" }, { "name" "callbackurl", "kind" "optional", "type" "string", "description" "application can provide a url in this parameter after completion of the transaction, user will be redirected to this url an additional parameter data query parameter will be added to the url ", "" "callbackurl" }, { "name" "sponsorfee", "kind" "optional", "type" "boolean", "description" "when sponsorfee is set to true, the exact amount is sent to the destination address (user's address) without deducting fees ", "" "when sponsorfee is set to true, the exact amount is sent to the destination address (user's address) without deducting fees " } ], "formdataparameters" \[] }, "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } signature generation the request for creating payout order requires a header signature this can be generated using following javascript code snippet const crypto = require('crypto'); // required parameters const secretkey="api secret provided by pay3"; const address = "destination wallet address"; const currency = "currency id"; const amount = "0 02"; const requestid = "order id generated by application"; const getsignature = (secretkey, address, currency, amount, requestid) => { // prepare the string to sign in same format const stringtosign = 'address=' + address + '\¤cy=' + currency + '\&amount=' + amount + '\&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, address, currency, amount, requestid);