Skip to content
Nasfam Business

Appearance

Build with Nasfam Business

One request places an order. Follow it to its result, and see every request you sent in your dashboard.

Request
cURL
POST /v1/ordersSandbox, test key
# One key per purchase: make it once, keep it with the purchase, and send the same key on every retry.: "${IDEMPOTENCY_KEY:?Set IDEMPOTENCY_KEY once for this purchase (a new UUID) and keep it for every retry}"curl -X POST "https://sandbox-api.nasfampay.com/v1/orders" \  -H "Authorization: Bearer $NASFAM_SANDBOX_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \  -d '{    "quote_id": "quo_01K7SAMP000000000000000090",    "reference": "TEST-0001"  }'
Response
JSON
202 AcceptedSelected fields. Amounts in cents.
{  "id": "ord_01K7SAMP000000000000000090",  "status": "processing",  "amount": {    "amount": 75,    "currency": "USD"  }}
order.succeededSucceededSigned under Standard Webhooks v1, sent to your endpoint when the order ends.

From key to first order

Four steps on test money, with nothing to install. Each opens its page in the docs, with the code and what you should see.

  1. Create a test key

    Sign up, name your workspace and create a key. It works only with test money, and its secret is shown to you once.

  2. Add test funds

    Put test money on your balance. Nothing real moves in the sandbox.

  3. Look up the recipient

    Find the Telegram account at a username, and let your customer confirm it.

  4. Place one order

    Order Stars or Premium, and receive a signed event when the order ends.

Then, for Live: ask for activation in your dashboard, create a live key and send the same request to the Live host.

Two environments, one integration

A key works only on its own host. Nothing crosses between the two.

Two environments, one integration
SandboxLive
OpensNeeds only an accountOnce your business is activated
Hosthttps://sandbox-api.nasfampay.com/v1https://api.nasfampay.com/v1
Key prefixnbk_test_nbk_live_
MoneyTest money only. No order reaches Telegram or a blockchain.Real money from your balance. A Live key needs a business activated for Live.
How to go live

Order from a quote

Quote the recipient first, then create the order from that quote, in the language and client you use. Every example is generated from the API contract.

Authorization
Your key, read from the environment. Never commit it or send it to a browser.
Idempotency-Key
One per order, reused on every retry. The same key returns the first order, never a second.
quote_id
The quote you created first. It holds its price for up to 60 seconds, and the order costs exactly that.
202 Accepted
The order finishes after the response. Read its final state, or receive the event.
POST /v1/ordersSandbox, test key
// npm install axiosimport axios from 'axios';// One key per purchase: make it once, keep it with the purchase, and send the same key on every retry.const idempotencyKey = process.env.IDEMPOTENCY_KEY;if (!idempotencyKey) throw new Error('Set IDEMPOTENCY_KEY once for this purchase (a new UUID) and keep it for every retry');try {  const { status, data: order } = await axios.post(    'https://sandbox-api.nasfampay.com/v1/orders',    {      quote_id: 'quo_01K7SAMP000000000000000001',      reference: 'INV-1001',    },    {      headers: {        Authorization: `Bearer ${process.env.NASFAM_SANDBOX_KEY}`,        'Idempotency-Key': idempotencyKey,      },    },  );  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})`);}

Examples in Node.js, TypeScript, Python, PHP, cURL.

Every request follows four rules

Learn them once, and every operation behaves the way you expect.

  • Authentication

    One bearer key per environment, sent on every request.

    Read authentication
  • Idempotency

    Retry any request, including one that changes your balance, without ever paying twice.

    Read idempotency
  • Errors

    Every error is a problem document with a stable code, its usual cause and how to recover.

    Read errors
  • Rate limits

    What the API does when you send too much, and how to back off.

    Read rate limits

Questions developers ask

Anything else is in the docs, or ask us through the contact page.

Is there a sandbox?
Yes. A test key works only on the sandbox host, with test money, and no order reaches Telegram. You can make a test order succeed, fail or come back unclear. Test scenarios
Which languages have examples?
Every example is generated from the API contract, in each language and HTTP client the docs offer, Node.js with Axios first. The request above shows them all.
Is there an OpenAPI document?
Yes. The contract the API answers is published as an OpenAPI file, ready to import into an API client or to generate one from. openapi.json
Are webhooks signed?
Yes. Every event is signed under Standard Webhooks v1, so your endpoint can check it came from us before acting on it. Webhooks
Is Nasfam Business affiliated with Telegram?
No. Nasfam Business is an independent service and is not affiliated with Telegram.

In the docs

Every page also answers as Markdown, for you or for the assistant you work with.

Make your Sandbox key and send a first request.

Keys are made in your dashboard and the secret is shown once. Sandbox runs on test money.