# Get Order by Order ID

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/account/orders/{order_id}:
    get:
      summary: Get Order by Order ID
      deprecated: false
      description: >-
        Get information about an existing order using the exchange generated
        order_id.


        Will only return orders with activity in the last 24 hours; older orders
        return `404`. Use `GET /v1/account/orders` for order history.


        Requires any valid API key. This endpoint is rate-limited per account
        holder.
      tags:
        - One Trading Public REST API/Trading
      parameters:
        - name: order_id
          in: path
          description: The order ID to fetch order details for
          required: true
          example: 83c81e54-7384-47d4-09d1-57af45314fa1
          schema:
            type: string
            format: uuid
      responses:
        '200':
          x-apidog-name: Success
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  order:
                    $ref: '#/components/schemas/Order'
                  trades:
                    type: array
                    items:
                      type: object
                      properties:
                        fee:
                          $ref: '#/components/schemas/Fee'
                        trade:
                          $ref: '#/components/schemas/Trade'
                      x-apidog-orders:
                        - fee
                        - trade
                      required:
                        - fee
                        - trade
                      x-apidog-ignore-properties: []
                x-apidog-orders:
                  - order
                  - trades
                required:
                  - order
                  - trades
                x-apidog-ignore-properties: []
              example:
                order:
                  account_id: 726288e6-a463-4f88-9068-024ae8f97a34
                  order_id: 74eaf796-869b-4d49-ab39-2bc4fe10daeb
                  client_id: b8854ae6-4077-404b-ae0c-52a1fe318440
                  amount: '1'
                  side: SELL
                  instrument_code: SOL_EUR
                  order_type: API
                  price: '140'
                  time: '2024-11-13T17:34:55.514Z'
                  time_nanos: '2024-11-13T17:34:55.514123456Z'
                  sequence: '58894260661'
                  total_fee: '0.29'
                  fee_currency: EUR
                  time_last_updated: '2024-11-13T17:34:55.514Z'
                  time_last_updated_nanos: '2024-11-13T17:34:55.514123456Z'
                  order_book_sequence: '58894260661'
                  filled_amount: '1'
                  status: FILLED_FULLY
                  average_price: '145.00'
                trades:
                  - fee:
                      fee_amount: '0.29'
                      fee_currency: EUR
                    trade:
                      trade_id: f99a7e64-5478-44f3-b404-19aac53f2062
                      order_id: 74eaf796-869b-4d49-ab39-2bc4fe10daeb
                      account_id: 726288e6-a463-4f88-9068-024ae8f97a34
                      amount: '1'
                      filled_amount: '1'
                      side: SELL
                      instrument_code: SOL_EUR
                      price: '145'
                      time: '2024-11-13T17:34:55.514Z'
                      time_nanos: '2024-11-13T17:34:55.514123456Z'
                      sequence: '58894260661'
                      matched_as: MAKER
                      order_type: API
          headers: {}
        '400':
          x-apidog-name: Bad Request
          description: Invalid order ID. `error` is `INVALID_PARAMETERS`.
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: INVALID_PARAMETERS
                error_message: Order ID must be a valid UUID
          headers: {}
        '401':
          description: >-
            Unauthorized. The token was accepted by the gateway but rejected by
            the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when
            the API key requires signed requests and the signature is missing or
            invalid.
          content:
            application/json:
              schema: *ref_0
              examples:
                '3':
                  summary: Unauthorized
                  value:
                    error: UNAUTHORIZED
                    error_message: Unauthorized access
                '4':
                  summary: Invalid signature
                  value:
                    error: INVALID_REQUEST_SIGNATURE
                    error_message: The request signature is missing or invalid
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: >-
            Forbidden. Either the gateway rejected the token
            (`{"message":"Forbidden"}`), or the endpoint denied the request,
            e.g. `PERMISSION_DENIED` (API key lacks the required scope, or
            account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.
          content:
            application/json:
              schema:
                oneOf:
                  - *ref_0
                  - $ref: '#/components/schemas/GatewayError'
              examples:
                '5':
                  summary: Gateway
                  value:
                    message: Forbidden
                '6':
                  summary: Permission denied
                  value:
                    error: PERMISSION_DENIED
                    error_message: Permission denied
                '7':
                  summary: Not provisioned
                  value:
                    error: EXCHANGE_ACCOUNT_NOT_PROVISIONED
                    error_message: >-
                      The account is authenticated but has no exchange account
                      yet
          headers: {}
          x-apidog-name: Forbidden
        '404':
          x-apidog-name: Record Not Found
          description: No matching order was found within the lookback window.
          content:
            application/json:
              schema: *ref_0
              example:
                error: ORDER_NOT_FOUND
                error_message: Order not found.
          headers: {}
        '429':
          description: >-
            Rate limit exceeded. Limits are per account holder per minute: 600
            (retail), 2,000 (institutional), 10,000 (market maker).
          content:
            application/json:
              schema: *ref_0
              example:
                error: TOO_MANY_REQUESTS
                error_message: Too many requests
          headers: {}
          x-apidog-name: ''
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema: *ref_0
              example:
                error: SERVER_ERROR
                error_message: An internal server error occurred
          headers: {}
          x-apidog-name: Server Error
      security: []
      x-apidog-folder: One Trading Public REST API/Trading
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/349694/apis/api-3612093-run
components:
  schemas:
    Trade:
      type: object
      properties:
        account_id:
          type: string
          format: uuid
          description: Account ID the trade belongs to
        order_id:
          type: string
          format: uuid
          description: Unique identifier of the order the trade belongs to
        trade_id:
          type: string
          format: uuid
          description: Unique identifier of the trade
        time:
          type: string
          description: The time the trade was executed (ISO 8601, millisecond precision)
          format: date-time
          deprecated: true
        time_nanos:
          type: string
          format: date-time
          description: The time the trade was executed (ISO 8601, nanosecond precision)
        instrument_code:
          type: string
          description: The market identifier for the trade
        side:
          type: string
          enum:
            - BUY
            - SELL
          x-apidog-enum:
            - value: BUY
              name: ''
              description: ''
            - value: SELL
              name: ''
              description: ''
          description: BUY or SELL
        matched_as:
          type: string
          enum:
            - MAKER
            - TAKER
          x-apidog-enum:
            - value: MAKER
              name: ''
              description: ''
            - value: TAKER
              name: ''
              description: ''
          description: MAKER or TAKER
        amount:
          type: string
          description: The quantity that has been executed, expressed in the base currency.
          deprecated: true
        filled_amount:
          type: string
          description: The quantity that has been executed, expressed in the base currency.
        price:
          type: string
          description: The price at which the trade matched at
        sequence:
          type: string
          description: An incremental identifier for tracking the trade in the exchange
        position_id:
          type: string
          description: >-
            Numeric ID (as a string) of the position associated with this trade.
            Present only on futures trades returned by the trades endpoints and
            `GET /v1/account/orders/{order_id}/trades`; never included in trades
            nested in order responses.
        prev_position_id:
          type: string
          description: >-
            Numeric ID (as a string) of the position closed by this trade when
            it causes a position flip (long to short or short to long). Present
            only on futures trades returned by the trades endpoints and `GET
            /v1/account/orders/{order_id}/trades`; never included in trades
            nested in order responses.
        open_position_amount:
          type: string
          description: >-
            The post-execution open position amount. Present only on futures
            trades returned by the trades endpoints and `GET
            /v1/account/orders/{order_id}/trades`; never included in trades
            nested in order responses.
        order_type:
          type: string
          enum:
            - API
            - UI
            - LIQUIDATION
            - TAKE_PROFIT
            - STOP_LOSS
            - INSTANT_TRADE
            - SPOT_LEGACY
            - UNKNOWN
          x-apidog-enum:
            - value: API
              name: ''
              description: ''
            - value: UI
              name: ''
              description: ''
            - value: LIQUIDATION
              name: ''
              description: ''
            - value: TAKE_PROFIT
              name: ''
              description: ''
            - value: STOP_LOSS
              name: ''
              description: ''
            - value: INSTANT_TRADE
              name: ''
              description: ''
            - value: SPOT_LEGACY
              name: ''
              description: ''
            - value: UNKNOWN
              name: ''
              description: ''
          description: >-
            How the order was placed: API, UI, LIQUIDATION, TAKE_PROFIT,
            STOP_LOSS, INSTANT_TRADE, SPOT_LEGACY or UNKNOWN. Returned by every
            endpoint that returns trades.
        time_in_force:
          type: string
          description: >-
            Time in force of the order the trade belongs to. Returned by the
            trades endpoints and `GET /v1/account/orders/{order_id}/trades`; not
            included in trades nested in order responses.
          nullable: true
        liquidation:
          type: boolean
          enum:
            - true
          description: >-
            Present (and `true`) only on trades of liquidation orders nested in
            order responses (`GET /v1/account/orders`, `GET
            /v1/account/orders/{order_id}`, `GET
            /v1/account/orders/client/{client_id}`). Absent otherwise.
      x-apidog-orders:
        - account_id
        - order_id
        - trade_id
        - time
        - time_nanos
        - instrument_code
        - side
        - matched_as
        - amount
        - filled_amount
        - price
        - sequence
        - position_id
        - prev_position_id
        - open_position_amount
        - order_type
        - time_in_force
        - liquidation
      required:
        - account_id
        - order_id
        - trade_id
        - time
        - time_nanos
        - instrument_code
        - side
        - matched_as
        - amount
        - filled_amount
        - price
        - sequence
        - order_type
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
    Fee:
      type: object
      properties:
        fee_amount:
          type: string
          description: The amount paid in the fee currency
        fee_currency:
          type: string
          description: The currency the fee was paid in
      x-apidog-orders:
        - fee_amount
        - fee_currency
      required:
        - fee_amount
        - fee_currency
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
    Order:
      type: object
      properties:
        account_id:
          type: string
          format: uuid
          description: The account ID the order belongs to
        order_id:
          type: string
          format: uuid
          description: Unique identifier of the order
        client_id:
          type: string
          format: uuid
          description: >-
            Unique client identifier for the order. This can be specified at
            time of booking the order by the client, otherwise is randomly
            generated
        amount:
          type: string
          description: The amount of currency for this order
        side:
          type: string
          enum:
            - BUY
            - SELL
          x-apidog-enum:
            - value: BUY
              name: ''
              description: ''
            - value: SELL
              name: ''
              description: ''
          description: BUY or SELL
        instrument_code:
          type: string
          description: The market identifier for the order
        price:
          type: string
          description: The price at which the order is set to execute
        time:
          type: string
          format: date-time
          description: The time the order was booked at (ISO 8601, millisecond precision)
        sequence:
          type: string
          description: An incremental identifier for tracking the order in the exchange
        total_fee:
          type: string
          description: >-
            The total cumulative fee paid for the order. This is a sum of fees
            for all trades executed for this order. Not present if there are no
            fees for this order.
        fee_currency:
          type: string
          description: >-
            The currency code that the fee was paid in. Not present if there are
            no trades for this order.
        time_last_updated:
          type: string
          format: date-time
          description: >-
            Time of the last activity on the order (ISO 8601, millisecond
            precision)
        order_book_sequence:
          type: string
          description: DEPRECATED - This will be removed soon, use sequence instead
        filled_amount:
          type: string
          description: The already filled amount of currency for this order
        status:
          $ref: '#/components/schemas/OrderStatus'
          description: >-
            The current state of the order. When it enters the book it has a
            status of *OPEN* (*BOOKED* is a deprecated alias); as trades are
            executed it changes to *FILL* or *FILLED_FULLY* depending on how
            much of the order is filled. *MOVED* and *MOVE_SELF_TRADE* are also
            open states.

            If the order is cancelled before any trades are executed, it has a
            status of *CANCELLED*. If there were already trades on the order
            when it was cancelled, the status is *FILLED_CLOSED*.

            If the order is rejected by the exchange, the status is the
            rejection reason (e.g. *INSUFFICIENT_FUNDS*, *SELF_TRADE*,
            *MATCHING_POST_ONLY_RESULTS_IN_MATCH*), or *FILLED_REJECTED* if it
            had already been partially filled.
        average_price:
          type: string
          description: >-
            Weighed average price of all trades belonging to this order. Not
            present if there are no trades for this order.
        time_nanos:
          type: string
          format: date-time
          description: The time the order was booked at (ISO 8601, nanosecond precision)
        time_last_updated_nanos:
          type: string
          format: date-time
          description: >-
            Time of the last activity on the order (ISO 8601, nanosecond
            precision)
        order_type:
          type: string
          enum:
            - API
            - UI
            - LIQUIDATION
            - TAKE_PROFIT
            - STOP_LOSS
            - INSTANT_TRADE
            - SPOT_LEGACY
            - UNKNOWN
          x-apidog-enum:
            - value: API
              name: ''
              description: ''
            - value: UI
              name: ''
              description: ''
            - value: LIQUIDATION
              name: ''
              description: ''
            - value: TAKE_PROFIT
              name: ''
              description: ''
            - value: STOP_LOSS
              name: ''
              description: ''
            - value: INSTANT_TRADE
              name: ''
              description: ''
            - value: SPOT_LEGACY
              name: ''
              description: ''
            - value: UNKNOWN
              name: ''
              description: ''
          description: >-
            How the order was placed: API, UI, LIQUIDATION, TAKE_PROFIT,
            STOP_LOSS, INSTANT_TRADE, SPOT_LEGACY or UNKNOWN.
        liquidation:
          type: boolean
          enum:
            - true
          description: Present (and `true`) only on liquidation orders. Absent otherwise.
      x-apidog-orders:
        - account_id
        - order_id
        - client_id
        - amount
        - side
        - instrument_code
        - price
        - time
        - sequence
        - total_fee
        - fee_currency
        - time_last_updated
        - order_book_sequence
        - filled_amount
        - status
        - average_price
        - time_nanos
        - time_last_updated_nanos
        - order_type
        - liquidation
      required:
        - account_id
        - order_id
        - client_id
        - amount
        - side
        - instrument_code
        - price
        - time
        - sequence
        - time_last_updated
        - filled_amount
        - status
        - time_nanos
        - time_last_updated_nanos
        - order_type
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
    OrderStatus:
      type: string
      enum:
        - OPEN
        - BOOKED
        - FILL
        - MOVED
        - MOVE_SELF_TRADE
        - FILLED_FULLY
        - FILLED_CLOSED
        - FILLED_REJECTED
        - CANCELLED
        - INSUFFICIENT_FUNDS
        - INSUFFICIENT_LIQUIDITY
        - MATCHING_MOVE_FAILED_PRICE_OVER_RISK_LIMIT
        - MATCHING_POST_ONLY_RESULTS_IN_MATCH
        - REJECTED
        - SELF_TRADE
        - RISK_FAILED_OVER_MAX_POSITION
        - RISK_INVALID_RESERVE_BID_PRICE
        - RISK_MARGIN_TRADING_DISABLED
        - RISK_REDUCE_ONLY_NO_POSITION
        - RISK_REDUCE_ONLY_WRONG_SIDE
        - RISK_REDUCE_ONLY_NO_CAPACITY
        - USER_MGMT_USER_IN_DERISK
      x-apidog-enum:
        - value: OPEN
          name: ''
          description: In the order book, no trades yet.
        - value: BOOKED
          name: ''
          description: Deprecated alias of OPEN.
        - value: FILL
          name: ''
          description: Partially filled and still open.
        - value: MOVED
          name: ''
          description: Price changed without being cancelled; still open.
        - value: MOVE_SELF_TRADE
          name: ''
          description: Still open.
        - value: FILLED_FULLY
          name: ''
          description: Completely filled.
        - value: FILLED_CLOSED
          name: ''
          description: Partially filled, then cancelled.
        - value: FILLED_REJECTED
          name: ''
          description: Partially filled, then rejected.
        - value: CANCELLED
          name: ''
          description: Cancelled before any trade.
        - value: INSUFFICIENT_FUNDS
          name: ''
          description: 'Rejected: not enough funds.'
        - value: INSUFFICIENT_LIQUIDITY
          name: ''
          description: 'Rejected: not enough liquidity.'
        - value: MATCHING_MOVE_FAILED_PRICE_OVER_RISK_LIMIT
          name: ''
          description: 'Rejected: the move would breach the market risk limit.'
        - value: MATCHING_POST_ONLY_RESULTS_IN_MATCH
          name: ''
          description: 'Rejected: a POST_ONLY order would have matched immediately.'
        - value: REJECTED
          name: ''
          description: Rejected by the exchange.
        - value: SELF_TRADE
          name: ''
          description: Rejected to prevent a self-trade.
        - value: RISK_FAILED_OVER_MAX_POSITION
          name: ''
          description: 'Rejected: would exceed the maximum position.'
        - value: RISK_INVALID_RESERVE_BID_PRICE
          name: ''
          description: 'Rejected: invalid reserve price.'
        - value: RISK_MARGIN_TRADING_DISABLED
          name: ''
          description: 'Rejected: margin trading disabled.'
        - value: RISK_REDUCE_ONLY_NO_POSITION
          name: ''
          description: 'Rejected: reduce-only with no position.'
        - value: RISK_REDUCE_ONLY_WRONG_SIDE
          name: ''
          description: 'Rejected: reduce-only on the wrong side.'
        - value: RISK_REDUCE_ONLY_NO_CAPACITY
          name: ''
          description: 'Rejected: reduce-only with no remaining capacity.'
        - value: USER_MGMT_USER_IN_DERISK
          name: ''
          description: 'Rejected: account is being de-risked.'
      x-apidog-folder: ''
    ErrorResponse:
      type: object
      description: >-
        Error body. `error` is a machine-readable code (e.g.
        `INVALID_INSTRUMENT_CODE`) on most endpoints; a few older endpoints
        return a human-readable message in `error` instead and omit
        `error_message`.
      properties:
        error:
          type: string
          description: Error code (or, on older endpoints, a human-readable message).
        error_message:
          type: string
          description: >-
            Human-readable detail. Present on endpoints that return an error
            code in `error`.
      required:
        - error
      x-apidog-orders:
        - error
        - error_message
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
    GatewayError:
      type: object
      description: >-
        Returned by the API gateway itself when the bearer token is missing,
        invalid, expired or revoked, or the calling IP is not on the API key's
        allowlist.
      properties:
        message:
          type: string
          enum:
            - Forbidden
            - Unauthorized
      required:
        - message
      x-apidog-orders:
        - message
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
  securitySchemes:
    bearerAuth:
      type: bearer
      scheme: bearer
      description: >-
        API key issued to the account holder, sent as `Authorization: Bearer
        <token>`. The key must hold the `SUBACCOUNT_TRANSFER` scope.
    bearer:
      type: bearer
      scheme: bearer
servers:
  - url: https://api.onetrading.com/fast
    description: Production Env
security: []

```