Send a test event
Deliver a signed sample event to an endpoint to check your handler.
Sends a signed sample event and returns the delivery. The payload has test: true and a made-up subject whose ID contains _test_, with only that ID in data, so your handler can tell it apart and nothing in your business changes. A test delivery goes out once and isn't retried.
Path
idstring RequiredThe webhook endpoint's ID, such aswhk_GFAKLrE8wkBwF4WL.
Body
event_typestringA type the endpoint receives. Defaults to its first one.
Errors
- 400
invalid_requestA field is missing, unknown or out of range.fieldnames it. - 404
not_foundNo webhook endpoint with that ID belongs to your business. - 429
rate_limitedMore than 10 test events and resends in a minute for this business.
Any request can also fail on its key or its body. See errors.
Request
curl -X POST "https://api.402pay.co/api/v1/webhooks/whk_GFAKLrE8wkBwF4WL/test" \
-H "Authorization: Bearer $PAY402_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"event_type": "payment.succeeded"
}'const response = await fetch("https://api.402pay.co/api/v1/webhooks/whk_GFAKLrE8wkBwF4WL/test", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PAY402_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
event_type: "payment.succeeded"
}),
});
const { data } = await response.json();import os
import requests
response = requests.post(
"https://api.402pay.co/api/v1/webhooks/whk_GFAKLrE8wkBwF4WL/test",
headers={
"Authorization": f"Bearer {os.environ['PAY402_SECRET_KEY']}",
},
json={
"event_type": "payment.succeeded"
},
)
data = response.json()["data"]Response201 Created
{
"data": {
"id": "dlv_bT1dN9zK1zp9H6Re",
"kind": "webhook_delivery",
"webhook_id": "whk_GFAKLrE8wkBwF4WL",
"event_id": "evt_AncdRQ0YlMsNNIQD",
"event_type": "payment.succeeded",
"subject": {
"kind": "payment",
"id": "pmt_test_wcKbRA2NP8gXhlmr"
},
"status": "succeeded",
"response_status": 200,
"duration_ms": 269,
"attempt": 1,
"attempts": [
{
"at": "2026-09-26T21:23:17.117Z",
"response_status": 200,
"duration_ms": 269,
"trigger": "manual"
}
],
"next_retry_at": null,
"request_headers": {
"content-type": "application/json",
"webhook-id": "evt_AncdRQ0YlMsNNIQD",
"webhook-timestamp": "1790457797",
"webhook-signature": "v1,erz2/ak2MUN/eIaREBRHTG9nfipCw9fZ2VcWbYByqw4="
},
"payload": {
"id": "evt_AncdRQ0YlMsNNIQD",
"kind": "event",
"type": "payment.succeeded",
"subject": {
"kind": "payment",
"id": "pmt_test_wcKbRA2NP8gXhlmr"
},
"data": {
"id": "pmt_test_wcKbRA2NP8gXhlmr"
},
"actor": {
"kind": "system",
"id": null,
"name": null
},
"mode": "live",
"test": true,
"api_version": "v1",
"created_at": "2026-09-26T21:23:17.117Z"
},
"created_at": "2026-09-26T21:23:17.117Z"
}
}