You can make bulk updates to products in PXM using the Import a product endpoint, using a Comma Separated Values (CSV) file.
- You can change existing product fields, including templates/flow fields. The entry in the
.csvfile must have a unique
external_refthat matches the
external_refof the existing product you want to update.
- You can add new products. For new products that you want to add, the entry in the
.csvfile must have a unique
external_refthat does not match any existing PXM products.
You cannot delete existing products using the Import a product endpoint.
If you have multiple entries in the
.csv file with the same
external_ref, the product is updated in the order of the entries in the
.csv file. This means the latest product update corresponds to the latest entry for the product in the
.csv file must be comma-separated and header-based. The following table describes the headers that are supported.
|external_ref||Optional||Specifies the unique attribute associated with the product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters.|
|name||Required||Specifies the name of a product.|
|slug||Required||Specifies a unique slug identifier for a product.|
|description||Required||Specifies a unique slug identifier for a product. You can include quotes in your product description, if you want to emphasize a word, for example. To do this, put quotes around the product description. For example, "This product description describes my "product" and the product "version"."|
|commodity_type||Required||Specifies a unique slug identifier for a product.|
|status||Required||Specifies the status of a product. Status can be either |
|sku||Optional||Specifies a unique sku identifier for a product.|
|mpn||Optional||Specifies the manufacturer part number of a product.|
|upc_ean||Optional||Specifies a unique universal product code for a product.|
|main_image_id||Optional||Specifies a unique ID of a main image file for a product.|
Here is an example of a CSV file that could be used to bulk update PXM products.
- All product attributes are supported.
- You can include a
main_image_idfor your products for images that are already uploaded to Elastic Path Commerce Cloud. See Using Main Image Files.
- Header names can be any order that you want.
- Header attributes must be the same as the product attributes.
- You cannot import product bundles.
A CSV file cannot have more than 50,000 rows, including the header. If a CSV file exceeds 50,000 rows, an error is displayed, and the products are not updated.
Product updates are an asynchronous operation. When you upload the CSV file, a job is created to import the products and create the product entries. When the job is complete, the update operation is complete, and you can use the products in the store. You can see the status of your product using the Job API. See Get a Job.
Using Main Image Files
You can use the main images that you have previously uploaded to Elastic Path Commerce Cloud and assign them to your products when importing products to Elastic Path Commerce Cloud. You can do this by adding a
main_image_id header to your
.csv file. The ID you provide in
main_image_id is the ID of a file that has already been uploaded to Elastic Path Commerce Cloud using create a file.
In Commerce Manager, you cannot add main image files without first creating a product. You must use create a file to upload media without creating products.
Updating Custom Data (Flows)
You can also update custom extension data in the CSV file by specifying the flow
ID and the field
slug in the
template:<flowID>:<fieldSlug> format. Ensure that extension data:
- Starts with
- The parameters are separated with a colon.
- The second parameter is the flow ID.
- The third parameter is the field slug.
For example, for a flow with ID
82c10a02-1851-4992-8ecb-d44f2782d09b and a field with the slug
condition, the extension data for the product import is: