Skip to main content

Webhook Logs

The Webhook Logs page provides a real-time view of all incoming webhooks received by the middleware. This is useful for monitoring webhook health, debugging failed deliveries, and verifying signature validation.

Accessing the Page

Navigate to Middleware → Webhook Logs in the WordPress admin sidebar.

Interface Overview

The page displays webhook log entries from the rm_webhook_log table with the following columns:

ColumnDescription
IDUnique webhook log entry identifier
SiteThe site that received the webhook
Event TypeWebhook event (e.g., store/product/created, store/product/updated)
StatusProcessing status: Queued (orange), Processed (green), or Failed (red)
SignatureWhether HMAC-SHA256 signature verification passed (✓ Valid / ✗ Invalid)
AttemptsNumber of processing attempts
ReceivedWhen the webhook was received
ProcessedWhen the webhook was successfully processed

Searching and Filtering

The search field matches against:

  • Event type (e.g., product.created)
  • Error messages
  • Payload hash (SHA256)

Filters

  • Site — Filter by a specific site
  • Status — Filter by Queued, Processed, or Failed

All filters apply immediately. The search field requires pressing Enter or clicking the Search button.

Pagination

Results are displayed 20 per page with Previous/Next navigation. The total count of matching webhooks is shown at the bottom left.

Viewing Webhook Details

Click View on any row to open a detail modal showing:

  • Metadata — ID, site, event type, status, signature validity, attempts, payload hash, queue job ID, timestamps
  • Headers — Full JSON of the original HTTP request headers
  • Payload — Complete webhook payload in formatted JSON
  • Error — Error message if processing failed (displayed in red)

Webhook Processing Flow

  1. Webhook received at /wp-json/gsm-middleware/v1/webhooks/products/{site_id}
  2. Signature verified (HMAC-SHA256 for BigCommerce)
  3. Logged to rm_webhook_log with status queued
  4. Job enqueued to rm_queue for async processing
  5. Queue processor picks up job (runs every 5 minutes via cron)
  6. On success: status → processed, processed_at timestamp set
  7. On failure: status → failed, error_message recorded, retry via exponential backoff

Troubleshooting

Many "Failed" Webhooks

Check the error messages in the detail modal. Common causes:

  • Invalid webhook secret (signature verification fails)
  • Site configuration missing or inactive
  • Database connection issues

Webhooks Stuck in "Queued"

The queue processor may not be running. Verify:

  1. Crontab includes the queue processor entry (Tools → Crontab Generator)
  2. cron/process-queue.php is executable
  3. Check server cron logs for errors

Invalid Signatures

Ensure the webhook secret in the site configuration matches the secret configured in BigCommerce/WooCommerce. Secrets are stored encrypted in rm_sites.webhook_secret.