Install
Terminal
declare(strict_types=1)).
Authenticate and make your first call
Build a client with an access token, then call a resource. Use an organization access token (OAT) for server-side integrations — generate one in the dashboard and load it from the environment rather than hard-coding it.foreach and the
SDK fetches subsequent pages for you.
Sandbox vs. production
Point the SDK at the sandbox environment to test the full flow against test cards before going live. Just set the server when you build the client — everything else stays the same:What you can build
The same client surfaces the whole Macropay data model. A few starting points:Products & checkout
Sell one-time or subscription products through hosted checkout — Macropay
handles tax, PCI, and the receipt as your Merchant of Record.
Customers & portal
Manage customers and let them self-serve through the customer portal:
subscriptions, invoices, refunds, and payment methods.
Usage & AI billing
Meter ingested events and bill by usage, activity, or outcome — ideal for
AI products and agents billed on the value they deliver.
Webhooks
React to orders, subscriptions, and payouts with signed, verifiable events.