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

# Get Completed Orders

> This endpoint retrieves the completed orders (fills) of your account across all markets.



## OpenAPI

````yaml GET /api/v1/completed-orders
openapi: 3.1.0
info:
  title: Order API
  version: 1.0.0
servers:
  - url: https://order.sandbox.rails.xyz
security: []
paths:
  /api/v1/completed-orders:
    get:
      summary: Get Completed Orders
      operationId: getCompletedOrders
      parameters:
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/startDate'
        - $ref: '#/components/parameters/endDate'
        - $ref: '#/components/parameters/start'
      responses:
        '200':
          description: ''
          headers:
            X-Api-Quota-Used:
              $ref: '#/components/headers/X-Api-Quota-Used'
            X-Api-Quota-Limit:
              $ref: '#/components/headers/X-Api-Quota-Limit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/completedOrdersResponse'
              example:
                completedOrders:
                  - market: ETH-USDT
                    matchId: a59141f0-9c13-4ec8-bc37-beceb7fb284a
                    orderId: 01JP39KFBF8SHJAT3ERHPF3YSP
                    orderType: buy
                    executionType: maker
                    fillType: complete
                    price: '1949'
                    quantity: '273.78842139'
                    tradeType: limit
                    fees: '533.61363328'
                    triggerType: none
                    triggerPrice: '0'
                    transactionHash: >-
                      335a50808317116f2fc1147277bcc226e0e52dfea7b15899d66add371d2ab499
                    filledAt: 1747426816421
                  - market: BTC-USDT
                    matchId: 6d6ca016-fd1d-415a-8a83-25a1f5fc02f4
                    orderId: 01JP390Z8WVR9EP6X1P187P722
                    orderType: sell
                    executionType: taker
                    fillType: complete
                    price: '82850.59187039'
                    quantity: '6.34127086'
                    tradeType: market
                    fees: '525.37804396'
                    triggerType: none
                    triggerPrice: '0'
                    transactionHash: >-
                      4dfb16c92be57701a4498b37c9af9ece0d1109bef5350d9a891e5f2f64eaf6d2
                    filledAt: 1747426816421
                last: >-
                  BTC-USDT#FEES#01JP390Z8WVR9EP6X1P187P722#01JP36QTCRJCGN7NC0CPZ22NAB@1741719371497
        '400':
          description: >-
            A required parameter is missing or a parameter value is invalid. The
            `message` field names the offending parameter.
          headers:
            X-Api-Quota-Used:
              $ref: '#/components/headers/X-Api-Quota-Used'
            X-Api-Quota-Limit:
              $ref: '#/components/headers/X-Api-Quota-Limit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
              example:
                error:
                  slug: BAD_REQUEST
                  code: '0006'
                message: pageSize must be between 20 and 200
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - bearerAuth: []
components:
  parameters:
    pageSize:
      name: pageSize
      in: query
      required: false
      description: >-
        Maximum number of items per page, between `20` and `200`. Defaults to
        `100`.
      schema:
        type: integer
        minimum: 20
        maximum: 200
        default: 100
    startDate:
      name: startDate
      in: query
      required: false
      description: >-
        This is a parameter to support querying by date. The value should be in
        the format of milliseconds since epoch. It can be used alone or in
        conjunction with the `endDate` parameter.
      schema:
        type: integer
        format: int64
        minimum: 1000000000000
        maximum: 9999999999999
    endDate:
      name: endDate
      in: query
      required: false
      description: >-
        This is a parameter to support querying by date. The value should be in
        the format of milliseconds since epoch. It can be used alone or in
        conjunction with the `startDate` parameter.
      schema:
        type: integer
        format: int64
        minimum: 1000000000000
        maximum: 9999999999999
    start:
      name: start
      in: query
      required: false
      description: >-
        This is a parameter to support pagination. Get the value from the `last`
        field if present in the previous response.
      schema:
        type: string
  headers:
    X-Api-Quota-Used:
      description: The number of requests you have made in the current rate limit window
      schema:
        type: integer
    X-Api-Quota-Limit:
      description: Your current rate limit (requests per minute)
      schema:
        type: integer
    Retry-After:
      description: >-
        Number of seconds to wait before making another request (429 responses
        only)
      schema:
        type: integer
  schemas:
    completedOrdersResponse:
      type: object
      properties:
        completedOrders:
          type: array
          description: >-
            List of completed (filled) orders for the account, newest first,
            across all markets.
          items:
            $ref: '#/components/schemas/completedOrder'
        last:
          $ref: '#/components/schemas/last'
      required:
        - completedOrders
    errorResponse:
      type: object
      properties:
        error:
          type: object
          description: An object containing error details.
          properties:
            slug:
              type: string
              description: A short string identifier for the error type.
            code:
              type: string
              description: A string code representing the error.
          required:
            - slug
            - code
        message:
          type: string
          description: A human-readable message describing the error.
      required:
        - error
        - message
    completedOrder:
      type: object
      properties:
        market:
          type: string
          description: >-
            Market name. Example value: `ETH-USDT`. To get all supported
            markets, call
            [/api/v1/markets](/latest/perps/rest-api/get-supported-markets)
            endpoint.
        matchId:
          type: string
          description: Unique identifier for the trade match.
        orderId:
          type: string
          description: Unique identifier for the order.
        orderType:
          type: string
          description: Order side.
          enum:
            - buy
            - sell
        executionType:
          type: string
          enum:
            - taker
            - maker
          description: Order execution role.
        fillType:
          type: string
          enum:
            - complete
            - partial
          description: Fill type.
        price:
          type: string
          description: Order fill price.
        quantity:
          type: string
          description: Order fill quantity.
        tradeType:
          type: string
          enum:
            - market
            - limit
          description: Order type.
        fees:
          type: string
          description: Fees paid for the order.
        triggerType:
          type: string
          enum:
            - none
            - take_profit
            - stop_loss
            - liquidation
          description: Trigger type for the order.
        triggerPrice:
          type: string
          description: Trigger price for the order.
        transactionHash:
          type: string
          description: Transaction hash for the trade.
        filledAt:
          type: integer
          format: int64
          description: Order fill timestamp (milliseconds since epoch).
      required:
        - market
        - matchId
        - orderId
        - orderType
        - executionType
        - fillType
        - price
        - quantity
        - tradeType
        - fees
        - triggerType
        - triggerPrice
        - transactionHash
        - filledAt
    last:
      type: string
      description: >-
        This is a field in the response to support pagination. Use this value if
        present for the `start` parameter of the following request to get the
        next page of results.
  responses:
    Unauthorized:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: A human-readable message describing the error.
            required:
              - message
          example:
            message: Unauthorized
    RateLimited:
      description: ''
      headers:
        X-Api-Quota-Used:
          $ref: '#/components/headers/X-Api-Quota-Used'
        X-Api-Quota-Limit:
          $ref: '#/components/headers/X-Api-Quota-Limit'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
          example:
            error:
              slug: TOO_MANY_REQUESTS
              code: '0003'
            message: api rate limit exceeded
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````