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

# Get order

> Eventually consistent operation. May not include the recently created orders.



## OpenAPI

````yaml get /orders/{orderId}
openapi: 3.1.0
info:
  title: Crypto Exchange API
  description: Crypto Exchange API
  version: 1.0.0
servers:
  - url: https://api.sandbox1-dev.finhost.io/crypto-exchange
  - url: https://api.sandbox1-stage.finhost.io/crypto-exchange
security: []
tags:
  - name: default
  - name: orders
paths:
  /orders/{orderId}:
    get:
      tags:
        - orders
      summary: Get order
      description: >-
        Eventually consistent operation. May not include the recently created
        orders.
      parameters:
        - description: Order ID
          name: orderId
          in: path
          required: true
          schema:
            description: Order ID (uuid version 7)
            type: string
            format: uuid
            examples:
              - 018e53c4-cd35-7863-be61-924932bfd862
        - description: Company ID
          name: companyId
          in: query
          required: false
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - id
                  - profileId
                  - accountIdFrom
                  - accountIdTo
                  - pair
                  - side
                  - volume
                  - settings
                  - state
                  - createdAt
                  - updatedAt
                properties:
                  id:
                    description: Order ID (uuid version 7)
                    type: string
                    format: uuid
                    examples:
                      - 018e53c4-cd35-7863-be61-924932bfd862
                  profileId:
                    description: Profile ID
                    type: string
                    format: uuid
                  accountIdFrom:
                    description: Account ID from which funds are taken
                    type: string
                    format: uuid
                  accountIdTo:
                    description: Account ID to which funds are sent
                    type: string
                    format: uuid
                  pair:
                    description: Order pair
                    type: string
                    pattern: ^[a-zA-Z0-9]{1,16}\/[a-zA-Z0-9]{1,16}$
                    examples:
                      - USDT/EUR
                      - BTC/EUR
                      - 1INCH/USDT
                  side:
                    description: Order side
                    type: string
                    enum:
                      - buy
                      - sell
                  volume:
                    type: string
                    minLength: 1
                    maxLength: 36
                    examples:
                      - '42'
                      - '4.2'
                      - '4.20'
                    description: >-
                      Order volume. If BUYING, the volume is in QUOTE currency.
                      If SELLING, the volume is in BASE currency
                  settings:
                    oneOf:
                      - description: >-
                          Market order (executes immediately at the current
                          market price)
                        type: object
                        additionalProperties: false
                        required:
                          - type
                          - desiredPrice
                        properties:
                          type:
                            type: string
                            enum:
                              - market
                          desiredPrice:
                            type: string
                            minLength: 1
                            maxLength: 36
                            examples:
                              - '42'
                              - '4.2'
                              - '4.20'
                            description: >-
                              Desired price (the price which user see in
                              application). Used only for slippage protection
                      - description: >-
                          Limit order (executes when a specified price is
                          reached)
                        type: object
                        additionalProperties: false
                        required:
                          - type
                          - limitPrice
                        properties:
                          type:
                            type: string
                            enum:
                              - limit
                          limitPrice:
                            type: string
                            minLength: 1
                            maxLength: 36
                            examples:
                              - '42'
                              - '4.2'
                              - '4.20'
                            description: Limit price
                  charge:
                    description: Charge info
                    type: object
                    additionalProperties: false
                    required:
                      - percentage
                      - contractId
                    properties:
                      percentage:
                        description: Percentage
                        type: number
                        format: float
                        minimum: 0
                        examples:
                          - 0.5
                      contractId:
                        description: Contract ID
                        type: string
                        pattern: ^[a-zA-Z0-9]{2,64}$
                        examples:
                          - regularContract
                  state:
                    oneOf:
                      - description: Order initiated
                        type: object
                        additionalProperties: false
                        required:
                          - status
                        properties:
                          status:
                            type: string
                            enum:
                              - initiated
                      - description: Order failed
                        type: object
                        additionalProperties: false
                        required:
                          - status
                          - reason
                        properties:
                          status:
                            type: string
                            enum:
                              - failed
                          reason:
                            oneOf:
                              - description: Account FROM status not acceptable
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - ACCOUNT_FROM_STATUS_NOT_ACCEPTABLE
                              - description: Account TO status not acceptable
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - ACCOUNT_TO_STATUS_NOT_ACCEPTABLE
                              - description: Account insufficient balance
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - ACCOUNT_INSUFFICIENT_BALANCE
                              - description: Pair not found
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - PAIR_NOT_FOUND
                              - description: Pair mode mismatch
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - PAIR_MODE_MISMATCH
                              - description: Pair max decimals mismatch
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - PAIR_MAXD_MISMATCH
                              - description: Pair min volume mismatch
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - PAIR_MINV_MISMATCH
                              - description: Process max age reached
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - PROCESS_MAX_AGE_REACHED
                              - description: Slippage overflown
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - SLIPPAGE_OVERFLOWN
                              - description: System failure
                                type: object
                                additionalProperties: false
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - SYSTEM_FAILURE
                      - description: Order pending
                        type: object
                        additionalProperties: false
                        required:
                          - status
                        properties:
                          status:
                            type: string
                            enum:
                              - pending
                      - description: Order open
                        type: object
                        additionalProperties: false
                        required:
                          - status
                          - fills
                        properties:
                          status:
                            type: string
                            enum:
                              - open
                          fills:
                            type: array
                            minItems: 1
                            items:
                              type: object
                              additionalProperties: false
                              required:
                                - outTransaction
                                - inTransaction
                                - price
                                - createdAt
                              properties:
                                outTransaction:
                                  type: object
                                  additionalProperties: false
                                  required:
                                    - id
                                    - amount
                                  properties:
                                    id:
                                      description: Transaction ID
                                      type: string
                                      format: uuid
                                    amount:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction amount
                                inTransaction:
                                  type: object
                                  additionalProperties: false
                                  required:
                                    - id
                                    - amount
                                    - fee
                                  properties:
                                    id:
                                      description: Transaction ID
                                      type: string
                                      format: uuid
                                    amount:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction amount
                                    fee:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction fee
                                price:
                                  type: string
                                  minLength: 1
                                  maxLength: 36
                                  examples:
                                    - '42'
                                    - '4.2'
                                    - '4.20'
                                  description: Execution price
                                createdAt:
                                  description: Created date
                                  type: string
                                  format: date-time
                      - description: Order closed
                        type: object
                        additionalProperties: false
                        required:
                          - status
                          - fills
                        properties:
                          status:
                            type: string
                            enum:
                              - closed
                          fills:
                            type: array
                            minItems: 1
                            items:
                              type: object
                              additionalProperties: false
                              required:
                                - outTransaction
                                - inTransaction
                                - price
                                - createdAt
                              properties:
                                outTransaction:
                                  type: object
                                  additionalProperties: false
                                  required:
                                    - id
                                    - amount
                                  properties:
                                    id:
                                      description: Transaction ID
                                      type: string
                                      format: uuid
                                    amount:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction amount
                                inTransaction:
                                  type: object
                                  additionalProperties: false
                                  required:
                                    - id
                                    - amount
                                    - fee
                                  properties:
                                    id:
                                      description: Transaction ID
                                      type: string
                                      format: uuid
                                    amount:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction amount
                                    fee:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction fee
                                price:
                                  type: string
                                  minLength: 1
                                  maxLength: 36
                                  examples:
                                    - '42'
                                    - '4.2'
                                    - '4.20'
                                  description: Execution price
                                createdAt:
                                  description: Created date
                                  type: string
                                  format: date-time
                      - description: Order closed partially
                        type: object
                        additionalProperties: false
                        required:
                          - status
                          - fills
                        properties:
                          status:
                            type: string
                            enum:
                              - closed_partially
                          fills:
                            type: array
                            minItems: 1
                            items:
                              type: object
                              additionalProperties: false
                              required:
                                - outTransaction
                                - inTransaction
                                - price
                                - createdAt
                              properties:
                                outTransaction:
                                  type: object
                                  additionalProperties: false
                                  required:
                                    - id
                                    - amount
                                  properties:
                                    id:
                                      description: Transaction ID
                                      type: string
                                      format: uuid
                                    amount:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction amount
                                inTransaction:
                                  type: object
                                  additionalProperties: false
                                  required:
                                    - id
                                    - amount
                                    - fee
                                  properties:
                                    id:
                                      description: Transaction ID
                                      type: string
                                      format: uuid
                                    amount:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction amount
                                    fee:
                                      type: string
                                      minLength: 1
                                      maxLength: 36
                                      examples:
                                        - '42'
                                        - '4.2'
                                        - '4.20'
                                      description: Transaction fee
                                price:
                                  type: string
                                  minLength: 1
                                  maxLength: 36
                                  examples:
                                    - '42'
                                    - '4.2'
                                    - '4.20'
                                  description: Execution price
                                createdAt:
                                  description: Created date
                                  type: string
                                  format: date-time
                  createdAt:
                    description: Created date
                    type: string
                    format: date-time
                  updatedAt:
                    description: Updated date
                    type: string
                    format: date-time
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                oneOf:
                  - description: Invalid data
                    type: object
                    additionalProperties: false
                    required:
                      - code
                      - criteria
                      - reason
                    properties:
                      code:
                        type: string
                        enum:
                          - INVALID_DATA
                      criteria:
                        type: string
                        enum:
                          - path_params
                          - query_params
                          - body
                          - headers
                      reason:
                        type:
                          - string
                          - 'null'
                        examples:
                          - null
                examples:
                  - see Schema for possible responses
        '404':
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - description: Order not found
                    type: object
                    additionalProperties: false
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - ORDER_NOT_FOUND
                examples:
                  - see Schema for possible responses
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````