Guides
SDK Webhook Verification
Verify and handle Flo webhook signatures with the FloPay Node SDK.
SDK Webhook Verification
The @flopay/node SDK provides webhooks.constructEvent to verify Flo webhook signatures and parse event payloads.
Setup
You need:
- A Flo webhook endpoint secret (
flo_whsec_...) - The raw request body (as a string or Buffer -- not parsed JSON)
- The
Flo-Signatureheader from the incoming request
Next.js API Route Example
You must read the request body as raw text (request.text()), not parsed JSON. Signature verification requires the exact bytes that were sent. If your framework parses the body automatically, configure it to skip parsing for your webhook route.
Express Example
Testing Locally
Use a local tunnel such as ngrok and point your Flo webhook endpoint at it:
Use the webhook signing secret returned when you create the endpoint and verify the incoming Flo-Signature header against the raw request body.