Skip to main content
The AnySpend Platform API gives you full programmatic control over your payment infrastructure. Build integrations, automate workflows, and let AI agents manage your commerce stack — all through a clean, Stripe-style REST API.

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:
The API returns a Stripe-style response with the created resource:

Associating payments with customers

There are two patterns for linking AnySpend payments back to your users:

Pattern 1: URL parameters (simple)

Append client_reference_id and metadata to your payment link URL:
These values flow through to your payment.completed webhook automatically.

Pattern 2: Server-side sessions (enterprise)

Create a checkout session on your backend with full customer context:
The response includes a url field — redirect your customer there to pay. All data is included in the webhook when the payment completes.
See the Webhooks Guide for complete examples of reconciling payments in your webhook handler.

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

The object field tells you the resource type. The id field is a unique identifier.

List of resources

See the Pagination & Filtering page for details on navigating list responses.

Error response

See the Errors page for the full error taxonomy.

Deleted resource

Rate limits

Rate limits vary by authentication tier. When you exceed the limit, the API returns a 429 status with a rate_limit_error: The response headers include rate limit information:

Idempotency

For safe retries on POST 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.