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

# Accept

> Accepts a drawdown proposal generated by the drawdown-quote call, turning it into a confirmed drawdown that settles on the next business day.



## OpenAPI

````yaml POST /customers/{customerId}/hedges/{hedgeId}/drawdown/accept
openapi: 3.1.0
info:
  title: Grain API
  version: 1.0.0
  description: >-
    Grain's API provides a comprehensive set of endpoints for managing hedging,
    currency conversions, pricing, and fund movements - enabling seamless
    integration of FX workflows into your platform. Each API call follows REST
    conventions, uses secure authentication, and returns standardized responses
    for consistency across environments.
  license:
    name: Creative Commons Attribution 3.0
  contact:
    name: Grain Finance
    url: https://docs.grainfinance.co
    email: support@grainfinance.co
  termsOfService: https://grainfinance.co/terms-of-service/
  x-apiClientRegistration:
    url: https://grainfinance.co/partners
servers:
  - url: https://api.grainfinance.co/v1
    description: Grain API
security: []
tags:
  - name: Hedges
    description: >-
      Hedge objects represent transactions that lock exchange rates for future
      dates. A single hedge locks an exchange rate for a future transaction
      between two currencies.
  - name: Dual Hedges
    description: >-
      A dual hedge mitigates FX risk by automatically generating two linked
      hedge legs - a customer leg and a supplier leg - both routed through the
      customer's functional currency. This structure reduces exposure to
      currency fluctuations for both cash flow and accounting purposes, while
      allowing independent tracking and reporting of each hedge leg.
  - name: Customers
    description: >-
      Customer objects represent your end customers on the Grain platform. A
      customer must be created before a hedge or conversion can be initiated.
  - name: Pricing
    description: >-
      Pricing endpoints provide access to FX rates for currency pairs that are
      not being hedged. These endpoints can be used for live rate display or
      bulk retrieval to support high-volume quoting workflows.
  - name: Conversions
    description: >-
      Conversion objects represent currency conversions executed for immediate
      or near-term settlement.
  - name: Wallets
    description: Endpoints to view balances, manage funding, and perform transfers.
  - name: Vendors
    description: >-
      Vendor objects represent payees that payouts can be sent to. A vendor
      holds contact details and one or more payout methods — the bank accounts
      payouts are sent to.
paths:
  /customers/{customerId}/hedges/{hedgeId}/drawdown/accept:
    post:
      tags:
        - Hedges
      description: >-
        Accepts a drawdown proposal generated by the drawdown-quote call,
        turning it into a confirmed drawdown that settles on the next business
        day.
      operationId: Drawdown Accept
      parameters:
        - description: The id of the customer within the Grain platform.
          in: path
          name: customerId
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
        - description: The id of the hedge within the Grain platform.
          in: path
          name: hedgeId
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
        - in: header
          name: X-Customer-IP
          required: true
          schema:
            $ref: '#/components/schemas/CustomerIP'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptDrawdownRequestBody'
      responses:
        '200':
          description: Drawdown Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DrawdownResponse'
              examples:
                Example 1:
                  value:
                    id: 4d78ac65-2c3f-47e2-8bf3-3f76124e9d27
                    hedgeId: 8173b9a7-ee61-413e-b9e3-7c04b2a067c5
                    status: Active
                    fromCurrency: MXN
                    toCurrency: USD
                    fromCurrencyAmount: 8040.43
                    toCurrencyAmount: 390
                    collateralAmountReleased: 402.02
                    quote: 20.6165
                    endAt: '2023-01-25'
                    settlementAt: '2023-01-26'
                    beforeHedgeState:
                      fromCurrencyAmount: 32161.8
                      toCurrencyAmount: 1560
                      quote: 20.6165
                      endAt: '2023-02-23'
                      settlementAt: '2023-02-24'
                      collateralAmount: 1608.09
                    afterHedgeState:
                      fromCurrencyAmount: 24121.37
                      toCurrencyAmount: 1170
                      quote: 20.6165
                      endAt: '2023-02-23'
                      settlementAt: '2023-02-24'
                      collateralAmount: 1206.07
        '403':
          description: The request failed because the caller has insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The request failed because the resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The request failed because a business rule constraint was violated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            The request failed because it is either semantically incorrect or
            has failed business validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '451':
          description: The request failed due to legal restrictions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RejectedByIPError'
      security:
        - api-key: []
