---
title: "Quote a price"
method: GET
path: "/v1/pricing"
tags: ["Pricing"]
---

# Quote a price

`GET /v1/pricing`

## Request

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

Get a quote for an item in a payment currency. The `amount` is the full,
all-in total you'll send on-chain (in `currency`) — there's nothing else to
add.

The quote echoes back **what it priced** — `type` plus `quantity` (for
Stars) or `months` (for Premium); the field that doesn't apply is `null` —
so the `amount` is self-describing and you never have to correlate it to your
request.

The response also carries `quoted_at` + `valid_until` (a re-quote hint —
the price tracks the market and is recomputed about every minute; it is
locked only when you create an order) and `usdt_per_ton` (the current
public GRAM↔USDT rate, for your own conversion; `null` if
momentarily unavailable).

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

## Query parameters

- `type` 'stars' | 'premium', required
- `quantity` integer
- `months` 3 | 6 | 12
- `payment_currency` 'ton' | 'usdt_ton', required: The asset the order is paid in. `ton` = the native coin GRAM (ex TON), sent as a plain transfer — it is not USDT on TON. `usdt_ton` = USDT (TON), sent as a jetton transfer. Required on every create and pricing request: a request without it is rejected with `400 bad_request`.

## Response `200`

A price quote.

- Quote
  - `type` 'stars' | 'premium', required: The product this quote priced — echoed back from your request.
  - `quantity` integer, nullable, required: The number of Stars priced (when `type=stars`); `null` for Premium.
  - `months` integer, nullable, required: The Premium subscription length in months priced (when `type=premium`); `null` for Stars.
  - `amount` string, required: The full, all-in total to pay, as a decimal string in `currency`. Nothing else to add — send exactly this amount on-chain.
  - `currency` 'ton' | 'usdt_ton', required: The asset the order is paid in. `ton` = the native coin GRAM (ex TON), sent as a plain transfer — it is not USDT on TON. `usdt_ton` = USDT (TON), sent as a jetton transfer. Required on every create and pricing request: a request without it is rejected with `400 bad_request`.
  - `fee` FeeBreakdown, nullable, required: Itemisation of the `usdt_ton` processing fee that is ALREADY part of the all-in amount. `subtotal + processing_fee == total == amount`. Pass-through network cost only — it does not reveal our cost basis or markup. It takes one of two forms, named by `kind`: a swap-backed fee (the 1% DEX swap fee plus GRAM swap gas) or, for an order settled without a swap, network gas alone. Only `total` (= `amount`) is binding — the `subtotal`/`processing_fee` split is informational and may shift by a cent with the live FX rate.
    - `subtotal` string, required: The item price before the processing fee, as a decimal string (USDT).
    - `processing_fee` string, required: The pass-through network cost, rounded up to the cent, as a decimal string (USDT) — the 1% DEX swap fee plus GRAM swap gas for a swap-backed order, or network gas alone for an order settled without a swap.
    - `total` string, required: subtotal + processing_fee — equals `amount`. Decimal string (USDT).
    - `description` string, required: Human-readable label for the fee components — for example "1% swap + 0.5 GRAM gas" for a swap-backed fee, or "TON network gas" for a fee that is network gas alone. A label for display; do not parse it — branch on `kind`.
    - `kind` 'swap' | 'network', required: Machine-readable fee form. `swap` — a swap-backed fee (the 1% DEX swap fee plus GRAM swap gas); `network` — network gas alone, for an order settled without a swap. Use it to choose your own wording for the fee.
    - `currency` 'usdt', required: The unit of the fee amounts (always `usdt`).
  - `usdt_per_ton` string, nullable, required: The current indicative USDT per 1 GRAM (the field name `usdt_per_ton` is frozen for wire compatibility) — public market data you can use to convert GRAM↔USDT in your own interface. `null` if the rate is momentarily unavailable. This is NOT the amount you pay (that is `amount`); it is informational only.
  - `quoted_at` string, date-time, required: Server timestamp (ISO 8601) when this quote was computed.
  - `valid_until` string, date-time, required: A RE-QUOTE HINT (ISO 8601): the price tracks the market and is recomputed about every minute, so re-fetch after this time. It is **not** a price lock — the price is locked only when you create an order (`POST /v1/orders`), which fixes the amount for the order's payment window. Read `expires_at` on the order for that deadline — it is authoritative; do not assume a fixed duration.

## Other responses

