context.Context, responses are strongly
typed, and list endpoints return iterators that page for you.
One client covers the whole platform — one-time and subscription products,
usage-based metering, and agent billing. Because Macropay is the merchant of
record, the same integration also makes us the seller of record on your
customers’ statements: we calculate and remit sales tax and VAT worldwide, so
that liability never lands on you.
Install
Terminal
Quickstart
Authenticate with an access token, then iterate your organizations. SetMACROPAY_ACCESS_TOKEN in your environment first — the client reads your token
from there and talks to https://api.macropay.ai by default.
main.go
snake_case in docs, Go fields in codeThe API and these docs use
snake_case (e.g. created_at). The Go SDK exposes
the same fields as exported Go struct members, so your IDE will surface them via
the generated types — keep that mapping in mind when moving between the
reference and your editor.Sandbox environment
Point the client at the sandbox environment to build and test against a fully isolated copy of the API — no real money, no real tax events. Select the server when you construct the client:Beyond the basics
The same client reaches the rest of the platform:- Usage-based billing — ingest metered events and bill by usage, then let Macropay aggregate them against your meters and prices.
- Agent billing — send activity and outcome signals through the Signals API to bill autonomous agents by what they do and what they deliver, and to certify ROI with value receipts.
Examples
- Go with Gin — a minimal HTTP service wiring checkout and webhooks into a Gin router.