> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tranzor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Отменить инвойс

> Отменяет PENDING инвойс. Нельзя отменить оплаченный или истёкший инвойс.



## OpenAPI

````yaml DELETE /api/v1/invoices/{invoiceId}
openapi: 3.1.0
info:
  title: Tranzor API
  description: >-
    API для приёма криптовалютных платежей и ресселинга eSIM. Создавайте
    инвойсы, продавайте eSIM, отслеживайте статусы.
  version: 1.0.0
  contact:
    name: Tranzor Support
    url: https://tranzor.io
servers:
  - url: https://sand.tranzor.io
    description: Sandbox
security:
  - BearerAuth: []
  - HmacAuth: []
externalDocs:
  description: Полная документация
  url: https://docs.tranzor.io/
paths:
  /api/v1/invoices/{invoiceId}:
    delete:
      tags:
        - Invoices
      summary: Отменить инвойс
      description: Отменяет PENDING инвойс. Нельзя отменить оплаченный или истёкший инвойс.
      operationId: cancelInvoice
      parameters:
        - name: invoiceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Инвойс отменён
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      invoiceId:
                        type: string
                      status:
                        type: string
                        example: CANCELLED
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    BadRequest:
      description: Невалидный запрос
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
    Unauthorized:
      description: Не авторизован
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Invalid API key
    NotFound:
      description: Не найдено
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Invoice not found
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API ключ в формате `trz_...`
    HmacAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |-
        HMAC аутентификация. Требуются заголовки:
        - `X-API-Key` — ваш API ключ
        - `X-Timestamp` — текущий unix timestamp (секунды, ±5 мин)
        - `X-Signature` — HMAC-SHA256 подпись

        Строка для подписи: `{timestamp}{METHOD}{path}{body}`
        Ключ подписи: `Secret Key` (выдаётся при создании API ключа)

````