Add or Update Single Product Attribute Method #2


When to Use

  • After a product is created, this is how to add or update attributes and attribute values for a product.
  • Requires the Product ID (not the Sku - the ChannelAdvisor unique ID representing the product).
    • Place a GET Products request and $filter=Sku eq 'PRODUCT SKU VALUE'&$select=ID to return the ID to use in this request.
  • The 'Name' of the attribute can have forward or backslashes, or other URL incompatible values.
  • For a way to create attributes during product creation, please see the pages on Creating Products.
  • Since the name of the attribute is sent in the body, any characters that may be interpreted as operators do NOT need to be encoded.
  • There are two other endpoints that can be used to add or update attribute data in $batch requests:

Resource URL / Endpoint

POST https://api.channeladvisor.com/v1/AttributeValues

Required Parameters

PropertyType (Max Length)RequiredNote
ProductIDinteger (32 bit)RequiredInclude in body. The ChannelAdvisor defined unique ID (not the Sku value) of the product.
See note above under "When to Use" about retrieving the Product ID.
ProfileIDinteger (32 bit)ConditionalInclude in body. Identifies the ChannelAdvisor account. Required if authorized for multiple profiles.
Namestring (32)RequiredInclude in body. The name of the attribute.
Valuestring (32,000)RequiredInclude in body. The value that corresponds with the name given.
Example Request
POST https://api.channeladvisor.com/v1/AttributeValues?access_token=xxxxxxxxxx
{
    "ProfileID": 12345678,
    "ProductID": 22223456,
    "Name": "Hub Cap Model",
    "Value": "58 Studebaker"
}
Example Response (Success)
201 Created
{
  "@odata.context": "https://api.channeladvisor.com/v1/$metadata#AttributeValues/$entity",
  "ProductID": 22223456,
  "ProfileID": 12345678,
  "Name": "Hub Cap Model",
  "Value": "58 Studebaker"
}