Signing
Verify signed Vendor USSD endpoint requests when outbound signing is enabled.
Signed-request Verification
The gateway can use request signing. Confirm the authentication mechanism that applies to your integration before exposing a public endpoint. When signing is enabled, obtain the secret through the approved setup process and verify every request before parsing or acting on it.
| Header | Meaning |
|---|---|
webhook-id | Delivery identifier prefixed with msg_. |
webhook-timestamp | Unix timestamp in seconds. |
webhook-signature | One or more space-separated v1,<base64-signature> values; rotation can provide several. |
Verification steps
-
Capture the exact raw HTTP body before parsing or reformatting it.
-
Read the three headers and reject missing or malformed values when signing is required.
-
Remove
whsec_from the configured secret and Base64-decode the remainder. -
Construct the signed content exactly as:
{webhook-id}.{webhook-timestamp}.{raw HTTP request body} -
Calculate HMAC-SHA256 with the decoded secret and Base64-encode the result.
-
Compare it against supplied
v1signatures with a constant-time comparison. -
Reject stale timestamps (older than five minutes) and timestamps outside the permitted future clock skew.
-
Apply the agreed delivery-ID replay policy before business logic runs.
Whitespace, key order, and line breaks affect the raw body, so reconstructing JSON after parsing can invalidate a valid signature. Signing proves request authenticity and integrity; your application must still authenticate and authorise its own business operations.
Replays, retries, and operational data
Retain delivery IDs for replay handling, separately from business-operation idempotency. A repeated business action may need protection even when it uses a different delivery ID.
Keep secrets outside source code. Do not log secrets, signatures, phone numbers, or raw session IDs in unsecured logs. Use a controlled diagnostic log and internal correlation ID instead.
To confirm before publication: Document signing enablement, secure secret delivery, rotation, secret scope, unsigned-integration controls, future clock skew, delivery-ID retention, and redelivery behaviour. Publish a tested verification example and fixed non-production test vector.