FOREX.com Orders API

Trade order placement and management

Operations 4

POST /order/newtradeorder Place a new market trade order #
POST /order/newstoplimitorder Place a new stop or limit order #
POST /order/activeorders List active orders #
POST /order/cancel Cancel an active order #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/forex-com-orders-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

forex-com-orders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: FOREX.com REST Account Orders API
  description: The FOREX.com REST API, hosted at ciapi.cityindex.com/TradingAPI, enables algorithmic traders to authenticate sessions, retrieve real-time and historical price data, execute buy/sell orders across 80+ forex and CFD markets, and manage account balances, positions, and order history programmatically. Authentication uses a session-based header credential obtained from the /session endpoint. A separate FIX API is available for institutional clients.
  version: 1.0.0
  contact:
    name: FOREX.com API Support
    url: https://www.forex.com/en/help-and-support/
    email: support.en@forex.com
  termsOfService: https://www.forex.com/en-us/help-and-support/pricing-and-fees/
  x-api-id: forex-com-trading-api
  x-logo:
    url: https://www.forex.com/favicon.ico
servers:
- url: https://ciapi.cityindex.com/TradingAPI
  description: FOREX.com REST API Base URL
security:
- SessionAuth: []
  UserNameAuth: []
tags:
- name: Orders
  description: Trade order placement and management
paths:
  /order/newtradeorder:
    post:
      operationId: newTradeOrder
      summary: Place a new market trade order
      description: Place a new market price trade order on the FOREX.com platform. Executes immediately at the current market bid/ask price. Supports configurable direction (buy/sell), quantity, stop-loss, take-profit, and price tolerance for slippage control.
      tags:
      - Orders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTradeOrderRequest'
            example:
              Direction: buy
              MarketId: 400616380
              Quantity: 10000
              MarketName: EUR/USD
              TradingAccountId: 12345678
              OfferPrice: 1.08532
              PriceTolerance: 10
              IfDone:
              - Stop:
                  TriggerPrice: 1.075
                  Direction: sell
                  Quantity: 10000
                Limit:
                  TriggerPrice: 1.095
                  Direction: sell
                  Quantity: 10000
      responses:
        '200':
          description: Trade order result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradeOrderResponse'
  /order/newstoplimitorder:
    post:
      operationId: newStopLimitOrder
      summary: Place a new stop or limit order
      description: Place a new stop or limit order that triggers at a specified price. Used for entry orders that execute when the market reaches the TriggerPrice.
      tags:
      - Orders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewStopLimitOrderRequest'
      responses:
        '200':
          description: Stop/limit order result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradeOrderResponse'
  /order/activeorders:
    post:
      operationId: listActiveOrders
      summary: List active orders
      description: Retrieve a list of active (pending) orders for the specified trading account.
      tags:
      - Orders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActiveOrdersRequest'
            example:
              TradingAccountId: 12345678
              MaxResults: 100
      responses:
        '200':
          description: Active orders retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveOrdersResponse'
  /order/cancel:
    post:
      operationId: cancelOrder
      summary: Cancel an active order
      description: Cancel a pending active order by its OrderId.
      tags:
      - Orders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelOrderRequest'
            example:
              TradingAccountId: 12345678
              OrderId: 987654321
      responses:
        '200':
          description: Order cancellation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOrderResponse'
components:
  schemas:
    NewStopLimitOrderRequest:
      type: object
      required:
      - Direction
      - MarketId
      - Quantity
      - TradingAccountId
      - OfferPrice
      - TriggerPrice
      properties:
        Direction:
          type: string
          enum:
          - buy
          - sell
          description: Trade direction
        MarketId:
          type: integer
          description: Market ID for the instrument
        Quantity:
          type: number
          format: double
          description: Trade quantity
        MarketName:
          type: string
          description: Market name
        TradingAccountId:
          type: integer
          description: Trading account ID
        OfferPrice:
          type: number
          format: double
          description: Offer price
        TriggerPrice:
          type: number
          format: double
          description: Price at which the stop/limit order triggers
        IfDone:
          type: array
          items:
            $ref: '#/components/schemas/IfDoneOrder'
    ActiveOrdersRequest:
      type: object
      required:
      - TradingAccountId
      properties:
        TradingAccountId:
          type: integer
          description: Trading account ID
        MaxResults:
          type: integer
          description: Maximum number of results to return
          default: 100
    CancelOrderRequest:
      type: object
      required:
      - TradingAccountId
      - OrderId
      properties:
        TradingAccountId:
          type: integer
          description: Trading account ID
        OrderId:
          type: integer
          description: Order ID to cancel
    ConditionalOrder:
      type: object
      properties:
        TriggerPrice:
          type: number
          format: double
          description: Price at which to trigger the conditional order
        Direction:
          type: string
          enum:
          - buy
          - sell
          description: Direction of the conditional order (opposite of parent order)
        Quantity:
          type: number
          format: double
          description: Quantity for the conditional order
    ActiveOrdersResponse:
      type: object
      properties:
        ActiveOrders:
          type: array
          items:
            $ref: '#/components/schemas/ActiveOrder'
    IfDoneOrder:
      type: object
      properties:
        Stop:
          $ref: '#/components/schemas/ConditionalOrder'
        Limit:
          $ref: '#/components/schemas/ConditionalOrder'
    ActiveOrder:
      type: object
      properties:
        OrderId:
          type: integer
        MarketId:
          type: integer
        MarketName:
          type: string
        Direction:
          type: string
          enum:
          - buy
          - sell
        Quantity:
          type: number
          format: double
        TriggerPrice:
          type: number
          format: double
        Status:
          type: integer
        StatusReason:
          type: integer
    CancelOrderResponse:
      type: object
      properties:
        OrderId:
          type: integer
        StatusReason:
          type: integer
        Status:
          type: integer
    TradeOrderResponse:
      type: object
      properties:
        OrderId:
          type: integer
          description: Order ID assigned to the trade
        StatusReason:
          type: integer
          description: Reason code for order status
        Status:
          type: integer
          description: Order status code
        Price:
          type: number
          format: double
          description: Execution price
        AuditId:
          type: string
          description: Audit ID for the order
    NewTradeOrderRequest:
      type: object
      required:
      - Direction
      - MarketId
      - Quantity
      - TradingAccountId
      - OfferPrice
      properties:
        Direction:
          type: string
          enum:
          - buy
          - sell
          description: Trade direction
        MarketId:
          type: integer
          description: Market ID for the instrument to trade
        Quantity:
          type: number
          format: double
          description: Trade quantity
        MarketName:
          type: string
          description: Market name (e.g. EUR/USD)
        TradingAccountId:
          type: integer
          description: Trading account ID
        OfferPrice:
          type: number
          format: double
          description: Offer (ask) price at time of order
        PriceTolerance:
          type: number
          format: double
          description: Slippage tolerance in pips (default 10)
          default: 10
        IfDone:
          type: array
          description: Conditional stop-loss and take-profit orders
          items:
            $ref: '#/components/schemas/IfDoneOrder'
  securitySchemes:
    SessionAuth:
      type: apiKey
      in: header
      name: Session
      description: Session ID obtained from POST /session
    UserNameAuth:
      type: apiKey
      in: header
      name: UserName
      description: FOREX.com account username
externalDocs:
  description: FOREX.com API Trading Documentation
  url: https://www.forex.com/en/trading-tools/api-trading/