> ## Documentation Index
> Fetch the complete documentation index at: https://doc-neteven.mylectra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Product file import

## Definition

Product content relates to information linked to SKU's, which includes product codes, measurements, classification, image urls, condition, language-dependent attributes. This type of data is required for product creation on Marketplaces.

Product file import is way to submit a catalog file to Neteven through the Merchant API. The product content is then imported into Neteven's inventory, **as per the configuration and mapping of the product import feed called upon** (see the Introduction page for more information).

> [!NOTE]
>
> * This method can be used to create new products or update existing products
> * The content included in the files submitted should always follow the structure defined with Neteven during the integration phase.
> * Any addition to the file (new column / field) should be done AFTER letting Neteven know, otherwise the corresponding feed mapping will NOT be updated by your Neteven contact and content sent will be ignored.
> * The detail of the mapping defined in the corresponding feed is NOT readable via the API.
> * The API is storing files and passing them to the feed manager for content import. Therefore, this is an **asynchronous process** (the integration of product content into Neteven is managed by a downstream system).
> * Files submitted are only accepted as txt, csv or XML.

## Best Practices

Please be aware of the following best practices when using these endpoints :

> [!TIP]
>
> * Only submit a file when necessary: when there was a change in product content or new products.
> * Only push relevant products (exclude from your file unnecessary items and content)
> * Take into account splitting large files into smaller ones, and possibly sending them over several subsequent API calls
> * Anticipate the need for *ad hoc* full refresh (avoid sending a full refresh on a daily basis, but allow for on-demand full catalogue update)

## Endpoints

#### Submit a file:

| `POST` | `/merchant/products/import-file` |
| - | - |
| **Description** | Submit a file to import product content into Neteven. |
| **Required scope** | `product_manager` |
| **Request body** | submit one or several files as **multipart/form-data** |
| **Files format and restrictions** | Accepted formats are csv, txt and xml. **maximum 10 mb per call.** |
| **Query parameter** | the `feed_id` is the identifier of the feed entity which will process the files submitted. It is unique and never-evolving. It will be provided by your Neteven contact once the feed is configured. |
| **Returns** | - If every file submitted is valid, returns the `process-id` which corresponds to the feed triggered to import them (import is an asynchronous process . - otherwise, returns an error. |

**example:**

```bash theme={null}
curl --request POST \
  --url 'https://api-neteven.mylectra.com/merchant/products/import-file?feed_id=1234'
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer $MYTOKEN' \
  --header 'content-type: multipart/form-data' \
  --form 'files=@ $MyPath\my_catalog_file.csv'
```

***

#### Verify the status of a given import (process-id):

| `GET` | `/merchant/products/imports/``{process-id}` |
| - | - |
| **Description** | Returns the status of a given file import, using the process-id to identify it. |
| **Required scope** | `product_reader` |
| **Path parameter** | the `process-id` is a temporary entity, which is directly tied to the execution of a given feed. Once the process is done, its `process-id` will disappear within a few days. |
| **Returns** | the status of the queries process-id. |

***

**Example:**

```bash theme={null}
curl --request GET \

  --url https://api-neteven.mylectra.com/merchant/products/imports/815115020\
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer $MYTOKEN' \
  --header 'Content-Type: application/json'
```

**response :**

```json 200 OK Reponse theme={null}
{
 "data": {
  "process": {
   "process_id": 815115020,
   "process_label": "PRODUCT IMPORT",
   "message": "The import process is still running",
   "date_start": "2022-09-08T13:30:16",
   "date_end": "2022-09-08T15:26:23",
   "state": "PENDING"
  }
 },
 "metadata": {
  "number_of_results": 1,
  "api_version": 1,
  "api_version_expiration_date": "2022-12-31"
 }
}
```

***

## API reference

*more information on parameters, responses and content in the* [API Reference](https://doc-neteven.mylectra.com/merchant-api/api-reference.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.