Webhooks
API v2 events posted to your webhook URL, how to verify their signature, the event log and resend.
Events
| type | sent when |
|---|---|
payment.detected | a payment is seen on chain (unless the address has notify_detected: false) |
payment.forwarded | the payment reached your wallet: fulfil the order |
payment.below_minimum | a payment is below the asset minimum: recorded, never forwarded |
checkout.paid | a payment checkout is covered |
checkout.expired | a payment checkout expired unpaid |
{
"object": "event",
"id": "evt_7tR2kM9pQ4xL1nV8wC5bZ3",
"type": "payment.forwarded",
"created_at": "2026-12-01T14:06:41Z",
"data": {
"object": "payment",
"id": "pay_8hQ2nV5kW1xC7mB3pL9rT4",
"address_id": "addr_4vJ9kQ2mXnL8pR7sT1wY3z",
"checkout_id": null,
"status": "forwarded",
"asset": "usdt",
"network": "tron",
"amount": "49.97",
"fee": "0.5",
"network_fee": "0.43",
"amount_forwarded": "49.04",
"tx_hash": "a1b2…",
"forward_tx_hashes": ["c3d4…"],
"confirmations": 19,
"required_confirmations": 19,
"metadata": { "order_id": "1042" },
"detected_at": "2026-12-01T14:05:02Z",
"confirmed_at": "2026-12-01T14:06:00Z"
}
}Answer any 2xx within 30 seconds. Anything else is retried at 6, 12, 24 minutes and so on, for 3 days. Events can
arrive more than once or out of order: deduplicate on id, and read data.status.
Verify the signature
Every event carries NoncePay-Signature: t=1764597999,v1=<base64>. v1 is an RSA-SHA256 (PKCS#1 v1.5) signature of
the string <t>.<raw body> with the key from GET /v2/public-key.
Reject a t more than 5 minutes from your clock: a captured delivery cannot be replayed later.
import { NoncePayV2 } from '@nonceapp/api'
const noncepay = new NoncePayV2()
app.post('/noncepay', express.raw({ type: 'application/json' }), async (req, res) => {
const event = await noncepay.verifyWebhook(req.body, req.headers['noncepay-signature'])
if (!event) return res.status(401).end()
if (event.type === 'payment.forwarded') {
// fulfil event.data.metadata.order_id
}
res.status(204).end()
})<?php
$pubkey = json_decode(file_get_contents('https://api.noncepay.app/v2/public-key'), true)['pem'];
$body = file_get_contents('php://input');
[$t, $sig] = sscanf($_SERVER['HTTP_NONCEPAY_SIGNATURE'] ?? '', 't=%d,v1=%s');
$valid = $t && abs(time() - $t) <= 300
&& openssl_verify("$t.$body", base64_decode($sig), $pubkey, OPENSSL_ALGO_SHA256) === 1;
if (!$valid) {
http_response_code(401);
exit;
}
$event = json_decode($body, true);
if ($event['type'] === 'payment.forwarded') {
// fulfil $event['data']['metadata']['order_id']
}
http_response_code(204);import base64, time
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding
def verify(body: bytes, header: str, pem: str) -> bool:
parts = dict(part.split("=", 1) for part in header.split(","))
t = int(parts["t"])
if abs(time.time() - t) > 300:
return False
key = serialization.load_pem_public_key(pem.encode())
try:
key.verify(base64.b64decode(parts["v1"]), f"{t}.".encode() + body,
padding.PKCS1v15(), hashes.SHA256())
return True
except Exception:
return FalseCache the public key rather than fetching it for every event.
Event log and resend
GET /v2/addresses/{id}/events (and
/v2/checkouts/{id}/events) list the events with their delivery
status and last attempts: status code, the start of your response, or the connection error.
Fixed your endpoint after it failed for days? POST /v2/events/{id}/resend
sends the same event again within seconds, with a fresh signature, and retries it for 3 more days.