components:
  schemas:
    UUID:
      type: string
      format: uuid
      pattern: >-
        [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
    CustomerIP:
      type: string
      format: IPv4
      description: >-
        The IPv4 address of the browser from which the customer contacts your
        platform. <br />

        _example_: `192.158.1.38`
      pattern: ((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}
    AcceptDrawdownRequestBody:
      description: The payload required in order to accept a drawdown proposal.
      properties:
        drawdownProposalId:
          $ref: '#/components/schemas/UUID'
          description: The id returned by the drawdown-quote call.
          example: 497f6eca-6276-4993-bfeb-53cbbbba6f08
        externalDrawdownId:
          type: string
          description: Your own reference id for this drawdown.
          example: dd_2026_001
      required:
        - drawdownProposalId
      type: object
      additionalProperties: false
    DrawdownResponse:
      description: >-
        An executed drawdown, returned by the drawdown-accept call and when
        fetching a drawdown.
      properties:
        id:
          $ref: '#/components/schemas/UUID'
          description: The id of the drawdown within the Grain platform.
          example: 4d78ac65-2c3f-47e2-8bf3-3f76124e9d27
        hedgeId:
          $ref: '#/components/schemas/UUID'
          description: The id of the hedge this drawdown belongs to.
          example: 8173b9a7-ee61-413e-b9e3-7c04b2a067c5
        status:
          $ref: '#/components/schemas/DrawdownStatus'
          description: The status of the drawdown.
          example: Active
        fromCurrency:
          type: string
          description: >-
            The currency in which the transaction should be paid at by your
            customer.
          example: MXN
        toCurrency:
          type: string
          description: >-
            The currency in which the inventory item is listed at on your
            platform.
          example: USD
        fromCurrencyAmount:
          type: number
          format: double
          description: >-
            The amount to draw down in the fromCurrency.

            If toCurrencyAmount is provided, then fromCurrencyAmount calculated
            as:

            `fromCurrencyAmount = toCurrencyAmount * quote`
          example: 8040.43
        toCurrencyAmount:
          type: number
          format: double
          description: >-
            The amount to draw down in the toCurrency.

            If fromCurrencyAmount is provided, then toCurrencyAmount calculated
            as:

            `toCurrencyAmount = fromCurrencyAmount / quote`
          example: 390
        collateralAmountReleased:
          type: number
          format: double
          description: >-
            The collateral amount released back to the customer as a result of
            this drawdown, in the fromCurrency.
          example: 402.02
        quote:
          type: number
          format: double
          description: >-
            The rate at which this drawdown settles - the rate locked by the
            hedge.
          example: 20.6165
        endAt:
          $ref: '#/components/schemas/GrainDateFormat'
          description: >-
            The date in which this drawdown executes, denoted in `YYYY-MM-DD`
            format.
          example: '2023-01-25'
        settlementAt:
          $ref: '#/components/schemas/GrainDateFormat'
          description: >-
            The date in which this drawdown settles (next business day after
            endAt), denoted in `YYYY-MM-DD` format.
          example: '2023-01-26'
        beforeHedgeState:
          $ref: '#/components/schemas/HedgeStateSnapshot'
          description: The hedge's state immediately before this drawdown.
        afterHedgeState:
          $ref: '#/components/schemas/HedgeStateSnapshot'
          description: The hedge's remaining state immediately after this drawdown.
      required:
        - id
        - hedgeId
        - status
        - fromCurrency
        - toCurrency
        - fromCurrencyAmount
        - toCurrencyAmount
        - collateralAmountReleased
        - quote
        - endAt
        - settlementAt
        - beforeHedgeState
        - afterHedgeState
      type: object
      additionalProperties: false
    ErrorResponse:
      description: An API Error
      properties:
        message:
          type: string
          description: A short explanation of the error.
          example: Can't perform this action
        reason:
          type: string
          description: A detailed description of the reason for the failure.
          example: >-
            Supplied object is in *Cancelled* state, which prevents performing
            this action
      required:
        - message
      type: object
      additionalProperties: false
    RejectedByIPError:
      properties:
        message:
          type: string
          description: A short explanation of the error.
          example: Could not parse IP address (v4 or v6) for ip
      required:
        - message
      type: object
      additionalProperties: false
    DrawdownStatus:
      description: >-
        The status of a drawdown as shown to partners. A drawdown is InProcess
        from acceptance

        until its settlement completes, Completed once settled, and Overdue when
        settlement is late.
      enum:
        - Active
        - InProcess
        - Completed
        - Overdue
      type: string
    GrainDateFormat:
      type: string
      example: '2023-04-15'
      format: YYYY-MM-DD
      description: >-
        The date format accepted by Grain's API. We accept dash separated
        ISO-8601 date-only strings.
      pattern: \d{4}-\d{2}-\d{2}
    HedgeStateSnapshot:
      description: >-
        A lighter point-in-time view of a hedge's position, used inside drawdown
        responses

        to show the hedge state before and after the action.
      properties:
        fromCurrencyAmount:
          type: number
          format: double
          description: The remaining hedge amount in the fromCurrency at this state.
          example: 32161.8
        toCurrencyAmount:
          type: number
          format: double
          description: The remaining hedge amount in the toCurrency at this state.
          example: 1560
        quote:
          type: number
          format: double
          description: The hedge rate at this state.
          example: 20.6165
        endAt:
          $ref: '#/components/schemas/GrainDateFormat'
          description: The hedge end date at this state, denoted in `YYYY-MM-DD` format.
          example: '2023-02-23'
        settlementAt:
          $ref: '#/components/schemas/GrainDateFormat'
          description: >-
            The hedge settlement date at this state, denoted in `YYYY-MM-DD`
            format.
          example: '2023-02-24'
        collateralAmount:
          type: number
          format: double
          description: >-
            The collateral amount held for the hedge at this state, in the
            fromCurrency.
          example: 1608.09
      required:
        - fromCurrencyAmount
        - toCurrencyAmount
        - quote
        - endAt
        - settlementAt
        - collateralAmount
      type: object
      additionalProperties: false
  securitySchemes:
    api-key:
      type: http
      scheme: basic
      description: >-
        Basic authentication using the partner API keys from
        https://console.grainfinance.co/keys

````