Skip to content

A job was paid (sent to your webhook URL)

Documents @snap4id-sdk/partner-api 1.0.0

POST
Code sample: Node (express)
app.post('/webhooks/snap4id', express.raw({ type: '*/*' }), async (req, res) => {
const result = await snap4id.verifyWebhook({ headers: req.headers, rawBody: req.body });
if (!result.ok) return res.status(result.reason === 'keys_unavailable' ? 503 : 401).end(); // never 410 here
if (await alreadyProcessed(result.event.event_id)) return res.status(200).end();
await markPaid(result.event.job_id, result.event.payment_ref);
res.status(200).end();
});

Sent once per job (at-least-once delivery) after the unlock. Verify: look up x-snap4id-key-id in GET /api/v1/partner/webhook-keys, check |now − x-timestamp| ≤ 300000 ms, verify x-signature over the canonical string built from the raw body (see the signing section of the overview), then dedupe by event_id. Retried with exponential backoff for up to 259200000 ms after paid_at (fresh timestamp/signature per attempt, same body). A failing webhook never affects the job.

x-snap4id-key-id
required

Snap4ID signing key id

string
/^[a-z0-9][a-z0-9_-]{2,63}$/

Snap4ID signing key id

x-timestamp
required

Unix epoch milliseconds of this attempt

string
/^\d{1,16}$/

Unix epoch milliseconds of this attempt

x-signature
required

Standard padded base64 Ed25519 signature over the canonical string

string
/^[A-Za-z0-9+/]{86}==$/

Standard padded base64 Ed25519 signature over the canonical string

Media typeapplication/json

Job.paid webhook payload. Serialised once (compact JSON, keys in this order) and sent byte-identical on every attempt; verify the signature over the raw received bytes.

object
event_id
required

UUID v5 of the job id (dedupe key)

string
/^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
type
required
string
Allowed value: job.paid
job_id
required
string
/^([a-z]{2}-)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
payment_ref
required

Payment_ref of the unlocking purchase

string
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
order_code
required
string
/^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{6}$/
paid_at
required

Unlock time (ISO 8601)

string
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/

Examples

Exampleexample
{
"event_id": "3b494732-257b-5290-bd93-33a64be78a6f",
"type": "job.paid",
"job_id": "eu-6f1c2b9e-3d4a-4b8f-9c2e-1a7d5e3f0b42",
"payment_ref": "3b241101-e2bb-4255-8caf-4136c566a962",
"order_code": "7K3M9Q",
"paid_at": "2026-11-24T12:00:00.000Z"
}

Gone: stops retries for this event (it is dropped).

Delivered (any 2xx); response body is discarded.

Any other status, timeout or connection failure: retried for the full delivery window.