API Documentation
Create Payout Order
2 min
this api creates a payout order to enable users to withdraw funds 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 transactions docid 5yeehtutj0mhyfy85crkd this api requires access token that can be generated using access token docid\ gi jr7m modsx5dxyfrw api { "name" "create payout order", "method" "post", "url" "https //your hostname pay3 app/v1/client/payout/create order", "description" "create an order with payout details from application's backend", "tab" "examples", "examples" { "languages" \[ { "id" "exhyhl9rwxfgu lg6oq1q", "language" "curl", "code" "curl location 'https //your hostname pay3 app/v1/client/payout/create order' \\\\\n header 'signature' \\"generated signature\\"\\\\\n header 'access token' \\"dynamic access token\\" \\\\\n header 'accept application/json' \\\\\n header 'content type application/json' \\\\\n data '{\n \\"currencyid\\" \\"currency id\\",\n \\"fiatamount\\" \\"0 02\\",\n \\"requestid\\" \\"9824649238\\",\n \\"paymentmethodid\\" \\"payment method id\\",\n \\"email\\" \\"user\@address com\\",\n \\"clientid\\" \\"your client id\\",\n \\"firstname\\" \\"john\\",\n \\"lastname\\" \\"doe\\",\n \\"taxid\\" \\"tax id\\"\n}'", "customlabel" "" } ], "selectedlanguageid" "exhyhl9rwxfgu lg6oq1q" }, "results" { "languages" \[ { "id" "vqyrchsr38ubbehatupjh", "language" "200", "customlabel" "", "code" "{\n \\"requestid\\" \\"9824649238\\",\n \\"token\\" \\"a35dc551 9fb4 491c 9f9b 44d9c2ef4b32\\",\n \\"offerinfodata\\" {\n \\"clientid\\" \\"your client id\\",\n \\"currencyid\\" \\"currency id\\",\n \\"onramppartner\\" \\"partner id\\",\n \\"requestmetadata\\" {\n \\"lastname\\" \\"doe\\",\n \\"firstname\\" \\"john\\",\n \\"requestid\\" \\"9824649238\\",\n \\"signature\\" \\"generated signature\\"\n },\n \\"selectedpaymentmethod\\" \\"payment method id\\",\n \\"totalfiatamount\\" \\"0 02\\",\n \\"type\\" \\"payout\\",\n \\"useraddress\\" \\"user\@address com\\"\n }\n}\n" }, { "id" "66dvgm2ssfyrrj4nnmnj1", "language" "400", "code" "{\n error {\n code '7001',\n message 'order already exists for given requestid'\n }\n}", "customlabel" "" } ], "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 application's backend this will be passed in relevant events and webhooks from pay3 to application", "children" \[] }, { "name" "currencyid", "kind" "required", "type" "string", "description" "currency id supported in the payout flow this will be provided by pay3 during onboarding" }, { "name" "fiatamount", "kind" "required", "type" "string", "description" "amount user can withdraw in string format maximum two decimal places are allowed", "children" \[] }, { "name" "paymentmethodid", "kind" "required", "type" "string", "description" "unique string identifier this will be provided by pay3 during onboarding ", "children" \[] }, { "name" "email", "kind" "required", "type" "string", "description" "user email to identify the user, which will be available in reporting dashboard", "children" \[] }, { "name" "userid", "kind" "optional", "type" "string", "description" "it is a type of uuid it will used as unique identifier of the user if this is not passed, email will be used as a unique identifier of the user within pay3 ", "" "it is a type of uuid it will used as unique identifier of the user if this is not passed, email will be used as a unique identifier of the user within pay3 " }, { "name" "clientid", "kind" "required", "type" "string", "description" "client id application's identifier", "children" \[] }, { "name" "firstname", "kind" "optional", "type" "string", "description" "optional first name of the user", "children" \[] }, { "name" "lastname", "kind" "optional", "type" "string", "description" "optional last name of the user", "children" \[] }, { "name" "taxid", "kind" "optional", "type" "string", "description" "tax id issued to the user by their country", "children" \[] }, { "name" "pixkey", "kind" "optional", "type" "string", "description" "pix key is a unique identifier that links to a brazilian user’s bank account and determines where the funds will be received ", "children" \[] }, { "name" "mode", "kind" "optional", "type" "string", "description" "mode can accept values like bank, cpf, pix etc pixkey is mandatory if mode is set to pix ", "children" \[] } ], "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 currencyid = "currency id"; const fiatamount = "0 02"; const requestid = "order id generated by application"; const clientid = "your client id"; const accesstoken = "dynamic access token"; const getsignature = (secretkey, currencyid, fiatamount, requestid) => { // prepare the string to sign in same format // currencyid followed by fiatamount followed by requestid const stringtosign = 'currencyid=' + currencyid + '\&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, currencyid, fiatamount, requestid);