Skip to content

Search API reference

Find an endpoint or a guide of the Sovgate API reference and jump straight to it.

Webhooks

Get told on your server when something happens: check each event's signature, answer fast, and handle repeats.

Sovgate sends an event to your server each time something happens in your account, such as checkout.session.completed when a customer pays. Add the endpoint, the https address on your server, in the Dashboard under Developers › Webhooks, and choose the event types it listens to. Endpoints are written only in the Dashboard: a key can read them.

What arrives

Each delivery is a POST with one event as its JSON body. An event is thin: it names what happened and the object it's about, never the object's data.

An event
json
{  "id": "evt_4c1e9a7f2b6d0e3a8c5f1b9d",  "object": "event",  "type": "checkout.session.completed",  "livemode": false,  "related_object": { "type": "checkout_session", "id": "cs_test_..." },  "request_id": null,  "source": "automatic",  "created": "2026-11-27T14:03:41Z"}

Treat it as a notice: fetch the object with the API and act on its current state.

Check the signature

Every delivery carries a Sovgate-Signature header: t, when the attempt started in Unix seconds, and one v1 signature for each signing secret in use.

Sovgate-Signature
text
t=1764252221,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd

Read the raw body

Before any parsing: a body parsed and written out again no longer matches.

Compute the signature

An HMAC-SHA256, keyed with the endpoint's signing secret, of t, a full stop, and the raw body. In hex.

Compare

Accept the delivery if any v1 matches, compared in constant time. Ignore a signature scheme you don't know: use only the v1 values.

Check the time and the mode

Refuse a t older than 5 minutes, or more than 1 minute in the future. If one address serves both modes, check livemode.

verify.js
javascript
import crypto from "node:crypto"
export function verifySovgateSignature(rawBody, header, secret) { const parts = header.split(",").map((part) => part.split("=")) const t = Number(parts.find(([key]) => key === "t")?.[1]) const signatures = parts.filter(([key]) => key === "v1").map(([, value]) => value) const now = Math.floor(Date.now() / 1000) if (!t || now - t > 300 || t - now > 60) return false const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex") return signatures.some( (signature) => signature.length === expected.length && crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected)) )}

Reveal or roll an endpoint's signing secret in the Dashboard. While a roll overlaps, each delivery carries a signature from both secrets.

Answer fast

Answer with a 2xx within 15 seconds, then do the work. Anything else, or no answer in time, is a failed attempt. A 3xx is a failure too: redirects are never followed.

TopicWhat happens
RetriesA failed attempt is retried after about 5 seconds, 5 minutes, 30 minutes, then 2, 5, 10, 14, 20 and 24 hours: 10 attempts over about 3 days. In test mode, 4 attempts.
PausesA 429, 502, 503, 504 or a timeout pauses deliveries to the endpoint for a minute. A Retry-After is followed, within bounds.
DisablingAn endpoint failing for 120 hours is disabled. A 410 answer disables it at once.
ResendingFrom the Dashboard, for up to 15 days.

Repeats and order

Delivery is at least once, and order isn't promised: retries, resends and recoveries all reorder events.

  • Store each event's id once you've handled it, and ignore an ID you've seen: a repeat carries the same ID.
  • Don't assume two events about one object arrive in the order they happened.
  • Make the work itself safe to repeat.

You can always list your events and fetch the objects, whatever reached your endpoint.

Event types

ResourceEvents
Paymentspayment.authorized, payment.succeeded, payment.captured, payment.failed, payment.canceled, payment.expired, payment.refunded
Checkout sessionscheckout.session.completed, checkout.session.expired
Refundsrefund.created, refund.succeeded, refund.failed, refund.updated
Disputesdispute.created, dispute.funds_withdrawn, dispute.updated, dispute.closed, dispute.funds_reinstated
Early fraud warningsearly_fraud_warning.created, early_fraud_warning.updated
Invoicesinvoice.created, invoice.updated, invoice.send_blocked, invoice.sent, invoice.reminder_sent, invoice.viewed, invoice.payment_succeeded, invoice.paid, invoice.overdue, invoice.canceled
Subscriptionssubscription.created, subscription.updated, subscription.billed, subscription.payment_succeeded, subscription.payment_failed, subscription.payment_recorded, subscription.period_voided, subscription.past_due, subscription.paused, subscription.resumed, subscription.canceled, subscription.ended
Payment linkspayment_link.created, payment_link.updated, payment_link.activated, payment_link.deactivated, payment_link.archived
Catalogproduct.created, product.updated, price.created, price.updated, price.deleted, coupon.created, coupon.updated, promotion_code.created, promotion_code.updated, shipping_rate.created, shipping_rate.updated, tax_rate.created, tax_rate.updated
Usagetelemetry.created, telemetry.updated, telemetry.deactivated, telemetry.reactivated, usage_alert.created, usage_alert.updated, usage_alert.triggered, credit_grant.created, credit_grant.applied, credit_grant.updated
Payoutspayout.created, payout.updated, payout.paid, payout.failed, payout.canceled, bank_account.created, bank_account.updated, bank_account.deleted
Webhook endpointswebhook_endpoint.ping, the test event

A restricted key sees only the events of resources it can read. New event types can be added at any time: ignore a type you don't handle.