Webhooks

Webhooks are how your backend learns that an advance changed state without polling. Shopsuey Capital POSTs a signed JSON event to the webhook URL you registered during onboarding, and your job is threefold: verify the signature, acknowledge fast, process idempotently.

Deliveries are signed with X-SSC-Signature: t=<timestamp>,v1=<hmac> using your webhook signing secret — a different secret from your API key, and the one place HMAC still appears in this API. We generate this secret and share it with you during onboarding, alongside your API keys; you do not choose or generate it yourself. Verify the untouched raw request body against <timestamp>.POST.<path>.<sha256_of_body>, reject stale timestamps, compare signatures in constant time, then enqueue your work and return a 2xx within 10 seconds.

Verify Deliveries

Read the request body as raw bytes before parsing JSON — re-serialized JSON will not hash to the same value. Recompute the signature with your webhook signing secret and the delivery pathname, and reject the delivery unless both the timestamp window and a constant-time signature comparison pass.

# Replay a placeholder payload locally. Production receivers verify the untouched raw body.
curl -X POST https://partner.example/webhooks/shopsuey -H 'Content-Type: application/json' -H 'X-SSC-Signature: t=1783728000,v1=EXAMPLE_SIGNATURE' --data '{"event":"advance.confirmed","advance_id":"00000000-0000-4000-8000-000000000002","partner_ref":"ADV-EXAMPLE-001","amount":250000,"fee_amount":4375,"net_amount":245625,"status":"confirmed","disbursal_mode":"partner","metadata":null,"occurred_at":"2026-07-11T00:00:00.000Z"}'

Events and Payload

Seven events cover the advance lifecycle, one per status transition:

EventEmitted when
advance.createdThe advance is created and awaiting merchant confirmation.
advance.confirmedThe merchant confirmed on the hosted page.
advance.disbursedFunds were disbursed to the merchant.
advance.failedA confirmed or disbursed advance failed operationally.
advance.cancelledThe advance was cancelled before confirmation (by you or the merchant).
advance.rejectedFinance ops rejected the advance; the payload includes rejection_reason.
advance.expiredThe confirmation window lapsed.

Every Payload Has the Same Shape

metadata echoes back whatever JSON you attached when creating the advance — use it to route events without a database lookup. New fields and event types may be added within /v1, so ignore anything you do not recognize.

Webhook payload example
{
  "event": "advance.confirmed",
  "advance_id": "00000000-0000-4000-8000-000000000002",
  "partner_ref": "ADV-EXAMPLE-001",
  "amount": 250000,
  "fee_amount": 4375,
  "net_amount": 245625,
  "status": "confirmed",
  "rejection_reason": null,
  "disbursal_mode": "partner",
  "metadata": null,
  "occurred_at": "2026-07-11T00:00:00.000Z"
}

Recovery and Retries

A delivery counts as successful only on a 2xx response within 10 seconds. Anything else is retried on a backoff schedule, up to seven attempts in total (the original delivery plus six retries), after which the delivery is dead-lettered and will not be retried automatically. Times are approximate — the redelivery dispatcher runs on a short polling interval, not to the exact second.

AttemptDelay after previous failureApprox. elapsed since first attempt
1 (original)—T0
230 secondsT0 + 30s
32 minutesT0 + 2.5m
410 minutesT0 + 12.5m
51 hour~T0 + 1h13m
66 hours~T0 + 7h13m
724 hours~T0 + 31h13m

Because retries can cross paths with later events, process idempotently: deduplicate by advance_id plus status rather than assuming each delivery is new information. And when you suspect you missed something — an endpoint outage longer than the retry window, say — reconcile with GET /v1/advances/:id. Never treat the merchant returning to your return_url as a substitute for a verified webhook.