Payment Link
What it is
A Payment Link is a shareable URL that lets anyone pay a fixed USDC amount to the agent's (or user's) FluxA Wallet. Agents can create, manage, and track payment links programmatically — useful for charging customers, selling digital goods, or collecting fees.
Each link gets a unique pl_* ID and a hosted payment page. Payers visit the URL, connect their wallet, and pay — no integration required on the payer side.
What agents can do with it
- Create collection links — generate a payment page with a fixed price, description, and optional digital content to deliver after payment.
- Set limits — control how many times a link can be used (
maxUses) and when it expires (expiresAt). - Deliver content — attach
resourceContent(JSON or text) that is revealed to the payer only after successful payment. - Track revenue — query all payments received through a specific link.
- Manage lifecycle — update descriptions, extend expiry, or delete links that are no longer needed.
Related APIs
| Method | Endpoint | Description |
|---|---|---|
POST | /api/payment-links | Create a new payment link |
GET | /api/payment-links | List all payment links |
GET | /api/payment-links/:linkId | Get link details |
PATCH | /api/payment-links/:linkId | Update a link |
DELETE | /api/payment-links/:linkId | Delete a link |
GET | /api/payment-links/:linkId/payments | List payments received |
Integration flow
Below is an example prompt you can give an AI agent to create a payment link and track incoming payments.
text
** Your task **
Create a payment link to sell access to a premium research
report for 1.50 USDC. The link should be valid for 7 days and
allow up to 50 purchases. After payment, deliver the report
content to the buyer.
** Step 1 — Create the payment link **
curl -X POST https://walletapi.fluxapay.xyz/api/payment-links \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AGENT_JWT" \
-d '{
"amount": "1500000",
"currency": "USDC",
"network": "base",
"description": "Premium Research Report — AI Market Trends Q1",
"resourceContent": "{\"reportUrl\": \"https://example.com/report/q1-ai-trends.pdf\", \"accessKey\": \"rpt-secret-key\"}",
"expiresAt": "2025-02-11T00:00:00.000Z",
"maxUses": 50
}'
The response returns a paymentLink object with:
- linkId (e.g. "pl_a1b2c3d4")
- url — the shareable payment page URL
Share the url with potential buyers.
** Step 2 — Monitor payments **
Periodically check incoming payments:
curl https://walletapi.fluxapay.xyz/api/payment-links/pl_a1b2c3d4/payments \
-H "Authorization: Bearer $AGENT_JWT"
Each payment entry includes amount, status, txHash, and
timestamp.
** Step 3 — Manage the link **
Update the link if needed (e.g. extend capacity):
curl -X PATCH https://walletapi.fluxapay.xyz/api/payment-links/pl_a1b2c3d4 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AGENT_JWT" \
-d '{ "maxUses": 100 }'
Or delete it when the campaign ends:
curl -X DELETE https://walletapi.fluxapay.xyz/api/payment-links/pl_a1b2c3d4 \
-H "Authorization: Bearer $AGENT_JWT"
** Step 4 — Report **
Summarize results to the user:
- Total payments received
- Revenue collected
- Link status (active / expired / deleted)