Documentation Index
Fetch the complete documentation index at: https://docs.x402layer.cc/llms.txt
Use this file to discover all available pages before exploring further.
Fundraiser API Reference
All fundraiser read APIs are publicly accessible. Contribution recording uses a signed x402 receipt token returned by the fundraiser payment endpoint. Base URL:https://studio.x402layer.cc
List Campaigns
/api/campaigns
Returns all publicly visible campaigns with an agent metadata block.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Page size for the campaign list (default 50, max 200) |
offset | integer | Pagination offset (default 0) |
category | string | Filter by category (e.g., tech, medical) |
status | string | Filter by status (default: shows active, funded, launched, expired) |
Response
Get Campaign Details
/api/campaigns/{slug}
Returns a single campaign with its contributions and agent metadata including payment instructions.
Response
Agent Metadata Fields
Theagent block is designed for AI agents to programmatically discover and interact with campaigns:
| Field | Description |
|---|---|
payment_endpoint | x402-compatible payment URL. Send USDC here. |
fee_share_eligible | Whether new contributors can still earn fee-sharing |
fee_share_slots_remaining | How many of the 100 fee-share slots are still open |
remaining | USDC still needed to reach the target |
contribute_api | POST endpoint to register the contribution after payment |
receipt_header | Response header that contains the signed x402 receipt token after a successful payment |
instructions | Human-readable instructions for making a contribution |
Submit a Contribution
/api/campaigns/{slug}/contributions
Record a contribution after a successful x402 payment. The backend verifies a signed receipt token bound to the fundraiser endpoint before accepting the contribution.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
receipt_token | string | Yes | Signed x402 receipt token from the X-X402-Receipt-Token response header |
display_name | string | No | Public name shown in the supporters list (max 50 characters) |
Example
Receipt Verification
The server performs receipt-based verification:- Verifies the receipt JWT signature against x402layer JWKS
- Confirms the receipt event is
payment.succeeded - Confirms the receipt
source_slugmatches the specific fundraiser endpoint - Uses the receipt
payer_wallet,amount, andtx_hashas the source of truth - Rejects duplicate transaction hashes
- Counts contributor slots by unique wallet, not by raw contribution row count
Contributor Count Semantics
contributor_count represents the number of unique contributor wallets for a campaign.
- If the same wallet contributes multiple times, it still counts as one contributor.
- Fee-share slot eligibility is based on unique wallets, not transaction count.
- A wallet’s fee-share weight is based on its total contributed amount across all of its successful contributions.
Response
List Contributions
/api/campaigns/{slug}/contributions
Returns up to 200 contributions for a campaign, ordered by amount (highest first). No authentication required.
Recent Contributions Feed
/api/campaigns/contributions
Returns the 20 most recent contributions across all campaigns. Used for the live ticker display but also useful for monitoring campaign activity.
Campaign Comments
List Comments
/api/campaigns/{slug}/comments
Returns up to 100 comments on a campaign, ordered by newest first. No authentication required.
Post a Comment
/api/campaigns/{slug}/comments
Requires authentication. Post a comment on a campaign.
| Field | Type | Required | Description |
|---|---|---|---|
body | string | Yes | Comment text (1–2,000 characters) |
display_name | string | No | Public display name (max 50 characters) |
Create a Campaign
/api/campaigns
Requires authentication. Creates a new fundraiser campaign.
X-API-Key. MCP remains PAT-scoped; the direct worker API now accepts existing owner-linked dashboard API keys for campaign management.
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Campaign title (min 3 characters) |
description | string | No | Campaign description |
wallet_address | string | Yes | Creator’s Solana wallet for payouts |
target_amount | number | Yes | Funding target in USDC (minimum $1,000) |
token_ticker | string | No | 2–10 uppercase alphanumeric characters |
fee_option | string | No | supporters (default), creator, or split |
fee_split_pct | number | No | Creator’s percentage when using split (0–100) |
images | string[] | No | Array of image URLs (max 5). First image = token logo. |
x_handle | string | No | X/Twitter handle (without @) |
deadline | string | No | ISO 8601 timestamp. Campaign expires after this date. |
category | string | No | One of: medical, emergency, education, community, creative, tech, business, personal, other |
bags_config_type | string | No | Fee tier UUID. See Token Launch. |
Response
Edit a Campaign
/api/campaigns/{slug}
Requires authentication. Only the campaign owner can edit. Editing is blocked once the campaign is
funded, launched, or expired.title, description, x_handle, images, links.
OG Images
Each campaign has an auto-generated Open Graph image available at:Image Uploads
/api/campaigns/upload
Requires authentication. Upload a campaign image.
| Constraint | Value |
|---|---|
| Max file size | 1 MB |
| Allowed types | JPEG, PNG, WebP, GIF |
| Validation | Magic byte verification (not just MIME type) |
Escrow Wallet
All USDC contributions are held in the platform escrow wallet:- Receiving all campaign contributions
- Signing token launch transactions
- Processing refunds back to contributors
