Recipients

Check a recipient

Changed on

Resolve a @username and check whether they can receive the requested item, before you create an order. Read-only: nothing is created or reserved.

When eligibility cannot be verified. If the check runs but cannot reach a verdict in time (a transient upstream problem), it answers a retryable 503 unavailable — retry shortly. Only when no check can run at all does it answer eligible: true with indeterminate: true: treat that as "unknown", not as "yes". Either way POST /v1/orders runs its own live check before it creates an order.

resolved is always true; a handle Telegram does not know is eligible: false with reason: not_found.

Why type is required. The check runs against the very product you intend to order, so it must know which one. Pass type: stars to resolve a Stars recipient, or type: premium to resolve a Premium-gift recipient (the Premium path also takes months — 3, 6 or 12). Always check with the same type you'll use in POST /v1/orders: a Stars check does not prove a Premium gift will be accepted, and vice-versa.

Checking the order itself (since 2.3.0). Fragment refuses some orders only once the order is opened, and only for some quantities or currencies (for example "You can buy a minimum of 12,500 stars"). A lookup of the recipient alone does not see that. Send the order you intend to place — quantity on a Stars check, payment_currency on a Premium check (with months) — and the check also opens that order at Fragment (no payment link, nothing signed) and drops it. Such a refusal comes back as eligible: false with Fragment's text in telegram_message. Nothing is created or reserved on our side either way. Check with the same quantity (or months) and payment_currency you will order with: POST /v1/orders runs this same check for the order it creates.

⚠️ A recipient who already has an active Premium subscription cannot be gifted Premium. Telegram blocks gifting a Premium subscription to anyone whose subscription is still active (for example, an annual plan that has not expired yet) — this is Telegram's restriction, not ours. The check surfaces it as eligible: false with reason: "already_subscribed" and Telegram's verbatim wording in telegram_message. The same recipient also makes POST /v1/orders fail with 422 recipient_ineligible: no order is created and you are not charged. Pre-flighting Premium recipients here is the cheapest way to tell your user before they pay.

A refusal here does not count toward the daily budget of ineligible-recipient refusals that POST /v1/orders keeps per tenant.

Rate limit: this endpoint carries a tighter per-tenant cap of 60 requests/min (in addition to the standard per-tenant budget), because each call performs a live upstream lookup. If you exceed this, you receive a 429 and should back off for the remainder of the minute.

post/v1/recipients/check

Request

  • Base URL
    https://api.mystars.tg
  • Auth
    API key in header X-Api-Key

Request body

type'stars' | 'premium' required

The product to check — and the product you intend to order. stars resolves a Stars recipient; premium resolves a Premium-gift recipient and uses months. Must match the type you pass to POST /v1/orders; a Stars check does not prove a Premium gift will be accepted (Premium has extra eligibility rules — see the endpoint description).

months3 | 6 | 12

Only meaningful for type=premium (defaults to 3). Must be 3, 6, or 12.

quantityinteger

Optional, type=stars only: the number of Stars you intend to order (since 2.3.0). Given it, the check also opens that order at Fragment (no payment link, nothing signed), so a refusal that depends on the order rather than on the recipient — for example "You can buy a minimum of 12,500 stars" — comes back as eligible: false with Fragment's text in telegram_message. A quantity outside [50, 1000000] answers 400. Ignored for type=premium. Without it, a Stars check looks up the recipient only.

payment_currency'ton' | 'usdt_ton'

Optional: the currency you intend to pay in (since 2.3.0). A Stars check uses it together with quantity (ton if omitted) and does not open an order on it alone. A Premium check opens the order for months when it is given. Send the same value you will pass to POST /v1/orders.

Example request

{
  "recipient": {
    "username": "durov"
  }
}

Response

Resolution + eligibility result.

resolvedboolean required

Always true: the check formed a verdict. Kept for compatibility; it does NOT say the @username exists. A handle Telegram does not know is eligible: false with reason: not_found.

eligibleboolean required

Whether the recipient can receive the item.

recipient_namestring nullable

The resolved recipient's display name from Fragment, when available (best-effort) — useful to confirm you're sending to the right person. null if Fragment returned no name.

reason'already_subscribed' | 'not_found' | 'ineligible' | 'null' nullable

Permanent-rejection class, set only when eligible is false: already_subscribed, not_found, or ineligible. null when eligible.

telegram_messagestring nullable

Fragment's verbatim refusal text, when Fragment gave a refusal we recognise (for example "No Telegram users found." or "You can buy a minimum of 12,500 stars"); null otherwise: when eligible, and on a refusal Fragment did not word itself or that we do not recognise (since 2.3.0; earlier versions could pass other text through). Branch on eligible and reason, never on whether this text is present; show it to the buyer when it is.

indeterminateboolean

true when no eligibility check could run at all (no checking capacity was available) and this endpoint answered eligible: true as a permissive default, not a measurement. false on every real verdict (eligible or not). When a check runs but cannot reach a verdict, the endpoint answers a retryable 503 unavailable instead.

Treat an indeterminate response as "unknown", never as "yes": the recipient has not been checked. It is safe to proceed to POST /v1/orders (which runs its own authoritative check), but do not present it to a buyer as a confirmed-deliverable recipient.

Always present since 1.11.0. Clients written against an earlier version saw the field absent; absent and false mean the same thing.

Changes

    • info

      added the new optional request property payment_currency

    • info

      added the new optional request property quantity

    • warning

      added the new antibot_enforce_unavailable enum value to the error/code response property for the response status

    129 more changes in this revision