Skip to content

Pay to Agent

What it is

Pay to Agent covers the scenarios where one agent (or platform) sends USDC to another agent. FluxA provides two methods, each suited to different use cases:

MethodWho sets the amountFlow
Payment LinkRecipient agentRecipient creates a link with a fixed price → shares it → payer pays the link
Unify Payment Link (UPL)PayerPayer constructs a URL with the target Agent ID + amount → pays directly

When to use which

The recipient agent creates a Payment Link with a specific price, then shares the link URL. The payer opens it and pays.

Use cases:

  • Selling goods or services — an agent prices its own products (reports, API access, digital assets), lists them with payment links, and other agents purchase by paying the links.
  • Invoicing — an agent sends an invoice to another agent as a payment link with the exact amount owed.
  • Fixed-fee services — an agent charges a standard fee (e.g. 0.50 USDC per task) and provides the link when the task is completed.
Recipient Agent                          Payer Agent
     |                                       |
     |-- create payment link (5 USDC) ------>|  (via FluxA API)
     |-- share link URL ------------------->|
     |                                       |
     |                                       |-- pay the link
     |<-- payment received (notification) ---|
     |-- deliver goods / complete service -->|

The payer constructs a UPL URL using only the recipient's Agent ID and the desired amount, then pays directly. The recipient does not need to create anything in advance.

Use cases:

  • Platform payouts — an agent platform distributes bounties, rewards, or AI agent salaries to agents. The platform knows each agent's ID and the amount to send, and pays directly via UPL.
  • Agent-to-agent transfers — Alice's agent pays Bob's agent for dinner, shared expenses, or any ad-hoc payment. Alice's agent just needs Bob's Agent ID and the amount.
  • Tips and donations — any agent can send any amount to another agent at any time, without the recipient needing to set anything up.
Payer Agent                              Recipient Agent
     |                                       |
     |-- construct UPL URL (Agent ID + amt)  |
     |-- GET → 402 → sign → submit -------->|  (via x402 protocol)
     |                                       |
     |                                       |-- USDC received

Comparison

FeaturePayment LinkUPL
Who sets the amountRecipientPayer
Recipient setup requiredYes — create a link via APINone — every agent has a UPL endpoint
URL lifetimeConfigurable (expiresAt), can be deletedPermanent (tied to Agent ID)
Use limitsConfigurable (maxUses)Unlimited
Content deliveryYes — resourceContent revealed after paymentNo
Payment trackingVia GET /api/payment-links/:linkId/paymentsVia wallet transaction history
Best forSelling, invoicing, fixed-fee servicesPayouts, transfers, tips
bash
# Recipient agent creates a payment link
curl -X POST https://walletapi.fluxapay.xyz/api/payment-links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $RECIPIENT_JWT" \
  -d '{
    "amount": "3000000",
    "currency": "USDC",
    "network": "base",
    "description": "AI Research Report — March 2025",
    "maxUses": 1,
    "expiresAt": "2025-04-01T00:00:00.000Z"
  }'

Response includes the url — share this with the payer agent.

The payer agent receives the payment link URL and pays it. See Payment Link (Agent Guide) for details on how agents pay links.

Recipient side — verify payment

bash
curl https://walletapi.fluxapay.xyz/api/payment-links/pl_a1b2c3d4/payments \
  -H "Authorization: Bearer $RECIPIENT_JWT"

Check for status: "succeeded" before delivering goods or completing the service.

For full API details, see Payment Links API.

Payer side — construct URL and pay

The payer only needs the recipient's Agent ID and the amount (in atomic units).

bash
# 1. Construct the UPL URL
UPL_URL="https://walletapi.fluxapay.xyz/unifypaymentlink/agentid/<recipientAgentId>?amount=5000000&asset=usdc"

# 2. Get the 402 payment requirement
curl -s "$UPL_URL"
# Returns HTTP 402 with payment details (payTo, asset, etc.)

# 3. Sign payment via mandate
curl -X POST https://walletapi.fluxapay.xyz/api/payment/x402V3Payment \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PAYER_JWT" \
  -d '{
    "mandateId": "<your-mandate-id>",
    "scheme": "exact",
    "network": "base",
    "amount": "5000000",
    "currency": "USDC",
    "assetAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "payTo": "<payTo from 402 response>",
    "host": "walletapi.fluxapay.xyz",
    "resource": "<UPL_URL>",
    "description": "Transfer to <recipientAgentId>",
    "tokenName": "USD Coin",
    "tokenVersion": "2",
    "validityWindowSeconds": 60
  }'

# 4. Submit with X-Payment header
curl -H "X-Payment: <xPaymentB64>" "$UPL_URL"
# Returns 200 with txHash on success

Recipient side — no setup needed

The recipient agent's UPL endpoint exists automatically. USDC arrives in their FluxA Wallet.

For the complete UPL flow (including mandate creation and error handling), see UPL (Agent Guide).

Example scenarios

An agent that generates AI art creates payment links for each piece:

text
** Agent prompt **
Create a payment link for my AI artwork "Sunset Over Base Chain"
priced at 2.00 USDC. Allow up to 100 purchases. After payment,
deliver the high-resolution image URL.

1. Create the link:
   POST /api/payment-links with amount=2000000, maxUses=100,
   resourceContent="{\"imageUrl\": \"https://...\"}"

2. List the artwork with the payment link URL for buyers.

3. Buyers (other agents) pay the link and receive the image URL
   automatically via resourceContent.

Scenario 2: Platform distributing bounties (UPL)

A platform pays out bounties to multiple agents after they complete tasks:

text
** Platform agent prompt **
Distribute bounties to the following agents:
- agent_alice: 10.00 USDC (completed data labeling)
- agent_bob: 5.00 USDC (completed code review)
- agent_carol: 7.50 USDC (completed testing)

For each agent, construct a UPL URL with their Agent ID and
the bounty amount, then pay via x402 V3 using your mandate.

UPL URL pattern:
https://walletapi.fluxapay.xyz/unifypaymentlink/agentid/<agentId>?amount=<atomic>&asset=usdc

Scenario 3: Agent-to-agent expense splitting (UPL)

Alice's agent pays Bob's agent for a shared expense:

text
** Alice's agent prompt **
Pay Bob's agent (agent ID: bob-agent-123) 12.50 USDC for
Alice's share of the dinner bill.

Construct a UPL:
https://walletapi.fluxapay.xyz/unifypaymentlink/agentid/bob-agent-123?amount=12500000&asset=usdc

Complete the x402 V3 payment flow using your existing mandate.
Report the txHash to Alice when done.

Released under the MIT License.