# Get Orders

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /account/orders:
    get:
      summary: Get Orders
      deprecated: false
      description: >-
        Returns a paginated list of orders.


        By default, if no params are provided, will return all open orders.


        If `with_cancelled_and_rejected` and/or `with_just_filled_inactive` is
        set to `true` the default lookback is 1 day.


        A `from` and a `to` date can be provided. The **maximum** window size is
        30 days. If more than a 30 day window is provided, you will receive an
        `400` error.
      tags:
        - One Trading Public REST API/Trading
      parameters:
        - name: from
          in: query
          description: Defines start of a query search.
          required: false
          example: '2025-02-13T16:00:00.000Z'
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: Defines end of a query search
          required: false
          example: '2025-11-14T10:00:00.000Z'
          schema:
            type: string
            format: date-time
        - name: instrument_code
          in: query
          description: Instrument pair to get orders for
          required: false
          example: BTC_EUR
          schema:
            type: string
        - name: with_cancelled_and_rejected
          in: query
          description: >-
            Return orders which have been cancelled by the user before being
            filled or rejected by the system as invalid. Additionally, all
            inactive filled orders which would return with
            "with_just_filled_inactive".
          required: false
          example: 'false'
          schema:
            type: boolean
        - name: with_just_filled_inactive
          in: query
          description: >-
            Return order history for orders which have been filled and are no
            longer open. Use of "with_cancelled_and_rejected" extends
            "with_just_filled_inactive" and in case both are specified the
            latter is ignored.
          required: false
          example: 'false'
          schema:
            type: boolean
        - name: with_just_orders
          in: query
          description: >-
            Returns order history for orders but does not return any trades
            corresponding to the orders. It may be significantly faster and
            should be used if user is not interesting in trade information. Can
            be combined with any other filter.
          required: false
          example: 'true'
          schema:
            type: boolean
        - name: max_page_size
          in: query
          description: >-
            Set max desired page size. If no value is provided, by default a
            maximum of 100 results per page are returned. The maximum upper
            limit is 100 results per page.
          required: false
          example: '5'
          schema:
            type: string
        - name: cursor
          in: query
          description: >-
            Pointer specifying the position from which the next pages should be
            returned.
          required: false
          example: '1731488541876570'
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  order_history:
                    type: array
                    items:
                      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: []
                    description: The order history based on the specified request criteria
                  max_page_size:
                    type: integer
                    description: The amount of items requested
                  cursor:
                    type: string
                    description: >-
                      If there are more records to fetch, the cursor returned
                      should be passed into the next request, to be used as a
                      starting point for the next batch of orders
                x-apidog-orders:
                  - order_history
                  - max_page_size
                  - cursor
                required:
                  - order_history
                  - max_page_size
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Success
      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-3612091-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, milisecond 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
          format: uuid
          description: >-
            The ID of the position associated with this trade. Included only for
            trades executed on perpetual markets.
        prev_position_id:
          type: string
          format: uuid
          description: >-
            If the trade causes a position flip (long to short or short to
            long), this field specifies the ID of the position closed by the
            trade. Present only for perpetual-market trades that result in a
            position flip.
        open_position_amount:
          type: string
          description: >-
            The post-execution open position amount. This field is included only
            for trades executed on perpetual markets.
      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
      required:
        - account_id
        - order_id
        - trade_id
        - time
        - time_nanos
        - instrument_code
        - side
        - matched_as
        - amount
        - filled_amount
        - price
        - sequence
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    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-ignore-properties: []
      x-apidog-folder: ''
    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
        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
        fee_currency:
          type: string
          description: The currency code that the fee was paid in
        time_last_updated:
          type: string
          description: Time of the last activity on the order
        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 is represented by the status, when it
            first enters the book it will have a status of *BOOKED* , as trades
            are executed, it will change to *FILL* or *FILLED_FULLY* depending
            on how much of the order is filled.

            If the order is cancelled by the user before any trades are
            executed, it will have a status of *CANCELLED*. If there are already
            trades on the order then subsequently cancelled by the user, the
            order will have a status of *FILLED_CLOSED*.

            If the order is rejected by the exchange for one of several reasons,
            it will have a state of either *FILLED_REJECTED*,
            *INSUFFICIENT_FUNDS*, or *INSUFFICIENT_LIQUIDITY*.
        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.
      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
      required:
        - account_id
        - order_id
        - client_id
        - amount
        - side
        - instrument_code
        - price
        - time
        - sequence
        - time_last_updated
        - filled_amount
        - status
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    OrderStatus:
      type: string
      enum:
        - BOOKED
        - FILL
        - MOVED
        - FILLED_FULLY
        - FILLED_CLOSED
        - FILLED_REJECTED
        - CANCELLED
        - INSUFFICIENT_FUNDS
        - INSUFFICIENT_LIQUIDITY
      x-apidog-enum:
        - value: BOOKED
          name: ''
          description: ''
        - value: FILL
          name: ''
          description: ''
        - value: MOVED
          name: ''
          description: ''
        - value: FILLED_FULLY
          name: ''
          description: ''
        - value: FILLED_CLOSED
          name: ''
          description: ''
        - value: FILLED_REJECTED
          name: ''
          description: ''
        - value: CANCELLED
          name: ''
          description: ''
        - value: INSUFFICIENT_FUNDS
          name: ''
          description: ''
        - value: INSUFFICIENT_LIQUIDITY
          name: ''
          description: ''
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.onetrading.com/fast/v1
    description: Production Env
security: []

```