API request must be authorized. This is achieved by including an "x-api-key" and a "signature" in the request headers. The API key is used to identify the SubAccount, while the signature provides a layer of security to verify the request's authenticity.
These are encoded as HTTP headers named
x-api-key (Your API key)
signature (Signature created using your API secret)
Example
Header
Data
Javascript Example
constCryptoJS=require("crypto-js");constaxios=require("axios");constapiDomain="{{API_DOMAIN}}";constapi_key="{{API_KEY}}";constapi_secret="{{API_SECRET}}";asyncfunctionsendRequest () {constapiPath="/api/payout/single";consthttpMethod="POST";let nonce =newDate().getTime();constsignedPayload=`${nonce}.${api_key}`;constexpectedSignature=CryptoJS.HmacSHA256(signedPayload, api_secret).toString();let sig = nonce +"."+ expectedSignature;try {constdata= { receiver_id:"a0bb742e-2b17-4698-be2d-3226c64aec03", account_id:"6dea4c0d-7825-4636-a0b0-c4895d451244", amount:2121, currency:"AUD", reference:"ref2121", note:"Payout for Mike 2121" };constresp=awaitaxios(`${apiDomain}${apiPath}`, { method: httpMethod, headers: {"x-api-key": api_key,"signature": sig, }, data: data });console.log("Result: ",resp.data); } catch (error) {console.log("error",error.response.data); }}sendRequest();