API Documentation

This document provides details for the available APIs for interacting with the platform.

Base URL: <url of your website>

All API requests should be made to the base URL followed by the specific API Name (endpoint path).


1. Get Account Details

API Name: /getAccount

Endpoint: <url of your website>/getAccount

Description: This API is used to retrieve the account details for a specific user.

Request: POST

Request Body (JSON):


{
  "user_id": "<Account No>",
  "pwd": "<KEEP IT EMPTY>",
  "supervisor_id": "900003",
  "supervisor_pwd": "Your password here",
  "supervisor_type": "ADMIN"
}
            

Parameters:

Parameter Type Description Required
user_id String The account number of the user. Yes
pwd String This field should be kept empty. Yes
supervisor_id String The ID of the supervising ADMIN. Yes
supervisor_pwd String The password for the supervising ADMIN. Yes
supervisor_type String The type of supervisor (e.g., "ADMIN"). Yes

Response:

*Note: The specific structure and details of the response are not provided in the input. Typical responses would include account information such as balance, equity, leverage, etc., and a status indicating success or failure.*

2. Get All Transactions

API Name: /getTransactions

Endpoint: <url of your website>/getTransactions

Description: This API is used to retrieve all deposit and withdrawal transactions for a specific user within a given date range.

Request: POST

Request Body (JSON):


{
  "from_dt": "YYYY-MM-DD HH:MM:SS",
  "to_dt": "YYYY-MM-DD HH:MM:SS",
  "user_id": "<Account No>",
  "trans_id": "",
  "comment": "test",
  "supervisor_id": "900003",
  "supervisor_pwd": "Your password here",
  "supervisor_type": "ADMIN"
}
            

Parameters:

Parameter Type Description Required
from_dt String The start date and time for the transaction search (format: YYYY-MM-DD HH:MM:SS). Yes
to_dt String The end date and time for the transaction search (format: YYYY-MM-DD HH:MM:SS). Yes
user_id String The account number of the user. Yes
trans_id String To get a particular transaction ID. Send empty for all transactions in the range. Yes
comment String A comment for the request (e.g., "test"). Yes
supervisor_id String The ID of the supervising ADMIN. Yes
supervisor_pwd String The password for the supervising ADMIN. Yes
supervisor_type String The type of supervisor (e.g., "ADMIN"). Yes

Response:

*Note: The specific structure and details of the response are not provided in the input. Typical responses would include a list of transaction objects, each containing details like transaction ID, type (deposit/withdrawal), amount, date/time, status, etc., and a status indicating success or failure.*

3. Get All Open Positions

API Name: /getPositions

Endpoint: <url of your website>/getPositions

Description: This API is used to retrieve all open trading positions for a specific user, with optional filtering.

Request: POST

Request Body (JSON):


{
  "from_dt": "YYYY-MM-DD HH:MM:SS",
  "to_dt": "YYYY-MM-DD HH:MM:SS",
  "user_id": "<Account No>",
  "volume": 0.0,
  "side": "<Whichever Side Required BUY OR SELL/ If Both Required Send Empty>",
  "position_id": "<To get A Particular Position/Else Send Empty>",
  "symbol": "<To get A Particular Pair Position/Else Send Empty>",
  "supervisor_id": "900003",
  "supervisor_pwd": "Your password here",
  "supervisor_type": "ADMIN",
  "group_id": ""
}
            

Parameters:

Parameter Type Description Required
from_dt String The start date and time for the position search (format: YYYY-MM-DD HH:MM:SS). Yes
to_dt String The end date and time for the position search (format: YYYY-MM-DD HH:MM:SS). Yes
user_id String The account number of the user. Yes
volume Number Filter by volume. Send 0.0 to get all positions. Yes
side String Filter by position side. Use "BUY", "SELL", or send empty for both. Yes
position_id String To get a particular position by ID. Send empty to get all positions in the range. Yes
symbol String To get positions for a particular trading pair/symbol. Send empty for all symbols. Yes
supervisor_id String The ID of the supervising ADMIN. Yes
supervisor_pwd String The password for the supervising ADMIN. Yes
supervisor_type String The type of supervisor (e.g., "ADMIN"). Yes
group_id String Filter by group ID. Send empty for all groups. Yes

