Monitor orders and webhooks
Register your Live webhook endpoint, follow every order to its end, and reconcile the money each day.
Sandbox: test money only. No request moves real money.
In this step you set up what you watch once real orders flow: a Live webhook endpoint, the statuses that need you, and a daily check that the money adds up.
Register your Live endpoint
Your Sandbox endpoint stays in the Sandbox. Register your Live endpoint on the Live host, for order.succeeded, order.failed and order.under_review. Its secret is shown once: store it on your server, apart from your Sandbox secret, and check every webhook-signature with it; see Verifying a delivery.
Then send it a test event, so you know the signature check works before a real order needs it. Webhooks shows how.
// npm install axiosimport axios from 'axios';try { const { status, data: endpoint } = await axios. post( 'https:// api. nasfampay. com/ v1/ webhook-endpoints', { url: 'https:// example. com/ webhooks/ nasfam', events: [ 'order. succeeded', 'order. failed', 'order. under_ review', 'funding. credited', ], description: 'Order updates', }, { headers: { Authorization: `Bearer ${process. env. NASFAM_ LIVE_ KEY}`, }, }, ); console. log( status, endpoint);} 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})`);}Handle every event
- Verify the signature over the raw body, and refuse a stale timestamp.
- Answer quickly, then do the work.
- Record the event
idand ignore one you have seen. An event can arrive more than once. - Ignore an event type you do not handle, and act on no test event. New types will be added.
- Keep the highest
versionyou have seen for each order and ignore anything lower.
Answer within 15 seconds, then do the work. A failed attempt is retried, and an endpoint that keeps failing is disabled. Every event is also in GET /events for 30 days, so you can catch up after downtime.
Watch the statuses that need you
| Status | Your money | What to do |
|---|---|---|
| Processingprocessing | Held. Delivery is in progress. | Wait for the next state. |
| Succeededsucceeded | Captured. The order is paid for. | Nothing. completed_at is set. |
| Failedfailed | Released back to available. | Read status_reason; order again if it makes sense. |
| Under reviewunder_ | Your funds stay held. | No action needed. |
Read GET /orders/{id} before you release value to your customer. under_review keeps the money held while the outcome is confirmed: show it as pending, and never order again to find out.
// npm install axiosimport axios from 'axios';try { const { status, data: order } = await axios. get( 'https:// api. nasfampay. com/ v1/ orders/ ord_ 01K7SAMP000000000000000090', { headers: { Authorization: `Bearer ${process. env. NASFAM_ LIVE_ KEY}`, }, }, ); console. log( status, order);} 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})`);}Reconcile each day
- Every accepted order has an
order_reserveonGET /balance/transactions, naming itsorder_id. - Every succeeded order has an
order_capture, and every failed one anorder_releaseback toavailable. - An order still
processingorunder_reviewhas its reserve and nothing else yet. - Your own records name the same orders, by your
reference.
A difference is a question for the order, never a reason to order again. Your dashboard's Orders and request logs show the same records.
// npm install axiosimport axios from 'axios';try { const { status, data: transactions } = await axios. get( 'https:// api. nasfampay. com/ v1/ balance/ transactions', { headers: { Authorization: `Bearer ${process. env. NASFAM_ LIVE_ KEY}`, }, }, ); console. log( status, transactions);} 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})`);}What you should see
Your Live endpoint is registered and has passed a test event. Each order ends succeeded or failed, and the statement shows its reserve and then its capture or release. The order you read reads like this:
{ "id": "ord_ 01K7SAMP000000000000000091", "environment": "live", "status": "succeeded", "status_ reason": null, "product": "telegram_ stars", "selection": { "quantity": 50 }, "recipient": { "telegram_ username": "customer" }, "amount": { "amount": 75, "currency": "USD" }, "quote_ id": "quo_ 01K7SAMP000000000000000091", "pricing_ version": "example", "reference": "TEST-0002", "version": 2, "estimated_ completion_ at": "2026-10-10T10:15:35.000Z", "created_ at": "2026-10-10T10:15:30.000Z", "updated_ at": "2026-10-10T10:15:05.000Z", "completed_ at": "2026-10-10T10:15:05.000Z", "recipient_ lookup": "rlk_ 01K7SAMP000000000000000090"}If it fails
| What you see | What to check |
|---|---|
| Your endpoint received nothing | Read the endpoint: enabled may be false, with a disabled_reason. Then list its deliveries; Webhooks shows how. |
| Your endpoint refuses every delivery | It is checking with your Sandbox secret. Use the Live endpoint's own secret, over the raw body. |
An order stays under_review | That is not a failure. The money stays held until the outcome is confirmed. Never order again. |
| The statement and your records disagree | Find the order by your reference with GET /orders?reference=, and read its status before you change anything. |
key_environment_mismatch | A Sandbox key reached the Live host. Use your Live key. |
rate_limited | Wait the seconds in Retry-After. Read less often: an event tells you when an order changes. |
Next step
This is the last step. Keep the Sandbox for testing changes before they reach Live: Sandbox scenarios lists what you can test, and the guides go deeper on each part, starting with Authentication and keys.
Related concepts
- Webhooks: endpoints, events, deliveries and replay.
- Recovering from failures: what to do in each case.
- Funding your account: the statement, line by line.
