493 lines
38 KiB
JavaScript
493 lines
38 KiB
JavaScript
"use strict";
|
||
/* tslint:disable */
|
||
/* eslint-disable */
|
||
/**
|
||
* Документация Ozon Seller API
|
||
* По вопросам работы с Seller API обращайтесь в поддержку через личный кабинет. <aside class=\"warning\">Обновляем корневой TLS/SSL-сертификат GlobalSign — вместо него будем использовать <a href=\"https://app.harica.gr/\">HARICA</a>.<br><a href=\"https://dev.ozon.ru/news/775-Izmeneniia-v-Ozon-API-migratsiia-kornevogo-sertifikata-UTs-Ozon/\">Подробнее о переходе на HARICA на платформе разработчиков Ozon for dev</a></aside> > [Инструкции по работе с маркетплейсом](https://seller-edu.ozon.ru) > [Информационная платформа и сообщество разработчиков Ozon for dev](https://dev.ozon.ru/)
|
||
*
|
||
* The version of the OpenAPI document: 2.1
|
||
*
|
||
*
|
||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||
* https://openapi-generator.tech
|
||
* Do not edit the class manually.
|
||
*/
|
||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
return new (P || (P = Promise))(function (resolve, reject) {
|
||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
});
|
||
};
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.PricesStocksAPI = void 0;
|
||
const runtime = require("../runtime");
|
||
const index_1 = require("../models/index");
|
||
/**
|
||
*
|
||
*/
|
||
class PricesStocksAPI extends runtime.BaseAPI {
|
||
/**
|
||
* Получить статус установленного таймера
|
||
*/
|
||
productAPIActionTimerStatusRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIActionTimerStatus().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIActionTimerStatus().');
|
||
}
|
||
if (requestParameters['v1ProductActionTimerStatusRequest'] == null) {
|
||
throw new runtime.RequiredError('v1ProductActionTimerStatusRequest', 'Required parameter "v1ProductActionTimerStatusRequest" was null or undefined when calling productAPIActionTimerStatus().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v1/product/action/timer/status`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.V1ProductActionTimerStatusRequestToJSON)(requestParameters['v1ProductActionTimerStatusRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V1ProductActionTimerStatusResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Получить статус установленного таймера
|
||
*/
|
||
productAPIActionTimerStatus(clientId, apiKey, v1ProductActionTimerStatusRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIActionTimerStatusRaw({ clientId: clientId, apiKey: apiKey, v1ProductActionTimerStatusRequest: v1ProductActionTimerStatusRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* Минимальная цена действует 30 дней после установки. После этого настройка выключается. Вы можете продлить её: вызовите метод повторно и укажите `product_ids`.
|
||
* Обновление таймера актуальности минимальной цены
|
||
*/
|
||
productAPIActionTimerUpdateRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIActionTimerUpdate().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIActionTimerUpdate().');
|
||
}
|
||
if (requestParameters['v1ProductActionTimerUpdateRequest'] == null) {
|
||
throw new runtime.RequiredError('v1ProductActionTimerUpdateRequest', 'Required parameter "v1ProductActionTimerUpdateRequest" was null or undefined when calling productAPIActionTimerUpdate().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v1/product/action/timer/update`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.V1ProductActionTimerUpdateRequestToJSON)(requestParameters['v1ProductActionTimerUpdateRequest']),
|
||
}, initOverrides);
|
||
return new runtime.VoidApiResponse(response);
|
||
});
|
||
}
|
||
/**
|
||
* Минимальная цена действует 30 дней после установки. После этого настройка выключается. Вы можете продлить её: вызовите метод повторно и укажите `product_ids`.
|
||
* Обновление таймера актуальности минимальной цены
|
||
*/
|
||
productAPIActionTimerUpdate(clientId, apiKey, v1ProductActionTimerUpdateRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
yield this.productAPIActionTimerUpdateRaw({ clientId: clientId, apiKey: apiKey, v1ProductActionTimerUpdateRequest: v1ProductActionTimerUpdateRequest }, initOverrides);
|
||
});
|
||
}
|
||
/**
|
||
* Метод для получения информации о состоянии и дефектах уценённого товара по его SKU. Работает только с уценёнными товарами по схеме FBO. Также метод возвращает SKU основного товара.
|
||
* Узнать информацию об уценке и основном товаре по SKU уценённого товара
|
||
*/
|
||
productAPIGetProductInfoDiscountedRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIGetProductInfoDiscounted().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIGetProductInfoDiscounted().');
|
||
}
|
||
if (requestParameters['v1GetProductInfoDiscountedRequest'] == null) {
|
||
throw new runtime.RequiredError('v1GetProductInfoDiscountedRequest', 'Required parameter "v1GetProductInfoDiscountedRequest" was null or undefined when calling productAPIGetProductInfoDiscounted().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v1/product/info/discounted`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.V1GetProductInfoDiscountedRequestToJSON)(requestParameters['v1GetProductInfoDiscountedRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V1GetProductInfoDiscountedResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Метод для получения информации о состоянии и дефектах уценённого товара по его SKU. Работает только с уценёнными товарами по схеме FBO. Также метод возвращает SKU основного товара.
|
||
* Узнать информацию об уценке и основном товаре по SKU уценённого товара
|
||
*/
|
||
productAPIGetProductInfoDiscounted(clientId, apiKey, v1GetProductInfoDiscountedRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIGetProductInfoDiscountedRaw({ clientId: clientId, apiKey: apiKey, v1GetProductInfoDiscountedRequest: v1GetProductInfoDiscountedRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* <aside class=\"warning\"> Вы можете посмотреть историю обновления цен только в личном кабинете продавца.<br> <a href=\"https://seller-edu.ozon.ru/libra/ceny-i-akcii/rabota-s-cenami/price-control#как-посмотреть-историю-обновления-цен\">Подробнее об истории обновления цен в Базе знаний продавца</a> </aside>
|
||
* Получить информацию о цене товара
|
||
*/
|
||
productAPIGetProductInfoPricesRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIGetProductInfoPrices().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIGetProductInfoPrices().');
|
||
}
|
||
if (requestParameters['productv5GetProductInfoPricesV5Request'] == null) {
|
||
throw new runtime.RequiredError('productv5GetProductInfoPricesV5Request', 'Required parameter "productv5GetProductInfoPricesV5Request" was null or undefined when calling productAPIGetProductInfoPrices().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v5/product/info/prices`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.Productv5GetProductInfoPricesV5RequestToJSON)(requestParameters['productv5GetProductInfoPricesV5Request']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.Productv5GetProductInfoPricesV5ResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* <aside class=\"warning\"> Вы можете посмотреть историю обновления цен только в личном кабинете продавца.<br> <a href=\"https://seller-edu.ozon.ru/libra/ceny-i-akcii/rabota-s-cenami/price-control#как-посмотреть-историю-обновления-цен\">Подробнее об истории обновления цен в Базе знаний продавца</a> </aside>
|
||
* Получить информацию о цене товара
|
||
*/
|
||
productAPIGetProductInfoPrices(clientId, apiKey, productv5GetProductInfoPricesV5Request, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIGetProductInfoPricesRaw({ clientId: clientId, apiKey: apiKey, productv5GetProductInfoPricesV5Request: productv5GetProductInfoPricesV5Request }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* Возвращает информацию о ĸоличестве товаров по схемам FBS, rFBS и FBP: - сĸольĸо единиц есть в наличии, - сĸольĸо зарезервировано поĸупателями. Чтобы получить информацию об остатках по схеме FBO, используйте метод [/v1/analytics/stocks](#operation/AnalyticsAPI_AnalyticsStocks).
|
||
* Информация о количестве товаров
|
||
*/
|
||
productAPIGetProductInfoStocksRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIGetProductInfoStocks().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIGetProductInfoStocks().');
|
||
}
|
||
if (requestParameters['v4GetProductInfoStocksRequest'] == null) {
|
||
throw new runtime.RequiredError('v4GetProductInfoStocksRequest', 'Required parameter "v4GetProductInfoStocksRequest" was null or undefined when calling productAPIGetProductInfoStocks().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v4/product/info/stocks`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.V4GetProductInfoStocksRequestToJSON)(requestParameters['v4GetProductInfoStocksRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V4GetProductInfoStocksResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Возвращает информацию о ĸоличестве товаров по схемам FBS, rFBS и FBP: - сĸольĸо единиц есть в наличии, - сĸольĸо зарезервировано поĸупателями. Чтобы получить информацию об остатках по схеме FBO, используйте метод [/v1/analytics/stocks](#operation/AnalyticsAPI_AnalyticsStocks).
|
||
* Информация о количестве товаров
|
||
*/
|
||
productAPIGetProductInfoStocks(clientId, apiKey, v4GetProductInfoStocksRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIGetProductInfoStocksRaw({ clientId: clientId, apiKey: apiKey, v4GetProductInfoStocksRequest: v4GetProductInfoStocksRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* Получить информацию об остатках на складах продавца
|
||
*/
|
||
productAPIGetProductInfoStocksByWarehouseFbsV2Raw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIGetProductInfoStocksByWarehouseFbsV2().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIGetProductInfoStocksByWarehouseFbsV2().');
|
||
}
|
||
if (requestParameters['v2GetProductInfoStocksByWarehouseFbsRequestV2'] == null) {
|
||
throw new runtime.RequiredError('v2GetProductInfoStocksByWarehouseFbsRequestV2', 'Required parameter "v2GetProductInfoStocksByWarehouseFbsRequestV2" was null or undefined when calling productAPIGetProductInfoStocksByWarehouseFbsV2().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v2/product/info/stocks-by-warehouse/fbs`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.V2GetProductInfoStocksByWarehouseFbsRequestV2ToJSON)(requestParameters['v2GetProductInfoStocksByWarehouseFbsRequestV2']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V2GetProductInfoStocksByWarehouseFbsResponseV2FromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Получить информацию об остатках на складах продавца
|
||
*/
|
||
productAPIGetProductInfoStocksByWarehouseFbsV2(clientId, apiKey, v2GetProductInfoStocksByWarehouseFbsRequestV2, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIGetProductInfoStocksByWarehouseFbsV2Raw({ clientId: clientId, apiKey: apiKey, v2GetProductInfoStocksByWarehouseFbsRequestV2: v2GetProductInfoStocksByWarehouseFbsRequestV2 }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* Позволяет изменить цену одного или нескольких товаров. Цену каждого товара можно обновлять не больше 10 раз в час. Чтобы сбросить `old_price`, поставьте `0` у этого параметра. Если у товара установлена минимальная цена и включено автоприменение в акции, отключите его и обновите минимальную цену. Иначе вернётся ошибка `action_price_enabled_min_price_missing`. Если запрос содержит оба параметра — `offer_id` и `product_id`, изменения применятся к товару с `offer_id`. Для избежания неоднозначности используйте только один из параметров.
|
||
* Обновить цену
|
||
*/
|
||
productAPIImportProductsPricesRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIImportProductsPrices().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIImportProductsPrices().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v1/product/import/prices`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.ProductImportProductsPricesRequestToJSON)(requestParameters['productImportProductsPricesRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProductImportProductsPricesResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Позволяет изменить цену одного или нескольких товаров. Цену каждого товара можно обновлять не больше 10 раз в час. Чтобы сбросить `old_price`, поставьте `0` у этого параметра. Если у товара установлена минимальная цена и включено автоприменение в акции, отключите его и обновите минимальную цену. Иначе вернётся ошибка `action_price_enabled_min_price_missing`. Если запрос содержит оба параметра — `offer_id` и `product_id`, изменения применятся к товару с `offer_id`. Для избежания неоднозначности используйте только один из параметров.
|
||
* Обновить цену
|
||
*/
|
||
productAPIImportProductsPrices(clientId, apiKey, productImportProductsPricesRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIImportProductsPricesRaw({ clientId: clientId, apiKey: apiKey, productImportProductsPricesRequest: productImportProductsPricesRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* <aside class=\"warning\"> Метод устаревает и будет отключён 7 апреля 2026 года. Переключитесь на <a href=\"#operation/ProductAPI_GetProductInfoStocksByWarehouseFbsV2\">/v2/product/info/stocks-by-warehouse/fbs</a>. </aside> Передайте в запросе `offer_id` или `sku`. Если укажете оба, будет использован только `sku`.
|
||
* Информация об остатках на складах продавца (FBS и rFBS)
|
||
*/
|
||
productAPIProductStocksByWarehouseFbsRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIProductStocksByWarehouseFbs().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIProductStocksByWarehouseFbs().');
|
||
}
|
||
if (requestParameters['productsv1GetProductInfoStocksByWarehouseFbsRequest'] == null) {
|
||
throw new runtime.RequiredError('productsv1GetProductInfoStocksByWarehouseFbsRequest', 'Required parameter "productsv1GetProductInfoStocksByWarehouseFbsRequest" was null or undefined when calling productAPIProductStocksByWarehouseFbs().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v1/product/info/stocks-by-warehouse/fbs`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.Productsv1GetProductInfoStocksByWarehouseFbsRequestToJSON)(requestParameters['productsv1GetProductInfoStocksByWarehouseFbsRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.Productsv1GetProductInfoStocksByWarehouseFbsResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* <aside class=\"warning\"> Метод устаревает и будет отключён 7 апреля 2026 года. Переключитесь на <a href=\"#operation/ProductAPI_GetProductInfoStocksByWarehouseFbsV2\">/v2/product/info/stocks-by-warehouse/fbs</a>. </aside> Передайте в запросе `offer_id` или `sku`. Если укажете оба, будет использован только `sku`.
|
||
* Информация об остатках на складах продавца (FBS и rFBS)
|
||
*/
|
||
productAPIProductStocksByWarehouseFbs(clientId, apiKey, productsv1GetProductInfoStocksByWarehouseFbsRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIProductStocksByWarehouseFbsRaw({ clientId: clientId, apiKey: apiKey, productsv1GetProductInfoStocksByWarehouseFbsRequest: productsv1GetProductInfoStocksByWarehouseFbsRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* Метод для установки размера скидки на уценённые товары, продающиеся по схеме FBS.
|
||
* Установить скидку на уценённый товар
|
||
*/
|
||
productAPIProductUpdateDiscountRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIProductUpdateDiscount().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIProductUpdateDiscount().');
|
||
}
|
||
if (requestParameters['v1ProductUpdateDiscountRequest'] == null) {
|
||
throw new runtime.RequiredError('v1ProductUpdateDiscountRequest', 'Required parameter "v1ProductUpdateDiscountRequest" was null or undefined when calling productAPIProductUpdateDiscount().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v1/product/update/discount`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.V1ProductUpdateDiscountRequestToJSON)(requestParameters['v1ProductUpdateDiscountRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V1ProductUpdateDiscountResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Метод для установки размера скидки на уценённые товары, продающиеся по схеме FBS.
|
||
* Установить скидку на уценённый товар
|
||
*/
|
||
productAPIProductUpdateDiscount(clientId, apiKey, v1ProductUpdateDiscountRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIProductUpdateDiscountRaw({ clientId: clientId, apiKey: apiKey, v1ProductUpdateDiscountRequest: v1ProductUpdateDiscountRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* Позволяет изменить информацию о количестве товара в наличии. <aside class=\"warning\"> Переданный остаток — количество товара в наличии без учёта зарезервированных товаров. Перед обновлением остатков проверьте количество зарезервированных товаров с помощью метода <a href=\"#operation/ProductAPI_GetProductInfoStocksByWarehouseFbsV2\">/v2/product/info/stocks-by-warehouse/fbs</a>. </aside> За один запрос можно изменить наличие для 100 пар товар-склад. С одного аккаунта продавца можно отправить до 80 запросов в минуту. <aside class=\"warning\">Обновлять остатки у одной пары товар-склад можно только 1 раз в 30 секунд, иначе в параметре <code>result.errors</code> в ответе будет ошибка <code>TOO_MANY_REQUESTS</code>.</aside> Вы можете задать наличие товара только после того, как его статус сменится на `price_sent`. Остатки крупногабаритных товаров можно обновлять только на предназначенных для них складах. Если запрос содержит оба параметра — `offer_id` и `product_id`, изменения применятся к товару с `offer_id`. Для избежания неоднозначности используйте только один из параметров.
|
||
* Обновить количество товаров на складах
|
||
*/
|
||
productAPIProductsStocksV2Raw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
if (requestParameters['clientId'] == null) {
|
||
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling productAPIProductsStocksV2().');
|
||
}
|
||
if (requestParameters['apiKey'] == null) {
|
||
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling productAPIProductsStocksV2().');
|
||
}
|
||
if (requestParameters['productv2ProductsStocksRequest'] == null) {
|
||
throw new runtime.RequiredError('productv2ProductsStocksRequest', 'Required parameter "productv2ProductsStocksRequest" was null or undefined when calling productAPIProductsStocksV2().');
|
||
}
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
if (requestParameters['clientId'] != null) {
|
||
headerParameters['Client-Id'] = String(requestParameters['clientId']);
|
||
}
|
||
if (requestParameters['apiKey'] != null) {
|
||
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
|
||
}
|
||
const response = yield this.request({
|
||
path: `/v2/products/stocks`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.Productv2ProductsStocksRequestToJSON)(requestParameters['productv2ProductsStocksRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.Productv2ProductsStocksResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Позволяет изменить информацию о количестве товара в наличии. <aside class=\"warning\"> Переданный остаток — количество товара в наличии без учёта зарезервированных товаров. Перед обновлением остатков проверьте количество зарезервированных товаров с помощью метода <a href=\"#operation/ProductAPI_GetProductInfoStocksByWarehouseFbsV2\">/v2/product/info/stocks-by-warehouse/fbs</a>. </aside> За один запрос можно изменить наличие для 100 пар товар-склад. С одного аккаунта продавца можно отправить до 80 запросов в минуту. <aside class=\"warning\">Обновлять остатки у одной пары товар-склад можно только 1 раз в 30 секунд, иначе в параметре <code>result.errors</code> в ответе будет ошибка <code>TOO_MANY_REQUESTS</code>.</aside> Вы можете задать наличие товара только после того, как его статус сменится на `price_sent`. Остатки крупногабаритных товаров можно обновлять только на предназначенных для них складах. Если запрос содержит оба параметра — `offer_id` и `product_id`, изменения применятся к товару с `offer_id`. Для избежания неоднозначности используйте только один из параметров.
|
||
* Обновить количество товаров на складах
|
||
*/
|
||
productAPIProductsStocksV2(clientId, apiKey, productv2ProductsStocksRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productAPIProductsStocksV2Raw({ clientId: clientId, apiKey: apiKey, productv2ProductsStocksRequest: productv2ProductsStocksRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
/**
|
||
* Получить информацию по остаткам на складе FBS и rFBS
|
||
*/
|
||
productInfoWarehouseStocksRaw(requestParameters, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const queryParameters = {};
|
||
const headerParameters = {};
|
||
headerParameters['Content-Type'] = 'application/json';
|
||
const response = yield this.request({
|
||
path: `/v1/product/info/warehouse/stocks`,
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: (0, index_1.V1ProductInfoWarehouseStocksRequestToJSON)(requestParameters['v1ProductInfoWarehouseStocksRequest']),
|
||
}, initOverrides);
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V1ProductInfoWarehouseStocksResponseFromJSON)(jsonValue));
|
||
});
|
||
}
|
||
/**
|
||
* Получить информацию по остаткам на складе FBS и rFBS
|
||
*/
|
||
productInfoWarehouseStocks(v1ProductInfoWarehouseStocksRequest, initOverrides) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
const response = yield this.productInfoWarehouseStocksRaw({ v1ProductInfoWarehouseStocksRequest: v1ProductInfoWarehouseStocksRequest }, initOverrides);
|
||
return yield response.value();
|
||
});
|
||
}
|
||
}
|
||
exports.PricesStocksAPI = PricesStocksAPI;
|