Response:

*Note: The specific structure and details of the response are not provided in the input. Typical responses would include a list of open position objects, each containing details like position ID, symbol, side, volume, open price, current price, profit/loss, etc., and a status indicating success or failure.*

4. Create A New Account

API Name: /account

Endpoint: <url of your website>/account

Description: This API is used to create a new user account on the platform.

Request: POST

Request Body (JSON):


{
  "zip_code": "",
  "with_addr": "",
  "server": "",
  "admin_id": "",
  "ADMIN_id": "900001",
  "group_id": "1000002",
  "api_pwd": "A%123456a",
  "pwd": "A%123456a",
  "investor_pwd": "investor@123",
  "balance": "0",
  "blocked": "0",
  "enableTrading": "1",
  "enableAlgoTrading": "1",
  "showRegularADMIN": 0,
  "includeServerReports": "0",
  "enableDailyReports": "1",
  "enableApiConnections": "1",
  "limitTotalValue": "0",
  "limitTotalOrders": "1000",
  "language": "en",
  "acct_mode": "1",
  "address": "",
  "city": "",
  "state": "",
  "first_name": "Kumawat",
  "middle_name": "Kumawat",
  "comment": "",
  "last_name": "",
  "type": "USER",
  "status": "Incomplete",
  "kyc_status": "Not Approved",
  "group": "RawSpread",
  "country": "Angola",
  "currency": "USD",
  "email": "[email protected]",
  "phone": "",
  "leverage": "500",
  "supervisor_id": "900003",
  "supervisor_pwd": "Your password here",
  "supervisor_type": "ADMIN",
  "company": ""
}
            

Parameters:

Parameter Type Description Required
zip_code String The zip code of the user. Optional
with_addr String (Description not provided) Optional
server String The server for the account. Optional
admin_id String The admin ID associated with the account. Optional
ADMIN_id String The ADMIN ID for the account. Yes
group_id String The group ID the account belongs to. Yes
api_pwd String The API password for the account. Yes
pwd String The main password for the account. Yes
investor_pwd String The investor password for the account. Yes
balance String The initial balance for the account. Yes
blocked String Indicates if the account is blocked (0 for not blocked, 1 for blocked). Yes
enableTrading String Enable trading for the account (1 for yes, 0 for no). Yes
enableAlgoTrading String Enable Algo trading for the account (1 for yes, 0 for no). Yes
showRegularADMIN Number (Description not provided) Yes
includeServerReports String Include server reports (1 for yes, 0 for no). Yes
enableDailyReports String Enable daily reports (1 for yes, 0 for no). Yes
enableApiConnections String Enable API connections for the account (1 for yes, 0 for no). Yes
limitTotalValue String Limit the total value (0 for no limit). Yes
limitTotalOrders String Limit the total number of open orders. Yes
language String The preferred language for the account (e.g., "en"). Yes
acct_mode String Account mode (1 for real, 0 for demo). Yes
address String The address of the user. Optional
city String The city of the user. Optional
state String The state/province of the user. Optional
first_name String The first name of the user. Yes
middle_name String The middle name of the user. Optional
comment String A comment for the account. Optional
last_name String The last name of the user. Yes
type String The type of user (e.g., "USER"). Yes
status String The status of the account (e.g., "Incomplete"). Yes
kyc_status String The KYC status of the account (e.g., "Not Approved"). Yes
group String The group name the account belongs to (e.g., "RawSpread"). Yes
country String The country of the user (e.g., "Angola"). Yes
currency String The currency of the account (e.g., "USD"). Yes
email String The email address of the user. Yes
phone String The phone number of the user. Optional
leverage String The leverage for the account (e.g., "500"). Yes
supervisor_id String The ID of the supervising ADMIN. Yes
supervisor_pwd String The password for the supervising ADMIN. Yes
supervisor_type String The type of supervisor (e.g., "ADMIN"). Yes
company String The company name associated with the account. Optional

