# Import items via JSON file

Imports items into the store from a JSON file via the specified URL. Refer to the documentation for more information about import from a JSON file.

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

## Path parameters:

  - `project_id` (integer, required)
    Project ID. You can find this parameter in your Publisher Account next to the project name and in the browser address bar when working with a project. The URL has the following format: https://publisher.xsolla.com//projects/.
    Example: 44056

## Request fields (application/json):

  - `connector_external_id` (string, required)
    A fixed value that specifies the type of operation for importing items.
    Enum: "import_items"

  - `file_url` (string, required)
    The URL of a file with data in JSON format. The file should be hosted on a storage service with public access. You can download the file template in Publisher Account in the [Store > Virtual Items > Catalog Management > Import Items (JSON)](https://publisher.xsolla.com/0/projects/0/storefront/import-export/import-items) section.
    Example: "https://my-bucket.s3.amazonaws.com/items.json"

  - `mode` (string)
    Import actions:

Possible values:
- create — Add new items.
- create_and_update — Add new items and update existing ones.
- sync — Add new, update existing, and disable missing items.
    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"


