API Documentation
Create Crypto Refund
2 min
this api creates a crypto refund order to enable merchants to refund a successfully processed crypto transaction it accepts amount, orderid and the other order details this api requires access token that can be generated using access token docid\ lq v6ff 2i h1o3xd5kka api { "name" "create refund ", "method" "post", "url" "https //your hostname pay3 app/v1/client/crypto refund/create", "description" "create an order with payout details from application's backend", "tab" "examples", "examples" { "languages" \[ { "id" "exhyhl9rwxfgu lg6oq1q", "language" "curl", "code" "curl location 'https //api pprod pay3 app/v1/client/crypto refund/create' \\\\\n header 'signature {{signature}}' \\\\\n header 'access token eyjrawqioiixymi5nja1yzm2zvrcwkjmohllmdrmcjbkceo2otm4njgzmdiwmmiyzcisinr5cci6ikpxvcisimfszyi6iljtmju2in0 eyjzdwiioii1mmu2yjc4ns1hzmeyltrlogetowe5zc1jyjg2nda4yzvhzjyilcjpc3mioijodhrwczovl3n3mml1zg93atuuzxhly3v0zs1hcgkuyxatc291dggtms5hbwf6b25hd3muy29tl3bwcm9kl3yxl3vzzxitbwfuywdlbwvudc8ud2vsbc1rbm93bi9qd2tzlmpzb24ilcjpyxqioje3ntyznjmxnzysimv4cci6mtc1njm2ndk3nn0 xavbdorw3ygierwhahfd92e5vsggkbn71vtlrugpgrk9ckcaskds8tbp7aoa9f h4ofrzf6geozx6gw3byabnxfd7sjy2cdszxvhqbwshppr6rk4zzyqom43z1zn0 oljbyi6gnh3yuxmitnqhg9yzkg7z8ouskwrmpikwvtajrc h49qneenyzkggdj aqo ks5s5qg1p94m04lizktzb9bie pbijdz6 oorrd48juzluhvu w62khsr4y ntjnj9hhz rtiw3cguu4lw d slzdrzzxfgrh9xe3tbw72szrnyn5ecxhezef89a3c fylyb7nji6pqmfbumprg3g' \\\\\n header 'content type application/json' \\\\\n data '{\n \\"clientid\\" \\"52e6b785 afa2 4e8a 9a9d cb86408c5af6\\",\n \\"orderid\\" \\"46d14be6 b24c 4c80 9c6d 71f65a67c691\\",\n \\"amount\\" \\"1 0\\",\n \\"currency\\" \\"usdc sepolia\\",\n \\"address\\" \\"0xfbd29f6c45649ca60f646d01ab77202d9e37d875\\",\n \\"sponsorfee\\" true,\n \\"requestid\\" \\"0b1b99fa 979e 4d64 adaa 556c02518e0e\\"\n}'", "customlabel" "" } ], "selectedlanguageid" "exhyhl9rwxfgu lg6oq1q" }, "results" { "languages" \[ { "id" "vqyrchsr38ubbehatupjh", "language" "200", "code" "", "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" "orderid", "kind" "required", "type" "string", "description" "the orderid of the parent order, this can be found out from the dashboard ", "" "the orderid of the parent order, this can be found out from the dashboard " }, { "name" "amount", "kind" "required", "type" "string", "description" "amount user can be refunded in string format this amount should be less than or equal to the parent order amount maximum two decimal places are allowed", "" "amount user can be refunded in string format this amount should be less than or equal to the parent order amount maximum two decimal places are allowed" }, { "name" "clientid", "kind" "required", "type" "string", "description" "client id application's identifier", "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 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);