> ## 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.

# Создать инвойс

> Создаёт новый платёжный инвойс. Возвращает адреса для оплаты и ссылку на страницу оплаты.



## OpenAPI

````yaml POST /api/v1/invoices
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:
    post:
      tags:
        - Invoices
      summary: Создать инвойс
      description: >-
        Создаёт новый платёжный инвойс. Возвращает адреса для оплаты и ссылку на
        страницу оплаты.
      operationId: createInvoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvoiceRequest'
            example:
              amount: 10.5
              currency: USD
              description: 'Заказ #1234'
              orderId: order-1234
              metadata: '{"userId": 42}'
      responses:
        '200':
          description: Инвойс создан
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInvoiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreateInvoiceRequest:
      type: object
      required:
        - amount
      properties:
        amount:
          type: number
          minimum: 0.01
          maximum: 1000000
          description: Сумма в USD
        currency:
          type: string
          enum:
            - USD
          default: USD
        description:
          type: string
          maxLength: 500
          description: Описание платежа
        orderId:
          type: string
          maxLength: 200
          description: Ваш ID заказа (уникальный)
        metadata:
          type: string
          maxLength: 2000
          description: Произвольные данные
    CreateInvoiceResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            invoiceId:
              type: string
            payUrl:
              type: string
              format: uri
              description: Ссылка на страницу оплаты
            status:
              type: string
              enum:
                - PENDING
            amount:
              type: number
              example: 10.5
            currency:
              type: string
              example: USD
            orderId:
              type: string
              nullable: true
            addresses:
              type: array
              items:
                $ref: '#/components/schemas/PaymentAddress'
            expiresAt:
              type: string
              format: date-time
            createdAt:
              type: string
              format: date-time
    PaymentAddress:
      type: object
      properties:
        chain:
          type: string
          example: ethereum
        address:
          type: string
          example: 0x...
        expectedAmount:
          type: string
          description: Ожидаемая сумма в минимальных единицах
        isToken:
          type: boolean
        tokenSymbol:
          type: string
          nullable: true
          example: USDT
  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
    InternalError:
      description: Внутренняя ошибка
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Internal server error
  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 ключа)

````