К содержанию
TelegaFirst

Для AI-агентов: markdown этой страницы — /docs/mcp-orders.mdиндекс документации — /llms.txt

MCP: orders

Обновлено

Определения инструментов. Обновляйте tools/list после изменения прав. required_scopes: ALL.

cancel_subscription

Cancel a buyer's subscription. subscription_id is the subscription number (its seq_num), the `subscription_id` get_subscription_status returns. Renewal stops, the buyer keeps access until the end of the paid period and is told about the cancellation. A subscription cancelled before answers outcome already_cancelled, an expired one already_ended; both change nothing.

Scopes (ALL): ["orders:status"]. Risk: "destructive".

Вход, результат и права

create_order

Accept the six-field signed quote returned by quote_order. Pass a new idempotency_key to dedupe retries; PRICE_CHANGED returns a fresh quote.

Scopes (ALL): ["orders"]. Risk: "write".

Вход, результат и права

execute_delivery_quote

Send the prepared delivery quote to the buyer. Refused when the request moved after the preparation. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

execute_manual_sale

Create the unpaid order in the in-progress (taken) stage and send its card to the buyer; settlement is required with manual: the order is created and the payment is recorded asynchronously, after the order is created — read the order to see it paid. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

execute_order_composition_change

Apply the prepared order composition change; the order total, the buyer's order card and an unpaid payment link follow the new composition. Refused when the order changed, closed or was paid, or its recomposed total differs from the reviewed one, since preparation — prepare the change again. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

execute_order_status_change

Execute the prepared order status change and buyer notification. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["orders:status"]. Risk: "write".

Вход, результат и права

execute_preselection_card

Send the prepared card to the buyer's chat; the answer's id is the card's «П-N». The buyer's opening of the card starts the checkout. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

execute_refund

Run the approved refund by action_id from prepare_refund. Answers the state of the approval (pending_approval, denied, expired, used) until the owner approves; once approved it refunds and answers executed with the amount. Call it again to read the state; the money moves once.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

execute_send_invoice

Issue payment for the prepared order: provider links on its order card when the buyer has a receipt contact (delivery queued), otherwise delivery order_page — the buyer gives the contact on the order page. Manual, invoice, deferred and online-prepay orders are issued; an order paid on site or owing nothing is refused — record its payment with mark_paid. A prepared reissue reissues the invoice: the buyer gets a new one for the current sum and the earlier payment links stop working. When the order's invoice changed since preparation (it was sent, reissued or paid in between), nothing is sent and the call is refused with INVOICE_CHANGED: prepare again. Call this tool only after final human confirmation of the prepared scenario.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

extend_personal_offer

Give a live personal offer a later term: id is the offer number «П-N» (its seq_num), expires_at is the new term — later than the current one and at most 30 days after the offer was created. The buyer's card shows the new term. An offer that is accepted, expired or revoked cannot be extended.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

get_customer

Read one customer by `id`, the per-tenant customer id. Each customer is the full card: names, username, channel and channel_user_id, language, email, phone, premium, chat status, ban and restriction, AI coach access, tags, payment and referral counters, partner_id (partner program) and inviter_id (who invited them), marketing_consent (false = refused advertising, excluded from broadcasts only), topic_url, invite_code and dates. include adds relations, each in its own view: orders, subscription, bookings (as booking_get_user_list) and registrations (100 at a time, newest first; pass registrations_next_cursor back as registrations_cursor for the next 100) and invite_links (the invite page of the site, `invite/index.html`, on behalf of this customer: the page address with their invite, the universal link, the mini app and the bot of each connected messenger; share these, never build one by hand; invite_links_recovery says what to do while the list is empty).

Scopes (ALL): ["orders"]. Risk: "read".

Вход, результат и права

Link a previously-anonymous order to a resolved user.

Scopes (ALL): ["orders"]. Risk: "write".

Вход, результат и права

list_customers

List customers of the current tenant in id order; pass the last id you saw as after_id for the next page. Each customer is the full card: names, username, channel and channel_user_id, language, email, phone, premium, chat status, ban and restriction, AI coach access, tags, payment and referral counters, partner_id (partner program) and inviter_id (who invited them), marketing_consent (false = refused advertising, excluded from broadcasts only), topic_url, invite_code and dates. 0-cost read.

Scopes (ALL): ["orders"]. Risk: "read".

Вход, результат и права

list_delivery_method_versions

List the stored versions of one delivery method (id), newest first: each version number with who stored it, when, and the method as it was then. Paginated by before_version (the previous page’s next_before_version). Use a version number with restore_delivery_method_version.

Scopes (ALL): ["orders:write"]. Risk: "read".

Вход, результат и права

list_delivery_quote_requests

List the live delivery quote requests (a buyer asked the business to name a delivery price). Each carries its `id`, state, the amount and term already quoted and `version`. Paginated by after_id.

Scopes (ALL): ["orders:write"]. Risk: "read".

Вход, результат и права

manage_delivery_methods

Manage the ways this business hands an order over: action list, create, update, delete or set_active. kind is pickup, included, fixed (amount and currency) or manual_quote (the business names the price per order). A paid method needs a complete tax_profile, otherwise the call is refused with DELIVERY_TAX_PROFILE_INCOMPLETE. Returns the methods with their `id`.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

