> ## 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 wallet balances



## OpenAPI

````yaml /api-reference/openapi.json get /v1/external/secretkey-auth/wallet/balances
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/wallet/balances:
    get:
      tags:
        - External - Wallet (Secret Key)
      summary: Get wallet balances
      operationId: ExternalWalletBalancesSecretKeyController_getOnchainBalances
      parameters: []
      responses:
        '200':
          description: >-
            Balances read from RPC for the merchant payout wallet; excludes
            inactive tokens/chains and chains without RPC in this environment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantWalletOnchainBalancesResponseDto'
        '400':
          description: Merchant wallet address is not configured
        '401':
          description: Invalid or missing x-spacepay-secret-key header
      security:
        - Secret Key: []
components:
  schemas:
    MerchantWalletOnchainBalancesResponseDto:
      type: object
      properties:
        balances:
          description: >-
            Per-chain balance for the default withdrawal token (on-chain, not
            ledger)
          type: array
          items:
            $ref: '#/components/schemas/MerchantWalletOnchainBalanceItemDto'
      required:
        - balances
    MerchantWalletOnchainBalanceItemDto:
      type: object
      properties:
        chainId:
          type: string
          description: CAIP-2 chain id
          example: eip155:8453
        token:
          description: Default withdrawal token metadata from registry
          allOf:
            - $ref: '#/components/schemas/TokenDto'
        amountRaw:
          type: string
          nullable: true
          description: >-
            Token balance in base units (wei / smallest unit) from chain; null
            if RPC failed
          example: '1500000'
        amountFormatted:
          type: string
          nullable: true
          description: >-
            Human-readable balance using token decimals; null if amount could
            not be fetched
          example: '1.5'
      required:
        - chainId
        - token
        - amountRaw
        - amountFormatted
    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.

````