{
  "openapi": "3.1.0",
  "info": {
    "title": "Smart Placement API",
    "description": "Для методов получения спонсорского контента (impressions) порядок элементов в ответе имеет значение, используйте выдачу в исходной последовательности."
  },
  "x-tagGroups": [
    {
      "name": "Получение спонсорского контента",
      "tags": [
        "smp product pages",
        "smp grouped products pages",
        "smp category pages",
        "smp search page",
        "smp other pages",
        "smp offline stores"
      ]
    },
    {
      "name": "Атрибуция и аналитика",
      "tags": ["smp events", "smp s2s reports"]
    },
    {
      "name": "Рекламодатели и доступ",
      "tags": ["Advertisers", "Access Management"]
    },
    {
      "name": "Финансы и документы",
      "tags": ["Transactions", "Invoices", "Balances"]
    }
  ],
  "servers": [
    {
      "url": "https://visitors-sp.retailrocket.ru/v1/",
      "description": "Контент и показы Smart Placement"
    },
    {
      "url": "https://apptracking.retailrocket.ru/2.0",
      "description": "События атрибуции"
    },
    {
      "url": "https://portals.smartplacement.io/s2s",
      "description": "S2S: порталы (отчёты, рекламодатели, доступ)"
    },
    {
      "url": "https://platforms.smartplacement.io/s2s",
      "description": "S2S: платформы (отчёты)"
    }
  ],
  "tags": [
    {
      "name": "smp product pages",
      "description": "Получение спонсорского контента для страниц товаров",
      "x-displayName": "Товары"
    },
    {
      "name": "smp grouped products pages",
      "description": "Контент для страниц с несколькими товарами",
      "x-displayName": "Группы разных товаров"
    },
    {
      "name": "smp search page",
      "description": "Спонсорский контент для страниц поиска",
      "x-displayName": "Поиск"
    },
    {
      "name": "smp category pages",
      "description": "Контент для страниц товарных категорий",
      "x-displayName": "Категории"
    },
    {
      "name": "smp offline stores",
      "description": "Спонсорский контент для показа в физических магазинах",
      "x-displayName": "Оффлайн-магазины"
    },
    {
      "name": "smp other pages",
      "description": "Контент для других типов страниц",
      "x-displayName": "Прочие страницы"
    },
    {
      "name": "smp events",
      "description": "Методы взаимодействия со спонсорским контентом",
      "x-displayName": "Взаимодействие со спонсорским контентом"
    },
    {
      "name": "smp s2s reports",
      "description": "Дневные server-to-server отчёты Smart Placement. Все запросы требуют авторизации с помощью **Bearer Token (PAT)**. Для получения токена обратитесь в техническую поддержку **Retail Rocket Group** (support@retailrocket.ru).",
      "x-displayName": "Отчеты server-to-server"
    },
    {
      "name": "Advertisers",
      "x-displayName": "Рекламодатели",
      "description": "Управление рекламодателями. \n\nВсе запросы к API требуют авторизации с помощью **Bearer Token (PAT)**. \n\nДля получения токена обратитесь в техническую поддержку **Retail Rocket Group** (support@retailrocket.ru)"
    },
    {
      "name": "Access Management",
      "x-displayName": "Управление доступом",
      "description": "Управление доступами и приглашениями. \n\nВсе запросы к API требуют авторизации с помощью **Bearer Token (PAT)**. \n\nДля получения токена обратитесь в техническую поддержку **Retail Rocket Group** (support@retailrocket.ru)"
    },
    {
      "name": "ORD",
      "x-displayName": "ОРД",
      "description": "Взаимодействие с Оператором Рекламных Данных. \n\nВсе запросы к API требуют авторизации с помощью **Bearer Token (PAT)**. \n\nДля получения токена обратитесь в техническую поддержку **Retail Rocket Group** (support@retailrocket.ru)"
    },
    {
      "name": "Transactions",
      "x-displayName": "Транзакции",
      "description": "Управление финансовыми транзакциями. \n\nВсе запросы к API требуют авторизации с помощью **Bearer Token (PAT)**. \n\nДля получения токена обратитесь в техническую поддержку **Retail Rocket Group** (support@retailrocket.ru)"
    },
    {
      "name": "Invoices",
      "x-displayName": "Акты",
      "description": "Получение актов выполненных работ. \n\nВсе запросы к API требуют авторизации с помощью **Bearer Token (PAT)**. \n\nДля получения токена обратитесь в техническую поддержку **Retail Rocket Group** (support@retailrocket.ru)"
    },
    {
      "name": "Balances",
      "x-displayName": "Балансы",
      "description": "Информация о балансах. \n\nВсе запросы к API требуют авторизации с помощью **Bearer Token (PAT)**. \n\nДля получения токена обратитесь в техническую поддержку **Retail Rocket Group** (support@retailrocket.ru)"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "parameters": {
      "PartnerId": {
        "name": "partnerId",
        "in": "path",
        "description": "Идентификатор интернет-магазина",
        "required": true,
        "schema": {
          "type": "string",
          "default": "59908d02c7d013ce40de715a"
        }
      },
      "PartnerIdQuery": {
        "name": "partnerId",
        "in": "query",
        "description": "Идентификатор интернет-магазина",
        "required": true,
        "schema": {
          "type": "string",
          "default": "59908d02c7d013ce40de715a"
        }
      },
      "PlacementId": {
        "name": "placementId",
        "in": "path",
        "description": "Идентификатор места размещения. Выдается сотрудником Retail Rocket",
        "required": true,
        "schema": {
          "type": "string",
          "default": "5b333f5693445184b6017"
        }
      },
      "ApiKey": {
        "name": "apiKey",
        "in": "query",
        "description": "Ключ авторизации",
        "required": true,
        "schema": {
          "type": "string",
          "default": "5b333f5697a528b0184b6017"
        }
      },
      "LinkName": {
        "name": "link.name",
        "in": "query",
        "description": "Указатель на посетителя - имя параметра link, из пары из произвольных строки-ключа и строки-значения (например, ключ — \"сессия пользователя\", значение — \"идентификатор сессии\"), или [другой идентификатор](https://docs.retailrocket.ru/docs/api/session-management/)",
        "required": true,
        "schema": {
          "type": "string",
          "format": "json",
          "default": "sp-540"
        }
      },
      "LinkValue": {
        "name": "link.value",
        "in": "query",
        "description": "Указатель на посетителя - значение параметра link, из пары из произвольных строки-ключа и строки-значения (например, ключ — \"сессия пользователя\", значение — \"идентификатор сессии\"), или [другой идентификатор](https://docs.retailrocket.ru/docs/api/session-management/)",
        "required": true,
        "schema": {
          "type": "string",
          "format": "json",
          "default": "SP4050"
        }
      },
      "AcceptContent": {
        "name": "acceptContent",
        "in": "query",
        "description": "Типы содержимого, которые площадка готова разместить, перечисленные через запятую: string, productIds, banners, sharedBanners, sharedProductIds",
        "required": true,
        "schema": {
          "type": "string",
          "default": "string"
        }
      },
      "StockId": {
        "name": "stockId",
        "in": "query",
        "description": "Идентификатор склада, к которому принадлежит товар",
        "schema": {
          "type": "string"
        }
      },
      "CustomName": {
        "name": "custom.name",
        "in": "query",
        "description": "Дополнительный параметр для получения рекламного контента, имя параметра не зависит от регистра, значение - регистрозависимо. Можно передать сколько угодно произвольных параметров в формате **custom.\\<name\\>=\\<value\\>**, с разными значениями 'name' и 'value'",
        "schema": {
          "type": "string",
          "default": "value"
        }
      },
      "ContentTypeHeader": {
        "name": "Content-type",
        "in": "header",
        "schema": {
          "type": "string",
          "default": "application/json"
        }
      },
      "IsProductIdString": {
        "name": "isProductIdString",
        "in": "query",
        "description": "Необходимо указывать true в случае если ID, передаваемые в запрос, являются строчными. Если ID числовые, то нужно или передавать параметр со значением false, либо не передавать данный параметр вовсе.",
        "schema": {
          "type": "boolean"
        }
      },
      "PortalId": {
        "name": "portalId",
        "in": "path",
        "required": true,
        "description": "Идентификатор портала",
        "schema": {
          "type": "string"
        }
      },
      "PlatformId": {
        "name": "platformId",
        "in": "path",
        "required": true,
        "description": "Идентификатор платформы / паблишера. В других разделах Smart Placement эта же сущность может называться partnerId.",
        "schema": {
          "type": "string",
          "example": "67b057844f6596d07edd691a"
        }
      },
      "AdvertiserId": {
        "name": "advertiserId",
        "in": "path",
        "required": true,
        "description": "Идентификатор рекламодателя",
        "schema": {
          "type": "string"
        }
      },
      "InviteId": {
        "name": "inviteId",
        "in": "path",
        "required": true,
        "description": "Идентификатор приглашения",
        "schema": {
          "type": "string"
        }
      },
      "OwnerId": {
        "name": "ownerId",
        "in": "path",
        "required": true,
        "description": "Идентификатор пользователя",
        "schema": {
          "type": "string"
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Количество записей на страницу",
        "schema": {
          "type": "integer"
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "Курсор для получения следующей страницы",
        "schema": {
          "type": "string"
        }
      },
      "FromDate": {
        "name": "from",
        "in": "query",
        "description": "Начальная дата (в формате ISO 8601)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ToDate": {
        "name": "to",
        "in": "query",
        "description": "Конечная дата (в формате ISO 8601)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ReportDate": {
        "name": "date",
        "in": "path",
        "required": true,
        "description": "Отчётная дата в формате YYYY-MM-DD. Дата должна находиться в пределах последних 60 дней.",
        "schema": {
          "type": "string",
          "format": "date",
          "example": "2026-04-22"
        }
      },
      "ReportTimezone": {
        "name": "tz",
        "in": "query",
        "required": true,
        "description": "Часовой пояс в формате IANA. От значения зависит граница дня для группировки данных.",
        "schema": {
          "type": "string",
          "example": "Europe/Moscow"
        }
      }
    },
    "schemas": {
      "AdvertsDailyReportResponse": {
        "type": "object",
        "properties": {
          "value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvertReportLine"
            }
          }
        }
      },
      "AdvertReportLine": {
        "type": "object",
        "properties": {
          "advertId": {
            "type": "string",
            "example": "01KN22935AY85RP2KYKHNT37ZY"
          },
          "advertName": {
            "type": "string",
            "example": "87895917"
          },
          "advertFormatDisplayName": {
            "type": "string",
            "example": "Общая товарная полка"
          },
          "campaignId": {
            "type": "string",
            "example": "01KN223PCNT65Y1BNGA5YKD98V"
          },
          "campaignName": {
            "type": "string",
            "example": "Тумбы под раковину"
          },
          "campaignBrand": {
            "type": "string",
            "example": ""
          },
          "placementId": {
            "type": "string",
            "example": "01HZH1PQW1VAJQW59B6SHY1MJM"
          },
          "placementName": {
            "type": "string",
            "example": "Товарное продвижение в блоке «Рекомендации для вас»"
          },
          "advertiserId": {
            "type": "string",
            "example": "01JBERS5ZDW9PERB4GD8VJDBCP"
          },
          "advertiserName": {
            "type": "string",
            "example": "ООО \"ТД КОНТИНЕНТ\""
          },
          "date": {
            "type": "string",
            "format": "date",
            "example": "2026-04-06"
          },
          "uniqViewVisitors": {
            "type": "integer",
            "example": 2
          },
          "impressions": {
            "type": "integer",
            "example": 0
          },
          "views": {
            "type": "integer",
            "example": 2
          },
          "clicks": {
            "type": "integer",
            "example": 0
          },
          "spent": {
            "type": "number",
            "format": "decimal",
            "example": 0.5
          },
          "postViewProducts": {
            "type": "number",
            "format": "decimal",
            "example": 0
          },
          "postClickProducts": {
            "type": "number",
            "format": "decimal",
            "example": 0
          },
          "postViewRevenue": {
            "type": "number",
            "format": "decimal",
            "example": 0
          },
          "postClickRevenue": {
            "type": "number",
            "format": "decimal",
            "example": 0
          }
        }
      },
      "AttributedOrdersDailyReportResponse": {
        "type": "object",
        "properties": {
          "value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttributedOrderLine"
            }
          }
        }
      },
      "AttributedOrderLine": {
        "type": "object",
        "properties": {
          "orderedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-31T21:28:56+00:00"
          },
          "orderId": {
            "type": "string",
            "example": "237202321"
          },
          "productId": {
            "type": "string",
            "example": "1001038"
          },
          "productName": {
            "type": "string",
            "example": "Виски Tullamore D.E.W. 0,7 л"
          },
          "quantity": {
            "type": "number",
            "format": "decimal",
            "example": 2
          },
          "purchase": {
            "type": "number",
            "format": "decimal",
            "example": 3299.98
          },
          "attributionType": {
            "type": "string",
            "enum": ["PostView", "PostClick"],
            "example": "PostView"
          },
          "advertId": {
            "type": "string",
            "example": "01KFX4B3MG8ZM25A6WWBGVC3WA"
          },
          "advertName": {
            "type": "string",
            "example": "Виски Jack Daniel's 0,7 л"
          },
          "placementId": {
            "type": "string",
            "example": "01JMEGNCH6MM68N4WFE5P41ZGZ"
          },
          "placementName": {
            "type": "string",
            "example": "Рекомендуем лично вам"
          }
        }
      },
      "PlacementReportLine": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "string",
            "format": "date-time",
            "example": "2026-02-28T21:00:00+00:00"
          },
          "placementId": {
            "type": "string",
            "example": "01JMEGFA00M28C0ARVHSW5VHB7"
          },
          "placementName": {
            "type": "string",
            "example": "Плитка баннеров"
          },
          "groupId": {
            "type": "string",
            "example": "01JMEG6QZKXV9QRDHVRASEXQKG"
          },
          "groupName": {
            "type": "string",
            "example": "Главная страница APP"
          },
          "deviceType": {
            "type": "string",
            "example": "Mobile"
          },
          "requests": {
            "type": "integer",
            "description": "Сколько раз площадка запросила контент.",
            "example": 3187
          },
          "adRequests": {
            "type": "integer",
            "description": "Сколько запросов было с рекламой.",
            "example": 3187
          }
        }
      },
      "InvalidDateRangeError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "INVALID_DATE_RANGE"
          },
          "requestedDate": {
            "type": "string",
            "format": "date",
            "example": "2026-04-06"
          }
        }
      },
      "AccessDeniedError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "ACCESS_DENIED"
          },
          "portalId": {
            "type": "string",
            "example": "01HZ1FNN5RNM4850TGY8PP4YTF"
          },
          "platformId": {
            "type": "string",
            "example": "67b057844f6596d07edd691a"
          }
        }
      },
      "RateLimitExceededError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "RATE_LIMIT_EXCEEDED"
          },
          "retryAfter": {
            "type": "integer",
            "description": "Через сколько секунд можно повторить запрос.",
            "example": 5
          }
        }
      }
    }
  },
  "security": [{}],
  "paths": {
    "/partners/{partnerId}/productPlacements/{placementId}/impressions": {
      "get": {
        "tags": ["smp product pages"],
        "summary": "Получение контента для товарных страниц",
        "description": "## Тип ответа\n\n### Impression\n\nСодержит данные для показа спонсорского содержимого. Может принимать разные формы, в зависимости от значения переданного в запросе **acceptContent**.\n\nЗначения **acceptContent**:\n\n* **string**\n* **productIds**\n* **banners**\n* **sharedBanners**\n* **sharedProductIds**\n\n`link` - это указатель на сессию пользователя, который состоит из двух параметров: `link.name`, где указывается название сессии, и `link.value`, где передается идентификатор сессии. В строке запроса название и значение должны выглядеть следующим образом: &link.name=sp-540&link.value=SP4050, где sp-540 — это название сессии, а SP4050 — её идентификатор.\n\nПорядок выдачи товарных идентификаторов имеет значение, реализовывать их отрисовку необходимо в соответствующем порядке.",
        "operationId": "receiving-of-sponsored-content-for-product-pages",
        "parameters": [
          {
            "$ref": "#/components/parameters/PartnerId"
          },
          {
            "$ref": "#/components/parameters/PlacementId"
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "name": "productId",
            "in": "query",
            "description": "Идентификатор товара, строка или число",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LinkName"
          },
          {
            "$ref": "#/components/parameters/LinkValue"
          },
          {
            "$ref": "#/components/parameters/AcceptContent"
          },
          {
            "$ref": "#/components/parameters/StockId"
          },
          {
            "$ref": "#/components/parameters/CustomName"
          },
          {
            "$ref": "#/components/parameters/ContentTypeHeader"
          },
          {
            "$ref": "#/components/parameters/IsProductIdString"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "StringImpression": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"string\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"string\": \"any string\"\n    }\n}"
                  },
                  "ProductIdsImpression": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"productIds\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"productIds\": [123, 321]\n    }\n}"
                  },
                  "BannersImpression": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"banners\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"banners\": [\n            {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            }\n        ],\n        \"ord\": {\n            \"eridToken\": \"<erid token>\",\n            \"advertiser\": {\n                \"legalName\": \"<legal name>\",\n                \"inn\": \"<inn>\",\n                \"ogrn\": \"<ogrn>\"\n            }\n        }\n}"
                  },
                  "SharedBannersImpression": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"sharedBanners\",\n    \"content\": [\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        },\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "StringImpression",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "string"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "string": {
                              "type": "string",
                              "example": "any string"
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "ProductIdsImpression",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "productIds"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "productIds": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "example": 123,
                                "default": 0
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "SharedBannersImpression",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "sharedBanners"
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "content identifier"
                              },
                              "banner": {
                                "type": "object",
                                "properties": {
                                  "targetUrl": {
                                    "type": "string",
                                    "example": "http://host/path"
                                  },
                                  "pictureUrl": {
                                    "type": "string",
                                    "example": "http://host/path/image.png"
                                  }
                                }
                              },
                              "ord": {
                                "type": "object",
                                "properties": {
                                  "eridToken": {
                                    "type": "string",
                                    "example": "<erid token>"
                                  },
                                  "advertiser": {
                                    "type": "object",
                                    "properties": {
                                      "legalName": {
                                        "type": "string",
                                        "example": "<legal name>"
                                      },
                                      "inn": {
                                        "type": "string",
                                        "example": "<inn>"
                                      },
                                      "ogrn": {
                                        "type": "string",
                                        "example": "<ogrn>"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "servers": [
          {
            "url": "https://visitors-sp.retailrocket.ru/v1/"
          }
        ]
      }
    },
    "/impressionContentViewed": {
      "post": {
        "summary": "Просмотр спонсорского контента",
        "description": "Должен быть вызван при каждом показе посетителю спонсорского контента.",
        "operationId": "sponsored-placement-view",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "$ref": "#/components/parameters/PartnerIdQuery"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["link", "impressionContentId", "timestamp"],
                "properties": {
                  "link": {
                    "type": "object",
                    "description": "Указатель на посетителя - пара, состоящая из произвольных строки-ключа и строки-значения (например, ключ — \"сессия пользователя\", значение — \"идентификатор сессии\"), или [другой идентификатор](https://docs.retailrocket.ru/docs/api/session-management/)",
                    "default": {
                      "name": "session",
                      "value": "1b111eb597a528b654db611e"
                    }
                  },
                  "impressionContentId": {
                    "type": "string",
                    "description": "Идентификатор спонсорского контента",
                    "default": "568da4f6-7952-49b1-afd3-9ac44d6e78c7"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Метка времени вызова",
                    "default": "2025-01-15T15:53:00+00:00"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "tags": ["smp events"],
        "servers": [
          {
            "url": "https://apptracking.retailrocket.ru/2.0"
          }
        ]
      }
    },
    "/impressionContentClicked": {
      "post": {
        "summary": "Клик по спонсорскому контенту",
        "description": "Должен быть вызван при каждом взаимодействии посетителя со спонсорским контентом, например: переход на карточку товара, добавление в корзину, добавление в избранное, сравнение и т.д.",
        "operationId": "sponsored-placement-click",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "$ref": "#/components/parameters/PartnerIdQuery"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["link", "impressionContentId", "timestamp"],
                "properties": {
                  "link": {
                    "type": "object",
                    "description": "Указатель на посетителя - пара, состоящая из произвольных строки-ключа и строки-значения (например, ключ — \"сессия пользователя\", значение — \"идентификатор сессии\"), или [другой идентификатор](https://docs.retailrocket.ru/docs/api/session-management/)",
                    "default": {
                      "name": "session",
                      "value": "1b111eb597a528b654db611e"
                    }
                  },
                  "impressionContentId": {
                    "type": "string",
                    "description": "Идентификатор спонсорского контента",
                    "default": "568da4f6-7952-49b1-afd3-9ac44d6e78c7"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Метка времени вызова",
                    "default": "2025-01-15T15:53:00+00:00"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "tags": ["smp events"],
        "servers": [
          {
            "url": "https://apptracking.retailrocket.ru/2.0"
          }
        ]
      }
    },
    "/partners/{partnerId}/events": {
      "post": {
        "summary": "Показ контента publicDisplay",
        "description": "Должен быть вызван, когда партнер воспроизвел рекламу на дисплее в офлайн-магазине.",
        "operationId": "public-display-events",
        "parameters": [
          {
            "$ref": "#/components/parameters/PartnerId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["events"],
                "properties": {
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "impressionContentId",
                        "type",
                        "timestamp"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Уникальный идентификатор события. Для каждого показа передавайте новое значение."
                        },
                        "impressionContentId": {
                          "type": "string",
                          "description": "Идентификатор экземпляра спонсорского контента."
                        },
                        "type": {
                          "type": "string",
                          "description": "Тип события.",
                          "enum": ["displayed"]
                        },
                        "timestamp": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Время, когда содержимое воспроизводилось. Формат ISO 8601, UTC."
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "events": [
                  {
                    "id": "test3",
                    "impressionContentId": "b3abe55e-1a31-4c9d-970c-ae647222428b",
                    "type": "displayed",
                    "timestamp": "2024-07-21T15:16:17.000Z"
                  },
                  {
                    "id": "test4",
                    "impressionContentId": "b3abe55e-1a31-4c9d-970c-ae647222428b",
                    "type": "displayed",
                    "timestamp": "2024-07-21T13:16:17.000Z"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "tags": ["smp events"],
        "servers": [
          {
            "url": "https://apptracking.retailrocket.ru/2.0"
          }
        ]
      }
    },
    "/portals/{portalId}/reports/adverts/{date}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["smp s2s reports"],
        "summary": "Дневной отчёт по рекламам портала",
        "description": "Возвращает дневную статистику рекламной активности, эффективности и атрибутированных продаж по рекламам портала. Используйте метод для регулярной server-to-server выгрузки данных в BI или data warehouse.",
        "operationId": "getPortalAdvertsDailyReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/ReportDate"
          },
          {
            "$ref": "#/components/parameters/ReportTimezone"
          }
        ],
        "responses": {
          "200": {
            "description": "Отчёт успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvertsDailyReportResponse"
                },
                "example": {
                  "value": [
                    {
                      "advertId": "01KN22935AY85RP2KYKHNT37ZY",
                      "advertName": "87895917",
                      "advertFormatDisplayName": "Общая товарная полка",
                      "campaignId": "01KN223PCNT65Y1BNGA5YKD98V",
                      "campaignName": "Тумбы под раковину",
                      "campaignBrand": "",
                      "placementId": "01HZH1PQW1VAJQW59B6SHY1MJM",
                      "placementName": "Товарное продвижение в блоке «Рекомендации для вас»",
                      "advertiserId": "01JBERS5ZDW9PERB4GD8VJDBCP",
                      "advertiserName": "ООО \"ТД КОНТИНЕНТ\"",
                      "date": "2026-04-06",
                      "uniqViewVisitors": 2,
                      "impressions": 0,
                      "views": 2,
                      "clicks": 0,
                      "spent": 0.5,
                      "postViewProducts": 0,
                      "postClickProducts": 0,
                      "postViewRevenue": 0,
                      "postClickRevenue": 0
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Дата вне допустимого окна или передана в неверном формате",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidDateRangeError"
                }
              }
            }
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "PAT валиден, но у SSO-аккаунта нет доступа к указанному порталу",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessDeniedError"
                }
              }
            }
          },
          "404": {
            "description": "Портал не найден или для него не включены S2S-отчёты"
          },
          "429": {
            "description": "Превышен rate limit",
            "headers": {
              "Retry-After": {
                "description": "Через сколько секунд можно повторить запрос.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitExceededError"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/platforms/{platformId}/reports/attributedOrders/{date}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["smp s2s reports"],
        "summary": "Дневной отчёт по атрибутированным заказам",
        "description": "Возвращает товарные позиции заказов, атрибутированные к рекламе Smart Placement по post view или post click. Используйте метод для финансовой отчётности и собственных attribution-моделей паблишера.",
        "operationId": "getPlatformAttributedOrdersDailyReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/PlatformId"
          },
          {
            "$ref": "#/components/parameters/ReportDate"
          },
          {
            "$ref": "#/components/parameters/ReportTimezone"
          }
        ],
        "responses": {
          "200": {
            "description": "Отчёт успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributedOrdersDailyReportResponse"
                },
                "example": {
                  "value": [
                    {
                      "orderedAt": "2026-03-31T21:28:56+00:00",
                      "orderId": "237202321",
                      "productId": "1001038",
                      "productName": "Виски Tullamore D.E.W. 0,7 л",
                      "quantity": 2,
                      "purchase": 3299.98,
                      "attributionType": "PostView",
                      "advertId": "01KFX4B3MG8ZM25A6WWBGVC3WA",
                      "advertName": "Виски Jack Daniel's 0,7 л",
                      "placementId": "01JMEGNCH6MM68N4WFE5P41ZGZ",
                      "placementName": "Рекомендуем лично вам"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Дата вне допустимого окна или передана в неверном формате",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidDateRangeError"
                }
              }
            }
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "PAT валиден, но у SSO-аккаунта нет доступа к указанной платформе",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessDeniedError"
                }
              }
            }
          },
          "404": {
            "description": "Платформа не найдена или для неё не включены S2S-отчёты"
          },
          "429": {
            "description": "Превышен rate limit",
            "headers": {
              "Retry-After": {
                "description": "Через сколько секунд можно повторить запрос.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitExceededError"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://platforms.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/platforms/{platformId}/reports/placements/{date}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["smp s2s reports"],
        "summary": "Дневной отчёт по плейсментам",
        "description": "Возвращает почасовую статистику спроса и матча рекламы по каждому плейсменту и группе. Ответ передаётся в формате application/json-seq: по одному JSON-объекту PlacementReportLine на строку, без обёртки value.",
        "operationId": "getPlatformPlacementsDailyReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/PlatformId"
          },
          {
            "$ref": "#/components/parameters/ReportDate"
          },
          {
            "$ref": "#/components/parameters/ReportTimezone"
          }
        ],
        "responses": {
          "200": {
            "description": "Поток строк отчёта успешно получен",
            "content": {
              "application/json-seq": {
                "schema": {
                  "$ref": "#/components/schemas/PlacementReportLine"
                },
                "examples": {
                  "line": {
                    "summary": "Одна строка отчёта",
                    "value": {
                      "hour": "2026-02-28T21:00:00+00:00",
                      "placementId": "01JMEGFA00M28C0ARVHSW5VHB7",
                      "placementName": "Плитка баннеров",
                      "groupId": "01JMEG6QZKXV9QRDHVRASEXQKG",
                      "groupName": "Главная страница APP",
                      "deviceType": "Mobile",
                      "requests": 3187,
                      "adRequests": 3187
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Дата вне допустимого окна или передана в неверном формате",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidDateRangeError"
                }
              }
            }
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "PAT валиден, но у SSO-аккаунта нет доступа к указанной платформе",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessDeniedError"
                }
              }
            }
          },
          "404": {
            "description": "Платформа не найдена или для неё не включены S2S-отчёты"
          },
          "429": {
            "description": "Превышен rate limit",
            "headers": {
              "Retry-After": {
                "description": "Через сколько секунд можно повторить запрос.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitExceededError"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://platforms.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/partners/{partnerId}/productGroupPlacements/{placementId}/impressions": {
      "get": {
        "tags": ["smp grouped products pages"],
        "summary": "Получение контента для страниц групп разных товаров",
        "description": "## Тип ответа\n\n### Impression\n\nСодержит данные для показа спонсорского содержимого. Может принимать разные формы, в зависимости от значения переданного в запросе **acceptContent**.\n\nЗначения **acceptContent**:\n\n* **string**\n* **productIds**\n* **banners**\n* **sharedBanners**\n* **sharedProductIds**\n\n`link` - это указатель на сессию пользователя, который состоит из двух параметров: `link.name`, где указывается название сессии, и `link.value`, где передается идентификатор сессии. В строке запроса название и значение должны выглядеть следующим образом: &link.name=sp-540&link.value=SP4050, где sp-540 — это название сессии, а SP4050 — её идентификатор.\n\nПорядок выдачи товарных идентификаторов имеет значение, реализовывать их отрисовку необходимо в соответствующем порядке.",
        "operationId": "receiving-of-sponsored-content-for-grouped-product-pages",
        "parameters": [
          {
            "$ref": "#/components/parameters/PartnerId"
          },
          {
            "$ref": "#/components/parameters/PlacementId"
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "name": "productIds",
            "in": "query",
            "description": "Список идентификаторов товара записанных через запятую, массив строк или чисел. (установлен лимит: не более 30 идентификаторов)",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int64"
              },
              "default": [543]
            }
          },
          {
            "$ref": "#/components/parameters/LinkName"
          },
          {
            "$ref": "#/components/parameters/LinkValue"
          },
          {
            "$ref": "#/components/parameters/AcceptContent"
          },
          {
            "$ref": "#/components/parameters/StockId"
          },
          {
            "$ref": "#/components/parameters/CustomName"
          },
          {
            "$ref": "#/components/parameters/ContentTypeHeader"
          },
          {
            "$ref": "#/components/parameters/IsProductIdString"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "string": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"string\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"string\": \"any string\"\n    }\n}"
                  },
                  "productIds": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"productIds\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"productIds\": [123, 321]\n    }\n}"
                  },
                  "banners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"banners\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"banners\": [\n            {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            }\n        ],\n        \"ord\": {\n            \"eridToken\": \"<erid token>\",\n            \"advertiser\": {\n                \"legalName\": \"<legal name>\",\n                \"inn\": \"<inn>\",\n                \"ogrn\": \"<ogrn>\"\n            }\n        }\n}"
                  },
                  "sharedBanners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"sharedBanners\",\n    \"content\": [\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        },\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "string",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "string"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "string": {
                              "type": "string",
                              "example": "any string"
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "productIds",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "productIds"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "productIds": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "example": 123,
                                "default": 0
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "sharedBanners",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "sharedBanners"
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "content identifier"
                              },
                              "banner": {
                                "type": "object",
                                "properties": {
                                  "targetUrl": {
                                    "type": "string",
                                    "example": "http://host/path"
                                  },
                                  "pictureUrl": {
                                    "type": "string",
                                    "example": "http://host/path/image.png"
                                  }
                                }
                              },
                              "ord": {
                                "type": "object",
                                "properties": {
                                  "eridToken": {
                                    "type": "string",
                                    "example": "<erid token>"
                                  },
                                  "advertiser": {
                                    "type": "object",
                                    "properties": {
                                      "legalName": {
                                        "type": "string",
                                        "example": "<legal name>"
                                      },
                                      "inn": {
                                        "type": "string",
                                        "example": "<inn>"
                                      },
                                      "ogrn": {
                                        "type": "string",
                                        "example": "<ogrn>"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "servers": [
          {
            "url": "https://visitors-sp.retailrocket.ru/v1/"
          }
        ]
      }
    },
    "/partners/{partnerId}/searchPlacements/{placementId}/impressions": {
      "get": {
        "tags": ["smp search page"],
        "summary": "Получение контента для страницы поиска",
        "description": "## Тип ответа\n\n### Impression\n\nСодержит данные для показа спонсорского содержимого. Может принимать разные формы, в зависимости от значения переданного в запросе **acceptContent**.\n\nЗначения **acceptContent**:\n\n* **string**\n* **productIds**\n* **banners**\n* **sharedBanners**\n* **sharedProductIds**\n\n`link` - это указатель на сессию пользователя, который состоит из двух параметров: `link.name`, где указывается название сессии, и `link.value`, где передается идентификатор сессии. В строке запроса название и значение должны выглядеть следующим образом: &link.name=sp-540&link.value=SP4050, где sp-540 — это название сессии, а SP4050 — её идентификатор.\n\nПорядок выдачи товарных идентификаторов имеет значение, реализовывать их отрисовку необходимо в соответствующем порядке.",
        "operationId": "receiving-of-sponsored-content-for-search-pages",
        "parameters": [
          {
            "$ref": "#/components/parameters/PartnerId"
          },
          {
            "$ref": "#/components/parameters/PlacementId"
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "name": "searchQuery",
            "in": "query",
            "description": "Поисковый запрос, который ввел пользователь",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Куртки"
            }
          },
          {
            "$ref": "#/components/parameters/LinkName"
          },
          {
            "$ref": "#/components/parameters/LinkValue"
          },
          {
            "$ref": "#/components/parameters/AcceptContent"
          },
          {
            "$ref": "#/components/parameters/StockId"
          },
          {
            "$ref": "#/components/parameters/CustomName"
          },
          {
            "$ref": "#/components/parameters/ContentTypeHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "string": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"string\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"string\": \"any string\"\n    }\n}"
                  },
                  "productIds": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"productIds\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"productIds\": [123, 321]\n    }\n}"
                  },
                  "banners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"banners\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"banners\": [\n            {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            }\n        ],\n        \"ord\": {\n            \"eridToken\": \"<erid token>\",\n            \"advertiser\": {\n                \"legalName\": \"<legal name>\",\n                \"inn\": \"<inn>\",\n                \"ogrn\": \"<ogrn>\"\n            }\n        }\n}"
                  },
                  "sharedBanners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"sharedBanners\",\n    \"content\": [\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        },\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "string",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "string"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "string": {
                              "type": "string",
                              "example": "any string"
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "productIds",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "productIds"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "productIds": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "example": 123,
                                "default": 0
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "sharedBanners",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "sharedBanners"
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "content identifier"
                              },
                              "banner": {
                                "type": "object",
                                "properties": {
                                  "targetUrl": {
                                    "type": "string",
                                    "example": "http://host/path"
                                  },
                                  "pictureUrl": {
                                    "type": "string",
                                    "example": "http://host/path/image.png"
                                  }
                                }
                              },
                              "ord": {
                                "type": "object",
                                "properties": {
                                  "eridToken": {
                                    "type": "string",
                                    "example": "<erid token>"
                                  },
                                  "advertiser": {
                                    "type": "object",
                                    "properties": {
                                      "legalName": {
                                        "type": "string",
                                        "example": "<legal name>"
                                      },
                                      "inn": {
                                        "type": "string",
                                        "example": "<inn>"
                                      },
                                      "ogrn": {
                                        "type": "string",
                                        "example": "<ogrn>"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "servers": [
          {
            "url": "https://visitors-sp.retailrocket.ru/v1/"
          }
        ]
      }
    },
    "/partners/{partnerId}/publicDisplayPlacements/{placementId}/impressions": {
      "get": {
        "tags": ["smp offline stores"],
        "summary": "Спонсорский контент для показа в оффлайн магазинах",
        "description": "## Тип ответа\n\n### Impression\n\nСодержит данные для показа спонсорского содержимого. Может принимать разные формы, в зависимости от значения переданного в запросе **acceptContent**.\n\nЗначения **acceptContent**:\n\n* **string**\n* **productIds**\n* **banners**\n* **sharedBanners**\n* **sharedProductIds**\n\n`link` - это указатель на сессию пользователя, который состоит из двух параметров: `link.name`, где указывается название сессии, и `link.value`, где передается идентификатор сессии. В строке запроса название и значение должны выглядеть следующим образом: &link.name=sp-540&link.value=SP4050, где sp-540 — это название сессии, а SP4050 — её идентификатор.\n\nПорядок выдачи товарных идентификаторов имеет значение, реализовывать их отрисовку необходимо в соответствующем порядке.",
        "operationId": "receiving-of-sponsored-content-for-offline-stores",
        "parameters": [
          {
            "$ref": "#/components/parameters/PartnerId"
          },
          {
            "$ref": "#/components/parameters/PlacementId"
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "$ref": "#/components/parameters/AcceptContent"
          },
          {
            "$ref": "#/components/parameters/StockId"
          },
          {
            "$ref": "#/components/parameters/CustomName"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "string": {
                    "value": "{\n  \"id\": \"a2e96a44-f2cd-4bd1-adcd-54a90329cb72\",\n  \"contentType\": \"string\",\n  \"content\": {\n    \"id\": \"1b577145-7b78-473e-8814-4df26353d802\",\n    \"string\": \"SP-1217-Test\"\n  }\n}"
                  },
                  "banners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"banners\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"banners\": [\n            {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            }\n        ],\n        \"ord\": {\n            \"eridToken\": \"<erid token>\",\n            \"advertiser\": {\n                \"legalName\": \"<legal name>\",\n                \"inn\": \"<inn>\",\n                \"ogrn\": \"<ogrn>\"\n            }\n        }\n}"
                  },
                  "multimedia": {
                    "value": "{\n  \"id\": \"a89b03b1-efdb-48a9-b0a1-7b5c7c812c86\",\n  \"contentType\": \"multimedia\",\n  \"content\": [\n    {\n      \"id\": \"e1659bf1-55b6-441d-a7af-9a3fa7f7b921\",\n      \"video\": {\n        \"url\": \"https://static.smartplacement.io/banner/01GV2WKABH4H812STFSV1JG07M/01J3J3BBZVSG6FJENAXTWN5AVK/1897559941\"\n      }\n    },\n    {\n      \"id\": \"e1659bf1-55b6-441d-a7af-9a3fa7f7b921\",\n      \"image\": {\n        \"url\": \"https://static.smartplacement.io/banner/01GV2WKABH4H812STFSV1JG07M/01J3J3BBZVSG6FJENAXTWN5AVK/1897559941\"\n      }\n    }\n  ]\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "string",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "a2e96a44-f2cd-4bd1-adcd-54a90329cb72"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "string"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "1b577145-7b78-473e-8814-4df26353d802"
                            },
                            "string": {
                              "type": "string",
                              "example": "SP-1217-Test"
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "multimedia",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "a89b03b1-efdb-48a9-b0a1-7b5c7c812c86"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "multimedia"
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "e1659bf1-55b6-441d-a7af-9a3fa7f7b921"
                              },
                              "video": {
                                "type": "object",
                                "properties": {
                                  "url": {
                                    "type": "string",
                                    "example": "https://static.smartplacement.io/banner/01GV2WKABH4H812STFSV1JG07M/01J3J3BBZVSG6FJENAXTWN5AVK/1897559941"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "servers": [
          {
            "url": "https://visitors-sp.retailrocket.ru/v1/"
          }
        ]
      }
    },
    "/partners/{partnerId}/anyPlacements/{placementId}/impressions": {
      "get": {
        "tags": ["smp other pages"],
        "summary": "Получение контента для прочих страниц",
        "description": "## Тип ответа\n\n### Impression\n\nСодержит данные для показа спонсорского содержимого. Может принимать разные формы, в зависимости от значения переданного в запросе **acceptContent**.\n\nЗначения **acceptContent**:\n\n* **string**\n* **productIds**\n* **banners**\n* **sharedBanners**\n* **sharedProductIds**\n\n`link` - это указатель на сессию пользователя, который состоит из двух параметров: `link.name`, где указывается название сессии, и `link.value`, где передается идентификатор сессии. В строке запроса название и значение должны выглядеть следующим образом: &link.name=sp-540&link.value=SP4050, где sp-540 — это название сессии, а SP4050 — её идентификатор.\n\nПорядок выдачи товарных идентификаторов имеет значение, реализовывать их отрисовку необходимо в соответствующем порядке.",
        "operationId": "receiving-of-sponsored-content-for-other-pages",
        "parameters": [
          {
            "$ref": "#/components/parameters/PartnerId"
          },
          {
            "$ref": "#/components/parameters/PlacementId"
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "$ref": "#/components/parameters/LinkName"
          },
          {
            "$ref": "#/components/parameters/LinkValue"
          },
          {
            "$ref": "#/components/parameters/AcceptContent"
          },
          {
            "$ref": "#/components/parameters/StockId"
          },
          {
            "$ref": "#/components/parameters/CustomName"
          },
          {
            "$ref": "#/components/parameters/ContentTypeHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "string": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"string\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"string\": \"any string\"\n    }\n}"
                  },
                  "productIds": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"productIds\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"productIds\": [123, 321]\n    }\n}"
                  },
                  "banners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"banners\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"banners\": [\n            {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            }\n        ],\n        \"ord\": {\n            \"eridToken\": \"<erid token>\",\n            \"advertiser\": {\n                \"legalName\": \"<legal name>\",\n                \"inn\": \"<inn>\",\n                \"ogrn\": \"<ogrn>\"\n            }\n        }\n}"
                  },
                  "sharedBanners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"sharedBanners\",\n    \"content\": [\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        },\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "string",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "string"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "string": {
                              "type": "string",
                              "example": "any string"
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "productIds",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "productIds"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "productIds": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "example": 123,
                                "default": 0
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "sharedBanners",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "sharedBanners"
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "content identifier"
                              },
                              "banner": {
                                "type": "object",
                                "properties": {
                                  "targetUrl": {
                                    "type": "string",
                                    "example": "http://host/path"
                                  },
                                  "pictureUrl": {
                                    "type": "string",
                                    "example": "http://host/path/image.png"
                                  }
                                }
                              },
                              "ord": {
                                "type": "object",
                                "properties": {
                                  "eridToken": {
                                    "type": "string",
                                    "example": "<erid token>"
                                  },
                                  "advertiser": {
                                    "type": "object",
                                    "properties": {
                                      "legalName": {
                                        "type": "string",
                                        "example": "<legal name>"
                                      },
                                      "inn": {
                                        "type": "string",
                                        "example": "<inn>"
                                      },
                                      "ogrn": {
                                        "type": "string",
                                        "example": "<ogrn>"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "servers": [
          {
            "url": "https://visitors-sp.retailrocket.ru/v1/"
          }
        ]
      }
    },
    "/partners/{partnerId}/categoryPlacements/{placementId}/impressions": {
      "get": {
        "tags": ["smp category pages"],
        "summary": "Получение спонсорского контента для страниц товарных категорий",
        "description": "### При интеграции через YML-файл\nВ YML файле доступно дерево категорий с целочисленными идентификаторами категории, поэтому и товары имеют целочисленные идентификаторы категорий, что позволяет использовать такие идентификаторы для запроса спонсорского контента для страниц товарных категорий. \n\nВ строке запроса нужно использовать параметр **categoryId** при таком типе интеграции.\n\n### При интеграции через Product API\nПри использовании Product API категория передается как **categoryPath**, она должна быть передана в таком же виде и при запросе спонсорского контента для страницы товарной категории.\n\nВ строке запроса нужно использовать параметр **categoryPath** при таком типе интеграции.\n\nПорядок элементов в ответе имеет значение, используйте выдачу в исходной последовательности.",
        "operationId": "receiving-of-sponsored-content-for-category-pages",
        "parameters": [
          {
            "$ref": "#/components/parameters/PartnerId"
          },
          {
            "$ref": "#/components/parameters/PlacementId"
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          },
          {
            "$ref": "#/components/parameters/LinkName"
          },
          {
            "$ref": "#/components/parameters/LinkValue"
          },
          {
            "$ref": "#/components/parameters/AcceptContent"
          },
          {
            "name": "categoryId",
            "in": "query",
            "description": "Идентификатор категории, в контексте которой находится пользователь",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 43
            }
          },
          {
            "name": "categoryPath",
            "in": "query",
            "description": "Путь категории товара",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/StockId"
          },
          {
            "$ref": "#/components/parameters/CustomName"
          },
          {
            "$ref": "#/components/parameters/ContentTypeHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "string": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"string\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"string\": \"any string\"\n    }\n}"
                  },
                  "productIds": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"productIds\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"productIds\": [123, 321]\n    }\n}"
                  },
                  "banners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"banners\",\n    \"content\": {\n        \"id\": \"content identifier\",\n        \"banners\": [\n            {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            }\n        ],\n        \"ord\": {\n            \"eridToken\": \"<erid token>\",\n            \"advertiser\": {\n                \"legalName\": \"<legal name>\",\n                \"inn\": \"<inn>\",\n                \"ogrn\": \"<ogrn>\"\n            }\n        }\n}"
                  },
                  "sharedBanners": {
                    "value": "{\n    \"id\": \"impression identifier\",\n    \"contentType\": \"sharedBanners\",\n    \"content\": [\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        },\n        {\n            \"id\": \"content identifier\",\n            \"banner\": {\n                \"targetUrl\" : \"http://host/path\",\n                \"pictureUrl\": \"http://host/path/image.png\"\n            },\n            \"ord\": {\n                \"eridToken\": \"<erid token>\",\n                \"advertiser\": {\n                    \"legalName\": \"<legal name>\",\n                    \"inn\": \"<inn>\",\n                    \"ogrn\": \"<ogrn>\"\n                }\n            }\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "string",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "string"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "string": {
                              "type": "string",
                              "example": "any string"
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "productIds",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "productIds"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "content identifier"
                            },
                            "productIds": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "example": 123,
                                "default": 0
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "sharedBanners",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "impression identifier"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "sharedBanners"
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "content identifier"
                              },
                              "banner": {
                                "type": "object",
                                "properties": {
                                  "targetUrl": {
                                    "type": "string",
                                    "example": "http://host/path"
                                  },
                                  "pictureUrl": {
                                    "type": "string",
                                    "example": "http://host/path/image.png"
                                  }
                                }
                              },
                              "ord": {
                                "type": "object",
                                "properties": {
                                  "eridToken": {
                                    "type": "string",
                                    "example": "<erid token>"
                                  },
                                  "advertiser": {
                                    "type": "object",
                                    "properties": {
                                      "legalName": {
                                        "type": "string",
                                        "example": "<legal name>"
                                      },
                                      "inn": {
                                        "type": "string",
                                        "example": "<inn>"
                                      },
                                      "ogrn": {
                                        "type": "string",
                                        "example": "<ogrn>"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "servers": [
          {
            "url": "https://visitors-sp.retailrocket.ru/v1/"
          }
        ]
      }
    },
    "/portals/{portalId}/advertisers": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Advertisers"],
        "summary": "Создание рекламодателя",
        "description": "Создаёт нового рекламодателя в указанном портале.",
        "operationId": "createAdvertiser",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "minBalance", "contract", "organization"],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Уникальное наименование рекламодателя"
                  },
                  "ownerId": {
                    "type": "string",
                    "description": "ID пользователя-владельца"
                  },
                  "minBalance": {
                    "type": "number",
                    "description": "Минимальный баланс"
                  },
                  "contract": {
                    "type": "object",
                    "required": [
                      "number",
                      "periodStartDay",
                      "signedAt",
                      "timezone"
                    ],
                    "properties": {
                      "number": {
                        "type": "string",
                        "description": "Номер договора"
                      },
                      "periodStartDay": {
                        "type": "integer",
                        "description": "День начала биллингового периода"
                      },
                      "signedAt": {
                        "type": "string",
                        "description": "Дата подписания (yyyy-MM-dd)",
                        "format": "date"
                      },
                      "timezone": {
                        "type": "string",
                        "description": "Часовой пояс (IANA)"
                      }
                    }
                  },
                  "organization": {
                    "type": "object",
                    "required": ["name", "tin"],
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Наименование Юридического лица/ИП"
                      },
                      "tin": {
                        "type": "string",
                        "description": "ИНН Юридического лица/ИП"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Рекламодатель успешно создан",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Идентификатор рекламодателя"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный часовой пояс или дата"
          },
          "401": {
            "description": "Требуется аутентификация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал не найден"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/advertisers/{advertiserId}/invites": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Access Management"],
        "summary": "Создание ссылки-приглашения (SSO RRG)",
        "description": "Создаёт ссылку для предоставления доступа пользователю к личному кабинету рекламодателя. Ссылка действительна 30 минут.",
        "operationId": "createInvite",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/AdvertiserId"
          }
        ],
        "responses": {
          "201": {
            "description": "Приглашение успешно создано",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "inviteLinkRelativeUrl": {
                      "type": "string"
                    },
                    "expiringAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал или рекламодатель не найден"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/advertisers/{advertiserId}/invites/{inviteId}:cancel": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Access Management"],
        "summary": "Отмена ссылки-приглашения (SSO RRG)",
        "description": "Отменяет ранее выданную ссылку-приглашение.",
        "operationId": "cancelInvite",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/AdvertiserId"
          },
          {
            "$ref": "#/components/parameters/InviteId"
          }
        ],
        "responses": {
          "200": {
            "description": "Приглашение успешно отменено"
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал, рекламодатель или приглашение не найдены"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/advertisers/{advertiserId}/owners": {
      "delete": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Access Management"],
        "summary": "Отзыв доступа по inviteId (SSO RRG)",
        "description": "Позволяет отозвать доступ у пользователя, который получил его с помощью ссылки-приглашения.",
        "operationId": "revokeAccessByInvite",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/AdvertiserId"
          },
          {
            "name": "inviteId",
            "in": "query",
            "required": true,
            "description": "Идентификатор приглашения",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Доступ успешно удалён"
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал или рекламодатель не найден"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/advertisers/{advertiserId}/owners/{ownerId}": {
      "put": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Access Management"],
        "summary": "Предоставление доступа (SSO Партнера)",
        "description": "Позволяет выдать пользователю доступ к личному кабинету рекламодателя.",
        "operationId": "grantAccess",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/AdvertiserId"
          },
          {
            "$ref": "#/components/parameters/OwnerId"
          }
        ],
        "responses": {
          "200": {
            "description": "Доступ пользователю успешно выдан"
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал или рекламодатель не найден"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      },
      "delete": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Access Management"],
        "summary": "Отзыв доступа (SSO Партнера)",
        "description": "Позволяет отозвать у пользователя доступ к личному кабинету рекламодателя.",
        "operationId": "revokeAccess",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/AdvertiserId"
          },
          {
            "$ref": "#/components/parameters/OwnerId"
          }
        ],
        "responses": {
          "200": {
            "description": "Доступ пользователю успешно удалён"
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал или рекламодатель не найден"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/advertisers/{advertiserId}:registerOrdServiceAgreement": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Advertisers"],
        "summary": "Регистрация ОРД-договора",
        "description": "Позволяет зарегистрировать прямой договор оказания рекламных услуг в ОРД.",
        "operationId": "registerOrdServiceAgreement",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/AdvertiserId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contractNumber",
                  "contractSignedAt",
                  "isOwnBrand",
                  "legalName",
                  "ogrn",
                  "tin"
                ],
                "properties": {
                  "contractNumber": {
                    "type": "string",
                    "description": "Номер договора"
                  },
                  "contractSignedAt": {
                    "type": "string",
                    "description": "Дата подписания договора (yyyy-MM-dd)",
                    "format": "date"
                  },
                  "isOwnBrand": {
                    "type": "boolean",
                    "description": "Признак собственного бренда"
                  },
                  "legalName": {
                    "type": "string",
                    "description": "Юридическое наименование рекламодателя"
                  },
                  "ogrn": {
                    "type": "string",
                    "description": "ОГРН рекламодателя"
                  },
                  "tin": {
                    "type": "string",
                    "description": "ИНН рекламодателя"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Договор успешно зарегистрирован"
          },
          "400": {
            "description": "Неверные входные данные"
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал или рекламодатель не найден"
          },
          "409": {
            "description": "Конфликт или ошибка конфигурации"
          },
          "502": {
            "description": "Ошибка на стороне ORD-провайдера"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/incomeTransactions": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Transactions"],
        "summary": "Получение списка транзакций",
        "description": "Позволяет получить список всех начислений и списаний денежных средств.",
        "operationId": "getIncomeTransactions",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/FromDate"
          },
          {
            "$ref": "#/components/parameters/ToDate"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Список транзакций успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "advertiserId": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "details": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "nextCursor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      },
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Transactions"],
        "summary": "Начисление и списание денежных средств",
        "description": "Позволяет начислить или списать денежные средства на ЛК рекламодателя в рамках портала.",
        "operationId": "createIncomeTransaction",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "advertiserId",
                  "amount",
                  "details",
                  "transactionId"
                ],
                "properties": {
                  "advertiserId": {
                    "type": "string",
                    "description": "Идентификатор рекламодателя"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Сумма транзакции"
                  },
                  "details": {
                    "type": "string",
                    "description": "Комментарий к транзакции"
                  },
                  "transactionId": {
                    "type": "string",
                    "description": "Уникальный идентификатор транзакции"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Транзакция успешно создана"
          },
          "400": {
            "description": "Сумма равна нулю"
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          },
          "404": {
            "description": "Портал или рекламодатель не найден"
          },
          "409": {
            "description": "Конфликт транзакции"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/invoices": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Invoices"],
        "summary": "Получение списка актов",
        "description": "Позволяет получить список актов по доходу вашей площадки от рекламодателей.",
        "operationId": "getInvoices",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "name": "finalizedAfter",
            "in": "query",
            "required": true,
            "description": "Фильтр по дате финализации (в формате ISO 8601)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Отчёты успешно получены",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "advertiserOrganizationName": {
                            "type": "string"
                          },
                          "advertiserOrganizationTin": {
                            "type": "string"
                          },
                          "contractNumber": {
                            "type": "string"
                          },
                          "contractSignedAt": {
                            "type": "string",
                            "format": "date"
                          },
                          "details": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "integer"
                                },
                                "data": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "key": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                },
                                "firstAt": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "lastAt": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "placement": {
                                  "type": "string"
                                },
                                "purpose": {
                                  "type": "string"
                                },
                                "sum": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "finalizedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "number": {
                            "type": "integer"
                          },
                          "period": {
                            "type": "object",
                            "properties": {
                              "startAt": {
                                "type": "string",
                                "format": "date"
                              },
                              "endAt": {
                                "type": "string",
                                "format": "date"
                              }
                            }
                          },
                          "serviceType": {
                            "type": "string"
                          },
                          "sum": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "nextCursor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    },
    "/portals/{portalId}/advertiserBalances": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": ["Balances"],
        "summary": "Получение баланса рекламодателей",
        "description": "Позволяет получить текущие балансы всех рекламодателей.",
        "operationId": "getAdvertiserBalances",
        "parameters": [
          {
            "$ref": "#/components/parameters/PortalId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Список балансов успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Уникальный идентификатор рекламодателя"
                          },
                          "balance": {
                            "type": "number",
                            "description": "Баланс рекламодателя"
                          }
                        }
                      }
                    },
                    "nextCursor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется авторизация"
          },
          "403": {
            "description": "Доступ запрещён"
          }
        },
        "servers": [
          {
            "url": "https://portals.smartplacement.io/s2s"
          }
        ]
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
