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

# Execute a pending USDT trade on a drain

> Force-executes a stuck USDT-to-USD trade at the current market rate. The drain must have a pending trade (i.e. appear in `GET /liquidation_addresses/drains/pending`).

After execution, the drain will continue processing normally with the executed market rate.




## OpenAPI

````yaml https://withbridge-image1-sv-usw2-monorail-openapi.s3.amazonaws.com/latest.json post /customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute
openapi: 3.0.2
info:
  title: Bridge API
  description: APIs to move into, out of, and between any form of a dollar
  version: '1'
servers:
  - url: https://api.bridge.xyz/v0
    description: The base path for all resources
security:
  - ApiKey: []
tags:
  - name: Customers
  - name: Fiat Payout Configuration
  - name: External Accounts
  - name: Transfers
  - name: Prefunded Accounts
  - name: Balances
  - name: Liquidation Addresses
  - name: Developers
  - name: API Keys
  - name: Plaid
  - name: Virtual Accounts
  - name: Static Memos
  - name: Cards
  - name: Funds Requests
  - name: Webhooks
  - name: Lists
  - name: Crypto Return Policies
  - name: Rewards
  - name: Associated Persons
  - name: Sandbox
paths:
  /customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute:
    parameters:
      - $ref: '#/components/parameters/CustomerIDParameter'
      - $ref: '#/components/parameters/LiquidationAddressIDParameter'
      - name: drainID
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/Id'
    post:
      tags:
        - Liquidation Addresses
      summary: Execute a pending USDT trade on a drain
      description: >
        Force-executes a stuck USDT-to-USD trade at the current market rate. The
        drain must have a pending trade (i.e. appear in `GET
        /liquidation_addresses/drains/pending`).


        After execution, the drain will continue processing normally with the
        executed market rate.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyParameter'
      responses:
        '200':
          description: Drain with trade execute at market rate enabled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Drain'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
