Skip to content

Send webhook test event

POST/webhook-endpoints/{id}/test

Send one test event of a type the endpoint subscribes to. It is marked and synthetic, and never a real order or funding.

Sandbox: test money only. No request moves real money.

Authenticate with your sandbox key as a bearer token: Authorization: Bearer nbk_test_....

The event is signed under the endpoint's secrets and delivered, retried and listed in its deliveries exactly as a real event is, so a receiver's signature verification is checked before a real order. Its envelope says "test": true and its id is an evt_ ULID dated 1970-01-01 (evt_0000000000...), which no real event has. Its object is shaped as the event type's real object (the Order of an order.* event, the Funding of funding.credited) with the all-zero id (ord_00000000000000000000000000, fnd_00000000000000000000000000): fetching it is 404, so a receiver that fetches the object before releasing value releases nothing. order.failed carries status_reason: provider_rejected and order.under_review outcome_unconfirmed. It is not in the event log, reaches no other endpoint and creates no order, funding or balance movement. A type the endpoint does not subscribe to (param: /type), or a disabled endpoint, is 400 invalid_request. An endpoint takes at most 20 test events in any hour; the next is 429 rate_limited with Retry-After. Each request sends one test event: there is no Idempotency-Key.

Request

HeaderValueSent
AuthorizationBearer nbk_test_...Required
Content-Typeapplication/jsonRequired

Parameters

FieldDescription
IDid · path string · requiredPattern ^whe_[0-9A-HJKMNP-TV-Z]{26}$.

Body

Unknown fields are rejected.

FieldDescription
Typetype · string · requiredOne of order.accepted, order.processing, order.succeeded, order.failed, order.refunded, order.under_review, funding.credited, deposit.confirmed, balance.low, balance.recovered.
The request in cURL, JavaScript and Python
POST /v1/webhook-endpoints/{id}/testSandbox, test key
const response = await fetch('https://sandbox-api.nasfampay.com/v1/webhook-endpoints/whe_01K7SAMP000000000000000001/test', {  method: 'POST',  headers: {    Authorization: `Bearer ${process.env.NASFAM_SANDBOX_KEY}`,    'Content-Type': 'application/json',  },  body: JSON.stringify({ type: 'order.accepted' }),});if (!response.ok) {  const problem = await response.json();  throw new Error(`${problem.status} ${problem.code}: ${problem.title} (request ${problem.request_id})`);}const result = await response.json();console.log(response.status, result);
Code for Request
POST /v1/webhook-endpoints/{id}/testSandbox, test key
// npm install axiosimport axios from 'axios';try {  const { status, data: delivery } = await axios.post(    'https://sandbox-api.nasfampay.com/v1/webhook-endpoints/whe_01K7SAMP000000000000000090/test',    { type: 'order.succeeded' },    {      headers: {        Authorization: `Bearer ${process.env.NASFAM_SANDBOX_KEY}`,      },    },  );  console.log(status, delivery);} catch (error) {  if (!axios.isAxiosError(error) || !error.response) throw error;  const problem = error.response.data;  throw new Error(`${problem.status} ${problem.code}: ${problem.title} (request ${problem.request_id})`);}

Responses

StatusMeaningBody
Accepted202The test event is made and its delivery scheduled. Headers: RateLimit (draft-ietf-httpapi-ratelimit-headers-11. the same buckets, each "<bucket>";r=<whole requests remaining, never negative>;t=<seconds until the quota is fully available again>. ), RateLimit-Policy (draft-ietf-httpapi-ratelimit-headers-11. a structured field list with one item per bucket the request drew on (orders, quotes, quotes_daily, reads, webhooks, lookups, lookups_org, lookups_daily), each "<bucket>";q=<quota>;w=<window seconds>. no partition key (pk) is sent. ).WebhookDelivery object
Content too large413The request body is over 16 KB (payload_too_large). Refused before authentication; nothing is read further. Headers: Request-Id.Problem object
Too many requests429Too many requests (rate_limited), or your queued orders are at your cap (queue_limit). A bucket that cannot be read at once because of contention is answered here too, never waited on. Honour Retry-After. . Headers: Request-Id, Retry-After (seconds to wait before retrying), RateLimit (draft-ietf-httpapi-ratelimit-headers-11. the same buckets, each "<bucket>";r=<whole requests remaining, never negative>;t=<seconds until the quota is fully available again>. ), RateLimit-Policy (draft-ietf-httpapi-ratelimit-headers-11. a structured field list with one item per bucket the request drew on (orders, quotes, quotes_daily, reads, webhooks, lookups, lookups_org, lookups_daily), each "<bucket>";q=<quota>;w=<window seconds>. no partition key (pk) is sent. ).Problem object
Any other statusdefaultError (RFC 9457). A 503 service_unavailable with Retry-After means the request was not processed: the rate limiter or the database could not answer, and the API refuses rather than serve unlimited (reads included). For a money-moving operation, retrying with the same Idempotency-Key is always safe. . Headers: Request-Id, Retry-After (on 429 and some 503 responses).Problem object

