Runtime verification (platform → merchant)
Outbound delivery (platform webhook delivery):| Header | Value |
|---|---|
Content-Type | application/json |
X-Stablecoin-Event | Event type string |
X-Stablecoin-Event-Id | Payload id field |
X-Stablecoin-Timestamp | Unix seconds (integer as string) |
X-Stablecoin-Signature | v1=<hex> |
X-Stablecoin-Integration-Id | Present when invoice has integration_id |
Runtime verification (WooCommerce plugin receiver)
The WooCommerce plugin (WooCommerce plugin webhook security module) verifies:X-Stablecoin-SignatureandX-Stablecoin-Timestampare present- Timestamp within 300 seconds (
MAX_AGE_SECONDS) X-Stablecoin-Integration-Idmatches local integration ID when both are set- Signature matches v1 format:
v1=+hash_hmac('sha256', $timestamp . '.' . $raw_body, $secret) - Legacy fallback accepted:
sha256=+hash_hmac('sha256', $raw_body, $secret)
Verification steps (custom integrations)
- Read raw request body (before JSON parsing)
- Extract
X-Stablecoin-TimestampandX-Stablecoin-Signature - Reject if timestamp is older than 300 seconds
- Compute
v1=+ HMAC-SHA256(secret,${timestamp}.${rawBody}) - Compare using constant-time comparison