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

# Get all trades

Get all the trades for a given client ID.

<Warning>Drawdown trades associated with fixed forward trades cannot be obtained using this operation.
Details of a fixed forward drawdown trade can be obtained using Get a trade.</Warning>


## OpenAPI

````yaml /openapi.json get /trades
openapi: 3.0.0
info:
  description: |
    Ebury API allows customers:
      to retrieve accounts, balances, beneficiaries, and transactions;
      to get buy/sell estimates and quotes, book trades and retrieve trade history;
      to allocate payments to a trade and beneficiary, and to submit payments in bulk;
      to download documents such as trade receipt, payment instruction and payment receipt;
      to manage the authorised persons on their account.
    The Metadata API allows applications to clarify some parts of the Ebury API
      that are impractical to express schematically.
  termsOfService: https://docs.ebury.io/#terms-of-use
  title: Ebury API
  version: '0.1'
servers:
  - url: https://{environment}.ebury.io
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox
security:
  - api_key: []
paths:
  /trades:
    get:
      tags:
        - Trades
      summary: Get all trades
      description: Get all the trades for a given client ID
      parameters:
        - description: The ID of the client
          in: query
          name: client_id
          required: true
          schema:
            type: string
        - description: >-
            The trade type. The list will be filtered to include only trades
            with a matching trade type.
          in: query
          name: trade_type
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - spot
                - forward
                - window_forward
                - drawdown
                - ndf
              type: string
        - description: Parent identifier for drawdown trades
          in: query
          name: parent_trade_id
          required: false
          schema:
            type: string
        - description: The desired page number for pagination. By default is 1.
          in: query
          name: page
          required: false
          schema:
            type: integer
            format: int32
        - description: The number of items per page for pagination. By default is 50.
          in: query
          name: page_size
          required: false
          schema:
            type: integer
            format: int32
        - description: Filter by payment level's external_reference_id.
          in: query
          name: external_reference_id
          required: false
          schema:
            type: string
        - description: Filter by related mass payment's uuid.
          in: query
          name: mass_payment_id
          required: false
          schema:
            type: string
        - description: Filter by related mass payment's external reference.
          in: query
          name: mass_payment_external_reference_id
          required: false
          schema:
            type: string
        - description: Filter by the buy currency
          in: query
          name: buy_currency
          required: false
          schema:
            type: string
        - description: Filter trades by comma separated statuses
          in: query
          name: status
          required: false
          schema:
            type: array
            items:
              enum:
                - Created
                - Funds In Partially
                - Funds In Full
                - Funds Out Partially Allocated
                - Closed
                - Cancelled
              type: string
          example: Funds In Full,Closed
        - name: Authorization
          in: header
          description: The access token
          required: true
          schema:
            type: string
        - description: The ID of the contact
          in: header
          name: X-Contact-ID
          required: false
          schema:
            type: string
      responses:
        '200':
          description: List of trades
          headers:
            x-total-count:
              description: Total number of available entries
              schema:
                type: integer
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/BookedTrade'
                type: array
        '400':
          description: >-
            Formatting, parameter or schema validation error. See error message
            for further details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Access denied due to authentication failure
        '403':
          description: >-
            Could not complete action due to data constraints. Refer to error
            message for additional details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Client or quote ID not found
        '502':
          description: Internal integration error. Contact support
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    BookedTrade:
      properties:
        buy_amount:
          description: Buy amount
          format: float
          type: number
        buy_currency:
          description: Buy currency code
          type: string
        fee_amount:
          description: Fee amount
          format: float
          type: number
        fee_currency:
          description: Fee currency
          type: string
        maturity_date:
          description: Limit date and time (UTC) in which funds must be received by Ebury
          format: date
          type: string
        order_date:
          description: Order date
          format: date
          type: string
        parent_trade_id:
          description: Parent trade ID (not null for drawdown deals)
          type: string
        rate:
          description: Booked rate
          format: float
          type: number
        rate_symbol:
          description: The symbol of booked rate
          type: string
        reference:
          description: 'Additional trade reference. Example: Invoice number.'
          type: string
        sell_amount:
          description: Sell amount
          format: float
          type: number
        sell_currency:
          description: Sell currency code
          type: string
        status:
          $ref: '#/components/schemas/TradeStatus'
        synthetic:
          description: Identifies as a synthetic future contracts
          format: boolean
          type: boolean
        trade_id:
          description: Trade identifier
          type: string
        trade_receipt:
          description: The URL to get the trade receipt
          format: uri
          type: string
        trade_type:
          description: Trade type
          type: string
        external_reference_id:
          description: The client's external reference ID if provided during trade creation
          type: string
      required:
        - buy_amount
        - buy_currency
        - fee_amount
        - fee_currency
        - maturity_date
        - order_date
        - parent_trade_id
        - rate
        - rate_symbol
        - sell_amount
        - sell_currency
        - status
        - trade_id
        - trade_type
        - synthetic
      type: object
    ErrorMessage:
      description: An error message.
      properties:
        code:
          type: string
          description: The code for the error.
        details:
          description: Error details
          type: string
        message:
          type: string
          description: A short description of the cause of the error.
      required:
        - code
        - message
        - details
      type: object
    TradeStatus:
      description: Status of the trade
      enum:
        - Created
        - Funds In Partially
        - Funds in Full
        - Funds Out Partially Allocated
        - Funds Out Full Allocated
        - Closed
        - Cancelled
      type: string
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````