Skip to main content

The signed request

Every request includes:
The signature follows the Appcharge v2 generation design: HMAC-SHA256(secret, timestamp + "." + JSON payload), using a Unix timestamp in milliseconds and lowercase hexadecimal output. FloKit signs the exact JSON bytes sent on the wire, which avoids ambiguity from parsing and re-serializing JSON. Use the entire flk_whsec_... secret string as the HMAC key. Read the original request bytes before JSON middleware changes them. Verify first, then decode and validate JSON. Treat IDs in the signed body as authority; the separate ID headers help diagnostics. The body and event ID remain the same across retries. FloKit creates a fresh timestamp and signature for every physical send. Permit at most five minutes of clock difference in either direction and keep your server clock synchronized.

Copy the verifier

Both examples accept a list containing your currently configured secret and, while updating your receiver during rotation, the previous secret. They accept any matching v1 value, reject malformed headers and oversized requests, and use constant-time digest comparisons.
For Node.js JavaScript, compile the TypeScript example with tsc or remove its type annotations. No provider SDK is required. The verification helper is tested against the same raw-byte fixtures as FloKit’s sender.

Minimal raw-request diagnostic

For a Node IncomingMessage, read bounded chunks into a Buffer, pass that buffer and the single flokit-signature header to verifyFloKit, and parse JSON only on success. Set request/header timeouts on your HTTP server and reject a second signature-header field.
Raw request handling
Log only the verification verdict, response code, duration, and safe opaque identifiers. Do not log the body, email, answers, secret, or signing header. A successful signature authenticates the bytes; durable acceptance still requires the unique event transaction. For an isolated unsigned local diagnostic endpoint only, this checks basic HTTP connectivity. It does not test verification and must fail authentication at a production receiver:

Rotate a secret

Use Rotate signing secret in Admin and confirm the operation. Install the new secret in every receiver for that Company. FloKit signs with both active and retiring secrets during the 24-hour overlap. After expiry, FloKit uses only the new active secret; remove the retired secret from your receiver. Rotation does not change event IDs or frozen request bodies.