A webhook endpoint is a URL on your server that Sovgate sends events to as they happen, such as checkout.session.completed when a customer pays. Each delivery is signed, so your server can check it came from Sovgate.
Add an endpoint
Start
Go to Developers, Webhooks and choose Add endpoint. It's added in the mode you're in.
Enter the URL
The https:// address on your server that receives the events, with an optional description.
Choose the events
Pick only the events your server uses, such as payment.succeeded, refund.failed, dispute.created, invoice.paid or subscription.payment_failed.
Copy the signing secret
Each endpoint has its own signing secret, starting whsec_. Reveal it on the endpoint's page and put it in your server's environment.
Send a test event
Choose Send test event to check your server answers. A test event goes to this endpoint only, isn't retried and isn't counted in its health.
Each mode can have up to 16 endpoints.
Answer each delivery
Your server must answer with a 2xx status within 15 seconds. Anything else, or no answer in time, is a failed attempt, and the delivery is retried. Answer first, then do the work: a slow job shouldn't hold the answer back.
The same event can arrive more than once, so make your handler safe to run twice: check the event's ID, or the object's state, before you act on it.
Check the signature
Every delivery carries a Sovgate-Signature header:
Read the header
t is when the attempt started, in Unix seconds. Each v1 is a signature, one per signing secret in use.
Compute the expected signature
An HMAC-SHA256, keyed with your signing secret, of t, a dot, and the raw request body exactly as received, in hex.
Compare
Accept the delivery if any v1 matches, using a constant-time comparison, and reject a t that's too old, to stop replays.
Roll the signing secret
Choose Roll secret:
- Replacing it on schedule: the old secret keeps signing beside the new one for the time you choose, so your server can move to it. Each delivery then carries a signature from both. Expire previous now ends the overlap early.
- It may have been exposed: the old secret stops at once, and deliveries fail at your server until you deploy the new one. Failed deliveries are retried on schedule, and can be resent for 15 days.