- `400`: Malformed request (`bad_request`): a missing or invalid field, header or query parameter (the `message` names it), a malformed `cursor`, a body that is not valid JSON, or a body nested deeper than 64 levels. Send integer query parameters as plain decimal digits: the pricing, order, giveaway and series routes refuse any other spelling (a sign, decimal point, exponent, hex prefix or surrounding spaces) with a `400` naming the parameter. Fix the request; retrying it unchanged gets the same answer.
- `401`: Missing or invalid `X-Api-Key`.
- `403`: The API key is valid, but the tenant is suspended (for example after `/api_revoke` — run `/api_rotate` in the bot to restore access) or banned, or the product (campaigns, giveaways) is not enabled for it. Products are enabled per tenant on request. A source address blocked at our edge gets `403 forbidden` with the message `source blocked`, whatever the key.
- `422`: The request is well-formed but cannot be served: `recipient_ineligible` (order create: the recipient cannot receive the item, and no order is created), `product_not_available`, `currency_not_available` (the currency is not offered on this service; nothing is created), `channel_checks_failed` (with `checks`), `schedule_out_of_bounds` (with `bound` and `limit`) or `unprocessable`.
- `429`: A rate limit was reached (`rate_limited`). See **Rate limits** in the overview. Which `429`s carry headers: - **Per-minute buckets** — the general request budget, the order-lifecycle bucket, the pricing/recipient-check probe cap (60 req/min), the campaign bucket, and your giveaway read, write, quote and attestation buckets. Every answer metered by one carries `RateLimit-Policy`, `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds); a `429` adds `Retry-After` (seconds). - **Caps, no `Retry-After`** — the daily intake cap and the daily order cap on `POST /v1/orders` (UTC day), the per-recipient guard on unfinished orders to one `@username`, and the cap on live campaigns. These `429`s carry no `Retry-After`, but they do carry the `RateLimit-*` headers of the per-minute bucket the request passed (often with `RateLimit-Remaining` above zero): branch on `Retry-After`, never on `RateLimit-Remaining`. Back off; the daily intake and order caps clear at the next UTC midnight. - **The daily budget of ineligible-recipient refusals** on `POST /v1/orders` — its `429` carries `Retry-After` and `error.retry_after`, both the seconds until 00:00 UTC, when the budget resets, plus the `RateLimit-*` headers of the order bucket it passed. `error.retry_after` is what sets it apart from the other `429`s. While the budget's places are held only by your own checks still running, the create answers a short `429` instead: `Retry-After` of a few seconds and no `error.retry_after` — retry after `Retry-After`. - **The giveaway quote budget shared by all tenants** — its `429` carries `Retry-After` (seconds until the shared budget reopens) and the `RateLimit-*` headers of your own quote bucket, never figures for the shared budget. - **Edge throttle** — a coarse per-IP throttle in front of the API answers the same envelope with `Retry-After: 1` and no `RateLimit-*` headers.
- `503`: A required source was temporarily unavailable (`unavailable`): the price source, recipient eligibility that could not be verified right now, the payment check a cancel runs first, or (order create, rarely) no fulfilment capacity assigned to your tenant right now. The `message` is generic (`internal error`), so it does not say which: treat every `unavailable` as **retryable** — reuse the same `Idempotency-Key` and try again shortly. An app `503 unavailable` creates and cancels nothing and charges nothing. If `503 unavailable` on order create persists, contact support with the `X-Request-ID`. The edge's own `502`, `503` and `504` (the service restarting or timing out) answer the same envelope with `unavailable`, and may follow a request that did land: retry with the same `Idempotency-Key`, and an order create that landed is replayed, never duplicated. On the campaign, gift and giveaway routes a `503` may also be a gift catalog that cannot be read right now (`gift_catalog_unavailable` — retry later) or an option that is not enabled for your tenant yet (`prize_type_unavailable`, `partner_conditions_unavailable`, `antibot_enforce_unavailable`, `autopost_unavailable`, `series_unavailable` — do not retry, ask support); the `code` says which.

## Changes

- **2026-10-31** `9f589c4dd26b`: 124 warning, 46 info
  - added the new `antibot_enforce_unavailable` enum value to the `error/code` response property for the response status `400`
  - added the new `antibot_enforce_unavailable` enum value to the `error/code` response property for the response status `401`
  - added the new `antibot_enforce_unavailable` enum value to the `error/code` response property for the response status `429`
  - added the new `antibot_enforce_unavailable` enum value to the `error/code` response property for the response status `503`
  - …166 more
- **2026-09-28** `6ebdc05ab41d`: 1 breaking, 2 info
  - the `query` request parameter `payment_currency` became required
  - the `currency` response's property default value `ton` was removed for the status `200`
  - added the required property `fee/oneOf[#/components/schemas/FeeBreakdown]/kind` to the response with the `200` status

[Operation history](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/changes/v1/pricing/get.md)

---

[API](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api.md) - [All operations](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/revisions/b6cdc8aff8c2?raw)
