Imports
Imports allow you to load large volumes of products into your catalog from CSV, Excel, or JSON files.
POST/imports
Create an import
Starts a new import job. Upload a file and specify the format.
Body parameters (multipart/form-data)
- Name
file- Type
- file
- Description
The import file (CSV, XLSX, or JSON).
- Name
format- Type
- string
- Description
File format:
csv,xlsx, orjson(auto-detected if omitted).
- Name
mapping- Type
- object
- Description
Column mapping object. Maps your file columns to product fields.
- Name
update_existing- Type
- boolean
- Description
If
true, existing products (matched by EAN) are updated. Default:true.
Request
POST
/importscurl -X POST https://api.productsmanager.app/api/v1/imports \
-H "Authorization: Bearer {api_key}" \
-F "file=@catalog.csv" \
-F "format=csv" \
-F 'mapping={"EAN":"ean","Titre":"title","Prix":"price"}'
Response
{
"id": "imp_01HQ...",
"status": "pending",
"format": "csv",
"total_rows": 0,
"created_at": "2024-03-15T09:00:00Z"
}
GET/imports/{id}
Get import status
Returns the current status and progress of an import job.
Path parameters
- Name
id- Type
- string
- Description
The import job ID.
Import statuses
| Status | Description |
|---|---|
pending | Queued, not yet started |
processing | Currently importing |
completed | Finished successfully |
completed_with_errors | Finished but some rows failed |
failed | Import aborted due to a critical error |
Request
GET
/imports/{id}curl https://api.productsmanager.app/api/v1/imports/imp_01HQ... \
-H "Authorization: Bearer {api_key}"
Response
{
"id": "imp_01HQ...",
"status": "completed",
"total_rows": 1250,
"processed_rows": 1250,
"created_rows": 980,
"updated_rows": 265,
"error_rows": 5,
"created_at": "2024-03-15T09:00:00Z",
"completed_at": "2024-03-15T09:02:34Z"
}
GET/imports/{id}/errors
Get import errors
Returns the list of rows that failed during the import, with error details.
Path parameters
- Name
id- Type
- string
- Description
The import job ID.
Request
GET
/imports/{id}/errorscurl https://api.productsmanager.app/api/v1/imports/imp_01HQ.../errors \
-H "Authorization: Bearer {api_key}"
Response
{
"data": [
{
"row": 42,
"ean": "invalid-ean",
"error": "validation_error",
"message": "Invalid EAN format."
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 5
}
}