Webhooks
Send events from the plugin, such as a price drop, to another service the moment they happen.
A webhook is an address on another service that the plugin calls. Create one with a name, the endpoint URL and the events to send for: Product imported, Price drop, Back in stock, Out of stock and Connection revoked.
The address must be on the internet. One on your own network (a local address) is refused, when it is saved and again each time something is sent, unless a developer allows it with WordPress's http_request_host_is_external filter. This covers every way of writing such an address (localhost, 127.0.0.1 in any spelling, 10.x, 192.168.x, a cloud server's metadata address and the like). Only a complete address that starts with http:// or https:// is accepted: text without it is refused, not completed for you.
What is sent
Each delivery is a signed HTTP POST of JSON with the event name, the data and a timestamp. For a product event the data includes the product (id, ASIN, title, affiliate link, current price and currency) and the details of that event. The headers X-SDA-Event (the event name) and X-SDA-Signature (sha256=… , an HMAC of the raw body made with the webhook's secret) let your receiver check where it came from.
A failed delivery is retried up to three times with backoff (1 minute, 5 minutes, 30 minutes) before it is marked failed.
On each webhook
- The switch turns it on or off.
- The signing secret is kept encrypted, and the card shows only its last four characters. The eye button shows the whole secret and the copy button copies it; both fetch it when you ask, so it is not part of the page until then. Regenerating it (after a confirmation) means you must update the receiving service too, or deliveries will fail the signature check.
- If the secret can no longer be read (for example the secret keys in wp-config.php were changed), the card says so and nothing is sent until you regenerate it.
- The address must start with https://, so the payload and its signature are protected on the way; a plain http:// address is accepted only for a machine of your own, such as localhost or a .test address. A webhook saved with a plain http:// address before this rule keeps working and shows "Not secure"; you can switch it off or rename it, and changing its address means giving an https:// one.
- A delivery does not follow redirects: an address that answers with one is recorded as a failed delivery, and the signed payload goes only where you said.
- Test sends a test delivery and says whether it succeeded.
- The delivery log lists each attempt with its status (success, failed, retrying or pending), the event, the HTTP code, how long ago it was and any error, newest first, with a summary at the top.
- Edit and Delete (asks first).