younifyd
Menu

Create Product

Create a product or bundle

POST/pcm/products

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Create Product action (under PIM).
  3. Fill in the fields below, then reference the result from later steps as {{createProduct.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

dataobjectrequired
typestringrequired

This represents the type of resource being returned. Always `product`.

One ofproduct

attributesobjectrequired16 fields
relationshipsobject1 fields

Relationships are established between different product entities.

json
{
  "data": {
    "type": "product",
    "attributes": {
      "external_ref": "string",
      "name": "string",
      "description": "string",
      "slug": "string",
      "sku": "string",
      "status": "live",
      "commodity_type": "physical",
      "upc_ean": "string",
      "mpn": "string",
      "tags": [
        "string"
      ],
      "shopper_attributes": {
        "cost_of_goods": "42.0",
        "charge_type": "credit card"
      },
      "admin_attributes": {
        "cost_of_goods": "42.0",
        "charge_type": "credit card"
      }
    },
    "relationships": {
      "variations": {
        "data": [
          {
            "id": "string",
            "type": "string"
          }
        ]
      }
    }
  }
}

Response

Returns 201 with an object. Read it in later steps with {{createProduct.response.data.<field>}}.

dataobject
idstring

A unique product ID that is generated when you create the product.

typestring

This represents the type of resource object being returned. Always `product`.

One ofproduct

attributesobject17 fields
metaobject8 fields
relationshipsobject

Relationships are established between different product entities. For example, a `bundle` product and a `child` product are related to a `parent` product, as both are associated with it.

includedobject

Included is an array of resources that are included in the response.

main_imagesarray<object>9 fields

The main images associated with a product.

component_productsarray<object>5 fields

Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned.

filesarray<object>9 fields

The files associated with a product.

json
{
  "data": {
    "id": "string",
    "type": "product",
    "attributes": {
      "name": "string",
      "description": "string",
      "slug": "string",
      "sku": "string",
      "status": "live",
      "commodity_type": "physical",
      "upc_ean": "string",
      "mpn": "string",
      "external_ref": "string",
      "locales": {},
      "tags": [
        "string"
      ],
      "shopper_attributes": {
        "cost_of_goods": "42.0",
        "charge_type": "credit card"
      }
    },
    "meta": {
      "created_at": "2020-09-22T09:00:00.000Z",
      "updated_at": "2020-09-22T09:00:00.000Z",
      "owner": "organization",
      "variations": [
        {
          "id": "string",
          "name": "string",
          "sort_order": 0,
          "options": [
            {
              "id": null,
              "name": null,
              "description": null,
              "sort_order": null
            }
          ]
        }
      ],
      "custom_relationships": [
        null
      ],
      "child_variations": [
        {
          "id": "string",
          "name": "string",
          "sort_order": 0,
          "options": [
            {
              "id": null,
              "name": null,
              "description": null,
              "sort_order": null
            }
          ],
          "option": {
            "id": "string",
            "name": "string",
            "description": "string",
            "sort_order": 0
          }
        }
      ],
      "product_types": [
        "parent"
      ],
      "variation_matrix": {}
    },
    "relationships": {}
  },
  "included": {
    "main_images": [
      {
        "id": "00000000-0000-0000-0000-000000000000",
        "type": "file",
        "file_name": "file_name.jpg",
        "mime_type": "image/jpeg",
        "file_size": 36000,
        "public": true,
        "meta": {
          "timestamps": {
            "created_at": "2023-10-11T13:02:25.293Z"
          },
          "dimensions": {
            "width": 1800,
            "height": 1000
          }
        },
        "links": {
          "self": "https://useast.api.elasticpath.com/v2/files/ddc28c74-a7df-46be-b262-8fa69a6e7d52"
        },
        "link": {
          "href": "https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/f8cf26b3-6d38-4275-937a-624a83994702.png",
          "meta": {
            "results": {
              "total": null
            }
          }
        }
      }
    ],
    "component_products": [
      {
        "id": "string",
        "type": "product",
        "attributes": {
          "name": "string",
          "description": "string",
          "slug": "string",
          "sku": "string",
          "status": "live",
          "commodity_type": "physical",
          "upc_ean": "string",
          "mpn": "string",
          "external_ref": "string",
          "locales": {},
          "tags": [
            "string"
          ],
          "shopper_attributes": {
            "cost_of_goods": "42.0",
            "charge_type": "credit card"
          }
        },
        "meta": {
          "created_at": "2020-09-22T09:00:00.000Z",
          "updated_at": "2020-09-22T09:00:00.000Z",
          "owner": "organization",
          "variations": [
            {
              "id": null,
              "name": null,
              "sort_order": null,
              "options": null
            }
          ],
          "custom_relationships": [
            null
          ],
          "child_variations": [
            {
              "id": null,
              "name": null,
              "sort_order": null,
              "options": null,
              "option": null
            }
          ],
          "product_types": [
            "parent"
          ],
          "variation_matrix": {}
        },
        "relationships": {}
      }
    ],
    "files": [
      {
        "id": "00000000-0000-0000-0000-000000000000",
        "type": "file",
        "file_name": "file_name.jpg",
        "mime_type": "image/jpeg",
        "file_size": 36000,
        "public": true,
        "meta": {
          "timestamps": {
            "created_at": "2023-10-11T13:02:25.293Z"
          },
          "dimensions": {
            "width": 1800,
            "height": 1000
          }
        },
        "links": {
          "self": "https://useast.api.elasticpath.com/v2/files/ddc28c74-a7df-46be-b262-8fa69a6e7d52"
        },
        "link": {
          "href": "https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/f8cf26b3-6d38-4275-937a-624a83994702.png",
          "meta": {
            "results": {
              "total": null
            }
          }
        }
      }
    ]
  }
}

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.

Create Product — Elastic Path — Documentation