Getting Started
Crypto Payout Server-Side API
6 min
this document explains how to create a crypto payout order and process user withdrawals using a backend only, server to server api without any user interface the create crypto payout order api creates a payout order and returns the parameters required to process the withdrawal when mode=createexecute is passed, no website url or ui is generated instead, the api response includes the token and requestid , along with the estimatedfees and estimatednetamount for the payout once you receive these parameters, your backend can call the execute crypto payout order api to complete the withdrawal this final api asyncronously submits the transaction to blockchain pay3 backend sends events to your backend service with real time updates on the payout status when you receive an event, you may call the order details api to fetch the latest payout information steps step 1 get access token to generate the access token, you will call the api with the api secret and client id please refer to the access token docid\ lq v6ff 2i h1o3xd5kka step 2 create a signature with parameters the payout request requires a signature in the header this can be generated using the javascript code snippet here create crypto payout order docid ma9ywvaybfe7qkrhqhwg step 3 call create crypto payout order docid ma9ywvaybfe7qkrhqhwg api send the required parameters and ensure mode = 'createestimate' is enabled the response will include token, requestid, currency, address, estimatedfees, estimatednetamount sample payload const payloadcryptopayout = { "requestid" "a1d4a50e 5577 4581 a980 98b03bc76260", // todo application’s order id, send unique id for every order (preferably uuid) "address" "tb1 ", // todo add your address to receive the usdt "currency" "btc bitcointestnet", // please reach out to pay3 team for enabled currencies in your clientid "amount" "0 001", // amout of bitcoin (in this case) "clientid" " ",// todo your clientid "payeremail" "user\@email com", //pass the email fo the user (uniqueid) "mode" "createestimate" } sample response { "token" "a003d60c d0ae 40e5 a7cb 2634ab607253", "requestid" "a1d4a50e 5577 4581 a980 98b03bc76260", "currency" "btc bitcointestnet", "address" "tb1q7sqtxktz3jle8evmfnnhv45s0maudwdtknmdqu", "warning" "the btc bitcointestnet balance (0 0031) is below the configured threshold (100 0000) ", "estimatedfees" "0 000066", "estimatednetamount" "0 000034" } step 4 call the execute crypto payout order docid 9yybpnibl2corbcyh2dz7 api using the clientid , token, requestid, call the execute crypto payout order api this api processes the payout and returns the final payout result sample payload const payloadcryptopayout = { "token" "a003d60c d0ae 40e5 a7cb 2634ab607253", "requestid" "a1d4a50e 5577 4581 a980 98b03bc76260", "clientid" " " } sample response { "txnhash" " ", "ordertype" "payout", "orderid" "3b5a941c efef 4125 9237 3216ddd6f607", "requestid" "a1d4a50e 5577 4581 a980 98b03bc76260", "status" "order payment processing" } step 5 listen for webhook events pay3 backend sends webhook notifications with status updates upon receiving an event, you may call the get cryptoorder details docid\ nzzqblpdfmg7mfy3otpvs to retrieve the latest payout details