CRM Open API DocumentationCRM Open API Documentation
REST API
Webhooks
PSP Open API
External Exchange Rates
REST API
Webhooks
PSP Open API
External Exchange Rates
  • REST API Introduction
  • Authentication
  • Authentication V2
  • Clients API

    • Get List of Client
    • Get Client Information
    • Get Client Registration Details
    • Get Client KYC Details
    • Validate User's Credentials
    • Create Client
    • Get Uplines Information of client
    • Get Downlines Information of client
  • Leads API

    • Create Lead
  • Trading Servers Connections API

    • Get CRM Trading Platform Connections
  • MT4 API

    • Get MT4 Connection Information
    • Get MT4 Accounts
    • Create MT4 Account
    • Deposit into MT4 Account
    • Withdraw from MT4 Account
    • Get MT4 Trades
  • MT5 API

    • Get MT5 Connection Information
    • Get MT5 Accounts
    • Create MT5 Account
  • cTrader API

    • Get cTrader Connection Information
    • Get cTrader Accounts
  • Reports API

    • Get Fixed Commission Report
    • Get Flexible Commission Report
    • Get Transactions Report
  • Wallets API

    • Get Wallet Information
    • Update Wallet Balance
    • Get Update Wallet Balance Order status
  • Payments API

    • Get All Bankcards
  • Trading Competitions API

    • Get Trading Competition Leader Board
  • Requests API

    • Approve Withdrawal Requests
    • Reject Withdrawal Requests
  • Accounts API

    • Send Registration Request for OTP
    • Send Multi-Step Registration Request for Approval
  • Configurations API

    • Get Countries
    • Get States
    • Get Cities
  • Forms API

    • Get Trader Registration Form
    • Get User Kyc Form Collections
    • Get User Kyc Form
    • Get AWS S3 signature
  • TradingAccounts API

    • Get CRM Trading Account Types
  • Annex

    • Language Codes

Authentication V2

This section is critical, authentication is REQUIRED for accessing every open APIs.

Create API Key

  1. Navigate to CRM Back Office - Settings - Dev Space - Open API Keys Page
  2. Create an API Key

Note:

API Key will only display one time after creation. Please copy and save your API Key into a secure location. If you lose your API key, please delete and create another.

Warning

For data security, please ensure that the API key is kept safely.

Key Authentication

Requesting every API in this documentation requires authentication via the above API key. Please attach the API key as a http header of the request.

HTTP Headervalue
keyAPI Key created from CRM

Signature

Any POST/PATCH/PUT API that contains a request body will need to sign the request and provide the signature as a HTTP header.

HTTP Headervalue
signaturecalculated using the algorithm below

Signature Algorithm

  1. Calculate a hash using your SECRET_TOKEN, and ensure that the result matches the hash from CRM. CRM uses an HMAC hex digest to compute the hash.

Note

If your language and server implementation specifies a character encoding, ensure that you handle the payload as UTF-8.

Sample JavaScript code to obtain the signature

Ruby
def generate_signature(payload_body)
  signature = 'sha256=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), ENV['API_KEY'], payload_body)
  return signature
end
PHP
<?php
    use Psr\Http\Message\RequestInterface;
    
    function generate_signature(RequestInterface $req) {
        $API_KEY = getenv('API_KEY');
        $signature = hash_hmac('sha256', json_encode($req->getBody()), $API_KEY);
        $trusted = 'sha256=' . $signature;
        return $trusted;
    }
?>
Python
import hashlib
import hmac
def generate_signature(payload_body, api_key):
    hash_object = hmac.new(api_key.encode('utf-8'), msg=payload_body, digestmod=hashlib.sha256)
    expected_signature = "sha256=" + hash_object.hexdigest()
    return expected_signature
Javascript
let encoder = new TextEncoder();

async function generateSignature(api_key, payload) {
	const trusted_signature = crypto
	    .createHmac('sha256', key)
	    .update(JSON.stringify(payload))
	    .digest('hex');
	const trusted = Buffer.from(`sha256=${trusted_signature}`, 'ascii');
	return trusted;
}
Typescript
import * as crypto from "crypto";

const API_KEY: string = process.env.API_KEY;

const generateSignature = (req: Request) => {
  const signature = crypto
    .createHmac("sha256", API_KEY)
    .update(JSON.stringify(req.body))
    .digest("hex");
  let trusted = Buffer.from(`sha256=${signature}`, 'ascii');
  return trusted;
};

Error Codes

HTTP CodeError TypeDescription
403invalid_api_keyAPI key is not exist or invalid
403invalid_signatureSignature does not match
Last Updated:: 8/26/24, 7:57 AM
Prev
Authentication