Fundraiser API Reference
API endpoints for listing, viewing, and contributing to fundraiser campaigns. All read endpoints 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
GET /api/campaigns — Returns all publicly visible campaigns with agent metadata.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
category | string | Filter by category (e.g., tech, medical) |
limit | integer | Page size for the campaign list (default 50, max 200) |
offset | integer | Pagination offset (default 0) |
status | string | Filter by status (default: active, funded, launched, expired) |
Agent Metadata
Every response includes an agent block for AI agent discovery:
{
"pagination": {
"total": 12,
"limit": 50,
"offset": 0,
"has_more": false
},
"agent": {
"description": "Singularity Fundraisers — crowdfunding campaigns with x402 payments...",
"protocol": "x402",
"currency": "USDC",
"list_url": "https://studio.x402layer.cc/api/campaigns",
"detail_url_pattern": "https://studio.x402layer.cc/api/campaigns/{slug}",
"campaign_page_pattern": "https://studio.x402layer.cc/fundraisers/{slug}",
"supports_pagination": true,
"supports_category_filter": true,
"active_count": 3
}
}Get Campaign Details
GET /api/campaigns/{slug} — Returns a single campaign with contributions and agent payment instructions.
Agent Payment Instructions
The agent block includes everything an AI agent needs to contribute:
{
"agent": {
"payment_endpoint": "https://api.x402layer.cc/e/fund-my-campaign-a1b2c3d4",
"accepts": ["solana"],
"currency": "USDC",
"protocol": "x402",
"min_amount": 1,
"status": "active",
"target_amount": 10000,
"raised_amount": 2500,
"remaining": 7500,
"fee_share_eligible": true,
"fee_share_slots_remaining": 88,
"contribute_api": "https://studio.x402layer.cc/api/campaigns/{slug}/contributions",
"contribute_api_auth": "none",
"receipt_header": "X-X402-Receipt-Token",
"instructions": "To contribute, send a x402 payment to the payment endpoint..."
}
}| 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 contributing |
Submit a Contribution
POST /api/campaigns/{slug}/contributions — Record a contribution after a successful x402 payment.
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 in supporters list (max 50 chars) |
Example
# 1. Pay the fundraiser endpoint and capture the X-X402-Receipt-Token header
curl -i "https://api.x402layer.cc/e/fund-my-campaign-a1b2c3d4?action=purchase&amount=100.00"
# 2. Submit the receipt token to record the contribution
curl -X POST https://studio.x402layer.cc/api/campaigns/my-campaign-a1b2c3d4/contributions \
-H "Content-Type: application/json" \
-d '{
"receipt_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"display_name": "Alice"
}'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 fundraiser endpoint - Uses the receipt payer wallet, amount, and transaction hash as 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 successful contributions.
List Contributions
GET /api/campaigns/{slug}/contributions — Returns up to 200 contributions, ordered by amount (highest first). No authentication required.
Recent Contributions Feed
GET /api/campaigns/contributions — Returns the 20 most recent contributions across all campaigns.
{
"contributions": [
{
"who": "Alice",
"amount": 500,
"campaign": "My Campaign",
"at": "2026-05-02T10:00:00Z"
}
]
}Campaign Comments
GET /api/campaigns/{slug}/comments — Returns up to 100 comments, newest first. No auth required.
POST /api/campaigns/{slug}/comments — Requires authentication. Body: body (1–2,000 chars), optional display_name (max 50 chars).
Create a Campaign
POST /api/campaigns — Requires authentication.
For agentic creation, you can either use Singularity MCP with a scoped dashboard PAT, or use the direct worker campaign-management surface with an owner-linked 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) |
wallet_address | string | Yes | Creator's Solana wallet |
target_amount | number | Yes | Funding target in USDC (minimum $1,000) |
description | string | No | Campaign description |
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 | Image URLs (max 5). First = token logo. |
deadline | string | No | ISO 8601 timestamp |
category | string | No | Campaign category |
Edit a Campaign
PATCH /api/campaigns/{slug} — Requires authentication. Only the campaign owner can edit. Editing is blocked once the campaign is funded, launched, or expired.
Editable fields: title, description, x_handle, images, links.
OG Images
Each campaign has an auto-generated Open Graph image at GET /api/og/campaign/{slug}. Returns a 1200×630 PNG with campaign status, title, raised amount, progress bar, and backer count. Used automatically for social media previews.
Image Uploads
POST /api/campaigns/upload — Requires authentication.
| 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:
AunvqAg5Zm9yUCPJCeusQwqpF7LhACxmtcmv36PZ47thThis wallet receives contributions, signs token launch transactions, and processes refunds.