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

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

sendInvoice

Обновлено

POST /api/v1/sales/orders/{order_id}/invoice

sendInvoice

Авторизация и права

Scopes: ALL. Auth alternatives: OR; scopes внутри альтернативы: ALL.

ПолеЗначение
security.0.hubApiKey[]
security.1.hubBearer[]
securitySchemes.hubApiKey.in"header"
securitySchemes.hubApiKey.name"X-Api-Key"
securitySchemes.hubApiKey.type"apiKey"
securitySchemes.hubBearer.scheme"bearer"
securitySchemes.hubBearer.type"http"
x-required-scopes["orders:write"]

Параметры запроса

ПолеЗначение
0.in"path"
0.name"order_id"
0.requiredtrue
0.schema0.schema
1.description"Required durable money receipt key; replay is retained for 30 days."
1.in"header"
1.name"Idempotency-Key"
1.requiredtrue
1.schema1.schema

Тело запроса

ПолеЗначение
content.application/json.schemaSendSalesInvoiceRequest
requiredtrue

Ответы

ПолеЗначение
201.content.application/json.schemaSendSalesInvoiceResponse
201.description"Durable money result, including completed replay"

Ошибки

ПолеЗначение
400.content.application/problem+json.schemaProblemDetails
400.description"Invalid strict body or path (VALIDATION_ERROR/INVALID_REQUEST), missing/blank Idempotency-Key (IDEMPOTENCY_KEY_REQUIRED), or missing credential provenance (INVALID_REQUEST)"
401.content.application/problem+json.schemaProblemDetails
401.description"Missing or invalid API key; a surface-session JWT is not accepted"
403.content.application/problem+json.schemaProblemDetails
403.description"Missing orders:write scope (INSUFFICIENT_SCOPE) or a credential not admitted to this tenant (FORBIDDEN)"
404.content.application/problem+json.schemaProblemDetails
404.description"The tenant-local buyer, catalogue, registration or order was not found"
409.content.application/problem+json.schemaProblemDetails
409.description"The durable receipt is pending and its effect cannot be recovered (IDEMPOTENCY_KEY_IN_FLIGHT), a line cannot be held (STOCK_EXHAUSTED), or the order's invoice is already out and the body does not ask for a reissue (ALREADY_SENT)"
413.content.application/problem+json.schemaProblemDetails
413.description"The per-tool resource policy rejects the request size"
422.content.application/problem+json.schemaProblemDetails
422.description"Divergent receipt-key reuse (IDEMPOTENCY_KEY_MISMATCH), declared unit prices in two currencies (MIXED_CURRENCY), or invalid current money preconditions such as a buyer without a receipt contact for an invoice"
429.content.application/problem+json.schemaProblemDetails
429.description"The per-tool rate limit is exceeded or its subsystem is unavailable"
429.headers.Retry-After.description"Retry delay in seconds when supplied by the resource limiter"
429.headers.Retry-After.requiredfalse
429.headers.Retry-After.schema429.headers.Retry-After.schema
500.content.application/problem+json.schemaProblemDetails
500.description"Unexpected money failure"

Дополнительные условия

ПолеЗначение
description"Issue payment for a tenant-local unpaid order. An order with its own payment mode gets the provider links on its order card when the buyer has a receipt contact (delivery queued); without one the answer is delivery order_page — the Pay button on the order card opens the order page, which asks for the contact. Manual, invoice, deferred and online-prepay orders are issued; an order paid on site or owing nothing is refused with FAILED_PRECONDITION. A one-product chat order queues its invoice card. An order whose invoice is already out is refused with ALREADY_SENT unless the body is {\"reissue\": true}: then the invoice is reissued for the current sum, the buyer gets a new one and the earlier payment links stop working. queued acknowledges the durable effect; buyer delivery is outbox-owned. Idempotency-Key must contain a non-whitespace character. The durable 30-day receipt is keyed by client, operation and key; replay rechecks actor admission and returns the stored result with replayed=true."
operationId"sendInvoice"
tags["sales"]