Newer Version Available
Commerce Webstore Composite Products, Update
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/v66.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 "Type": "Base", // This is required when creating a variant parent 5 "Description": "This is a sample product", 6 "StockKeepingUnit": "110000", 7 "CustomField1__c": 9999, 8 "CustomField2__c": "some custom text" 9 }, 10 "categoryIds": [ 11 "0ZGxx0000000007GAA", 12 "0ZGxx0000000008GAA" 13 ], 14 "productMedia": [ 15 { 16 "mediaId": "20Yxx0000011QskEAE", 17 "developerName": "productDetailImage" 18 }, 19 { 20 "mediaId": "20Yxx0000011QslEAE", 21 "developerName": "productListImage" 22 } 23 ], 24 "attributeSetInfo": { 25 "id": "0iYxx0000000001EAA", // present if using an existing set 26 "name": "Apparel", // present if creating a new set 27 "attributes": [ // present if creating a new set 28 "Color__c", 29 "Size__c" 30 ] 31 } 32} - 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