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

# Update invoices



## OpenAPI

````yaml /openapi/billing.json put /v1/billing/invoices/{id}/
openapi: 3.0.3
info:
  title: Yume API — Биллинг
  version: 1.0.0
  description: Подписки, счета и тарификация.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/billing/invoices/{id}/:
    put:
      tags:
        - invoices
      summary: Update invoices
      operationId: invoices_update
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantInvoiceDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TenantInvoiceDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TenantInvoiceDetail'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantInvoiceDetail'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    TenantInvoiceDetail:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        tenant:
          type: integer
          readOnly: true
        card:
          type: integer
          readOnly: true
          nullable: true
          title: Карта
        currency:
          allOf:
            - $ref: '#/components/schemas/CurrencyEnum'
          readOnly: true
          title: Валюта
        status:
          allOf:
            - $ref: '#/components/schemas/Status14dEnum'
          readOnly: true
          title: Статус
        variant:
          allOf:
            - $ref: '#/components/schemas/VariantEnum'
          title: Платёжный провайдер
        total:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
          title: Итого
        captured_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
          title: Списано
        refund_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
          title: Возвращено
        captured_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Списано в
        start_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Начало периода
        end_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Конец периода
        items:
          type: array
          items:
            $ref: '#/components/schemas/TenantInvoiceItem'
        success_url:
          type: string
          writeOnly: true
        target_date:
          type: string
          format: date
          writeOnly: true
          nullable: true
        transaction_url:
          type: string
          format: uri
          readOnly: true
          nullable: true
          title: Ссылка на транзакцию
        kaspi_method:
          allOf:
            - $ref: '#/components/schemas/KaspiMethodEnum'
          writeOnly: true
          default: qr
        kaspi_phone:
          type: string
          writeOnly: true
          pattern: ^7\d{9}$
      required:
        - captured_amount
        - captured_at
        - card
        - currency
        - end_at
        - id
        - items
        - refund_amount
        - start_at
        - status
        - tenant
        - total
        - transaction_url
    CurrencyEnum:
      enum:
        - KZT
        - USD
        - RUB
        - EUR
        - UZS
        - KGS
        - AED
        - SAR
      type: string
      description: |-
        * `KZT` - KZT
        * `USD` - USD
        * `RUB` - RUB
        * `EUR` - EUR
        * `UZS` - UZS
        * `KGS` - KGS
        * `AED` - AED
        * `SAR` - SAR
    Status14dEnum:
      enum:
        - waiting
        - confirmed
        - rejected
        - refunded
      type: string
      description: |-
        * `waiting` - В ожидании
        * `confirmed` - Подтвержден
        * `rejected` - Отклонен
        * `refunded` - Возвращен
    VariantEnum:
      enum:
        - freedom
        - kaspi
      type: string
      description: |-
        * `freedom` - Freedom
        * `kaspi` - Kaspi Pay
    TenantInvoiceItem:
      type: object
      properties:
        id:
          type: integer
        type:
          $ref: '#/components/schemas/Type56aEnum'
        integration_period:
          type: integer
        count:
          type: integer
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
      required:
        - count
        - price
        - type
    KaspiMethodEnum:
      enum:
        - qr
        - invoice
      type: string
      description: |-
        * `qr` - qr
        * `invoice` - invoice
    Type56aEnum:
      enum:
        - staff
        - rental_point
        - inventory_car
        - inventory_scooter
        - inventory_motorcycle
        - module
        - integration
      type: string
      description: |-
        * `staff` - Пользовательские места
        * `rental_point` - Точки аренды
        * `inventory_car` - Автомобили
        * `inventory_scooter` - Самокаты
        * `inventory_motorcycle` - Мотоциклы
        * `module` - Модуль
        * `integration` - Интеграция
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````