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

# Get sales



## OpenAPI

````yaml /openapi/shop.json get /v1/shop/sales/
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/shop/sales/:
    get:
      tags:
        - sales
      summary: Get sales
      operationId: sales_list
      parameters:
        - in: query
          name: agent
          schema:
            type: integer
        - in: query
          name: client
          schema:
            type: integer
        - in: query
          name: counterparty
          schema:
            type: number
        - in: query
          name: created_at__date__gte
          schema:
            type: string
            format: date
        - in: query
          name: created_at__date__lte
          schema:
            type: string
            format: date
        - in: query
          name: created_by
          schema:
            type: integer
        - in: query
          name: created_by__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: pageSize
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: payments__type
          schema:
            type: integer
        - in: query
          name: payments__type__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - $ref: '#/components/parameters/TenantId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrderSaleListList'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    PaginatedOrderSaleListList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/OrderSaleList'
    OrderSaleList:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        client:
          $ref: '#/components/schemas/BaseClient'
        agent:
          $ref: '#/components/schemas/Referral'
        discount:
          type: integer
          nullable: true
          title: Скидка
        discount_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        price_discount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        paid_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        created_by:
          type: integer
          readOnly: true
          nullable: true
          title: Создал
        rental_point:
          type: integer
          readOnly: true
          nullable: true
          title: Точка проката
        status:
          allOf:
            - $ref: '#/components/schemas/Status518Enum'
          readOnly: true
          title: Статус
        groups:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        payments:
          type: array
          items:
            $ref: '#/components/schemas/BaseTransaction'
          readOnly: true
      required:
        - agent
        - client
        - created_at
        - created_by
        - groups
        - id
        - paid_amount
        - payments
        - price
        - price_discount
        - rental_point
        - status
    BaseClient:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          title: Название
          maxLength: 512
        type:
          allOf:
            - $ref: '#/components/schemas/BaseClientTypeEnum'
          title: Тип
          minimum: 0
          maximum: 2147483647
        avatar:
          type: string
          format: uri
          nullable: true
          title: Фото
        agreement_id:
          type: string
          readOnly: true
          nullable: true
        signed:
          type: boolean
        sign_date:
          type: string
          format: date
          nullable: true
        sign_expires:
          type: string
          format: date
          nullable: true
        phone:
          type: string
          title: Телефон
          maxLength: 32
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        legal_type:
          nullable: true
          title: Форма организации
          minimum: 0
          maximum: 2147483647
          oneOf:
            - $ref: '#/components/schemas/LegalTypeEnum'
            - $ref: '#/components/schemas/NullEnum'
        extra:
          title: Доп. данные
      required:
        - agreement_id
        - id
        - name
        - phone
    Referral:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        phone:
          type: string
          nullable: true
          maxLength: 32
        extra: {}
      required:
        - id
        - name
    Status518Enum:
      enum:
        - 0
        - 1
        - 2
      type: integer
      description: |-
        * `0` - черновик
        * `1` - Продано
        * `2` - Отменено
    BaseTransaction:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        method:
          allOf:
            - $ref: '#/components/schemas/MethodEnum'
          title: Способ
          minimum: -32768
          maximum: 32767
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          title: Сумма
        type:
          type: integer
          nullable: true
          title: Способ оплаты
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        created_by:
          type: integer
          nullable: true
          title: Создал
        account:
          type: integer
          nullable: true
          title: Счёт
        category:
          type: integer
          nullable: true
          title: Статья
        status:
          allOf:
            - $ref: '#/components/schemas/BaseTransactionStatusEnum'
          title: Статус
        extra:
          nullable: true
          title: Доп. данные
        comment:
          type: string
          nullable: true
          title: Комментарий
      required:
        - created_at
        - id
    BaseClientTypeEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Физ. лицо
        * `1` - Юр. лицо
    LegalTypeEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
      type: integer
      description: |-
        * `0` - ИП
        * `1` - ТОО
        * `2` - АО
        * `3` - ПК
    NullEnum:
      enum:
        - null
    MethodEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Приход
        * `1` - Расход
    BaseTransactionStatusEnum:
      enum:
        - pending
        - success
        - failure
        - expired
      type: string
      description: |-
        * `pending` - Ожидает оплаты
        * `success` - Успешно
        * `failure` - Ошибка
        * `expired` - Истёк срок
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````