Newer Version Available

This content describes an older version of this product. View Latest

Commerce Webstore Composite Products, Update

Update an existing product record with the specified category and media records.

When updating a product record, you need to include both the existing category and media records that are already linked to it, along with any new ones you want to add. For example, if a product record has two categories and three media records associated with it, the API will delete and then reinsert all the category and media records. If you don't specify the existing associated category and media records, the API removes their association with the product.

Resource
1/commerce/management/webstore/${webstoreId}/composite-products/${productId}
Resource example
1https://yourInstance.salesforce.com/services/data/v63.0/commerce/management/webstore/0ZEOK00000008vJ4AQ/composite-products/01tOK000000EUozYAG
Available version
61.0
HTTP methods
PUT
Request body for PUT
JSON example
1{
2  "productFields": {
3    "Name": "Sample Product",
4    "Description": "This is a sample product",
5    "StockKeepingUnit": "110000",
6    "CustomField1__c": 9999,
7    "CustomField2__c": "some custom text"
8  },
9  "categoryIds": [
10    "0ZGxx0000000007GAA",
11    "0ZGxx0000000008GAA"
12  ],
13  "productMedia": [
14    {
15      "mediaId": "20Yxx0000011QskEAE",
16      "developerName": "productDetailImage"
17    },
18    {
19      "mediaId": "20Yxx0000011QslEAE",
20      "developerName": "productListImage"
21    }
22  ],
23  "attributeSetInfo": {
24    "id": "0iYxx0000000001EAA", // present if using an existing set
25    "name": "Apparel", // present if creating a new set
26    "attributes": [ // present if creating a new set
27      "Color__c",
28      "Size__c"
29    ]
30  }
31}
Properties
Name Type Description Required or Optional Available Version
attributeSetInfo Product Attribute Set Input Attribute set information for a variation parent product. Optional 62.0
categoryIds String[] A list of category IDs to be associated with the product. Optional 61.0
productFields Map<String, String> A map of product field names and their values. Required 61.0
productMedia Product Media Input[] A list of media records to be associated with the product. Optional 61.0
productPricing Product Pricing Input Details of the product pricing. Optional 61.0
Response body for PUT
Composite Commerce Product Output