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

# Create Payment Intent

> Start a pay-link payment from a buyer's own wallet, in USDC or USDT on any network the link takes. Returns the transfer to send, or an exact amount to send from an exchange or any wallet app.

```bash theme={null}
curl -X POST https://api.xenarch.dev/v1/links/JJjIwDyV4N1CG9g8AHMxfdJ9/intent \
  -H "Content-Type: application/json" \
  -d '{"method": "wallet", "payer": "0xBuyerWalletAddress000000000000000000000000"}'
```

```json 200 theme={null}
{
  "reference": "0x5c1e8a0b7d2f4e6a9c3b1d08",
  "link_id": "JJjIwDyV4N1CG9g8AHMxfdJ9",
  "method": "wallet",
  "chain_id": 8453,
  "network": "base",
  "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "pay_to": "0xYourWalletAddress",
  "amount_micro": "25000000",
  "amount": "25.00",
  "base_amount_micro": "25000000",
  "expires_at": "2026-11-23T12:30:00Z",
  "tx": {
    "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "data": "0xa9059cbb…",
    "value": "0x0",
    "chain_id": 8453
  },
  "eip681": null,
  "claim_token": "q3V…"
}
```

This is how a person pays a pay link. The hosted page at `pay.xenarch.com` calls it when the buyer presses the pay button. You only need it if you build your own checkout. Agents pay over x402 instead (see [MCP tools](https://docs.xenarch.com/mcp/tools.md), `xenarch_pay_link`).

## How it works

1. Call this endpoint. It is public and needs no API key.
2. Ask the buyer's wallet to send `tx` as is: `to` is the token contract on the chosen network and `data` is `transfer(pay_to, amount)` followed by a short Xenarch reference. The wallet shows an ordinary USDC or USDT send. The buyer pays the network's fee in its own coin (ETH on Base or Ethereum, BNB on BNB Chain, MON on Monad), under a cent on Base.
3. Xenarch watches the network and books the transfer once it has the network's confirmations (Base 1, Ethereum 12, BNB Chain 15, Monad 2, Tron 19), so the payment is recorded and your [webhook](https://docs.xenarch.com/payments/webhooks.md) fires even if the buyer closes the page.
4. Poll [Get Payment Intent](https://docs.xenarch.com/api-reference/links/get-intent.md) with the `claim_token` to show the buyer when the payment is booked.

The payment goes straight from the buyer's wallet to yours. Xenarch has no contract in the payment.

## Networks and coins

Every link takes USDC on Base. Its owner can add USDC on Ethereum, BNB Chain and Monad, and USDT on Ethereum, BNB Chain, Monad (Tether's USDT0) and Tron with [Set Link Networks](https://docs.xenarch.com/api-reference/links/set-networks.md). Pass `network` and `token` to pay on one of them; [Get Link](https://docs.xenarch.com/api-reference/links/get.md) lists what the link takes under `networks`. Omit both for Base USDC.

## Paying from an exchange or another app

`method: "manual"` is for a payer who can't connect a wallet: an exchange withdrawal, or a wallet app on another device. Instead of `tx`, the response holds a unique `amount` for this payment (the price plus 0.0001 to 0.0099, four decimals; six once those are taken), `pay_to` and a `qr` value. Show them and ask the payer to send exactly that amount on that network.

* The amount is held 60 minutes (`expires_at`), then stays reserved 72 more hours, so a late withdrawal still finds its payment.
* Exchanges often take their fee out of what they send. A transfer that arrives up to about \$6 short, with the same last two digits, is booked `underpaid` against this payment; fulfil it or ask for the rest.
* Tron takes `manual` only.

Some smart wallets drop or wrap the transaction data. The payment then can't be matched from the reference, and the payer has to sign a short proof that they sent it. The hosted page asks for that signature; a custom checkout should send those buyers to the hosted page.

Before you open the wallet, check that `tx.to` is the token contract the link lists for that network, and that `pay_to` and `amount` match what you show the buyer.

## Body

All fields are optional.

| Field | Type | Description |
| - | - | - |
| `method` | string | `wallet` (default) returns the transaction for a connected wallet. `manual` returns a unique amount to send from an exchange or any wallet app. |
| `network` | string | `base` (default), `ethereum`, `bnb`, `monad` or `tron`. Must be a network the link takes. |
| `token` | string | `USDC` (default) or `USDT`. Tron takes only `USDT`. |
| `payer` | string | The connected wallet address, used to match the transfer to this intent |
| `amount` | string | Decimal amount for an open-amount link, within its bounds |
| `tip` | string | Decimal tip, added to the total |
| `client_reference_id` | string | Your own reference, up to 200 characters. Echoed on the payment's webhook. |
| `subids` | object | Up to five tracking values, `subid1` to `subid5` |
| `bill_to` | object | Buyer details collected before paying, up to 20 fields |

These attribution fields are stored on the intent. They can't be changed after the payment is sent.

## Response

| Field | Description |
| - | - |
| `reference` | The intent's id, 12 bytes as hex. It is in the transaction data and in the path of [Get Payment Intent](https://docs.xenarch.com/api-reference/links/get-intent.md). |
| `tx` | For `wallet`: the transaction to send: `to` (the token contract), `data`, `value` (`0x0`) and `chain_id` |
| `network`, `chain_id`, `token` | The network and coin of this payment. `chain_id` is `null` on Tron. |
| `decimals` | The token's on-chain decimals (18 for USDC and USDT on BNB Chain, 6 elsewhere). The amounts in this response are always 6-decimal micro units. |
| `confirmations` | Confirmations needed before the payment is booked |
| `qr` | For `manual`: what a QR code should encode. An EIP-681 URI on EVM networks, the bare address on Tron. |
| `pay_to` | Your receiving wallet, from the link's signed terms |
| `amount`, `amount_micro` | Total to pay, as a decimal and in micro units (6 decimals), including any tip. For `manual`, the exact unique amount to send. |
| `base_amount_micro` | The amount before the tip |
| `expires_at` | 30 minutes after creation for `wallet`, 60 minutes for `manual`. Create a new intent after that. |
| `claim_token` | A secret for this checkout only. Keep it in the browser and don't put it in a URL. It authorizes [Get Payment Intent](https://docs.xenarch.com/api-reference/links/get-intent.md). |

## Errors

| Status | Meaning |
| - | - |
| `400` | The amount, tip, network or token isn't allowed for this link, or the link has no valid receiving wallet |
| `404` | No link with this id |
| `410` | The link is revoked or expired, or a single-use link was already paid |
| `429` | Too many requests from this IP address, or the link has too many open payments |
| `503` | Every unique amount for this price is briefly taken (`manual`). Try again shortly. |


## OpenAPI

````yaml POST /v1/links/{link_id}/intent
openapi: 3.1.0
info:
  title: Xenarch API
  version: 0.1.0
servers:
  - url: https://api.xenarch.dev
security: []
paths:
  /v1/links/{link_id}/intent:
    post:
      tags:
        - pay-links
      summary: Create Payment Intent
      description: >-
        Start a payment from the buyer's own wallet, on Base or another network
        the link takes. `wallet` returns the transfer to send, with a Xenarch
        reference in its data; `manual` returns a unique amount to send from an
        exchange or any wallet app. The buyer pays the network's fee.
      operationId: create_link_payment_intent_v1_links__link_id__intent_post
      parameters:
        - name: link_id
          in: path
          required: true
          schema:
            type: string
            title: Link Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayLinkIntentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayLinkIntentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PayLinkIntentRequest:
      type: object
      title: PayLinkIntentRequest
      properties:
        method:
          type: string
          enum:
            - wallet
            - manual
          default: wallet
          title: Method
          description: >-
            `wallet` (default) returns the transaction for the buyer's connected
            wallet, with a Xenarch reference in its data. `manual` returns a
            unique amount for a payer who sends from an exchange or any wallet
            app (QR or copy and paste); the amount ties the transfer to this
            payment. Tron takes `manual` only.
        payer:
          anyOf:
            - type: string
              pattern: ^0x[0-9a-fA-F]{40}$
            - type: 'null'
          title: Payer
          description: Connected wallet address
        amount:
          anyOf:
            - type: string
              pattern: ^\d{1,12}(\.\d{1,6})?$
            - type: 'null'
          title: Amount
          description: Buyer-chosen amount (decimal USDC) for open-amount links
        tip:
          anyOf:
            - type: string
              pattern: ^\d{1,12}(\.\d{1,6})?$
            - type: 'null'
          title: Tip
          description: Tip (decimal USDC), added to the total
        client_reference_id:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Client Reference Id
          description: Your own reference, echoed on the payment's webhook
        subids:
          anyOf:
            - type: object
              additionalProperties:
                type: string
            - type: 'null'
          title: Subids
          description: Tracking values subid1 to subid5
        bill_to:
          anyOf:
            - type: object
              additionalProperties:
                type: string
            - type: 'null'
          title: Bill To
          description: Buyer details, up to 20 fields
        network:
          anyOf:
            - type: string
              pattern: ^[a-z0-9_-]{2,24}$
            - type: 'null'
          title: Network
          description: >-
            `base`, `ethereum`, `bnb`, `monad` or `tron`. Base USDC when
            omitted. Anything else must be a network the link's owner turned on
            (see `networks` on [Get Link](/api-reference/links/get)).
        token:
          anyOf:
            - type: string
              pattern: ^[A-Za-z0-9]{2,12}$
            - type: 'null'
          title: Token
          description: >-
            `USDC` or `USDT`. `USDC` when omitted. Tron takes only `USDT`.
            Monad's USDT is Tether's USDT0.
        renewal_token:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Renewal Token
          description: 'For a subscription renewal: the token from the renewal email.'
        email_confirm_token:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          title: Email Confirm Token
          description: >-
            For a link that confirms the buyer's email first: the token from the
            confirmation email.
    PayLinkIntentResponse:
      type: object
      title: PayLinkIntentResponse
      required:
        - reference
        - link_id
        - method
        - asset
        - pay_to
        - amount_micro
        - amount
        - base_amount_micro
        - expires_at
        - claim_token
      properties:
        reference:
          type: string
          title: Reference
        link_id:
          type: string
          title: Link Id
        method:
          type: string
          enum:
            - wallet
            - manual
          title: Method
        chain_id:
          type: integer
          default: 8453
          title: Chain Id
        network:
          type: string
          title: Network
          default: base
        asset:
          type: string
          title: Asset
        pay_to:
          type: string
          title: Pay To
        amount_micro:
          type: string
          title: Amount Micro
        amount:
          type: string
          title: Amount
        base_amount_micro:
          type: string
          title: Base Amount Micro
        expires_at:
          type: string
          format: date-time
          title: Expires At
        tx:
          anyOf:
            - $ref: '#/components/schemas/PayLinkIntentTx'
            - type: 'null'
        eip681:
          anyOf:
            - type: string
            - type: 'null'
          title: Eip681
        claim_token:
          type: string
          title: Claim Token
          description: >-
            Secret for this checkout only. Authorizes GET
            /v1/links/{link_id}/intents/{reference}.
        token:
          type: string
          title: Token
          default: USDC
          description: 'The stablecoin: `USDC` or `USDT`.'
        decimals:
          type: integer
          title: Decimals
          default: 6
          description: >-
            The token's on-chain decimals (18 for USDC and USDT on BNB Chain, 6
            elsewhere). Amounts in this response are always 6-decimal micro
            units.
        confirmations:
          type: integer
          title: Confirmations
          default: 1
          description: >-
            How many confirmations the network needs before the payment is
            booked: Base 1, Ethereum 12, BNB Chain 15, Monad 2, Tron 19.
        qr:
          anyOf:
            - type: string
            - type: 'null'
          title: Qr
          description: >-
            For `manual`: what a QR code should encode. An EIP-681 URI on EVM
            networks, the bare address on Tron.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PayLinkIntentTx:
      type: object
      title: PayLinkIntentTx
      required:
        - to
        - data
      properties:
        to:
          type: string
          title: To
          description: The USDC contract on Base
        data:
          type: string
          title: Data
          description: transfer(pay_to, amount_micro) plus the Xenarch reference
        value:
          type: string
          default: '0x0'
          title: Value
        chain_id:
          type: integer
          default: 8453
          title: Chain Id
    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.