> ## 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.

# Set Link Networks

> Choose the networks and stablecoins a pay link takes: USDC on Base, Ethereum, BNB Chain and Monad, and USDT on Ethereum, BNB Chain, Monad (USDT0) and Tron.

```bash theme={null}
curl -X PUT https://api.xenarch.dev/v1/links/JJjIwDyV4N1CG9g8AHMxfdJ9/networks \
  -H "Authorization: Bearer xm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "networks": {
      "ethereum": {"tokens": ["USDC", "USDT"]},
      "bnb": {"tokens": ["USDT"]},
      "tron": {"tokens": ["USDT"], "pay_to": "TYourTronReceivingAddress00000000"}
    }
  }'
```

```json 200 theme={null}
{
  "link_id": "JJjIwDyV4N1CG9g8AHMxfdJ9",
  "accepted_networks": {
    "ethereum": {"tokens": ["USDC", "USDT"]},
    "bnb": {"tokens": ["USDT"]},
    "tron": {"tokens": ["USDT"], "pay_to": "TYourTronReceivingAddress00000000"}
  },
  "networks": [
    {
      "network": "base",
      "name": "Base",
      "chain_id": 8453,
      "standard": "",
      "native_symbol": "ETH",
      "confirmations": 1,
      "wallet": true,
      "pay_to": "0xYourWalletAddress",
      "tokens": [{"symbol": "USDC", "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "decimals": 6}]
    },
    {
      "network": "tron",
      "name": "Tron",
      "chain_id": null,
      "standard": "TRC-20",
      "native_symbol": "TRX",
      "confirmations": 19,
      "wallet": false,
      "pay_to": "TYourTronReceivingAddress00000000",
      "tokens": [{"symbol": "USDT", "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "decimals": 6}]
    }
  ]
}
```

Every pay link takes USDC on Base. This endpoint adds more networks and coins to one link, as the link's **Settings > Networks** does in the dashboard. The payment still goes straight from the buyer's wallet to yours, and the buyer pays that network's fee.

Subscriptions stay USDC on Base. For now, links with a tip, invoices that collect billing details before payment, and checkouts opened with the embed script or `@xenarch/react` also take USDC on Base only.

| Network | `network` | USDC | USDT | Fee coin | Confirmations |
| - | - | - | - | - | - |
| Base | `base` | always on | not issued | ETH | 1 |
| Ethereum | `ethereum` | yes | yes | ETH | 12 |
| BNB Chain | `bnb` | yes | yes | BNB | 15 |
| Monad | `monad` | yes | USDT0 | MON | 2 |
| Tron | `tron` | not issued | yes\* | TRX | 19 |

USDT0 is Tether's USDT on Monad. \*Tron takes exact-amount transfers only: an exchange withdrawal or a Tron wallet app, never a connected wallet.

## Authentication

