Spunk Autos

Websites and web tools

Budget-Friendly Webhook Testing

A webhook is an HTTP request one service sends to another when something happens, such as a new booking, a paid deposit or a cancelled appointment. Testing them can feel like it needs paid tools. Most of the work can be done with free software already on your computer and the test modes that booking and payment providers offer.

What you are testing

  • That your endpoint receives the request and returns a 2xx status code quickly.
  • That it verifies the sender's signature before trusting the data.
  • That it handles the same event arriving twice without double-booking.
  • That it copes with events arriving in an unexpected order.
  • That failures are logged so you can replay them.

Free and low-cost methods

MethodCostGood forLimits
Provider's test mode and event replayUsually includedRealistic payloads with correct signaturesOnly that provider's events
Local server plus a saved sample payload sent with curlFreeFast repeat tests of your handler logicYou must craft or copy the payload
Tunnel from a public URL to your machineFree tiers existReceiving real test events on your laptopURL may change each session; never leave it open
Request inspector page that shows incoming requestsFree tiers existSeeing exactly what a provider sendsDo not send live customer data to a third party
Unit tests with recorded payloadsFreeRegression checks on every changeNeed updating when the provider's format changes

A step-by-step routine

  1. Read the provider's webhook documentation for headers, signature method and retry policy.
  2. Turn on test mode and register a test endpoint.
  3. Capture one example of each event type you use and save it as a file.
  4. Write your handler to verify the signature first, then process the event.
  5. Replay the saved files with curl -X POST -H "Content-Type: application/json" --data @event.json against your local server.
  6. Send the same event twice and confirm only one booking results.
  7. Send a deliberately wrong signature and confirm the handler rejects it with a 4xx code.

Signature checks

Most providers sign each request, often with an HMAC using SHA-256 and a shared secret. Your code recomputes the signature over the raw request body and compares the two. Use the raw bytes, not a re-serialised JSON object, because spacing differences change the signature. Use a constant-time comparison function from your language's library.

Retries and timing

If your endpoint fails or is slow, providers retry, often with growing gaps between attempts. Check your provider's documentation for its exact schedule.

Keep costs and risks low

  • Respond with 200 as soon as the event is stored, then do slow work such as sending emails afterwards.
  • Store the event ID and ignore duplicates.
  • Keep test and live secrets separate and out of your code repository.
  • Close tunnels when you finish a session.
  • Delete test data from request inspectors when done.