The webhook delivery object

FieldDescription
IDid · string · requiredPattern ^whd_[0-9A-HJKMNP-TV-Z]{26}$.
Event IDevent_id · string · required
Attemptattempt · integer · requiredAt least 1.
Statusstatus · string · requiredOne of pending, succeeded, failed, abandoned.
Response statusresponse_status · integer or null
Duration msduration_ms · integer or null
Failure classfailure_class · stringNull when accepted (2xx) or not yet attempted, and for a stored answer with no class (a 101 recorded before such answers were recorded as connection failures).
Next attempt atnext_attempt_at · string or nullFormat date-time.
Created atcreated_at · string · requiredFormat date-time.

Responses are extensible: ignore fields, enum values and event types you do not know. Any other status is a Problem (see Errors).

Every kind of response
202 AcceptedSynthetic sandbox data
{  "id": "whd_01K7SAMP000000000000000001",  "event_id": "string",  "attempt": 1,  "status": "pending",  "response_status": null,  "duration_ms": null,  "failure_class": null,  "next_attempt_at": null,  "created_at": "2026-10-10T10:05:02Z"}

Not finished. Only a final status means it is done: read it again or wait for its webhook. An outcome that is not known yet is held, never a failure.

Code for Responses
Response
JSON
202 AcceptedSynthetic sandbox data
{  "id": "whd_01K7SAMP000000000000000092",  "event_id": "evt_0000000000K7SAMP0000000090",  "attempt": 1,  "status": "pending",  "created_at": "2026-10-10T10:13:00.000Z"}
Test event
JSON
order.succeededSynthetic sandbox data
{  "id": "evt_0000000000K7SAMP0000000090",  "type": "order.succeeded",  "timestamp": "2026-10-10T10:13:00.000Z",  "environment": "sandbox",  "api_version": "v1",  "data": {    "object": {      "id": "ord_00000000000000000000000000",      "environment": "sandbox",      "status": "succeeded",      "status_reason": null,      "product": "telegram_stars",      "selection": {        "quantity": 50      },      "recipient": {        "telegram_username": "nasfam_test_ok"      },      "amount": {        "amount": 75,        "currency": "USD"      },      "quote_id": null,      "pricing_version": "sandbox-synthetic-v1",      "reference": "TEST-0001",      "version": 2,      "estimated_completion_at": "2026-10-10T10:15:05.000Z",      "created_at": "2026-10-10T10:15:02.000Z",      "updated_at": "2026-10-10T10:15:05.000Z",      "completed_at": "2026-10-10T10:15:05.000Z"    }  },  "test": true}
Error
JSON
429 Too Many RequestsSynthetic sandbox data
{  "type": "about:blank",  "title": "Too many requests",  "status": 429,  "code": "rate_limited",  "category": "rate_limit",  "detail": "Too many requests. Retry after the time in Retry-After.",  "param": null,  "request_id": "req_01K7SAMP000000000000000090"}

How it behaves

What to expect
AuthenticationYour key as a bearer token in the Authorization header: a nbk_test_ key on the sandbox host.
IdempotencyTakes no key.
In the sandboxServed, on your own test records.
On LiveThe same request, on the Live host with a live key, which exists only for a workspace activated for Live. See Go live.
FundingNone. This request does not touch your balance.
Status changesNone: a test event is marked, synthetic and never a real order or funding.
Webhook eventsOne test event of the type you name, with test set to true.

Error responses

This operation can also answer with not_found, payload_too_large, unknown_field.

Any request can answer with invalid_request, invalid_api_key, key_expired, key_environment_mismatch, insufficient_scope, rate_limited, service_unavailable, internal_error. Errors says what to do about each one.