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

# Prepare a withdrawal request

> Turns the user's burn transaction data on the remote chain into fully encoded burn intents to send to the `/withdraw` endpoint. This endpoint performs the following:
- Resolves contract and token addresses across networks.
- Determines the optimal forwarding strategy, such as redepositing to another xReserve remote domain or forwarding to a CCTP domain.
- Calculates transfer amounts and fees.
- Encodes forwarding call data with the calculated transfer amounts.
- Generates `maxBlockHeight` and `maxFee` values with safety buffers.
- Returns data in the structure expected by the withdraw endpoint.

Note: The `/withdraw` endpoint requires signatures and the remote chain `burnTxId` in addition to the burn intent prepared by this endpoint.




## OpenAPI

````yaml openapi/xreserve.yaml post /v1/prepare-withdrawal
openapi: 3.0.2
info:
  title: Circle xReserve
  version: 1.0.0
  description: >
    xReserve enables transfers between USDC and USDC-backed tokens across
    supported blockchain networks using a secure attestation system.
servers:
  - url: https://xreserve-api-testnet.circle.com
    description: Testnet
  - url: https://xreserve-api.circle.com
    description: Mainnet
security: []
tags:
  - name: xReserve
    description: xReserve endpoints
paths:
  /v1/prepare-withdrawal:
    post:
      tags:
        - xReserve
      summary: Prepare a withdrawal request
      description: >
        Turns the user's burn transaction data on the remote chain into fully
        encoded burn intents to send to the `/withdraw` endpoint. This endpoint
        performs the following:

        - Resolves contract and token addresses across networks.

        - Determines the optimal forwarding strategy, such as redepositing to
        another xReserve remote domain or forwarding to a CCTP domain.

        - Calculates transfer amounts and fees.

        - Encodes forwarding call data with the calculated transfer amounts.

        - Generates `maxBlockHeight` and `maxFee` values with safety buffers.

        - Returns data in the structure expected by the withdraw endpoint.


        Note: The `/withdraw` endpoint requires signatures and the remote chain
        `burnTxId` in addition to the burn intent prepared by this endpoint.
      operationId: prepareWithdrawal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareWithdrawalRequest'
      responses:
        '200':
          $ref: '#/components/responses/PrepareWithdrawalResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '500':
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    PrepareWithdrawalRequest:
      type: object
      description: Contains data that prepares burn intents for withdrawal.
      properties:
        batches:
          type: array
          description: Array of burn intent batches.
          items:
            $ref: '#/components/schemas/PrepareBurnIntentInput'
      required:
        - batches
    PrepareBurnIntentInput:
      type: object
      description: Contains burn intent data used to prepare burn intents.
      required:
        - token
        - remoteDomain
        - remoteDepositor
        - finalDestinationDomain
        - finalDestinationRecipient
        - useCircleForwarding
      properties:
        token:
          type: string
          enum:
            - USDC
          description: Symbol of the token to transfer.
        valueExcludingFees:
          type: string
          pattern: ^\d+(\.\d+)?$
          description: >-
            Crosschain transfer amount excluding fees, in decimal string
            formatting. Pass either this field or `valueIncludingFees`, but not
            both.
          example: '10.00'
        valueIncludingFees:
          type: string
          pattern: ^\d+(\.\d+)?$
          description: >-
            Crosschain transfer amount including fees, in decimal string
            formatting. Pass either this field or `valueExcludingFees`, but not
            both.
          example: '10.00'
        remoteDomain:
          type: integer
          minimum: 1
          description: >-
            The remote domain ID. Typically greater than `10000`. Must be
            different from `finalDestinationDomain`.
        remoteDepositor:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: >-
            The remote depositor address as a 32-byte hexadecimal string. This
            address initiated the withdrawal on the remote chain.
        finalDestinationDomain:
          type: integer
          minimum: 0
          description: >-
            The destination domain where forwarded funds are withdrawn, either a
            CCTP supported domain or another remote domain. Must be different
            from `remoteDomain`.
        finalDestinationRecipient:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: >-
            The recipient address on the final destination domain as a 32-byte
            hexadecimal string.
        finalDestinationCaller:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: >-
            Authorized caller address on the final destination chain as a
            32-byte hexadecimal string. If this field is present, the caller
            must be this address.
        salt:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: >-
            A salt that is used to ensure uniqueness in the burn intent as a
            32-byte hexadecimal string. If omitted, this field is randomly
            generated.
        useCircleForwarding:
          type: boolean
          description: >-
            Indicates whether Circle should forward the transaction and release
            funds on either a CCTP supported blockchain or another remote
            blockchain.
        forwardingOptions:
          $ref: '#/components/schemas/ForwardingOptions'
          description: Options for forwarding the transaction.
    PrepareWithdrawalResponse:
      type: object
      description: Contains prepared burn intents.
      properties:
        batches:
          type: array
          description: List of prepared burn intents.
          items:
            type: object
            properties:
              burnIntents:
                type: array
                items:
                  $ref: '#/components/schemas/BurnIntent'
              encoded:
                type: string
                description: Encoded burn intent data
              messageHashToSign:
                type: string
                description: >-
                  The message hash to sign before submitting the withdrawal
                  request.
            required:
              - burnIntents
              - encoded
              - messageHashToSign
      required:
        - batches
    ErrorResponse:
      type: object
      description: Standard error response.
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Error message
    ForwardingOptions:
      type: object
      description: Contains forwarding strategies, either a redeposit or CCTP forwarding.
      properties:
        maxFee:
          type: string
          pattern: ^\d+(\.\d{1,6})?$
          description: >-
            Maximum fee for redeposits or CCTP forwarding. This required fee is
            in addition to the `burnIntent.maxFee`.
        hookData:
          type: string
          pattern: ^0x[a-fA-F0-9]*$
          description: Optional hook data for forwarding, in hexadecimal format.
        usesFastFinality:
          type: boolean
          description: >-
            Indicates whether to use fast finality. Required for CCTP
            forwarding.
    BurnIntent:
      type: object
      description: A burn intent representing a single withdrawal request.
      required:
        - maxBlockHeight
        - maxFee
        - spec
      properties:
        maxBlockHeight:
          type: string
          pattern: ^\d+$
          description: The maximum block height at which the burn intent is valid.
          example: '1000000'
        maxFee:
          type: string
          pattern: ^\d+$
          description: >-
            The maximum fee allowed for the burn intent in the smallest token
            unit.
          example: '100000'
        spec:
          $ref: '#/components/schemas/TransferSpec'
    TransferSpec:
      type: object
      description: Contains transfer specifications for a withdrawal.
      required:
        - version
        - sourceDomain
        - destinationDomain
        - sourceContract
        - destinationContract
        - sourceToken
        - destinationToken
        - sourceDepositor
        - destinationRecipient
        - sourceSigner
        - destinationCaller
        - value
        - salt
        - hookData
      properties:
        version:
          type: integer
          description: Transfer specification version.
          example: 1
        sourceDomain:
          type: integer
          description: Source domain ID.
          example: 0
        destinationDomain:
          type: integer
          description: Destination domain ID.
          example: 1
        sourceContract:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Source contract address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6'
        destinationContract:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Destination contract address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7'
        sourceToken:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Source token address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c'
        destinationToken:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Destination token address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d'
        sourceDepositor:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Source depositor address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad'
        destinationRecipient:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Destination recipient address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe'
        sourceSigner:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Source signer address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0'
        destinationCaller:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Destination caller address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1'
        value:
          type: string
          pattern: ^\d+$
          description: The transfer amount in the smallest token unit.
          example: '1000000'
        salt:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Random salt that ensures uniqueness as a 32-byte hexadecimal string.
          example: '0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4'
        hookData:
          $ref: '#/components/schemas/StructuredHookData'
    StructuredHookData:
      type: object
      description: >-
        Contains structured hook data for withdrawals, including forwarding and
        remote chain information.
      required:
        - remoteDomain
        - remoteDepositor
        - remoteToken
        - forwardingContractAddress
        - forwardingCalldata
      properties:
        remoteDomain:
          type: integer
          description: Remote chain domain identifier.
          example: 10001
        remoteDepositor:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Remote depositor address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6'
        remoteToken:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          description: Remote token address as a 32-byte hexadecimal string.
          example: '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7'
        forwardingContractAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            Forwarding contract address as a 20-byte hexadecimal string. If you
            are not forwarding funds, set to `0x0`.
          example: '0x0000000000000000000000000000000000000000'
        forwardingCalldata:
          type: string
          pattern: ^0x([a-fA-F0-9]{8}[a-fA-F0-9]*)?$
          description: >-
            Forwarding call data. If you are forwarding funds, set to `0x` + a
            4-byte function selector + optional data. If not forwarding, set to
            `0x`.
          example: 0x
  responses:
    PrepareWithdrawalResponse:
      description: Successfully prepared burn intents ready for withdrawal.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PrepareWithdrawalResponse'
    ErrorResponse:
      description: Standard error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````