mark_paid

Record an explicit manual settlement. switch_to_manual must be true; idempotency_key is required.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

prepare_delivery_quote

Prepare the delivery price for one open quote request: request_id, amount in the order currency, optional note and valid_until (default 24 hours). Returns the frozen quote and a preview for final human review; sends nothing. The buyer alone accepts a quote.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

prepare_manual_sale

Prepare a CRM order for a buyer of this tenant: user_id with lines (catalog_id, optional combination_key, quantity, optional unit price; an event ticket line may name ticket_holders, one per ticket or null; a booking service line names its booking_slot: resource_id, start_at, optional end_at, optional guests; its add-ons go in selected_options, an add-on taken more than once with its pieces in option_quantities), or a frozen registration_id. payment_mode is manual (a sale already paid outside the platform), invoice or deferred; settlement is required with manual and refused with invoice or deferred. Returns the frozen scenario for final human review; creates no order.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

prepare_order_composition_change

Prepare one change to the composition of an open, unpaid order: remove_line, set_quantity, set_line_price (final unit price as a decimal string in the order currency), add_line (a product by catalog_id) or set_variant (the line takes another variant of its product as selected_options, keeping its quantity and note, priced fresh). Address lines by the line_no the order read returns. Returns the frozen scenario — the order version it is based on, the change, the lines and totals before and after, and payment_link_reissue (an unpaid payment link is reissued for the new amount) — to show the human before calling execute_order_composition_change. An unpaid order is changed without the buyer's confirmation, and its earlier payment requests are withdrawn and issued again. Refused for a closed order; a paid order is refused with ORDER_ALREADY_PAID — a change to what was bought is a refund and a new order. Changes nothing by itself.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

prepare_order_status_change

Prepare a tenant order status change. The execution notifies the buyer through the configured status delivery slot. A comment for the operators goes through add_comment.

Scopes (ALL): ["orders:status"]. Risk: "write".

Вход, результат и права

prepare_preselection_card

Prepare a card for a buyer with positions already chosen: user_id and lines (catalog_id of a product or an event tier, optional combination_key or selected_options, quantity, optional unit_price with its currency), and the message text in the buyer's language. Add expires_at (1–30 days from now) to make it a personal offer «П-N» valid until then. A line takes unit_price only on a personal offer (expires_at), in the currency the tenant's zone quotes the position in, exact to that currency's smallest unit, and only with the price-override right; otherwise the card is refused. Returns the frozen card and a preview for final human review; sends nothing and creates no order.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

prepare_refund

Prepare a refund of one order: order_id (the order number, its seq_num) and scope full, or one line (line_no, optional quantity); optional reason. Asks the owner of the business to approve it in Telegram and returns action_id with status pending_approval; money moves only in execute_refund after the approval.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

prepare_send_invoice

Prepare invoice dispatch for a tenant-local order_id. The prepared scenario names its mode: first (the order has no invoice out) or reissue (an invoice is out and executing replaces it: the buyer gets a new one for the current sum and the earlier payment links stop working). Sends nothing until execute_send_invoice is called.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

quote_order

Evaluate direct items or an opaque Cart address into the signed quote required by create_order.

Scopes (ALL): ["orders"]. Risk: "read".

Вход, результат и права

refresh_payment_urls

Regenerate payment provider URLs for an existing order.

Scopes (ALL): ["orders"]. Risk: "write".

Вход, результат и права

restore_delivery_method_version

Put one delivery method (id) back to a stored version (version from list_delivery_method_versions). The stored copy must pass today’s rules, such as a complete tax_profile for a paid method, and becomes the next version; orders already confirmed keep their delivery price. Returns the method.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

revoke_personal_offer

Withdraw a live personal offer: id is the offer number «П-N» (its seq_num), the `id` that execute_preselection_card, list_personal_offers and get_personal_offer return. The buyer's card turns revoked and the offer can no longer be accepted or checked out. An offer that is accepted, expired or already revoked cannot be withdrawn.

Scopes (ALL): ["orders:write"]. Risk: "write".

Вход, результат и права

set_order_payment_type

Switch how the buyer pays an open, unpaid order: order_id is the order number (its seq_num), payment_type is manual (the buyer's card loses the payment-provider buttons and you record the payment yourself with mark_paid) or online (the provider links are issued again; needs a connected payment provider and an order card sent to the buyer). manual on an order with no card sent through the platform is refused with FAILED_PRECONDITION while the order still offers online payment. An order already on that branch answers outcome unchanged. A paid order is refused with ORDER_ALREADY_PAID.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права

unmark_paid

Reverse a manual settlement: order_id is the order number (its seq_num), payment_id is the number (its seq_num) of the payment recorded by hand that you mean to undo, as get_order lists it. That payment is cancelled by a compensating entry, never edited, the order is open and unpaid again, and the buyer's private access that payment opened is taken back unless another payment keeps it. confirm_reversal must be true. Only a payment recorded by hand (mark_paid or a manual sale) can be reversed: a provider payment is a refund (prepare_refund). A repeat with the same payment_id answers outcome already_cancelled and changes nothing, even if another payment was recorded on the order since.

Scopes (ALL): ["orders:write"]. Risk: "money".

Вход, результат и права