Update a product or bundle
PUThttps://euwest.api.elasticpath.com/pcm/products/:productID
Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the product or bundle is not updated.
Request
Path Parameters
productID stringrequired
A unique identifier for the product.
- application/json
Body
data objectrequired
Responses
- 200
- 403
- 404
- 409
- 422
- 500
Updates a product with the following attributes.
- application/json
- Schema
- Example (auto)
- updated-product
- build-rules
- update-product-custom-inputs
- update-product-bundle
- update-product-bundle-quantity-config
Schema
data object
included object
{
"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"
],
"extensions": {},
"custom_inputs": {},
"build_rules": {
"default": "include",
"include": [
"string"
],
"exclude": [
"string"
]
},
"components": {}
},
"meta": {
"created_at": "2020-09-22T09:00:00",
"updated_at": "2020-09-22T09:00:00",
"owner": "organization",
"variations": [
{
"id": "string",
"name": "string",
"options": [
{
"id": "string",
"name": "string",
"description": "string"
}
]
}
],
"custom_relationships": [
null
],
"child_variations": [
{
"id": "string",
"name": "string",
"sort_order": 0,
"options": [
{
"id": "string",
"name": "string",
"description": "string"
}
],
"option": {
"id": "string",
"name": "string",
"description": "string"
}
}
],
"product_types": [
"parent"
],
"variation_matrix": {}
},
"relationships": {}
},
"included": {
"main_images": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"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": 2
}
}
}
}
],
"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"
],
"extensions": {},
"custom_inputs": {},
"build_rules": {
"default": "include",
"include": [
"string"
],
"exclude": [
"string"
]
},
"components": {}
},
"meta": {
"created_at": "2020-09-22T09:00:00",
"updated_at": "2020-09-22T09:00:00",
"owner": "organization",
"variations": [
{
"id": "string",
"name": "string",
"options": [
{
"id": "string",
"name": "string",
"description": "string"
}
]
}
],
"custom_relationships": [
null
],
"child_variations": [
{
"id": "string",
"name": "string",
"sort_order": 0,
"options": [
{
"id": "string",
"name": "string",
"description": "string"
}
],
"option": {
"id": "string",
"name": "string",
"description": "string"
}
}
],
"product_types": [
"parent"
],
"variation_matrix": {}
},
"relationships": {}
}
],
"files": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"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": 2
}
}
}
}
]
}
}
Update a base product
{
"data": {
"type": "product",
"id": "60afe403-a191-455e-b771-c510c928a308",
"attributes": {
"commodity_type": "physical",
"description": "The 30 inch version of this popular electric range.",
"mpn": "BE-R-1111-aaaa-1a1a-30",
"name": "UPDATED BestEver Range 30 inch, Model 1a1a-30",
"sku": "BE-Range-1a1a-30",
"slug": "bestever-range-1a1a-30",
"status": "draft",
"upc_ean": "111130303030",
"locales": {
"fr-FR": {
"name": "MISE À JOUR de la gamme BestEver 30 pouces, modèle 1a1a-30",
"description": "La version 30 pouces de cette cuisinière électrique populaire"
}
},
"tags": [
"tag1",
"tag2"
]
},
"relationships": {
"files": {
"data": [],
"links": {
"self": "/products/60afe403-a191-455e-b771-c510c928a308/relationships/files"
}
},
"templates": {
"data": [],
"links": {
"self": "/products/60afe403-a191-455e-b771-c510c928a308/relationships/templates"
}
}
},
"meta": {
"created_at": "2023-09-28T10:43:41.72Z",
"owner": "organization",
"product_types": [
"standard"
],
"updated_at": "2023-09-28T10:43:41.72Z"
}
}
}
Update a base product, configure build rules
{
"data": {
"type": "product",
"id": "9214719b-17fe-4ea7-896c-d61e60fc0d05",
"attributes": {
"build_rules": {
"default": "include",
"exclude": [
[
"cbde9096-e0e1-43d8-a1aa-cb66cf1d299f",
"0b261f7d-753d-4af6-b9f4-62b436cca37d",
"994c2029-519c-43d9-9c54-14f3af4e3efd"
]
]
},
"commodity_type": "physical",
"description": "T-shirt.",
"locales": {
"fr-FR": {
"name": "Shirt",
"description": "T-Shirt."
}
},
"mpn": "1234-5678-SSSS",
"name": "Shirt",
"sku": "978055216732567",
"slug": "978055216732567",
"status": "live",
"upc_ean": "135623456"
},
"relationships": {
"children": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/children"
}
},
"component_products": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/component_products"
}
},
"files": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/files"
}
},
"main_image": {
"data": null
},
"templates": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/templates"
}
},
"variations": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/variations"
}
}
},
"meta": {
"created_at": "2022-08-18T12:14:52.782Z",
"owner": "store",
"product_types": [
"standard"
],
"updated_at": "2022-08-18T12:40:13.484Z",
"variation_matrix": {},
"variations": [
{
"id": "6c4b5caa-3819-4366-a14e-c5b85009544b",
"name": "Shirt Size",
"options": [
{
"id": "cbde9096-e0e1-43d8-a1aa-cb66cf1d299f",
"name": "Small",
"description": "Size Small"
},
{
"id": "da9d88d0-8ea6-434c-a0dd-059caf595687",
"name": "Medium",
"description": "Size Medium"
},
{
"id": "07493fea-74b0-40a2-972a-cd7e1d6561bd",
"name": "Large",
"description": "Size Large"
}
]
},
{
"id": "b1ae545e-3375-455f-b5ea-09669b60996f",
"name": "Shirt Material",
"options": [
{
"id": "994c2029-519c-43d9-9c54-14f3af4e3efd",
"name": "Cotton",
"description": "Material Cotton"
},
{
"id": "7951f3d9-f628-49f8-8a43-7749d28153d6",
"name": "Denim",
"description": "Material Denim"
},
{
"id": "58115bff-589a-4287-98d8-373112102617",
"name": "Wool",
"description": "Material Wool"
}
]
},
{
"id": "f192e114-9f8a-4284-99d0-4d9ccd8a0275",
"name": "Shirt Color",
"options": [
{
"id": "0b261f7d-753d-4af6-b9f4-62b436cca37d",
"name": "Red",
"description": "Color Red"
},
{
"id": "55d6d785-cc52-453a-bff6-2cf9add8a580",
"name": "Green",
"description": "Color Green"
},
{
"id": "a43d8b6f-b411-49aa-adaa-36a1a025051e",
"name": "Blue",
"description": "Color Blue"
}
]
}
]
}
}
}
Update using custom_inputs
{
"data": {
"type": "product",
"id": "9214719b-17fe-4ea7-896c-d61e60fc0d05",
"attributes": {
"commodity_type": "physical",
"custom_inputs": {
"back": {
"name": "T-Shirt Back",
"validation_rules": [
{
"type": "string",
"options": {
"max_length": 50
}
}
],
"required": false
},
"front": {
"name": "T-Shirt Front",
"validation_rules": [
{
"type": "string",
"options": {
"max_length": 50
}
}
],
"required": false
}
},
"description": "T-shirt.",
"locales": {
"fr-FR": {
"name": "T-Shirt",
"description": "T-Shirt."
}
},
"mpn": "1234-5678-SSSS",
"name": "Shirt",
"sku": "978055216732567",
"slug": "978055216732567",
"status": "live"
},
"relationships": {
"children": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/children"
}
},
"component_products": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/component_products"
}
},
"files": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/files"
}
},
"main_image": {
"data": null
},
"templates": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/templates"
}
},
"variations": {
"data": [],
"links": {
"self": "/products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/variations"
}
}
},
"meta": {
"created_at": "2022-08-18T12:14:52.782Z",
"updated_at": "2022-08-19T12:28:26.343Z",
"variation_matrix": {},
"variations": [
{
"id": "6c4b5caa-3819-4366-a14e-c5b85009544b",
"name": "Shirt Size",
"options": [
{
"id": "cbde9096-e0e1-43d8-a1aa-cb66cf1d299f",
"name": "Small",
"description": "Size Small"
},
{
"id": "da9d88d0-8ea6-434c-a0dd-059caf595687",
"name": "Medium",
"description": "Size Medium"
},
{
"id": "07493fea-74b0-40a2-972a-cd7e1d6561bd",
"name": "Large",
"description": "Size Large"
}
]
},
{
"id": "b1ae545e-3375-455f-b5ea-09669b60996f",
"name": "Shirt Material",
"options": [
{
"id": "994c2029-519c-43d9-9c54-14f3af4e3efd",
"name": "Cotton",
"description": "Material Cotton"
},
{
"id": "7951f3d9-f628-49f8-8a43-7749d28153d6",
"name": "Denim",
"description": "Material Denim"
},
{
"id": "58115bff-589a-4287-98d8-373112102617",
"name": "Wool",
"description": "Material Wool"
}
]
},
{
"id": "f192e114-9f8a-4284-99d0-4d9ccd8a0275",
"name": "Shirt Color",
"options": [
{
"id": "0b261f7d-753d-4af6-b9f4-62b436cca37d",
"name": "Red",
"description": "Color Red"
},
{
"id": "55d6d785-cc52-453a-bff6-2cf9add8a580",
"name": "Green",
"description": "Color Green"
},
{
"id": "a43d8b6f-b411-49aa-adaa-36a1a025051e",
"name": "Blue",
"description": "Color Blue"
}
]
}
]
}
}
}
Update a bundle
{
"data": {
"type": "product",
"id": "8a0072c0-cedf-4e53-bdc4-a14a5d6389d5",
"attributes": {
"commodity_type": "digital",
"components": {
"List 1": {
"name": "PS5",
"options": [
{
"id": "c7cf43f3-24c6-4523-8a24-3663b49b81aa",
"type": "product",
"quantity": 1,
"default": true
}
],
"sort_order": 1
},
"List 2": {
"name": "Controller",
"options": [
{
"id": "e59ca559-37c7-4dc9-8a91-df94cd5700d3",
"type": "product",
"quantity": 1,
"default": true
}
],
"sort_order": 2
},
"List 3": {
"name": "PS+",
"options": [
{
"id": "8ae2a7ea-f767-4af0-8486-ae203947ecc4",
"type": "product",
"quantity": 1,
"default": true
}
],
"sort_order": 3
},
"List 4": {
"options": [
{
"id": "549a291f-669c-47d0-bc04-60a3f18fc55c",
"type": "product",
"quantity": 1,
"default": true
},
{
"id": "071e461c-22a2-42e0-9604-c345bbc9b85c",
"type": "product",
"quantity": 1,
"default": false
},
{
"id": "633b8172-8aa9-4dbd-aa07-0dcefca3de74",
"type": "product",
"quantity": 1,
"default": false
},
{
"id": "549a291f-669c-47d0-bc04-60a3f18fc55c",
"type": "product",
"quantity": 1,
"default": false
}
],
"min": 1,
"max": 1,
"sort_order": 4
},
"headsets": {
"name": "Headsets",
"options": [
{
"id": "8ae2a7ea-f767-4af0-8486-ae203947ecc4",
"type": "product",
"quantity": 5,
"default": true
}
]
}
},
"description": "Favourite DOOM games in one bundle - Select one from four choices",
"mpn": "1234-5678-ABCD00",
"name": "Favourite games bundle",
"sku": "fav23455",
"slug": "PGH69345-B",
"status": "live",
"upc_ean": "123456"
},
"relationships": {
"children": {
"data": [],
"links": {
"self": "/products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/children"
}
},
"component_products": {
"data": [],
"links": {
"self": "/products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/component_products"
}
},
"files": {
"data": [],
"links": {
"self": "/products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/files"
}
},
"main_image": {
"data": null
},
"templates": {
"data": [],
"links": {
"self": "/products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/templates"
}
},
"variations": {
"data": [],
"links": {
"self": "/products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/variations"
}
}
},
"meta": {
"created_at": "2022-02-03T19:38:00.602Z",
"owner": "store",
"updated_at": "2022-02-03T19:43:21.487Z",
"variation_matrix": {}
}
}
}
Update Bundle with Quantity Configuration
{
"data": {
"type": "product",
"id": "143e9ded-b549-4631-831c-d27f5fb2fe2e",
"attributes": {
"name": "Coffee Bundle",
"description": "A customizable coffee bundle with optional syrups and coffee options",
"sku": "COFFEE-BUNDLE-001",
"commodity_type": "physical",
"status": "live",
"components": {
"syrup": {
"name": "Syrup Selection",
"min": 0,
"max": 2,
"options": [
{
"id": "vanilla-id",
"type": "product",
"quantity": 1,
"min": 1,
"max": 3,
"default": true
},
{
"id": "salted-caramel-id",
"type": "product",
"quantity": 1,
"min": 1,
"max": 3
},
{
"id": "hazelnut-id",
"type": "product",
"quantity": 1,
"min": 1,
"max": 3
},
{
"id": "caramel-id",
"type": "product",
"quantity": 1,
"min": 1,
"max": 3
},
{
"id": "toffee-nut-id",
"type": "product",
"quantity": 1,
"min": 1,
"max": 3
},
{
"id": "pumpkin-spice-id",
"type": "product",
"quantity": 1,
"min": 1,
"max": 3
}
]
},
"coffee": {
"name": "Coffee Selection",
"min": 1,
"max": 1,
"options": [
{
"id": "cappuccino-id",
"type": "product",
"quantity": 1,
"default": true
},
{
"id": "espresso-id",
"type": "product",
"quantity": 1
},
{
"id": "latte-id",
"type": "product",
"quantity": 1
}
]
}
}
},
"relationships": {
"children": {
"data": [],
"links": {
"self": "/products/143e9ded-b549-4631-831c-d27f5fb2fe2e/children"
}
},
"component_products": {
"data": [],
"links": {
"self": "/products/143e9ded-b549-4631-831c-d27f5fb2fe2e/relationships/component_products"
}
},
"files": {
"data": [],
"links": {
"self": "/products/143e9ded-b549-4631-831c-d27f5fb2fe2e/relationships/files"
}
},
"main_image": {
"data": null
},
"templates": {
"data": [],
"links": {
"self": "/products/143e9ded-b549-4631-831c-d27f5fb2fe2e/templates"
}
},
"variations": {
"data": [],
"links": {
"self": "/products/143e9ded-b549-4631-831c-d27f5fb2fe2e/relationships/variations"
}
}
},
"meta": {
"created_at": "2024-04-14T10:34:00.000Z",
"owner": "organization",
"product_types": [
"bundle"
],
"updated_at": "2024-04-14T10:34:00.000Z",
"variation_matrix": {}
}
},
"included": {
"main_images": [],
"files": []
}
}
Forbidden
- application/json
- Schema
- Example (auto)
- 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": [
{
"title": "Forbidden",
"status": "403",
"detail": "entity owned by organization"
}
]
}
Bad Request. Not Found.
- application/json
- Schema
- Example (auto)
- 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": [
{
"title": "Not Found",
"status": "404"
}
]
}
Write conflict detected
- application/json
- Schema
- Example (auto)
- 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": [
{
"title": "Conflict",
"status": "409",
"detail": "write conflict detected"
}
]
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (auto)
- 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 (auto)
- 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
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
ResponseClear