# Get Trade by Trade ID

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/account/trade/{trade_id}:
    get:
      summary: Get Trade by Trade ID
      deprecated: false
      description: >-
        Get information about an executed trade using the exchange generated
        trade_id. Only trades of the account the token acts on are found; a
        trade of another subaccount returns `404`.


        Will only return trades from the last 30 days.


        **Required API scope:** any valid API key. This endpoint is
        rate-limited.
      tags:
        - One Trading Public REST API/Trading
      parameters:
        - name: trade_id
          in: path
          description: The trade ID to fetch trade details for
          required: true
          example: ''
          schema:
            type: string
            format: uuid
      responses:
        '200':
          x-apidog-name: Success
          description: ''
          content:
            application/json:
              schema:
                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: []
              example:
                fee:
                  fee_amount: '0.0020505'
                  fee_currency: USD
                trade:
                  account_id: aaaba8bd-3195-4f72-87ff-98720a940f23
                  order_id: 71912cd5-1df2-4c14-3e59-377765d23b01
                  trade_id: aa765409-4719-5358-b27a-3fabedf27164
                  time: '2025-12-02T11:32:32.515Z'
                  time_nanos: '2025-12-02T11:32:32.515915000Z'
                  instrument_code: DOGE_USD_P
                  side: BUY
                  matched_as: TAKER
                  order_type: API
                  price: '0.1367'
                  amount: '100'
                  filled_amount: '100'
                  sequence: '92096745784'
                  open_position_amount: '0'
                  position_id: '1764675149939364'
          headers: {}
        '400':
          x-apidog-name: Bad Request
          description: '`trade_id` is not a valid UUID.'
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: INVALID_PARAMETERS
                error_message: Invalid trade ID.
          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: Not Found
          description: No trade with this ID exists for the account.
          content:
            application/json:
              schema: *ref_0
              example:
                error: TRADE_NOT_FOUND
                error_message: Trade 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-3612100-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: []
    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: []

```