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

# Scan a Payer Wallet

> Read a connected wallet's USDC and USDT balances on every network a pay link takes, with each network's fee and whether the wallet can pay it.

```bash theme={null}
curl "https://api.xenarch.dev/v1/links/JJjIwDyV4N1CG9g8AHMxfdJ9/wallet-scan?address=0xBuyerWalletAddress000000000000000000000000"
```

```json 200 theme={null}
{
  "address": "0xBuyerWalletAddress000000000000000000000000",
  "balances": [
    {
      "network": "base",
      "token": "USDC",
      "chain_id": 8453,
      "decimals": 6,
      "balance_micro": "240000000",
      "native_symbol": "ETH",
      "native_balance": "0.018",
      "fee_native": "0.0000002",
      "fee_usd": "0.0006",
      "has_gas": true,
      "confirmations": 1
    },
    {
      "network": "bnb",
      "token": "USDT",
      "chain_id": 56,
      "decimals": 18,
      "balance_micro": "310000000",
      "native_symbol": "BNB",
      "native_balance": "0",
      "fee_native": "0.0000093",
      "fee_usd": "0.006",
      "has_gas": false,
      "confirmations": 15
    }
  ],
  "unavailable": []
}
```

The hosted pay page calls this after the buyer connects a wallet, to offer the balances that can pay, cheapest network fee first. Use it if you build your own checkout for a link that takes more than Base USDC.

It's public and read-only: it never moves anything, and Xenarch doesn't store the address. It covers every network and coin the link takes from a connected wallet (all but Tron, which takes exact-amount transfers only).

## Fields

| Field | Description |
| - | - |
| `balances[].balance_micro` | The wallet's balance of that token, in 6-decimal micro units |
| `balances[].native_symbol`, `native_balance` | The coin the network fee is paid in, and how much of it the wallet holds |
| `balances[].fee_native`, `fee_usd` | Estimated fee of one transfer, in that coin and in USD (`null` when no price is available) |
| `balances[].has_gas` | Whether the wallet holds enough of the fee coin, with a margin. When it's `false`, ask the buyer to add some or to pay another way. |
| `unavailable` | Networks that couldn't be read right now. Their rows are missing. |

Results are cached for about 15 seconds per link and address.

## Errors

| Status | Meaning |
| - | - |
| `404` | No link with this id, or the link is revoked |
| `422` | `address` isn't an EVM address |
| `429` | Too many requests from this IP address |


## OpenAPI

````yaml GET /v1/links/{link_id}/wallet-scan
openapi: 3.1.0
info:
  title: Xenarch API
  version: 0.1.0
servers:
  - url: https://api.xenarch.dev
security: []
paths:
  /v1/links/{link_id}/wallet-scan:
    get:
      tags:
        - pay-links
      summary: Scan a Payer Wallet
      description: >-
        A connected wallet's USDC and USDT balances on every network the link
        takes from a wallet, with each network's fee and whether the wallet can
        pay it. Public and read-only; the address isn't stored.
      operationId: scan_payer_wallet_v1_links__link_id__wallet_scan_get
      parameters:
        - name: link_id
          in: path
          required: true
          schema:
            type: string
            title: Link Id
        - name: address
          in: query
          required: true
          schema:
            type: string
            pattern: ^0x[0-9a-fA-F]{40}$
            title: Address
          description: The buyer's EVM wallet address.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletScanResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WalletScanResponse:
      type: object
      title: WalletScanResponse
      properties:
        address:
          type: string
          description: The scanned address, checksummed.
        balances:
          type: array
          items:
            $ref: '#/components/schemas/WalletScanBalance'
          description: >-
            One row per network and stablecoin the link takes from a connected
            wallet.
        unavailable:
          type: array
          items:
            type: string
          description: Networks that couldn't be read right now. Their rows are missing.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WalletScanBalance:
      type: object
      title: WalletScanBalance
      properties:
        network:
          type: string
        token:
          type: string
        chain_id:
          type: integer
        decimals:
          type: integer
          description: The token's on-chain decimals.
        balance_micro:
          type: string
          description: The wallet's balance of this token, in 6-decimal micro units.
        native_symbol:
          type: string
          description: The coin the network fee is paid in.
        native_balance:
          type: string
          description: The wallet's balance of that coin.
        fee_native:
          type: string
          description: Estimated fee of one transfer, in that coin.
        fee_usd:
          type:
            - string
            - 'null'
          description: The same fee in USD, or `null` when no price is available.
        has_gas:
          type: boolean
          description: Whether the wallet holds enough of the fee coin, with a margin.
        confirmations:
          type: integer
          description: Confirmations needed on this network.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.