The link's owner only: a merchant key (`Authorization: Bearer xm_live_...`) or the dashboard's wallet session. See [Authentication](https://docs.xenarch.com/api-reference/authentication.md).

## Body

`networks` replaces the whole setting. Each key is a network; each value has `tokens`, a list of `USDC` and `USDT`. An empty list turns that network off, and `{}` goes back to Base USDC only. Base USDC is always on and can't be turned off.

On an EVM network the link's own receiving wallet is used, so it must be a plain wallet there. A smart-contract wallet often doesn't exist at the same address on another chain, so Xenarch refuses it with `409`. Tron needs `pay_to`, your Tron receiving address (it starts with `T`); Xenarch checks its checksum.

The setting isn't part of the link's signed terms, so open checkouts keep working when you change it.

## Response

| Field | Description |
| - | - |
| `accepted_networks` | The stored setting, or `null` for Base USDC only |
| `networks` | What the link takes now, in the order a pay page lists it. The same list [Get Link](https://docs.xenarch.com/api-reference/links/get.md) returns to buyers. |

## Errors

| Status | Meaning |
| - | - |
| `400` | An unknown or disabled network or coin, or a malformed address |
| `401` | No merchant key or session |
| `404` | No link with this id, or the link isn't yours |
| `409` | The link's receiving wallet is a contract on that network |
| `502` | The network couldn't be checked right now. Try again. |


## OpenAPI

````yaml PUT /v1/links/{link_id}/networks
openapi: 3.1.0
info:
  title: Xenarch API
  version: 0.1.0
servers:
  - url: https://api.xenarch.dev
security: []
paths:
  /v1/links/{link_id}/networks:
    put:
      tags:
        - pay-links
      summary: Set Link Networks
      description: >-
        Choose the networks and stablecoins a pay link takes beyond Base USDC.
        Owner only. Replaces the whole setting.
      operationId: put_link_networks_v1_links__link_id__networks_put
      parameters:
        - name: link_id
          in: path
          required: true
          schema:
            type: string
            title: Link Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayLinkNetworksBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayLinkNetworksResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PayLinkNetworksBody:
      type: object
      title: PayLinkNetworksBody
      required:
        - networks
      description: >-
        The networks and stablecoins the link takes beyond Base USDC. Replaces
        the whole setting; `{}` goes back to Base USDC only.
      properties:
        networks:
          type: object
          maxProperties: 16
          description: >-
            Keyed by network. Each value has `tokens` (a list of `USDC`/`USDT`;
            an empty list turns the network off). Tron also needs `pay_to`, your
            Tron receiving address. Base USDC is always on.
          additionalProperties:
            type: object
            properties:
              tokens:
                type: array
                items:
                  type: string
                  enum:
                    - USDC
                    - USDT
              pay_to:
                type: string
                description: 'Tron only: your T-address.'
      example:
        networks:
          ethereum:
            tokens:
              - USDC
              - USDT
          bnb:
            tokens:
              - USDT
          tron:
            tokens:
              - USDT
            pay_to: T…
    PayLinkNetworksResponse:
      type: object
      title: PayLinkNetworksResponse
      required:
        - link_id
      properties:
        link_id:
          type: string
        accepted_networks:
          type:
            - object
            - 'null'
          description: >-
            The stored setting, as you sent it after normalising. `null` means
            Base USDC only.
        networks:
          type: array
          items:
            $ref: '#/components/schemas/PayLinkNetwork'
          description: What the link takes now, as a pay page lists it.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PayLinkNetwork:
      type: object
      title: PayLinkNetwork
      description: >-
        One network a pay link takes, in the order a pay page lists them. Base
        USDC comes first.
      properties:
        network:
          type: string
          description: '`base`, `ethereum`, `bnb`, `monad` or `tron`.'
        name:
          type: string
          description: Display name, for example `BNB Chain`.
        label:
          type: string
          description: Display label.
        kind:
          type: string
          description: '`evm` or `tron`.'
        chain_id:
          type:
            - integer
            - 'null'
          description: EVM chain id (8453, 1, 56, 143). `null` on Tron.
        standard:
          type: string
          description: >-
            Token standard shown to buyers, for example `ERC-20`, `BEP-20`,
            `TRC-20`. Empty on Base.
        native_symbol:
          type: string
          description: 'The coin the network fee is paid in: `ETH`, `BNB`, `MON` or `TRX`.'
        confirmations:
          type: integer
          description: Confirmations needed before a payment is booked.
        wallet:
          type: boolean
          description: >-
            Whether a buyer can pay from a connected wallet here. `false` on
            Tron, which takes `manual` payments only.
        explorer_name:
          type: string
          description: Block explorer name, for example `Etherscan`.
        explorer_tx:
          type: string
          description: Explorer URL prefix for a transaction hash.
        pay_to:
          type: string
          description: >-
            The receiving address on this network: the link's wallet on EVM
            networks, the owner's Tron address on Tron.
        tokens:
          type: array
          description: The stablecoins taken here.
          items:
            type: object
            properties:
              symbol:
                type: string
              address:
                type: string
                description: Token contract.
              decimals:
                type: integer
    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.