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
| Header | Value | Sent |
|---|---|---|
Authorization | Bearer nbk_test_... | Required |
Content-Type | application/json | Required |
Parameters
| Field | Description |
|---|---|
| IDid · path string · required | Pattern ^whe_[0-9A-HJKMNP-TV-Z]{26}$. |
Body
Unknown fields are rejected.
| Field | Description |
|---|---|
| Typetype · string · required | One of order.accepted, order.processing, order.succeeded, order.failed, order.refunded, order.under_review, funding.credited, deposit.confirmed, balance.low, balance.recovered. |
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);// 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
| Status | Meaning | Body |
|---|---|---|
| Accepted202 | The 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 large413 | The request body is over 16 KB (payload_too_large). Refused before authentication; nothing is read further. Headers: Request-Id. | Problem object |
| Too many requests429 | Too 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 statusdefault | Error (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
| Field | Description |
|---|---|
| IDid · string · required | Pattern ^whd_[0-9A-HJKMNP-TV-Z]{26}$. |
| Event IDevent_ | |
| Attemptattempt · integer · required | At least 1. |
| Statusstatus · string · required | One of pending, succeeded, failed, abandoned. |
| Response statusresponse_ | |
| Duration msduration_ | |
| Failure classfailure_ | Null 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_ | Format date-time. |
| Created atcreated_ | Format date-time. |
Responses are extensible: ignore fields, enum values and event types you do not know. Any other status is a Problem (see Errors).
{ "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.
{ "id": "whd_ 01K7SAMP000000000000000092", "event_ id": "evt_ 0000000000K7SAMP0000000090", "attempt": 1, "status": "pending", "created_ at": "2026-10-10T10:13:00.000Z"}{ "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}{ "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 | |
|---|---|
| Authentication | Your key as a bearer token in the Authorization header: a nbk_test_ key on the sandbox host. |
| Idempotency | Takes no key. |
| In the sandbox | Served, on your own test records. |
| On Live | The same request, on the Live host with a live key, which exists only for a workspace activated for Live. See Go live. |
| Funding | None. This request does not touch your balance. |
| Status changes | None: a test event is marked, synthetic and never a real order or funding. |
| Webhook events | One 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.
