Skip to main content
The PHP SDK is a typed client for the Macropay API, so you can wire payments and billing into Laravel, Symfony or plain PHP without hand-rolling HTTP requests, auth headers, or pagination. Because Macropay is your Merchant of Record, those calls do more than move money: we become the seller of record on your customer’s statement, remit sales tax and VAT worldwide so you don’t carry the liability, and keep card data inside a PCI DSS Level 1 compliant vault — your server never touches a raw PAN.

Install

Terminal
Requires PHP 8.1+ (the SDK uses named arguments and 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.
The client returns a paginated, iterable response — loop with 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:
Sandbox mirrors production, including webhook delivery, so you can verify checkout, fulfillment, and signature verification end-to-end. Use a sandbox token here — production tokens won’t authenticate against the test server.

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.

Need help?

Have a question or hit a snag? Reach the team and we’ll point you in the right direction.