> ## Documentation Index
> Fetch the complete documentation index at: https://api-trading-docs.vexprofx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a market order

> Request an opening trade and receive the MT5 submission response.

## What this operation does

Requires a verified account, trading enabled, and a valid Idempotency-Key. The service returns 400 if the header is missing or its format is invalid. Persist the key and body before submitting; then save the MT5 ID and query its result.

## Complete workflow

See [the step-by-step guide](/trading/orders) and [errors and their handling](/errors).

Playground values are examples. Replace the account, symbol, volume, and price with valid data for your integration.


## OpenAPI

````yaml openapi.json POST /api/v1/orders/market
openapi: 3.1.0
info:
  title: MT5 API — Partner Portal
  description: >-
    Secure endpoints for account ownership verification, market data, and
    trading on previously verified accounts.
  version: 0.1.0
servers:
  - url: https://api-trading.vexprofx.com
    description: API Trading · Partners
security: []
paths:
  /api/v1/orders/market:
    post:
      tags:
        - Trading
      summary: Place a market order
      description: >-
        Filling is automatic for the account and symbol: FOK when allowed,
        otherwise IOC when supported. IOC can execute partially; inspect the
        execution result and positions. Unfilled volume is not automatically
        resubmitted.
      operationId: market_order_api_v1_orders_market_post
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 16
            maxLength: 128
            pattern: ^[A-Za-z0-9._:-]{16,128}$
            example: 550e8400-e29b-41d4-a716-446655440000
          description: >-
            Persisted key for this intent. Reuse the same key and body when
            retrying; use a new key for another opening or closing order.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarketOrderRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Market Order Api V1 Orders Market Post
        '400':
          description: Missing or invalid Idempotency-Key.
        '409':
          description: Key reused with different data or request still pending.
        '422':
          description: Invalid request or incompatible closing parameters.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: string
              example:
                detail: Invalid request
      security:
        - HTTPBearer: []
components:
  schemas:
    MarketOrderRequest:
      properties:
        login:
          type: integer
          exclusiveMinimum: 0
          title: Login
          description: Trading account login.
          examples:
            - 104205
          example: 104205
        symbol:
          type: string
          maxLength: 32
          minLength: 1
          pattern: ^[A-Za-z0-9._-]+$
          title: Symbol
          description: MT5 symbol name.
          examples:
            - EURUSD
          example: EURUSD
        volume:
          type: integer
          exclusiveMinimum: 0
          title: Volume
          description: 'MT5 volume units: 100 = 0.01 lots; 10000 = 1 lot.'
          examples:
            - 100
          example: 100
        side:
          type: string
          enum:
            - buy
            - sell
          title: Side
          description: Order direction.
          examples:
            - buy
          example: buy
        price:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Price
          description: >-
            Legacy explicit price; send together with digits or omit both for
            automatic pricing.
          deprecated: true
        digits:
          anyOf:
            - type: integer
              maximum: 10
              minimum: 0
            - type: 'null'
          title: Digits
          description: >-
            Legacy price decimals; omit with price to use the symbol
            configuration.
          deprecated: true
        comment:
          type: string
          maxLength: 31
          title: Comment
          description: Order comment stored in MT5.
          default: REST API
      additionalProperties: false
      type: object
      required:
        - login
        - symbol
        - volume
        - side
      title: MarketOrderRequest
      examples:
        - comment: REST API
          login: 104205
          side: buy
          symbol: EURUSD
          volume: 100
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        Send the provider-issued token in the Authorization header using Bearer
        authentication.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.