# Импорт товаров из JSON-файла

Импортирует товары в магазин из JSON-файла по указанному URL-адресу. Подробная информация об импорте из JSON-файла приведена в документации.

Endpoint: POST /v1/projects/{project_id}/import/from_external_file
Version: 2.0.0
Security: basicAuth

## Path parameters:

  - `project_id` (integer, required)
    ID проекта. Вы можете найти этот параметр в Личном кабинете рядом с названием проекта, а также в адресной строке браузера при работе с проектом. URL-адрес имеет следующий формат: https://publisher.xsolla.com//projects/.
    Example: 44056

## Request fields (application/json):

  - `connector_external_id` (string, required)
    Фиксированное значение, определяющее тип операции для импорта товаров.
    Enum: "import_items"

  - `file_url` (string, required)
    URL-адрес файла с данными в формате JSON. Файл должен быть размещен на сервисе хранения данных в публичном доступе. Шаблон файла вы можете скачать в Личном кабинете в разделе [Store > Виртуальные предметы > Управление каталогом > Импортировать товары (JSON)](https://publisher.xsolla.com/0/projects/0/storefront/import-export/import-items).
    Example: "https://my-bucket.s3.amazonaws.com/items.json"

  - `mode` (string)
    Действия при импорте:

Возможные значения:
- create — Добавить новые товары.
- create_and_update — Добавить новые товары и обновить существующие.
- sync — Добавить новые товары, обновить существующие и отключить отсутствующие.
    Enum: "create", "create_and_update", "sync"

## Response 201 fields (application/json):

  - `import_id` (string)
    Import operation ID. If you encounter difficulties importing the JSON file, report this ID to your Customer Success Manager or send an email to csm@xsolla.com.
    Example: "af9f3638a16e11ef880da2cd677d2d24"

## Response 401 fields (application/json):

  - `statusCode` (integer)
    Example: 401

  - `errorCode` (integer)
    Example: 1020

  - `errorMessage` (string)
    Example: "[0401-1020]: Error in Authentication method occurred"

## Response 422 fields (application/json):

  - `errorCode` (integer)
    Example: 1803

  - `statusCode` (integer)
    Example: 422

  - `errorMessage` (string)
    Example: "[0410-1803]: File content-type doesn't allowed. Allowed content types: application/json; current content type: text/plain"

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"


