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

Create a drawdown from an existing window forward trade.

<Warning>You need to have a valid forward `trade_id` to create a drawdown.</Warning>


## OpenAPI

````yaml /openapi.json post /drawdowns
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:
  /drawdowns:
    post:
      tags:
        - Drawdowns
      summary: Create a drawdown
      description: >
        Create a drawdown from an existing forward trade. You need to have a
        valid forward trade_id to create a drawdown.
      parameters:
        - description: The ID of the client
          in: query
          name: client_id
          required: true
          schema:
            type: string
        - description: The ID of the forward trade to draw down from
          in: query
          name: trade_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/NewDrawdown'
        description: Request Payload
        required: true
      responses:
        '201':
          description: Drawdown created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfirmedDrawdown'
        '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 trade ID not found
        '409':
          description: >-
            Requested drawdown 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:
    NewDrawdown:
      properties:
        amount:
          description: The amount to draw down
          format: double
          type: number
          minimum: 0.01
        direction:
          description: The direction of the amount
          enum:
            - buy
            - sell
          type: string
        value_date:
          description: >-
            The T+2 value date for the drawdown in YYYY-MM-DD or YYYY/MM/DD
            format
          type: string
          pattern: ^\d{4}[-/]\d{2}[-/]\d{2}$
        reason_for_trade:
          description: Reason for trade
          enum:
            - charitable_aid
            - payment_for_goods
            - capital_investment
            - payment_for_services
            - repatriation_of_goods
            - repatriation_of_services
            - property_purchase
            - mortage_repayment
            - property_rental_or_maintenance
            - salary_payroll
            - travel_costs
            - living_costs
            - repayment_of_loan
            - balance_hedging
            - repatriation_from_investment
            - portfolio_netting
            - other
          type: string
        use_margin:
          description: >-
            Whether to use any available margin from the forward trade to fund
            the drawdown
          type: boolean
          default: false
        convert:
          description: >-
            Intention behind the drawdown. When set to true, drawdown will be
            executed and funds will be transferred between two Ebury wallets.
            When false, drawdown will be executed only when it is linked to at
            least one payment
          type: boolean
          default: false
        auto_confirm_value_date:
          description: >-
            When set to true, the next available value date will be used if the
            requested T+2 date is invalid. When false, the request will fail if
            the value date is not valid
          type: boolean
          default: false
        external_reference_id:
          description: >-
            API external reference id for the drawdown. Maximum 128 characters.
            Alphanumeric, hyphens, and underscores only
          type: string
          maxLength: 128
          pattern: ^[a-zA-Z0-9_-]*$
      required:
        - amount
        - direction
        - value_date
        - reason_for_trade
        - use_margin
        - convert
      type: object
    ConfirmedDrawdown:
      properties:
        trade_id:
          description: Drawdown trade identifier
          type: string
        amount_to_transfer:
          description: The amount to be transferred
          format: double
          type: number
        buy_amount:
          description: The amount in the buy currency
          format: double
          type: number
        sell_amount:
          description: The amount in the sell currency
          format: double
          type: number
        rate:
          description: The exchange rate applied
          type: string
        reason_for_trade:
          description: The reason for trade specified in the request
          type: string
        external_reference_id:
          description: Your external reference ID if provided
          type: string
        convert:
          description: Whether funds will be converted
          type: boolean
        value_date:
          description: The value date for the drawdown
          type: string
        deposit_not_used:
          description: Amount of deposit not used from the forward trade
          type: string
        bank_account:
          description: Bank account details for funding the drawdown
          type: object
        fee:
          description: Fee details for the drawdown, including payment and trade fees
          type: object
        fee_bank_account:
          description: Bank account details for the fee payment
          type: object
      required:
        - trade_id
      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

````