Avito Stock Management API

The Stock Management API from Avito — 2 operation(s) for stock management.

Documentation

📖
Documentation
https://developers.avito.ru/api-catalog/accounts-hierarchy/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/ads/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/auction/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/auth/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/autoload/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/autostrategy/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/autoteka/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/avito-promo/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/calltracking/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/cpa/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/cpxpromo/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/delivery-sandbox/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/item/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/job/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/messenger/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/order-management/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/promotion/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/ratings/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/realty-reports/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/sbc-gateway/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/stock-management/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/str/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/tariff/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/trxpromo/documentation
📖
Documentation
https://developers.avito.ru/api-catalog/user/documentation

Specifications

OpenAPI Specification

avito-stock-management-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  contact:
    email: supportautoload@avito.ru
  description: 'API для взаимодействия с иерархией аккаунтов в Авито

    **Авито API для бизнеса предоставляется согласно [Условиям использования](https://www.avito.ru/legal/pro_tools/public-api).**

    '
  title: Иерархия Аккаунтов Access Stock Management API
  version: '1'
servers:
- url: https://api.avito.ru/
tags:
- name: Stock Management
paths:
  /stock-management/1/info:
    x-gateway:
      exportTo:
      - gateway: open-api-gateway
    post:
      description: 'Максимальное количество элементов в одном запросе - 10


        Максимальное количество запросов в минуту - 100


        Возвращает в ответ массив объектов со следующей структурой:

        - `itemId` - идентификатор объявления

        - `isUnlimited` - признак неограниченности остатков

        - `isMultiple` - флаг с подачи или редактирования "Несколько штук в наличии"

        - `quantity` - доступное количество товара (количество с подачи или редактирования минус бронь)

        - `isOutOfStock` - признак того, что у объявления закончилось доступное кол-во товара

        '
      parameters:
      - $ref: '#/components/parameters/authHeader'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                item_ids:
                  items:
                    description: Массив идентификаторов объявлений
                    type: integer
                  maxItems: 500
                  minItems: 1
                  type: array
                strong_consistency:
                  description: Пропустить поход в кеш, отдать данные из базы
                  type: boolean
              required:
              - item_ids
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stocksInfoResult'
          description: Success
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalError'
      security:
      - ClientCredentials: []
      summary: Получение остатков
      x-rate-limiter:
        default: 100
      tags:
      - Stock Management
  /stock-management/1/stocks:
    put:
      description: 'Максимальное количество элементов в одном запросе - 200


        Максимальное количество запросов в минуту - 100


        Возвращает в ответ массив объектов со следующей структурой:

        - `errors` – массив, который содержит информацию о ошибках, возникших при обновлении остатков.

        - `item_id` – идентификатор объявления, для которого мы обновляем остатки.

        - `external_id` – идентификатор объявления во внешней системе, для которого мы обновляем остатки.

        - `success` – флаг, успешно ли прошло обновление остатка для объявления.

        '
      parameters:
      - $ref: '#/components/parameters/authHeader'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                stocks:
                  items:
                    description: Остатки в объявлении
                    properties:
                      external_id:
                        description: Идентификатор объявления во внешней системе
                        example: AB123456
                        type: string
                      item_id:
                        description: Идентификатор объявления на сайте
                        example: 123321
                        format: int64
                        type: integer
                      quantity:
                        description: Количество товара
                        example: 500
                        format: int64
                        maximum: 999999
                        minimum: 0
                        type: integer
                    required:
                    - item_id
                    - quantity
                    type: object
                  maxItems: 200
                  minItems: 1
                  type: array
              required:
              - stocks
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stockEditResult'
          description: Success
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalError'
      security:
      - ClientCredentials: []
      summary: Редактирование остатков
      x-rate-limiter:
        default: 100
      tags:
      - Stock Management
components:
  responses:
    internalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorMessage'
      description: Internal Error
    badRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorMessage'
      description: Bad request
    tooManyRequests:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorMessage'
      description: Too Many Requests
    unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/unauthError'
      description: Unauthorized
  schemas:
    errorMessage:
      additionalProperties: false
      properties:
        message:
          description: Текст ошибки
          example: Что-то пошло не так
          type: string
      required:
      - message
      type: object
    stockEditResult:
      properties:
        stocks:
          items:
            description: Остатки в объявлении
            properties:
              errors:
                description: Ошибки при обновлении остатка
                example: []
                items:
                  type: string
                type: array
              external_id:
                description: Идентификатор объявления во внешней системе
                example: AB123456
                nullable: true
                type: string
              item_id:
                description: Идентификатор объявления на сайте
                example: 123321
                format: int64
                type: integer
              success:
                description: Успешно ли прошло обновление остатков
                example: true
                type: boolean
            required:
            - item_id
            - success
            type: object
          type: array
      type: object
    unauthError:
      additionalProperties: false
      properties:
        message:
          description: Сообщение о том, что пользователь не авторизован. Если текст ошибки "Unsupported flow for endpoint", значит в авторизационном заголовке "X-Oauth-Flow" не передан "authorization_code"
          example: Unsupported flow for endpoint
          type: string
      required:
      - message
      type: object
    stocksInfoResult:
      properties:
        stocks:
          items:
            description: Информация по остаткам
            properties:
              is_multiple:
                description: Флаг с подачи или редактирования "Несколько штук в наличии"
                example: true
                type: boolean
              is_out_of_stock:
                description: Признак того, что у объявления закончилось доступное кол-во товара
                example: false
                type: boolean
              is_unlimited:
                description: Признак неограниченности стоков
                example: true
                type: boolean
              item_id:
                description: Идентификатор объявления на сайте
                example: 123321
                format: int64
                type: integer
              quantity:
                description: Доступное количество товара (количество с подачи или редактирования минус бронь)
                example: 100
                format: int64
                type: integer
            required:
            - item_id
            - is_unlimited
            - is_multiple
            - quantity
            - is_out_of_stock
            type: object
          type: array
      type: object
  parameters:
    authHeader:
      description: Токен для авторизации
      in: header
      name: Authorization
      required: true
      schema:
        example: Bearer ACCESS_TOKEN
        type: string
  securitySchemes:
    AuthorizationCode:
      description: Это API использует OAuth 2 с механизмом authorization_code. Используйте его для доступа к данным других пользователей при разработке стороннего приложения. [Подробнее](/api-catalog/auth/documentation#tag/ApplicationAccess)
      flows:
        authorizationCode:
          authorizationUrl: https://avito.ru/oauth
          scopes:
            ah:access: Взаимодействие с иерархией аккаунтов
          tokenUrl: https://api.avito.ru/token
      type: oauth2
    ClientCredentials:
      description: Это API использует OAuth 2 с механизмом client_credentials. Используйте его для доступа к возможностям своей личной учетной записи. [Подробнее](#tag/Access)
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: https://api.avito.ru/token
      type: oauth2