Response:

*Note: The specific structure and details of the response are not provided in the input. Typical responses would include the newly created account's details (including the generated account number if not provided), and a status indicating success or failure.*

5. Deposit Or Withdraw Funds

API Name: /deposit or /withdraw

Endpoint: <url of your website>/deposit or <url of your website>/withdraw

Description: These APIs are used to deposit or withdraw funds from a user's account.

Request: POST

Request Body (JSON):


{
  "uid": "<Account No>",
  "fund_amt": "<Amount To Be Added/Removed>",
  "dt": "YYYY-MM-DD HH:MM:SS",
  "group": "",
  "name": "",
  "supervisor_id": "900003",
  "supervisor_pwd": "Your password here",
  "supervisor_type": "ADMIN",
  "fund_type": "BALANCE"
}
            

Parameters:

Parameter Type Description Required
uid String The account number of the user. Yes
fund_amt String The amount to be deposited or withdrawn. Yes
dt String The date and time of the transaction (format: YYYY-MM-DD HH:MM:SS). Yes
group String (Description not provided) Optional
name String (Description not provided) Optional
supervisor_id String The ID of the supervising ADMIN. Yes
supervisor_pwd String The password for the supervising ADMIN. Yes
supervisor_type String The type of supervisor (e.g., "ADMIN"). Yes
fund_type String The type of fund transaction (e.g., "BALANCE"). Yes

Response:

*Note: The specific structure and details of the response are not provided in the input. Typical responses would include a confirmation of the transaction, the resulting account balance, and a status indicating success or failure.*

6. Create A New Group

API Name: /createGroup

Endpoint: <url of your website>/createGroup

Description: This API is used to create a new trading group on the platform.

Request: POST

Request Body (JSON):


{
  "gname": "<GROUP NAME>",
  "server": "COMPANY NAME",
  "company": "",
  "gtype": "2",
  "auth": "1",
  "otp": "0",
  "currency": "USD",
  "digits": 2,
  "symbols": "",
  "enable_deal_cost": 0,
  "enable_swaps": 0,
  "enable_hedge": 0,
  "enable_expert_Advisors": 0,
  "compensate_negative_balance": 0,
  "stop_out_fully_hedged": 0,
  "virtual_credit": 0,
  "daily_fixed_profit": "use unrealized profit/loss",
  "unrealized_profit": "use unrealized profit/loss",
  "margin_risk_management": "",
  "leverage": 500,
  "max_orders": 0,
  "available_history": 1,
  "withdrawal_url": "",
  "deposit_url": "",
  "company_email": "",
  "company_site": "",
  "interest_rate": 0,
  "margin_call_level": 90,
  "stop_out_level": 10,
  "push_notifications": "1",
  "support_email": "",
  "support_site": "",
  "generate_statement_client": 0,
  "generate_statement_email": 0,
  "generate_copies": 0,
  "template_folder": "",
  "trading_signals": 1,
  "transfer_funds": 1,
  "max_symbols": 100,
  "max_positions": 500,
  "enable_connections": 1,
  "enable_certificate_confirmation": 0,
  "change_password_at_first_login": 0,
  "show_risk_window_after_con": 0,
  "min_password_length": 8,
  "force_otp_usage": 0,
  "admin_id": "100001",
  "ADMIN_id": "900003",
  "generate_report_data": 1,
  "level_in": "%",
  "floating_leverage_profile": "",
  "deposit_by_default": 0,
  "enforce_country_regulatory": 0,
  "enable_trailing_stops": 0,
  "enable_position_fifo_rule": 0,
  "groupSuffix": "<GROUP SYMBOL SUFFIX>"
}
            

Parameters:

