Treat every bearer token like a password. Keep it server-side, never commit it to a repo, and never expose it in client-side code, mobile bundles, or browser network requests.
Pick the right method
Organization Access Tokens
Recommended for your own integrations. A long-lived token scoped to a single organization. Generate it in seconds from your dashboard and start calling the API.
OAuth 2.0 Provider
For partner integrations. Let other Macropay organizations grant your app scoped access — the right choice when you build for tools like Zapier, Slack, or Raycast.
Organization Access Tokens
An organization access token (OAT) is bound to exactly one of your organizations. Create it from that organization’s settings, then send it as a bearer token on every request:POST /v1/signals so you can bill by usage or verified ROI. See the organization access token guide for the full walkthrough.
OAuth 2.0 for partner integrations
Building an app that other Macropay merchants install? Use the OAuth 2.0 provider. Each organization explicitly authorizes your app, and you receive a token scoped to the permissions they grant — no merchant ever hands you their raw OAT.Automatic leak protection
Macropay is the merchant of record for everything you sell, so protecting your account credentials is part of protecting your revenue. We continuously watch for tokens that surface in public places and revoke them before they can be abused. We participate in the GitHub Secret Scanning Program. The moment GitHub detects a Macropay token in a public repository, gist, or discussion, we’re notified and that token is revoked immediately — no action required on your part.Keep tokens out of the open
A few habits prevent most leaks:- Load tokens from environment variables or a secrets manager — never inline them in source.
- Add
.envand credential files to.gitignorebefore your first commit. - Use distinct tokens per environment so a leaked sandbox key never touches production.
- Rotate on a schedule and immediately after any teammate offboards.