Skip to content
API reference/Webhooks

Settlement event

POSTYour registered HTTPS endpoint

One POST to your webhook URL per settled payment, with User-Agent: Cadmos-Webhooks/1. The body is one settlement, as in the list.

Verify the signature against the exact bytes received, and refuse a timestamp more than 300 seconds from your clock:

JavaScript
const { createHash } = require('crypto');
const { verifyMessage } = require('ethers');

// rawBody: the exact bytes received. signers: the addresses from GET /v1/external-auth/webhook-signers.
function verifyCadmosWebhook(rawBody, headers, signers) {
  const timestamp = headers['x-cadmos-timestamp'];
  if (!/^\d+$/.test(timestamp) || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
  try {
    const digest = createHash('sha256').update(rawBody).digest('hex');
    const message = `${timestamp}.${JSON.parse(rawBody).id}.${digest}`;
    return signers.includes(verifyMessage(message, headers['x-cadmos-signature']));
  } catch {
    return false;
  }
}

Delivery is at least once: answer 2xx only after storing the payment, and drop an id you already have. Any other answer, a redirect (never followed) or no answer within 10 seconds is retried: 1 minute later, doubling up to 1 hour, until 3 days after the settlement. The settlements list has everything a webhook missed.

Parameters

X-Cadmos-Timestampstring · headerRequired

Unix seconds when this attempt was sent.

pattern ^\d+$
X-Cadmos-Signaturestring · headerRequired

EIP-191 signature over <X-Cadmos-Timestamp>.<id>.<sha256 hex of the body>.

pattern ^0x[0-9a-fA-F]{130}$

Request body

application/json · Settlement

idstringRequired

The payment's on-chain transfer id. Unique: drop one you already have.

pattern ^0x[0-9a-fA-F]{64}$
linkUuidstringRequired

Ignore a link you do not know: it was made in the app.

format uuid
externalReferencestring or nullRequired

Your reference, null for a link made in the app.

assetstringRequired

What arrived: CUSD for a cash payment.

one of USDC, USDT, CUSD
grossstringRequired

An integer string of 6-decimal units: "100000000" is 100.000000.

pattern ^\d+$
gatewayFeestring or nullRequired

An integer string of 6-decimal units: "100000000" is 100.000000.

pattern ^\d+$
appliedRateBpsinteger or nullRequired
netCusdstringRequired

What your wallet was credited.

pattern ^\d+$
settledAtstring or nullRequired
format date-time
settlementobjectRequired
settlement.chainstringRequired
one of arbitrum
settlement.txHashstring or nullRequired

The transaction that credited your wallet.

whishCashInstring or nullRequired

The Whish cash-in behind a cash payment; null for crypto.

destinationstringRequired

Always your Cadmos wallet.

one of cadmos_wallet
Example
{
  "id": "0x5f2c0c3d2b1a09f8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a3928170",
  "linkUuid": "0b6f5a8e-1c2d-4e3f-9a8b-7c6d5e4f3a2b",
  "externalReference": "order-42",
  "asset": "USDT",
  "gross": "100000000",
  "gatewayFee": "500000",
  "appliedRateBps": 50,
  "netCusd": "99500000",
  "settledAt": "2026-11-17T10:00:00.000Z",
  "settlement": {
    "chain": "arbitrum",
    "txHash": "0xdfd1a5041e8abc7c9b2f6a0e1d3c5b7a9f8e6d4c2b0a1f3e5d7c9b8a6f4e2d0c"
  },
  "whishCashIn": null,
  "destination": "cadmos_wallet"
}

Responses

Stored. Any other answer is retried.

We use necessary cookies to run this site. With your permission, we also use analytics and advertising technologies to measure visits and downloads.