Import Products
POSThttps://euwest.api.elasticpath.com/pcm/products/import
You can use the Product Import API to:
Add new products, including:
- main image files. See Importing Main Image Files.
- custom data. See Importing custom data.
- Make bulk updates to existing products.
You cannot use product import to:
- Delete existing products.
- Import product bundles.
The Product Import API uses a Comma Separated Values (CSV) file to import products, main image files and custom extension data. Each row in a .csv file represents a product you want to create/update. See an example file.
Each file can have 50,000 rows, including the header. If a CSV file exceeds 50,000 rows, an error is displayed, and the products are not imported. A CSV file must not be larger than 50 megabytes. If a CSV file is larger than 50 megabytes, a 503 client read
error is displayed.
If you want to create/update more than 50,000 products or your CSV file is larger than 50 megabytes, you must have a separate CSV file and import each CSV file one at a time.
See Characteristics of CSV Files.
Request
- multipart/form-data
Body
The file you want to upload. Ensure that the file format is Comma Separated Values (CSV).
Responses
- 201
- 400
- 422
- 500
Import started
- application/json
- Schema
- Example (from schema)
- pending
Schema
data object
{
"data": {
"id": "string",
"type": "pim-job",
"attributes": {
"started_at": "2020-09-22T09:00:00",
"completed_at": "2020-09-22T09:00:00",
"created_at": "2020-09-22T09:00:00",
"updated_at": "2020-09-22T09:00:00",
"type": "child-products",
"status": "pending"
},
"meta": {
"x_request_id": "string",
"copied_from": "string",
"hierarchy_id": "string",
"file_locations": [
"string"
],
"filter": "string"
}
}
}
Successful Job
{
"data": {
"type": "pim-job",
"id": "7e1b9ba1-c844-4556-9b16-4ae3f0988b0f",
"attributes": {
"completed_at": null,
"created_at": "2024-01-05T15:27:23.161Z",
"started_at": null,
"status": "pending",
"type": "product-import",
"updated_at": "2024-01-05T15:27:23.161Z"
},
"meta": {
"x_request_id": "fad8c5c0-9546-4e0c-b68e-8a2d809891e5"
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- bad-request
Schema
errors undefined[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Bad Request",
"detail": "Could not parse the supplied filter",
"status": "400"
}
]
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- failed-validation
Schema
errors undefined[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Failed Validation",
"status": "422",
"detail": "<XYZ> can not be empty"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
errors undefined[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"status": "500",
"title": "Internal Server Error",
"detail": "There was an internal server error, you can report with your request id.",
"request_id": "635da56d-75a1-43cd-b696-7ab119756b3a"
}
]
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://euwest.api.elasticpath.com/pcm/products/import' \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'