Skip to content

Build with Nasfam Business

Order digital products, fund your balance with crypto, and follow every order, through one API.

Nasfam Business lets you order digital products for your customers, fund your balance with crypto, and follow every order to its end, through one integration.

It is for businesses that would otherwise integrate each provider themselves, reconcile funding by hand, and chase delivery status order by order.

This documentation is generated from contract 1.0.0-draft.10, so an endpoint, field or code on these pages exists in the contract.

What you can build

Digital Commerce APIs. Sell and deliver digital products without integrating each provider yourself.

ServiceAvailabilityWhat it does
Telegram StarsAvailableResolve a username and let your customer confirm the account, order an amount of Stars, and follow the order to its end.
Telegram PremiumAvailableThe same flow for 3, 6 or 12 months. In Live, for a workspace allowed to buy it.
QuotesAvailableCheck a recipient and hold a price for up to 60 seconds.
Order managementAvailableCreate, find and reconcile orders, with one order per idempotency key.
Delivery status and webhooksAvailableRead an order, or receive a signed event when it changes.
Other digital productsPlannedGET /products lists what can be ordered. The contract names two products.

Blockchain Infrastructure APIs. Blockchain services through the same integration, as each one opens.

ServiceAvailabilityWhat it does
Reference rates and USD pricesAvailableA price book in USD, and the reference rates a quote is priced at.
Crypto Payouts APISandboxSend crypto from your USD balance to an approved wallet, checking the address against its network's rules first, through the same account and integration. The sandbox simulates it once Nasfam switches it on there. Live: not yet available.

Availability labels

LabelWhat it means
AvailableLive and verified in production.
SandboxBuilt for the sandbox, on synthetic money. Not live.
BetaAvailable, and still being tested.
Coming soonAnnounced. Not available yet.
PlannedOn the roadmap, with no launch date.

How it works

  1. Create a workspace and an API key in your dashboard.
  2. Fund your account with crypto. Once your deposit is verified, your available balance is updated. In the sandbox it holds test money.
  3. Quote a recipient, then create an order. Its amount is held on your balance before the response is sent.
  4. Follow the order to succeeded, failed or under_review, by reading it or by webhook.

The API takes no payment from your customer. Orders are paid from your own prepaid balance. Your balance is prepaid service credits in USD. See Funding your account.

Base URL

Every path on these pages is relative to the host of the environment your key belongs to. The examples use https://sandbox-api.nasfampay.com/v1, which takes nbk_test_ keys and holds test money only, so no example can reach a real balance. Each environment's host, keys and money are set out in Environments.

How every request works

  • Authentication. A bearer token in the Authorization header. See Authentication and keys.
  • Strict requests. An unknown request field is rejected with unknown_field.
  • Extensible responses. Ignore response fields, enum values and event types you do not know; new ones will appear.
  • Money. Every figure is exact and its field names its unit: an amount of 750 is $7.50 in cents, a _micros field is micro-dollars, a _usd field is the same figure as a dollar string. Never read one unit as another. Money fields lists them.
  • Idempotency. A request that changes your balance requires an Idempotency-Key, bound permanently to the operation it creates. See Idempotency and safe retries.
  • Unknown outcomes. A timeout means unknown, never failed. Send the same request with the same key. See Recovering from failures.
  • Errors. Every error is an RFC 9457 problem with a stable code and a request_id. See Errors.
  • Lists. Newest first, paged with limit (1 to 100, default 20) and cursor; the answer carries has_more and next_cursor.
  • Ordering. Order events are ordered by the order's version, which increases by one on every state change, not by timestamps.