components:
  parameters:
    CustomerIDParameter:
      name: customerID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Id'
    LiquidationAddressIDParameter:
      name: liquidationAddressID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Id'
    IdempotencyKeyParameter:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        type: string
  schemas:
    Id:
      description: A UUID that uniquely identifies a resource
      type: string
      pattern: '[a-z0-9]*'
      minLength: 1
      maxLength: 42
    Drain:
      required:
        - id
        - customer_id
        - liquidation_address_id
        - amount
        - currency
        - state
      properties:
        id:
          $ref: '#/components/schemas/Id'
          readOnly: true
        amount:
          description: >-
            Amount of the drain, represented as a dollar denominated string.
            Examples include "100.25", "0.1", "1.234567", "1.01" etc.
          type: string
        customer_id:
          $ref: '#/components/schemas/Id'
          readOnly: true
        liquidation_address_id:
          $ref: '#/components/schemas/Id'
          readOnly: true
        currency:
          $ref: '#/components/schemas/EuroInclusiveCurrency'
        state:
          $ref: '#/components/schemas/TransactionStatus'
          description: Status of the drain
          readOnly: true
        created_at:
          readOnly: true
          type: string
          description: Time of creation of the drain
          format: date-time
        updated_at:
          readOnly: true
          type: string
          description: Time of last update of the drain
          format: date-time
        deposit_tx_hash:
          readOnly: true
          type: string
          description: Hash of the Liquidation Address deposit that triggered this drain
        from_address:
          readOnly: true
          type: string
          description: The blockchain address that sent funds to the Liquidation Address
        source_payment_rail:
          readOnly: true
          type: string
          description: The source payment rail where the funds originated from
        destination:
          $ref: '#/components/schemas/DrainDestination'
          readOnly: true
          description: Destination information of a drain.
        destination_tx_hash:
          readOnly: true
          type: string
          description: Hash of withdrawal of funds to the destination
        refund_tx_hash:
          readOnly: true
          type: string
          description: Hash of refund, if the drain has been returned
        return_details:
          $ref: '#/components/schemas/DrainReturnDetails'
          readOnly: true
          description: Return information, if the drain has been returned.
        receipt:
          $ref: '#/components/schemas/DrainReceipt'
          readOnly: true
          description: Receipt information of a drain.
        exchange_details:
          $ref: '#/components/schemas/ExchangeDetails'
          readOnly: true
          description: Exchange details for the associated trade, if applicable.
    EuroInclusiveCurrency:
      type: string
      enum:
        - brl
        - cop
        - eur
        - eurc
        - gbp
        - mxn
        - pyusd
        - usd
        - usdb
        - usdc
        - usdt
    TransactionStatus:
      type: string
      enum:
        - awaiting_funds
        - in_review
        - funds_received
        - payment_submitted
        - payment_processed
        - canceled
        - error
        - undeliverable
        - returned
        - refund_in_flight
        - refund_failed
        - refunded
    DrainDestination:
      required:
        - payment_rail
        - currency
      properties:
        payment_rail:
          $ref: '#/components/schemas/PaymentRail'
        currency:
          $ref: '#/components/schemas/Currency'
        to_address:
          description: >-
            The crypto wallet address that the customer will ultimately receive
            funds at
          type: string
        blockchain_memo:
          description: >-
            The memo to include in the transaction, for blockchains that support
            memos only
          type: string
        external_account_id:
          $ref: '#/components/schemas/Id'
          description: External bank account to which Bridge will send the funds.
        wire_message:
          $ref: '#/components/schemas/WireMessage'
          description: A message to be sent with a wire transfer.
        sepa_reference:
          $ref: '#/components/schemas/SepaReference'
        swift_reference:
          $ref: '#/components/schemas/SwiftReference'
        spei_reference:
          $ref: '#/components/schemas/SpeiReference'
        reference:
          $ref: '#/components/schemas/Reference'
        ach_reference:
          $ref: '#/components/schemas/AchReference'
        imad:
          $ref: '#/components/schemas/Imad'
        trace_number:
          $ref: '#/components/schemas/TraceNumber'
          readOnly: true
        tracking_number:
          $ref: '#/components/schemas/TrackingNumber'
          readOnly: true
        transaction_id:
          $ref: '#/components/schemas/TransactionId'
          readOnly: true
        sending_institution_name:
          description: The name of the institution sending the funds
          type: string
          readOnly: true
        uetr:
          $ref: '#/components/schemas/Uetr'
    DrainReturnDetails:
      properties:
        reason:
          description: >-
            The reason for the return, as given by the returning financial
            institution.
          type: string
        risk_rejection_reason:
          description: >-
            If the return is due to a risk rejection, this field will be
            populated with the reason for the risk rejection.
          type: string
    DrainReceipt:
      required:
        - initial_amount
        - developer_fee
        - exchange_rate
        - subtotal_amount
        - converted_amount
        - outgoing_amount
        - destination_currency
      properties:
        initial_amount:
          description: >-
            The initial amount of the drain, denominated in the fiat currency to
            which the currency of the Liquidation Address is pegged. Examples
            include "100.25", "0.1", "1.234567", "1.000000000000000001" etc.
          type: string
        developer_fee:
          description: >-
            The developer fee, denominated in the fiat currency to which the
            currency of the Liquidation Address is pegged. This fee is a
            specific amount deducted from the initial total before conversion,
            rather than a percentage.
          type: string
        subtotal_amount:
          description: >-
            The initial amount of the drain less the `developer_fee`,
            denominated in the fiat currency to which the Liquidation Address
            currency is pegged. Examples include "100.25", "0.1", "1.234567",
            "1.000000000000000001" etc.
          type: string
        gas_fee:
          description: >-
            The fee that is deducted from the withdrawn amount to pay for gas. 
            Only included for crypto withdrawals that cost gas (e.g. USDT). It's
            denominated in the fiat currency to which the destination currency
            is pegged.
          type: string
        converted_amount:
          description: >-
            The converted amount of the drain. It's denominated in the
            destination currency or its pegged fiat currency.
          type: string
        exchange_rate:
          description: >-
            The effective exchange rate that can be calculated by dividing the
            converted amount by the amount available for conversion after
            deducting the developer fee.
        outgoing_amount:
          description: >-
            The final amount of the drain, equal to the `converted_amount` minus
            any gas fees. It's denominated in the destination currency or its
            pegged fiat currency.
          type: string
        destination_currency:
          $ref: '#/components/schemas/Currency'
          description: The currency of the fund sent to the customer.
        url:
          description: The URL of a user-facing copy of the receipt.
          type: string
    ExchangeDetails:
      description: Exchange information for a currency conversion.
      properties:
        fixed_rate:
          description: The target exchange rate.
          type: string
        estimated_market_rate:
          description: The estimated achievable rate based on current market conditions.
          type: string
        traded_market_rate:
          description: The actual effective exchange rate achieved.
          type: string
        trade_at_market:
          description: Whether market-rate execution has been applied to this trade.
          type: boolean
        updated_at:
          description: Timestamp of the last exchange details update.
          type: string
          format: date-time
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: string
          minLength: 1
          maxLength: 256
        message:
          type: string
          minLength: 1
          maxLength: 512
        source:
          title: ErrorSource
          required:
            - location
            - key
          properties:
            location:
              type: string
              enum:
                - path
                - query
                - body
                - header
            key:
              type: string
              description: >-
                Comma separated names of the properties or parameters causing
                the error
    PaymentRail:
      type: string
      enum:
        - ach
        - wire
        - ach_push
        - ach_same_day
        - arbitrum
        - avalanche_c_chain
        - base
        - bre_b
        - co_bank_transfer
        - celo
        - ethereum
        - optimism
        - pix
        - polygon
        - solana
        - spei
        - stellar
        - tempo
    Currency:
      type: string
      enum:
        - usdb
        - usdc
        - usdt
        - usd
        - pyusd
    WireMessage:
      description: >-
        A message to be sent with a wire transfer. It can have up to 140
        characters. This message will be validated against 4 lines, each with a
        max length of 35 characters according to the Fedwire standard.
      type: string
      minLength: 1
      maxLength: 256
    SepaReference:
      description: >-
        A reference message to be sent with a SEPA transaction. We recommend you
        set a unique value to help you and your customers track payments end to
        end. It must be from 6 to 140 characters. The allowed characters are
        `a-z`, `A-Z`, `0-9`, spaces, ampersand (`&`), hyphen (`-`), full stop
        (`.`), and solidus (`/`). If not populated, the default value is
        "Payment via Bridge {unique_token}".
      type: string
      minLength: 6
      maxLength: 140
    SwiftReference:
      description: >-
        A payment reference message or remittance information to be included in
        a SWIFT transaction. It can have at most 4 lines (separated by "\n"),
        each line with a max length of 35 chars. The allowed characters are
        `a-z`, `A-Z`, `0-9`, special characters (`/` `-` `?` `:` `(` `)` `.` `,`
        `'` `+`), and space
      type: string
      minLength: 1
      maxLength: 190
    SpeiReference:
      description: >-
        A payment reference message or remittance information to be included in
        a SPEI transaction. The allowed characters are alphanumeric `a-z`,
        `A-Z`, `0-9`, and space
      type: string
      minLength: 1
      maxLength: 40
    Reference:
      description: >
        A payment reference message for newer payment rails (e.g. Pix and Faster
        Payments).
      oneOf:
        - $ref: '#/components/schemas/FasterPaymentsReference'
        - $ref: '#/components/schemas/PixReference'
    AchReference:
      description: >-
        A reference message to be sent with an ACH transaction. It can be at
        most 10 characters, A-Z, a-z, 0-9, and spaces.
      type: string
      minLength: 1
      maxLength: 10
    Imad:
      description: (Wire only) The IMAD of a wire transfer, if available
      type: string
      pattern: '[a-z0-9]*'
      minLength: 1
      maxLength: 40
    TraceNumber:
      description: The trace number of an ACH transfer
      type: string
      pattern: '[0-9]'
      minLength: 15
      maxLength: 15
    TrackingNumber:
      description: >-
        The primary tracking identifier for this fiat transaction. Format varies
        by payment rail (e.g., UETR for SEPA/FPS, clave de rastreo for SPEI,
        end-to-end ID for PIX).
      type: string
      readOnly: true
    TransactionId:
      description: >-
        Deprecated: use tracking_number instead. The unique transaction
        identifier for this payment.
      type: string
      deprecated: true
    Uetr:
      description: >-
        Deprecated: use tracking_number instead. The unique end-to-end
        transaction reference, for tracing purposes.
      type: string
      readOnly: true
      deprecated: true
    FasterPaymentsReference:
      title: Faster Payments
      type: string
      minLength: 1
      maxLength: 18
    PixReference:
      title: Pix
      type: string
      minLength: 1
      maxLength: 100
  responses:
    BadRequestError:
      description: Request containing missing or invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            BadCustomerRequestErrorExample:
              summary: Bad customer request
              value:
                code: bad_customer_request
                message: fields missing from customer body.
                name: first_name,ssn
    AuthenticationError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            MissingTokenError:
              summary: No Api-Key header
              description: The header may be missing or misspelled.
              value:
                code: required
                location: header
                name: Api-Key
                message: Missing Api-Key header
            InvalidTokenError:
              summary: Invalid key in Api-Key header
              value:
                code: invalid
                location: header
                name: Api-Key
                message: Invalid Api-Key header
    NotFoundError:
      description: No resource found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            NotFoundErrorExample:
              summary: Invalid customer id
              value:
                code: Invalid
                message: Unknown customer id
    UnexpectedError:
      description: Unexpected error. User may try and send the request again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            UnexpectedError:
              summary: An unexpected error
              value:
                errors:
                  - code: unexpected
                    message: An expected error occurred, you may try again later
  securitySchemes:
    ApiKey:
      type: apiKey
      name: Api-Key
      in: header

````