Skip to content

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 a nbk_live_ key read from NASFAM_LIVE_KEY. Nothing else in your code.
  • A succeeded order is delivered and paid from real money.
  • A nasfam_test_ recipient is refused with recipient_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.

Code for The request
GET /v1/accountLive, real money
// 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

  1. The workspace is active on Live: GET /account with your Live key reads kyb_status active.
  2. 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.
  3. GET /balance shows enough available for the order, in integer cents, read from the API and never computed, and its spending_currency says how you order: a workspace that does not spend USD orders from a quote.
  4. Every POST /orders sends an Idempotency-Key stored before the request, and a retry reuses that key and body.
  5. A timeout is unknown: retry with the same key, or look the order up by reference. under_review is shown as pending and never triggers a second order.
  6. Only succeeded releases value. A webhook is verified over the raw body, its webhook-id is deduplicated and its order is read before value moves; or you poll GET /orders/{id}.
  7. 429 and 503 wait for Retry-After, and request_id is logged with every error.

What you should see

GET /account answers 200 with environment live and kyb_status active:

Code for What you should see
A Live account
JSON
200 OKSynthetic sandbox data
{  "id": "org_01K7SAMP000000000000000090",  "name": "Example Business Ltd",  "environment": "live",  "kyb_status": "active",  "limits": {    "max_queued": 50  }}

If it fails

What you seeWhat to check
key_environment_mismatchA nbk_test_ key reached the Live host. Use your Live key on the Live host only.
invalid_api_keyThe key in NASFAM_LIVE_KEY is mistyped or revoked. Create another in the dashboard.
account_restrictedThe 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.