"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Документация Ozon Seller API
* По вопросам работы с Seller API обращайтесь в поддержку через личный кабинет. > [Инструкции по работе с маркетплейсом](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.FBSrFBSMarks = void 0;
const runtime = require("../runtime");
const index_1 = require("../models/index");
/**
*
*/
class FBSrFBSMarks extends runtime.BaseAPI {
/**
* Метод для получения информации по экземплярам товаров из отправления, переданных в методе [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6). Используйте метод для получения `exemplar_id`.
* Получить данные созданных экземпляров
*/
postingAPIFbsPostingProductExemplarCreateOrGetV6Raw(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 postingAPIFbsPostingProductExemplarCreateOrGetV6().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling postingAPIFbsPostingProductExemplarCreateOrGetV6().');
}
if (requestParameters['v6FbsPostingProductExemplarCreateOrGetV6Request'] == null) {
throw new runtime.RequiredError('v6FbsPostingProductExemplarCreateOrGetV6Request', 'Required parameter "v6FbsPostingProductExemplarCreateOrGetV6Request" was null or undefined when calling postingAPIFbsPostingProductExemplarCreateOrGetV6().');
}
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: `/v6/fbs/posting/product/exemplar/create-or-get`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V6FbsPostingProductExemplarCreateOrGetV6RequestToJSON)(requestParameters['v6FbsPostingProductExemplarCreateOrGetV6Request']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V6FbsPostingProductExemplarCreateOrGetV6ResponseFromJSON)(jsonValue));
});
}
/**
* Метод для получения информации по экземплярам товаров из отправления, переданных в методе [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6). Используйте метод для получения `exemplar_id`.
* Получить данные созданных экземпляров
*/
postingAPIFbsPostingProductExemplarCreateOrGetV6(clientId, apiKey, v6FbsPostingProductExemplarCreateOrGetV6Request, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postingAPIFbsPostingProductExemplarCreateOrGetV6Raw({ clientId: clientId, apiKey: apiKey, v6FbsPostingProductExemplarCreateOrGetV6Request: v6FbsPostingProductExemplarCreateOrGetV6Request }, initOverrides);
return yield response.value();
});
}
/**
* Асинхронный метод: - для проверки наличия экземпляров в обороте в системе «Честный ЗНАК»; - для сохранения данных экземпляров. Чтобы получить результаты проверок, используйте метод [/v5/fbs/posting/product/exemplar/status](#operation/PostingAPI_FbsPostingProductExemplarStatusV5). Для получения данных о созданных экземплярах, используйте метод [/v6/fbs/posting/product/exemplar/create-or-get](#operation/PostingAPI_FbsPostingProductExemplarCreateOrGetV6). Если у вас несколько одинаковых товаров в отправлении, укажите один `product_id` и массив `exemplars` для каждого товара из отправления. Всегда передавайте полный набор данных по экземплярам и продуктам. Например, в вашей системе 10 экземпляров. Вы передали их для проверки и сохранения. Потом добавили в своей системе ещё 60 экземпляров. При повторной передаче экземпляров для проверки и сохранения укажите все экземпляры: и старые, и только что добавленные. Код ответа 200 не гарантирует, что данные об экземплярах приняты. Он указывает, что создана задача для добавления информации. Чтобы проверить статус задачи, используйте метод [/v5/fbs/posting/product/exemplar/status](#operation/PostingAPI_FbsPostingProductExemplarStatusV5).
* Проверить и сохранить данные экземпляров
*/
postingAPIFbsPostingProductExemplarSetV6Raw(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 postingAPIFbsPostingProductExemplarSetV6().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling postingAPIFbsPostingProductExemplarSetV6().');
}
if (requestParameters['v6FbsPostingProductExemplarSetV6Request'] == null) {
throw new runtime.RequiredError('v6FbsPostingProductExemplarSetV6Request', 'Required parameter "v6FbsPostingProductExemplarSetV6Request" was null or undefined when calling postingAPIFbsPostingProductExemplarSetV6().');
}
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: `/v6/fbs/posting/product/exemplar/set`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V6FbsPostingProductExemplarSetV6RequestToJSON)(requestParameters['v6FbsPostingProductExemplarSetV6Request']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
* Асинхронный метод: - для проверки наличия экземпляров в обороте в системе «Честный ЗНАК»; - для сохранения данных экземпляров. Чтобы получить результаты проверок, используйте метод [/v5/fbs/posting/product/exemplar/status](#operation/PostingAPI_FbsPostingProductExemplarStatusV5). Для получения данных о созданных экземплярах, используйте метод [/v6/fbs/posting/product/exemplar/create-or-get](#operation/PostingAPI_FbsPostingProductExemplarCreateOrGetV6). Если у вас несколько одинаковых товаров в отправлении, укажите один `product_id` и массив `exemplars` для каждого товара из отправления. Всегда передавайте полный набор данных по экземплярам и продуктам. Например, в вашей системе 10 экземпляров. Вы передали их для проверки и сохранения. Потом добавили в своей системе ещё 60 экземпляров. При повторной передаче экземпляров для проверки и сохранения укажите все экземпляры: и старые, и только что добавленные. Код ответа 200 не гарантирует, что данные об экземплярах приняты. Он указывает, что создана задача для добавления информации. Чтобы проверить статус задачи, используйте метод [/v5/fbs/posting/product/exemplar/status](#operation/PostingAPI_FbsPostingProductExemplarStatusV5).
* Проверить и сохранить данные экземпляров
*/
postingAPIFbsPostingProductExemplarSetV6(clientId, apiKey, v6FbsPostingProductExemplarSetV6Request, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.postingAPIFbsPostingProductExemplarSetV6Raw({ clientId: clientId, apiKey: apiKey, v6FbsPostingProductExemplarSetV6Request: v6FbsPostingProductExemplarSetV6Request }, initOverrides);
});
}
/**
* Метод для получения статусов добавления экземпляров, переданных в методе [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6). Также возвращает данные по этим экземплярам.
* Получить статус добавления экземпляров
*/
postingAPIFbsPostingProductExemplarStatusV5Raw(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 postingAPIFbsPostingProductExemplarStatusV5().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling postingAPIFbsPostingProductExemplarStatusV5().');
}
if (requestParameters['v5FbsPostingProductExemplarStatusV5Request'] == null) {
throw new runtime.RequiredError('v5FbsPostingProductExemplarStatusV5Request', 'Required parameter "v5FbsPostingProductExemplarStatusV5Request" was null or undefined when calling postingAPIFbsPostingProductExemplarStatusV5().');
}
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/fbs/posting/product/exemplar/status`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V5FbsPostingProductExemplarStatusV5RequestToJSON)(requestParameters['v5FbsPostingProductExemplarStatusV5Request']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V5FbsPostingProductExemplarStatusV5ResponseFromJSON)(jsonValue));
});
}
/**
* Метод для получения статусов добавления экземпляров, переданных в методе [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6). Также возвращает данные по этим экземплярам.
* Получить статус добавления экземпляров
*/
postingAPIFbsPostingProductExemplarStatusV5(clientId, apiKey, v5FbsPostingProductExemplarStatusV5Request, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postingAPIFbsPostingProductExemplarStatusV5Raw({ clientId: clientId, apiKey: apiKey, v5FbsPostingProductExemplarStatusV5Request: v5FbsPostingProductExemplarStatusV5Request }, initOverrides);
return yield response.value();
});
}
/**
* Используйте метод после передачи информации по экземплярам методом [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6), чтобы сохранить обновлённые данные по экземплярам для отправлений в статусе «Ожидает отгрузки».
* Обновить данные экземпляров
*/
postingAPIFbsPostingProductExemplarUpdateRaw(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 postingAPIFbsPostingProductExemplarUpdate().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling postingAPIFbsPostingProductExemplarUpdate().');
}
if (requestParameters['v1FbsPostingProductExemplarUpdateRequest'] == null) {
throw new runtime.RequiredError('v1FbsPostingProductExemplarUpdateRequest', 'Required parameter "v1FbsPostingProductExemplarUpdateRequest" was null or undefined when calling postingAPIFbsPostingProductExemplarUpdate().');
}
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/fbs/posting/product/exemplar/update`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V1FbsPostingProductExemplarUpdateRequestToJSON)(requestParameters['v1FbsPostingProductExemplarUpdateRequest']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
* Используйте метод после передачи информации по экземплярам методом [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6), чтобы сохранить обновлённые данные по экземплярам для отправлений в статусе «Ожидает отгрузки».
* Обновить данные экземпляров
*/
postingAPIFbsPostingProductExemplarUpdate(clientId, apiKey, v1FbsPostingProductExemplarUpdateRequest, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.postingAPIFbsPostingProductExemplarUpdateRaw({ clientId: clientId, apiKey: apiKey, v1FbsPostingProductExemplarUpdateRequest: v1FbsPostingProductExemplarUpdateRequest }, initOverrides);
});
}
/**
* Метод для проверки кодов на соответствие требованиям системы «Честный ЗНАК» по количеству и составу символов, а также других маркировок. Если у вас нет номера грузовой таможенной декларации (ГТД), вы можете его не указывать.
* Валидация кодов маркировки
*/
postingAPIFbsPostingProductExemplarValidateV5Raw(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 postingAPIFbsPostingProductExemplarValidateV5().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling postingAPIFbsPostingProductExemplarValidateV5().');
}
if (requestParameters['v5FbsPostingProductExemplarValidateV5Request'] == null) {
throw new runtime.RequiredError('v5FbsPostingProductExemplarValidateV5Request', 'Required parameter "v5FbsPostingProductExemplarValidateV5Request" was null or undefined when calling postingAPIFbsPostingProductExemplarValidateV5().');
}
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/fbs/posting/product/exemplar/validate`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V5FbsPostingProductExemplarValidateV5RequestToJSON)(requestParameters['v5FbsPostingProductExemplarValidateV5Request']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V5FbsPostingProductExemplarValidateV5ResponseFromJSON)(jsonValue));
});
}
/**
* Метод для проверки кодов на соответствие требованиям системы «Честный ЗНАК» по количеству и составу символов, а также других маркировок. Если у вас нет номера грузовой таможенной декларации (ГТД), вы можете его не указывать.
* Валидация кодов маркировки
*/
postingAPIFbsPostingProductExemplarValidateV5(clientId, apiKey, v5FbsPostingProductExemplarValidateV5Request, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postingAPIFbsPostingProductExemplarValidateV5Raw({ clientId: clientId, apiKey: apiKey, v5FbsPostingProductExemplarValidateV5Request: v5FbsPostingProductExemplarValidateV5Request }, initOverrides);
return yield response.value();
});
}
/**
* Если в запросе передать часть товаров из отправления, метод разделит первичное отправление на две части. В первичном несобранном отправлении останется часть товаров, которую не передали в запросе. По умолчанию статус созданных отправлений `awaiting_packaging` — ожидает сборки. Статус изначального отправления изменится только после изменения статуса отправлений, на которые он разделился.
* Частичная сборка отправления (версия 4)
*/
postingAPIShipFbsPostingPackageRaw(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 postingAPIShipFbsPostingPackage().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling postingAPIShipFbsPostingPackage().');
}
if (requestParameters['v4FbsPostingShipPackageV4Request'] == null) {
throw new runtime.RequiredError('v4FbsPostingShipPackageV4Request', 'Required parameter "v4FbsPostingShipPackageV4Request" was null or undefined when calling postingAPIShipFbsPostingPackage().');
}
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/posting/fbs/ship/package`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V4FbsPostingShipPackageV4RequestToJSON)(requestParameters['v4FbsPostingShipPackageV4Request']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V4FbsPostingShipPackageV4ResponseFromJSON)(jsonValue));
});
}
/**
* Если в запросе передать часть товаров из отправления, метод разделит первичное отправление на две части. В первичном несобранном отправлении останется часть товаров, которую не передали в запросе. По умолчанию статус созданных отправлений `awaiting_packaging` — ожидает сборки. Статус изначального отправления изменится только после изменения статуса отправлений, на которые он разделился.
* Частичная сборка отправления (версия 4)
*/
postingAPIShipFbsPostingPackage(clientId, apiKey, v4FbsPostingShipPackageV4Request, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postingAPIShipFbsPostingPackageRaw({ clientId: clientId, apiKey: apiKey, v4FbsPostingShipPackageV4Request: v4FbsPostingShipPackageV4Request }, initOverrides);
return yield response.value();
});
}
/**
* Делит заказ на отправления и переводит его в статус `awaiting_deliver`. Каждый элемент в `packages` может содержать несколько элементов `products` или отправлений. Каждый элемент в `products` — это товар, включённый в данное отправление. Разделить заказ нужно, если: - товары не помещаются в одну упаковку, - товары нельзя сложить в одну упаковку. Чтобы разделить заказ, передайте в массиве `packages` несколько объектов. Пример запроса, когда заказ разделять не нужно: 2 товара будут в одном отправлении. ``` { \"packages\": [ { \"products\": [ { \"product_id\": 185479045, \"quantity\": 2 } ] } ], \"posting_number\": \"89491381-0072-1\" } ``` Пример запроса, когда заказ нужно разделить: каждый товар будет в отдельном отправлении. ``` { \"packages\": [ { \"products\": [ { \"product_id\": 185479045, \"quantity\": 1 } ] }, { \"products\": [ { \"product_id\": 185479045, \"quantity\": 1 } ] } ], \"posting_number\": \"89491381-0072-1\" } ``` Чтобы внести информацию по экземплярам, используйте метод [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6).
* Собрать заказ (версия 4)
*/
postingAPIShipFbsPostingV4Raw(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 postingAPIShipFbsPostingV4().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling postingAPIShipFbsPostingV4().');
}
if (requestParameters['fbsv4FbsPostingShipV4Request'] == null) {
throw new runtime.RequiredError('fbsv4FbsPostingShipV4Request', 'Required parameter "fbsv4FbsPostingShipV4Request" was null or undefined when calling postingAPIShipFbsPostingV4().');
}
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/posting/fbs/ship`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.Fbsv4FbsPostingShipV4RequestToJSON)(requestParameters['fbsv4FbsPostingShipV4Request']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.Fbsv4FbsPostingShipV4ResponseFromJSON)(jsonValue));
});
}
/**
* Делит заказ на отправления и переводит его в статус `awaiting_deliver`. Каждый элемент в `packages` может содержать несколько элементов `products` или отправлений. Каждый элемент в `products` — это товар, включённый в данное отправление. Разделить заказ нужно, если: - товары не помещаются в одну упаковку, - товары нельзя сложить в одну упаковку. Чтобы разделить заказ, передайте в массиве `packages` несколько объектов. Пример запроса, когда заказ разделять не нужно: 2 товара будут в одном отправлении. ``` { \"packages\": [ { \"products\": [ { \"product_id\": 185479045, \"quantity\": 2 } ] } ], \"posting_number\": \"89491381-0072-1\" } ``` Пример запроса, когда заказ нужно разделить: каждый товар будет в отдельном отправлении. ``` { \"packages\": [ { \"products\": [ { \"product_id\": 185479045, \"quantity\": 1 } ] }, { \"products\": [ { \"product_id\": 185479045, \"quantity\": 1 } ] } ], \"posting_number\": \"89491381-0072-1\" } ``` Чтобы внести информацию по экземплярам, используйте метод [/v6/fbs/posting/product/exemplar/set](#operation/PostingAPI_FbsPostingProductExemplarSetV6).
* Собрать заказ (версия 4)
*/
postingAPIShipFbsPostingV4(clientId, apiKey, fbsv4FbsPostingShipV4Request, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postingAPIShipFbsPostingV4Raw({ clientId: clientId, apiKey: apiKey, fbsv4FbsPostingShipV4Request: fbsv4FbsPostingShipV4Request }, initOverrides);
return yield response.value();
});
}
}
exports.FBSrFBSMarks = FBSrFBSMarks;