Who is this for?
- Developers building custom integrations with AnySpend
- AI agents that create payment links, manage products, or pull analytics
- Automation platforms orchestrating commerce workflows (Zapier, n8n, custom scripts)
- Backend services that need to programmatically create checkout sessions or track transactions
Quick start
Create a payment link in 3 lines:Associating payments with customers
There are two patterns for linking AnySpend payments back to your users:Pattern 1: URL parameters (simple)
Appendclient_reference_id and metadata to your payment link URL:
payment.completed webhook automatically.
Pattern 2: Server-side sessions (enterprise)
Create a checkout session on your backend with full customer context:url field — redirect your customer there to pay. All data is included in the webhook when the payment completes.
Base URL
All API requests are made to:Authentication tiers
The API uses three authentication tiers depending on the endpoint:
Most developers will use API Key authentication. See the Authentication page for details on creating and managing keys.
Response format
Every API response follows a consistent Stripe-style format.Single resource
object field tells you the resource type. The id field is a unique identifier.
List of resources
Error response
Deleted resource
Rate limits
Rate limits vary by authentication tier. When you exceed the limit, the API returns a429 status with a rate_limit_error:
The response headers include rate limit information:
Idempotency
For safe retries onPOST and PATCH requests, include an Idempotency-Key header. Duplicate requests with the same key and body return the cached response. See the Idempotency page for details.
Available resources
Authentication
Create and manage API keys, understand permission levels, and follow security best practices.
Payment Links
Create, update, and manage payment links with items, stats, sessions, and visitor tracking.
Products
Manage your product catalog — create products that can be attached to payment links.
Checkout Sessions
Create and track checkout sessions, monitor payment status, and handle completions.
Transactions
Query transaction history, filter by status, and pull settlement details.
Customers
Track customer wallets, view purchase history, and manage customer records.
Webhooks
Register webhook endpoints to receive real-time notifications for payment events.
Discount Codes
Create and manage discount codes for your payment links.
Next steps
1
Get your API key
Go to your AnySpend Dashboard under Settings > API Keys and create a key with the permissions you need.
2
Make your first request
Use the curl example above or your preferred HTTP client to create a payment link.
3
Set up webhooks
Register a webhook endpoint to receive real-time notifications when payments complete.
HypeDuel