Skip to content

API explorer

Create an order from your dashboard with no code: in the sandbox on test money, or in Live as a real order you confirm first.

The API explorer is in your dashboard, under Developers. It opens on POST /orders: choose Stars or Premium, enter a username and how much, and read the order that comes back. Any other operation is one choice away. In the sandbox nothing real can move.

What it does

  • Opens on an order. Its first form creates one: the minimal Stars order where your dashboard serves it, otherwise the order from a quote.
  • Starts from a sample. Each form opens with the sample request these pages show, and checks your values against the contract before anything is sent. A quantity or months is also held to what GET /products serves for its product, which the page reads when it opens, so a Telegram Stars order above the range in force says to place several orders instead.
  • Asks in plain fields for the quickest requests. Check a recipient takes a username and a product; Order Telegram Stars a product, a username and a quantity; Order Telegram Premium a product, a username and months. They are offered once your dashboard serves them, and say what to fix in plain words.
  • Sends only when you press Send. Opening the page, changing a value or returning to it sends none of your requests. A read then goes at once, and changes nothing.
  • Confirms before it writes. A request that changes records or moves synthetic money asks you first, names what it charges or the deposit it simulates, and sends once.
  • Keeps one Idempotency-Key per attempt. The key is shown on the page. Each set of values sent keeps its own key. Sending the same values again reuses it, so a retry returns the same operation, even after you send other values or leave the explorer and come back. Values not sent before, or New attempt, make a new one. An order form keeps one key per purchase, whatever you change before a retry, and New purchase makes a new one.
  • Holds the key in memory only. Reloading or closing the dashboard, or signing out, lets it go. After that, check your records before you send a change again: it goes with a new key.
  • Never sends again for you. A conflict on the key, a request still being processed under its key, an answer still in progress and no answer at all are each said plainly, and nothing is retried.
  • Shows you the code. The same request in cURL, Node.js and Python against the public API, written from the contract, with the key read from NASFAM_SANDBOX_KEY, so you can run it with your own key. The Schema tab is what the contract accepts.

In Live

With Live chosen, the explorer does one thing: it places a real order, paid from your Live balance and delivered to Telegram. Only an Owner or Admin can. It is marked as real money on every step.

  • The price first. Get the price asks the server for this order's price, which holds briefly. It moves no money. The page shows the price beside your available balance, and says so when the balance looks too low.
  • Confirm, then send. Review and place order asks you first, names the price on its button, and sends only once you tick that you understand it is a real order. Nothing is sent when the page opens.
  • One Idempotency-Key per order. The key and a reference are made with the price and shown before you press anything. Pressing again while the order is on its way sends nothing.
  • The real answer, then the status. You see what Live answered, with its request id. Once the order exists, Check status reads it back; only succeeded means delivered.
  • Honest when it goes wrong. A refusal such as insufficient_funds says that no order was made and nothing was held. No answer means the outcome is unknown, never failed: Send this order again sends the same order with the same key, and a new order waits until you know.

Limits

In the sandbox it offers what the sandbox serves. In Live it places orders only, from a price the server set. The preview of the dashboard has no Live backend, so it sends nothing there and never shows a Live answer.