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

# Get a withdrawal



## OpenAPI

````yaml /api-reference/openapi.json get /v1/external/secretkey-auth/withdrawals/{withdrawalId}
openapi: 3.0.0
info:
  title: SpacePay External API
  description: Merchant-facing SpacePay API endpoints.
  version: '1.0'
servers:
  - url: https://api.spacepay.solutions
    description: Mainnet
  - url: https://api-testnet.spacepay.solutions
    description: Testnet
security: []
tags:
  - name: External - Token Registry (Public)
  - name: External - Payments (Secret Key)
  - name: External - Withdrawals (Secret Key)
  - name: External - Wallet (Secret Key)
paths:
  /v1/external/secretkey-auth/withdrawals/{withdrawalId}:
    get:
      tags:
        - External - Withdrawals (Secret Key)
      summary: Get a withdrawal
      operationId: ExternalWithdrawalsBySecretKeyController_getWithdrawalDetails
      parameters:
        - name: withdrawalId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Withdrawal retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalDto'
        '401':
          description: Invalid or missing x-spacepay-secret-key header
      security:
        - Secret Key: []
components:
  schemas:
    WithdrawalDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Withdrawal ID
        merchantId:
          type: string
          format: uuid
          description: Merchant ID
        amountInCents:
          type: number
          description: Withdrawal amount in USD cents
        chainId:
          type: string
          description: CAIP-2 chain id
          example: eip155:8453
        recipientAddress:
          type: string
          description: Beneficiary address
        status:
          enum:
            - pending
            - processing
            - completed
            - failed
            - cancelled
          type: string
          description: Withdrawal status
        currency:
          type: string
          enum:
            - USD
          description: Currency of the withdrawal
        orderId:
          type: string
          nullable: true
          description: Optional order ID
        customMetadata:
          type: string
          nullable: true
          description: Optional custom metadata
        errorMessage:
          type: string
          nullable: true
          description: Error message (if failed)
        receipt:
          nullable: true
          description: Withdrawal receipt
          allOf:
            - $ref: '#/components/schemas/WithdrawalReceiptDto'
        createdAt:
          format: date-time
          type: string
          description: Created at
        updatedAt:
          format: date-time
          type: string
          description: Updated at
      required:
        - id
        - merchantId
        - amountInCents
        - chainId
        - recipientAddress
        - status
        - currency
        - orderId
        - customMetadata
        - errorMessage
        - receipt
        - createdAt
        - updatedAt
    WithdrawalReceiptDto:
      type: object
      properties:
        withdrawalId:
          type: string
          format: uuid
          description: Withdrawal ID
        settledToken:
          nullable: true
          description: Settled token
          allOf:
            - $ref: '#/components/schemas/TokenDto'
        settledChain:
          nullable: true
          description: Settled chain
          allOf:
            - $ref: '#/components/schemas/ChainDto'
        settledAmountAsset:
          type: string
          nullable: true
          description: Settled amount in asset
          example: '100'
        settledAmountUsd:
          type: string
          nullable: true
          description: Settled amount in USD
          example: '100.00'
        txHash:
          type: string
          nullable: true
          description: Transaction hash
          example: '0xda3be87732110de6c1354c83770aae630ede9ac308d9f7b399ecfba23d923384'
        txBlockNumber:
          type: number
          nullable: true
          description: Block number
          example: 123456
        txTimestamp:
          format: date-time
          type: string
          nullable: true
          description: Timestamp
          example: '2021-01-01T00:00:00.000Z'
        txSenderAddress:
          type: string
          nullable: true
          description: Sender address
          example: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
        txGasUsed:
          type: number
          nullable: true
          description: Gas used
          example: 100000
        txTotalCost:
          type: string
          nullable: true
          description: Total cost
          example: '1000000000000000000'
        txTotalCostUsdFractions:
          type: number
          nullable: true
          description: Total cost in USD, 6 decimals of precision
          example: 1000000
        txIsSponsored:
          type: boolean
          nullable: true
          description: Is transaction sponsored
          example: true
        processedBy:
          nullable: true
          enum:
            - webhook
            - frontend
            - cron
            - manual
          type: string
          description: Who processed the transaction
        createdAt:
          format: date-time
          type: string
          description: Created at
      required:
        - withdrawalId
        - settledToken
        - settledChain
        - settledAmountAsset
        - settledAmountUsd
        - txBlockNumber
        - txTimestamp
        - txSenderAddress
        - txGasUsed
        - txTotalCost
        - txTotalCostUsdFractions
        - txIsSponsored
        - processedBy
        - createdAt
    TokenDto:
      type: object
      properties:
        id:
          type: string
          description: Token ID
          example: 123e4567-e89b-12d3-a456-426614174000
        coingeckoApiId:
          type: string
          description: Coingecko API ID
          example: ethereum
        chain:
          description: Chain information
          allOf:
            - $ref: '#/components/schemas/ChainDto'
        symbol:
          type: string
          description: Token symbol
          example: USDC
        contractAddress:
          type: string
          description: Token contract address (lowercase)
          example: '0xa0b86a33e6441b8c4c8c0c0c0c0c0c0c0c0c0c0'
        decimals:
          type: number
          description: Token decimals
          example: 6
        type:
          enum:
            - stablecoin
            - volatile
          type: string
          description: Token type
          example: stablecoin
        assetType:
          enum:
            - native
            - erc20
          type: string
          description: Token asset type
          example: native
        status:
          enum:
            - active
            - deprecated
            - blocked
          type: string
          description: Token status
          example: active
        tokenPriceUsd:
          type: number
          nullable: true
          description: Token price in USD
          example: 1
      required:
        - id
        - coingeckoApiId
        - chain
        - symbol
        - contractAddress
        - decimals
        - type
        - assetType
        - status
        - tokenPriceUsd
    ChainDto:
      type: object
      properties:
        chainId:
          type: string
          description: CAIP-2 chain id
          example: eip155:1
        name:
          type: string
          description: Chain name
          example: Ethereum
        nativeSymbol:
          type: string
          description: Native token symbol
          example: ETH
        nativeDecimals:
          type: number
          description: Native token decimals
          example: 18
        isEnabled:
          type: boolean
          description: Whether the chain is enabled
          example: true
        isTestnet:
          type: boolean
          description: Whether the chain is a testnet
          example: false
      required:
        - chainId
        - name
        - nativeSymbol
        - nativeDecimals
        - isEnabled
        - isTestnet
  securitySchemes:
    Secret Key:
      type: apiKey
      in: header
      name: x-spacepay-secret-key
      description: Secret key for authentication of external API.

````