> ## 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.

# Create a Trade

Initiate a new trade.

<Warning>You need to have an valid `trade_id` from a firm quote response to create a trade.</Warning>


## OpenAPI

````yaml /openapi.json post /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:
    post:
      tags:
        - Trades
      summary: Create a Trade
      description: |
        Initiate a new trade. You need to have an existing quote_id to do this
      parameters:
        - description: The identifier of the quote
          in: query
          name: quote_id
          required: true
          schema:
            type: string
        - description: The ID of the client
          in: query
          name: client_id
          required: true
          schema:
            type: string
        - 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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTrade'
        description: Request Payload
        required: true
      responses:
        '201':
          description: Trade created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfirmedTrade'
        '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
        '409':
          description: >-
            Requested trade causes a conflict that can be corrected, see
            response body for details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '502':
          description: Internal integration error. Contact support
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    NewTrade:
      properties:
        reason:
          description: >-
            Reason for trade. The 'not_related_to_goods_or_services' reason is
            only for spot type.
          enum:
            - payment_for_goods
            - payment_for_services
            - repatriation_of_goods
            - repatriation_of_services
            - intercompany_funding_operational_purposes
            - salary_payroll
            - tax_related
            - direct_investment
            - property_purchase_sale
            - payment_living_costs
            - repayment_of_loan
            - balance_hedging
            - repatriation_from_investment
            - other_not_related_to_goods_or_services
            - charitable_aid
            - capital_investment
            - property_purchase
            - mortage_repayment
            - property_rental_or_maintenance
            - travel_costs
            - living_costs
            - portfolio_netting
            - not_related_to_goods_or_services
            - other
          type: string
        reference:
          description: Reference for the trade.
          type: string
        trade_type:
          description: Currently ignored (DEPRECATED)
          type: string
        external_reference_id:
          description: API external reference id
          type: string
      required:
        - reason
      type: object
    ConfirmedTrade:
      properties:
        bank_account:
          description: An existing bank account
          properties:
            account_number:
              type: string
            bank_address_line_1:
              type: string
            bank_address_line_2:
              type: string
            bank_city:
              type: string
            bank_identifier:
              type: string
            bank_identifier_type:
              type: string
            bank_name:
              type: string
            bank_post_code:
              type: string
            iban:
              type: string
            swift_code:
              type: string
          required:
            - account_number
            - iban
            - swift_code
            - bank_identifier
            - bank_identifier_type
            - bank_address_line_1
            - bank_address_line_2
            - bank_city
            - bank_post_code
          type: object
        initial_margin_amount:
          description: Only for forwards. Trade's deposit amount.
          format: double
          type: number
        initial_margin_due_date:
          description: >-
            Only for forwards. Date on or before which deposit must be received
            by Ebury. Date and time are in UTC.
          format: date
          type: string
        maturity_date:
          description: Limit date and time (UTC) in which funds must be received by Ebury
          format: date
          type: string
        trade_id:
          description: Trade identifier
          type: string
        external_reference_id:
          description: The client's external reference ID provided during trade creation
          type: string
      required:
        - trade_id
        - bank_account
        - maturity_date
      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
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````