Elastic Path Product Export API
```mdx-code-block import ProductExport from '/docs/partials/pxm/import/export.mdx'; ``` ### Characteristics of Exporting Products - Product exports are an asynchronous operation. When you send a request to the Export API, it triggers an asynchronous job to build the `.csv` file containing the product entries. - Jobs are processed one at a time. You can continue to send product export requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. See [**Jobs**](/docs/api/pxm/products/jobs). - The Export API response includes a job resource. In the response, you can verify the job status; if the status is successful, the response includes a link to the location where the `.csv` file is stored. See [**Product Export CSV File**](#product-export-csv-file). A single CSV file contains 10,000 rows, excluding the header. If you are exporting 50,000 products, the job endpoint response contains links to five `.csv` files; each `.csv` file including 10,000 products. - You might have specified custom extension data in a `.csv` file when you imported the products. These modifications are all exported. So, when you send a request to the Export API, the `.csv` file, included in the Job endpoint response, reflects any changes that you have made. - You cannot export product bundles. ### Product Export CSV File The Product Export API generates a Comma Separated Values (CSV) file that you can use to import/update products, main image files, and custom extension data. The `.csv` file is: - Comma-separated. - Header-based. - Header attributes must be the same as the product attributes. - Header names can be in any order. - Each row after the first line represents a single product. The following table describes the headers that are supported. | Header | Required | Description | |:---------------------------------|:---------|:-----------------------------------------------------| | id | Optional | A unique product ID that is generated when you create the product. The `id` is used to look up products in the `.csv` file and matches them to the products in your storefront that you want to update. | | external_ref | Optional | A unique attribute associated with a product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters. | | name | Required | The name of a product. | | description | Required | A description 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"." | | slug | Required | A label for the product that is used in the URL paths. A slug can contain any combination of letters, numbers, periods, hyphens, and underscores. NO spaces or other characters are allowed. By default, the product name is used as the slug. | | status | Required | The status of a product, either `Draft` or `Live`. | | commodity_type | Required | The commodity type, either `physical` or `digital`. | | upc_ean | Optional | The universal product code or european article number of the product. | | mpn | Optional | The manufacturer part number of a product. | | sku | Optional | The unique stock keeping unit of the product. | | tags | Optional | The product tags used to store or assign a key word against a product. A product can have up to 20 product tags. A product tag can be up to 255 characters. See [**Product Tags**](/docs/api/pxm/products/product-tags ). | | main_image_id | Optional | Specifies a unique ID of a main image file for a product. See [Exporting Main Image Files](#exporting-main-image-files). | | `_created_at` | Optional| The date and time a product was created. **Note**: This field does not populate any data; it is provided solely for informational purposes. | | `_updated_at` | Optional | The date and time a product was updated. **Note**: This field does not populate any data; it is provided solely for informational purposes. | | `template::created_at` | Optional | The date and time a template was created. **Note**: This field does not populate any data; it is provided solely for informational purposes. | | `template::updated_at` | Optional | The date and time a template was updated. **Note**: This field does not populate any data; it is provided solely for informational purposes. | | `template::` | Optional | Custom extension data includes the flow `ID` or `slug` and the field `name`. See [Exporting Custom Data (Flows)](#exporting-custom-data-flows). | ### Exporting Main Image Files The main images that you have previously uploaded Commerce are exported. A `main_image_id` header is added to your `.csv` file. The ID in `main_image_id` is the ID of a file that has already been uploaded to Commerce using [create a file](/docs/api/pxm/files/create-a-file). ### Exporting Custom Data (Flows) Custom extension data is exported in a `.csv` file by creating a header that includes the flow `ID` or `slug` and the field `name` as shown below: - `template::` - `template::` where: - `template` must be `template`. - one of the following for the template that contains the field whose data you want to export: - `flowID` is the ID of the flow. - `flowSlug` is the flow slug. - `fieldName` is the name of the field whose data you want to export. In the following example, for a flow with ID `82c10a02-1851-4992-8ecb-d44f2782d09b` and a field with the name `condition`: - the header is `template:82c10a02-1851-4992-8ecb-d44f2782d09b:condition`. - the updated custom data is `as-new`. | name | slug | sku | status | template:82c10a02-1851-4992-8ecb-d44f2782d09b:condition | | :--- | :--- | :--- | :--- | :--- | | BestEver Range | bestever-range-1a1a-30 | BE-Range-1a1a-30 | draft | as-new |