{"components":{"schemas":{"AcceptedBody":{"additionalProperties":false,"properties":{"accepted":{"description":"Always true: the request was stored, or was a repeat or a bot and is treated as stored","type":"boolean"}},"required":["accepted"],"type":"object"},"AcceptedOutBody":{"additionalProperties":false,"properties":{"run_id":{"description":"Identifies the run in the run_started event of the stream","type":"string"}},"required":["run_id"],"type":"object"},"Access-product-compRequest":{"additionalProperties":false,"properties":{"days":{"format":"int64","maximum":365,"minimum":1,"type":"integer"},"mode":{"description":"Default live","enum":["live","test"],"type":"string"},"subscriber_id":{"description":"sbr_... or cnt_...","type":"string"}},"required":["subscriber_id","days"],"type":"object"},"Access-product-remove-subscriberRequest":{"additionalProperties":false,"properties":{"mode":{"description":"Default live","enum":["live","test"],"type":"string"},"note":{"description":"Why: kept for the subscriber card, never sent to the person","maxLength":300,"type":"string"},"subscriber_id":{"description":"sbr_... or cnt_...","type":"string"}},"required":["subscriber_id"],"type":"object"},"Access-product-start-link-rotateRequest":{"additionalProperties":false,"properties":{"mode":{"enum":["live","test"],"type":"string"}},"required":["mode"],"type":"object"},"Access-start-link-createRequest":{"additionalProperties":false,"properties":{"mode":{"enum":["live","test"],"type":"string"},"product_id":{"description":"prd_...","type":"string"}},"required":["product_id","mode"],"type":"object"},"AccessView":{"additionalProperties":false,"properties":{"status":{"description":"The payment's status; keys come only once it is paid.","type":"string"},"students":{"items":{"$ref":"#/components/schemas/StudentKeyView"},"type":"array"}},"required":["status","students"],"type":"object"},"AccountHealth":{"additionalProperties":false,"properties":{"checked_at":{"format":"date-time","type":"string"},"id":{"description":"kac_...","type":"string"},"is_default":{"type":"boolean"},"last_error":{"type":"string"},"phone_last4":{"type":"string"},"state":{"enum":["login_pending","active","degraded","expired","reauth_required","disabled"],"type":"string"}},"required":["id","phone_last4","state","is_default"],"type":"object"},"AccountListOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/AccountView"},"type":["array","null"]}},"required":["data"],"type":"object"},"AccountView":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","type":"string"},"id":{"description":"Account id (kac_...)","type":"string"},"is_default":{"type":"boolean"},"last_checked_at":{"format":"date-time","type":"string"},"last_error":{"type":"string"},"login_expires_at":{"format":"date-time","type":"string"},"org_bin":{"type":"string"},"org_name":{"type":"string"},"phone_last4":{"type":"string"},"state":{"enum":["login_pending","active","degraded","expired","reauth_required","disabled"],"type":"string"}},"required":["id","phone_last4","state","is_default","created_at"],"type":"object"},"ActionFieldView":{"additionalProperties":false,"properties":{"description":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}},"required":["name","kind","required","description"],"type":"object"},"ActionRunView":{"additionalProperties":false,"properties":{"attempts":{"format":"int64","type":"integer"},"finished_at":{"format":"date-time","type":"string"},"index":{"format":"int64","type":"integer"},"next_attempt_at":{"description":"Set while another attempt is scheduled.","format":"date-time","type":"string"},"result":{"description":"The outcome class of the last attempt: ok, http_3xx, http_4xx, http_410, http_5xx, timeout, dns, connection_refused, tls, blocked_address, network, invalid_url, skipped, ...","type":"string"},"started_at":{"format":"date-time","type":"string"},"status":{"enum":["pending","running","succeeded","failed","dead","skipped"],"type":"string"},"type":{"type":"string"},"unsigned":{"description":"true when this call_webhook was sent without a signature (saved with unsigned: true).","type":"boolean"}},"required":["index","type","status","attempts"],"type":"object"},"ActionTypeView":{"additionalProperties":false,"properties":{"available":{"type":"boolean"},"description":{"type":"string"},"fields":{"items":{"$ref":"#/components/schemas/ActionFieldView"},"type":"array"},"stage":{"description":"For an unavailable action: the delivery stage that brings it.","type":"string"},"type":{"type":"string"}},"required":["type","description","available","fields"],"type":"object"},"ActivityItem":{"additionalProperties":false,"properties":{"amount":{"description":"Tiyn, for an order or a payment","format":"int64","type":"integer"},"at":{"format":"date-time","type":"string"},"detail":{"description":"A short fact: the form, the consent purpose, the order status, \"renewal\"","type":"string"},"kind":{"type":"string"},"ref":{"description":"The object's uuid, for a link to its page","type":"string"},"ref_kind":{"enum":["store","course","channel","link","order"],"type":"string"},"title":{"description":"What it concerns: the store, the plan, the course, the payment link","type":"string"}},"required":["at","kind"],"type":"object"},"ActivityView":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/ActivityItem"},"type":"array"}},"required":["data"],"type":"object"},"AddChannelRequest":{"additionalProperties":false,"properties":{"chat":{"description":"The channel or supergroup: @username, t.me/username, https://t.me/username or the numeric chat id. The bot must be an administrator there with the rights to invite users and to ban members.","maxLength":120,"minLength":2,"type":"string"}},"required":["chat"],"type":"object"},"AgentAccepted":{"additionalProperties":false,"properties":{"run_id":{"description":"The run started (uuid); its events carry it","type":"string"},"thread_id":{"description":"uuid","type":"string"}},"required":["run_id","thread_id"],"type":"object"},"AgentActionView":{"additionalProperties":false,"properties":{"approval_id":{"description":"apr_..., while or after the action waits for approval; approve it with POST /approvals/{id}/approve","type":"string"},"created_at":{"format":"date-time","type":"string"},"error":{"description":"Why it failed, in Russian","type":"string"},"id":{"type":"string"},"object":{"$ref":"#/components/schemas/AgentObjectView","description":"The object it created or changed; absent when none"},"risk":{"enum":["read","create","change","publish","broadcast","money"],"type":"string"},"run_id":{"type":"string"},"seq":{"description":"Order of the call within its run","format":"int64","type":"integer"},"status":{"enum":["running","done","failed","proposed","approved","rejected","executed"],"type":"string"},"summary":{"description":"What the call does or did, in Russian","type":"string"},"tool":{"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","run_id","seq","tool","risk","status","summary","created_at","updated_at"],"type":"object"},"AgentChecklistItemView":{"additionalProperties":false,"properties":{"key":{"enum":["kaspi","legal_profile","offer","site","bot","channel","delivery","test_purchase"],"type":"string"},"path":{"description":"The cabinet route that sets it up","type":"string"},"status":{"enum":["done","todo"],"type":"string"},"title":{"description":"In Russian","type":"string"}},"required":["key","title","status","path"],"type":"object"},"AgentMessageBody":{"additionalProperties":false,"properties":{"attachments":{"description":"Upload ids (upl_...) of files uploaded with POST /uploads","items":{"type":"string"},"maxItems":10,"type":["array","null"]},"text":{"description":"What the merchant asks for","maxLength":4000,"minLength":1,"type":"string"}},"required":["text"],"type":"object"},"AgentMessageView":{"additionalProperties":false,"properties":{"attachments":{"description":"Upload ids (upl_...)","items":{"type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"role":{"enum":["user","assistant","system"],"type":"string"},"run_id":{"type":["string","null"]},"text":{"description":"Secrets (bot tokens, Kaspi credentials) are redacted before storage","type":"string"}},"required":["id","role","text","run_id","attachments","created_at"],"type":"object"},"AgentObjectView":{"additionalProperties":false,"properties":{"id":{"type":"string"},"kind":{"enum":["product","course","course_module","course_lesson","deployment","start_link","site","delivery_option","payment_link"],"type":"string"},"path":{"type":"string"}},"required":["kind","id","path"],"type":"object"},"AgentRunView":{"additionalProperties":false,"properties":{"ended_at":{"format":"date-time","type":["string","null"]},"error":{"description":"Why a failed or interrupted run stopped, in Russian","type":"string"},"id":{"type":"string"},"started_at":{"format":"date-time","type":"string"},"status":{"enum":["running","done","failed","interrupted"],"type":"string"}},"required":["id","status","started_at","ended_at"],"type":"object"},"AgentThreadView":{"additionalProperties":false,"properties":{"actions":{"description":"Every journaled tool call of the thread, oldest first","items":{"$ref":"#/components/schemas/AgentActionView"},"type":"array"},"checklist":{"description":"What is set up and what the merchant still has to do, computed from the database","items":{"$ref":"#/components/schemas/AgentChecklistItemView"},"type":"array"},"id":{"type":"string"},"messages":{"description":"The last 50 messages, oldest first","items":{"$ref":"#/components/schemas/AgentMessageView"},"type":"array"},"run":{"$ref":"#/components/schemas/AgentRunView","description":"The latest run; absent before the first message"},"running":{"description":"A run is in progress","type":"boolean"}},"required":["id","running","messages","actions","checklist"],"type":"object"},"ApprovalView":{"additionalProperties":false,"properties":{"action":{"enum":["payment.refund","catalog.price_change","payments.invoice_batch","agent.apply","mcp.apply"],"type":"string"},"amount":{"description":"Money the action moves, in tiyn","format":"int64","type":"integer"},"approve_url":{"description":"Where a human approves it; only while pending","type":"string"},"attempted_at":{"description":"When the action was started at Kaspi","format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"decided_at":{"format":"date-time","type":"string"},"decided_by":{"description":"The cabinet user who decided","type":"string"},"decided_by_name":{"description":"A name for decided_by, as requested_by_name","type":"string"},"decision_note":{"type":"string"},"executed_at":{"format":"date-time","type":"string"},"expires_at":{"description":"After this a pending approval can no longer be approved","format":"date-time","type":"string"},"failure_reason":{"description":"kaspi_rejected, kaspi_unavailable (outcome unknown: check Kaspi before asking again), session_invalid, execution_interrupted (same as kaspi_unavailable), payment_not_refundable, limit_exceeded","type":"string"},"id":{"description":"Approval id (apr_...)","type":"string"},"mode":{"enum":["live","test"],"type":"string"},"object":{"enum":["approval"],"type":"string"},"params":{"description":"The action's parameters, e.g. {\"payment_id\": \"pay_...\", \"reason\": \"...\"}"},"requested_by":{"description":"Who asked: user:usr_..., key:key_..., later mcp:key_... or generator:...","type":"string"},"requested_by_name":{"description":"A name for requested_by: the member's name (else @telegram username or masked phone) or the API key's label. Absent when the requester is no longer a member or the key is gone.","type":"string"},"result":{"description":"What the action did, or Kaspi's error code"},"self_approved":{"description":"The decider is the requester","type":"boolean"},"status":{"enum":["pending","approved","rejected","expired","executed","failed"],"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","object","action","status","mode","amount","params","requested_by","self_approved","expires_at","created_at","updated_at"],"type":"object"},"Attribution":{"additionalProperties":false,"properties":{"campaign":{"type":"string"},"content":{"type":"string"},"label":{"type":"string"},"medium":{"type":"string"},"source":{"type":"string"},"term":{"type":"string"}},"type":"object"},"AuditEntry":{"additionalProperties":false,"properties":{"action":{"description":"<resource>.<verb>, e.g. member.role_changed.","type":"string"},"actor":{"description":"Who acted: user:<uuid>, key:<uuid> or system.","type":"string"},"after":{"description":"State after the change, without secrets or personal data."},"before":{"description":"State before the change, without secrets or personal data."},"created_at":{"format":"date-time","type":"string"},"id":{"description":"Journal line id (UUID).","type":"string"},"ip":{"description":"Client address the request came from.","type":"string"},"request_id":{"description":"Request id, to match the line with the access log.","type":"string"},"resource":{"type":"string"},"resource_id":{"description":"The public id of what was acted on (usr_..., key_..., ivt_...) or a UUID for a resource without one.","type":"string"}},"required":["id","actor","action","created_at"],"type":"object"},"Auth-handoff-exchangeRequest":{"additionalProperties":false,"properties":{"token":{"maxLength":100,"minLength":20,"type":"string"}},"required":["token"],"type":"object"},"Auth-handoff-startRequest":{"additionalProperties":false,"properties":{"merchant_id":{"description":"Business to open (mch_...); defaults to the cabinet's own choice","type":"string"},"path":{"description":"Cabinet path to open, like /kaspi","maxLength":200,"type":"string"}},"type":"object"},"BadgeView":{"additionalProperties":false,"properties":{"can_hide":{"description":"The current plan lets the owner switch the link off (Профессиональный, Бизнес); on the other plans it is always shown","type":"boolean"},"enabled":{"description":"The owner's choice: show the link (default true). Only effective on a plan that lets the owner hide it","type":"boolean"},"shown":{"description":"What visitors see now: false only when can_hide and not enabled","type":"boolean"}},"required":["enabled","can_hide","shown"],"type":"object"},"BillingSummaryView":{"additionalProperties":false,"properties":{"month":{"description":"The calendar month (UTC) the monthly counters are for, YYYY-MM","type":"string"},"period_end":{"description":"When the paid period ends and the default plan applies again","format":"date-time","type":["string","null"]},"period_start":{"description":"Start of the paid period; null on the default plan","format":"date-time","type":["string","null"]},"plan":{"$ref":"#/components/schemas/PlatformPlanView"},"usage":{"items":{"$ref":"#/components/schemas/PlanUsageView"},"type":"array"}},"required":["plan","period_start","period_end","month","usage"],"type":"object"},"Bitrix24-itemsResponse":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/Bitrix24ItemView"},"type":"array"}},"required":["data"],"type":"object"},"Bitrix24-retry-failedResponse":{"additionalProperties":false,"properties":{"queued":{"format":"int64","type":"integer"}},"required":["queued"],"type":"object"},"Bitrix24CheckView":{"additionalProperties":false,"properties":{"account":{"type":"string"},"admin":{"type":"boolean"},"code":{"description":"Why the test failed.","enum":["invalid_webhook","no_crm_scope","unreachable","blocked_host","throttled"],"type":"string"},"host":{"type":"string"},"ok":{"type":"boolean"},"scopes":{"items":{"type":"string"},"type":["array","null"]}},"required":["ok","host","admin"],"type":"object"},"Bitrix24ConnectRequest":{"additionalProperties":false,"properties":{"webhook_url":{"description":"The inbound webhook of your Bitrix24: https://<portal>/rest/<user_id>/<code>/ (Developer resources, Other, Inbound webhook; give it the CRM right). It is stored encrypted and never shown again.","maxLength":500,"minLength":20,"type":"string"}},"required":["webhook_url"],"type":"object"},"Bitrix24ConnectionView":{"additionalProperties":false,"properties":{"account":{"description":"The Bitrix24 user the webhook acts as.","type":"string"},"created_at":{"format":"date-time","type":"string"},"has_inbound_token":{"description":"A token for the reverse endpoint was issued.","type":"boolean"},"last_checked_at":{"format":"date-time","type":"string"},"last_sync_at":{"format":"date-time","type":"string"},"masked":{"description":"The portal and the last four characters of the webhook code: the only part of it shown.","type":"string"},"portal_host":{"type":"string"},"settings":{"$ref":"#/components/schemas/Bitrix24SettingsView"},"status":{"description":"needs_attention pauses the queue until the connection test succeeds.","enum":["active","needs_attention"],"type":"string"},"status_at":{"format":"date-time","type":"string"},"status_code":{"description":"Why: invalid_webhook, no_crm_scope, blocked_host, ...","type":"string"}},"required":["portal_host","masked","status","settings","has_inbound_token","created_at"],"type":"object"},"Bitrix24ItemView":{"additionalProperties":false,"properties":{"attempts":{"format":"int64","type":"integer"},"created_at":{"format":"date-time","type":"string"},"error_code":{"type":"string"},"error_detail":{"description":"Bitrix24's reason when it refused the item.","type":"string"},"event_type":{"type":"string"},"id":{"description":"bxs_...","type":"string"},"next_attempt_at":{"format":"date-time","type":"string"},"result":{"description":"What was written in Bitrix24, e.g. «сделка 1234».","type":"string"},"status":{"enum":["pending","failed","done","skipped","dead"],"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","event_type","status","attempts","next_attempt_at","created_at","updated_at"],"type":"object"},"Bitrix24Options":{"additionalProperties":false,"properties":{"pipelines":{"items":{"$ref":"#/components/schemas/Bitrix24Pipeline"},"type":"array"},"sources":{"items":{"$ref":"#/components/schemas/Bitrix24Source"},"type":"array"}},"required":["pipelines","sources"],"type":"object"},"Bitrix24Pipeline":{"additionalProperties":false,"properties":{"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"stages":{"items":{"$ref":"#/components/schemas/Bitrix24Stage"},"type":"array"}},"required":["id","name","stages"],"type":"object"},"Bitrix24SettingsRequest":{"additionalProperties":false,"properties":{"category_id":{"format":"int64","minimum":0,"type":"integer"},"events":{"description":"Replaces the list of synced event types.","items":{"type":"string"},"maxItems":10,"type":"array"},"responsible_id":{"format":"int64","minimum":0,"type":"integer"},"source_id":{"maxLength":50,"type":"string"},"stage_lost":{"maxLength":50,"type":"string"},"stage_new":{"maxLength":50,"type":"string"},"stage_won":{"maxLength":50,"type":"string"}},"type":"object"},"Bitrix24SettingsView":{"additionalProperties":false,"properties":{"category_id":{"description":"Deal pipeline id; 0 is the main pipeline.","format":"int64","type":"integer"},"events":{"description":"Event types pushed to Bitrix24.","items":{"enum":["lead.created","payment.success","order.paid","order.created","subscription.activated","subscription.ended","payment.refunded"],"type":"string"},"type":"array"},"responsible_id":{"description":"Bitrix24 user the new objects are assigned to; 0 is the webhook's user.","format":"int64","type":"integer"},"source_id":{"description":"SOURCE_ID of new leads and deals; empty keeps the portal's default.","type":"string"},"stage_lost":{"description":"STATUS_ID of the stage a refunded deal goes to; empty only adds a comment.","type":"string"},"stage_new":{"description":"STATUS_ID of the stage a new deal starts in (order.created); empty: the portal's default.","type":"string"},"stage_won":{"description":"STATUS_ID of the stage a paid deal goes to; empty leaves the stage alone.","type":"string"}},"required":["events","category_id","stage_new","stage_won","stage_lost","responsible_id","source_id"],"type":"object"},"Bitrix24Source":{"additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"type":"object"},"Bitrix24Stage":{"additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"semantics":{"type":"string"}},"required":["id","name","semantics"],"type":"object"},"Bitrix24StatusView":{"additionalProperties":false,"properties":{"connected":{"type":"boolean"},"connection":{"$ref":"#/components/schemas/Bitrix24ConnectionView"},"counts":{"additionalProperties":{"format":"int64","type":"integer"},"description":"Sync items by status: pending, failed, done, skipped, dead.","type":"object"},"recent":{"description":"The ten newest sync items.","items":{"$ref":"#/components/schemas/Bitrix24ItemView"},"type":"array"}},"required":["connected","counts","recent"],"type":"object"},"BotListOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/BotView"},"type":"array"}},"required":["data"],"type":"object"},"BotView":{"additionalProperties":false,"properties":{"connected_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"disconnected_at":{"format":"date-time","type":"string"},"id":{"description":"Bot id (bot_...)","type":"string"},"status":{"enum":["connected","disconnected"],"type":"string"},"telegram_bot_id":{"description":"The bot's Telegram user id","format":"int64","type":"integer"},"username":{"description":"The bot's @username, without the @","type":"string"}},"required":["id","telegram_bot_id","username","status","connected_at","created_at"],"type":"object"},"Builder-message-sendRequest":{"additionalProperties":false,"properties":{"text":{"description":"What to build or change","maxLength":4000,"minLength":1,"type":"string"}},"required":["text"],"type":"object"},"Builder-project-createRequest":{"additionalProperties":false,"properties":{"title":{"maxLength":200,"type":"string"}},"type":"object"},"Builder-project-settingsRequest":{"additionalProperties":false,"properties":{"paybot_badge":{"description":"Show the «Сделано на PayBot» link (true, default) or hide it (false, paid plans)","type":"boolean"}},"required":["paybot_badge"],"type":"object"},"BuilderVersionView":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","type":"string"},"current":{"type":"boolean"},"id":{"type":"string"},"n":{"format":"int64","type":"integer"},"published":{"type":"boolean"},"status":{"enum":["ready","needs_attention","failed"],"type":"string"},"summary":{"type":"string"}},"required":["id","n","status","summary","created_at","current","published"],"type":"object"},"CSRFBody":{"additionalProperties":false,"properties":{"csrf_token":{"type":"string"}},"required":["csrf_token"],"type":"object"},"CatalogView":{"additionalProperties":false,"properties":{"actions":{"items":{"$ref":"#/components/schemas/ActionTypeView"},"type":"array"},"limits":{"$ref":"#/components/schemas/LimitsView"},"ops":{"items":{"$ref":"#/components/schemas/OpView"},"type":"array"},"triggers":{"items":{"$ref":"#/components/schemas/TriggerView"},"type":"array"}},"required":["triggers","ops","actions","limits"],"type":"object"},"CatalogueOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/DescriptorSummary"},"type":["array","null"]}},"required":["data"],"type":"object"},"ChangeRoleInputBody":{"additionalProperties":false,"properties":{"role":{"enum":["owner","admin","viewer"],"type":"string"}},"required":["role"],"type":"object"},"ChannelListOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/ChannelView"},"type":"array"}},"required":["data"],"type":"object"},"ChannelView":{"additionalProperties":false,"properties":{"bot_id":{"description":"Bot id (bot_...)","type":"string"},"chat_id":{"description":"Telegram chat id","format":"int64","type":"integer"},"chat_type":{"enum":["channel","supergroup"],"type":"string"},"checked_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"description":"Channel id (chn_...)","type":"string"},"missing_rights":{"description":"What the last check found missing: administrator, can_invite_users, can_restrict_members.","items":{"type":"string"},"type":"array"},"product_id":{"description":"The deployment (prd_...) that sells this channel, when there is one","type":"string"},"status":{"description":"pending_confirmation: the bot was added through the connect session and waits for the merchant to confirm it; it serves nothing yet.","enum":["active","missing_rights","pending_confirmation"],"type":"string"},"title":{"type":"string"},"username":{"type":"string"}},"required":["id","bot_id","chat_id","chat_type","title","status","missing_rights","checked_at","created_at"],"type":"object"},"CheckoutBody":{"additionalProperties":false,"properties":{"amount":{"description":"Only for a payer-entered amount: tiyn, an integer, whole tenge. A priced item ignores it: the price is set by the page.","format":"int64","minimum":100,"type":"integer"},"attribution":{"$ref":"#/components/schemas/Attribution"},"item_id":{"description":"The item to buy, for a page that sells several","maxLength":64,"type":"string"},"phone":{"description":"Only when the page asks for it (an invoice to this Kaspi phone)","maxLength":20,"type":"string"},"promo_code":{"description":"A promo code: the server takes its discount off the price; a code that does not apply is a 422 on promo_code.","maxLength":40,"type":"string"}},"type":"object"},"CheckoutInBody":{"additionalProperties":false,"properties":{"periods":{"description":"How many periods to pay for (default 1)","format":"int64","maximum":12,"minimum":0,"type":"integer"},"phone":{"description":"Send a Kaspi invoice to this phone instead of a QR","maxLength":20,"type":"string"},"plan":{"description":"Plan code from GET /billing/plans","maxLength":32,"minLength":1,"type":"string"}},"required":["plan"],"type":"object"},"CheckoutView":{"additionalProperties":false,"properties":{"amount":{"description":"What the payer pays, in tiyn","format":"int64","type":"integer"},"claim_code":{"description":"Course pages only: with payment_id, claims the student key once paid (POST /v1/public/courses/access). Shown once; keep it.","type":"string"},"deep_link":{"description":"Opens the payment in the Kaspi app, when there is one","type":"string"},"expires_at":{"description":"After this Kaspi can no longer complete the payment (scan_expires_at plus the confirmation window)","format":"date-time","type":"string"},"kind":{"description":"qr: the payer scans or opens deep_link; invoice: Kaspi sends a bill to the payer's phone","enum":["qr","invoice"],"type":"string"},"payment_id":{"description":"pay_...","type":"string"},"qr_token":{"description":"Encode this into the QR image (QR payments, once pending)","type":"string"},"scan_expires_at":{"description":"After this the QR no longer scans; a page then asks for a fresh payment","format":"date-time","type":"string"},"status":{"type":"string"}},"required":["payment_id","status"],"type":"object"},"CodeView":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"code":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"expires_at":{"format":"date-time","type":"string"},"fixed_amount":{"description":"The fixed discount, for kind fixed.","format":"int64","type":"integer"},"id":{"description":"prm_...","type":"string"},"kind":{"enum":["percent","fixed"],"type":"string"},"max_uses":{"format":"int64","type":"integer"},"scope_kind":{"enum":["all","course","store","link","channel"],"type":"string"},"scope_ref":{"description":"The course id, product handle or payment link it is limited to; absent: every item of the scope.","type":"string"},"starts_at":{"format":"date-time","type":"string"},"used":{"description":"Uses that count: paid, or open for payment.","format":"int64","type":"integer"},"value":{"description":"percent: 1..99; fixed: tiyn, a whole number of tenge","format":"int64","type":"integer"}},"required":["id","code","kind","value","scope_kind","used","active","created_at"],"type":"object"},"ConditionView":{"additionalProperties":false,"properties":{"field":{"description":"An event data field from the catalog, e.g. amount or metadata.plan.","maxLength":100,"minLength":1,"type":"string"},"op":{"description":"gte and lte apply to integer fields only.","enum":["eq","neq","gte","lte","in","exists"],"type":"string"},"value":{"description":"A JSON literal of the field's kind: an integer number of tiyn for amounts, a string, an array for in, a boolean for exists."}},"required":["field","op"],"type":"object"},"Config":{"additionalProperties":false,"properties":{"bot_id":{"type":"string"},"channel_id":{"type":"string"},"messages":{"$ref":"#/components/schemas/Messages"},"more_plans":{"items":{"$ref":"#/components/schemas/PlanConfig"},"type":["array","null"]},"plan":{"$ref":"#/components/schemas/PlanConfig"},"slug":{"type":"string"},"test_mode_real_telegram":{"type":"boolean"}},"required":["bot_id","channel_id","plan","messages","test_mode_real_telegram"],"type":"object"},"ConfigView":{"additionalProperties":false,"properties":{"allowed":{"description":"The plan allows at least one domain.","type":"boolean"},"enabled":{"description":"Custom domains are configured on this server.","type":"boolean"},"ipv4":{"description":"The addresses an apex domain's A records point to.","items":{"type":"string"},"type":"array"},"ipv6":{"description":"The addresses an apex domain's AAAA records point to (optional records).","items":{"type":"string"},"type":"array"},"limit":{"description":"The plan's number of domains; null is unlimited.","format":"int64","type":["integer","null"]},"target_host":{"description":"The name a subdomain's CNAME points to.","type":"string"},"used":{"format":"int64","type":"integer"}},"required":["enabled","ipv4","ipv6","allowed","used","limit"],"type":"object"},"ConnectBotRequest":{"additionalProperties":false,"properties":{"token":{"description":"The bot token from @BotFather. It is stored encrypted and never shown again.","maxLength":300,"type":"string"}},"required":["token"],"type":"object"},"ConnectOutBody":{"additionalProperties":false,"properties":{"check":{"$ref":"#/components/schemas/Bitrix24CheckView"},"connection":{"$ref":"#/components/schemas/Bitrix24ConnectionView"}},"required":["connection","check"],"type":"object"},"ConnectedAppView":{"additionalProperties":false,"properties":{"client_name":{"description":"What the application calls itself; not verified.","type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"description":"oag_...","type":"string"},"last_used_at":{"description":"Accurate to about a minute; null if the application never called.","format":"date-time","type":["string","null"]},"mode":{"enum":["test","live"],"type":"string"},"redirect_host":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"}},"required":["id","client_name","redirect_host","mode","scopes","created_at","last_used_at"],"type":"object"},"ConsentBusinessView":{"additionalProperties":false,"properties":{"merchant_id":{"description":"mch_...","type":"string"},"name":{"type":"string"},"role":{"enum":["owner","admin"],"type":"string"}},"required":["merchant_id","name","role"],"type":"object"},"ConsentDecisionRequest":{"additionalProperties":false,"properties":{"approve":{"description":"true to allow, false to refuse.","type":"boolean"},"merchant_id":{"description":"The business to connect (mch_...); required to approve.","type":"string"},"mode":{"description":"test works on the sandbox, live on real money; required to approve.","enum":["test","live"],"type":"string"},"request":{"description":"The one-time request token from the cabinet address.","maxLength":100,"minLength":10,"type":"string"},"scopes":{"description":"Any of read, write, publish, broadcast, money; required to approve.","items":{"type":"string"},"maxItems":5,"type":["array","null"]}},"required":["request","approve"],"type":"object"},"ConsentDecisionView":{"additionalProperties":false,"properties":{"redirect_url":{"description":"Send the browser here: the application's redirect URI with code and state, or with error=access_denied.","type":"string"}},"required":["redirect_url"],"type":"object"},"ConsentPreviewRequest":{"additionalProperties":false,"properties":{"request":{"description":"The one-time request token from the cabinet address (?request=...).","maxLength":100,"minLength":10,"type":"string"}},"required":["request"],"type":"object"},"ConsentPreviewView":{"additionalProperties":false,"properties":{"businesses":{"description":"Businesses where the user is an owner or an admin.","items":{"$ref":"#/components/schemas/ConsentBusinessView"},"type":"array"},"client_name":{"description":"What the application calls itself. Not verified: anyone can register any name.","type":"string"},"default_mode":{"enum":["test","live"],"type":"string"},"default_scopes":{"description":"The scopes to preselect.","items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","type":"string"},"loopback":{"description":"The application runs on this computer (a localhost redirect): any program on it could claim to be the application.","type":"boolean"},"redirect_host":{"description":"Where the browser is sent afterwards; show it next to the name.","type":"string"},"requested_scopes":{"description":"The scopes the application asked for (it may ask for none).","items":{"type":"string"},"type":"array"}},"required":["client_name","redirect_host","loopback","requested_scopes","default_scopes","default_mode","expires_at","businesses"],"type":"object"},"ConsentView":{"additionalProperties":false,"properties":{"granted_at":{"format":"date-time","type":"string"},"purpose":{"enum":["marketing","cart_reminder","order_status","course_updates"],"type":"string"},"revoked_at":{"format":"date-time","type":["string","null"]},"source":{"type":"string"}},"required":["purpose","source","granted_at","revoked_at"],"type":"object"},"ContactDetailView":{"additionalProperties":false,"properties":{"avg_check":{"description":"paid_total / paid_count, tiyn; 0 without purchases","format":"int64","type":"integer"},"consents":{"items":{"$ref":"#/components/schemas/ConsentView"},"type":"array"},"first_seen_at":{"format":"date-time","type":"string"},"first_touch":{"$ref":"#/components/schemas/TouchView","description":"Where the client came from the first time"},"has_telegram":{"description":"The contact wrote to one of the business's bots","type":"boolean"},"id":{"description":"cnt_...","type":"string"},"last_activity_at":{"format":"date-time","type":["string","null"]},"last_paid_at":{"format":"date-time","type":["string","null"]},"last_seen_at":{"description":"Last message to a bot of the business","format":"date-time","type":["string","null"]},"last_touch":{"$ref":"#/components/schemas/TouchView","description":"Where the client came from the last time"},"leads":{"description":"Newest first, at most 50","items":{"$ref":"#/components/schemas/LeadItemView"},"type":"array"},"merged_count":{"description":"How many duplicates were merged into this client","format":"int64","type":"integer"},"name":{"type":"string"},"notes":{"type":"string"},"opted_out":{"description":"The contact asked to stop marketing messages","type":"boolean"},"paid_count":{"description":"Purchases net of refunds","format":"int64","type":"integer"},"paid_total":{"description":"Paid in total net of refunds, in tiyn (live money, from the money ledger)","format":"int64","type":"integer"},"phone":{"description":"Masked: +7 701 *** ** 67","type":"string"},"refunded_total":{"description":"Refunded in total, tiyn","format":"int64","type":"integer"},"source":{"description":"Where the contact came from: lead, access, order, course, bot, link, payment","type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"username":{"description":"Telegram username, without @","type":"string"}},"required":["notes","refunded_total","merged_count","leads","consents","id","name","source","has_telegram","opted_out","paid_total","paid_count","avg_check","first_seen_at","last_seen_at","last_paid_at","last_activity_at","tags"],"type":"object"},"ContactMergeInBody":{"additionalProperties":false,"properties":{"with":{"description":"cnt_... the duplicate to merge in","type":"string"}},"required":["with"],"type":"object"},"ContactPatchInBody":{"additionalProperties":false,"properties":{"name":{"maxLength":64,"type":"string"},"notes":{"maxLength":2000,"type":"string"},"tags":{"description":"The whole list of tags; each 1 to 32 characters","items":{"type":"string"},"maxItems":20,"type":"array"}},"type":"object"},"ContactView":{"additionalProperties":false,"properties":{"avg_check":{"description":"paid_total / paid_count, tiyn; 0 without purchases","format":"int64","type":"integer"},"first_seen_at":{"format":"date-time","type":"string"},"first_touch":{"$ref":"#/components/schemas/TouchView","description":"Where the client came from the first time"},"has_telegram":{"description":"The contact wrote to one of the business's bots","type":"boolean"},"id":{"description":"cnt_...","type":"string"},"last_activity_at":{"format":"date-time","type":["string","null"]},"last_paid_at":{"format":"date-time","type":["string","null"]},"last_seen_at":{"description":"Last message to a bot of the business","format":"date-time","type":["string","null"]},"last_touch":{"$ref":"#/components/schemas/TouchView","description":"Where the client came from the last time"},"name":{"type":"string"},"opted_out":{"description":"The contact asked to stop marketing messages","type":"boolean"},"paid_count":{"description":"Purchases net of refunds","format":"int64","type":"integer"},"paid_total":{"description":"Paid in total net of refunds, in tiyn (live money, from the money ledger)","format":"int64","type":"integer"},"phone":{"description":"Masked: +7 701 *** ** 67","type":"string"},"source":{"description":"Where the contact came from: lead, access, order, course, bot, link, payment","type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"username":{"description":"Telegram username, without @","type":"string"}},"required":["id","name","source","has_telegram","opted_out","paid_total","paid_count","avg_check","first_seen_at","last_seen_at","last_paid_at","last_activity_at","tags"],"type":"object"},"Course-access-claimRequest":{"additionalProperties":false,"properties":{"claim_code":{"description":"claim_code from the checkout answer; with the payment id it is the proof of purchase","maxLength":64,"type":"string"},"payment_id":{"description":"pay_..., from the checkout answer","maxLength":64,"type":"string"}},"required":["payment_id","claim_code"],"type":"object"},"Course-createRequest":{"additionalProperties":false,"properties":{"description":{"maxLength":2000,"type":"string"},"title":{"maxLength":200,"minLength":1,"type":"string"}},"required":["title"],"type":"object"},"Course-enrollment-extendRequest":{"additionalProperties":false,"properties":{"days":{"format":"int64","maximum":3650,"minimum":1,"type":"integer"}},"required":["days"],"type":"object"},"Course-learn-exchangeRequest":{"additionalProperties":false,"properties":{"code":{"description":"The c= value of the player address","maxLength":64,"type":"string"}},"required":["code"],"type":"object"},"Course-lesson-attachment-uploadRequest":{"additionalProperties":false,"properties":{"content_type":{"maxLength":200,"type":"string"},"file_name":{"maxLength":200,"type":"string"},"size":{"format":"int64","minimum":1,"type":"integer"}},"required":["content_type","size"],"type":"object"},"Course-lesson-orderRequest":{"additionalProperties":false,"properties":{"lesson_ids":{"description":"Every lesson of the module, once, in the new order.","items":{"type":"string"},"maxItems":500,"type":["array","null"]}},"required":["lesson_ids"],"type":"object"},"Course-lesson-upload-confirmRequest":{"additionalProperties":false,"properties":{"file_key":{"description":"file_key from the upload answer.","maxLength":512,"type":"string"}},"required":["file_key"],"type":"object"},"Course-lesson-uploadRequest":{"additionalProperties":false,"properties":{"content_type":{"description":"One of the allowed types, e.g. application/pdf, video/mp4.","maxLength":200,"type":"string"},"duration_seconds":{"description":"Video length when the client knows it.","format":"int64","maximum":86400,"minimum":1,"type":"integer"},"file_name":{"description":"Name students download it as.","maxLength":200,"type":"string"},"size":{"description":"Exact size in bytes.","format":"int64","minimum":1,"type":"integer"}},"required":["content_type","size"],"type":"object"},"Course-login-startRequest":{"additionalProperties":false,"properties":{"channel":{"description":"whatsapp: send to WhatsApp even when a Telegram chat could receive the code.","enum":["whatsapp",""],"type":"string"},"phone":{"description":"A Kazakhstan mobile number","maxLength":20,"type":"string"}},"required":["phone"],"type":"object"},"Course-login-verifyRequest":{"additionalProperties":false,"properties":{"challenge_id":{"description":"From login/start","maxLength":64,"type":"string"},"code":{"description":"The 6-digit code","maxLength":6,"type":"string"},"phone":{"maxLength":20,"type":"string"}},"required":["challenge_id","phone","code"],"type":"object"},"Course-module-createRequest":{"additionalProperties":false,"properties":{"title":{"maxLength":200,"minLength":1,"type":"string"}},"required":["title"],"type":"object"},"Course-module-orderRequest":{"additionalProperties":false,"properties":{"module_ids":{"description":"Every module of the course, once, in the new order.","items":{"type":"string"},"maxItems":100,"type":["array","null"]}},"required":["module_ids"],"type":"object"},"Course-module-updateRequest":{"additionalProperties":false,"properties":{"title":{"maxLength":200,"minLength":1,"type":"string"}},"required":["title"],"type":"object"},"Course-student-phone-confirmRequest":{"additionalProperties":false,"properties":{"code":{"maxLength":6,"type":"string"},"phone":{"maxLength":20,"type":"string"}},"required":["phone","code"],"type":"object"},"Course-student-phone-startRequest":{"additionalProperties":false,"properties":{"phone":{"maxLength":20,"type":"string"}},"required":["phone"],"type":"object"},"Course-student-positionRequest":{"additionalProperties":false,"properties":{"position_seconds":{"format":"int64","maximum":86400,"minimum":0,"type":"integer"}},"required":["position_seconds"],"type":"object"},"Course-updateRequest":{"additionalProperties":false,"properties":{"access_days":{"description":"0 removes the limit.","format":"int64","maximum":3650,"minimum":0,"type":"integer"},"after_payment_text":{"maxLength":1000,"type":"string"},"description":{"maxLength":2000,"type":"string"},"sequential":{"type":"boolean"},"title":{"maxLength":200,"minLength":1,"type":"string"}},"type":"object"},"CoursePreviewLessonView":{"additionalProperties":false,"properties":{"duration_seconds":{"format":"int64","type":"integer"},"file":{"$ref":"#/components/schemas/FileLinkView"},"id":{"description":"lsn_...","type":"string"},"kind":{"enum":["text","video_url","file"],"type":"string"},"text":{"type":"string"},"text_format":{"enum":["plain","markdown",""],"type":"string"},"title":{"type":"string"},"video_url":{"type":"string"}},"required":["id","title","kind"],"type":"object"},"CoursePreviewView":{"additionalProperties":false,"properties":{"lessons":{"items":{"$ref":"#/components/schemas/CoursePreviewLessonView"},"type":"array"}},"required":["lessons"],"type":"object"},"CourseView":{"additionalProperties":false,"properties":{"access_days":{"description":"Access lasts this many days from enrollment; absent: unlimited.","format":"int64","type":"integer"},"after_payment_text":{"description":"What the sales page says happens after paying; empty: the default text.","type":"string"},"created_at":{"format":"date-time","type":"string"},"description":{"type":"string"},"id":{"description":"crs_...","type":"string"},"modules":{"description":"In order; only on GET /courses/{course_id}.","items":{"$ref":"#/components/schemas/ModuleView"},"type":["array","null"]},"published_at":{"format":"date-time","type":"string"},"sequential":{"description":"A lesson opens only after the previous one is done.","type":"boolean"},"status":{"enum":["draft","published"],"type":"string"},"title":{"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","title","description","status","created_at","updated_at","sequential","after_payment_text"],"type":"object"},"CreateBody":{"additionalProperties":false,"properties":{"hostname":{"description":"The name to connect, such as shop.example.kz or example.kz.","maxLength":253,"minLength":3,"type":"string"},"redirect_www":{"type":"boolean"},"target":{"$ref":"#/components/schemas/TargetView","description":"What it opens; default the site."}},"required":["hostname"],"type":"object"},"CreateEndpointRequest":{"additionalProperties":false,"properties":{"description":{"maxLength":200,"type":"string"},"events":{"description":"Event types to deliver, e.g. payment.success; omit for every type.","items":{"type":"string"},"maxItems":50,"type":["array","null"]},"url":{"description":"https URL with a public host name. Redirects are not followed.","maxLength":2000,"minLength":10,"type":"string"}},"required":["url"],"type":"object"},"CreateInviteInputBody":{"additionalProperties":false,"properties":{"email":{"description":"Email of the person to invite. Send this or phone.","maxLength":320,"type":"string"},"expires_in_days":{"description":"Lifetime in days; default 7.","format":"int64","maximum":30,"minimum":1,"type":"integer"},"phone":{"description":"Kazakhstan phone of the person to invite. Send this or email.","maxLength":32,"type":"string"},"role":{"enum":["owner","admin","viewer"],"type":"string"}},"required":["role"],"type":"object"},"CreateInvoiceInBody":{"additionalProperties":false,"properties":{"account_id":{"description":"Kaspi account (kac_...); the default account when absent","type":"string"},"amount":{"description":"Amount in tiyn, an integer; invoices take whole tenge (a multiple of 100)","format":"int64","minimum":1,"type":"integer"},"client_ref":{"description":"Your reference (e.g. an order number), unique per merchant","maxLength":200,"type":"string"},"description":{"description":"Shown to the payer; Kaspi displays about the first 60 characters","maxLength":2000,"type":"string"},"metadata":{"description":"Your own key-value data: a JSON object of at most 4 KB, stored exactly as sent"},"mode":{"description":"live (default) or test (sandbox, no money moves). A cabinet session chooses; an API key may only name its own mode (403 mode_mismatch).","enum":["live","test"],"type":"string"},"phone":{"description":"Payer's Kaspi phone, e.g. +77001234567","maxLength":20,"minLength":10,"type":"string"}},"required":["amount","phone"],"type":"object"},"CreateLotBody":{"additionalProperties":false,"properties":{"image_url":{"description":"An https URL; PayBot never fetches it","maxLength":2048,"type":"string"},"price":{"description":"Tiyn; a multiple of 100 (Kaspi takes whole tenge)","format":"int64","minimum":100,"type":"integer"},"quantity":{"description":"Default: the page's lot_defaults.quantity","format":"int64","maximum":100000,"minimum":1,"type":"integer"},"title":{"description":"Plain text","maxLength":100,"minLength":1,"type":"string"}},"required":["title","price"],"type":"object"},"CreateMerchantInputBody":{"additionalProperties":false,"properties":{"attribution":{"$ref":"#/components/schemas/FirstTouch","description":"First-touch labels captured by the site and the sign-in page: source, utm_*, referrer host, partner, invite"},"name":{"description":"The business name, at most 60 characters, no < or >","maxLength":60,"minLength":1,"type":"string"}},"required":["name"],"type":"object"},"CreatePlanRequest":{"additionalProperties":false,"properties":{"active":{"description":"Default true","type":"boolean"},"grace_days":{"format":"int64","maximum":30,"minimum":0,"type":"integer"},"name":{"maxLength":200,"minLength":1,"type":"string"},"period_count":{"description":"1..365 days or 1..12 months","format":"int64","maximum":365,"minimum":1,"type":"integer"},"period_unit":{"description":"day: count × 24 h; month: calendar months, the end day clamped to the month's length","enum":["day","month"],"type":"string"},"price":{"description":"Price of one period in tiyn; a multiple of 100 (Kaspi takes whole tenge)","format":"int64","minimum":100,"type":"integer"},"reminder_offsets":{"description":"Whole days 1..30 before the end of a period; default [3, 1]; [] for none","items":{"format":"int64","type":"integer"},"maxItems":5,"type":"array"},"trial_days":{"format":"int64","maximum":90,"minimum":0,"type":"integer"}},"required":["name","price","period_unit","period_count"],"type":"object"},"CreateQRInBody":{"additionalProperties":false,"properties":{"account_id":{"description":"Kaspi account (kac_...); the default account when absent","type":"string"},"amount":{"description":"Amount in tiyn, an integer; whole tenge (a multiple of 100)","format":"int64","minimum":1,"type":"integer"},"client_ref":{"description":"Your reference (e.g. an order number), unique per merchant","maxLength":200,"type":"string"},"description":{"maxLength":2000,"type":"string"},"metadata":{"description":"Your own key-value data: a JSON object of at most 4 KB, stored exactly as sent"},"mode":{"description":"live (default) or test (sandbox, no money moves). A cabinet session chooses; an API key may only name its own mode (403 mode_mismatch).","enum":["live","test"],"type":"string"}},"required":["amount"],"type":"object"},"CreateRequest":{"additionalProperties":false,"properties":{"allow_money":{"description":"Must be true when scopes contains money, so that the right to move money is never granted by accident.","type":"boolean"},"allowed_ips":{"description":"IP addresses or CIDRs the key may be used from; omit to allow any.","items":{"type":"string"},"maxItems":32,"type":["array","null"]},"expires_in_days":{"description":"Lifetime in days; omit for a key that does not expire.","format":"int64","maximum":3650,"minimum":1,"type":"integer"},"grants":{"$ref":"#/components/schemas/Grants","description":"The key's explicit auto settings (what an AI client may do without an approval, with limits); omit for none."},"mode":{"description":"live acts on real payments; test on test data.","enum":["live","test"],"type":"string"},"name":{"description":"A label for the cabinet, e.g. the system that will use the key.","maxLength":200,"type":"string"},"scopes":{"description":"Any of read, write, publish, broadcast, money. publish and broadcast let an AI client ask for a publish or a broadcast; a person approves it unless a grant below says otherwise.","items":{"type":"string"},"maxItems":5,"minItems":1,"type":["array","null"]}},"required":["mode","scopes"],"type":"object"},"CreateRuleRequest":{"additionalProperties":false,"properties":{"actions":{"description":"Action objects with a type, e.g. {\"type\":\"call_webhook\",\"url\":\"https://...\"}.","items":{},"maxItems":10,"minItems":1,"type":["array","null"]},"conditions":{"items":{"$ref":"#/components/schemas/ConditionView"},"maxItems":10,"type":["array","null"]},"enabled":{"description":"Default true.","type":"boolean"},"name":{"maxLength":200,"minLength":1,"type":"string"},"stop_on_failure":{"type":"boolean"},"trigger":{"description":"An event type from GET /v1/rules/catalog.","maxLength":100,"type":"string"}},"required":["name","trigger","actions"],"type":"object"},"CreatedInvite":{"additionalProperties":false,"properties":{"invite":{"$ref":"#/components/schemas/Invite"},"token":{"description":"The invite token. It is shown only in this response; put it in the link you send. The addressee accepts with POST /v1/invites/{token}/accept after signing in with the invited phone or email.","type":"string"}},"required":["token","invite"],"type":"object"},"CreatedKey":{"additionalProperties":false,"properties":{"api_key":{"$ref":"#/components/schemas/Key","description":"The key's metadata, as listed later."},"key":{"description":"The full API key. It is shown only in this response; store it now.","type":"string"}},"required":["key","api_key"],"type":"object"},"DailySummaryInput":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"hour":{"format":"int64","maximum":23,"minimum":0,"type":"integer"}},"type":"object"},"DailySummaryView":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"hour":{"description":"Local hour it is sent at","format":"int64","maximum":23,"minimum":0,"type":"integer"}},"required":["enabled","hour"],"type":"object"},"DashboardDayView":{"additionalProperties":false,"properties":{"day":{"description":"YYYY-MM-DD (UTC); absent on totals","type":"string"},"invoices_created":{"format":"int64","type":"integer"},"invoices_paid":{"format":"int64","type":"integer"},"paid_amount":{"description":"Tiyn","format":"int64","type":"integer"},"payments_created":{"format":"int64","type":"integer"},"payments_paid":{"description":"Paid, including refunded later","format":"int64","type":"integer"},"qr_created":{"format":"int64","type":"integer"},"qr_paid":{"format":"int64","type":"integer"},"refunded_amount":{"description":"Tiyn","format":"int64","type":"integer"},"refunded_count":{"format":"int64","type":"integer"},"subscriptions_started":{"format":"int64","type":"integer"}},"required":["payments_created","payments_paid","paid_amount","refunded_count","refunded_amount","invoices_created","invoices_paid","qr_created","qr_paid","subscriptions_started"],"type":"object"},"DashboardView":{"additionalProperties":false,"properties":{"active_subscribers":{"description":"Subscriptions in trial, active or grace at the latest snapshot; null before the first","format":"int64","type":["integer","null"]},"from":{"description":"First day, YYYY-MM-DD (UTC)","type":"string"},"invoice_conversion_bps":{"description":"Invoices paid / invoices sent, in basis points (10000 = 100%); -1 when none was sent","format":"int64","type":"integer"},"mode":{"enum":["live","test"],"type":"string"},"refreshed_at":{"description":"The oldest refresh among the days shown: how stale the numbers may be","format":"date-time","type":["string","null"]},"revenue":{"description":"Paid minus refunded, tiyn","format":"int64","type":"integer"},"series":{"description":"Days with activity, oldest first","items":{"$ref":"#/components/schemas/DashboardDayView"},"type":"array"},"to":{"description":"Last day, inclusive","type":"string"},"totals":{"$ref":"#/components/schemas/DashboardDayView"}},"required":["mode","from","to","totals","revenue","invoice_conversion_bps","active_subscribers","series","refreshed_at"],"type":"object"},"DecideBody":{"additionalProperties":false,"properties":{"note":{"description":"Why; shown in the cabinet and kept with the approval","maxLength":500,"type":"string"}},"type":"object"},"DeletionItem":{"additionalProperties":false,"properties":{"merchant_id":{"type":"string"},"name":{"type":"string"},"outcome":{"enum":["leave","close","blocked"],"type":"string"},"role":{"type":"string"}},"required":["merchant_id","name","role","outcome"],"type":"object"},"DeletionPreview":{"additionalProperties":false,"properties":{"allowed":{"description":"False while any business is blocked","type":"boolean"},"businesses":{"items":{"$ref":"#/components/schemas/DeletionItem"},"type":"array"}},"required":["businesses","allowed"],"type":"object"},"DeliveryListOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/DeliveryOptionView"},"type":["array","null"]}},"required":["data"],"type":"object"},"DeliveryOptionView":{"additionalProperties":false,"properties":{"archived":{"type":"boolean"},"code":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"details":{"type":"string"},"free_over":{"description":"courier_free_over: the subtotal (tiyn) from which delivery is free.","format":"int64","type":"integer"},"kind":{"enum":["pickup","courier","courier_free_over","arrangement"],"type":"string"},"position":{"format":"int64","type":"integer"},"price":{"description":"Tiyn. 0 for pickup and arrangement.","format":"int64","type":"integer"},"title":{"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["code","kind","title","details","price","position","archived","created_at","updated_at"],"type":"object"},"DeliveryRequest":{"additionalProperties":false,"properties":{"details":{"description":"Plain text: where to pick up, delivery hours...","maxLength":500,"type":"string"},"free_over":{"description":"courier_free_over only: the subtotal from which delivery is free.","format":"int64","minimum":100,"type":"integer"},"kind":{"enum":["pickup","courier","courier_free_over","arrangement"],"type":"string"},"position":{"format":"int64","maximum":1000,"minimum":0,"type":"integer"},"price":{"description":"Tiyn, whole tenge. courier and courier_free_over only.","format":"int64","minimum":0,"type":"integer"},"title":{"maxLength":100,"minLength":1,"type":"string"}},"required":["kind","title"],"type":"object"},"DeliveryView":{"additionalProperties":false,"properties":{"attempt":{"description":"Attempts made since the delivery was created or last replayed.","format":"int64","type":"integer"},"created_at":{"format":"date-time","type":"string"},"duration_ms":{"format":"int64","type":"integer"},"endpoint_id":{"description":"Endpoint id (whk_...)","type":"string"},"event_id":{"description":"Event id (evt_...), the PayBot-Event-Id header; deduplicate on it.","type":"string"},"event_type":{"type":"string"},"id":{"description":"Delivery id (dlv_...)","type":"string"},"last_error":{"description":"Why the last attempt failed: an HTTP status, or one of timeout, dns, connection_refused, tls, blocked_address, too_large, network, invalid_url.","type":"string"},"last_status_code":{"description":"HTTP status of the last answer; absent when there was none.","format":"int64","type":"integer"},"next_attempt_at":{"format":"date-time","type":"string"},"response_snippet":{"description":"The first 1 KB of your server's last answer.","type":"string"},"status":{"enum":["pending","failed","succeeded","dead"],"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","endpoint_id","event_id","event_type","status","attempt","duration_ms","created_at","updated_at"],"type":"object"},"DeployMessagesRequest":{"additionalProperties":false,"properties":{"ended":{"description":"Sent when access ends. Placeholder: {plan}.","maxLength":1000,"type":"string"},"expiring":{"description":"Sent at each reminder. Placeholders: {plan}, {period_end}, {link} (a renewal payment link).","maxLength":1000,"type":"string"},"granted":{"description":"Sent after payment. Placeholders: {plan}, {period_end}, {link} (the invite link, required).","maxLength":1000,"type":"string"},"welcome":{"description":"Sent after /start. Placeholders: {plan}, {link} (the payment link, required).","maxLength":1000,"type":"string"}},"type":"object"},"DeployPlanRequest":{"additionalProperties":false,"properties":{"best":{"description":"Recommend this plan («выгодно»); at most one.","type":"boolean"},"days":{"description":"Length of a custom period in days (period custom only).","format":"int64","maximum":365,"minimum":0,"type":"integer"},"grace_days":{"description":"Days access is kept after period_end without payment. Default 0.","format":"int64","maximum":30,"minimum":0,"type":"integer"},"key":{"description":"more_plans only: the plan's key as returned; keep it to edit that plan. Without one a plan is matched by position.","maxLength":16,"type":"string"},"name":{"maxLength":100,"minLength":1,"type":"string"},"period":{"enum":["day","week","month","quarter","half_year","year","custom"],"type":"string"},"price":{"description":"Price per period in tiyn, an integer; whole tenge (a multiple of 100).","format":"int64","minimum":100,"type":"integer"},"reminders":{"description":"Days before period_end to remind the subscriber (1-30). Default [3, 1]; [] for none.","items":{"format":"int64","type":"integer"},"maxItems":5,"type":"array"},"trial_days":{"description":"Default 0.","format":"int64","maximum":90,"minimum":0,"type":"integer"}},"required":["name","price","period"],"type":"object"},"DeployRequest":{"additionalProperties":false,"properties":{"bot_id":{"description":"bot_...","type":"string"},"channel_id":{"description":"chn_..., a channel of that bot","type":"string"},"create_only":{"description":"Refuse (409 channel_in_use) when this channel already has a deployment instead of replacing its plan. The setup wizard sends true.","type":"boolean"},"messages":{"$ref":"#/components/schemas/DeployMessagesRequest","description":"Plain text; only {plan}, {period_end} and {link} are substituted, literally."},"more_plans":{"description":"The channel's other plans (week, 3 months, ...), each with its own price, trial and grace. A plan left out of a redeploy stops selling; its subscribers keep it.","items":{"$ref":"#/components/schemas/DeployPlanRequest"},"maxItems":5,"type":["array","null"]},"plan":{"$ref":"#/components/schemas/DeployPlanRequest"},"test_mode_real_telegram":{"description":"Let test-mode subscriptions use the real bot (invite links, removals, messages). Default false: test mode is simulated and never calls Telegram.","type":"boolean"}},"required":["bot_id","channel_id","plan"],"type":"object"},"DeployView":{"additionalProperties":false,"properties":{"changed":{"description":"false when this exact configuration was already deployed (nothing was written).","type":"boolean"},"config":{"$ref":"#/components/schemas/Config","description":"The stored configuration, every default filled in."},"plan_id":{"description":"pln_...","type":"string"},"product_id":{"description":"The deployment (prd_...)","type":"string"},"start_link":{"description":"The public, reusable live start link (https://t.me/<bot>?start=...). Shown ONLY when created: on the first deployment, or when the bot changed; null otherwise. Rotate to get a new one.","type":["string","null"]},"test_start_link":{"description":"The same for test mode: purchases are sandbox payments. Keep it private: with test_mode_real_telegram it grants real access without paying.","type":["string","null"]},"version":{"description":"The configuration version now deployed.","format":"int64","type":"integer"}},"required":["product_id","plan_id","version","changed","start_link","test_start_link","config"],"type":"object"},"DeploymentSummary":{"additionalProperties":false,"properties":{"slug":{"description":"Address of the public page (paybot.kz/<slug>); absent when the template has no page","type":"string"},"status":{"description":"published: the page is public; unpublished: a draft or a pause, it opens only with a preview token; no_page: the template serves no page; archived: closed for good","enum":["published","unpublished","no_page","archived"],"type":"string"},"subject_id":{"description":"The deployment's public id, as the deploy answered it","type":"string"},"template":{"description":"Template id, e.g. payment_link","type":"string"},"title":{"description":"The configuration's title (or name), when it has one","type":"string"},"updated_at":{"description":"When the deployed version was written","format":"date-time","type":"string"},"version":{"description":"The configuration version now deployed","format":"int64","type":"integer"}},"required":["subject_id","template","version","status","updated_at"],"type":"object"},"DeploymentView":{"additionalProperties":false,"properties":{"changed":{"description":"false when this exact configuration was already deployed (nothing was written)","type":"boolean"},"output":{"description":"The template's own answer. It can carry a show-once secret (a preview token)."},"restored_version":{"description":"Rollback only: the version whose configuration was deployed again","format":"int64","type":"integer"},"subject_id":{"description":"The deployment's public id","type":"string"},"template":{"type":"string"},"version":{"description":"The configuration version now deployed","format":"int64","type":"integer"}},"required":["template","subject_id","version","changed"],"type":"object"},"DescriptorSummary":{"additionalProperties":false,"properties":{"description":{"type":"string"},"id":{"description":"Template id, e.g. payment_link","type":"string"},"schema_version":{"format":"int64","type":"integer"},"title":{"type":"string"}},"required":["id","schema_version","title"],"type":"object"},"DescriptorView":{"additionalProperties":false,"properties":{"config_schema":{"description":"JSON Schema (draft 2020-12) of the configuration"},"deploy_plan":{"description":"What a deploy creates or changes","items":{"$ref":"#/components/schemas/PlanStep"},"type":["array","null"]},"description":{"type":"string"},"id":{"type":"string"},"public_page":{"description":"Whether deployments are served at /v1/public/{slug}","type":"boolean"},"schema_version":{"format":"int64","type":"integer"},"title":{"type":"string"},"ui_schema":{"description":"Layout hints for the cabinet form"}},"required":["id","schema_version","title","config_schema","ui_schema","deploy_plan","public_page"],"type":"object"},"DeviceView":{"additionalProperties":false,"properties":{"id":{"type":"string"},"platform":{"enum":["ios","android"],"type":"string"},"provider":{"enum":["apns","fcm","expo"],"type":"string"}},"required":["id","platform","provider"],"type":"object"},"Documents":{"additionalProperties":false,"properties":{"offer_text":{"type":"string"},"privacy_text":{"type":"string"},"return_policy":{"description":"A starting text for the return terms; empty when the profile already has one","type":"string"}},"required":["offer_text","privacy_text","return_policy"],"type":"object"},"DomainView":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","type":"string"},"give_up_at":{"description":"While waiting for the records: when the checks stop (72 hours after the start).","format":"date-time","type":"string"},"hostname":{"description":"The connected name, in lower case and punycode.","type":"string"},"hostname_display":{"description":"The same name as a person reads it (Unicode).","type":"string"},"id":{"description":"dom_...","type":"string"},"last_check_at":{"format":"date-time","type":"string"},"last_error":{"description":"Why the last check failed, a code: no_txt, txt_mismatch, no_records, wrong_target, proxied, dns_unavailable, timeout, routing_lost, plan_lost.","type":"string"},"last_error_detail":{"description":"For wrong_target and proxied: the addresses the name points to now.","type":"string"},"next_check_at":{"format":"date-time","type":"string"},"plan_lost_at":{"description":"The plan no longer covers this domain: it is switched off 7 days after this.","format":"date-time","type":"string"},"propagating":{"description":"The records were added less than 24 hours ago, so a missing record may only be slow to spread.","type":"boolean"},"records":{"description":"The DNS records to create, computed from the platform's settings.","items":{"$ref":"#/components/schemas/RecordView"},"type":"array"},"redirect_partner":{"description":"The partner name the redirect refers to (www.example.kz for example.kz and back).","type":"string"},"redirect_state":{"description":"With redirect_www: missing: the partner is not connected; pending: connected, not verified yet; active: the partner redirects here.","enum":["missing","pending","active"],"type":"string"},"redirect_www":{"description":"Redirect the www/apex partner of this name here (301). It works only when the partner is connected and verified as a domain of its own, with its own records; until then the flag does nothing.","type":"boolean"},"route_ok":{"description":"The name points to PayBot.","type":"boolean"},"routing_broken_since":{"description":"An active domain whose DNS stopped pointing to PayBot keeps working for 7 days after this.","format":"date-time","type":"string"},"status":{"description":"pending_dns: waiting for the DNS records; active: connected and served over HTTPS; error: gave up or the DNS was lost; disabled: switched off (the plan no longer covers it).","enum":["pending_dns","verifying","active","error","disabled","removing"],"type":"string"},"target":{"$ref":"#/components/schemas/TargetView"},"target_ok":{"description":"False for a page target whose page was deleted or unpublished: the domain then answers 404 until the page is back or the target is changed.","type":"boolean"},"tls":{"description":"The certificate, as far as known.","enum":["unknown","issued","failed"],"type":"string"},"txt_ok":{"description":"The ownership record was found.","type":"boolean"},"verified_at":{"format":"date-time","type":"string"}},"required":["id","hostname","hostname_display","status","txt_ok","route_ok","target","redirect_www","target_ok","tls","records","created_at","propagating"],"type":"object"},"EndpointListOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/EndpointView"},"type":"array"}},"required":["data"],"type":"object"},"EndpointView":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"consecutive_failures":{"description":"Deliveries in a row that exhausted every retry.","format":"int64","type":"integer"},"created_at":{"format":"date-time","type":"string"},"description":{"type":"string"},"disabled_reason":{"description":"Why the endpoint was switched off (410 Gone, a failure streak, or the merchant).","type":"string"},"events":{"description":"Event types delivered here; empty means every type.","items":{"type":"string"},"type":"array"},"id":{"description":"Endpoint id (whk_...)","type":"string"},"updated_at":{"format":"date-time","type":"string"},"url":{"type":"string"}},"required":["id","url","events","active","description","consecutive_failures","created_at","updated_at"],"type":"object"},"EnrollmentView":{"additionalProperties":false,"properties":{"completed_lessons":{"format":"int64","type":"integer"},"course_id":{"description":"crs_...","type":"string"},"enrolled_at":{"format":"date-time","type":"string"},"expires_at":{"description":"Access ends then; absent: unlimited.","format":"date-time","type":"string"},"has_phone":{"description":"The student can sign in by phone.","type":"boolean"},"id":{"description":"enr_...","type":"string"},"mode":{"enum":["live","test"],"type":"string"},"payment_id":{"description":"pay_...","type":"string"},"revoked_at":{"format":"date-time","type":"string"},"source":{"enum":["checkout","rule"],"type":"string"},"status":{"enum":["active","revoked"],"type":"string"},"token_issued":{"description":"Whether a student key was claimed or issued.","type":"boolean"}},"required":["id","course_id","payment_id","source","mode","status","token_issued","completed_lessons","enrolled_at","has_phone"],"type":"object"},"ErrorDetail":{"additionalProperties":false,"properties":{"location":{"description":"Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'","type":"string"},"message":{"description":"Error message text","type":"string"},"value":{"description":"The value at the given location"}},"type":"object"},"EventPrefInput":{"additionalProperties":false,"properties":{"event":{"type":"string"},"push":{"type":"boolean"},"telegram":{"type":"boolean"}},"required":["event","push","telegram"],"type":"object"},"EventPrefView":{"additionalProperties":false,"properties":{"event":{"description":"Event id, e.g. payment.success","type":"string"},"group":{"enum":["money","sales","alerts"],"type":"string"},"push":{"type":"boolean"},"telegram":{"type":"boolean"}},"required":["event","group","push","telegram"],"type":"object"},"FieldView":{"additionalProperties":false,"properties":{"description":{"type":"string"},"kind":{"enum":["string","money","int","scalar"],"type":"string"},"name":{"description":"The field to put in a condition; for a prefix family, append the key (metadata.<key>).","type":"string"},"ops":{"items":{"type":"string"},"type":"array"},"prefix":{"description":"true for a family such as metadata., which takes any key after the dot.","type":"boolean"}},"required":["name","kind","ops","description"],"type":"object"},"FileLinkView":{"additionalProperties":false,"properties":{"content_type":{"type":"string"},"expires_at":{"format":"date-time","type":"string"},"name":{"type":"string"},"size":{"format":"int64","type":"integer"},"url":{"description":"Presigned GET, valid until expires_at (at most 5 minutes).","type":"string"}},"required":["url","expires_at","content_type","size"],"type":"object"},"FileView":{"additionalProperties":false,"properties":{"confirmed_at":{"format":"date-time","type":"string"},"content_type":{"enum":["image/jpeg","image/png","image/webp","application/pdf"],"type":"string"},"created_at":{"format":"date-time","type":"string"},"expires_at":{"description":"Pending only: the upload URL stops working at this time","format":"date-time","type":"string"},"id":{"description":"Upload id (upl_...)","type":"string"},"object":{"enum":["upload"],"type":"string"},"purpose":{"enum":["template_image","product_image","document"],"type":"string"},"size":{"description":"Bytes","format":"int64","type":"integer"},"status":{"description":"pending until confirm saw the file in storage","enum":["pending","ready"],"type":"string"},"url":{"description":"Ready only: where the file is served (a redirect to storage). Put it in a template's image_url or a product's image.","type":"string"}},"required":["id","object","purpose","content_type","size","status","created_at"],"type":"object"},"FirstTouch":{"additionalProperties":false,"properties":{"first_touch_at":{"format":"date-time","type":"string"},"invite":{"type":"string"},"partner":{"type":"string"},"referrer":{"type":"string"},"source":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_medium":{"type":"string"},"utm_source":{"type":"string"},"utm_term":{"type":"string"}},"type":"object"},"GenApplyImportRequest":{"additionalProperties":false,"properties":{"confirm_reviewed":{"description":"Required when a picked item needs review: a person has checked it","type":"boolean"},"items":{"description":"Indexes of the items to import","items":{"format":"int64","type":"integer"},"maxItems":200,"minItems":1,"type":["array","null"]},"untracked_items":{"description":"Picked items to import without stock tracking (made or ordered on demand): always for sale, stock not counted. Their stock is imported as 0.","items":{"format":"int64","type":"integer"},"maxItems":200,"type":["array","null"]}},"required":["items"],"type":"object"},"GenCreditsView":{"additionalProperties":false,"properties":{"balance":{"description":"Credits left; 1 credit = 1e-6 USD of the model's list price","format":"int64","type":"integer"},"generations_left":{"format":"int64","type":"integer"},"generations_limit":{"format":"int64","type":"integer"},"model":{"type":"string"},"price_table":{"description":"Where and when the price table was read","type":"string"},"recent":{"items":{"$ref":"#/components/schemas/GenUsageEntry"},"type":["array","null"]}},"required":["balance","price_table","model","recent"],"type":"object"},"GenImportCounts":{"additionalProperties":false,"properties":{"products_created":{"format":"int64","type":"integer"},"products_updated":{"format":"int64","type":"integer"},"rows":{"format":"int64","type":"integer"},"variants_created":{"format":"int64","type":"integer"},"variants_updated":{"format":"int64","type":"integer"}},"required":["rows","products_created","products_updated","variants_created","variants_updated"],"type":"object"},"GenImportIssue":{"additionalProperties":false,"properties":{"field":{"type":"string"},"reason":{"type":"string"}},"required":["reason"],"type":"object"},"GenImportItem":{"additionalProperties":false,"properties":{"changes":{"description":"What the row changes in existing products and variants, before and after (stock, titles, price, back on sale)","items":{"$ref":"#/components/schemas/GenOpChange"},"type":["array","null"]},"confidence":{"description":"0-100, the model's own estimate","format":"int64","type":"integer"},"description":{"type":"string"},"doubts":{"items":{"type":"string"},"type":["array","null"]},"errors":{"description":"What the catalogue import refuses in this row; such a row cannot be imported","items":{"$ref":"#/components/schemas/GenImportIssue"},"type":["array","null"]},"existing":{"description":"The SKU is already in the catalogue: the row changes that variant","type":"boolean"},"handle":{"type":"string"},"index":{"format":"int64","type":"integer"},"needs_review":{"description":"Low confidence, doubts, errors or changes of existing objects: a person must check it, and confirm it explicitly to import it","type":"boolean"},"no_stock_tracking":{"description":"The variant does not count stock (made to order): it already does not, or untracked_items marked it at apply. Its stock is imported as 0.","type":"boolean"},"price":{"description":"Tiyn","format":"int64","type":"integer"},"price_change":{"$ref":"#/components/schemas/GenPriceChange","description":"A new price of an existing variant: the import keeps the current price and asks for an approval of this one"},"sku":{"type":"string"},"source":{"description":"The fragment of the source the item was read from","type":"string"},"stock":{"format":"int64","type":"integer"},"title":{"type":"string"},"variant":{"type":"string"}},"required":["index","handle","title","description","sku","variant","price","stock","confidence","doubts","source","needs_review","errors","existing","changes"],"type":"object"},"GenImportRequest":{"additionalProperties":false,"properties":{"content":{"description":"The source for text and csv","maxLength":65536,"type":"string"},"format":{"enum":["text","csv","image"],"type":"string"},"image_base64":{"description":"A photo of a price list, base64, at most 700 KB decoded","maxLength":960000,"type":"string"},"image_type":{"enum":["image/jpeg","image/png","image/gif","image/webp"],"type":"string"},"locale":{"enum":["ru","kk"],"type":"string"}},"required":["format"],"type":"object"},"GenImportView":{"additionalProperties":false,"properties":{"applied":{"$ref":"#/components/schemas/GenImportCounts"},"attention":{"description":"For needs_attention: what was interrupted and what to check before asking again","type":"string"},"created_at":{"format":"date-time","type":"string"},"dry_run":{"$ref":"#/components/schemas/GenImportCounts"},"expires_at":{"format":"date-time","type":"string"},"id":{"description":"gim_...","type":"string"},"items":{"items":{"$ref":"#/components/schemas/GenImportItem"},"type":["array","null"]},"model":{"type":"string"},"price_change":{"$ref":"#/components/schemas/GenOpResult","description":"The catalog.price_change approval requested for the new prices of existing variants"},"status":{"enum":["proposed","applying","applied","needs_attention","expired"],"type":"string"},"warnings":{"items":{"type":"string"},"type":["array","null"]}},"required":["id","status","items","warnings","dry_run","model","created_at","expires_at"],"type":"object"},"GenOpChange":{"additionalProperties":false,"properties":{"after":{"type":"string"},"before":{"type":"string"},"field":{"type":"string"},"object":{"description":"What changes, e.g. a SKU or a payment id","type":"string"}},"required":["object","field","before","after"],"type":"object"},"GenOpResult":{"additionalProperties":false,"properties":{"approval_id":{"type":"string"},"approve_url":{"type":"string"},"error":{"type":"string"},"index":{"format":"int64","type":"integer"},"op":{"type":"string"},"status":{"enum":["applied","approval_requested","failed","unknown"],"type":"string"}},"required":["index","op","status"],"type":"object"},"GenPriceChange":{"additionalProperties":false,"properties":{"from":{"format":"int64","type":"integer"},"sku":{"type":"string"},"to":{"format":"int64","type":"integer"},"variant_id":{"type":"string"}},"required":["variant_id","sku","from","to"],"type":"object"},"GenRequestView":{"additionalProperties":false,"properties":{"cached":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"generation_counted":{"type":"boolean"},"generation_refunded":{"type":"boolean"},"generations_left":{"description":"Generations left this month on the plan; absent when unlimited","format":"int64","type":"integer"},"generations_limit":{"format":"int64","type":"integer"},"images":{"description":"For an image request (task images): the ids (upl_...) of the stored images, ready uploads to use like any photo","items":{"type":"string"},"type":["array","null"]},"outcome":{"description":"For a failed request: invalid_output, refused, truncated, unavailable, rejected, insufficient_credits, abandoned (the server lost the request mid-call) or error","type":"string"},"request_id":{"type":"string"},"session_id":{"type":"string"},"stages":{"description":"Real server events in order; a stage appears only after it happened","items":{"$ref":"#/components/schemas/Stage"},"type":["array","null"]},"state":{"description":"running until the model work ends; read session_id for the stored proposal","enum":["running","succeeded","failed"],"type":"string"},"task":{"type":"string"}},"required":["request_id","task","state","stages","cached","generation_counted","generation_refunded","created_at"],"type":"object"},"GenUsageEntry":{"additionalProperties":false,"properties":{"cache_read_tokens":{"format":"int64","type":"integer"},"cache_write_tokens":{"format":"int64","type":"integer"},"cost":{"description":"Credits debited (1 credit = 1e-6 USD of list price)","format":"int64","type":"integer"},"created_at":{"format":"date-time","type":"string"},"granted":{"format":"int64","type":"integer"},"input_tokens":{"format":"int64","type":"integer"},"model":{"type":"string"},"outcome":{"description":"Why the call gave no usable answer: refused, truncated, invalid_output, unavailable, rejected; reconciled when a reservation that was never settled was settled later at its estimated input cost","type":"string"},"output_tokens":{"format":"int64","type":"integer"},"provider":{"description":"The model provider that answered: anthropic, minimax or deepseek","type":"string"},"status":{"enum":["reserved","settled","cached","granted"],"type":"string"},"task":{"type":"string"}},"required":["task","model","status","cost","input_tokens","output_tokens","cache_read_tokens","cache_write_tokens","created_at"],"type":"object"},"GeneratedImageView":{"additionalProperties":false,"properties":{"content_type":{"enum":["image/jpeg","image/png"],"type":"string"},"height":{"format":"int64","type":"integer"},"id":{"description":"Upload id (upl_...): use it in a product's image_upload_ids or as the logo; its url goes in a template's image_url","type":"string"},"purpose":{"enum":["template_image","product_image"],"type":"string"},"size":{"description":"Bytes","format":"int64","type":"integer"},"url":{"description":"Where the picture is served (the public file redirect)","type":"string"},"width":{"format":"int64","type":"integer"}},"required":["id","url","content_type","purpose","size","width","height"],"type":"object"},"GeneratedImagesView":{"additionalProperties":false,"properties":{"credits_per_image":{"description":"What each stored picture costs, in generator credits (1 credit = 1e-6 USD). Pictures that could not be made cost nothing and the plan's generation is returned","format":"int64","type":"integer"},"images":{"items":{"$ref":"#/components/schemas/GeneratedImageView"},"type":["array","null"]},"request_id":{"description":"GET /generator/requests/{request_id} shows the stages and the image ids","type":"string"},"state":{"description":"running (202): still being made, poll the request; succeeded (201): images is complete","enum":["running","succeeded"],"type":"string"}},"required":["request_id","state","images","credits_per_image"],"type":"object"},"GrantView":{"additionalProperties":false,"properties":{"channel_id":{"description":"chn_...","type":"string"},"created_at":{"format":"date-time","type":"string"},"granted_at":{"format":"date-time","type":"string"},"id":{"description":"Grant id (gnt_...)","type":"string"},"mode":{"enum":["live","test"],"type":"string"},"period_end":{"format":"date-time","type":"string"},"period_index":{"description":"0 for the first paid period, then one per renewal.","format":"int64","type":"integer"},"period_start":{"format":"date-time","type":"string"},"plan_id":{"description":"pln_...","type":"string"},"revoke_reason":{"description":"expired, cancelled, revoked, manual or rule.","type":"string"},"revoked_at":{"format":"date-time","type":"string"},"status":{"description":"pending: the invite link is on its way; active: delivered; superseded: carried over to the next period; revoked: removed.","enum":["pending","active","superseded","revoked"],"type":"string"},"subscriber_id":{"description":"sbr_...","type":"string"},"subscription_id":{"description":"sub_...","type":"string"}},"required":["id","subscription_id","subscriber_id","channel_id","plan_id","period_index","period_start","period_end","mode","status","created_at"],"type":"object"},"Grants":{"additionalProperties":false,"properties":{"auto_publish":{"description":"Publishing (a site, a course page, a channel deploy) runs at once, without an approval. Needs the publish scope.","type":"boolean"}},"required":["auto_publish"],"type":"object"},"GrantsOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/ConnectedAppView"},"type":"array"}},"required":["data"],"type":"object"},"HandoffBody":{"additionalProperties":false,"properties":{"expires_at":{"format":"date-time","type":"string"},"token":{"description":"Single use, valid 60 seconds. Put it in the URL FRAGMENT of the cabinet's /handoff page, never in the query.","type":"string"}},"required":["token","expires_at"],"type":"object"},"HandoffExchangeBody":{"additionalProperties":false,"properties":{"csrf_token":{"type":"string"},"merchant_id":{"description":"The business the app was in (mch_...)","type":"string"},"path":{"description":"Where the cabinet should open","type":"string"}},"required":["csrf_token","path"],"type":"object"},"HealthView":{"additionalProperties":false,"properties":{"checked_at":{"format":"date-time","type":"string"},"kaspi":{"$ref":"#/components/schemas/KaspiHealth"},"problems":{"description":"Open problems on Today","format":"int64","type":"integer"},"refused":{"$ref":"#/components/schemas/RefusedHealth","description":"«За это время N покупателей не смогли оплатить»"}},"required":["kaspi","refused","problems","checked_at"],"type":"object"},"HistoryOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/HistoryView"},"type":"array"}},"required":["data"],"type":"object"},"HistoryView":{"additionalProperties":false,"properties":{"actor":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"from":{"description":"Absent for the first entry (the payment was created)","type":"string"},"kaspi_status":{"type":"string"},"reason":{"type":"string"},"to":{"type":"string"}},"required":["to","actor","created_at"],"type":"object"},"ImageView":{"additionalProperties":false,"properties":{"id":{"description":"upl_..., the upload","type":"string"},"position":{"format":"int64","type":"integer"},"url":{"description":"Public address of the file (a redirect to short-lived storage); empty when file serving is not configured","type":"string"}},"required":["id","url","position"],"type":"object"},"ImagesRequest":{"additionalProperties":false,"properties":{"aspect":{"description":"Default 1:1","enum":["1:1","4:5","16:9","3:2"],"type":"string"},"n":{"description":"How many pictures, 1 to 4; default 1. Each stored picture costs credits_per_image","format":"int64","maximum":4,"minimum":1,"type":"integer"},"prompt_hint":{"description":"What the picture should show, in a few words (at most 300 characters are used). It is only a subject: the server builds the real prompt from it and a fixed style, drops anything addressed to the model, and refuses disallowed content","maxLength":1000,"minLength":1,"type":"string"},"request_id":{"description":"Your id for this request (a UUID); omit to let the server make one. One id is one request (409 when reused); poll GET /generator/requests/{request_id}","format":"uuid","type":"string"},"slot":{"description":"Where the picture is used; it picks the style, and the purpose of the upload (product: product_image, otherwise template_image)","enum":["hero","banner","product","background","gallery"],"type":"string"}},"required":["prompt_hint","slot"],"type":"object"},"ImportRequest":{"additionalProperties":false,"properties":{"csv":{"description":"UTF-8 CSV with the header handle,title,description,sku,variant,price,stock (price in tenge)","maxLength":524288,"minLength":1,"type":"string"},"dry_run":{"description":"Validate against the current catalogue and write nothing","type":"boolean"}},"required":["csv"],"type":"object"},"ImportView":{"additionalProperties":false,"properties":{"applied":{"description":"false for a dry run and whenever a row has an error (then nothing was written)","type":"boolean"},"dry_run":{"type":"boolean"},"errors":{"items":{"$ref":"#/components/schemas/RowErrorView"},"type":["array","null"]},"products_created":{"format":"int64","type":"integer"},"products_updated":{"format":"int64","type":"integer"},"rows":{"format":"int64","type":"integer"},"truncated":{"description":"More errors were found than are listed","type":"boolean"},"variants_created":{"format":"int64","type":"integer"},"variants_updated":{"format":"int64","type":"integer"}},"required":["dry_run","applied","rows","products_created","products_updated","variants_created","variants_updated","errors","truncated"],"type":"object"},"Input":{"additionalProperties":false,"properties":{"address":{"type":"string"},"confirm_terms":{"type":"boolean"},"email":{"type":"string"},"hours":{"type":"string"},"instagram":{"type":"string"},"legal_form":{"enum":["ip","too","individual","other"],"type":"string"},"offer_text":{"type":"string"},"phone":{"type":"string"},"privacy_text":{"type":"string"},"registration":{"type":"string"},"return_policy":{"type":"string"},"seller_name":{"type":"string"},"telegram":{"type":"string"},"whatsapp":{"type":"string"}},"required":["seller_name","legal_form","address","phone"],"type":"object"},"Invite":{"additionalProperties":false,"properties":{"accepted_at":{"format":"date-time","type":"string"},"addressee":{"description":"The masked phone or email the invite is for.","type":"string"},"channel":{"description":"How the invite is addressed.","enum":["phone","email"],"type":"string"},"created_at":{"format":"date-time","type":"string"},"created_by":{"description":"User id of the inviter.","type":"string"},"expires_at":{"format":"date-time","type":"string"},"id":{"description":"Invite id (ivt_...).","type":"string"},"revoked_at":{"format":"date-time","type":"string"},"role":{"enum":["owner","admin","viewer"],"type":"string"},"status":{"enum":["pending","accepted","revoked","expired"],"type":"string"}},"required":["id","role","channel","addressee","status","created_at","expires_at"],"type":"object"},"InvitesOutputBody":{"additionalProperties":false,"properties":{"data":{"description":"The merchant's invites, newest first.","items":{"$ref":"#/components/schemas/Invite"},"type":"array"}},"required":["data"],"type":"object"},"Item":{"additionalProperties":false,"properties":{"item_id":{"maxLength":64,"minLength":1,"type":"string"},"quantity":{"format":"int64","maximum":99,"minimum":1,"type":"integer"}},"required":["item_id","quantity"],"type":"object"},"ItemRow":{"additionalProperties":false,"properties":{"item":{"type":"string"},"title":{"type":"string"},"views":{"format":"int64","type":"integer"}},"required":["item","views"],"type":"object"},"Kaspi-account-login-startRequest":{"additionalProperties":false,"properties":{"phone":{"description":"Cashier phone, e.g. +77001234567","maxLength":20,"minLength":10,"type":"string"}},"required":["phone"],"type":"object"},"Kaspi-account-login-verifyRequest":{"additionalProperties":false,"properties":{"code":{"maxLength":8,"minLength":4,"type":"string"}},"required":["code"],"type":"object"},"KaspiHealth":{"additionalProperties":false,"properties":{"accounts":{"items":{"$ref":"#/components/schemas/AccountHealth"},"type":["array","null"]},"down_since":{"format":"date-time","type":"string"},"state":{"description":"working / degraded: buyers can pay; down: connected but every session ended; none: nothing connected","enum":["working","degraded","down","none"],"type":"string"},"usable":{"description":"Accounts that can take a payment now","format":"int64","type":"integer"}},"required":["state","usable","accounts"],"type":"object"},"Key":{"additionalProperties":false,"properties":{"allowed_ips":{"description":"CIDRs the key may be used from; empty means anywhere.","items":{"type":"string"},"type":["array","null"]},"created_at":{"description":"When the key was issued.","format":"date-time","type":"string"},"expires_at":{"description":"When the key stops working; null means it does not expire.","format":"date-time","type":["string","null"]},"grants":{"$ref":"#/components/schemas/Grants","description":"What an AI client with this key may do without a person's approval (all off by default)."},"id":{"description":"Public identifier, key_<32 hex digits>.","type":"string"},"last_used_at":{"description":"Last successful authentication, accurate to about a minute; null if never used.","format":"date-time","type":["string","null"]},"mode":{"description":"Whether the key acts on live or test data.","enum":["live","test"],"type":"string"},"name":{"description":"Label chosen by the merchant.","type":"string"},"prefix":{"description":"The non-secret head of the key; identifies it in logs and in the cabinet.","type":"string"},"revoked_at":{"description":"When the key was revoked; null while it is usable.","format":"date-time","type":["string","null"]},"rotated_from":{"description":"The key this one replaced, if it was created by rotation.","type":["string","null"]},"scopes":{"description":"Granted scopes: read, write, publish, broadcast, money.","items":{"type":"string"},"type":"array"}},"required":["id","prefix","mode","scopes","created_at","last_used_at","expires_at","revoked_at","rotated_from","grants"],"type":"object"},"LeadBody":{"additionalProperties":false,"properties":{"attribution":{"$ref":"#/components/schemas/Attribution"},"consent":{"description":"The visitor agreed to be contacted; false is 422 consent_required","type":"boolean"},"consent_version":{"description":"The version of the consent text shown to the visitor; must be the current one","maxLength":60,"type":"string"},"message":{"maxLength":2000,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"phone":{"description":"A Kazakhstan phone number, any spelling","maxLength":32,"type":"string"},"source":{"maxLength":64,"type":"string"},"telegram":{"description":"A Telegram username, with or without @","maxLength":64,"type":"string"},"website":{"description":"Honeypot, always empty for a human: a filled value is answered like a success and dropped","maxLength":500,"type":"string"}},"required":["name","consent"],"type":"object"},"LeadItemView":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","type":"string"},"id":{"description":"led_...","type":"string"},"message":{"type":"string"},"name":{"type":"string"},"page_slug":{"type":"string"},"source":{"type":"string"},"telegram":{"type":"string"},"test":{"type":"boolean"}},"required":["id","source","page_slug","message","test","created_at"],"type":"object"},"LeadView":{"additionalProperties":false,"properties":{"status":{"enum":["received"],"type":"string"}},"required":["status"],"type":"object"},"LearnExchangeView":{"additionalProperties":false,"properties":{"student_token":{"description":"Send it as X-Student-Token. Shown once.","type":"string"}},"required":["student_token"],"type":"object"},"LessonAttachmentView":{"additionalProperties":false,"properties":{"content_type":{"type":"string"},"id":{"description":"att_...","type":"string"},"name":{"type":"string"},"size":{"description":"Bytes.","format":"int64","type":"integer"}},"required":["id","content_type","size"],"type":"object"},"LessonFileView":{"additionalProperties":false,"properties":{"content_type":{"type":"string"},"key":{"description":"Object key in the course bucket.","type":"string"},"name":{"type":"string"},"size":{"description":"Bytes.","format":"int64","type":"integer"}},"required":["key","content_type","size"],"type":"object"},"LessonRequest":{"additionalProperties":false,"properties":{"drip_date":{"description":"Open on this day, YYYY-MM-DD (midnight Asia/Almaty). Exclusive with drip_days.","type":"string"},"drip_days":{"description":"Open this many days after enrollment (midnight Asia/Almaty); 0 at once.","format":"int64","maximum":3650,"minimum":0,"type":"integer"},"duration_seconds":{"description":"Video length when known.","format":"int64","maximum":86400,"minimum":1,"type":"integer"},"free_preview":{"description":"Anyone may read this lesson from the sales page.","type":"boolean"},"kind":{"description":"Any kind may be created as a draft. A file lesson gets its file by upload + confirm; file on replace keeps it.","enum":["text","video_url","file"],"type":"string"},"module_id":{"description":"mod_...; required on create; on replace it moves the lesson to the end of that module.","type":"string"},"text":{"description":"Plain text of a text lesson.","maxLength":100000,"type":"string"},"text_format":{"description":"Default plain on create; empty on replace keeps the current.","enum":["plain","markdown",""],"type":"string"},"title":{"maxLength":200,"minLength":1,"type":"string"},"video_url":{"description":"https link of a video_url lesson.","maxLength":2000,"type":"string"}},"required":["title","kind"],"type":"object"},"LessonRow":{"additionalProperties":false,"properties":{"done":{"format":"int64","type":"integer"},"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title","done"],"type":"object"},"LessonView":{"additionalProperties":false,"properties":{"attachments":{"items":{"$ref":"#/components/schemas/LessonAttachmentView"},"type":"array"},"drip_date":{"description":"Opens on this day (YYYY-MM-DD), at midnight Asia/Almaty.","type":"string"},"drip_days":{"description":"Opens this many days after enrollment, at midnight Asia/Almaty.","format":"int64","type":"integer"},"duration_seconds":{"description":"Video length when known.","format":"int64","type":"integer"},"file":{"$ref":"#/components/schemas/LessonFileView"},"free_preview":{"description":"Anyone may read this lesson from the sales page.","type":"boolean"},"id":{"description":"lsn_...","type":"string"},"kind":{"enum":["text","video_url","file"],"type":"string"},"module_id":{"description":"mod_...","type":"string"},"pending_file":{"$ref":"#/components/schemas/LessonFileView","description":"An uploaded file not confirmed yet; the lesson still shows its old content."},"position":{"format":"int64","type":"integer"},"text":{"type":"string"},"text_format":{"description":"How Text is rendered.","enum":["plain","markdown"],"type":"string"},"title":{"type":"string"},"video_url":{"type":"string"}},"required":["id","module_id","title","position","kind","text_format","free_preview","attachments"],"type":"object"},"LimitsView":{"additionalProperties":false,"properties":{"actions_per_rule":{"format":"int64","type":"integer"},"conditions_per_rule":{"format":"int64","type":"integer"},"max_attempts_per_action":{"format":"int64","type":"integer"},"rules_per_merchant":{"format":"int64","type":"integer"}},"required":["rules_per_merchant","conditions_per_rule","actions_per_rule","max_attempts_per_action"],"type":"object"},"LinkPhoneRequestInputBody":{"additionalProperties":false,"properties":{"phone":{"description":"Kazakhstan phone; any common spelling.","maxLength":32,"minLength":10,"type":"string"}},"required":["phone"],"type":"object"},"LinkPhoneVerifyInputBody":{"additionalProperties":false,"properties":{"code":{"maxLength":6,"minLength":6,"pattern":"^[0-9]{6}$","type":"string"},"phone":{"maxLength":32,"minLength":10,"type":"string"}},"required":["phone","code"],"type":"object"},"LinkTelegramCallbackInputBody":{"additionalProperties":false,"properties":{"code":{"description":"The code query parameter Telegram added to the redirect URI.","maxLength":2048,"minLength":1,"type":"string"},"state":{"description":"The state query parameter, unchanged.","maxLength":128,"minLength":1,"type":"string"}},"required":["code","state"],"type":"object"},"LinkWhatsAppPollInputBody":{"additionalProperties":false,"properties":{"flow_token":{"description":"The flow_token from start.","maxLength":128,"minLength":1,"type":"string"}},"required":["flow_token"],"type":"object"},"LinkWhatsAppStartInputBody":{"additionalProperties":false,"properties":{"phone":{"description":"Kazakhstan phone; any common spelling.","maxLength":32,"minLength":10,"type":"string"}},"required":["phone"],"type":"object"},"LinkedMethods":{"additionalProperties":false,"properties":{"phone":{"description":"Masked phone, e.g. +7 701 *** ** 67. Absent when none is linked.","type":"string"},"telegram":{"description":"Telegram username. Absent when none is linked or the account has no username.","type":"string"},"telegram_linked":{"description":"Whether a Telegram account is linked.","type":"boolean"},"whatsapp_login_available":{"description":"Whether sign-in and phone linking by a WhatsApp push is configured on this server.","type":"boolean"}},"required":["telegram_linked","whatsapp_login_available"],"type":"object"},"ListOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/CodeView"},"type":"array"}},"required":["data"],"type":"object"},"ListOutputBody":{"additionalProperties":false,"properties":{"data":{"description":"The merchant's API keys, newest first.","items":{"$ref":"#/components/schemas/Key"},"type":"array"}},"required":["data"],"type":"object"},"ListOutputBody1":{"additionalProperties":false,"properties":{"config":{"$ref":"#/components/schemas/ConfigView"},"data":{"items":{"$ref":"#/components/schemas/DomainView"},"type":"array"}},"required":["data","config"],"type":"object"},"LoginChallengeView":{"additionalProperties":false,"properties":{"challenge_id":{"description":"Send it back with the code. Its five wrong guesses are counted on it alone.","type":"string"}},"required":["challenge_id"],"type":"object"},"LoginEntry":{"additionalProperties":false,"properties":{"at":{"description":"When it happened (UTC); show it in the person's time zone.","format":"date-time","type":"string"},"can_report":{"description":"'Это не я' is available: a successful sign-in not yet reported and not the current session.","type":"boolean"},"current":{"description":"The session this request is made with.","type":"boolean"},"device_client":{"description":"app, edge, opera, yandex, firefox, chrome, safari, browser, or empty when unknown.","type":"string"},"device_os":{"description":"Windows, macOS, Linux, Android, iOS, or empty when unknown.","type":"string"},"id":{"description":"lgn_...","type":"string"},"ip_masked":{"description":"The network the attempt came from, masked: 5.34.33.x for IPv4, 2a02:6b8:1234::/48 for IPv6. Empty when unknown.","type":"string"},"method":{"description":"whatsapp_button: the confirmation button in WhatsApp. whatsapp_code: the code sent to WhatsApp. telegram: Telegram. app_link: the app opened the cabinet with a link. admin: the admin panel.","enum":["whatsapp_button","whatsapp_code","telegram","app_link","admin"],"type":"string"},"new_device":{"description":"A successful sign-in from a device and network this account had not signed in from before.","type":"boolean"},"reason":{"description":"Why a failed or blocked attempt did not sign in.","enum":["code_invalid","code_attempts","push_unanswered","push_send_failed","push_throttled"],"type":"string"},"result":{"description":"success: signed in. failed: it did not work (wrong code, nobody confirmed, the message was not sent). blocked: refused by a limit. cancelled: signed in, then the person pressed 'Это не я' and the session was closed.","enum":["success","failed","blocked","cancelled"],"type":"string"},"session_live":{"description":"The session this sign-in opened is still active.","type":"boolean"}},"required":["id","at","method","result","device_os","device_client","ip_masked","new_device","current","session_live","can_report"],"type":"object"},"LotResource":{"additionalProperties":false,"properties":{"closed_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"currency":{"enum":["KZT"],"type":"string"},"current":{"description":"The lot on air","type":"boolean"},"id":{"description":"Lot id (prd_...)","type":"string"},"image_url":{"type":"string"},"object":{"enum":["live_lot"],"type":"string"},"page_id":{"type":"string"},"price":{"description":"Tiyn (1 ₸ = 100 tiyn); whole tenge","format":"int64","type":"integer"},"quantity":{"format":"int64","type":"integer"},"remaining":{"format":"int64","type":"integer"},"reserved":{"description":"Units held by payments in progress","format":"int64","type":"integer"},"sold":{"description":"Paid units","format":"int64","type":"integer"},"status":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","object","page_id","title","price","currency","quantity","sold","reserved","remaining","status","current","created_at","updated_at"],"type":"object"},"LotView":{"additionalProperties":false,"properties":{"currency":{"type":"string"},"current":{"type":"boolean"},"id":{"description":"prd_...","type":"string"},"image_url":{"type":"string"},"price":{"description":"Tiyn, whole tenge","format":"int64","type":"integer"},"price_text":{"description":"The price for display, e.g. \"1 500 ₸\"","type":"string"},"quantity":{"format":"int64","type":"integer"},"remaining":{"description":"Units neither sold nor held by a payment in progress","format":"int64","type":"integer"},"sold":{"format":"int64","type":"integer"},"sold_out":{"type":"boolean"},"title":{"type":"string"}},"required":["id","title","price","price_text","currency","quantity","sold","remaining","sold_out","current"],"type":"object"},"MCPConnectionView":{"additionalProperties":false,"properties":{"sdk_path":{"description":"The SDK script every site of the business can load: https://<subdomain>.<base>/__pb/paybot.js.","type":"string"},"site_url":{"description":"The business's site address, when site hosting is on.","type":"string"},"tool_count":{"format":"int64","type":"integer"},"tools":{"description":"Every tool the endpoint serves, sorted.","items":{"type":"string"},"type":"array"},"url":{"description":"The MCP endpoint of this server: https://<api host>/mcp.","type":"string"}},"required":["url","sdk_path","tool_count","tools"],"type":"object"},"Me-deleteRequest":{"additionalProperties":false,"properties":{"confirm":{"description":"Must be true: the person confirmed the deletion","type":"boolean"}},"required":["confirm"],"type":"object"},"MeBody":{"additionalProperties":false,"properties":{"linked":{"$ref":"#/components/schemas/LinkedMethods"},"memberships":{"items":{"$ref":"#/components/schemas/Membership"},"type":["array","null"]},"user":{"$ref":"#/components/schemas/User"}},"required":["user","memberships","linked"],"type":"object"},"Member":{"additionalProperties":false,"properties":{"created_at":{"description":"When the person joined the merchant.","format":"date-time","type":"string"},"email":{"description":"Masked email, e.g. a***@example.com.","type":"string"},"name":{"type":"string"},"phone":{"description":"Masked phone, e.g. +7 701 *** ** 67.","type":"string"},"role":{"enum":["owner","admin","viewer"],"type":"string"},"telegram_username":{"type":"string"},"user_id":{"description":"User id (usr_...).","type":"string"}},"required":["user_id","role","created_at"],"type":"object"},"MembersOutputBody":{"additionalProperties":false,"properties":{"data":{"description":"The merchant's members, earliest first.","items":{"$ref":"#/components/schemas/Member"},"type":"array"}},"required":["data"],"type":"object"},"Membership":{"additionalProperties":false,"properties":{"merchant_id":{"description":"Merchant id (mch_...); send it as X-Merchant-Id.","type":"string"},"name":{"type":"string"},"role":{"enum":["owner","admin","viewer"],"type":"string"},"status":{"enum":["active","suspended"],"type":"string"},"subdomain":{"description":"The business subdomain (<subdomain>.paybot.kz). Returned by merchant creation and GET /v1/merchants/{id}.","type":"string"}},"required":["merchant_id","name","role","status"],"type":"object"},"MerchantDetail":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","type":"string"},"id":{"description":"Merchant id (mch_...).","type":"string"},"logo_upload_id":{"description":"The merchant's logo (upl_...): a confirmed template_image upload. Public pages show it next to the name.","type":"string"},"name":{"type":"string"},"org_bin":{"description":"Organisation BIN, filled from Kaspi.","type":"string"},"org_name":{"description":"Organisation name, filled from Kaspi once a cashier is connected.","type":"string"},"role":{"description":"The caller's role in this merchant.","enum":["owner","admin","viewer"],"type":"string"},"status":{"enum":["active","suspended"],"type":"string"},"subdomain":{"description":"The business subdomain: the generated site is <subdomain>.paybot.kz. Change it with PUT /v1/builder/subdomain.","type":"string"},"timezone":{"description":"IANA timezone the cabinet shows dates in; Asia/Almaty unless changed.","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","name","status","role","timezone","subdomain","created_at","updated_at"],"type":"object"},"MerchantsOutputBody":{"additionalProperties":false,"properties":{"merchants":{"items":{"$ref":"#/components/schemas/Membership"},"type":["array","null"]}},"required":["merchants"],"type":"object"},"MessageView":{"additionalProperties":false,"properties":{"body":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"role":{"enum":["user","assistant","system"],"type":"string"},"version_id":{"type":["string","null"]}},"required":["id","role","body","version_id","created_at"],"type":"object"},"Messages":{"additionalProperties":false,"properties":{"ended":{"description":"Sent when access ends.","type":"string"},"expiring":{"description":"Sent before period_end at each reminder, under it a renewal button. {link} is optional and dropped from the text.","type":"string"},"granted":{"description":"Sent after payment, under it the «Войти в канал» button. {link} is optional and dropped from the text.","type":"string"},"welcome":{"description":"Sent after /start, under it the «Оплатить в Kaspi» button. {link} is optional and dropped from the text (the link is the button).","type":"string"}},"required":["welcome","granted","expiring","ended"],"type":"object"},"ModuleView":{"additionalProperties":false,"properties":{"id":{"description":"mod_...","type":"string"},"lessons":{"items":{"$ref":"#/components/schemas/LessonView"},"type":"array"},"position":{"format":"int64","type":"integer"},"title":{"type":"string"}},"required":["id","title","position","lessons"],"type":"object"},"NotMeResult":{"additionalProperties":false,"properties":{"closed":{"description":"The session this sign-in opened was still active and has been signed out.","type":"boolean"},"reported":{"description":"The entry is now marked cancelled. False when it already was (the call is idempotent).","type":"boolean"}},"required":["closed","reported"],"type":"object"},"NotificationLinkView":{"additionalProperties":false,"properties":{"bot_username":{"description":"The platform bot's @username, without the @","type":"string"},"expires_at":{"format":"date-time","type":"string"},"url":{"description":"Open it in Telegram and press Start. Shown once; valid for 15 minutes.","type":"string"}},"required":["url","bot_username","expires_at"],"type":"object"},"NotificationPrefsView":{"additionalProperties":false,"properties":{"daily_summary":{"$ref":"#/components/schemas/DailySummaryView"},"events":{"items":{"$ref":"#/components/schemas/EventPrefView"},"type":"array"},"push":{"$ref":"#/components/schemas/PushChannelView"},"quiet_hours":{"$ref":"#/components/schemas/QuietHoursView"},"telegram":{"$ref":"#/components/schemas/TelegramChannelView"}},"required":["events","quiet_hours","daily_summary","push","telegram"],"type":"object"},"NotificationSettingsView":{"additionalProperties":false,"properties":{"available_events":{"items":{"type":"string"},"type":"array"},"telegram":{"$ref":"#/components/schemas/NotificationTelegramSettings"}},"required":["telegram","available_events"],"type":"object"},"NotificationTelegramSettings":{"additionalProperties":false,"properties":{"enabled":{"description":"Master switch","type":"boolean"},"events":{"items":{"enum":["order.paid","payment.success","session.expired","approval.requested"],"type":"string"},"type":"array"},"linked":{"description":"A Telegram chat is bound (the user pressed Start after the link)","type":"boolean"}},"required":["linked","enabled","events"],"type":"object"},"NotifyBody":{"additionalProperties":false,"properties":{"consent":{"description":"The buyer agreed to be contacted","type":"boolean"},"consent_version":{"description":"store.LeadConsentVersion","maxLength":60,"type":"string"},"message":{"description":"What the buyer wanted to pay for","maxLength":2000,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"phone":{"description":"A Kazakhstan phone number, any spelling","maxLength":32,"type":"string"},"telegram":{"maxLength":64,"type":"string"}},"required":["name","consent"],"type":"object"},"OIDCStartBody":{"additionalProperties":false,"properties":{"authorization_url":{"description":"Send the browser here (a full-page redirect, not a popup or an iframe).","type":"string"},"expires_at":{"description":"The sign-in must be finished before this time (10 minutes).","format":"date-time","type":"string"},"flow_token":{"description":"Only with X-PayBot-Client: app: send it back as flow_token to /auth/telegram/oidc/callback. Keep it in memory; it is single use.","type":"string"}},"required":["authorization_url","expires_at"],"type":"object"},"ObjectRow":{"additionalProperties":false,"properties":{"id":{"type":"string"},"kind":{"enum":["store","course","channel","bot"],"type":"string"},"reached":{"format":"int64","type":"integer"},"reached_key":{"type":"string"},"title":{"type":"string"},"visits":{"format":"int64","type":"integer"}},"required":["kind","id","title","visits","reached","reached_key"],"type":"object"},"ObjectStats":{"additionalProperties":false,"properties":{"audience":{"format":"int64","type":"integer"},"empty":{"description":"Nothing happened in the period","type":"boolean"},"from":{"description":"First day, YYYY-MM-DD in the asked time zone","type":"string"},"funnel":{"items":{"$ref":"#/components/schemas/Step"},"type":"array"},"id":{"type":"string"},"items":{"items":{"$ref":"#/components/schemas/ItemRow"},"type":"array"},"kind":{"enum":["store","course","channel","bot"],"type":"string"},"lost":{"description":"Blocked the bot / lost access in the period","format":"int64","type":"integer"},"mode":{"enum":["live","test"],"type":"string"},"paid_amount":{"description":"Tiyn paid in the period, net of refunds (store, course, channel)","format":"int64","type":"integer"},"period":{"enum":["today","7d","30d"],"type":"string"},"returning_buyers":{"format":"int64","type":"integer"},"series":{"items":{"$ref":"#/components/schemas/Point"},"type":"array"},"sources":{"items":{"$ref":"#/components/schemas/SourceRow"},"type":"array"},"students":{"$ref":"#/components/schemas/Students"},"surfaces":{"additionalProperties":{"format":"int64","type":"integer"},"type":"object"},"title":{"type":"string"},"to":{"description":"Last day, inclusive","type":"string"},"visits_tracked":{"type":"boolean"}},"required":["kind","id","title","period","from","to","mode","visits_tracked","funnel","series","sources","items","surfaces","returning_buyers","paid_amount","empty"],"type":"object"},"ObjectsView":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/ObjectRow"},"type":"array"},"period":{"enum":["today","7d","30d"],"type":"string"}},"required":["period","data"],"type":"object"},"OfferView":{"additionalProperties":false,"properties":{"buy_url":{"description":"The checkout page, relative to the public host: /p/{slug} or /p/{slug}/buy/{handle}","type":"string"},"cover_url":{"description":"A public image address, null without one","type":["string","null"]},"description":{"type":"string"},"handle":{"description":"Stable within the business: a product's handle, a deployment's slug","type":"string"},"in_stock":{"type":"boolean"},"kind":{"enum":["product","course","channel"],"type":"string"},"period_count":{"description":"Channel plans: the number of period units","format":"int64","type":"integer"},"period_unit":{"description":"Channel plans: the billing period's unit; empty for a one-time price","enum":["day","month"],"type":"string"},"price":{"format":"int64","type":"integer"},"price_text":{"description":"\"15 000 ₸\"; empty when the price is zero or unknown","type":"string"},"title":{"type":"string"}},"required":["kind","handle","title","description","price_text","price","cover_url","buy_url","in_stock"],"type":"object"},"OffersView":{"additionalProperties":false,"properties":{"currency":{"type":"string"},"offers":{"description":"Products first (catalogue order), then courses, then channel plans","items":{"$ref":"#/components/schemas/OfferView"},"type":"array"},"slug":{"description":"The store page the offers were read for","type":"string"}},"required":["slug","currency","offers"],"type":"object"},"OidcCallbackInputBody":{"additionalProperties":false,"properties":{"code":{"description":"The code query parameter Telegram added to the redirect URI.","maxLength":2048,"minLength":1,"type":"string"},"flow_token":{"description":"Only with X-PayBot-Client: app: the flow_token from start. Ignored for the web, which is bound by its cookie.","maxLength":128,"type":"string"},"state":{"description":"The state query parameter, unchanged.","maxLength":128,"minLength":1,"type":"string"}},"required":["code","state"],"type":"object"},"OidcStartInputBody":{"additionalProperties":false,"properties":{"phone":{"description":"Also ask Telegram for the user's phone number (the user may decline).","type":"boolean"}},"type":"object"},"OpView":{"additionalProperties":false,"properties":{"description":{"type":"string"},"op":{"type":"string"}},"required":["op","description"],"type":"object"},"OrderBody":{"additionalProperties":false,"properties":{"address":{"description":"Required by a courier delivery","maxLength":500,"type":"string"},"attribution":{"$ref":"#/components/schemas/Attribution"},"comment":{"maxLength":500,"type":"string"},"delivery":{"description":"A delivery option code from the page","maxLength":40,"minLength":1,"type":"string"},"items":{"items":{"$ref":"#/components/schemas/OrderLineBody"},"maxItems":50,"minItems":1,"type":["array","null"]},"name":{"maxLength":100,"type":"string"},"phone":{"description":"A Kazakhstan mobile number","maxLength":20,"minLength":1,"type":"string"},"promo_code":{"description":"A promo code; the server takes its discount off the lines. A code that does not apply is a 422 on promo_code.","maxLength":40,"type":"string"}},"required":["items","delivery","phone"],"type":"object"},"OrderHistoryView":{"additionalProperties":false,"properties":{"actor":{"type":"string"},"at":{"format":"date-time","type":"string"},"from":{"type":"string"},"reason":{"type":"string"},"to":{"type":"string"}},"required":["to","actor","at"],"type":"object"},"OrderItemView":{"additionalProperties":false,"properties":{"line_total":{"format":"int64","type":"integer"},"product_title":{"type":"string"},"quantity":{"format":"int64","type":"integer"},"sku":{"type":"string"},"unit_price":{"format":"int64","type":"integer"},"variant_id":{"description":"prd_...","type":"string"},"variant_title":{"type":"string"}},"required":["variant_id","sku","product_title","variant_title","unit_price","quantity","line_total"],"type":"object"},"OrderLineBody":{"additionalProperties":false,"properties":{"item_id":{"description":"A variant's item_id from the page","maxLength":64,"minLength":1,"type":"string"},"quantity":{"format":"int64","maximum":99,"minimum":1,"type":"integer"}},"required":["item_id","quantity"],"type":"object"},"OrderPageDelivery":{"additionalProperties":false,"properties":{"address":{"type":"string"},"kind":{"enum":["pickup","courier","courier_free_over","arrangement"],"type":"string"},"title":{"type":"string"}},"required":["title","kind"],"type":"object"},"OrderPageDigital":{"additionalProperties":false,"properties":{"note":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"required":["title"],"type":"object"},"OrderPageItem":{"additionalProperties":false,"properties":{"line_total":{"format":"int64","type":"integer"},"quantity":{"format":"int64","type":"integer"},"title":{"type":"string"},"unit_price":{"format":"int64","type":"integer"},"variant":{"type":"string"}},"required":["title","quantity","unit_price","line_total"],"type":"object"},"OrderPageStep":{"additionalProperties":false,"properties":{"at":{"format":"date-time","type":"string"},"status":{"enum":["new","paid","packed","shipped","done","cancelled"],"type":"string"}},"required":["status","at"],"type":"object"},"OrderPageView":{"additionalProperties":false,"properties":{"comment":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"delivery":{"$ref":"#/components/schemas/OrderPageDelivery"},"delivery_price":{"format":"int64","type":"integer"},"digital":{"description":"What the buyer gets for a paid order (a link and/or a note per product); empty before payment, after a cancel and after a refund","items":{"$ref":"#/components/schemas/OrderPageDigital"},"type":"array"},"discount":{"description":"Promo-code discount in tiyn (0: none)","format":"int64","type":"integer"},"items":{"items":{"$ref":"#/components/schemas/OrderPageItem"},"type":["array","null"]},"merchant_name":{"type":"string"},"number":{"description":"The short number the buyer quotes to the seller","type":"string"},"paid_at":{"format":"date-time","type":"string"},"promo_code":{"type":"string"},"refunded_at":{"description":"Set when the payment was returned to the buyer in full («Возврат»); the status is unchanged","format":"date-time","type":"string"},"seller":{"$ref":"#/components/schemas/Public","description":"How to reach the seller; absent when the merchant has not filled it in"},"shop_slug":{"description":"The page the order was placed on; empty when it is gone","type":"string"},"status":{"enum":["new","paid","packed","shipped","done","cancelled"],"type":"string"},"steps":{"items":{"$ref":"#/components/schemas/OrderPageStep"},"type":["array","null"]},"subtotal":{"format":"int64","type":"integer"},"test":{"description":"A test-mode order: no money moved","type":"boolean"},"total":{"format":"int64","type":"integer"}},"required":["number","status","test","steps","items","subtotal","discount","delivery_price","total","delivery","created_at","digital","merchant_name"],"type":"object"},"OrderView":{"additionalProperties":false,"properties":{"address":{"type":"string"},"buyer_name":{"type":"string"},"buyer_phone":{"description":"Only on GET /orders/{id}.","type":"string"},"cancel_reason":{"type":"string"},"comment":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"currency":{"type":"string"},"delivery_code":{"type":"string"},"delivery_kind":{"type":"string"},"delivery_price":{"format":"int64","type":"integer"},"delivery_title":{"type":"string"},"discount":{"description":"Promo-code discount in tiyn (0: none); total = subtotal - discount + delivery_price.","format":"int64","type":"integer"},"history":{"description":"Only on GET /orders/{id}.","items":{"$ref":"#/components/schemas/OrderHistoryView"},"type":["array","null"]},"id":{"description":"ord_...","type":"string"},"items":{"items":{"$ref":"#/components/schemas/OrderItemView"},"type":["array","null"]},"mode":{"enum":["live","test"],"type":"string"},"paid_at":{"format":"date-time","type":"string"},"payment_id":{"description":"pay_...","type":"string"},"promo_code":{"type":"string"},"refunded_at":{"description":"Set when the order's payment was refunded in full; the status is unchanged (shown as «Возврат»)","format":"date-time","type":"string"},"reserved_until":{"format":"date-time","type":"string"},"source":{"type":"string"},"status":{"enum":["new","paid","packed","shipped","done","cancelled"],"type":"string"},"stock_short":{"description":"Paid after its reservation was released, and the goods were gone: resolve by hand.","type":"boolean"},"stock_state":{"enum":["reserved","committed","released","restocked","simulated"],"type":"string"},"subtotal":{"format":"int64","type":"integer"},"total":{"format":"int64","type":"integer"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","mode","status","source","currency","subtotal","discount","delivery_price","total","delivery_code","delivery_kind","delivery_title","buyer_name","address","comment","stock_state","stock_short","items","created_at","updated_at"],"type":"object"},"OrdersOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/PlanOrderView"},"type":"array"}},"required":["data"],"type":"object"},"OverviewDay":{"additionalProperties":false,"properties":{"day":{"description":"YYYY-MM-DD in the business's time zone","type":"string"},"payments":{"format":"int64","type":"integer"},"revenue":{"description":"Net of refunds, tiyn","format":"int64","type":"integer"}},"required":["day","revenue","payments"],"type":"object"},"OverviewTotals":{"additionalProperties":false,"properties":{"avg_check":{"description":"gross / payments, tiyn; 0 without payments","format":"int64","type":"integer"},"gross":{"description":"Paid, tiyn","format":"int64","type":"integer"},"new_customers":{"description":"Clients whose first purchase falls in the period","format":"int64","type":"integer"},"payments":{"description":"Paid payments","format":"int64","type":"integer"},"refunded":{"description":"Refunded, tiyn (a refund counts on the day it was made)","format":"int64","type":"integer"},"refunds":{"description":"Refunds made","format":"int64","type":"integer"},"repeat_customers":{"description":"Clients who bought in the period and had bought before","format":"int64","type":"integer"},"revenue":{"description":"Paid minus refunded, tiyn","format":"int64","type":"integer"}},"required":["revenue","gross","refunded","payments","refunds","avg_check","new_customers","repeat_customers"],"type":"object"},"OverviewView":{"additionalProperties":false,"properties":{"current":{"$ref":"#/components/schemas/OverviewTotals"},"from":{"description":"First day, YYYY-MM-DD","type":"string"},"mode":{"enum":["live","test"],"type":"string"},"previous":{"$ref":"#/components/schemas/OverviewTotals"},"previous_from":{"type":"string"},"previous_series":{"items":{"$ref":"#/components/schemas/OverviewDay"},"type":"array"},"previous_to":{"type":"string"},"series":{"description":"Every day of the period, oldest first, zeros included","items":{"$ref":"#/components/schemas/OverviewDay"},"type":"array"},"timezone":{"description":"IANA zone the days are cut in","type":"string"},"to":{"description":"Last day, inclusive","type":"string"}},"required":["mode","timezone","from","to","current","series","previous_series"],"type":"object"},"PageApprovalView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/ApprovalView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageAuditEntry":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/AuditEntry"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageContactView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/ContactView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageCourseView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/CourseView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageDeliveryView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/DeliveryView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageDeploymentSummary":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/DeploymentSummary"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageEnrollmentView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/EnrollmentView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageGrantView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/GrantView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageLoginEntry":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/LoginEntry"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageOrderView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/OrderView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PagePaymentView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/PaymentView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PagePlanView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/PlanView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageProductView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/ProductView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageResource":{"additionalProperties":false,"properties":{"current_lot_id":{"description":"The lot on air; null between lots","type":["string","null"]},"id":{"description":"Page id (prd_...), the live_page deployment","type":"string"},"lots":{"items":{"$ref":"#/components/schemas/LotResource"},"type":"array"},"object":{"enum":["live_page"],"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"version":{"description":"State version; the id of the latest SSE event","format":"int64","type":"integer"}},"required":["id","object","slug","title","current_lot_id","version","lots"],"type":"object"},"PageRunView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/RunView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageSubscriberView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/SubscriberView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageSubscriptionView":{"additionalProperties":false,"properties":{"data":{"description":"The items on this page.","items":{"$ref":"#/components/schemas/SubscriptionView"},"type":"array"},"has_more":{"description":"Whether another page exists.","type":"boolean"},"next_cursor":{"description":"Opaque cursor for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor","has_more"],"type":"object"},"PageView":{"additionalProperties":false,"properties":{"published":{"type":"boolean"},"slug":{"type":"string"},"template":{"description":"store, course, access_channel, payment_link, ...","type":"string"}},"required":["slug","template","published"],"type":"object"},"Pay-problems-resolve-refusedResponse":{"additionalProperties":false,"properties":{"resolved":{"format":"int64","type":"integer"}},"required":["resolved"],"type":"object"},"Payment-refundsResponse":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/RefundStatusView"},"type":"array"}},"required":["data"],"type":"object"},"PaymentStatusView":{"additionalProperties":false,"properties":{"amount":{"description":"In tiyn","format":"int64","type":"integer"},"deep_link":{"description":"Opens the payment in the Kaspi app (pending QR payments)","type":"string"},"expires_at":{"description":"After this Kaspi can no longer complete the payment","format":"date-time","type":"string"},"kind":{"enum":["qr","invoice"],"type":"string"},"paid_at":{"format":"date-time","type":"string"},"qr_token":{"description":"Encode this into the QR image (pending QR payments)","type":"string"},"scan_expires_at":{"description":"After this the QR no longer scans","format":"date-time","type":"string"},"status":{"type":"string"}},"required":["status"],"type":"object"},"PaymentView":{"additionalProperties":false,"properties":{"account_id":{"description":"Kaspi account the money goes to (kac_...); absent in test mode","type":"string"},"amount":{"description":"Amount in tiyn (1 ₸ = 100 tiyn)","format":"int64","type":"integer"},"client_ref":{"description":"The reference you sent; absent when none was sent","type":"string"},"created_at":{"format":"date-time","type":"string"},"currency":{"enum":["KZT"],"type":"string"},"deep_link":{"description":"Opens the Kaspi app on a phone (QR payments)","type":"string"},"description":{"type":"string"},"expires_at":{"description":"After this Kaspi can no longer complete the payment","format":"date-time","type":"string"},"failure_reason":{"description":"Why the payment is not paid (failed, expired)","type":"string"},"id":{"description":"Payment id (pay_...)","type":"string"},"kaspi_operation_id":{"description":"Kaspi's own operation id, once Kaspi accepted the payment","format":"int64","type":"integer"},"kind":{"enum":["invoice","qr"],"type":"string"},"metadata":{"description":"Your own key-value data, echoed in webhooks"},"mode":{"enum":["live","test"],"type":"string"},"object":{"enum":["payment"],"type":"string"},"paid_at":{"format":"date-time","type":"string"},"paid_at_source":{"description":"kaspi: paid_at is the operation time Kaspi reported; observed: the moment PayBot noticed the payment","enum":["kaspi","observed"],"type":"string"},"payer_phone_last4":{"description":"Last four digits of the invoice payer's phone","type":"string"},"qr_token":{"description":"Encode this into the QR image (QR payments)","type":"string"},"receipt_path":{"description":"The buyer's confirmation page, /p/r/{token}, once the payment is paid","type":"string"},"refundable_amount":{"description":"Tiyn that can still be refunded","format":"int64","type":"integer"},"refunded_amount":{"description":"Tiyn returned to the buyer so far","format":"int64","type":"integer"},"scan_expires_at":{"description":"After this the QR no longer scans (QR payments); expires_at adds the confirmation window","format":"date-time","type":"string"},"source_id":{"description":"The uuid of the deployment (page) that started the payment; filter with GET /payments?source_id=","type":"string"},"source_template":{"description":"The template of the page that started the payment (payment_link, store, course, live_page, access_channel; landing_service on historical payments of the retired landing pages); absent for a payment created through the API","type":"string"},"status":{"enum":["creating","pending","paid","failed","expired","refunded"],"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","object","status","kind","mode","amount","currency","metadata","refunded_amount","refundable_amount","created_at","updated_at"],"type":"object"},"PhoneInputBody":{"additionalProperties":false,"properties":{"phone":{"description":"Kazakhstan phone; any common spelling.","maxLength":32,"minLength":10,"type":"string"}},"required":["phone"],"type":"object"},"PlanConfig":{"additionalProperties":false,"properties":{"best":{"type":"boolean"},"days":{"format":"int64","type":"integer"},"grace_days":{"format":"int64","type":"integer"},"key":{"type":"string"},"name":{"type":"string"},"period":{"type":"string"},"price":{"format":"int64","type":"integer"},"reminders":{"items":{"format":"int64","type":"integer"},"type":["array","null"]},"trial_days":{"format":"int64","type":"integer"}},"required":["name","price","period","trial_days","grace_days","reminders"],"type":"object"},"PlanLimitsView":{"additionalProperties":false,"properties":{"api_keys":{"description":"Active API keys at once; null is unlimited","format":"int64","type":["integer","null"]},"bots":{"description":"Connected Telegram bots at once; null is unlimited","format":"int64","type":["integer","null"]},"businesses":{"description":"Businesses one user may own, by the plans of the businesses it owns; null is unlimited","format":"int64","type":["integer","null"]},"channels":{"description":"Paid Telegram channels (a channel with a plan) at once; null is unlimited","format":"int64","type":["integer","null"]},"courses":{"description":"Courses, draft or published, at once; null is unlimited","format":"int64","type":["integer","null"]},"custom_domains":{"description":"Own domains (hostnames) for the site or a page at once; 0 on plans without the feature; null is unlimited","format":"int64","type":["integer","null"]},"generations_per_month":{"description":"Generator runs (credits) per calendar month; null is unlimited","format":"int64","type":["integer","null"]},"kaspi_accounts":{"description":"Connected Kaspi cashiers at once; null is unlimited","format":"int64","type":["integer","null"]},"objects":{"description":"Stores plus the published site at once; null is unlimited","format":"int64","type":["integer","null"]},"payments_per_month":{"description":"Live payments per calendar month (UTC); null is unlimited","format":"int64","type":["integer","null"]}},"required":["payments_per_month","generations_per_month","api_keys","bots","channels","courses","objects","kaspi_accounts","businesses","custom_domains"],"type":"object"},"PlanOrderView":{"additionalProperties":false,"properties":{"amount":{"description":"Tiyn","format":"int64","type":"integer"},"applied_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"deep_link":{"description":"Open in the Kaspi app to pay","type":"string"},"failure_reason":{"type":"string"},"id":{"description":"ord_...","type":"string"},"mode":{"enum":["live","test"],"type":"string"},"payment_status":{"description":"The platform payment's status","type":"string"},"periods":{"format":"int64","type":"integer"},"plan":{"type":"string"},"qr_token":{"description":"Render as a QR code to pay with the Kaspi app","type":"string"},"status":{"enum":["pending","applied","failed"],"type":"string"}},"required":["id","plan","periods","amount","mode","status","created_at"],"type":"object"},"PlanStep":{"additionalProperties":false,"properties":{"description":{"description":"Human-readable, plain text.","type":"string"},"object":{"description":"What is created or changed, e.g. payment_link, public_page.","type":"string"}},"required":["object","description"],"type":"object"},"PlanUsageView":{"additionalProperties":false,"properties":{"limit":{"description":"null is unlimited","format":"int64","type":["integer","null"]},"metric":{"enum":["payments","generations","api_keys","bots","channels","courses","objects","kaspi_accounts","businesses","custom_domains"],"type":"string"},"soft_limit":{"description":"Warnings start here; null when unlimited","format":"int64","type":["integer","null"]},"state":{"description":"exceeded: the next one is refused with plan_limit_reached","enum":["ok","warning","exceeded"],"type":"string"},"used":{"format":"int64","type":"integer"}},"required":["metric","used","limit","soft_limit","state"],"type":"object"},"PlanView":{"additionalProperties":false,"properties":{"active":{"description":"Only an active plan takes purchases","type":"boolean"},"archived_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"currency":{"enum":["KZT"],"type":"string"},"grace_days":{"description":"Days of access kept after a period ends unpaid","format":"int64","type":"integer"},"id":{"description":"Plan id (pln_...)","type":"string"},"name":{"type":"string"},"object":{"enum":["plan"],"type":"string"},"period_count":{"format":"int64","type":"integer"},"period_unit":{"enum":["day","month"],"type":"string"},"price":{"description":"Price of one period in tiyn (1 ₸ = 100 tiyn); always whole tenge","format":"int64","type":"integer"},"reminder_offsets":{"description":"Days before the end of a period at which subscription.expiring fires, largest first","items":{"format":"int64","type":"integer"},"type":"array"},"trial_days":{"description":"A new subscriber's first period is a free trial of this many days; 0 for none","format":"int64","type":"integer"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","object","name","price","currency","period_unit","period_count","trial_days","grace_days","reminder_offsets","active","created_at","updated_at"],"type":"object"},"PlansOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/PlatformPlanView"},"type":"array"}},"required":["data"],"type":"object"},"PlatformPlanView":{"additionalProperties":false,"properties":{"code":{"type":"string"},"custom_domain":{"description":"The plan includes own domains (limits.custom_domains is above zero or unlimited)","type":"boolean"},"default":{"description":"The plan of a merchant without a paid one","type":"boolean"},"hide_paybot_badge":{"description":"The plan lets the owner switch off the «Сделано на PayBot» link on the published site (pro and business); on the other plans the link is always shown","type":"boolean"},"limits":{"$ref":"#/components/schemas/PlanLimitsView"},"name":{"type":"string"},"period_days":{"format":"int64","type":"integer"},"price":{"description":"Price of one period in tiyn","format":"int64","type":"integer"},"purchasable":{"type":"boolean"},"soft_limit_percent":{"description":"Warnings start at this share of each limit","format":"int64","type":"integer"}},"required":["code","name","price","period_days","soft_limit_percent","default","purchasable","limits","custom_domain","hide_paybot_badge"],"type":"object"},"Point":{"additionalProperties":false,"properties":{"day":{"type":"string"},"reached":{"description":"The funnel's last step that day: paid orders, enrolments, subscriptions or bot starts","format":"int64","type":"integer"},"visits":{"format":"int64","type":"integer"}},"required":["day","visits","reached"],"type":"object"},"PreviewOutBody":{"additionalProperties":false,"properties":{"url":{"description":"The iframe src: https://pv-<project>.<base domain>/?t=<token>","type":"string"}},"required":["url"],"type":"object"},"PreviewView":{"additionalProperties":false,"properties":{"preview_token":{"description":"Send it as X-Preview-Token or ?preview= to see and buy from the page in test mode. Shown once.","type":"string"}},"required":["preview_token"],"type":"object"},"Problem":{"additionalProperties":false,"properties":{"code":{"description":"A stable machine-readable error code, e.g. not_found or idempotency_conflict.","type":"string"},"detail":{"description":"A human-readable explanation of this occurrence.","type":"string"},"errors":{"description":"Field-level validation errors.","items":{"$ref":"#/components/schemas/ErrorDetail"},"type":["array","null"]},"instance":{"description":"A URI reference identifying this occurrence.","type":"string"},"limit":{"description":"With plan_limit_reached: the plan limit that was reached (payments, generations, api_keys, bots, channels, courses, objects, kaspi_accounts, businesses or custom_domains).","type":"string"},"request_id":{"description":"The request id; quote it to support.","type":"string"},"status":{"description":"The HTTP status code.","format":"int64","type":"integer"},"title":{"description":"A short, human-readable summary of the problem type.","type":"string"},"type":{"description":"A URI reference identifying the problem type; about:blank when no page exists.","type":"string"}},"required":["type","title","status","code"],"type":"object"},"ProblemView":{"additionalProperties":false,"properties":{"buyer_phone":{"description":"The buyer's phone when a refused checkout was an invoice, to call back","type":"string"},"created_at":{"format":"date-time","type":"string"},"detail":{"description":"Kind-specific facts: amount (tiyn), reason, ids"},"id":{"description":"prb_...","type":"string"},"kind":{"enum":["checkout_refused","duplicate_paid","reconcile_mismatch","refund_failed","refund_waiting","expired_unchecked","external_refund","paid_late"],"type":"string"},"payment_id":{"type":"string"},"resolved_at":{"format":"date-time","type":"string"}},"required":["id","kind","detail","created_at"],"type":"object"},"ProblemsOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/ProblemView"},"type":"array"},"summary":{"$ref":"#/components/schemas/ProblemsSummaryView"}},"required":["data","summary"],"type":"object"},"ProblemsSummaryView":{"additionalProperties":false,"properties":{"by_kind":{"additionalProperties":{"format":"int64","type":"integer"},"type":"object"},"refused_buyers":{"description":"Buyers who could not pay because Kaspi was unavailable and have not been dealt with","format":"int64","type":"integer"},"refused_since":{"format":"date-time","type":"string"},"total":{"format":"int64","type":"integer"}},"required":["total","by_kind","refused_buyers"],"type":"object"},"ProductPatchRequest":{"additionalProperties":false,"properties":{"delivery_note":{"description":"Digital delivery note; \"\" clears it","maxLength":500,"type":"string"},"delivery_url":{"description":"Digital delivery link; \"\" clears it","maxLength":500,"type":"string"},"description":{"maxLength":2000,"type":"string"},"image_upload_ids":{"description":"Replaces the photos, in display order (ids of ready product_image uploads, at most 8); [] removes them; absent keeps them","items":{"type":"string"},"maxItems":8,"type":"array"},"title":{"maxLength":200,"type":"string"}},"type":"object"},"ProductRequest":{"additionalProperties":false,"properties":{"delivery_note":{"description":"Digital delivery: a note (access code, instructions) shown to the buyer once the order is paid","maxLength":500,"type":"string"},"delivery_url":{"description":"Digital delivery: an https link shown to the buyer once the order is paid; never on the store page","maxLength":500,"type":"string"},"description":{"maxLength":2000,"type":"string"},"handle":{"description":"[a-z0-9][a-z0-9_-]*, unique per merchant","maxLength":64,"minLength":1,"type":"string"},"image_upload_ids":{"description":"Photos in display order: ids (upl_...) of ready uploads with purpose product_image, at most 8","items":{"type":"string"},"maxItems":8,"type":["array","null"]},"title":{"maxLength":200,"minLength":1,"type":"string"},"variants":{"items":{"$ref":"#/components/schemas/VariantRequest"},"maxItems":100,"minItems":1,"type":["array","null"]}},"required":["handle","title","variants"],"type":"object"},"ProductView":{"additionalProperties":false,"properties":{"archived":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"delivery_note":{"description":"Digital delivery: a note (an access code, instructions) the buyer of a paid order gets","type":"string"},"delivery_url":{"description":"Digital delivery: an https link the buyer of a paid order gets on the order page","type":"string"},"description":{"type":"string"},"handle":{"type":"string"},"id":{"description":"prd_...","type":"string"},"images":{"description":"Photos in display order","items":{"$ref":"#/components/schemas/ImageView"},"type":["array","null"]},"title":{"type":"string"},"updated_at":{"format":"date-time","type":"string"},"variants":{"items":{"$ref":"#/components/schemas/VariantView"},"type":["array","null"]}},"required":["id","handle","title","description","archived","variants","images","created_at","updated_at"],"type":"object"},"Profile":{"additionalProperties":false,"properties":{"address":{"type":"string"},"email":{"type":"string"},"hours":{"type":"string"},"instagram":{"description":"An Instagram username without the @; empty when none","type":"string"},"legal_form":{"enum":["ip","too","individual","other"],"type":"string"},"offer_text":{"type":"string"},"offer_version":{"format":"int64","type":"integer"},"phone":{"type":"string"},"privacy_text":{"type":"string"},"registration":{"description":"BIN or IIN, as the merchant writes it","type":"string"},"return_policy":{"type":"string"},"seller_name":{"type":"string"},"telegram":{"description":"A Telegram username without the @; empty when none","type":"string"},"terms_confirmed_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"whatsapp":{"description":"A phone number that answers in WhatsApp; empty when none","type":"string"}},"required":["seller_name","legal_form","registration","address","phone","whatsapp","telegram","instagram","email","hours","return_policy","offer_text","privacy_text","offer_version","updated_at"],"type":"object"},"ProgressView":{"additionalProperties":false,"properties":{"completed_at":{"format":"date-time","type":"string"},"lesson_id":{"type":"string"}},"required":["lesson_id","completed_at"],"type":"object"},"ProjectView":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","type":"string"},"current_version":{"description":"The number of the current version; 0 while the project has none","format":"int64","type":"integer"},"id":{"type":"string"},"messages":{"description":"The last 50 chat messages, oldest first","items":{"$ref":"#/components/schemas/MessageView"},"type":["array","null"]},"paybot_badge":{"$ref":"#/components/schemas/BadgeView","description":"The «Сделано на PayBot» link on the published site"},"published_version":{"description":"The number of the published version, null before the first publish","format":"int64","type":["integer","null"]},"running":{"description":"A run is in progress","type":"boolean"},"site_url":{"description":"The address of the site: https://<subdomain>.<base domain>; empty when site hosting is not configured","type":"string"},"subdomain":{"description":"The business subdomain: <subdomain>.paybot.kz","type":"string"},"title":{"type":"string"}},"required":["id","title","created_at","current_version","published_version","subdomain","site_url","running","paybot_badge","messages"],"type":"object"},"Promo-createRequest":{"additionalProperties":false,"properties":{"code":{"description":"Letters, digits, - and _; stored upper-case.","maxLength":32,"minLength":3,"type":"string"},"expires_at":{"format":"date-time","type":"string"},"kind":{"enum":["percent","fixed"],"type":"string"},"max_uses":{"format":"int64","minimum":1,"type":"integer"},"scope_kind":{"description":"Default all.","enum":["all","course","store","link","channel"],"type":"string"},"scope_ref":{"maxLength":100,"type":"string"},"starts_at":{"format":"date-time","type":"string"},"value":{"description":"percent: 1..99; fixed: tiyn, a whole number of tenge","format":"int64","minimum":1,"type":"integer"}},"required":["code","kind","value"],"type":"object"},"Promo-set-activeRequest":{"additionalProperties":false,"properties":{"active":{"type":"boolean"}},"required":["active"],"type":"object"},"PromoPreviewBody":{"additionalProperties":false,"properties":{"items":{"description":"The cart, for a store","items":{"$ref":"#/components/schemas/Item"},"maxItems":50,"type":["array","null"]},"promo_code":{"maxLength":40,"minLength":1,"type":"string"}},"required":["promo_code"],"type":"object"},"PromoPreviewView":{"additionalProperties":false,"properties":{"discount":{"description":"Tiyn taken off","format":"int64","type":"integer"},"total":{"description":"What the priced lines come to after the discount (a store's delivery is not included)","format":"int64","type":"integer"}},"required":["discount","total"],"type":"object"},"Public":{"additionalProperties":false,"properties":{"address":{"type":"string"},"email":{"type":"string"},"has_offer":{"type":"boolean"},"has_privacy":{"type":"boolean"},"hours":{"type":"string"},"instagram":{"type":"string"},"legal_form":{"type":"string"},"phone":{"type":"string"},"registration":{"type":"string"},"return_policy":{"type":"string"},"seller_name":{"type":"string"},"telegram":{"type":"string"},"whatsapp":{"type":"string"}},"required":["seller_name","legal_form","registration","address","phone","whatsapp","telegram","instagram","email","hours","return_policy","has_offer","has_privacy"],"type":"object"},"Public-notify-payableResponse":{"additionalProperties":false,"properties":{"status":{"enum":["received"],"type":"string"}},"required":["status"],"type":"object"},"PublishOutBody":{"additionalProperties":false,"properties":{"created_delivery_option":{"description":"The business had no delivery option, so the publish created one (\"По договорённости с продавцом\", free) for its store page; the merchant can change it in the catalogue","type":"boolean"},"url":{"description":"The public address of the site","type":"string"},"version_n":{"description":"The number of the published version","format":"int64","type":"integer"}},"required":["url","version_n","created_delivery_option"],"type":"object"},"PurchaseView":{"additionalProperties":false,"properties":{"payment_id":{"description":"The payment to pay (pay_...); null when a trial started instead","type":["string","null"]},"payment_status":{"description":"Status of that payment when it was returned","enum":["creating","pending","paid","failed","expired","refunded"],"type":["string","null"]},"subscription":{"$ref":"#/components/schemas/SubscriptionView"}},"required":["subscription","payment_id","payment_status"],"type":"object"},"PushChannelView":{"additionalProperties":false,"properties":{"configured":{"description":"The installation sends push (EXPO_PUSH_ENABLED)","type":"boolean"},"devices":{"description":"This user's phones registered for push in this business","format":"int64","type":"integer"}},"required":["configured","devices"],"type":"object"},"PutDeviceRequest":{"additionalProperties":false,"properties":{"app_version":{"maxLength":32,"type":"string"},"locale":{"maxLength":35,"type":"string"},"platform":{"enum":["ios","android"],"type":"string"},"provider":{"enum":["apns","fcm","expo"],"type":"string"},"token":{"description":"The push token of this install. Never returned.","maxLength":512,"minLength":8,"type":"string"}},"required":["platform","provider","token"],"type":"object"},"PutNotificationPrefsRequest":{"additionalProperties":false,"properties":{"daily_summary":{"$ref":"#/components/schemas/DailySummaryInput"},"events":{"description":"Rows to change; events not listed keep their choice","items":{"$ref":"#/components/schemas/EventPrefInput"},"maxItems":64,"type":"array"},"quiet_hours":{"$ref":"#/components/schemas/QuietHoursInput"}},"type":"object"},"PutNotificationSettingsRequest":{"additionalProperties":false,"properties":{"telegram":{"$ref":"#/components/schemas/PutNotificationSettingsRequestTelegramStruct"}},"required":["telegram"],"type":"object"},"PutNotificationSettingsRequestTelegramStruct":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"events":{"description":"Events to be told about. Omit to keep the stored list.","items":{"enum":["order.paid","payment.success","session.expired","approval.requested"],"type":"string"},"maxItems":4,"type":"array"}},"required":["enabled"],"type":"object"},"PutView":{"additionalProperties":false,"properties":{"expires_at":{"format":"date-time","type":"string"},"headers":{"additionalProperties":{"type":"string"},"description":"Send exactly these headers (they are signed): Content-Type and Content-Length of the declared file.","type":"object"},"method":{"enum":["PUT"],"type":"string"},"url":{"description":"PUT the file's bytes here, before expires_at. A credential: do not log or share it.","type":"string"}},"required":["method","url","headers","expires_at"],"type":"object"},"QuietHoursInput":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"end":{"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","type":"string"},"start":{"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","type":"string"},"timezone":{"maxLength":64,"type":"string"}},"type":"object"},"QuietHoursView":{"additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"end":{"description":"Local time, HH:MM; may be earlier than start (a night)","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","type":"string"},"start":{"description":"Local time, HH:MM","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","type":"string"},"timezone":{"description":"IANA zone; defaults to the business's zone","type":"string"}},"required":["enabled","start","end","timezone"],"type":"object"},"ReauthBody":{"additionalProperties":false,"properties":{"expires_at":{"description":"Until when dangerous actions are allowed without proving it again.","format":"date-time","type":"string"},"reauth_at":{"description":"When the identity was proved.","format":"date-time","type":"string"}},"required":["reauth_at","expires_at"],"type":"object"},"ReauthOIDCCallbackInputBody":{"additionalProperties":false,"properties":{"code":{"description":"The code query parameter Telegram added to the redirect URI.","maxLength":2048,"minLength":1,"type":"string"},"state":{"description":"The state query parameter, unchanged.","maxLength":128,"minLength":1,"type":"string"}},"required":["code","state"],"type":"object"},"ReauthVerifyInputBody":{"additionalProperties":false,"properties":{"code":{"maxLength":6,"minLength":6,"pattern":"^[0-9]{6}$","type":"string"}},"required":["code"],"type":"object"},"ReceiptView":{"additionalProperties":false,"properties":{"amount":{"description":"Tiyn","format":"int64","type":"integer"},"code":{"description":"The PayBot payment code the buyer can quote","type":"string"},"description":{"description":"What was paid for","type":"string"},"paid_at":{"format":"date-time","type":"string"},"refunded_amount":{"description":"Tiyn returned to the buyer","format":"int64","type":"integer"},"seller_name":{"type":"string"},"seller_phone":{"type":"string"},"status":{"enum":["paid","refunded"],"type":"string"},"test":{"type":"boolean"}},"required":["seller_name","amount","refunded_amount","status","paid_at","code","test"],"type":"object"},"ReconcileReport":{"additionalProperties":false,"properties":{"checked":{"format":"int64","type":"integer"},"external_refunds":{"format":"int64","type":"integer"},"mismatches":{"format":"int64","type":"integer"},"paid_time_fixed":{"format":"int64","type":"integer"}},"required":["checked","external_refunds","paid_time_fixed","mismatches"],"type":"object"},"RecordView":{"additionalProperties":false,"properties":{"name":{"description":"The full record name (the host to create the record for).","type":"string"},"purpose":{"description":"verify: proves the domain is yours; route: sends visitors to PayBot.","enum":["verify","route"],"type":"string"},"type":{"enum":["TXT","CNAME","A","AAAA"],"type":"string"},"value":{"type":"string"}},"required":["purpose","type","name","value"],"type":"object"},"RefundBody":{"additionalProperties":false,"properties":{"amount":{"description":"Amount in tiyn; omit to refund the whole payment. Partial refunds are not supported yet.","format":"int64","minimum":0,"type":"integer"},"reason":{"description":"Shown to the person who approves","maxLength":500,"type":"string"}},"type":"object"},"RefundRequestView":{"additionalProperties":false,"properties":{"amount":{"description":"Amount to refund, in tiyn","format":"int64","type":"integer"},"approval_id":{"description":"Approval id (apr_...)","type":"string"},"approve_url":{"description":"Where a person approves it (the cabinet maps it to its page)","type":"string"},"expires_at":{"description":"After this the request can no longer be approved","format":"date-time","type":"string"},"payment_id":{"type":"string"},"status":{"description":"Always pending: nothing has been refunded yet","enum":["pending"],"type":"string"}},"required":["approval_id","status","approve_url","payment_id","amount","expires_at"],"type":"object"},"RefundStatusView":{"additionalProperties":false,"properties":{"amount":{"description":"Tiyn","format":"int64","type":"integer"},"approval_id":{"description":"apr_...","type":"string"},"created_at":{"format":"date-time","type":"string"},"failure_reason":{"type":"string"},"state":{"enum":["requested","approved","waiting_kaspi","done","failed","rejected","expired"],"type":"string"}},"required":["approval_id","amount","state","created_at"],"type":"object"},"RefusedHealth":{"additionalProperties":false,"properties":{"buyers":{"format":"int64","type":"integer"},"since":{"format":"date-time","type":"string"}},"required":["buyers"],"type":"object"},"Report":{"additionalProperties":false,"properties":{"app_version":{"maxLength":32,"type":"string"},"build":{"description":"Build number (versionCode)","maxLength":16,"type":"string"},"fatal":{"description":"Whether the platform treated it as fatal (the app would have closed)","type":"boolean"},"kind":{"description":"js_error: uncaught JavaScript error; boundary: a React error boundary caught a render error; promise: unhandled promise rejection; native: a native (Java/Kotlin) crash saved by the previous run","enum":["js_error","boundary","promise","native"],"type":"string"},"message":{"maxLength":500,"type":"string"},"name":{"description":"Error name, e.g. TypeError","maxLength":80,"type":"string"},"platform":{"description":"android, ios or web","maxLength":16,"type":"string"},"screen":{"description":"The route the person was on","maxLength":128,"type":"string"},"stack":{"maxLength":4000,"type":"string"}},"required":["kind","platform","message"],"type":"object"},"RequestedView":{"additionalProperties":false,"properties":{"put":{"$ref":"#/components/schemas/PutView"},"upload":{"$ref":"#/components/schemas/FileView"}},"required":["upload","put"],"type":"object"},"RollbackRequest":{"additionalProperties":false,"properties":{"version":{"description":"The version to restore; a new version is created with its configuration","format":"int64","minimum":1,"type":"integer"}},"required":["version"],"type":"object"},"RotateRequest":{"additionalProperties":false,"properties":{"expires_in_days":{"description":"Lifetime of the new key in days; omit for no expiry.","format":"int64","maximum":3650,"minimum":1,"type":"integer"},"grace_hours":{"description":"How long the old key keeps working; default 24, at most 168 (7 days).","format":"int64","maximum":168,"minimum":0,"type":"integer"}},"type":"object"},"RowErrorView":{"additionalProperties":false,"properties":{"field":{"type":"string"},"reason":{"type":"string"},"row":{"description":"Line number in the file; the header is line 1","format":"int64","type":"integer"}},"required":["row","reason"],"type":"object"},"RuleListOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/RuleView"},"type":"array"}},"required":["data"],"type":"object"},"RuleView":{"additionalProperties":false,"properties":{"actions":{"description":"Typed action objects, executed in order.","items":{},"type":"array"},"conditions":{"description":"All must hold (AND).","items":{"$ref":"#/components/schemas/ConditionView"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"enabled":{"type":"boolean"},"id":{"description":"Rule id (rul_...)","type":"string"},"name":{"type":"string"},"stop_on_failure":{"description":"When an action ends dead, skip the rest of that run.","type":"boolean"},"trigger":{"description":"The event type that fires the rule.","type":"string"},"updated_at":{"format":"date-time","type":"string"},"version":{"description":"Incremented by every PATCH.","format":"int64","type":"integer"},"warnings":{"description":"Things the merchant should know, e.g. an action sent without a signature.","items":{"type":"string"},"type":["array","null"]}},"required":["id","name","enabled","trigger","conditions","actions","stop_on_failure","version","created_at","updated_at"],"type":"object"},"RunView":{"additionalProperties":false,"properties":{"actions":{"items":{"$ref":"#/components/schemas/ActionRunView"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"event_id":{"description":"The event that fired the rule (evt_...)","type":"string"},"event_type":{"type":"string"},"id":{"description":"Run id (rrn_...)","type":"string"},"rule_id":{"type":"string"},"rule_version":{"description":"The rule version the run was created from.","format":"int64","type":"integer"}},"required":["id","rule_id","event_id","event_type","rule_version","created_at","actions"],"type":"object"},"SecretView":{"additionalProperties":false,"properties":{"endpoint":{"$ref":"#/components/schemas/EndpointView"},"secret":{"description":"The signing secret (whsec_...). It is shown only in this response; store it now. Verify PayBot-Signature with it.","type":"string"}},"required":["secret","endpoint"],"type":"object"},"SecurityEvent":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"kind":{"description":"push_started: a WhatsApp sign-in push was sent for this account's phone. push_confirmed / push_expired: it was confirmed / nobody answered. push_fallback: pushes were throttled and the code flow answered. push_signed_in: a session was opened by a push. new_sign_in: the FIRST push sign-in of an account that already has a Telegram link or a merchant; show it prominently. session_revoked_by_user: the person pressed 'Это не я' in the WhatsApp sign-in notice and that session was closed.","enum":["push_started","push_confirmed","push_expired","push_send_failed","push_fallback","push_signed_in","new_sign_in","session_revoked_by_user"],"type":"string"},"method":{"description":"How: whatsapp.","type":"string"}},"required":["id","kind","method","created_at"],"type":"object"},"SecurityEventsOutputBody":{"additionalProperties":false,"properties":{"events":{"description":"Newest first: the newest 50 events plus up to 20 new_sign_in events, which are never pushed out by the others.","items":{"$ref":"#/components/schemas/SecurityEvent"},"type":["array","null"]}},"required":["events"],"type":"object"},"SeenBody":{"additionalProperties":false,"properties":{"attribution":{"$ref":"#/components/schemas/Attribution"},"item":{"description":"The handle of the product that was opened","maxLength":64,"minLength":1,"type":"string"}},"required":["item"],"type":"object"},"SessionView":{"additionalProperties":false,"properties":{"client":{"description":"app: the phone application; web: a browser","enum":["app","web"],"type":"string"},"created_at":{"format":"date-time","type":"string"},"current":{"description":"The session this request was made with","type":"boolean"},"device":{"description":"What the client reported about itself, shortened","type":"string"},"id":{"description":"Session id (ses_...)","type":"string"},"last_seen_at":{"format":"date-time","type":"string"}},"required":["id","created_at","last_seen_at","client","current"],"type":"object"},"SessionsOutBody":{"additionalProperties":false,"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SessionView"},"type":"array"}},"required":["sessions"],"type":"object"},"SetCurrentBody":{"additionalProperties":false,"properties":{"lot_id":{"description":"An open lot of the page (prd_...); null takes the current lot off air","type":["string","null"]}},"type":"object"},"SettingsInBody":{"additionalProperties":false,"properties":{"max_refund_amount":{"description":"Largest single refund, in tiyn","format":"int64","minimum":1,"type":"integer"},"max_refund_total_per_day":{"description":"In tiyn; at least max_refund_amount","format":"int64","minimum":1,"type":"integer"},"max_refunds_per_day":{"format":"int64","maximum":10000,"minimum":1,"type":"integer"}},"required":["max_refund_amount","max_refunds_per_day","max_refund_total_per_day"],"type":"object"},"SettingsView":{"additionalProperties":false,"properties":{"default":{"description":"No limits were saved; these are PayBot's defaults","type":"boolean"},"max_refund_amount":{"description":"Largest single refund, in tiyn","format":"int64","type":"integer"},"max_refund_total_per_day":{"description":"Total refunded per rolling 24 hours, in tiyn","format":"int64","type":"integer"},"max_refunds_per_day":{"description":"Refunds per rolling 24 hours","format":"int64","type":"integer"},"updated_at":{"format":"date-time","type":"string"},"updated_by":{"type":"string"}},"required":["max_refund_amount","max_refunds_per_day","max_refund_total_per_day","default"],"type":"object"},"SignInBody":{"additionalProperties":false,"properties":{"csrf_token":{"description":"Cookie sign-in only: echo it in X-CSRF-Token on unsafe requests (also in the __Host-pb_csrf cookie).","type":"string"},"session_token":{"description":"Only with X-PayBot-Client: app. Send it as 'Authorization: Bearer pbs.<token>'. Shown once; keep it in secure storage.","type":"string"},"user":{"$ref":"#/components/schemas/User"}},"required":["user"],"type":"object"},"SiteLiveOutputBody":{"additionalProperties":false,"properties":{"url":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["url","version"],"type":"object"},"SiteUploadView":{"additionalProperties":false,"properties":{"bytes":{"format":"int64","type":"integer"},"files":{"format":"int64","type":"integer"},"live":{"description":"True when publish=true and the site now shows this version.","type":"boolean"},"url":{"description":"The site's address; present when it went live.","type":"string"},"version":{"description":"The version number.","format":"int64","type":"integer"},"version_id":{"description":"The stored version; pass it to site_publish or POST /v1/site/versions/{id}/publish.","type":"string"}},"required":["version_id","version","files","bytes","live"],"type":"object"},"SiteVersionView":{"additionalProperties":false,"properties":{"files":{"format":"int64","type":"integer"},"live":{"type":"boolean"},"note":{"type":"string"},"version":{"format":"int64","type":"integer"},"version_id":{"type":"string"}},"required":["version_id","version","files","live"],"type":"object"},"SiteVersionsOutputBody":{"additionalProperties":false,"properties":{"url":{"type":"string"},"versions":{"items":{"$ref":"#/components/schemas/SiteVersionView"},"type":"array"}},"required":["versions"],"type":"object"},"SlugCheckOutBody":{"additionalProperties":false,"properties":{"available":{"type":"boolean"},"reason":{"description":"Why it is not available. taken does not say who holds it.","enum":["taken","reserved","invalid"],"type":"string"},"slug":{"description":"The address that was checked, as sent","type":"string"},"suggestions":{"description":"Up to three free addresses close to the one asked about; empty when it is available","items":{"type":"string"},"type":"array"}},"required":["slug","available","suggestions"],"type":"object"},"SourceRow":{"additionalProperties":false,"properties":{"class":{"type":"string"},"count":{"format":"int64","type":"integer"},"name":{"type":"string"}},"required":["class","count"],"type":"object"},"SourceRowView":{"additionalProperties":false,"properties":{"avg_check":{"format":"int64","type":"integer"},"campaign":{"type":"string"},"conversion_bps":{"description":"payments / (visits + starts), basis points; 0 without traffic","format":"int64","type":"integer"},"leads":{"description":"Contact requests","format":"int64","type":"integer"},"medium":{"type":"string"},"payments":{"description":"Paid payments","format":"int64","type":"integer"},"repeat_buyers":{"description":"Buyers of this source who had bought before","format":"int64","type":"integer"},"revenue":{"description":"Net of refunds, tiyn","format":"int64","type":"integer"},"source":{"description":"utm_source; empty is direct or unknown","type":"string"},"starts":{"description":"Bot starts","format":"int64","type":"integer"},"visits":{"description":"Visits of public pages (anonymous)","format":"int64","type":"integer"}},"required":["source","visits","leads","starts","payments","revenue","avg_check","repeat_buyers","conversion_bps"],"type":"object"},"SourcesView":{"additionalProperties":false,"properties":{"data":{"description":"Best revenue first","items":{"$ref":"#/components/schemas/SourceRowView"},"type":"array"},"from":{"type":"string"},"group_by":{"enum":["source","campaign"],"type":"string"},"mode":{"enum":["live","test"],"type":"string"},"previous":{"$ref":"#/components/schemas/SourceRowView"},"timezone":{"type":"string"},"to":{"type":"string"},"total":{"$ref":"#/components/schemas/SourceRowView"}},"required":["mode","timezone","from","to","group_by","total","data"],"type":"object"},"Stage":{"additionalProperties":false,"properties":{"at":{"format":"date-time","type":"string"},"stage":{"enum":["accepted","prompt_built","model_called","model_answered","validated","facts_checked","saved","failed","cache_hit","images_called","images_stored"],"type":"string"}},"required":["stage","at"],"type":"object"},"StartLinkView":{"additionalProperties":false,"properties":{"expires_at":{"description":"Personal links only.","format":"date-time","type":"string"},"kind":{"description":"public: reusable by any number of buyers; personal: works once.","enum":["public","personal"],"type":"string"},"mode":{"enum":["live","test"],"type":"string"},"start_link":{"description":"https://t.me/<bot>?start=... Shown once; it is stored hashed.","type":"string"}},"required":["start_link","mode","kind"],"type":"object"},"StateView":{"additionalProperties":false,"properties":{"lot":{"$ref":"#/components/schemas/LotView"},"mode":{"type":"string"},"sold_total":{"format":"int64","type":"integer"},"title":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["version","title","lot","sold_total","mode"],"type":"object"},"StatsDayView":{"additionalProperties":false,"properties":{"date":{"description":"YYYY-MM-DD in the merchant's timezone","type":"string"},"paid_amount":{"format":"int64","type":"integer"},"payments_created":{"format":"int64","type":"integer"},"payments_paid":{"format":"int64","type":"integer"}},"required":["date","payments_created","payments_paid","paid_amount"],"type":"object"},"StatsTotalsView":{"additionalProperties":false,"properties":{"last_paid_at":{"description":"When the latest of those payments was paid","format":"date-time","type":"string"},"paid_amount":{"description":"Sum of the paid payments, gross of refunds, in tiyn","format":"int64","type":"integer"},"payments_created":{"description":"Payments the page started in the range, whatever their outcome","format":"int64","type":"integer"},"payments_paid":{"description":"Of those, the ones that were paid (a payment refunded later still counts: it was paid)","format":"int64","type":"integer"},"refunded_amount":{"description":"The part of paid_amount that was refunded (refunds are whole), in tiyn","format":"int64","type":"integer"}},"required":["payments_created","payments_paid","paid_amount","refunded_amount"],"type":"object"},"StatsView":{"additionalProperties":false,"properties":{"from":{"format":"date-time","type":"string"},"mode":{"enum":["live","test","all"],"type":"string"},"series":{"description":"One entry per day with a payment, oldest first","items":{"$ref":"#/components/schemas/StatsDayView"},"type":"array"},"template":{"type":"string"},"to":{"format":"date-time","type":"string"},"totals":{"$ref":"#/components/schemas/StatsTotalsView"}},"required":["template","from","to","mode","totals","series"],"type":"object"},"Step":{"additionalProperties":false,"properties":{"count":{"format":"int64","type":"integer"},"key":{"type":"string"},"people":{"format":"int64","type":"integer"}},"required":["key","count"],"type":"object"},"StockRequest":{"additionalProperties":false,"properties":{"delta":{"description":"Units to add (positive) or remove (negative); non-zero.","format":"int64","maximum":1000000,"minimum":-1000000,"type":"integer"},"note":{"maxLength":200,"type":"string"}},"required":["delta"],"type":"object"},"StoreOrderView":{"additionalProperties":false,"properties":{"amount":{"description":"What the payer pays, in tiyn: the order's total","format":"int64","type":"integer"},"deep_link":{"description":"Opens the payment in the Kaspi app, when there is one; absent while the status is creating (poll the payment's status)","type":"string"},"delivery_price":{"format":"int64","type":"integer"},"discount":{"description":"Promo-code discount in tiyn (0: none)","format":"int64","type":"integer"},"expires_at":{"description":"After this Kaspi can no longer complete the payment","format":"date-time","type":"string"},"kind":{"description":"How the order is paid","enum":["qr","invoice"],"type":"string"},"mode":{"enum":["live","test"],"type":"string"},"order_id":{"description":"ord_...","type":"string"},"order_number":{"description":"The short number the buyer quotes to the seller, the same everywhere","type":"string"},"order_token":{"description":"Opens the buyer's order page: /p/o/{order_token}, and GET /public/orders/{order_token}","type":"string"},"payment_id":{"description":"pay_...; its status is at /public/{slug}/payments/{payment_id}","type":"string"},"qr_token":{"description":"Encode this into the QR image (once pending)","type":"string"},"scan_expires_at":{"description":"After this the QR no longer scans","format":"date-time","type":"string"},"status":{"description":"The payment's status","type":"string"},"subtotal":{"format":"int64","type":"integer"},"total":{"format":"int64","type":"integer"}},"required":["order_id","order_number","payment_id","status","mode","subtotal","discount","delivery_price","total"],"type":"object"},"StudentAttachmentView":{"additionalProperties":false,"properties":{"content_type":{"type":"string"},"id":{"description":"att_...","type":"string"},"name":{"type":"string"},"size":{"format":"int64","type":"integer"}},"required":["id","content_type","size"],"type":"object"},"StudentCourseView":{"additionalProperties":false,"properties":{"completed_lessons":{"format":"int64","type":"integer"},"course_id":{"description":"crs_...","type":"string"},"description":{"type":"string"},"enrolled_at":{"format":"date-time","type":"string"},"enrollment_id":{"description":"enr_...","type":"string"},"expires_at":{"description":"Access ends then; absent: unlimited.","format":"date-time","type":"string"},"modules":{"items":{"$ref":"#/components/schemas/StudentModuleView"},"type":"array"},"sequential":{"description":"Lessons open one after another.","type":"boolean"},"test":{"description":"A test enrollment (the business's own purchase in test mode); it ends 72 hours after it began","type":"boolean"},"title":{"type":"string"},"total_lessons":{"format":"int64","type":"integer"}},"required":["enrollment_id","course_id","title","description","enrolled_at","completed_lessons","total_lessons","modules"],"type":"object"},"StudentKeyView":{"additionalProperties":false,"properties":{"course_id":{"description":"crs_...","type":"string"},"course_title":{"type":"string"},"enrollment_id":{"description":"enr_...","type":"string"},"student_token":{"description":"Send it as X-Student-Token. Shown once: keep it; it is stored hashed.","type":"string"}},"required":["enrollment_id","course_id","course_title","student_token"],"type":"object"},"StudentLessonContentView":{"additionalProperties":false,"properties":{"attachments":{"items":{"$ref":"#/components/schemas/StudentAttachmentView"},"type":"array"},"completed_at":{"format":"date-time","type":"string"},"duration_seconds":{"format":"int64","type":"integer"},"file":{"$ref":"#/components/schemas/FileLinkView","description":"Absent on a file lesson whose file is not uploaded yet."},"id":{"description":"lsn_...","type":"string"},"kind":{"enum":["text","video_url","file"],"type":"string"},"position_seconds":{"description":"Where this student stopped in the video.","format":"int64","type":"integer"},"text":{"description":"Text of a text lesson; see text_format.","type":"string"},"text_format":{"enum":["plain","markdown",""],"type":"string"},"title":{"type":"string"},"video_url":{"type":"string"}},"required":["id","title","kind","position_seconds","attachments"],"type":"object"},"StudentLessonView":{"additionalProperties":false,"properties":{"available_at":{"format":"date-time","type":"string"},"completed_at":{"format":"date-time","type":"string"},"content_type":{"description":"A file lesson's MIME type (video/mp4 for an uploaded video); absent for other kinds.","type":"string"},"duration_seconds":{"format":"int64","type":"integer"},"id":{"description":"lsn_...","type":"string"},"kind":{"enum":["text","video_url","file"],"type":"string"},"locked_by":{"description":"Why a closed lesson is closed.","enum":["drip","previous",""],"type":"string"},"open":{"description":"false while the drip schedule or the previous lesson keeps it locked","type":"boolean"},"title":{"type":"string"}},"required":["id","title","kind","open","available_at"],"type":"object"},"StudentLoginView":{"additionalProperties":false,"properties":{"students":{"description":"One session key per course the phone holds; use each as X-Student-Token.","items":{"$ref":"#/components/schemas/StudentKeyView"},"type":"array"}},"required":["students"],"type":"object"},"StudentModuleView":{"additionalProperties":false,"properties":{"id":{"description":"mod_...","type":"string"},"lessons":{"items":{"$ref":"#/components/schemas/StudentLessonView"},"type":"array"},"title":{"type":"string"}},"required":["id","title","lessons"],"type":"object"},"Students":{"additionalProperties":false,"properties":{"active":{"description":"Finished a lesson in the period","format":"int64","type":"integer"},"finished":{"description":"Finished every lesson","format":"int64","type":"integer"},"lessons":{"items":{"$ref":"#/components/schemas/LessonRow"},"type":"array"},"started":{"description":"Finished at least one lesson","format":"int64","type":"integer"},"total":{"description":"Active students","format":"int64","type":"integer"}},"required":["total","started","finished","active","lessons"],"type":"object"},"SubdomainBody":{"additionalProperties":false,"properties":{"subdomain":{"description":"The business subdomain; the site is <subdomain>.paybot.kz.","type":"string"}},"required":["subdomain"],"type":"object"},"SubdomainInputBody":{"additionalProperties":false,"properties":{"subdomain":{"description":"The new subdomain: 3 to 32 characters of a-z, 0-9 and '-', not starting or ending with '-', not reserved, not starting with pv-.","maxLength":64,"type":"string"}},"required":["subdomain"],"type":"object"},"SubscriberStateView":{"additionalProperties":false,"properties":{"access_until":{"format":"date-time","type":"string"},"free":{"type":"boolean"},"status":{"enum":["pending","trial","active","grace","cancelled","ended"],"type":"string"}},"required":["status","access_until","free"],"type":"object"},"SubscriberView":{"additionalProperties":false,"properties":{"access_until":{"description":"When access runs out (grace included).","format":"date-time","type":"string"},"free":{"description":"Access the merchant gave for nothing.","type":"boolean"},"joined_at":{"format":"date-time","type":"string"},"membership":{"description":"Whether the person entered the channel, as far as the bot has seen.","enum":["joined","left","not_joined"],"type":"string"},"name":{"description":"The Telegram first name, when the bot has seen it; empty otherwise.","type":"string"},"plan":{"description":"The name of the plan of this subscription","type":"string"},"removal_note":{"description":"Why the merchant last removed this person, when they said","type":"string"},"removed_at":{"format":"date-time","type":"string"},"since":{"description":"When the subscription was created.","format":"date-time","type":"string"},"status":{"enum":["pending","trial","active","grace","cancelled","ended"],"type":"string"},"subscriber_id":{"description":"sbr_...","type":"string"},"subscription_id":{"description":"sub_...","type":"string"},"username":{"description":"The Telegram @username without the @, when known; empty otherwise.","type":"string"}},"required":["subscriber_id","subscription_id","name","username","status","free","access_until","since","membership","plan"],"type":"object"},"Subscription-createRequest":{"additionalProperties":false,"properties":{"payer_phone":{"description":"Send a Kaspi invoice to this phone instead of making a QR","maxLength":20,"type":"string"},"plan_id":{"description":"Plan id (pln_...)","type":"string"},"subscriber_id":{"description":"Your subscriber id (sbr_... from the access module); stored as given","maxLength":100,"minLength":1,"type":"string"}},"required":["plan_id","subscriber_id"],"type":"object"},"SubscriptionView":{"additionalProperties":false,"properties":{"activated_at":{"description":"When the subscription first had access","format":"date-time","type":"string"},"cancelled_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"currency":{"enum":["KZT"],"type":"string"},"current_period_end":{"format":"date-time","type":"string"},"current_period_start":{"format":"date-time","type":"string"},"ended_at":{"format":"date-time","type":"string"},"grace_days":{"description":"Grace of the current period","format":"int64","type":"integer"},"id":{"description":"Subscription id (sub_...)","type":"string"},"mode":{"enum":["live","test"],"type":"string"},"object":{"enum":["subscription"],"type":"string"},"period_index":{"description":"1 for the first period, one more for each period bought","format":"int64","type":"integer"},"plan_id":{"type":"string"},"price":{"description":"What the current period cost, in tiyn; 0 for a trial","format":"int64","type":"integer"},"status":{"enum":["pending","trial","active","grace","cancelled","ended"],"type":"string"},"subscriber_id":{"description":"The subscriber id given at purchase, as given","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","object","plan_id","subscriber_id","mode","status","period_index","price","currency","grace_days","created_at","updated_at"],"type":"object"},"TargetView":{"additionalProperties":false,"properties":{"kind":{"description":"site: the business's published site; page: one of its public pages.","enum":["site","page"],"type":"string"},"slug":{"description":"The page's address, for kind page.","type":"string"}},"required":["kind"],"type":"object"},"TargetsOutputBody":{"additionalProperties":false,"properties":{"pages":{"items":{"$ref":"#/components/schemas/PageView"},"type":"array"},"site_published":{"type":"boolean"}},"required":["site_published","pages"],"type":"object"},"Telegram-bot-channel-sessionResponse":{"additionalProperties":false,"properties":{"expires_at":{"format":"date-time","type":"string"}},"required":["expires_at"],"type":"object"},"TelegramChannelView":{"additionalProperties":false,"properties":{"configured":{"description":"The platform bot is set up on this installation","type":"boolean"},"linked":{"description":"The user's Telegram chat is bound","type":"boolean"}},"required":["configured","linked"],"type":"object"},"TelegramLinkView":{"additionalProperties":false,"properties":{"expires_at":{"format":"date-time","type":"string"},"url":{"description":"https://t.me/<bot>?start=learn_<code>","type":"string"}},"required":["url","expires_at"],"type":"object"},"TelegramLogin":{"additionalProperties":false,"properties":{"auth_date":{"description":"Unix time the widget signed the payload.","format":"int64","minimum":1,"type":"integer"},"first_name":{"maxLength":256,"type":"string"},"hash":{"description":"Hex HMAC-SHA256 computed by Telegram.","maxLength":64,"minLength":64,"type":"string"},"id":{"description":"Telegram user id.","format":"int64","minimum":1,"type":"integer"},"last_name":{"maxLength":256,"type":"string"},"photo_url":{"maxLength":2048,"type":"string"},"username":{"maxLength":64,"type":"string"}},"required":["id","auth_date","hash"],"type":"object"},"TemplateDeployRequest":{"additionalProperties":false,"properties":{"config":{"description":"The configuration, a JSON object valid against the template's config_schema"},"expected_version":{"description":"Updates only: the configuration version this change was made against. If the deployment has moved on (another tab or user saved), nothing is written and the answer is 409 version_conflict. The If-Match header carries the same number.","format":"int64","minimum":1,"type":"integer"},"publish":{"description":"Default true: the page is public at once. false creates it as a draft that opens only with its preview token until POST .../publish. Applies when the deploy creates the page; an existing page keeps its state.","type":"boolean"}},"required":["config"],"type":"object"},"Terms":{"additionalProperties":false,"properties":{"address":{"type":"string"},"email":{"type":"string"},"has_offer":{"type":"boolean"},"has_privacy":{"type":"boolean"},"hours":{"type":"string"},"instagram":{"type":"string"},"legal_form":{"type":"string"},"offer_text":{"type":"string"},"offer_version":{"format":"int64","type":"integer"},"phone":{"type":"string"},"privacy_text":{"type":"string"},"registration":{"type":"string"},"return_policy":{"type":"string"},"seller_name":{"type":"string"},"telegram":{"type":"string"},"whatsapp":{"type":"string"}},"required":["offer_text","privacy_text","offer_version","seller_name","legal_form","registration","address","phone","whatsapp","telegram","instagram","email","hours","return_policy","has_offer","has_privacy"],"type":"object"},"TestPushView":{"additionalProperties":false,"properties":{"queued":{"description":"How many phones got a test message","format":"int64","type":"integer"}},"required":["queued"],"type":"object"},"TokenOutBody":{"additionalProperties":false,"properties":{"path":{"type":"string"},"token":{"description":"The token of the reverse endpoint (b24i_...). Shown once; the URL is /v1/integrations/bitrix24/{token}/events.","type":"string"}},"required":["token","path"],"type":"object"},"TokenView":{"additionalProperties":false,"properties":{"enrollment_id":{"description":"enr_...","type":"string"},"student_token":{"description":"Give it to the student; it goes in X-Student-Token. Shown once, stored hashed.","type":"string"}},"required":["enrollment_id","student_token"],"type":"object"},"TouchView":{"additionalProperties":false,"properties":{"at":{"format":"date-time","type":"string"},"campaign":{"type":"string"},"content":{"type":"string"},"label":{"description":"The label of a bot start link or an ad link","type":"string"},"medium":{"type":"string"},"source":{"type":"string"},"term":{"type":"string"}},"required":["at"],"type":"object"},"TransitionRequest":{"additionalProperties":false,"properties":{"reason":{"maxLength":200,"type":"string"},"restock":{"description":"Cancelling a paid order: put its goods back on hand. A refund is a separate approval.","type":"boolean"},"status":{"enum":["packed","shipped","done","cancelled"],"type":"string"}},"required":["status"],"type":"object"},"TransitionView":{"additionalProperties":false,"properties":{"changed":{"description":"false when the deployment was already in that state (nothing was written)","type":"boolean"},"status":{"description":"The deployment's status now","enum":["published","unpublished","archived"],"type":"string"},"subject_id":{"description":"The deployment's public id","type":"string"},"template":{"type":"string"}},"required":["template","subject_id","status","changed"],"type":"object"},"TriggerView":{"additionalProperties":false,"properties":{"description":{"type":"string"},"fields":{"items":{"$ref":"#/components/schemas/FieldView"},"type":"array"},"type":{"type":"string"}},"required":["type","description","fields"],"type":"object"},"UpdateBody":{"additionalProperties":false,"properties":{"redirect_www":{"type":"boolean"},"target":{"$ref":"#/components/schemas/TargetView"}},"type":"object"},"UpdateEndpointRequest":{"additionalProperties":false,"properties":{"active":{"description":"false switches the endpoint off; true switches it back on and clears its failure streak.","type":"boolean"},"description":{"maxLength":200,"type":"string"},"events":{"description":"Replaces the filter; an empty list means every type.","items":{"type":"string"},"maxItems":50,"type":"array"},"url":{"maxLength":2000,"minLength":10,"type":"string"}},"type":"object"},"UpdateLotBody":{"additionalProperties":false,"properties":{"image_url":{"description":"\"\" removes the image","maxLength":2048,"type":"string"},"price":{"description":"Applies to checkouts from now on","format":"int64","minimum":100,"type":"integer"},"quantity":{"description":"Not below sold + reserved","format":"int64","maximum":100000,"minimum":1,"type":"integer"},"title":{"maxLength":100,"minLength":1,"type":"string"}},"type":"object"},"UpdateMerchantInputBody":{"additionalProperties":false,"properties":{"logo_upload_id":{"description":"The logo: a confirmed template_image upload of this merchant (upl_...; 422 invalid_logo otherwise). An empty string removes it.","maxLength":64,"type":"string"},"name":{"description":"New name (at most 60 characters, no < or >), also shown on the merchant's public pages. Send name, timezone, logo_upload_id or any of them.","maxLength":60,"minLength":1,"type":"string"},"timezone":{"description":"IANA timezone name, e.g. Asia/Almaty or Asia/Aqtobe (422 invalid_timezone otherwise).","maxLength":64,"type":"string"}},"type":"object"},"UpdatePlanRequest":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"grace_days":{"format":"int64","maximum":30,"minimum":0,"type":"integer"},"name":{"maxLength":200,"minLength":1,"type":"string"},"period_count":{"format":"int64","maximum":365,"minimum":1,"type":"integer"},"period_unit":{"enum":["day","month"],"type":"string"},"price":{"description":"Applies to periods bought from now on","format":"int64","minimum":100,"type":"integer"},"reminder_offsets":{"items":{"format":"int64","type":"integer"},"maxItems":5,"type":"array"},"trial_days":{"format":"int64","maximum":90,"minimum":0,"type":"integer"}},"type":"object"},"UpdateRuleRequest":{"additionalProperties":false,"properties":{"actions":{"description":"Replaces the actions.","items":{},"maxItems":10,"minItems":1,"type":"array"},"conditions":{"description":"Replaces the conditions; an empty list means always.","items":{"$ref":"#/components/schemas/ConditionView"},"maxItems":10,"type":"array"},"name":{"maxLength":200,"minLength":1,"type":"string"},"stop_on_failure":{"type":"boolean"},"trigger":{"maxLength":100,"type":"string"}},"type":"object"},"Upload-createRequest":{"additionalProperties":false,"properties":{"content_type":{"enum":["image/jpeg","image/png","image/webp","application/pdf"],"type":"string"},"purpose":{"enum":["template_image","product_image","document"],"type":"string"},"size":{"description":"Exact size of the file in bytes","format":"int64","maximum":10485760,"minimum":1,"type":"integer"}},"required":["purpose","content_type","size"],"type":"object"},"UploadView":{"additionalProperties":false,"properties":{"attachment_id":{"description":"att_..., for an attachment upload.","type":"string"},"expires_at":{"format":"date-time","type":"string"},"file_key":{"description":"Send it to .../confirm after the PUT.","type":"string"},"headers":{"additionalProperties":{"type":"string"},"description":"Send exactly these headers (they are signed).","type":"object"},"method":{"enum":["PUT"],"type":"string"},"url":{"description":"Upload the file here before expires_at. It is a credential: do not log or share it.","type":"string"}},"required":["method","url","headers","file_key","expires_at"],"type":"object"},"User":{"additionalProperties":false,"properties":{"id":{"description":"User id (usr_...).","type":"string"},"name":{"type":"string"},"phone":{"description":"Masked phone, e.g. +7 701 *** ** 67.","type":"string"},"telegram_username":{"type":"string"}},"required":["id"],"type":"object"},"VariantPatchRequest":{"additionalProperties":false,"properties":{"price":{"description":"Tiyn, whole tenge. Applies to new orders only.","format":"int64","minimum":100,"type":"integer"},"title":{"maxLength":100,"type":"string"},"track_stock":{"description":"Switch stock counting on or off; 409 while an unpaid order holds the variant","type":"boolean"}},"type":"object"},"VariantRequest":{"additionalProperties":false,"properties":{"price":{"description":"Tiyn, whole tenge (a multiple of 100).","format":"int64","minimum":100,"type":"integer"},"sku":{"description":"[A-Za-z0-9][A-Za-z0-9._-]*, unique per merchant. Optional: generated from the product handle when empty.","maxLength":64,"type":"string"},"stock":{"description":"Initial on_hand. Default 0. Must be 0 when track_stock is false.","format":"int64","maximum":1000000,"minimum":0,"type":"integer"},"title":{"description":"Plain text; empty for a product with one variant","maxLength":100,"type":"string"},"track_stock":{"description":"Absent: counted when an initial stock is given, otherwise not counted (a new item is not \"out of stock\" just because nobody typed a number). true: stock is counted. false: the item is made or ordered on demand, its stock is not counted and it is always for sale.","type":"boolean"}},"required":["price"],"type":"object"},"VariantView":{"additionalProperties":false,"properties":{"archived":{"type":"boolean"},"available":{"description":"on_hand - reserved","format":"int64","type":"integer"},"created_at":{"format":"date-time","type":"string"},"id":{"description":"prd_...","type":"string"},"on_hand":{"format":"int64","type":"integer"},"price":{"description":"Tiyn, whole tenge.","format":"int64","type":"integer"},"product_id":{"description":"prd_...","type":"string"},"reserved":{"description":"Held by unpaid live orders.","format":"int64","type":"integer"},"sku":{"type":"string"},"title":{"type":"string"},"track_stock":{"description":"false: made or ordered on demand. Always for sale; on_hand, reserved and available are not counted and mean nothing.","type":"boolean"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","product_id","sku","title","price","on_hand","reserved","available","archived","track_stock","created_at","updated_at"],"type":"object"},"VerifyInputBody":{"additionalProperties":false,"properties":{"code":{"maxLength":6,"minLength":6,"pattern":"^[0-9]{6}$","type":"string"},"phone":{"maxLength":32,"minLength":10,"type":"string"}},"required":["phone","code"],"type":"object"},"VersionView":{"additionalProperties":false,"properties":{"config":{},"config_hash":{"description":"SHA-256 of the stored configuration, hex","type":"string"},"created_at":{"format":"date-time","type":"string"},"version":{"format":"int64","type":"integer"}},"required":["version","config","config_hash","created_at"],"type":"object"},"VersionsOutBody":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/VersionView"},"type":["array","null"]}},"required":["data"],"type":"object"},"VersionsOutBody1":{"additionalProperties":false,"properties":{"versions":{"description":"Newest first, at most 50","items":{"$ref":"#/components/schemas/BuilderVersionView"},"type":["array","null"]}},"required":["versions"],"type":"object"},"WhatsAppPollBody":{"additionalProperties":false,"properties":{"csrf_token":{"description":"Cookie sign-in only.","type":"string"},"session_token":{"description":"Only with X-PayBot-Client: app. Shown once.","type":"string"},"status":{"description":"pending: waiting for the button. confirmed: signed in (a link: linked). expired: nobody pressed the button in time, start again. denied is reserved and is never produced (the message has no No button); a client may treat it like expired.","enum":["pending","confirmed","denied","expired"],"type":"string"},"user":{"$ref":"#/components/schemas/User","description":"Sign-in only, with status confirmed."}},"required":["status"],"type":"object"},"WhatsAppPollInputBody":{"additionalProperties":false,"properties":{"flow_token":{"description":"The flow_token from start.","maxLength":128,"minLength":1,"type":"string"}},"required":["flow_token"],"type":"object"},"WhatsAppStartBody":{"additionalProperties":false,"properties":{"expires_at":{"description":"The person must press the button before this time (5 minutes).","format":"date-time","type":"string"},"fallback":{"description":"'code': no push was sent (it could not be, or this phone was pushed twice without an answer and is on the code flow for an hour); use /auth/otp/request instead. No flow was started.","enum":["code"],"type":"string"},"flow_token":{"description":"Keep it in memory and send it to poll. Single use; absent when fallback is set.","type":"string"},"masked_phone":{"description":"The phone the confirmation went to, masked.","type":"string"},"match_code":{"description":"Only when the server is configured with a number-matching template: show these 2 digits to the person, they must be the same as in the WhatsApp message.","type":"string"}},"required":["masked_phone"],"type":"object"},"WhatsAppStartInputBody":{"additionalProperties":false,"properties":{"phone":{"description":"Kazakhstan phone; any common spelling.","maxLength":32,"minLength":10,"type":"string"}},"required":["phone"],"type":"object"}},"securitySchemes":{"apiKey":{"bearerFormat":"pb_<mode>_<key>","description":"An API key: Authorization: Bearer pb_.... Bound to its merchant and its mode; X-Merchant-Id is not needed.","scheme":"bearer","type":"http"},"apiKeyHeader":{"description":"The same API key in the X-API-Key header.","in":"header","name":"X-API-Key","type":"apiKey"},"csrfToken":{"description":"With the session cookie on unsafe methods: the value of the __Host-pb_csrf cookie (GET /v1/auth/csrf).","in":"header","name":"X-CSRF-Token","type":"apiKey"},"sessionBearer":{"bearerFormat":"pbs.<token>","description":"The cabinet session as a bearer token (the app, ADR 0027): Authorization: Bearer pbs.<token>. No CSRF token.","scheme":"bearer","type":"http"},"sessionCookie":{"description":"The cabinet session cookie (web). Unsafe methods also need csrfToken.","in":"cookie","name":"__Host-pb_session","type":"apiKey"}}},"info":{"title":"paybot API","version":"snapshot"},"openapi":"3.1.0","paths":{"/v1/access/grants":{"get":{"operationId":"access-grant-list","parameters":[{"description":"Cabinet only; an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only; an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"Only this subscriber's grants (sbr_...)","explode":false,"in":"query","name":"subscriber_id","schema":{"description":"Only this subscriber's grants (sbr_...)","type":"string"}},{"description":"Only this channel's grants (chn_...)","explode":false,"in":"query","name":"channel_id","schema":{"description":"Only this channel's grants (chn_...)","type":"string"}},{"description":"Only grants in this state: pending, active, superseded or revoked","explode":false,"in":"query","name":"status","schema":{"description":"Only grants in this state: pending, active, superseded or revoked","type":"string"}},{"description":"next_cursor from the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor from the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageGrantView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List access grants, newest first","tags":["Access"],"x-required-scope":"read"}},"/v1/access/grants/{id}/revoke":{"post":{"description":"Cabinet sessions only. The removal is queued (202) and happens when the access queue runs; the grant becomes revoked then. Idempotent. The subscription is not cancelled.","operationId":"access-grant-revoke","parameters":[{"description":"Grant id (gnt_...)","in":"path","name":"id","required":true,"schema":{"description":"Grant id (gnt_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantView"}}},"description":"Accepted"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Revoke a grant by hand: remove the subscriber from the channel","tags":["Access"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/access/products/{id}/comp":{"post":{"description":"Cabinet sessions only. The person must be a known subscriber or contact of the business. A new period at price 0 starts now, or when their current one ends; they get the channel link by DM. Journalled.","operationId":"access-product-comp","parameters":[{"description":"Deployment id (prd_...)","in":"path","name":"id","required":true,"schema":{"description":"Deployment id (prd_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Access-product-compRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberStateView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Give a known subscriber free access for N days, or extend theirs","tags":["Access"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/access/products/{id}/remove-subscriber":{"post":{"description":"Cabinet sessions only. The removal is queued (202) and happens when the access queue runs. The person is not messaged. Nothing is refunded. Idempotent.","operationId":"access-product-remove-subscriber","parameters":[{"description":"Deployment id (prd_...)","in":"path","name":"id","required":true,"schema":{"description":"Deployment id (prd_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Access-product-remove-subscriberRequest"}}},"required":true},"responses":{"202":{"description":"Accepted"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Remove a subscriber: end the subscription and take them out of the channel","tags":["Access"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/access/products/{id}/start-link/rotate":{"post":{"description":"Cabinet session or live API key. The old link stops working at once. The new one is shown in this answer only. Journalled. Idempotency-Key is refused: the link is never stored.","operationId":"access-product-start-link-rotate","parameters":[{"description":"Deployment id (prd_...)","in":"path","name":"id","required":true,"schema":{"description":"Deployment id (prd_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Access-product-start-link-rotateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartLinkView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Replace the public start link of a deployment for one mode","tags":["Access"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/access/products/{id}/stop-sales":{"post":{"description":"Cabinet sessions only. The plan takes no new subscribers; existing ones keep renewing and keep access. This is what a channel or bot removal asks for first (409 channel_in_use). Journalled. Idempotent.","operationId":"access-product-stop-sales","parameters":[{"description":"Deployment id (prd_...)","in":"path","name":"id","required":true,"schema":{"description":"Deployment id (prd_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stop selling the plan of a channel","tags":["Access"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/access/products/{id}/subscribers":{"get":{"description":"Names and @usernames come from the contact the bot saw. q searches a name, an @username or a Telegram id. membership says whether the person entered the channel.","operationId":"access-product-subscribers","parameters":[{"description":"Deployment id (prd_...)","in":"path","name":"id","required":true,"schema":{"description":"Deployment id (prd_...)","type":"string"}},{"description":"Default live. An API key sees only its own mode.","explode":false,"in":"query","name":"mode","schema":{"description":"Default live. An API key sees only its own mode.","enum":["live","test"],"type":"string"}},{"description":"Only subscriptions in this status","explode":false,"in":"query","name":"status","schema":{"description":"Only subscriptions in this status","enum":["pending","trial","active","grace","cancelled","ended"],"type":"string"}},{"description":"Search a name, @username or Telegram id","explode":false,"in":"query","name":"q","schema":{"description":"Search a name, @username or Telegram id","maxLength":100,"type":"string"}},{"description":"next_cursor from the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor from the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageSubscriberView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List the subscribers of a channel's plan, newest first","tags":["Access"],"x-required-scope":"read"}},"/v1/access/start-links":{"post":{"description":"Cabinet session or live API key. Journalled. Idempotency-Key is refused: the link is never stored.","operationId":"access-start-link-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Access-start-link-createRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartLinkView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create a personal start link: works once, for a link sent to one person","tags":["Access"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/agent/actions/{id}/reject":{"post":{"description":"Rejects the action's pending approval and marks the action rejected; the model is told on its next turn. 409 action_not_proposed when it is not waiting for approval.","operationId":"agent-action-reject","parameters":[{"description":"The run or action id (uuid)","in":"path","name":"id","required":true,"schema":{"description":"The run or action id (uuid)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentActionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Reject a proposed action","tags":["agent"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/agent/events":{"get":{"description":"text/event-stream. Events: run.started {run_id, status}, text.delta {run_id, text}, message {message}, action.started|action.done|action.failed|action.proposed|action.rejected|action.executed {action}, site.* (the site builder's events of a site_build call, data unchanged), checklist {items}, run.ended {run_id, status, error}. `id` grows with every event: reconnect with Last-Event-ID to replay what was missed. Comment lines are heartbeats every 15 seconds. The stream ends after at most 10 minutes; reconnect.","operationId":"agent-events","parameters":[{"description":"The id of the last event received","in":"header","name":"Last-Event-ID","schema":{"description":"The id of the last event received","type":"string"}},{"description":"The same, for clients that cannot set the header","explode":false,"in":"query","name":"last_event_id","schema":{"description":"The same, for clients that cannot set the header","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"text/event-stream":{"schema":{"type":"string"}}},"description":"An event stream"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stream the agent's events (server-sent events)","tags":["agent"],"x-required-scope":"read"}},"/v1/agent/messages":{"post":{"description":"Starts a run and answers 202 at once; follow it on GET /agent/events. The run keeps going if the request ends (at most 10 minutes, 30 tool calls). Creating drafts runs at once; changing existing objects, publishing and broadcasting become approvals (agent.apply). 409 run_in_progress while an earlier run of the business is still going. Spends generations.","operationId":"agent-message-send","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMessageBody"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccepted"}}},"description":"Accepted"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Send the agent a message","tags":["agent"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/agent/runs/{id}/cancel":{"post":{"description":"Stops the run now (a site build in it included); it ends as interrupted and can be continued. Stopping a run that is not running does nothing (204).","operationId":"agent-run-cancel","parameters":[{"description":"The run or action id (uuid)","in":"path","name":"id","required":true,"schema":{"description":"The run or action id (uuid)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stop a running run","tags":["agent"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/agent/runs/{id}/continue":{"post":{"description":"Starts a new run whose context is the thread summary and the journal's done actions, so nothing is created twice. 409 run_in_progress while a run is going, 409 run_not_resumable when the run is not interrupted or failed. Spends generations.","operationId":"agent-run-continue","parameters":[{"description":"The run or action id (uuid)","in":"path","name":"id","required":true,"schema":{"description":"The run or action id (uuid)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccepted"}}},"description":"Accepted"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Continue an interrupted run","tags":["agent"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/agent/thread":{"get":{"description":"The last 50 messages, every journaled action and the checklist. Before the first message: an empty thread.","operationId":"agent-thread-get","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentThreadView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The business's agent conversation","tags":["agent"],"x-required-scope":"read"}},"/v1/api-keys":{"get":{"description":"All keys of the selected merchant, newest first, including revoked and expired ones. Never includes a secret.","operationId":"list-api-keys","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOutputBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List API keys","tags":["API keys"],"x-required-scope":"read"},"post":{"description":"Issues a key for the selected merchant. The full key is in the response and is never shown again. Cabinet sessions only: an API key cannot create keys.","operationId":"create-api-key","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedKey"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create an API key","tags":["API keys"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/api-keys/{id}":{"delete":{"description":"The key stops working immediately. Revoking a revoked key succeeds.","operationId":"revoke-api-key","parameters":[{"description":"The key to revoke, key_<32 hex digits>.","in":"path","name":"id","required":true,"schema":{"description":"The key to revoke, key_<32 hex digits>.","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Revoke an API key","tags":["API keys"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/api-keys/{id}/rotate":{"post":{"description":"Issues a successor with the same name, mode, scopes and allowlist, and limits the old key to a grace period (default 24 hours, at most 7 days). The new full key is shown once.","operationId":"rotate-api-key","parameters":[{"description":"The key to rotate, key_<32 hex digits>.","in":"path","name":"id","required":true,"schema":{"description":"The key to rotate, key_<32 hex digits>.","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateRequest"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedKey"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Rotate an API key","tags":["API keys"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/approvals":{"get":{"operationId":"approvals-list","parameters":[{"description":"Comma-separated statuses, e.g. pending","explode":false,"in":"query","name":"status","schema":{"description":"Comma-separated statuses, e.g. pending","type":"string"}},{"description":"Cabinet only; an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only; an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"next_cursor of the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page","type":"string"}},{"description":"Page size, 1..100 (default 25)","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, 1..100 (default 25)","format":"int64","type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageApprovalView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List approvals, newest first","tags":["Approvals"],"x-required-scope":"read"}},"/v1/approvals/settings":{"get":{"description":"Cabinet owner or admin. Reading needs no re-authentication; changing the limits does (PUT).","operationId":"approval-settings-get","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The merchant's refund limits","tags":["Approvals"],"x-required-scope":"money"},"put":{"description":"Cabinet owner only, re-authenticated within the last 5 minutes. Journalled with the limits before and after.","operationId":"approval-settings-put","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsInBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change the merchant's refund limits","tags":["Approvals"],"x-idempotency":"optional","x-required-scope":"money"}},"/v1/approvals/{id}":{"get":{"operationId":"approval-get","parameters":[{"description":"Approval id (apr_...)","in":"path","name":"id","required":true,"schema":{"description":"Approval id (apr_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get an approval","tags":["Approvals"],"x-required-scope":"read"}},"/v1/approvals/{id}/approve":{"post":{"description":"Only a person in the cabinet decides: a session of an owner or admin who re-entered a sign-in code within the last 5 minutes (otherwise 403 `reauth_required`). An API key is refused with 403 whatever its scopes. A decision is final; an expired approval cannot be approved. Approving executes the action at once and returns the outcome: `executed`, or `failed` with a failure_reason. A refund is never retried automatically.","operationId":"approval-approve","parameters":[{"description":"Approval id (apr_...)","in":"path","name":"id","required":true,"schema":{"description":"Approval id (apr_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideBody","description":"Optional"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Approve and execute","tags":["Approvals"],"x-idempotency":"optional","x-required-scope":"money"}},"/v1/approvals/{id}/reject":{"post":{"description":"Only a person in the cabinet decides: a session of an owner or admin who re-entered a sign-in code within the last 5 minutes (otherwise 403 `reauth_required`). An API key is refused with 403 whatever its scopes. A decision is final; an expired approval cannot be approved. Approving executes the action at once and returns the outcome: `executed`, or `failed` with a failure_reason. A refund is never retried automatically.","operationId":"approval-reject","parameters":[{"description":"Approval id (apr_...)","in":"path","name":"id","required":true,"schema":{"description":"Approval id (apr_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideBody","description":"Optional"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Reject","tags":["Approvals"],"x-idempotency":"optional","x-required-scope":"money"}},"/v1/audit-log":{"get":{"description":"Owner or admin, cabinet sessions only. Filters combine with AND; page with next_cursor.","operationId":"list-audit-log","parameters":[{"description":"Only lines by this actor: a user id (usr_...), a key id (key_...), or as stored (user:<uuid>, system).","explode":false,"in":"query","name":"actor","schema":{"description":"Only lines by this actor: a user id (usr_...), a key id (key_...), or as stored (user:<uuid>, system).","maxLength":200,"type":"string"}},{"description":"Only this action, e.g. member.removed.","explode":false,"in":"query","name":"action","schema":{"description":"Only this action, e.g. member.removed.","maxLength":100,"type":"string"}},{"description":"Only this resource, e.g. member or api_key.","explode":false,"in":"query","name":"resource","schema":{"description":"Only this resource, e.g. member or api_key.","maxLength":100,"type":"string"}},{"description":"Only lines about this object (its public id or UUID).","explode":false,"in":"query","name":"resource_id","schema":{"description":"Only lines about this object (its public id or UUID).","maxLength":64,"type":"string"}},{"description":"Only lines at or after this time (RFC 3339).","explode":false,"in":"query","name":"since","schema":{"description":"Only lines at or after this time (RFC 3339).","format":"date-time","type":"string"}},{"description":"Only lines before this time (RFC 3339).","explode":false,"in":"query","name":"until","schema":{"description":"Only lines before this time (RFC 3339).","format":"date-time","type":"string"}},{"description":"next_cursor of the previous page.","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page.","maxLength":64,"type":"string"}},{"description":"Page size; default 25, at most 100.","explode":false,"in":"query","name":"limit","schema":{"description":"Page size; default 25, at most 100.","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageAuditEntry"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The selected merchant's audit log, newest first","tags":["audit"],"x-required-scope":"read"}},"/v1/auth/csrf":{"get":{"description":"Also refreshes both cookies' lifetime to the session's (sliding) expiry; call it when the cabinet loads.","operationId":"auth-csrf","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSRFBody"}}},"description":"OK","headers":{"Set-Cookie":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Issue a fresh CSRF token for the current session","tags":["auth"]}},"/v1/auth/handoff":{"post":{"description":"A signed-in session mints a token valid 60 seconds and usable once. The app opens <cabinet>/handoff#t=<token>&to=<path>; the cabinet trades the token for its own cookie session with POST /auth/handoff/exchange. Put the token in the fragment: it never reaches a server or a log.","operationId":"auth-handoff-start","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Auth-handoff-startRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffBody"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Open the web cabinet without signing in again","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/handoff/exchange":{"post":{"description":"No credentials needed: the token is the credential. Sets the cabinet cookies. 401 handoff_invalid for an unknown, used or expired token.","operationId":"auth-handoff-exchange","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Auth-handoff-exchangeRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffExchangeBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"Set-Cookie":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Trade a hand-off token for a cabinet session","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/link/phone/request":{"post":{"description":"The same code and the same limits as /auth/otp/request. Finish with /auth/link/phone/verify.","operationId":"auth-link-phone-request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPhoneRequestInputBody"}}},"required":true},"responses":{"202":{"description":"Accepted"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Send a code to a phone to link it to the signed-in account","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/link/phone/verify":{"post":{"description":"Checks the code like /auth/otp/verify but signs nobody in: the phone is attached to the signed-in account. 403 reauth_required: the session has not proven its identity in the last 5 minutes (sign-in counts; otherwise use /auth/reauth/*). Attaching a method revokes the account's OTHER sessions. 409 *_in_use: another account that has a business holds the identity (an EMPTY account, one with no merchant, is merged into this one and deleted). 409 *_already_linked: this account already has a different one.","operationId":"auth-link-phone-verify","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPhoneVerifyInputBody"}}},"required":true},"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Link a phone to the signed-in account with its code","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/link/telegram/callback":{"post":{"description":"Redeems the code, verifies the id_token and attaches the Telegram id to the signed-in account. 204 on success (also when it was already linked). 400 telegram_oidc_state_invalid, 401 telegram_auth_invalid as for sign-in. 403 reauth_required: the session has not proven its identity in the last 5 minutes (sign-in counts; otherwise use /auth/reauth/*). Attaching a method revokes the account's OTHER sessions. 409 *_in_use: another account that has a business holds the identity (an EMPTY account, one with no merchant, is merged into this one and deleted). 409 *_already_linked: this account already has a different one.","operationId":"auth-link-telegram-callback","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkTelegramCallbackInputBody"}}},"required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Finish linking Telegram with the code and state from the redirect","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/link/telegram/start":{"post":{"description":"Answers the Telegram authorization URL, like /auth/telegram/oidc/start. The flow is bound to this session and lives 10 minutes; finish it with /auth/link/telegram/callback.","operationId":"auth-link-telegram-start","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OIDCStartBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Start linking a Telegram account to the signed-in account","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/link/whatsapp/poll":{"post":{"description":"pending, denied, expired or confirmed (the phone is linked). 409 phone_in_use: another account with a business holds this phone. 409 phone_already_linked: this account has another phone. An empty account that holds the phone is merged into this one.","operationId":"auth-link-whatsapp-poll","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkWhatsAppPollInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppPollBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"Set-Cookie":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Poll a WhatsApp phone link","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/link/whatsapp/start":{"post":{"description":"Like /auth/whatsapp/start, for the signed-in user: pressing 'Подтвердить вход' attaches the phone to this account (poll with /auth/link/whatsapp/poll). Cabinet or app session required, re-authenticated within the last 5 minutes (403 reauth_required).","operationId":"auth-link-whatsapp-start","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"'app' when called by the native app.","in":"header","name":"X-PayBot-Client","schema":{"description":"'app' when called by the native app.","enum":["web","app"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkWhatsAppStartInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppStartBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Start linking a phone to the signed-in account by WhatsApp","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/logout":{"post":{"description":"Revokes the session of the request: the bearer token (Authorization: Bearer pbs.<token>) or the session cookie. A dead or unknown session is not an error.","operationId":"auth-logout","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"responses":{"204":{"description":"No Content","headers":{"Set-Cookie":{"schema":{"type":"string"}}}},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"default":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Revoke the current session","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/logout-all":{"post":{"description":"Ends every session of the user, this one included, and removes every push token in every business.","operationId":"auth-logout-all","responses":{"204":{"description":"No Content","headers":{"Set-Cookie":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Sign out everywhere","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/otp/request":{"post":{"description":"Always 202 for a valid phone, whether or not it has an account. Limited to 1 code per minute and 5 per hour per phone.","operationId":"auth-otp-request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneInputBody"}}},"required":true},"responses":{"202":{"description":"Accepted"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Send a sign-in code to a phone","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/otp/verify":{"post":{"operationId":"auth-otp-verify","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","in":"header","name":"X-PayBot-Client","schema":{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","enum":["web","app"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"Set-Cookie":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Sign in with a phone and code","tags":["auth"],"x-idempotency":"refused"}},"/v1/auth/reauth/request":{"post":{"description":"No body: the code always goes to the phone on the account. Same limits as sign-in (1 code per minute, 5 per hour per phone). An account without a phone gets 409 no_phone; use /auth/reauth/telegram.","operationId":"auth-reauth-request","responses":{"202":{"description":"Accepted"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Send a confirmation code to the signed-in user's own phone","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/reauth/telegram":{"post":{"description":"For accounts that sign in with Telegram. The payload is verified as at sign-in, must be at most 5 minutes old and must belong to the Telegram account of the signed-in user.","operationId":"auth-reauth-telegram","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLogin"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Confirm identity with a fresh Telegram Login payload","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/reauth/telegram/oidc/callback":{"post":{"description":"Redeems the code, verifies the id_token and, when it names the Telegram account bound to the signed-in user, unlocks dangerous actions for 5 minutes. 400 telegram_oidc_state_invalid: unknown, expired, reused, a sign-in's, or another session's state. 401 telegram_auth_invalid: Telegram refused the code, the token did not verify, or it names another Telegram account.","operationId":"auth-reauth-telegram-oidc-callback","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthOIDCCallbackInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthBody"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Finish confirming identity with the code and state from the Telegram redirect","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/reauth/telegram/oidc/start":{"post":{"description":"For accounts that sign in with Telegram and have no phone. Answers the Telegram authorization URL; send the browser there as for sign-in. The flow is bound to this session: only it can finish it, with /auth/reauth/telegram/oidc/callback, within 10 minutes. Telegram redirects to the same redirect URI as sign-in, so the cabinet remembers which of the two it started. 409 no_telegram: the account has no Telegram login.","operationId":"auth-reauth-telegram-oidc-start","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OIDCStartBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Start confirming identity with Log In With Telegram (OpenID Connect)","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/reauth/verify":{"post":{"operationId":"auth-reauth-verify","parameters":[{"in":"cookie","name":"__Host-pb_session","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthVerifyInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Confirm identity with the code; unlocks dangerous actions for 5 minutes","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/security-events":{"get":{"description":"Cabinet or app session. Shows pushes sent for the account's phone and how they ended, and a new_sign_in event when the account was first used through a WhatsApp push. Someone who types your number and nobody confirms leaves push_started and push_expired here.","operationId":"auth-security-events","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityEventsOutputBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"The account's recent sign-in events","tags":["auth"]}},"/v1/auth/sessions":{"get":{"operationId":"auth-sessions-list","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionsOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"List the caller's signed-in devices and browsers","tags":["auth"]}},"/v1/auth/sessions/revoke-others":{"post":{"operationId":"auth-sessions-revoke-others","responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Sign every other session out","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/sessions/{id}":{"delete":{"operationId":"auth-sessions-revoke","parameters":[{"description":"Session id (ses_...)","in":"path","name":"id","required":true,"schema":{"description":"Session id (ses_...)","type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Sign one session out","tags":["auth"],"x-idempotency":"optional"}},"/v1/auth/telegram":{"post":{"description":"The widget payload (id, names, auth_date, hash) checked with SHA256(bot token). New clients use /auth/telegram/oidc/start and /auth/telegram/oidc/callback.","operationId":"auth-telegram","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","in":"header","name":"X-PayBot-Client","schema":{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","enum":["web","app"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLogin"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"Set-Cookie":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Sign in with the legacy Telegram Login widget","tags":["auth"],"x-idempotency":"refused"}},"/v1/auth/telegram/oidc/callback":{"post":{"description":"Redeems the code with Telegram, verifies the id_token and signs in exactly like /auth/otp/verify: cookies for the web, session_token with X-PayBot-Client: app. 400 telegram_oidc_state_invalid: unknown, expired, reused or foreign state (start again). 401 telegram_auth_invalid: Telegram refused the code or the token did not verify. 503: Telegram could not be reached.","operationId":"auth-telegram-oidc-callback","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","in":"header","name":"X-PayBot-Client","schema":{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","enum":["web","app"],"type":"string"}},{"in":"cookie","name":"__Host-pb_tg_oidc","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OidcCallbackInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"Set-Cookie":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Finish a Telegram sign-in with the code and state from the redirect","tags":["auth"],"x-idempotency":"refused"}},"/v1/auth/telegram/oidc/start":{"post":{"description":"Answers the Telegram authorization URL to send the browser to. state, nonce and the PKCE verifier stay on the server for 10 minutes. The web is bound to the flow by the HttpOnly cookie __Host-pb_tg_oidc set here; the app (X-PayBot-Client: app) gets flow_token instead.","operationId":"auth-telegram-oidc-start","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","in":"header","name":"X-PayBot-Client","schema":{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","enum":["web","app"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OidcStartInputBody"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OIDCStartBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"Set-Cookie":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Start a Telegram sign-in (Log In With Telegram, OpenID Connect)","tags":["auth"],"x-idempotency":"refused"}},"/v1/auth/whatsapp/poll":{"post":{"description":"pending until the person presses the button; a flow nobody confirms expires after 5 minutes. On confirmed it signs in exactly like /auth/otp/verify: cookies and csrf_token for the web, session_token with X-PayBot-Client: app. A flow signs in once. Poll every 2 seconds; a flow answers at most 200 polls. 400 whatsapp_flow_invalid: unknown, used or foreign flow.","operationId":"auth-whatsapp-poll","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","in":"header","name":"X-PayBot-Client","schema":{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","enum":["web","app"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppPollInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppPollBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"Set-Cookie":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Poll a WhatsApp sign-in; signs in once the button is pressed","tags":["auth"],"x-idempotency":"refused"}},"/v1/auth/whatsapp/start":{"post":{"description":"Sends a WhatsApp message with the button 'Подтвердить вход' to the phone and answers a flow_token for /auth/whatsapp/poll. Same phone rule as /auth/otp/request, limited to 1 per minute and 5 per hour per phone and 10 per minute per network. When the message cannot be sent the answer is 200 with fallback 'code' and no flow: use the code flow. 503 whatsapp_login_not_configured: the server has no WhatsApp sign-in; use the code flow.","operationId":"auth-whatsapp-start","parameters":[{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","in":"header","name":"X-PayBot-Client","schema":{"description":"'app' answers the session as session_token in the body instead of cookies (the native app). Absent or 'web': cookies.","enum":["web","app"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppStartInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppStartBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Start a WhatsApp sign-in: send a confirmation to the phone","tags":["auth"],"x-idempotency":"refused"}},"/v1/billing":{"get":{"description":"Monthly counters reset on the first day of each calendar month (UTC). From a plan's soft limit on, responses that count usage carry a PayBot-Quota-Warning header; at the hard limit the create is refused with 402 plan_limit_reached.","operationId":"billing-summary","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummaryView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The merchant's PayBot plan and usage against its limits","tags":["Billing"],"x-required-scope":"read"}},"/v1/billing/checkout":{"post":{"description":"Cabinet only (an owner or admin). Creates an order and a Kaspi payment to PayBot; pay it with deep_link or qr_token. The plan is applied within seconds of the payment, and GET /billing/orders/{id} shows the outcome. Paying for the plan already running extends it; another plan starts at once. A merchant may have at most 3 unpaid orders at once (409 too_many_open_orders), and checkouts are rate-limited per merchant (429).","operationId":"billing-checkout","parameters":[{"description":"Required. A retry with the same key never creates a second order.","in":"header","name":"Idempotency-Key","required":true,"schema":{"description":"Required. A retry with the same key never creates a second order.","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutInBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanOrderView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Buy a PayBot plan","tags":["Billing"],"x-idempotency":"required","x-required-scope":"money"}},"/v1/billing/orders":{"get":{"operationId":"billing-orders","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrdersOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The merchant's plan orders, newest first (at most 100)","tags":["Billing"],"x-required-scope":"read"}},"/v1/billing/orders/{id}":{"get":{"operationId":"billing-order-get","parameters":[{"description":"ord_...","in":"path","name":"id","required":true,"schema":{"description":"ord_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanOrderView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"One plan order with its payment","tags":["Billing"],"x-required-scope":"read"}},"/v1/billing/plans":{"get":{"operationId":"billing-plans","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlansOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"PayBot plans and their limits","tags":["Billing"],"x-required-scope":"read"}},"/v1/builder/project":{"get":{"description":"A business with no site yet gets 200 with an empty project: the nil id, current_version 0, no messages.","operationId":"builder-project-get","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The business's site project","tags":["builder"],"x-required-scope":"read"}},"/v1/builder/project/events":{"get":{"description":"text/event-stream. Events: run_started {run_id}, delta {text}, file_started {path}, file_done {path}, checking, fixing {round, reason}, preview_ready {version_id}, needs_attention {problems}, error {message}, done {version_id, summary}, version_restored {version_id, n}. `id` grows with every event: reconnect with Last-Event-ID to replay what was missed (the last 500 events are kept). Comment lines are heartbeats every 15 seconds. The stream ends after at most 10 minutes, or when the client reads too slowly; reconnect.","operationId":"builder-events","parameters":[{"description":"The id of the last event received","in":"header","name":"Last-Event-ID","schema":{"description":"The id of the last event received","type":"string"}},{"description":"The same, for clients that cannot set the header","explode":false,"in":"query","name":"last_event_id","schema":{"description":"The same, for clients that cannot set the header","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"text/event-stream":{"schema":{"type":"string"}}},"description":"An event stream"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stream the project's events (server-sent events)","tags":["builder"],"x-required-scope":"read"}},"/v1/builder/project/messages":{"post":{"description":"Starts a run and answers 202 at once; follow it on GET /builder/project/events. The run keeps going if the request ends (at most 10 minutes). 409 run_in_progress while an earlier run of the project is still going. Spends generations.","operationId":"builder-message-send","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Builder-message-sendRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedOutBody"}}},"description":"Accepted"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Ask the builder for a change","tags":["builder"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/builder/project/preview-token":{"post":{"description":"Returns the iframe URL on the preview host with a token valid for one hour; the preview host trades the token for a cookie on first load. 503 when previews are not configured.","operationId":"builder-preview-token","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The URL of the project's live preview","tags":["builder"],"x-idempotency":"optional","x-required-scope":"read"}},"/v1/builder/project/publish":{"post":{"description":"Builds the current version and makes it the live site on the business subdomain. 409 run_in_progress while a run or a restore is going, 409 nothing_to_publish before the first version, 422 version_needs_attention when the current version has unresolved problems, 422 build_not_publishable when the build fails or its output is refused, 409 site_slug_taken when another business holds the subdomain as its page address, 409 site_slug_own_page when another page of this business does, 422 site_slug_invalid when the subdomain cannot be a page address, 429 publish_rate_limited after 10 publishes of the business within an hour (Retry-After), 503 builder_busy when every sandbox is in use (retry later), 503 when publishing is not configured.","operationId":"builder-project-publish","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Publish the current version","tags":["builder"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/builder/project/settings":{"patch":{"description":"paybot_badge: false hides the «Сделано на PayBot» link on the published site, true shows it again (default). Hiding needs the plan entitlement (Профессиональный, Бизнес): 402 badge_plan_required otherwise (the link then stays on whatever is stored). Takes effect within about 30 seconds. 404 when the business has no site project.","operationId":"builder-project-settings","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Builder-project-settingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadgeView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"402":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Payment Required"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change the site's settings","tags":["builder"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/builder/project/versions":{"get":{"operationId":"builder-versions-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionsOutBody1"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The project's versions, newest first (at most 50)","tags":["builder"],"x-required-scope":"read"}},"/v1/builder/project/versions/{id}/restore":{"post":{"description":"Creates a new version that copies the files of the named one (summary \"restored v<n>\") and makes it current. No model call, no generations spent. 409 run_in_progress while a run is going.","operationId":"builder-version-restore","parameters":[{"description":"The version id","in":"path","name":"id","required":true,"schema":{"description":"The version id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderVersionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Go back to an earlier version","tags":["builder"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/builder/projects":{"post":{"description":"One project per business. 409 project_exists when it already has one.","operationId":"builder-project-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Builder-project-createRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectView"}}},"description":"Created"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create the business's site project","tags":["builder"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/builder/subdomain":{"put":{"description":"Owner or admin, cabinet sessions only; the merchant is X-Merchant-Id. 409 subdomain_taken when another business holds the name as its subdomain or as a page address, 409 site_slug_own_page when the business has a site and another of its pages uses the name, 422 subdomain_invalid when it is not allowed. A business with a site keeps it: its store page moves to the new address in the same request (a published site is published there at once; the old address stops working).","operationId":"builder-set-subdomain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubdomainInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubdomainBody"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Rename the business subdomain","tags":["builder"],"x-idempotency":"optional"}},"/v1/catalog/delivery-options":{"get":{"operationId":"catalog-delivery-list","parameters":[{"explode":false,"in":"query","name":"include_archived","schema":{"type":"boolean"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryListOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List delivery options","tags":["Catalog"],"x-required-scope":"read"}},"/v1/catalog/delivery-options/{code}":{"delete":{"operationId":"catalog-delivery-archive","parameters":[{"in":"path","name":"code","required":true,"schema":{"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryOptionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Archive a delivery option","tags":["Catalog"],"x-idempotency":"optional","x-required-scope":"write"},"put":{"description":"Manual delivery only: pickup, courier at a fixed price, courier free from a subtotal, or by arrangement. Idempotent.","operationId":"catalog-delivery-put","parameters":[{"description":"[a-z0-9][a-z0-9_-]*, at most 40","in":"path","name":"code","required":true,"schema":{"description":"[a-z0-9][a-z0-9_-]*, at most 40","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryOptionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create or replace a delivery option","tags":["Catalog"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/catalog/import":{"post":{"description":"All or nothing: a row error and nothing is written; every row error is reported. Rows are matched by handle and SKU: existing ones are updated, new ones created; stock sets on_hand. A dry run works with any key; an import needs the cabinet or a live key.","operationId":"catalog-import","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Import a catalogue CSV (or validate it with dry_run)","tags":["Catalog"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/catalog/products":{"get":{"operationId":"catalog-product-list","parameters":[{"explode":false,"in":"query","name":"include_archived","schema":{"type":"boolean"}},{"description":"next_cursor from the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor from the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageProductView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List products, newest first","tags":["Catalog"],"x-required-scope":"read"},"post":{"operationId":"catalog-product-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create a product with its variants","tags":["Catalog"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/catalog/products/{id}":{"delete":{"operationId":"catalog-product-archive","parameters":[{"description":"prd_...","in":"path","name":"id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Archive a product (take it off sale); orders keep their snapshot","tags":["Catalog"],"x-idempotency":"optional","x-required-scope":"write"},"get":{"operationId":"catalog-product-get","parameters":[{"description":"prd_...","in":"path","name":"id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a product","tags":["Catalog"],"x-required-scope":"read"},"patch":{"operationId":"catalog-product-update","parameters":[{"description":"prd_...","in":"path","name":"id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPatchRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change a product's title or description","tags":["Catalog"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/catalog/products/{id}/variants":{"post":{"operationId":"catalog-variant-create","parameters":[{"description":"prd_... (the product)","in":"path","name":"id","required":true,"schema":{"description":"prd_... (the product)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Add a variant to a product","tags":["Catalog"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/catalog/variants/{id}":{"delete":{"operationId":"catalog-variant-archive","parameters":[{"description":"prd_... (the variant)","in":"path","name":"id","required":true,"schema":{"description":"prd_... (the variant)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Archive a variant (take it off sale)","tags":["Catalog"],"x-idempotency":"optional","x-required-scope":"write"},"patch":{"operationId":"catalog-variant-update","parameters":[{"description":"prd_... (the variant)","in":"path","name":"id","required":true,"schema":{"description":"prd_... (the variant)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantPatchRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change a variant's title or price","tags":["Catalog"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/catalog/variants/{id}/stock":{"post":{"description":"on_hand never drops below what open orders hold. Journalled. Not idempotent by content (a delta), so Idempotency-Key is required.","operationId":"catalog-variant-stock-adjust","parameters":[{"description":"prd_... (the variant)","in":"path","name":"id","required":true,"schema":{"description":"prd_... (the variant)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Adjust a variant's stock by a delta","tags":["Catalog"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/client-errors":{"post":{"description":"Anonymous (the app may fail before sign-in); no Idempotency-Key (a repeat is just another log line). Body at most 8 KiB, limited to 12 per minute per client address. The server writes one log line with the prefix client-error: and stores nothing. Phone numbers, tokens and e-mail addresses are removed by the app and again by the server.","operationId":"client-errors-report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}},"required":true},"responses":{"204":{"description":"No Content"},"413":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Report a crash of the app","tags":["Client errors"],"x-idempotency":"refused"}},"/v1/contacts":{"get":{"description":"One entry per person: leads, bots, orders, payments, subscriptions and courses of the same person are one client. Totals are from the money ledger, net of refunds.","operationId":"contact-list","parameters":[{"description":"next_cursor of the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page","type":"string"}},{"description":"Page size, 1..100 (default 25)","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, 1..100 (default 25)","format":"int64","type":"integer"}},{"description":"Search by name, username or phone","explode":false,"in":"query","name":"q","schema":{"description":"Search by name, username or phone","maxLength":100,"type":"string"}},{"description":"Only contacts from this source","explode":false,"in":"query","name":"source","schema":{"description":"Only contacts from this source","maxLength":32,"type":"string"}},{"description":"Only contacts with this tag","explode":false,"in":"query","name":"tag","schema":{"description":"Only contacts with this tag","maxLength":32,"type":"string"}},{"description":"recent: newest first; spend: who paid most; activity: last activity first","explode":false,"in":"query","name":"sort","schema":{"default":"recent","description":"recent: newest first; spend: who paid most; activity: last activity first","enum":["recent","spend","activity"],"type":"string"}},{"description":"Only clients who bought this: store:<uuid>, course:<uuid>, channel:<plan uuid> or link:<uuid>","explode":false,"in":"query","name":"bought","schema":{"description":"Only clients who bought this: store:<uuid>, course:<uuid>, channel:<plan uuid> or link:<uuid>","maxLength":80,"type":"string"}},{"description":"Only clients with at least one purchase","explode":false,"in":"query","name":"buyers","schema":{"description":"Only clients with at least one purchase","type":"boolean"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageContactView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The business's clients","tags":["contacts"],"x-required-scope":"read"}},"/v1/contacts/{id}":{"get":{"operationId":"contact-get","parameters":[{"description":"cnt_...","in":"path","name":"id","required":true,"schema":{"description":"cnt_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetailView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"One client with their leads and consents","tags":["contacts"],"x-required-scope":"read"},"patch":{"operationId":"contact-patch","parameters":[{"description":"cnt_...","in":"path","name":"id","required":true,"schema":{"description":"cnt_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPatchInBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetailView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Edit a client's name, notes and tags","tags":["contacts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/contacts/{id}/activity":{"get":{"description":"Built from the client's own records only. Anonymous browsing is never attached to a person. An erased contact has no activity.","operationId":"contact-activity","parameters":[{"description":"cnt_...","in":"path","name":"id","required":true,"schema":{"description":"cnt_...","type":"string"}},{"explode":false,"in":"query","name":"limit","schema":{"default":30,"format":"int64","maximum":100,"minimum":1,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"What a client did: bot start, lead, orders, consents, channel access","tags":["Statistics"],"x-required-scope":"read"}},"/v1/contacts/{id}/erase":{"post":{"description":"Clears the name, username, phone, notes and identities; the row stays because payments refer to it.","operationId":"contact-erase","parameters":[{"description":"cnt_...","in":"path","name":"id","required":true,"schema":{"description":"cnt_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetailView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Erase a client's personal data on their request","tags":["contacts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/contacts/{id}/merge":{"post":{"description":"Moves the duplicate's purchases, leads, consents, bots and identities to this client and deletes the duplicate. Two clients that both have a Telegram account cannot be merged (409 both_telegram).","operationId":"contact-merge","parameters":[{"description":"cnt_...","in":"path","name":"id","required":true,"schema":{"description":"cnt_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMergeInBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetailView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Merge a duplicate client into this one","tags":["contacts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses":{"get":{"operationId":"course-list","parameters":[{"description":"next_cursor from the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor from the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCourseView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List courses, newest first","tags":["Courses"],"x-required-scope":"read"},"post":{"operationId":"course-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-createRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create a draft course","tags":["Courses"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses/{course_id}":{"delete":{"operationId":"course-delete","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Delete a course that has no page and no students","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"},"get":{"operationId":"course-get","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a course with its modules and lessons","tags":["Courses"],"x-required-scope":"read"},"patch":{"operationId":"course-update","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-updateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change a course's title or description","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/enrollments":{"get":{"operationId":"course-enrollment-list","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"Cabinet only; an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only; an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"explode":false,"in":"query","name":"cursor","schema":{"type":"string"}},{"explode":false,"in":"query","name":"limit","schema":{"format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageEnrollmentView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List a course's enrollments, newest first","tags":["Courses"],"x-required-scope":"read"}},"/v1/courses/{course_id}/enrollments/{enrollment_id}/extend":{"post":{"operationId":"course-enrollment-extend","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"enr_...","in":"path","name":"enrollment_id","required":true,"schema":{"description":"enr_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-enrollment-extendRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Extend a student's access by a number of days","tags":["Courses"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses/{course_id}/enrollments/{enrollment_id}/reset-phone":{"post":{"description":"For a number that changed hands or a leaked key. The student's sessions and Telegram link are removed; the key still works until reissued.","operationId":"course-enrollment-reset-phone","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"enr_...","in":"path","name":"enrollment_id","required":true,"schema":{"description":"enr_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Clear a student's confirmed phone and end their sign-ins","tags":["Courses"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses/{course_id}/enrollments/{enrollment_id}/revoke":{"post":{"operationId":"course-enrollment-revoke","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"enr_...","in":"path","name":"enrollment_id","required":true,"schema":{"description":"enr_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Revoke a student's access; their key stops working at once","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/enrollments/{enrollment_id}/token":{"post":{"description":"Cabinet session or live API key. The key is shown in this answer only; give it to the student yourself. Idempotency-Key is refused: the key is never stored.","operationId":"course-enrollment-token","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"enr_...","in":"path","name":"enrollment_id","required":true,"schema":{"description":"enr_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Issue a new student key for an enrollment (the old one stops working)","tags":["Courses"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/courses/{course_id}/lessons":{"post":{"operationId":"course-lesson-create","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Append a lesson to a module","tags":["Courses"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses/{course_id}/lessons/{lesson_id}":{"delete":{"operationId":"course-lesson-delete","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Delete a lesson","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"},"put":{"operationId":"course-lesson-replace","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Replace a lesson's title, content and drip","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/lessons/{lesson_id}/attachments":{"post":{"description":"Step one of two (confirm it afterwards). Idempotency-Key is refused: the URL is a credential.","operationId":"course-lesson-attachment-upload","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-lesson-attachment-uploadRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a presigned upload URL for a file attached to a lesson","tags":["Courses"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/courses/{course_id}/lessons/{lesson_id}/attachments/{attachment_id}":{"delete":{"operationId":"course-lesson-attachment-delete","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"att_...","in":"path","name":"attachment_id","required":true,"schema":{"description":"att_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Remove an attachment","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/lessons/{lesson_id}/attachments/{attachment_id}/confirm":{"post":{"operationId":"course-lesson-attachment-confirm","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"att_...","in":"path","name":"attachment_id","required":true,"schema":{"description":"att_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonAttachmentView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Confirm an attachment's upload","tags":["Courses"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses/{course_id}/lessons/{lesson_id}/upload":{"post":{"description":"The file is uploaded straight to the object store with a PUT of exactly the declared type and size. Only the object key is stored. Idempotency-Key is refused: the URL is a credential and is never stored.","operationId":"course-lesson-upload","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-lesson-uploadRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a presigned upload URL for a lesson's file; the lesson becomes a file lesson","tags":["Courses"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/courses/{course_id}/lessons/{lesson_id}/upload/confirm":{"post":{"description":"Step two. After the PUT, send the file_key from the upload answer. PayBot checks that the object is in the store with the announced size and type, then the lesson becomes a file lesson (its text or link is dropped). 422 upload_missing when the file did not arrive.","operationId":"course-lesson-upload-confirm","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-lesson-upload-confirmRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Confirm the lesson's uploaded file; the lesson switches to it now","tags":["Courses"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses/{course_id}/module-order":{"put":{"operationId":"course-module-order","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-module-orderRequest"}}},"required":true},"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Set the order of a course's modules","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/modules":{"post":{"operationId":"course-module-create","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-module-createRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Append a module to a course","tags":["Courses"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/courses/{course_id}/modules/{module_id}":{"delete":{"operationId":"course-module-delete","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"mod_...","in":"path","name":"module_id","required":true,"schema":{"description":"mod_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Delete a module and its lessons","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"},"patch":{"operationId":"course-module-update","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"mod_...","in":"path","name":"module_id","required":true,"schema":{"description":"mod_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-module-updateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Rename a module","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/modules/{module_id}/lesson-order":{"put":{"operationId":"course-lesson-order","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"mod_...","in":"path","name":"module_id","required":true,"schema":{"description":"mod_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-lesson-orderRequest"}}},"required":true},"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Set the order of a module's lessons","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/publish":{"post":{"operationId":"course-publish","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Publish a course: a course page may sell it","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/courses/{course_id}/unpublish":{"post":{"operationId":"course-unpublish","parameters":[{"description":"crs_...","in":"path","name":"course_id","required":true,"schema":{"description":"crs_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stop selling a course (students keep their access)","tags":["Courses"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/dashboard":{"get":{"description":"Pre-computed per UTC day by a background sweep; the numbers lag the payments by up to a minute (see refreshed_at). The range is at most 366 days.","operationId":"dashboard","parameters":[{"description":"First day, YYYY-MM-DD (UTC); default 29 days before to","explode":false,"in":"query","name":"from","schema":{"description":"First day, YYYY-MM-DD (UTC); default 29 days before to","type":"string"}},{"description":"Last day, inclusive; default today (UTC)","explode":false,"in":"query","name":"to","schema":{"description":"Last day, inclusive; default today (UTC)","type":"string"}},{"description":"Cabinet only (default live); an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only (default live); an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Revenue, payments, invoice conversion and subscribers over a range of days","tags":["Dashboard"],"x-required-scope":"read"}},"/v1/deployments":{"get":{"description":"Every deployed template instance at its latest configuration version, with its public page's slug and status when the template has one. updated_at is when the latest version was written (a deploy or a rollback).","operationId":"deployments-list","parameters":[{"description":"Only this template's deployments (a template id, e.g. payment_link); 404 for an unknown one","explode":false,"in":"query","name":"template","schema":{"description":"Only this template's deployments (a template id, e.g. payment_link); 404 for an unknown one","maxLength":50,"type":"string"}},{"description":"next_cursor of the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page","maxLength":64,"type":"string"}},{"description":"Page size, 1..100 (default 25)","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, 1..100 (default 25)","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDeploymentSummary"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List the merchant's deployments, most recently changed first","tags":["Templates"],"x-required-scope":"read"}},"/v1/deployments/{template}/{subject}/stats":{"get":{"description":"The payments the deployment started, created in [from, to): counts, the paid sum, the refunded sum, the last payment time and a per-day series. Defaults to the last 30 days of live payments; at most 366 days. Payments created through the API are not counted: only those a page started.","operationId":"deployment-stats","parameters":[{"description":"Template id, e.g. payment_link","in":"path","name":"template","required":true,"schema":{"description":"Template id, e.g. payment_link","type":"string"}},{"description":"The deployment's public id, as GET /deployments lists it","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id, as GET /deployments lists it","type":"string"}},{"description":"Start of the range, inclusive (RFC 3339). Default: 30 days before to.","explode":false,"in":"query","name":"from","schema":{"description":"Start of the range, inclusive (RFC 3339). Default: 30 days before to.","format":"date-time","type":"string"}},{"description":"End of the range, exclusive (RFC 3339). Default: now.","explode":false,"in":"query","name":"to","schema":{"description":"End of the range, exclusive (RFC 3339). Default: now.","format":"date-time","type":"string"}},{"description":"Which payments: live (default), test (previews) or all","explode":false,"in":"query","name":"mode","schema":{"default":"live","description":"Which payments: live (default), test (previews) or all","enum":["live","test","all"],"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Payments and figures of one page","tags":["Templates"],"x-required-scope":"read"}},"/v1/devices":{"put":{"description":"Stores or refreshes the push token of the native app for the signed-in user and business. The same token sent again refreshes it. A token registered and still active for another user answers 409 device_token_in_use. Cabinet sessions only (cookie or bearer). Storage only: nothing is pushed yet. The token is never returned.","operationId":"devices-put","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutDeviceRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Register a device push token","tags":["Devices"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/devices/{id}":{"delete":{"description":"Marks the caller's own device revoked (used on sign-out). Cabinet sessions only. Revoking twice answers 204 again.","operationId":"devices-delete","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Revoke a device push token","tags":["Devices"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/domains":{"get":{"description":"Each domain with its state, the DNS records to create and what it opens, and the plan's allowance. Live mode only.","operationId":"domain-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOutputBody1"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List the business's own domains","tags":["Domains"],"x-required-scope":"read"},"post":{"description":"Adds the name in the state pending_dns and returns the DNS records to create. Refused with 402 plan_limit_reached (limit custom_domains) when the plan allows no more, 409 domain_taken when the name is connected already, 422 domain_invalid or domain_reserved for names that cannot be used.","operationId":"domain-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"402":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Payment Required"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Connect a domain","tags":["Domains"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/domains/targets":{"get":{"operationId":"domain-targets","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetsOutputBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"What a domain can open: the site and the public pages","tags":["Domains"],"x-required-scope":"read"}},"/v1/domains/{id}":{"delete":{"description":"It stops being served at once; the DNS records at the registrar are the merchant's to delete.","operationId":"domain-delete","parameters":[{"description":"dom_...","in":"path","name":"id","required":true,"schema":{"description":"dom_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Remove a domain","tags":["Domains"],"x-idempotency":"optional","x-required-scope":"write"},"get":{"operationId":"domain-get","parameters":[{"description":"dom_...","in":"path","name":"id","required":true,"schema":{"description":"dom_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"One domain","tags":["Domains"],"x-required-scope":"read"},"patch":{"description":"The site or one of the business's pages; the change is live within seconds.","operationId":"domain-update","parameters":[{"description":"dom_...","in":"path","name":"id","required":true,"schema":{"description":"dom_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change what a domain opens, or its www redirect","tags":["Domains"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/domains/{id}/check":{"post":{"description":"Looks the records up at once instead of waiting for the next scheduled check; at most once every 30 seconds. A domain that gave up (error) starts a new 72-hour window.","operationId":"domain-check","parameters":[{"description":"dom_...","in":"path","name":"id","required":true,"schema":{"description":"dom_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Check the DNS now","tags":["Domains"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/exports/{entity}":{"get":{"description":"payments, orders, contacts, subscribers, leads or sources, with the filters of the screen it comes from. xlsx: Russian headers, amounts as numbers with a format, dates in the business's time zone, statuses as words, a frozen header, column widths and a sheet «Итого». csv: UTF-8 with BOM, ';', decimal comma. At most 50 000 rows (the file says when it was cut off). Cells a spreadsheet would evaluate as a formula are prefixed with a single quote. Personal data is not exported beyond what the API shows.","operationId":"export","parameters":[{"in":"path","name":"entity","required":true,"schema":{"enum":["payments","orders","contacts","subscribers","leads","sources"],"type":"string"}},{"description":"xlsx (default) or csv (UTF-8 with BOM, ';', decimal comma)","explode":false,"in":"query","name":"format","schema":{"description":"xlsx (default) or csv (UTF-8 with BOM, ';', decimal comma)","enum":["xlsx","csv"],"type":"string"}},{"description":"First day, YYYY-MM-DD in the business's time zone (or an RFC 3339 instant); default 29 days before to","explode":false,"in":"query","name":"from","schema":{"description":"First day, YYYY-MM-DD in the business's time zone (or an RFC 3339 instant); default 29 days before to","type":"string"}},{"description":"Last day, inclusive (or an RFC 3339 instant, exclusive); default today","explode":false,"in":"query","name":"to","schema":{"description":"Last day, inclusive (or an RFC 3339 instant, exclusive); default today","type":"string"}},{"description":"Cabinet only (default live); an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only (default live); an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"payments, orders, subscribers: only this status","explode":false,"in":"query","name":"status","schema":{"description":"payments, orders, subscribers: only this status","maxLength":20,"type":"string"}},{"description":"contacts: search by name, username or phone","explode":false,"in":"query","name":"q","schema":{"description":"contacts: search by name, username or phone","maxLength":100,"type":"string"}},{"description":"contacts: only this source","explode":false,"in":"query","name":"source","schema":{"description":"contacts: only this source","maxLength":32,"type":"string"}},{"description":"contacts: only this tag","explode":false,"in":"query","name":"tag","schema":{"description":"contacts: only this tag","maxLength":32,"type":"string"}},{"description":"contacts: order","explode":false,"in":"query","name":"sort","schema":{"description":"contacts: order","enum":["recent","spend","activity"],"type":"string"}},{"description":"contacts: store:<uuid>, course:<uuid>, channel:<uuid> or link:<uuid>","explode":false,"in":"query","name":"bought","schema":{"description":"contacts: store:<uuid>, course:<uuid>, channel:<uuid> or link:<uuid>","maxLength":80,"type":"string"}},{"description":"contacts: only clients with a purchase","explode":false,"in":"query","name":"buyers","schema":{"description":"contacts: only clients with a purchase","type":"boolean"}},{"description":"sources: how rows are grouped","explode":false,"in":"query","name":"group_by","schema":{"description":"sources: how rows are grouped","enum":["source","campaign"],"type":"string"}},{"description":"ignored (accepted so a list screen can send its own query)","explode":false,"in":"query","name":"compare","schema":{"description":"ignored (accepted so a list screen can send its own query)","type":"boolean"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{},"text/csv":{}},"description":"The file"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Download a list as an Excel file (or CSV)","tags":["Dashboard"],"x-required-scope":"read"}},"/v1/generator/credits":{"get":{"operationId":"generator-credits","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenCreditsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Generation credits: balance and latest usage","tags":["Generator"],"x-required-scope":"read"}},"/v1/generator/images":{"post":{"description":"Makes 1 to 4 pictures with an AI image model and stores each as the merchant's own ready upload, so a template or a product refers to it by upload id like to any photo. The merchant sends a short subject (prompt_hint) and a slot; the server builds the prompt from a fixed style, and every picture is made without text, logos or watermarks. One request is one generation of the plan (counted once, returned when no picture could be made) and n pictures at credits_per_image; only stored pictures are charged. Answers 201 with the pictures when they are ready within a few seconds, otherwise 202 with the request id: poll GET /generator/requests/{id} (task images; its images list the upload ids). 422 image_prompt_refused when the subject asks for disallowed content (nothing is charged), 422 image_rejected when the provider's own safety check refused it, 503 images_not_configured when image generation is off.","operationId":"generator-images-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImagesRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedImagesView"}}},"description":"Created"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"402":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Payment Required"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Generate pictures for a page or a product","tags":["Generator"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/generator/imports":{"post":{"description":"Text, CSV or a photo. Every proposed item is checked by the catalogue import as a dry run; items with low confidence, doubts or errors are flagged needs_review. Nothing is created: apply with POST /generator/imports/{id}/apply. Spends credits.","operationId":"generator-import-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenImportRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenImportView"}}},"description":"Created"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"402":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Payment Required"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Propose catalogue items from a messy price list","tags":["Generator"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/generator/imports/{id}":{"get":{"operationId":"generator-import-get","parameters":[{"description":"gim_...","in":"path","name":"id","required":true,"schema":{"description":"gim_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenImportView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Read an import proposal","tags":["Generator"],"x-required-scope":"read"}},"/v1/generator/imports/{id}/apply":{"post":{"description":"Runs the catalogue CSV import (all or nothing) with the picked items. Items that need review are imported only with confirm_reviewed. Cabinet session or live API key.","operationId":"generator-import-apply","parameters":[{"description":"gim_...","in":"path","name":"id","required":true,"schema":{"description":"gim_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenApplyImportRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenImportView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Import the picked items of an import proposal","tags":["Generator"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/generator/requests/{id}":{"get":{"description":"The real server events of a request, in order, with its state and, once stored, its session_id. Poll it while POST /generator/sessions runs (send your own request_id): a stage appears only after the server did it. 404 until the request is recorded.","operationId":"generator-request-get","parameters":[{"description":"The request id (uuid)","in":"path","name":"id","required":true,"schema":{"description":"The request id (uuid)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenRequestView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Progress of a generator request","tags":["Generator"],"x-required-scope":"read"}},"/v1/integrations/bitrix24":{"delete":{"operationId":"bitrix24-disconnect","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Disconnect Bitrix24: forget the webhook, the links and the sync log","tags":["Bitrix24"],"x-idempotency":"optional","x-required-scope":"write"},"get":{"operationId":"bitrix24-status","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24StatusView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The Bitrix24 connection and the state of the sync","tags":["Bitrix24"],"x-required-scope":"read"},"post":{"description":"The webhook is validated (https, a public host, no redirects), tested with a call to the portal and stored encrypted. 422 bitrix24_invalid_url, bitrix24_blocked_host, bitrix24_invalid_webhook, bitrix24_no_crm_scope or bitrix24_unreachable when it cannot be used. Replaces an existing connection. Do not send Idempotency-Key.","operationId":"bitrix24-connect","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24ConnectRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectOutBody"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Connect a Bitrix24 portal by its inbound webhook","tags":["Bitrix24"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/integrations/bitrix24/inbound-token":{"post":{"description":"The token is shown once and replaces the previous one. A Bitrix24 automation robot or outbound webhook POSTs to /v1/integrations/bitrix24/{token}/events; PayBot emits the rules trigger bitrix.deal_stage_changed. Do not send Idempotency-Key.","operationId":"bitrix24-inbound-token","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenOutBody"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Issue a token for the reverse endpoint (a deal changed stage in Bitrix24)","tags":["Bitrix24"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/integrations/bitrix24/items":{"get":{"operationId":"bitrix24-items","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24-itemsResponse"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The last 100 sync items, newest first","tags":["Bitrix24"],"x-required-scope":"read"}},"/v1/integrations/bitrix24/items/{id}/retry":{"post":{"operationId":"bitrix24-item-retry","parameters":[{"description":"Item id (bxs_...)","in":"path","name":"id","required":true,"schema":{"description":"Item id (bxs_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Push a failed or dead item again","tags":["Bitrix24"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/integrations/bitrix24/options":{"get":{"description":"Fills the pipeline, stage and source selects. Calls the portal, so it can answer 422 with a bitrix24_* code.","operationId":"bitrix24-options","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24Options"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The portal's deal pipelines with their stages, and its sources (read live)","tags":["Bitrix24"],"x-required-scope":"read"}},"/v1/integrations/bitrix24/retry-failed":{"post":{"operationId":"bitrix24-retry-failed","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24-retry-failedResponse"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Push every failed or dead item again","tags":["Bitrix24"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/integrations/bitrix24/settings":{"patch":{"operationId":"bitrix24-settings","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24SettingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24ConnectionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change what is synced and where","tags":["Bitrix24"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/integrations/bitrix24/test":{"post":{"description":"A failure is an answer (ok false with a code), not an HTTP error. A successful test resumes a paused connection.","operationId":"bitrix24-test","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bitrix24CheckView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Check the stored connection (who the webhook is, whether it has the CRM right)","tags":["Bitrix24"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/invites":{"get":{"description":"Newest first, in every status. Owner or admin. Never includes a token.","operationId":"list-invites","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitesOutputBody"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The selected merchant's invites","tags":["invites"],"x-required-scope":"read"},"post":{"description":"Owner or admin; an owner invite needs an owner. An admin or owner invite needs a re-authentication in the last 5 minutes. The token is in the response only. Do not send Idempotency-Key (400).","operationId":"create-invite","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteInputBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedInvite"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Invite a person by phone or email","tags":["invites"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/invites/{id}":{"delete":{"description":"Revoking a revoked or expired invite succeeds; an accepted one is 409 invite_accepted.","operationId":"revoke-invite","parameters":[{"description":"Invite id (ivt_...).","in":"path","name":"id","required":true,"schema":{"description":"Invite id (ivt_...).","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Revoke an invite","tags":["invites"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/invites/{token}/accept":{"post":{"description":"Any signed-in cabinet user, without X-Merchant-Id. The invite works only for the phone or email it was sent to; every failure is the same 404 invite_invalid. An existing membership is never changed.","operationId":"accept-invite","parameters":[{"description":"The invite token from the invitation link.","in":"path","name":"token","required":true,"schema":{"description":"The invite token from the invitation link.","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Accept an invite and join its merchant","tags":["invites"],"x-idempotency":"optional"}},"/v1/kaspi/accounts":{"get":{"operationId":"kaspi-accounts-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountListOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List connected Kaspi accounts","tags":["Kaspi accounts"],"x-required-scope":"read"}},"/v1/kaspi/accounts/login":{"post":{"operationId":"kaspi-account-login-start","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Kaspi-account-login-startRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountView"}}},"description":"Accepted"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Start connecting a Kaspi cashier account (sends an SMS code)","tags":["Kaspi accounts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/kaspi/accounts/{id}":{"delete":{"operationId":"kaspi-account-delete","parameters":[{"description":"Account id (kac_...)","in":"path","name":"id","required":true,"schema":{"description":"Account id (kac_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Disconnect a Kaspi account and erase its keys","tags":["Kaspi accounts"],"x-idempotency":"required","x-required-scope":"write"},"get":{"operationId":"kaspi-account-get","parameters":[{"description":"Account id (kac_...)","in":"path","name":"id","required":true,"schema":{"description":"Account id (kac_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a Kaspi account","tags":["Kaspi accounts"],"x-required-scope":"read"}},"/v1/kaspi/accounts/{id}/check":{"post":{"description":"The cabinet's «Обновить»: asks Kaspi whether the session still works and returns the account's state afterwards. An account that is not usable (expired, login pending, disabled) is returned as it is.","operationId":"kaspi-account-check","parameters":[{"description":"Account id (kac_...)","in":"path","name":"id","required":true,"schema":{"description":"Account id (kac_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Check the account's Kaspi session now","tags":["Kaspi accounts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/kaspi/accounts/{id}/default":{"post":{"operationId":"kaspi-account-set-default","parameters":[{"description":"Account id (kac_...)","in":"path","name":"id","required":true,"schema":{"description":"Account id (kac_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Use this account for new payments","tags":["Kaspi accounts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/kaspi/accounts/{id}/disable":{"post":{"operationId":"kaspi-account-disable","parameters":[{"description":"Account id (kac_...)","in":"path","name":"id","required":true,"schema":{"description":"Account id (kac_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stop using this account","tags":["Kaspi accounts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/kaspi/accounts/{id}/verify":{"post":{"operationId":"kaspi-account-login-verify","parameters":[{"description":"Account id (kac_...)","in":"path","name":"id","required":true,"schema":{"description":"Account id (kac_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Kaspi-account-login-verifyRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Finish connecting a Kaspi account with the SMS code","tags":["Kaspi accounts"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/live/pages/{page_id}":{"get":{"operationId":"live-page-get","parameters":[{"description":"prd_...","in":"path","name":"page_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageResource"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"A live page with its lots","tags":["Live pages"],"x-required-scope":"read"}},"/v1/live/pages/{page_id}/current":{"put":{"operationId":"live-current-set","parameters":[{"description":"prd_...","in":"path","name":"page_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCurrentBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageResource"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Put a lot on air","tags":["Live pages"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/live/pages/{page_id}/lots":{"post":{"operationId":"live-lot-create","parameters":[{"description":"prd_...","in":"path","name":"page_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLotBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LotResource"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Add a lot to a live page","tags":["Live pages"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/live/pages/{page_id}/lots/{lot_id}":{"delete":{"operationId":"live-lot-delete","parameters":[{"description":"prd_...","in":"path","name":"page_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"prd_...","in":"path","name":"lot_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Delete a lot nobody checked out","tags":["Live pages"],"x-idempotency":"optional","x-required-scope":"write"},"patch":{"operationId":"live-lot-update","parameters":[{"description":"prd_...","in":"path","name":"page_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"prd_...","in":"path","name":"lot_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLotBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LotResource"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change an open lot","tags":["Live pages"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/live/pages/{page_id}/lots/{lot_id}/close":{"post":{"description":"Closing the lot on air takes it off air. Payments in progress still settle. Idempotent.","operationId":"live-lot-close","parameters":[{"description":"prd_...","in":"path","name":"page_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"prd_...","in":"path","name":"lot_id","required":true,"schema":{"description":"prd_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LotResource"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stop selling a lot","tags":["Live pages"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/mcp/connection":{"get":{"description":"The address of the MCP endpoint and the tools it serves, for the cabinet's connect screen. Create the key with POST /v1/api-keys.","operationId":"mcp-connection","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPConnectionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"How to connect the merchant's own AI (MCP address, tool list)","tags":["MCP"],"x-required-scope":"read"}},"/v1/me":{"delete":{"description":"Cabinet session only, and the caller must have re-authenticated within 5 minutes (403 reauth_required). Personal data is cleared, every session ends, push tokens are removed. Each business is left, or closed when the caller is its only member; 409 ownership_transfer_required when the caller is the only owner of a team. Not reversible.","operationId":"me-delete","parameters":[{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me-deleteRequest"}}},"required":true},"responses":{"204":{"description":"No Content","headers":{"Set-Cookie":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Delete the caller's account","tags":["auth"],"x-idempotency":"required"},"get":{"operationId":"get-me","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"The signed-in user and their merchants","tags":["auth"]}},"/v1/me/deletion":{"get":{"description":"For each business: leave (it goes on without you), close (you are the only member: it is closed and kept for the records the law requires) or blocked (you are the only owner and others remain: make someone else an owner first).","operationId":"me-deletion-preview","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionPreview"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"What deleting the account would do","tags":["auth"]}},"/v1/me/logins":{"get":{"description":"Cabinet or app session. Every sign-in of the caller's account in the last 12 months, newest first: when, the method, the result, a coarse device and the masked network, and whether the session is still active. Failed attempts against the account's phone are included; attempts against a phone with no account are not recorded anywhere. It spans all of the caller's businesses. Cursor pages (limit up to 100).","operationId":"me-logins","parameters":[{"description":"next_cursor of the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page","maxLength":64,"type":"string"}},{"description":"Page size, 1..100 (default 25)","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, 1..100 (default 25)","format":"int64","type":"integer"}},{"description":"Only this result","explode":false,"in":"query","name":"result","schema":{"description":"Only this result","enum":["success","failed","blocked","cancelled"],"type":"string"}},{"description":"Only this method","explode":false,"in":"query","name":"method","schema":{"description":"Only this method","enum":["whatsapp_button","whatsapp_code","telegram","app_link","admin"],"type":"string"}},{"description":"Only entries at or after this time (RFC 3339)","explode":false,"in":"query","name":"from","schema":{"description":"Only entries at or after this time (RFC 3339)","format":"date-time","type":"string"}},{"description":"Only entries before this time (RFC 3339)","explode":false,"in":"query","name":"to","schema":{"description":"Only entries before this time (RFC 3339)","format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageLoginEntry"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"The caller's sign-in history","tags":["auth"]}},"/v1/me/logins/{id}/not-me":{"post":{"description":"Marks one of the caller's successful sign-ins as cancelled and signs out the session it opened, and only that one. Idempotent. 404: not the caller's entry. 409 login_current_session: it is the session being used (sign out instead). 409 login_not_reportable: the entry is not a successful sign-in.","operationId":"me-logins-not-me","parameters":[{"description":"lgn_...","in":"path","name":"id","required":true,"schema":{"description":"lgn_...","type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotMeResult"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"This sign-in was not me: close its session","tags":["auth"],"x-idempotency":"required"}},"/v1/members":{"get":{"description":"Any member may list. Cabinet sessions only; the merchant is X-Merchant-Id.","operationId":"list-members","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembersOutputBody"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The people of the selected merchant","tags":["members"],"x-required-scope":"read"}},"/v1/members/{user_id}":{"delete":{"description":"Anyone may remove themselves; an admin removes viewers and admins; only an owner removes an owner. The last owner cannot be removed. Removing an owner or an admin needs a re-authentication in the last 5 minutes, and revokes the open invites they sent.","operationId":"remove-member","parameters":[{"description":"User id (usr_...).","in":"path","name":"user_id","required":true,"schema":{"description":"User id (usr_...).","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Remove a member (or leave the merchant)","tags":["members"],"x-idempotency":"optional","x-required-scope":"read"},"patch":{"description":"An admin manages viewers and admins; only an owner makes, demotes or touches an owner. The last owner cannot be demoted (409 last_owner). Any change that grants or takes away admin or owner rights needs a re-authentication in the last 5 minutes (403 reauth_required).","operationId":"change-member-role","parameters":[{"description":"User id (usr_...).","in":"path","name":"user_id","required":true,"schema":{"description":"User id (usr_...).","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeRoleInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change a member's role","tags":["members"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/merchants":{"get":{"operationId":"list-merchants","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantsOutputBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"The caller's merchants","tags":["merchants"]},"post":{"operationId":"create-merchant","parameters":[{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMerchantInputBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"402":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Payment Required"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Register a merchant; the caller becomes its owner","tags":["merchants"],"x-idempotency":"required"}},"/v1/merchants/{id}":{"get":{"description":"Cabinet sessions only. Does not need X-Merchant-Id. A merchant the caller is not in is 404.","operationId":"get-merchant","parameters":[{"description":"Merchant id (mch_...).","in":"path","name":"id","required":true,"schema":{"description":"Merchant id (mch_...).","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDetail"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]}],"summary":"A merchant the caller is a member of","tags":["merchants"]},"patch":{"description":"Owner or admin, cabinet sessions only. The organisation details come from Kaspi and are not editable.","operationId":"update-merchant","parameters":[{"description":"Merchant id (mch_...).","in":"path","name":"id","required":true,"schema":{"description":"Merchant id (mch_...).","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMerchantInputBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDetail"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Rename a merchant, change its timezone or set its logo","tags":["merchants"],"x-idempotency":"optional"}},"/v1/merchants/{id}/legal-profile":{"get":{"operationId":"legal-profile-get","parameters":[{"description":"The merchant id; the one selected with X-Merchant-Id","in":"path","name":"id","required":true,"schema":{"description":"The merchant id; the one selected with X-Merchant-Id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The seller's legal profile","tags":["legal-profile"],"x-required-scope":"read"},"put":{"description":"Changing offer_text raises offer_version.","operationId":"legal-profile-put","parameters":[{"description":"The merchant id; the one selected with X-Merchant-Id","in":"path","name":"id","required":true,"schema":{"description":"The merchant id; the one selected with X-Merchant-Id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create or replace the seller's legal profile","tags":["legal-profile"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/merchants/{id}/legal-profile/documents":{"post":{"description":"Nothing is saved. The drafts have gaps written as [уточните: …]; the merchant fills them in and confirms the texts with PUT confirm_terms.","operationId":"legal-profile-documents","parameters":[{"description":"The merchant id; the one selected with X-Merchant-Id","in":"path","name":"id","required":true,"schema":{"description":"The merchant id; the one selected with X-Merchant-Id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Documents"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Draft the offer and the privacy policy from the profile","tags":["legal-profile"],"x-idempotency":"required","x-required-scope":"read"}},"/v1/notifications/preferences":{"get":{"description":"The per-event, per-channel matrix (push to the app, Telegram), quiet hours, the evening summary, and what each channel can do right now. Defaults fill whatever was never saved. Cabinet only.","operationId":"notifications-preferences-get","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPrefsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get what the caller is told about, and where","tags":["Notifications"],"x-required-scope":"read"},"put":{"description":"Changes the listed events, quiet hours and summary; everything not named keeps its value. Quiet hours hold push messages until the window ends (Telegram has its own do-not-disturb).","operationId":"notifications-preferences-put","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutNotificationPrefsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPrefsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change what the caller is told about, and where","tags":["Notifications"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/notifications/push/test":{"post":{"description":"Queues one test message per registered phone. 503 notifications_not_configured when push is off on this installation. Cabinet only.","operationId":"notifications-push-test","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestPushView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Send a test push to the caller's phones","tags":["Notifications"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/notifications/settings":{"get":{"operationId":"notifications-settings-get","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get notification settings","tags":["Notifications"],"x-required-scope":"read"},"put":{"operationId":"notifications-settings-put","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutNotificationSettingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Replace notification settings","tags":["Notifications"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/notifications/telegram/link":{"post":{"description":"Returns a deep link to the platform bot with a one-time code. The user opens it and presses Start; the chat is then bound to their account. A new link replaces the previous unused one. Cabinet only. 503 notifications_not_configured when the installation has no platform bot.","operationId":"notifications-telegram-link","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationLinkView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Link Telegram for notifications","tags":["Notifications"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/oauth/authorization/decision":{"post":{"description":"The consent screen's second call. Approving needs a business, a mode and scopes; the money scope also needs a re-authentication in the last 5 minutes (403 reauth_required). The answer is the address to send the browser to: the application's redirect URI with the authorization code (or access_denied). Single use.","operationId":"oauth-authorization-decision","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDecisionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDecisionView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"Allow or refuse an AI application","tags":["AI connections"],"x-idempotency":"refused"}},"/v1/oauth/authorization/preview":{"post":{"description":"The consent screen's first call. Takes the one-time request token the authorization endpoint put in the cabinet address. Cabinet sessions only; the businesses are those where the user is an owner or an admin. 409 oauth_request_expired for an unknown, expired or answered request.","operationId":"oauth-authorization-preview","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentPreviewRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentPreviewView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]}],"summary":"What an AI application asks for, and the businesses that can be connected","tags":["AI connections"],"x-idempotency":"refused"}},"/v1/oauth/grants":{"get":{"description":"The applications the business allowed through OAuth (Claude, ChatGPT, other MCP clients), newest first; revoked ones are not listed.","operationId":"oauth-list-grants","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantsOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Connected AI applications","tags":["AI connections"],"x-required-scope":"read"}},"/v1/oauth/grants/{id}":{"delete":{"description":"Revokes the connection: its tokens stop working at once and the approvals it was waiting for expire. Cabinet sessions only.","operationId":"oauth-disconnect-grant","parameters":[{"description":"The connection to end, oag_...","in":"path","name":"id","required":true,"schema":{"description":"The connection to end, oag_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Disconnect an AI application","tags":["AI connections"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/orders":{"get":{"operationId":"order-list","parameters":[{"description":"Cabinet only; an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only; an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"new, paid, packed, shipped, done or cancelled; refunded: the orders whose payment was refunded in full","explode":false,"in":"query","name":"status","schema":{"description":"new, paid, packed, shipped, done or cancelled; refunded: the orders whose payment was refunded in full","type":"string"}},{"description":"Only the orders of this buyer phone","explode":false,"in":"query","name":"phone","schema":{"description":"Only the orders of this buyer phone","maxLength":20,"type":"string"}},{"description":"next_cursor from the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor from the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"Only orders created at or after this time (RFC 3339)","explode":false,"in":"query","name":"created_from","schema":{"description":"Only orders created at or after this time (RFC 3339)","format":"date-time","type":"string"}},{"description":"Only orders created before this time (RFC 3339)","explode":false,"in":"query","name":"created_to","schema":{"description":"Only orders created before this time (RFC 3339)","format":"date-time","type":"string"}},{"description":"Only orders from this source, e.g. store","explode":false,"in":"query","name":"source","schema":{"description":"Only orders from this source, e.g. store","maxLength":50,"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageOrderView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List orders, newest first","tags":["Orders"],"x-required-scope":"read"}},"/v1/orders/{id}":{"get":{"operationId":"order-get","parameters":[{"description":"ord_...","in":"path","name":"id","required":true,"schema":{"description":"ord_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get an order with its history and the buyer's phone","tags":["Orders"],"x-required-scope":"read"}},"/v1/orders/{id}/transition":{"post":{"description":"packed, shipped, done or cancelled, along the order state machine; an order becomes paid only through its payment. Repeating the current status is a no-op. Journalled.","operationId":"order-transition","parameters":[{"description":"ord_...","in":"path","name":"id","required":true,"schema":{"description":"ord_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Move an order to another status","tags":["Orders"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/pay/health":{"get":{"description":"working / degraded / down / none, the connected accounts, how many buyers could not pay while Kaspi was unavailable and the number of open problems. Cheap: it reads stored state (the background check keeps it fresh); POST /kaspi/accounts/{id}/check asks Kaspi now.","operationId":"pay-health","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Can buyers pay right now? The Kaspi status for the cabinet header and the app","tags":["Payments"],"x-required-scope":"read"}},"/v1/pay/problems":{"get":{"description":"Buyers who could not pay while Kaspi was unavailable (with their phone when the checkout was an invoice), double payments, refunds waiting for the Kaspi session or failed, expired payments that could not be checked, refunds picked up from Kaspi, and mismatches the daily reconciliation found. Open ones unless resolved=true.","operationId":"pay-problems-list","parameters":[{"description":"Include the resolved ones","explode":false,"in":"query","name":"resolved","schema":{"description":"Include the resolved ones","type":"boolean"}},{"description":"1..200, default 50","explode":false,"in":"query","name":"limit","schema":{"description":"1..200, default 50","format":"int64","type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemsOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The problems to look at on Today","tags":["Payments"],"x-required-scope":"read"}},"/v1/pay/problems/refused/resolve":{"post":{"operationId":"pay-problems-resolve-refused","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pay-problems-resolve-refusedResponse"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Mark all refused checkouts as dealt with","tags":["Payments"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/pay/problems/{id}/resolve":{"post":{"operationId":"pay-problem-resolve","parameters":[{"description":"prb_...","in":"path","name":"id","required":true,"schema":{"description":"prb_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Mark a problem done","tags":["Payments"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/pay/reconcile":{"post":{"description":"Cabinet button «Сверить». Picks up refunds made in the Kaspi app, replaces the payment time with Kaspi's operation time and flags payments PayBot expired that Kaspi lists. Also runs by itself once a day.","operationId":"pay-reconcile","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconcileReport"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Check the payments against the Kaspi history now","tags":["Payments"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/payments":{"get":{"operationId":"payments-list","parameters":[{"description":"Comma-separated statuses, e.g. pending,paid","explode":false,"in":"query","name":"status","schema":{"description":"Comma-separated statuses, e.g. pending,paid","type":"string"}},{"explode":false,"in":"query","name":"kind","schema":{"enum":["invoice","qr"],"type":"string"}},{"description":"Cabinet only; an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only; an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"next_cursor of the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page","type":"string"}},{"description":"Page size, 1..100 (default 25)","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, 1..100 (default 25)","format":"int64","type":"integer"}},{"description":"Only payments created at or after this time (RFC 3339)","explode":false,"in":"query","name":"created_from","schema":{"description":"Only payments created at or after this time (RFC 3339)","format":"date-time","type":"string"}},{"description":"Only payments created before this time (RFC 3339)","explode":false,"in":"query","name":"created_to","schema":{"description":"Only payments created before this time (RFC 3339)","format":"date-time","type":"string"}},{"description":"Only the payment with exactly this client_ref","explode":false,"in":"query","name":"client_ref","schema":{"description":"Only the payment with exactly this client_ref","maxLength":200,"type":"string"}},{"description":"Only invoices sent to this phone (any KZ spelling); matched through a blind index","explode":false,"in":"query","name":"payer_phone","schema":{"description":"Only invoices sent to this phone (any KZ spelling); matched through a blind index","maxLength":20,"type":"string"}},{"description":"Only the payments one page started: the deployment's id as GET /deployments lists it (pl_..., tpl_...) or its bare uuid","explode":false,"in":"query","name":"source_id","schema":{"description":"Only the payments one page started: the deployment's id as GET /deployments lists it (pl_..., tpl_...) or its bare uuid","maxLength":64,"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagePaymentView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List payments, newest first","tags":["Payments"],"x-required-scope":"read"}},"/v1/payments/invoices":{"post":{"description":"Responds 201 once Kaspi has answered: status `pending` (waiting for the payer) or `failed` (Kaspi refused it; see failure_reason). Responds 202 with status `creating` when Kaspi takes longer than the server's wait (8 s by default; `Prefer: wait=N` may shorten it): the outcome then arrives as a webhook, or poll GET /payments/{id}. A retry with the same Idempotency-Key or client_ref returns the same payment and never creates a second one at Kaspi.","operationId":"payment-invoice-create","parameters":[{"description":"Required. A retry with the same key never creates a second Kaspi payment.","in":"header","name":"Idempotency-Key","required":true,"schema":{"description":"Required. A retry with the same key never creates a second Kaspi payment.","type":"string"}},{"description":"Optional 'wait=N' (seconds) to wait less than the server's default before a 202.","in":"header","name":"Prefer","schema":{"description":"Optional 'wait=N' (seconds) to wait less than the server's default before a 202.","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceInBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentView"}}},"description":"Created","headers":{"Location":{"schema":{"type":"string"}}}},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentView"}}},"description":"Accepted: Kaspi has not answered within the wait; status is `creating` and the outcome arrives by webhook (or poll GET /payments/{id})","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Send a Kaspi invoice to a payer's phone","tags":["Payments"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/payments/qr":{"post":{"description":"Responds 201 once Kaspi has answered: status `pending` (waiting for the payer) or `failed` (Kaspi refused it; see failure_reason). Responds 202 with status `creating` when Kaspi takes longer than the server's wait (8 s by default; `Prefer: wait=N` may shorten it): the outcome then arrives as a webhook, or poll GET /payments/{id}. A retry with the same Idempotency-Key or client_ref returns the same payment and never creates a second one at Kaspi.","operationId":"payment-qr-create","parameters":[{"description":"Required. A retry with the same key never creates a second Kaspi payment.","in":"header","name":"Idempotency-Key","required":true,"schema":{"description":"Required. A retry with the same key never creates a second Kaspi payment.","type":"string"}},{"description":"Optional 'wait=N' (seconds) to wait less than the server's default before a 202.","in":"header","name":"Prefer","schema":{"description":"Optional 'wait=N' (seconds) to wait less than the server's default before a 202.","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQRInBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentView"}}},"description":"Created","headers":{"Location":{"schema":{"type":"string"}}}},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentView"}}},"description":"Accepted: Kaspi has not answered within the wait; status is `creating` and the outcome arrives by webhook (or poll GET /payments/{id})","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create a Kaspi QR payment","tags":["Payments"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/payments/{id}":{"get":{"operationId":"payment-get","parameters":[{"description":"Payment id (pay_...)","in":"path","name":"id","required":true,"schema":{"description":"Payment id (pay_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a payment","tags":["Payments"],"x-required-scope":"read"}},"/v1/payments/{id}/cancel":{"post":{"description":"Asks Kaspi for the payment's status first. If it was paid in the meantime the payment is returned as paid; otherwise an invoice is cancelled at Kaspi and the payment becomes failed with failure_reason cancelled (a QR cannot be voided at Kaspi, it is only no longer watched). A payment that is not pending is returned unchanged. 503 when Kaspi cannot be asked: nothing is changed, try again.","operationId":"payment-cancel","parameters":[{"description":"Payment id (pay_...)","in":"path","name":"id","required":true,"schema":{"description":"Payment id (pay_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stop waiting for a pending payment","tags":["Payments"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/payments/{id}/events":{"get":{"description":"Server-sent events (`text/event-stream`). Sends the current status at once, then one `payment.status` event per status change, whose `data` is the payment as GET /payments/{id} returns it and whose `id` is a resume token: reconnect with `Last-Event-ID` to receive exactly the changes you missed. The stream closes after a terminal status (paid, failed, expired, refunded) and after at most 10 minutes; a reconnect to a terminal payment with nothing new answers 204. Comment lines (`:`) are heartbeats.","operationId":"payment-events","parameters":[{"description":"Payment id (pay_...)","in":"path","name":"id","required":true,"schema":{"description":"Payment id (pay_...)","type":"string"}},{"description":"The id of the last event received; the transitions after it are replayed. EventSource sends it by itself on reconnect.","in":"header","name":"Last-Event-ID","schema":{"description":"The id of the last event received; the transitions after it are replayed. EventSource sends it by itself on reconnect.","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"text/event-stream":{"schema":{"type":"string"}}},"description":"An event stream; see the description for the format"},"204":{"description":"The payment is terminal and the client has already seen every change"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Stream a payment's status (server-sent events)","tags":["Payments"],"x-required-scope":"read"}},"/v1/payments/{id}/history":{"get":{"operationId":"payment-history","parameters":[{"description":"Payment id (pay_...)","in":"path","name":"id","required":true,"schema":{"description":"Payment id (pay_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Status history of a payment, oldest first","tags":["Payments"],"x-required-scope":"read"}},"/v1/payments/{id}/refund":{"post":{"description":"Never moves money. Creates an approval and answers 202 with its id: the refund happens only after a person approves it in the cabinet (POST /approvals/{id}/approve), and the outcome arrives as the payment.refunded webhook or on the approval. Requires the money scope. A test-mode key refunds only test payments. Only a paid payment can be refunded, in full; one open request per payment. Refused with 422 when it exceeds the merchant's refund limits.","operationId":"payment-refund-request","parameters":[{"description":"Required. A retry with the same key returns the same approval.","in":"header","name":"Idempotency-Key","required":true,"schema":{"description":"Required. A retry with the same key returns the same approval.","type":"string"}},{"description":"Payment id (pay_...)","in":"path","name":"id","required":true,"schema":{"description":"Payment id (pay_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundBody","description":"Optional"}}}},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequestView"}}},"description":"Accepted","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Ask for a refund (creates an approval)","tags":["Payments"],"x-idempotency":"required","x-required-scope":"money"}},"/v1/payments/{id}/refunds":{"get":{"operationId":"payment-refunds","parameters":[{"description":"Payment id (pay_...)","in":"path","name":"id","required":true,"schema":{"description":"Payment id (pay_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment-refundsResponse"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Refund requests of a payment and where each one stands","tags":["Payments"],"x-required-scope":"read"}},"/v1/plans":{"get":{"operationId":"plan-list","parameters":[{"description":"next_cursor of the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagePlanView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List plans, newest first","tags":["Plans"],"x-required-scope":"read"},"post":{"operationId":"plan-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create a subscription plan","tags":["Plans"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/plans/{id}":{"get":{"operationId":"plan-get","parameters":[{"description":"Plan id (pln_...)","in":"path","name":"id","required":true,"schema":{"description":"Plan id (pln_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a plan","tags":["Plans"],"x-required-scope":"read"},"patch":{"description":"A price change applies to periods bought from now on and is recorded in the audit log with the price before and after.","operationId":"plan-update","parameters":[{"description":"Plan id (pln_...)","in":"path","name":"id","required":true,"schema":{"description":"Plan id (pln_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlanRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change a plan; a running period keeps the terms it started with","tags":["Plans"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/plans/{id}/archive":{"post":{"operationId":"plan-archive","parameters":[{"description":"Plan id (pln_...)","in":"path","name":"id","required":true,"schema":{"description":"Plan id (pln_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Archive a plan: it takes no new subscribers; existing subscribers keep renewing on their terms","tags":["Plans"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/promo-codes":{"get":{"operationId":"promo-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List promo codes, newest first","tags":["Promo codes"],"x-required-scope":"read"},"post":{"operationId":"promo-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promo-createRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create a promo code","tags":["Promo codes"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/promo-codes/{id}":{"patch":{"operationId":"promo-set-active","parameters":[{"description":"prm_...","in":"path","name":"id","required":true,"schema":{"description":"prm_...","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promo-set-activeRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Switch a promo code on or off","tags":["Promo codes"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/public/courses/access":{"post":{"description":"Anonymous. Poll it after a course checkout with its payment_id and claim_code: until the payment is paid it answers the status and no key. Once paid, it answers the key of every course the payment bought, ONCE; a second claim is 409 (the seller can issue a new key).","operationId":"course-access-claim","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-access-claimRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Claim the student key a paid payment bought","tags":["Course students"],"x-idempotency":"optional"}},"/v1/public/courses/learn/exchange":{"post":{"operationId":"course-learn-exchange","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-learn-exchangeRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnExchangeView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Trade the one-time code of the bot's «Учиться» button for the student key","tags":["Course students"],"x-idempotency":"optional"}},"/v1/public/courses/login/start":{"post":{"description":"Anonymous. Answers 200 with a challenge_id, whether or not the phone is confirmed for a course; the id is required with the code. 429 when the phone's send budget is spent (3 an hour, 10 a day), the same for every phone. The code goes to the Telegram chat the student started with the business's bot (it opens only that course), or by WhatsApp (it opens every course the phone is confirmed for).","operationId":"course-login-start","parameters":[{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-login-startRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginChallengeView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Send a sign-in code to the phone a course was bought with","tags":["Course students"],"x-idempotency":"required"}},"/v1/public/courses/login/verify":{"post":{"description":"Anonymous. 422 invalid_code for a wrong, expired or used code (five tries per code).","operationId":"course-login-verify","parameters":[{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-login-verifyRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentLoginView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Trade a correct sign-in code for the student's keys","tags":["Course students"],"x-idempotency":"required"}},"/v1/public/courses/me":{"get":{"operationId":"course-student-outline","parameters":[{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentCourseView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"The student's course: modules and lessons with their drip state and progress","tags":["Course students"]}},"/v1/public/courses/me/lessons/{lesson_id}":{"get":{"description":"A locked lesson (drip) is 403 lesson_locked and returns nothing of its content. A file lesson answers a download URL valid for at most 5 minutes.","operationId":"course-student-lesson","parameters":[{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentLessonContentView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"An open lesson's content","tags":["Course students"]}},"/v1/public/courses/me/lessons/{lesson_id}/attachments/{attachment_id}":{"get":{"operationId":"course-student-attachment","parameters":[{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"att_...","in":"path","name":"attachment_id","required":true,"schema":{"description":"att_...","type":"string"}},{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileLinkView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"A short-lived download of a lesson attachment","tags":["Course students"]}},"/v1/public/courses/me/lessons/{lesson_id}/complete":{"post":{"operationId":"course-student-complete","parameters":[{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgressView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Mark an open lesson done","tags":["Course students"],"x-idempotency":"optional"}},"/v1/public/courses/me/lessons/{lesson_id}/position":{"put":{"operationId":"course-student-position","parameters":[{"description":"lsn_...","in":"path","name":"lesson_id","required":true,"schema":{"description":"lsn_...","type":"string"}},{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-student-positionRequest"}}},"required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Remember where the student stopped in a lesson's video","tags":["Course students"],"x-idempotency":"required"}},"/v1/public/courses/me/phone/confirm":{"post":{"operationId":"course-student-phone-confirm","parameters":[{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-student-phone-confirmRequest"}}},"required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Link the phone to this course with the code it received","tags":["Course students"],"x-idempotency":"required"}},"/v1/public/courses/me/phone/start":{"post":{"description":"X-Student-Token. The code goes by WhatsApp to that phone; confirm it to link the phone to this course.","operationId":"course-student-phone-start","parameters":[{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course-student-phone-startRequest"}}},"required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"Send a code to a phone the student wants to sign in with later","tags":["Course students"],"x-idempotency":"required"}},"/v1/public/courses/me/telegram-link":{"post":{"description":"Anonymous with X-Student-Token. Each call issues a new code valid for 24 hours and usable once. 409 no_bot when the business has no connected bot.","operationId":"course-student-telegram-link","parameters":[{"description":"The student key","in":"header","name":"X-Student-Token","schema":{"description":"The student key","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLinkView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"A one-time Telegram link that brings the student's course into the business's bot","tags":["Course students"],"x-idempotency":"optional"}},"/v1/public/courses/pages/{slug}/preview":{"get":{"description":"Anonymous. Only lessons the author marked as free previews; nothing else of the course.","operationId":"course-page-preview","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePreviewView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"The free preview lessons of a published course page","tags":["Course students"]}},"/v1/public/files/{id}":{"get":{"description":"302 to a presigned GET that lives 15 minutes; the redirect itself may be cached for 5 minutes. Unknown, pending and suspended merchants' files are 404.","operationId":"public-file","parameters":[{"description":"Upload id (upl_...)","in":"path","name":"id","required":true,"schema":{"description":"Upload id (upl_...)","type":"string"}}],"responses":{"302":{"description":"Found","headers":{"Cache-Control":{"schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[],"summary":"A ready uploaded file: a redirect to storage","tags":["Uploads"]}},"/v1/public/leads":{"post":{"description":"Anonymous; the endpoint of the form on paybot.kz/zayavka. Send it as application/x-www-form-urlencoded (the page's plain HTML form: the answer is a 303 to /zayavka/spasibo, or to /zayavka?error=<field> for a refused field, so the form works without JavaScript) or as application/json with the same fields (202 {\"accepted\":true}; a refused field is a 422 problem naming it; 429 when over the budget). Budgets: 5 requests an hour per address, 200 a day for the site; the same phone number twice within 10 minutes is one request. A request is stored and passed on to PayBot's team by Telegram and to its CRM in the background.","operationId":"public-leads-create","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"comment":{"maxLength":1000,"type":"string"},"consent":{"description":"Must be true (the form's checkbox sends on): consent to processing of personal data, /legal/pdp-consent","type":"boolean"},"messenger":{"description":"Telegram username or WhatsApp number, optional","maxLength":100,"type":"string"},"name":{"description":"Visitor's name","maxLength":100,"minLength":1,"type":"string"},"need":{"description":"What the visitor needs","enum":["api","site","courses","channel","links","other"],"type":"string"},"page":{"maxLength":200,"type":"string"},"phone":{"description":"Kazakhstan mobile number in any common form: +7 700 123 45 67, 8 (700) 123-45-67, 700 123 45 67. Required unless reply_via is telegram","maxLength":25,"type":"string"},"reply_via":{"description":"Where to answer. With telegram the phone may be left out: messenger must then be a Telegram username","enum":["telegram","whatsapp","call"],"type":"string"},"source":{"maxLength":120,"type":"string"},"utm_campaign":{"maxLength":120,"type":"string"},"utm_content":{"maxLength":120,"type":"string"},"utm_medium":{"maxLength":120,"type":"string"},"utm_source":{"maxLength":120,"type":"string"},"utm_term":{"maxLength":120,"type":"string"},"volume":{"description":"Payments a month","enum":["lt50","50_400","400_2000","gt2000","unknown"],"type":"string"},"website":{"description":"Honeypot: a hidden field of the form that people never fill. When it is not empty the request is answered as accepted and dropped","type":"string"}},"required":["name","need","volume","consent"],"type":"object"}},"application/x-www-form-urlencoded":{"schema":{"additionalProperties":false,"properties":{"comment":{"maxLength":1000,"type":"string"},"consent":{"description":"Must be true (the form's checkbox sends on): consent to processing of personal data, /legal/pdp-consent","type":"boolean"},"messenger":{"description":"Telegram username or WhatsApp number, optional","maxLength":100,"type":"string"},"name":{"description":"Visitor's name","maxLength":100,"minLength":1,"type":"string"},"need":{"description":"What the visitor needs","enum":["api","site","courses","channel","links","other"],"type":"string"},"page":{"maxLength":200,"type":"string"},"phone":{"description":"Kazakhstan mobile number in any common form: +7 700 123 45 67, 8 (700) 123-45-67, 700 123 45 67. Required unless reply_via is telegram","maxLength":25,"type":"string"},"reply_via":{"description":"Where to answer. With telegram the phone may be left out: messenger must then be a Telegram username","enum":["telegram","whatsapp","call"],"type":"string"},"source":{"maxLength":120,"type":"string"},"utm_campaign":{"maxLength":120,"type":"string"},"utm_content":{"maxLength":120,"type":"string"},"utm_medium":{"maxLength":120,"type":"string"},"utm_source":{"maxLength":120,"type":"string"},"utm_term":{"maxLength":120,"type":"string"},"volume":{"description":"Payments a month","enum":["lt50","50_400","400_2000","gt2000","unknown"],"type":"string"},"website":{"description":"Honeypot: a hidden field of the form that people never fill. When it is not empty the request is answered as accepted and dropped","type":"string"}},"required":["name","need","volume","consent"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedBody"}}},"description":"Accepted","headers":{"Cache-Control":{"schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}}},"303":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedBody"}}},"description":"A form post: redirect to the thank-you page, or back to the form with ?error=<code>","headers":{"Cache-Control":{"schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}}},"413":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Leave a request on the PayBot site","tags":["Site"],"x-idempotency":"refused"}},"/v1/public/live/{slug}/events":{"get":{"description":"Anonymous. Server-sent events (`text/event-stream`): one `live.state` event with the page's live state (the lot on air, its price, sold and remaining counts, the total sold) at once and after every change; `id` is the state version, so a reconnect with `Last-Event-ID` resumes without a duplicate. Comment lines (`:`) are heartbeats. The stream ends after at most 15 minutes (reconnect) or when the page is archived. Nothing personal is sent. Rate limited per IP; concurrent streams are capped per page and per IP (429).","operationId":"public-live-events","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"A preview token: the page's test-mode view","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token: the page's test-mode view","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}},{"description":"The id of the last event received","in":"header","name":"Last-Event-ID","schema":{"description":"The id of the last event received","type":"string"}}],"responses":{"200":{"content":{"text/event-stream":{"schema":{"type":"string"}}},"description":"An event stream; see the description for the format"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Stream a live page's state (server-sent events)","tags":["Public pages"]}},"/v1/public/live/{slug}/overlay":{"get":{"description":"Anonymous. The lot on air (null between lots) with its price, sold and remaining counts, and the total sold. Never cached; poll it (rate limited per IP) or use the event stream.","operationId":"public-live-overlay","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"A preview token","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StateView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"A live page's state as compact JSON, for an OBS overlay","tags":["Public pages"]}},"/v1/public/orders/{token}":{"get":{"description":"Anonymous. The token from the order call opens the order: lines, delivery, status timeline and the seller's contacts. An unknown or malformed token is 404.","operationId":"public-order-get","parameters":[{"description":"order_token of the order call","in":"path","name":"token","required":true,"schema":{"description":"order_token of the order call","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPageView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}},"X-Robots-Tag":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"A buyer's order page","tags":["Public pages"]}},"/v1/public/payments/receipts/{token}":{"get":{"description":"Anonymous. Seller, what was paid for, amount, date and the PayBot payment code. Not a fiscal receipt (Kaspi sends those). The token is unguessable and exists only for a paid payment; anything else is 404.","operationId":"public-payment-receipt","parameters":[{"in":"path","name":"token","required":true,"schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"The buyer's payment confirmation","tags":["Public pages"]}},"/v1/public/{slug}":{"get":{"description":"Anonymous. Answers 304 to a matching If-None-Match. With a preview token (?preview= or X-Preview-Token) an unpublished page is rendered in test mode, and the answer is never cached. An unknown or unpublished page is 404.","operationId":"public-page-get","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"A preview token","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}},{"in":"header","name":"If-None-Match","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"description":"The page, a JSON object defined by its template","headers":{"Cache-Control":{"schema":{"type":"string"}},"ETag":{"schema":{"type":"string"}},"Vary":{"schema":{"type":"string"}}}},"304":{"description":"Not modified"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"A published page, as JSON","tags":["Public pages"]}},"/v1/public/{slug}/checkout":{"post":{"description":"Anonymous. The page sets the price, the description and the reference; the client never sets a price. With a preview token the payment is a sandbox (test) payment.","operationId":"public-page-checkout","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"A preview token","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}},{"description":"Part of the visitor fingerprint that makes a reload return the open payment instead of a second QR","in":"header","name":"User-Agent","schema":{"description":"Part of the visitor fingerprint that makes a reload return the open payment instead of a second QR","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Start a payment for one item of a page","tags":["Public pages"],"x-idempotency":"optional"}},"/v1/public/{slug}/leads":{"post":{"description":"Anonymous, from the business's site (<LeadForm>). The lead lands in the merchant's Clients and fires the lead.created rule trigger. Limited per IP and per slug; a filled honeypot field (website) is answered like a success but stores nothing. 422 consent_required without consent, 422 when neither phone nor telegram is given.","operationId":"public-store-lead","parameters":[{"description":"The business's store page (its subdomain)","in":"path","name":"slug","required":true,"schema":{"description":"The business's store page (its subdomain)","type":"string"}},{"description":"A preview token: the lead is then test data","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token: the lead is then test data","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Leave a lead (a contact request) with a business","tags":["Public pages"],"x-idempotency":"optional"}},"/v1/public/{slug}/notify-payable":{"post":{"description":"Anonymous. The buyer's page shows this after merchant_payments_paused. It becomes a lead (source payments_paused) in the seller's Clients and fires lead.created. Limited per address.","operationId":"public-notify-payable","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Public-notify-payableResponse"}}},"description":"Created"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Ask the seller to tell me when I can pay","tags":["Public pages"],"x-idempotency":"optional"}},"/v1/public/{slug}/offers":{"get":{"description":"Anonymous, readable cross-origin by the business's site (like GET /public/{slug}). With a preview token, unpublished pages and drafts are included. Prices come formatted (price_text); a site never computes money.","operationId":"public-store-offers","parameters":[{"description":"The business's store page (its subdomain)","in":"path","name":"slug","required":true,"schema":{"description":"The business's store page (its subdomain)","type":"string"}},{"description":"A preview token: unpublished pages and drafts are then included (test mode)","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token: unpublished pages and drafts are then included (test mode)","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffersView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"What a business sells: store products, published courses and channel plans","tags":["Public pages"]}},"/v1/public/{slug}/orders":{"post":{"description":"Anonymous. The store prices every line from its catalogue and quotes the delivery; the client never sends a price. With a preview token the order and its payment are test mode and no stock is held.","operationId":"public-store-order","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"A preview token","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreOrderView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Place a store order (a cart) and start its payment","tags":["Public pages"],"x-idempotency":"optional"}},"/v1/public/{slug}/payments/{payment_id}":{"get":{"description":"Anonymous. Only a payment created by this page is found; any other is 404.","operationId":"public-page-payment-status","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"pay_...","in":"path","name":"payment_id","required":true,"schema":{"description":"pay_...","type":"string"}},{"description":"A preview token","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentStatusView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"The status of a payment started on a page","tags":["Public pages"]}},"/v1/public/{slug}/promo-preview":{"post":{"description":"Anonymous. Reserves nothing and starts no payment. An unknown, used-up or inapplicable code is 422 on promo_code.","operationId":"public-page-promo-preview","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"A preview token","explode":false,"in":"query","name":"preview","schema":{"description":"A preview token","type":"string"}},{"description":"A preview token, instead of ?preview=","in":"header","name":"X-Preview-Token","schema":{"description":"A preview token, instead of ?preview=","type":"string"}},{"in":"header","name":"User-Agent","schema":{"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoPreviewBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoPreviewView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"What a promo code would take off, before paying","tags":["Public pages"],"x-idempotency":"required"}},"/v1/public/{slug}/seen":{"post":{"description":"Anonymous, no cookie, no body beyond the handle. Counted only for a published page and never for a preview or a robot; always 204. See ADR 0115.","operationId":"public-page-seen","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"in":"header","name":"User-Agent","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeenBody"}}},"required":true},"responses":{"204":{"description":"No Content"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"Count the opening of a product on a page","tags":["Public pages"],"x-idempotency":"optional"}},"/v1/public/{slug}/terms":{"get":{"operationId":"public-terms-get","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Terms"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[],"summary":"The seller's details and offer for buyers","tags":["legal-profile"]}},"/v1/rules":{"get":{"operationId":"rule-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleListOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List rules","tags":["Rules"],"x-required-scope":"read"},"post":{"operationId":"rule-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Create a rule","tags":["Rules"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/rules/catalog":{"get":{"operationId":"rule-catalog","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Describe the triggers, condition fields, operators and actions a rule can use","tags":["Rules"],"x-required-scope":"read"}},"/v1/rules/{id}":{"delete":{"operationId":"rule-delete","parameters":[{"description":"Rule id (rul_...)","in":"path","name":"id","required":true,"schema":{"description":"Rule id (rul_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Delete a rule, its runs and its queued actions","tags":["Rules"],"x-idempotency":"optional","x-required-scope":"write"},"get":{"operationId":"rule-get","parameters":[{"description":"Rule id (rul_...)","in":"path","name":"id","required":true,"schema":{"description":"Rule id (rul_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a rule","tags":["Rules"],"x-required-scope":"read"},"patch":{"operationId":"rule-update","parameters":[{"description":"Rule id (rul_...)","in":"path","name":"id","required":true,"schema":{"description":"Rule id (rul_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change a rule's name, trigger, conditions, actions or stop_on_failure","tags":["Rules"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/rules/{id}/disable":{"post":{"operationId":"rule-disable","parameters":[{"description":"Rule id (rul_...)","in":"path","name":"id","required":true,"schema":{"description":"Rule id (rul_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Switch a rule off (actions already queued still run)","tags":["Rules"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/rules/{id}/enable":{"post":{"operationId":"rule-enable","parameters":[{"description":"Rule id (rul_...)","in":"path","name":"id","required":true,"schema":{"description":"Rule id (rul_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Switch a rule on","tags":["Rules"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/rules/{id}/runs":{"get":{"operationId":"rule-runs","parameters":[{"description":"Rule id (rul_...)","in":"path","name":"id","required":true,"schema":{"description":"Rule id (rul_...)","type":"string"}},{"description":"next_cursor from the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor from the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageRunView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List a rule's runs and the state of their actions, newest first","tags":["Rules"],"x-required-scope":"read"}},"/v1/site/upload":{"post":{"description":"Stores the archive as a new version of the business's own site; nothing goes live unless publish=true. Static files only (html, css, js, images, fonts; no server code), at most 20 MiB and 2000 files; index.html at the top or inside one folder. 422 bad_upload says what is refused.","operationId":"site-upload","parameters":[{"description":"application/zip, application/x-tar or application/gzip (a .tar.gz); the archive's first bytes decide, not this header.","in":"header","name":"Content-Type","schema":{"description":"application/zip, application/x-tar or application/gzip (a .tar.gz); the archive's first bytes decide, not this header.","type":"string"}},{"description":"A short label for the version.","explode":false,"in":"query","name":"note","schema":{"description":"A short label for the version.","maxLength":200,"type":"string"}},{"description":"Also put the version live at once. Needs the publish scope when called with an API key.","explode":false,"in":"query","name":"publish","schema":{"description":"Also put the version live at once. Needs the publish scope when called with an API key.","type":"boolean"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/octet-stream":{"schema":{"contentMediaType":"application/octet-stream","format":"binary","type":"string"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUploadView"}}},"description":"Created"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Upload a static site (zip, tar or tar.gz) as the raw request body","tags":["Own site"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/site/versions":{"get":{"operationId":"site-versions","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVersionsOutputBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List the uploaded versions of the site","tags":["Own site"],"x-required-scope":"read"}},"/v1/site/versions/{id}/publish":{"post":{"description":"The site at <subdomain>.paybot.kz shows this version at once; the previous one is kept.","operationId":"site-version-publish","parameters":[{"description":"The version id from POST /v1/site/upload or GET /v1/site/versions.","in":"path","name":"id","required":true,"schema":{"description":"The version id from POST /v1/site/upload or GET /v1/site/versions.","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteLiveOutputBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Put an uploaded version live (also a rollback to an earlier one)","tags":["Own site"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/slugs/check":{"get":{"description":"The slug is 3 to 48 characters of a-z, 0-9 and '-', starting and ending with a letter or digit. A refusal (taken, reserved, invalid) comes with up to three free alternatives. The answer for a taken address does not say whose it is. 60 checks per minute per caller, and as many per merchant whatever the number of its keys. Free now does not mean free later: publishing can still answer 409.","operationId":"slug-check","parameters":[{"description":"The address to check","explode":false,"in":"query","name":"slug","schema":{"description":"The address to check","maxLength":100,"minLength":1,"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlugCheckOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Is an address free for a public page?","tags":["Templates"],"x-required-scope":"read"}},"/v1/stats/objects":{"get":{"description":"The store, the courses, the channels and the bots, each with its visits and its last funnel step for the period. Visits are anonymous and cookieless; see ADR 0115.","operationId":"stats-objects","parameters":[{"explode":false,"in":"query","name":"period","schema":{"default":"7d","enum":["today","7d","30d"],"type":"string"}},{"description":"IANA time zone the days are cut in (default UTC)","explode":false,"in":"query","name":"tz","schema":{"description":"IANA time zone the days are cut in (default UTC)","maxLength":64,"type":"string"}},{"description":"Cabinet only (default live); an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only (default live); an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectsView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The business's objects with their numbers for a period","tags":["Statistics"],"x-required-scope":"read"}},"/v1/stats/objects/{kind}/{id}":{"get":{"description":"A funnel (visits, then what the business's own records say: orders, payments, enrolments, bot starts), a daily line, where visitors came from and, for a course, the progress of its students. Errors: 404 for an object of another business.","operationId":"stats-object","parameters":[{"in":"path","name":"kind","required":true,"schema":{"enum":["store","course","channel","bot"],"type":"string"}},{"description":"The object's id: a store or channel-page uuid, crs_..., bot_...","in":"path","name":"id","required":true,"schema":{"description":"The object's id: a store or channel-page uuid, crs_..., bot_...","maxLength":64,"type":"string"}},{"explode":false,"in":"query","name":"period","schema":{"default":"7d","enum":["today","7d","30d"],"type":"string"}},{"explode":false,"in":"query","name":"tz","schema":{"maxLength":64,"type":"string"}},{"explode":false,"in":"query","name":"mode","schema":{"enum":["live","test"],"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectStats"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"The statistics of one store, course, channel or bot","tags":["Statistics"],"x-required-scope":"read"}},"/v1/stats/overview":{"get":{"description":"From the money ledger, in the business's time zone, net of refunds. With compare=1 the previous period of the same length is returned too. The range is at most 366 days.","operationId":"stats-overview","parameters":[{"description":"First day, YYYY-MM-DD in the business's time zone; default 6 days before to","explode":false,"in":"query","name":"from","schema":{"description":"First day, YYYY-MM-DD in the business's time zone; default 6 days before to","type":"string"}},{"description":"Last day, inclusive; default today in the business's time zone","explode":false,"in":"query","name":"to","schema":{"description":"Last day, inclusive; default today in the business's time zone","type":"string"}},{"description":"Also return the previous period of the same length","explode":false,"in":"query","name":"compare","schema":{"description":"Also return the previous period of the same length","type":"boolean"}},{"description":"Cabinet only (default live); an API key always sees its own mode","explode":false,"in":"query","name":"mode","schema":{"description":"Cabinet only (default live); an API key always sees its own mode","enum":["live","test"],"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverviewView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Revenue, payments, average check, new and repeat customers over a period","tags":["Dashboard"],"x-required-scope":"read"}},"/v1/stats/sources":{"get":{"description":"Visits, leads, bot starts, payments and net revenue per utm source or campaign (last touch of the purchase), in the business's time zone.","operationId":"stats-sources","parameters":[{"description":"First day, YYYY-MM-DD in the business's time zone; default 29 days before to","explode":false,"in":"query","name":"from","schema":{"description":"First day, YYYY-MM-DD in the business's time zone; default 29 days before to","type":"string"}},{"description":"Last day, inclusive; default today","explode":false,"in":"query","name":"to","schema":{"description":"Last day, inclusive; default today","type":"string"}},{"explode":false,"in":"query","name":"group_by","schema":{"default":"campaign","enum":["source","campaign"],"type":"string"}},{"explode":false,"in":"query","name":"compare","schema":{"type":"boolean"}},{"explode":false,"in":"query","name":"mode","schema":{"enum":["live","test"],"type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourcesView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Where visitors, leads and money come from: by source and campaign","tags":["Dashboard"],"x-required-scope":"read"}},"/v1/subscriptions":{"get":{"operationId":"subscription-list","parameters":[{"explode":false,"in":"query","name":"status","schema":{"enum":["pending","trial","active","grace","cancelled","ended"],"type":"string"}},{"description":"Only this plan's (pln_...)","explode":false,"in":"query","name":"plan_id","schema":{"description":"Only this plan's (pln_...)","type":"string"}},{"description":"Only this subscriber's","explode":false,"in":"query","name":"subscriber_id","schema":{"description":"Only this subscriber's","maxLength":100,"type":"string"}},{"description":"next_cursor of the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor of the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageSubscriptionView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List subscriptions, newest first","tags":["Subscriptions"],"x-required-scope":"read"},"post":{"description":"Idempotent: the same plan and subscriber always name the same subscription, and while the payment for its next period can still be paid the same payment is returned. A new subscriber on a plan with trial days starts the trial and gets no payment. The payment is a Kaspi QR, or an invoice when payer_phone is given. Responds 201 when the subscription was created by this call, 200 otherwise.","operationId":"subscription-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription-createRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseView"}}},"description":"Created","headers":{"Location":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Start or renew a subscription: returns the subscription and the payment for its next period","tags":["Subscriptions"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/subscriptions/{id}":{"get":{"operationId":"subscription-get","parameters":[{"description":"Subscription id (sub_...)","in":"path","name":"id","required":true,"schema":{"description":"Subscription id (sub_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a subscription","tags":["Subscriptions"],"x-required-scope":"read"}},"/v1/subscriptions/{id}/cancel":{"post":{"description":"A trial or active subscription keeps access until the end of the current period and then ends with no grace; a pending one, or one in grace, ends now. Nothing is refunded here: a refund is only ever made through an approval (POST /v1/payments/{id}/refund).","operationId":"subscription-cancel","parameters":[{"description":"Subscription id (sub_...)","in":"path","name":"id","required":true,"schema":{"description":"Subscription id (sub_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Cancel a subscription at the end of its period (no refund)","tags":["Subscriptions"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/telegram/bots":{"get":{"operationId":"telegram-bot-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotListOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List Telegram bots","tags":["Telegram"],"x-required-scope":"read"},"post":{"description":"Checks the token with Telegram, stores it encrypted and registers the webhook. Cabinet only. Do not send Idempotency-Key.","operationId":"telegram-bot-connect","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectBotRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotView"}}},"description":"Created"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Connect a Telegram bot","tags":["Telegram"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/telegram/bots/{id}":{"delete":{"description":"Erases the token, deletes the webhook and drops the bot's queued messages. Its channels are kept for a later reconnect. Cabinet only.","operationId":"telegram-bot-disconnect","parameters":[{"description":"Bot id (bot_...)","in":"path","name":"id","required":true,"schema":{"description":"Bot id (bot_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Disconnect a Telegram bot","tags":["Telegram"],"x-idempotency":"optional","x-required-scope":"write"},"get":{"operationId":"telegram-bot-get","parameters":[{"description":"Bot id (bot_...)","in":"path","name":"id","required":true,"schema":{"description":"Bot id (bot_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a Telegram bot","tags":["Telegram"],"x-required-scope":"read"}},"/v1/telegram/bots/{id}/channel-session":{"post":{"description":"Call it when the person presses «Добавить бота в канал». For 15 minutes a channel the bot is added to as an administrator is recorded as pending_confirmation (listed with the bot's channels) until the merchant confirms or rejects it. Outside a session such an addition is ignored, so strangers cannot fill the list. Cabinet only.","operationId":"telegram-bot-channel-session","parameters":[{"description":"Bot id (bot_...)","in":"path","name":"id","required":true,"schema":{"description":"Bot id (bot_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Telegram-bot-channel-sessionResponse"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Start a short connect session for adding the bot to a channel","tags":["Telegram"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/telegram/bots/{id}/channels":{"get":{"operationId":"telegram-channel-list","parameters":[{"description":"Bot id (bot_...)","in":"path","name":"id","required":true,"schema":{"description":"Bot id (bot_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelListOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List a bot's channels","tags":["Telegram"],"x-required-scope":"read"},"post":{"description":"The bot must already be an administrator of the channel or supergroup with can_invite_users and can_restrict_members; a 422 names what is missing. Cabinet only.","operationId":"telegram-channel-add","parameters":[{"description":"Bot id (bot_...)","in":"path","name":"id","required":true,"schema":{"description":"Bot id (bot_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddChannelRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelView"}}},"description":"Created"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Add a channel the bot grants access to","tags":["Telegram"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/telegram/channels/{id}":{"delete":{"operationId":"telegram-channel-remove","parameters":[{"description":"Channel id (chn_...)","in":"path","name":"id","required":true,"schema":{"description":"Channel id (chn_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Remove a channel","tags":["Telegram"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/telegram/channels/{id}/check":{"post":{"description":"Asks Telegram and records the result: status active, or missing_rights with the list of what is missing. Cabinet only.","operationId":"telegram-channel-check","parameters":[{"description":"Channel id (chn_...)","in":"path","name":"id","required":true,"schema":{"description":"Channel id (chn_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Check the bot's rights in a channel again","tags":["Telegram"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/telegram/channels/{id}/confirm":{"post":{"description":"Makes a pending_confirmation channel active (or missing_rights when the bot lacks a right). Idempotent. Cabinet only.","operationId":"telegram-channel-confirm","parameters":[{"description":"Channel id (chn_...)","in":"path","name":"id","required":true,"schema":{"description":"Channel id (chn_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Confirm a pending channel: the merchant recognises it and wants to use it","tags":["Telegram"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/telegram/channels/{id}/reject":{"post":{"description":"Only a pending_confirmation channel. The bot leaves the chat when Telegram allows it; the channel is discarded either way. Cabinet only.","operationId":"telegram-channel-reject","parameters":[{"description":"Channel id (chn_...)","in":"path","name":"id","required":true,"schema":{"description":"Channel id (chn_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Reject a pending channel: discard it and make the bot leave the chat","tags":["Telegram"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/templates":{"get":{"operationId":"template-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogueOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List the templates that can be deployed","tags":["Templates"],"x-required-scope":"read"}},"/v1/templates/access_channel/deploy":{"post":{"description":"One idempotent transaction: creates or updates the plan, links it to the channel, stores the messages and a configuration version. Deploying the same configuration again changes nothing. The public start links (live and test) are returned only when they are created; rotate them to get new ones. Idempotency-Key is refused: the answer can carry start links, which are never stored.","operationId":"template-access-channel-deploy","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Deploy the access_channel template: one plan, one closed channel, the messages around them","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}":{"get":{"operationId":"template-get","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DescriptorView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Describe a template: configuration schema, UI schema and deploy plan","tags":["Templates"],"x-required-scope":"read"}},"/v1/templates/{id}/deployments":{"post":{"description":"One transaction in the template. Cabinet session or live API key. The answer can carry a show-once secret, so it is never cached and Idempotency-Key is refused; a create that is retried may create a second deployment unless the template's own keys (a slug) collide.","operationId":"template-deployment-create","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDeployRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Deploy a template: create a deployment","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}/deployments/{subject}/archive":{"post":{"description":"Takes the page down, closes the template's own object where it has one (a payment link, a live page). The deployment can no longer be published or deployed. Journals template.archived. Archiving twice changes nothing. Cabinet session or live API key. Idempotency-Key is refused; the answer is never cached.","operationId":"template-deployment-archive","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The deployment's public id","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Archive a deployment for good","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}/deployments/{subject}/deploy":{"post":{"description":"Idempotent by content: the configuration already deployed changes nothing (changed=false, same version). Cabinet session or live API key. Idempotency-Key is refused; the answer is never cached.","operationId":"template-deployment-deploy","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The deployment's public id","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id","type":"string"}},{"description":"The configuration version this change was made against (same as expected_version)","in":"header","name":"If-Match","schema":{"description":"The configuration version this change was made against (same as expected_version)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDeployRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Deploy a new configuration of an existing deployment","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}/deployments/{subject}/preview/rotate":{"post":{"description":"The old token stops working at once; the new one is shown in this answer only. Use it when a preview link leaked: a preview checkout is paid by the sandbox. Cabinet session or live API key. Idempotency-Key is refused; the answer is never cached.","operationId":"template-deployment-preview-rotate","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The deployment's public id","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Replace a deployment's preview token","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}/deployments/{subject}/publish":{"post":{"description":"Makes the page public (the ETag changes) and journals template.published. A deployment without a page, or an archived one, is a 409. Publishing a published page changes nothing. Cabinet session or live API key. Idempotency-Key is refused; the answer is never cached.","operationId":"template-deployment-publish","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The deployment's public id","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Publish a draft or paused deployment","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}/deployments/{subject}/rollback":{"post":{"description":"Deploys that version's configuration again through the template, which creates a NEW version (history is append-only). Journalled as template.rolled_back. Cabinet session or live API key. Idempotency-Key is refused; the answer is never cached.","operationId":"template-deployment-rollback","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The deployment's public id","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Roll a deployment back to an earlier configuration version","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}/deployments/{subject}/unpublish":{"post":{"description":"The page opens only with its preview token until it is published again (the ETag changes). Journals template.unpublished. Unpublishing an unpublished page changes nothing. Cabinet session or live API key. Idempotency-Key is refused; the answer is never cached.","operationId":"template-deployment-unpublish","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The deployment's public id","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Take a deployment's page down (pause)","tags":["Templates"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/templates/{id}/deployments/{subject}/versions":{"get":{"operationId":"template-deployment-versions","parameters":[{"description":"Template id","in":"path","name":"id","required":true,"schema":{"description":"Template id","type":"string"}},{"description":"The deployment's public id","in":"path","name":"subject","required":true,"schema":{"description":"The deployment's public id","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionsOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List the configuration versions of a deployment, oldest first","tags":["Templates"],"x-required-scope":"read"}},"/v1/uploads":{"post":{"description":"Images (image/jpeg, image/png, image/webp; purpose template_image or product_image) up to 5 MB, documents (application/pdf; purpose document) up to 10 MB. PUT the file to put.url with put.headers before put.expires_at (10 minutes), then POST /uploads/{id}/confirm. The answer is a credential: never cached, and Idempotency-Key is refused. 503 when no storage is configured.","operationId":"upload-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload-createRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestedView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Request an upload: a presigned PUT for one image or document","tags":["Uploads"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/uploads/{id}":{"get":{"operationId":"upload-get","parameters":[{"description":"Upload id (upl_...)","in":"path","name":"id","required":true,"schema":{"description":"Upload id (upl_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get an upload","tags":["Uploads"],"x-required-scope":"read"}},"/v1/uploads/{id}/confirm":{"post":{"description":"Checks the stored file's type and size against the request and makes the upload ready; confirming a ready upload again answers it unchanged. 409 upload_missing: the file is not in storage yet. 410 upload_expired: the upload URL expired before the file arrived. 422 upload_mismatch: the stored file is not the one requested.","operationId":"upload-confirm","parameters":[{"description":"Upload id (upl_...)","in":"path","name":"id","required":true,"schema":{"description":"Upload id (upl_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"410":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Gone"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Confirm an upload once the file is in storage","tags":["Uploads"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/webhooks":{"get":{"operationId":"webhook-list","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointListOutBody"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List webhook endpoints","tags":["Webhooks"],"x-required-scope":"read"},"post":{"description":"The signing secret is in the response and is never shown again. Do not send Idempotency-Key.","operationId":"webhook-create","parameters":[{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEndpointRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretView"}}},"description":"Created","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Register a webhook endpoint","tags":["Webhooks"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/webhooks/deliveries/{id}/replay":{"post":{"description":"Re-queues the delivery for an immediate new attempt with a fresh retry schedule, whatever its state (including dead and succeeded).","operationId":"webhook-delivery-replay","parameters":[{"description":"Delivery id (dlv_...)","in":"path","name":"id","required":true,"schema":{"description":"Delivery id (dlv_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Send a delivery again","tags":["Webhooks"],"x-idempotency":"required","x-required-scope":"write"}},"/v1/webhooks/{id}":{"delete":{"operationId":"webhook-delete","parameters":[{"description":"Endpoint id (whk_...)","in":"path","name":"id","required":true,"schema":{"description":"Endpoint id (whk_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Delete a webhook endpoint and its delivery log","tags":["Webhooks"],"x-idempotency":"optional","x-required-scope":"write"},"get":{"operationId":"webhook-get","parameters":[{"description":"Endpoint id (whk_...)","in":"path","name":"id","required":true,"schema":{"description":"Endpoint id (whk_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Get a webhook endpoint","tags":["Webhooks"],"x-required-scope":"read"},"patch":{"operationId":"webhook-update","parameters":[{"description":"Endpoint id (whk_...)","in":"path","name":"id","required":true,"schema":{"description":"Endpoint id (whk_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEndpointRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointView"}}},"description":"OK"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Change a webhook endpoint's URL, event filter, description or active flag","tags":["Webhooks"],"x-idempotency":"optional","x-required-scope":"write"}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"webhook-deliveries","parameters":[{"description":"Endpoint id (whk_...)","in":"path","name":"id","required":true,"schema":{"description":"Endpoint id (whk_...)","type":"string"}},{"description":"next_cursor from the previous page","explode":false,"in":"query","name":"cursor","schema":{"description":"next_cursor from the previous page","type":"string"}},{"description":"Page size, default 25","explode":false,"in":"query","name":"limit","schema":{"description":"Page size, default 25","format":"int64","maximum":100,"minimum":0,"type":"integer"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDeliveryView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also invalid_cursor)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"List an endpoint's deliveries, newest first","tags":["Webhooks"],"x-required-scope":"read"}},"/v1/webhooks/{id}/rotate-secret":{"post":{"description":"The new secret is in the response and is never shown again; the old one stops being used at once. Do not send Idempotency-Key.","operationId":"webhook-rotate-secret","parameters":[{"description":"Endpoint id (whk_...)","in":"path","name":"id","required":true,"schema":{"description":"Endpoint id (whk_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretView"}}},"description":"OK","headers":{"Cache-Control":{"schema":{"type":"string"}}}},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Replace the signing secret","tags":["Webhooks"],"x-idempotency":"refused","x-required-scope":"write"}},"/v1/webhooks/{id}/test":{"post":{"description":"Delivers a signed webhook.test event (mode test) to this endpoint once and returns the result. Works on a disabled endpoint.","operationId":"webhook-test","parameters":[{"description":"Endpoint id (whk_...)","in":"path","name":"id","required":true,"schema":{"description":"Endpoint id (whk_...)","type":"string"}},{"description":"The merchant (mch_...) a cabinet session acts for; required with a session (400 merchant_required without it). An API key acts for its own merchant and does not need it.","in":"header","name":"X-Merchant-Id","schema":{"maxLength":64,"type":"string"}},{"description":"Required. A unique value per logical request; a retry with the same key replays the first answer.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryView"}}},"description":"OK"},"400":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request (also idempotency_key_required)"},"401":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"409":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Conflict (also idempotency_conflict: a request with this key is still in flight; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"422":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unprocessable Entity (also idempotency_key_reused)"},"429":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests (rate_limited; retry after Retry-After)","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"}},"security":[{"csrfToken":[],"sessionCookie":[]},{"sessionBearer":[]},{"apiKey":[]},{"apiKeyHeader":[]}],"summary":"Send a test event now","tags":["Webhooks"],"x-idempotency":"required","x-required-scope":"write"}}},"servers":[{"description":"Version 1","url":"/v1"}]}