Skip to main content
Webhooks are how your app learns what happened. As your Merchant of Record, Macropay settles the payment, remits the sales tax or VAT, and absorbs the PCI and dispute handling — then fires an event so your code can do its part: grant a license, unlock a download, provision a seat, or top up prepaid credits. The same applies to usage- and agent-driven billing: when an order or subscription moves, a webhook is your signal to react. This page covers the full lifecycle: building a receiver that verifies and parses events, the network and reliability guarantees you can rely on, and how to monitor and debug deliveries from the dashboard.

Monitor deliveries in the dashboard

Every registered endpoint gets a delivery overview. From there you can:
  • Browse the full history of delivery attempts
  • Inspect the exact payload that was sent
  • Replay any delivery — useful after you ship a fix for a failing handler
Keep this open while you wire up your route below; it’s the fastest way to confirm events are leaving Macropay and to see the status code your endpoint returned.

Build your receiver

Register a route at the URL you configured on Macropay, then verify the signature, parse the payload, and branch on the event type before doing any work.

With the SDKs

The TypeScript and Python SDKs ship a single helper that verifies the signature and returns a typed event in one step.
Both samples read the signing secret from an environment variable named MACROPAY_WEBHOOK_SECRET. Set it to the secret shown when you created the endpoint.

Rolling your own verification

Macropay signs every event using the Standard Webhooks specification, so you can drop in any of the community libraries across languages — or follow the spec directly if you’d rather implement it yourself.
The secret must be base64-encodedThe most common mistake when verifying by hand is forgetting that the signing secret is base64-encoded before the signature is computed. The SDK handles this for you; if you roll your own, decode the secret first.

Network allowlist

If a firewall or reverse proxy sits in front of your endpoint, allow the following ranges so deliveries can reach you.
New IP rangesStarting October 27th, 2025, these ranges are added to the list:

Reliability guarantees

Macropay does the heavy lifting to get each event delivered. Here’s what to expect, and what’s expected of your handler.
Respond fast, work laterThe timeout may tighten over time. Treat the webhook handler as a fast acknowledgement layer: verify, enqueue a background task, and return a 2xx immediately. Doing real work inline risks timeouts and unnecessary retries.

When an endpoint is disabled

After 10 consecutive non-2xx responses, the endpoint stops receiving new events and your organization’s admins get an email notification. To recover:
  1. Confirm the endpoint is reachable and returning 2xx (use redelivery from the dashboard to test).
  2. Re-enable it under your organization’s webhook settings.
Re-enabling before the underlying issue is fixed will simply trip the auto-disable again.

Troubleshooting

Seeing deliveries leave Macropay but nothing arriving on your end? Start with the basics, then match the reported status code below. First checks
  • Tunnel still live? When testing locally, confirm your tunnel (ngrok, Cloudflare Tunnel, etc.) is up and its public URL still matches the endpoint configured on Macropay.
  • Log generously. Emit markers like webhook.handler_called, webhook.signature_validated, and webhook.handled so you can see whether the handler ran and how far it got.
By status code Resolving 403
  • If you protect routes with authorization middleware, exclude the webhook path — it must be publicly reachable.
  • On Cloudflare:
    • Check the firewall logs to see whether requests are blocked, and add a WAF rule to accept traffic from Macropay’s IP ranges.
    • Bot Fight Mode is a common cause: it blocks legitimate webhook traffic, and neither IP allowlisting nor custom WAF rules override it. Disable it under Security → Bots, then re-test.

Invalid signature errors

Verifying signatures yourself? Base64-decode the secret you configured on Macropay before computing the signature — a raw secret will never match.