Send real orders
The same code, the Live host and your Live key. A first read proves them, then the checklist, then your first real order.
Sandbox: test money only. No request moves real money.
In this step you start sending real orders, from a workspace activated for Live. First a read that moves no money: it proves the key, the host and your configuration. Your setup checklist marks the step done once a Live request with your key succeeds. Then the checklist below, and your first real order.
What changes from the sandbox
- The base URL and the key:
https://api.nasfampay.com/v1, and anbk_live_key read fromNASFAM_LIVE_KEY. Nothing else in your code. - A succeeded order is delivered and paid from real money.
- A
nasfam_test_recipient is refused withrecipient_not_eligible. - The sandbox routes answer 404.
The request
Read your account. It answers with the organisation behind the key, its environment and its kyb_status, and changes nothing.
// npm install axiosimport axios from 'axios';try { const { status, data: account } = await axios. get( 'https:// api. nasfampay. com/ v1/ account', { headers: { Authorization: `Bearer ${process. env. NASFAM_ LIVE_ KEY}`, }, }, ); console. log( status, account);} 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})`);}Go Live readiness checklist
- The workspace is active on Live:
GET /accountwith your Live key readskyb_statusactive. - The Live key has only the scopes it needs, lives on your server in
NASFAM_LIVE_KEY, and is configured apart from the sandbox key and host. It is never in a browser or an app. GET /balanceshows enoughavailablefor the order, in integer cents, read from the API and never computed, and itsspending_currencysays how you order: a workspace that does not spend USD orders from a quote.- Every
POST /orderssends anIdempotency-Keystored before the request, and a retry reuses that key and body. - A timeout is unknown: retry with the same key, or look the order up by
reference.under_reviewis shown as pending and never triggers a second order. - Only
succeededreleases value. A webhook is verified over the raw body, itswebhook-idis deduplicated and its order is read before value moves; or you pollGET /orders/{id}. - 429 and 503 wait for
Retry-After, andrequest_idis logged with every error.
What you should see
GET /account answers 200 with environment live and kyb_status active:
{ "id": "org_ 01K7SAMP000000000000000090", "name": "Example Business Ltd", "environment": "live", "kyb_ status": "active", "limits": { "max_ queued": 50 }}If it fails
| What you see | What to check |
|---|---|
key_environment_mismatch | A nbk_test_ key reached the Live host. Use your Live key on the Live host only. |
invalid_api_key | The key in NASFAM_LIVE_KEY is mistyped or revoked. Create another in the dashboard. |
account_restricted | The account may not do this. Read kyb_status on GET /account, and the reason in your dashboard. |
Next step
Step 4 continues: First Live order. One real Telegram Stars order on the Live host, a step at a time, from your key to the money it moved.
Related concepts
- Recovering from failures: what to do in each case.
- Order lifecycle: every transition, and the event it raises.