Parameter Type Description Required
gname String The name of the new group. Yes
server String The server associated with the group (e.g., "COMPANY NAME"). Yes
company String The company associated with the group. Optional
gtype String Group type (e.g., "2"). Yes
auth String Authentication setting (e.g., "1"). Yes
otp String OTP setting (e.g., "0"). Yes
currency String The default currency for the group (e.g., "USD"). Yes
digits Number Number of digits for symbols in the group. Yes
symbols String Specific symbols allowed in the group (leave empty for all or specify). Optional
enable_deal_cost Number Enable deal cost (0 for no, 1 for yes). Yes
enable_swaps Number Enable swaps (0 for no, 1 for yes). Yes
enable_hedge Number Enable hedging (0 for no, 1 for yes). Yes
enable_expert_Advisors Number Enable Expert Advisors (0 for no, 1 for yes). Yes
compensate_negative_balance Number Compensate negative balance (0 for no, 1 for yes). Yes
stop_out_fully_hedged Number Stop out fully hedged positions (0 for no, 1 for yes). Yes
virtual_credit Number Virtual credit setting. Yes
daily_fixed_profit String Daily fixed profit setting (e.g., "use unrealized profit/loss"). Yes
unrealized_profit String Unrealized profit setting (e.g., "use unrealized profit/loss"). Yes
margin_risk_management String Margin risk management profile. Optional
leverage Number The leverage for the group (e.g., 500). Yes
max_orders Number Maximum number of open orders allowed (0 for no limit). Yes
available_history Number Available history in days. Yes
withdrawal_url String Withdrawal URL. Optional
deposit_url String Deposit URL. Optional
company_email String Company email. Optional
company_site String Company website. Optional
interest_rate Number Interest rate. Yes
margin_call_level Number Margin call level percentage. Yes
stop_out_level Number Stop out level percentage. Yes
push_notifications String Enable push notifications (1 for yes, 0 for no). Yes
support_email String Support email. Optional
support_site String Support website. Optional
generate_statement_client Number Generate statements for client (0 for no, 1 for yes). Yes
generate_statement_email Number Generate statements via email (0 for no, 1 for yes). Yes
generate_copies Number Generate copies (0 for no, 1 for yes). Yes
template_folder String Template folder for reports/statements. Optional
trading_signals Number Enable trading signals (0 for no, 1 for yes). Yes
transfer_funds Number Enable fund transfers (0 for no, 1 for yes). Yes
max_symbols Number Maximum number of symbols allowed per account in this group. Yes
max_positions Number Maximum number of open positions allowed per account in this group. Yes
enable_connections Number Enable connections (0 for no, 1 for yes). Yes
enable_certificate_confirmation Number Enable certificate confirmation (0 for no, 1 for yes). Yes
change_password_at_first_login Number Force password change on first login (0 for no, 1 for yes). Yes
show_risk_window_after_con Number Show risk warning window after connection (0 for no, 1 for yes). Yes
min_password_length Number Minimum password length required. Yes
force_otp_usage Number Force OTP usage (0 for no, 1 for yes). Yes
admin_id String Admin ID associated with the group. Yes
ADMIN_id String ADMIN ID associated with the group. Yes
generate_report_data Number Generate report data (0 for no, 1 for yes). Yes
level_in String Level indicator (e.g., "%"). Yes
floating_leverage_profile String Floating leverage profile name. Optional
deposit_by_default Number Deposit by default setting (0 for no, 1 for yes). Yes
enforce_country_regulatory Number Enforce country regulatory settings (0 for no, 1 for yes). Yes
enable_trailing_stops Number Enable trailing stops (0 for no, 1 for yes). Yes
enable_position_fifo_rule Number Enable position FIFO rule (0 for no, 1 for yes). Yes
groupSuffix String Suffix to add to symbols for this group. Yes

Response:

*Note: The specific structure and details of the response are not provided in the input. Typical responses would include confirmation of group creation, the assigned group ID, and a status indicating success or failure.*