---
title: "Confirm and get the payment instruction"
method: POST
path: "/v1/campaigns/{id}/confirm"
tags: ["Campaigns"]
---

# Confirm and get the payment instruction

`POST /v1/campaigns/{id}/confirm`

## Request

- Base URL: `https://api.mystars.tg`
- URL: `https://api.mystars.tg/v1/campaigns/{id}/confirm`
- Auth: API key in header `X-Api-Key`

Lock the list and the price, and move the draft to `awaiting_payment`.
Rows still `pending` are billed as `unverified` (fail-open: they are
re-checked live before sending); rejected rows are excluded and never
billed. The answer says exactly what to pay: `amount` of `currency` to
`pay_to` with `memo` (the campaign id) before `expires_at`, plus the full
`payment` block (asset, decimals, smallest-unit amount, transfer kind).

The price is your wholesale terms for ONE recipient (for `star_gift`, the
list's total Stars quoted once and divided per gift, rounded up),
multiplied by the deliverable count (`ok` + `unverified`). A list with
nothing deliverable answers `409 conflict`. Confirming again while
`awaiting_payment` returns the same instruction. Where USDT payments are
not offered, confirming a `usdt_ton` campaign answers
`422 currency_not_available`, even when the campaign is already
awaiting payment.

`422 product_not_available` for a `star_gift` campaign: the gift is no
longer sendable (sold out or withdrawn since the draft), or it is a
limited gift with fewer copies left than the recipients this confirm
would bill (`ok`, `unverified` and still `pending` rows; the message
names both numbers). `503 unavailable`: no delivery capacity is
available right now, or — for a `usdt_ton` Stars or Premium campaign —
no live price source.
`503 gift_catalog_unavailable`: the star-gift catalog cannot be read
right now. Nothing is locked on a refused confirm. A `503` is
retryable. A `422` is not: for a gift that is no longer sendable,
create a new campaign with another gift; for too few copies, cancel
the draft and create one with at most the remaining copies.

**Payment.** One on-chain transfer, matched by memo, with the same
−1% … +2% tolerance as an order. A payment outside it still funds
`floor(received / unit_price)` recipients in submission order; the rest
are skipped `insufficient_payment` and their value is returned in the
settlement reversal. A payment that funds nobody ends the campaign
`failed` with a full reversal.

**Pay only a campaign that reads `awaiting_payment`, before its
`expires_at`, in the asset of its `payment` block, with the memo.** A
transfer that does not fit is never credited to the campaign. It is
returned to the address it came from, in the asset received, minus the
reversal fee (currently 0.01 GRAM for GRAM; for USDT, the USDT value of
0.15 GRAM at the current rate, or 0.30 USDT when no rate is available).
Amounts below 0.1 GRAM or 0.5 USDT, or that the fee would consume
entirely, are not returned. A transfer sent from a smart contract
rather than a plain wallet (a DEX, for example) is not returned
automatically; it is returned by hand after review. These figures may
change. The cases:

- **Before confirm** (a `draft`, whose id is already the memo) — the
  draft is unchanged; confirm it, then pay the instruction it returns.
- **After you cancelled** — the campaign stays `cancelled`.
- **After it expired** — the campaign stays `expired`; create a new one.
  A payment that lands just after `expires_at`, before the campaign has
  turned `expired`, may still be credited.
- **In the other asset** (for example USDT to a `ton` campaign) — not
  converted; the campaign is still `awaiting_payment` and can be paid
  correctly until `expires_at`.
- **A second payment** to a campaign that is already paid.
- **Without the memo** — it matches no campaign.

These returns are separate from the campaign's own settlement reversal:
they do not appear in its `reversal_tx`. If one has not arrived, contact
support with the `campaign_id` and the transaction hash.

`403 tenant_review_required`: new confirms are paused while your account
is under review; existing campaigns and direct orders are unaffected.
Contact support.

## Path parameters

- `id` string, uuid, required

## Response `200`

The list and price are locked; pay before `expires_at`.

- CampaignConfirmation
  - `campaign_id` string, uuid, required
  - `status` 'awaiting_payment', required
  - `recipient_count` integer, required
  - `unit_price` string, required
  - `amount` string, required: The total to pay, decimal string in `currency`.
  - `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`.
  - `pay_to` string, required: The address to pay.
  - `memo` string, required: The comment the payment must carry (the campaign id).
  - `expires_at` string, date-time, required
  - `payment` CampaignPaymentInstruction, required: How to pay a confirmed campaign: send EXACTLY `amount_smallest_unit` of `asset` to `pay_to_address` with `memo` (the campaign id) as the comment (`native`) or the jetton forward-payload comment (`jetton`).
    - `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`.
    - `chain` string, required
    - `pay_to_address` string, required
    - `memo` string, required: The campaign id.
    - `amount` string, required: Decimal string in `asset`.
    - `amount_smallest_unit` string, required: Integer string — nano-GRAM or micro-USDT.
    - `asset` 'GRAM' | 'USDT', required
    - `decimals` 9 | 6, required
    - `transfer` 'native' | 'jetton', required
    - `jetton_master` string, nullable, required

## Other responses

- `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.
- `404`: No such resource for this tenant (another tenant's id is also `404`).
- `409`: The request conflicts with the resource's state or with an earlier request: `idempotency_conflict`, `idempotency_in_flight` (with `Retry-After`), `conflict` (also an order `Idempotency-Key` reused with a different body, or an order cancel in a status other than `awaiting_payment`), or a giveaway refusal with its own code (`funding_received`, `use_close`, `limit_reached`, `attestations_frozen`, `attestation_limit_reached` with `limit`, `funding_order_open_in_other_currency` with `currency`, …).
- `413`: The request body is larger than 256 KB (`bad_request`, `request body too large`).
- `415`: A request body was sent with a `Content-Type` other than `application/json` (a missing one included), or with an unsupported charset or `Content-Encoding` (`bad_request`). A POST without a body needs no `Content-Type`.
- `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`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/changes/v1/campaigns/:id/confirm/post.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)
