---
title: "Webhooks"
description: "Signed events at every step: how to receive and verify them."
---

Register endpoints in **Developers → Webhooks** or with `POST /v1/webhook-endpoints`. Each endpoint has a signing secret (`whsec_…`), shown once.

Every delivery carries:

| Header | Value |
|---|---|
| `Storspay-Signature` | `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`; two `v1=` values while a secret rotation overlaps |
| `Storspay-Timestamp` | The same `t`, as its own header (new routes only; if you read it, it must equal `t`) |
| `Storspay-Event-Id` | `evt_…`, the same on every retry |
| `Storspay-Delivery-Id` | `del_…`, one per attempt |

## Verify every delivery

Take `t` and every `v1` from `Storspay-Signature`, compute the HMAC over `t + "." + rawBody`, compare in constant time, and refuse a `t` more than 5 minutes from your clock. Then answer any 2xx within 30 seconds and do the work afterwards.

<CodeGroup>

```js Node.js
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyStorspay(rawBody, signatureHeader, secret) {
  const parts = String(signatureHeader ?? "").split(",").map((p) => p.trim().split("="));
  const t = parts.find(([k]) => k === "t")?.[1];
  if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return parts
    .filter(([k]) => k === "v1")
    .some(([, sig]) => sig.length === expected.length &&
      timingSafeEqual(Buffer.from(sig), Buffer.from(expected)));
}
```

```python Python
import hmac, hashlib, time

def verify_storspay(raw_body: bytes, signature_header: str, secret: str) -> bool:
    parts = [p.strip().split("=", 1) for p in signature_header.split(",") if "=" in p]
    t = next((v for k, v in parts if k == "t"), "")
    if not t or abs(time.time() - int(t)) > 300:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(v, expected) for k, v in parts if k == "v1")
```

```go Go
func VerifyStorspay(rawBody []byte, signatureHeader, secret string) bool {
	var t string
	var sigs []string
	for _, p := range strings.Split(signatureHeader, ",") {
		kv := strings.SplitN(strings.TrimSpace(p), "=", 2)
		if len(kv) != 2 {
			continue
		}
		switch kv[0] {
		case "t":
			t = kv[1]
		case "v1":
			sigs = append(sigs, kv[1])
		}
	}
	sec, err := strconv.ParseInt(t, 10, 64)
	if err != nil || math.Abs(float64(time.Now().Unix()-sec)) > 300 {
		return false
	}
	mac := hmac.New(sha256.New, []byte(secret))
	mac.Write([]byte(t + "."))
	mac.Write(rawBody)
	expected := hex.EncodeToString(mac.Sum(nil))
	for _, sig := range sigs {
		if hmac.Equal([]byte(sig), []byte(expected)) {
			return true
		}
	}
	return false
}
```

```java Java
static boolean verifyStorspay(byte[] rawBody, String signatureHeader, String secret) throws Exception {
    String t = null;
    List<String> sigs = new ArrayList<>();
    for (String p : signatureHeader.split(",")) {
        String[] kv = p.trim().split("=", 2);
        if (kv.length != 2) continue;
        if (kv[0].equals("t")) t = kv[1];
        if (kv[0].equals("v1")) sigs.add(kv[1]);
    }
    if (t == null || Math.abs(Instant.now().getEpochSecond() - Long.parseLong(t)) > 300) return false;
    Mac mac = Mac.getInstance("HmacSHA256");
    mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
    mac.update((t + ".").getBytes(StandardCharsets.UTF_8));
    byte[] expected = HexFormat.of().formatHex(mac.doFinal(rawBody)).getBytes(StandardCharsets.UTF_8);
    for (String sig : sigs) {
        if (MessageDigest.isEqual(sig.getBytes(StandardCharsets.UTF_8), expected)) return true;
    }
    return false;
}
```

</CodeGroup>

## Delivery and retries

- We retry up to 12 times over about an hour. For the September v1 API we retry at 30 s, 2 min and 10 min after a non-2xx answer or a 10 s timeout.
- Events can arrive out of order: use `createdAt` and fetch the resource when in doubt.
- The same event can arrive twice: deduplicate by the event id.
- Payloads carry ids, statuses and amounts, not personal data.
- Send a test event any time: `POST /v1/webhook-endpoints/{id}/test` sends `webhook.test` with `"test": true`.

## Payload

```json
{
  "id": "evt_…",
  "type": "payout.paid",
  "createdAt": "2026-12-18T14:03:00Z",
  "apiVersion": "…",
  "accountId": "acct_…",
  "test": false,
  "data": { "object": { "id": "po_…", "status": "paid" } }
}
```

`data.object` is the resource as `GET` returns it, without personal data.

## Events

| Family | Events |
|---|---|
| Payouts | `payout.created`, `.queued`, `.processing`, `.paid`, `.failed`, `.cancelled`, `.reverted`, `.funds_returned` |
| Transfers | `transfer.created`, `.completed`, `.failed`, `.held`, `.released`, `.refunded` (a cash-out also sends the payout's `payout.*` events) |
| Deposits | `deposit.received`, `deposit.credited` |
| Collections | `collection.created`, `.received`, `.converting`, `.credited`, `.expired`, `.cancelled`, `.failed` |
| Account holders | `account.created`, `account.activated`, `account.frozen`, `account.closed` |
| Applications | `application.submitted`, `.approved`, `.rejected`, `.needs_information` |
| Information requests | `information_request.created`, `.closed` |
| Account details | `virtual_account.created`, `.kyc_updated`, `.deposit_received`, `.paused`, `.reactivated`, `.frozen`, `.closed` |
| Mandates | `mandate.payout_held` (an agent payout held for a person to approve) |
| Platform fees | `platform_fee.earned` |
| Test | `webhook.test` |

Choose the event families per endpoint.

## September v1 API webhooks

The September v1 API sends its own events to the endpoint we set for you, or to a per-payout `callbackUrl`: `payout.created`, `payout.processing`, `payout.completed`, `payout.failed`, `payout.refunded`, `payout.held`, `payout.released`. They use the same `Storspay-Signature` header, so one verifier works for both. `payout.completed` (v1) and `payout.paid` (new routes) are the same moment.
