What you’ll need
- A Macropay account
- An organization set up in the dashboard
Run everything in the Sandbox environment. Sandbox mirrors production but never moves real money or touches a real card.
1
Authenticate with an access token
Macropay authenticates server-side requests with an Organization Access Token (OAT) — a long-lived key scoped to one organization.
- Open your organization Settings in the dashboard
- Go to Access Tokens
- Click Create Token and copy the value (you’ll only see it once)
2
Create a product
In Macropay, everything you sell is a product — one-time or recurring, same API. Here we’ll stand up a monthly “Indie tier” subscription at $12/month (Result: a
price_amount is in cents).product.id in the response. Hold onto it — the next step needs it.3
Generate a checkout link
A checkout turns a product into a hosted, PCI-compliant payment page. Card data is tokenized in our PCI DSS Level 1 vault — it never reaches your server, so you stay out of PCI scope entirely.Result: open the returned
url in a browser and you’ll see the live checkout. Share it as a link, drop it in an email, or embed it in your app.4
Run a test sale
Sandbox accepts canonical test cards. Use these to simulate a successful payment:
Finish the form and Macropay redirects you to your
success_url. Behind the scenes, the sale is recorded, tax is computed for the buyer’s region, and a customer record is created — no extra calls from you.5
Receive a signed webhook
Webhooks are how your backend learns that money moved. Register an endpoint and subscribe to the events you care about.When the test sale clears, you’ll receive an
curl
order.paid payload:You just shipped a billable product
In a handful of calls you created a product, took a payment, and got a verified server-side event — with tax, PCI, and dispute handling folded in for free. The same primitives scale well past a single subscription. A few directions worth exploring:- Billing AI and agents by what they do. Macropay can meter usage, activity, or outcomes — bill an agent for the revenue it generated or the time it saved, and watch its margin against AI cost.
- Drop in an OpenAI-compatible proxy. Point your LLM calls at
/ai/v1/chat/completionsand Macropay captures token cost per request automatically. - Let customers self-serve. The hosted customer portal handles upgrades, cancellations, and invoices without you building a settings page.
Pricing models
Fixed, free, pay-what-you-want, usage-based, and seat-based pricing
Webhook events
Every event type you can subscribe to
Customer portal
Self-serve upgrades, invoices, and cancellations
SDKs
TypeScript, Python, PHP, and Go libraries