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

# Create a new liquidation address for a customer

> 
      Create a new liquidation address for a customer. Liquidation addresses allow 
      customers to automatically liquidate cryptocurrency holdings to fiat or other 
      stablecoins based on configured parameters.

      **Required fields:**
      - chain: Blockchain network (ethereum, polygon, arbitrum, base)
      - currency: Stablecoin currency (usdc, eurc, dai, pyusd, usdt)
      - address: Valid blockchain address

      **At least one destination must be specified:**
      - external_account_id: External bank account
      - prefunded_account_id: Developer's prefunded account
      - bridge_wallet_id: Bridge wallet
      - destination_address: Crypto wallet address

      **Payment Rails:**
      Different payment rails have different requirements:
      - ACH: Requires external_account_id, supports destination_ach_reference
      - SEPA: Requires external_account_id, supports destination_sepa_reference
      - Wire: Requires external_account_id, supports destination_wire_message
      - Crypto: Requires destination_address, supports destination_blockchain_memo
    



## OpenAPI

````yaml /swagger.yml post /api/v0/customers/{customerId}/liquidation_addresses
openapi: 3.0.0
info:
  title: Devdraft AI Payment & Business Management API
  description: >-

    A comprehensive payment processing and business management API that enables
    seamless integration of cryptocurrency and traditional payment methods.
        
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.devdraft.ai
    description: Production Server
security: []
tags: []
paths:
  /api/v0/customers/{customerId}/liquidation_addresses:
    post:
      tags:
        - Liquidation Addresses
      summary: Create a new liquidation address for a customer
      description: |2-

              Create a new liquidation address for a customer. Liquidation addresses allow 
              customers to automatically liquidate cryptocurrency holdings to fiat or other 
              stablecoins based on configured parameters.

              **Required fields:**
              - chain: Blockchain network (ethereum, polygon, arbitrum, base)
              - currency: Stablecoin currency (usdc, eurc, dai, pyusd, usdt)
              - address: Valid blockchain address

              **At least one destination must be specified:**
              - external_account_id: External bank account
              - prefunded_account_id: Developer's prefunded account
              - bridge_wallet_id: Bridge wallet
              - destination_address: Crypto wallet address

              **Payment Rails:**
              Different payment rails have different requirements:
              - ACH: Requires external_account_id, supports destination_ach_reference
              - SEPA: Requires external_account_id, supports destination_sepa_reference
              - Wire: Requires external_account_id, supports destination_wire_message
              - Crypto: Requires destination_address, supports destination_blockchain_memo
            
      operationId: LiquidationAddressController_createLiquidationAddress
      parameters:
        - name: customerId
          required: true
          in: path
          description: Unique identifier for the customer
          schema:
            example: cust_123
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLiquidationAddressDto'
      responses:
        '201':
          description: Liquidation address created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LiquidationAddressResponseDto'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                example:
                  error: Validation failed
                  message: Invalid Ethereum address format
                  statusCode: 400
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                example:
                  error: Not Found
                  message: Customer with id 'cust_123' not found
                  statusCode: 404
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                example:
                  message: Failed to create liquidation address
                  statusCode: 500
components:
  schemas:
    CreateLiquidationAddressDto:
      type: object
      properties:
        chain:
          type: string
          description: The blockchain chain for the liquidation address
          enum:
            - ethereum
            - solana
            - polygon
            - avalanche_c_chain
            - base
            - arbitrum
            - optimism
            - stellar
            - tron
          example: ethereum
        currency:
          type: string
          description: The currency for the liquidation address
          enum:
            - usdc
            - eurc
            - dai
            - pyusd
            - usdt
          example: usdc
        address:
          type: string
          description: The liquidation address on the blockchain
          example: '0x4d0280da2f2fDA5103914bCc5aad114743152A9c'
        external_account_id:
          type: string
          description: External bank account to send funds to
          maxLength: 42
          example: ext_123
        prefunded_account_id:
          type: string
          description: Developer's prefunded account id
          maxLength: 42
          example: pf_acc_123
        bridge_wallet_id:
          type: string
          description: Bridge Wallet to send funds to
          maxLength: 42
          example: bw_123
        destination_payment_rail:
          description: Payment rail for sending funds
          default: ach
          example: sepa
          allOf:
            - $ref: '#/components/schemas/BridgePaymentRail'
        destination_currency:
          description: Currency for sending funds
          default: usd
          example: eur
          allOf:
            - $ref: '#/components/schemas/DestinationCurrency'
        destination_wire_message:
          type: string
          description: Message for wire transfers
          maxLength: 256
          example: Liquidation payment for customer
        destination_sepa_reference:
          type: string
          description: Reference for SEPA transactions
          minLength: 6
          maxLength: 140
          example: SEPA-REF-123456
        destination_ach_reference:
          type: string
          description: Reference for ACH transactions
          maxLength: 10
          example: ACH123
        destination_address:
          type: string
          description: Crypto wallet address for crypto transfers
          example: '0x1234567890abcdef1234567890abcdef12345678'
        destination_blockchain_memo:
          type: string
          description: Memo for blockchain transactions
          example: liquidation-memo-123
        return_address:
          type: string
          description: >-
            Address to return funds on failed transactions (Not supported on
            Stellar)
          example: '0xabcdefabcdefabcdefabcdefabcdefabcdef'
        custom_developer_fee_percent:
          type: string
          description: >-
            Custom developer fee percentage (Base 100 percentage: 10.2% =
            "10.2")
          example: '2.5'
      required:
        - chain
        - currency
        - address
    LiquidationAddressResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the liquidation address
          example: la_generated_id_123
        state:
          type: string
          description: Current state of the liquidation address
          example: active
        customer_id:
          type: string
          description: Customer ID this liquidation address belongs to
          example: cust_123
        chain:
          type: string
          description: Blockchain chain
          example: ethereum
        currency:
          type: string
          description: Currency
          example: usdc
        address:
          type: string
          description: Liquidation address
          example: '0x4d0280da2f2fDA5103914bCc5aad114743152A9c'
        external_account_id:
          type: string
          description: External account ID
        prefunded_account_id:
          type: string
          description: Prefunded account ID
        bridge_wallet_id:
          type: string
          description: Bridge wallet ID
        destination_payment_rail:
          type: string
          description: Destination payment rail
        destination_currency:
          type: string
          description: Destination currency
        custom_developer_fee_percent:
          type: string
          description: Custom developer fee percent
        created_at:
          type: string
          description: Creation timestamp
        updated_at:
          type: string
          description: Last update timestamp
      required:
        - id
        - state
        - customer_id
        - chain
        - currency
        - address
        - created_at
        - updated_at
    BridgePaymentRail:
      type: string
      enum:
        - ethereum
        - solana
        - polygon
        - avalanche_c_chain
        - base
        - arbitrum
        - optimism
        - stellar
        - tron
        - bridge_wallet
        - wire
        - ach
        - ach_push
        - ach_same_day
        - sepa
        - swift
        - spei
      description: >-
        The blockchain network where the source currency resides. Determines gas
        fees and transaction speed.
    DestinationCurrency:
      type: string
      enum:
        - usd
        - eur
        - mxn
        - usdc
        - eurc
        - dai
        - pyusd
        - usdt
      description: Currency for sending funds

````