Developer API – Products

AttributeDelete

This will remove an attribute or field from all products. Please provide the attribute/field code and not the friendly name.

Input

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<ChannelUnity>  
    <MerchantName>DemoAccount</MerchantName>  
    <Authorization>RGVtbjE4NWM=</Authorization>  
    <ApiKey>18eb4565477448ab</ApiKey>  
    <RequestType>AttributeDelete</RequestType>  
    <SourceURL><![CDATA[http://]]></SourceURL>  
    <Payload>  
        <ProductAttributes>  
            <Attribute>  
                <Name>option2</Name>  
            </Attribute>  
        </ProductAttributes>  
    </Payload>
</ChannelUnity>

Output

1
2
3
<ChannelUnity>
    <Status>OK</Status>
</ChannelUnity>

ProductAttributes

This call allows custom product attributes (fields) to be specified along with a type and name.

When sending these attributes as part of ProductData, they must be contained within the <Custom> tag.

Input

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<ChannelUnity>  
    <MerchantName>merc</MerchantName>  
    <Authorization>T.....==</Authorization>      
    <ApiKey>123123123</ApiKey>  
    <RequestType>ProductAttributes</RequestType>  
    <Payload>  
        <ProductAttributes>  
            <Attribute>  
                <Name>my_attr_code</Name>  
                <Type>int</Type>  
                <FriendlyName>My attribute code</FriendlyName>
           </Attribute>    
 [ <Attribute> element repeated for each attribute ]          
       </ProductAttributes>  
    </Payload>
</ChannelUnity>

Output

1
2
3
<ChannelUnity>
    <Status>OK</Status>
</ChannelUnity>

It is not strictly necessary to call ProductAttributes but is useful for when a lot of custom attributes are uploaded in product data. The ProductAttributes call associates an attribute code with a friendly name which is displayed in the ChannelUnity user interface at Setup -> Describe Product Fields.

Each attribute is given the following information.

Name – The attribute code as used in the ProductData messages. This code can contain only: a-z, 0-9 or underscore. The maximum length is 60 characters.

Type – The type of the attribute – for information purposes – one of int, decimal, text.

FriendlyName – The friendly name of this attribute to be displayed to the user.

ProductData

Allows you to send information on a product or products to the ChannelUnity account.

Any additional attributes to the basic ones listed below (which we refer to as Custom) can be defined using the ProductAttributes API.

Basic Attributes:

  • RemoteId – The unique integer ID of the product in your own system. This is a value 1 or greater.
  • SourceURL – The same URL as provided to earlier API calls.
  • StoreViewId – The ID number of the Store View
  • ProductType – Set this as “Default”.
  • Title – The title or name of the product.
  • Description – The main description body text to describe the product. HTML data is allowed (which can be placed within CDATA tags). NB marketplaces vary in the level of HTML that is allowed on listings.
  • SKU – Stock keeping unit. This is the field that ChannelUnity uses to uniquely identify a product.
  • Price – The price that the product is to be sold for. NB. custom fields can be used to specify different prices on different marketplaces. Also the currency for prices is set in ChannelUnity under Setup -> Describe Product Fields.
  • Quantity – The quantity on hand of this product.
  • Category – The category ID of this product as matching the ID value of the CategoryData call. Multiple categories are given via a comma separated list, e.g. 4,14,29.
  • CategoryName – The of the category in which this product belongs. (optional).
  • Image – URL to the main image for this product. Must be a publicly accessible URL.

Custom Attributes:

These are any extra data needed such as UPC, Size, Colour etc. When sending these they must be within a sub tag of <Custom>.

Input

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<ChannelUnity>  
    <MerchantName>merch</MerchantName>  
    <Authorization>TWF0dFR...==</Authorization>  
    <ApiKey>123123123</ApiKey>  
    <RequestType>ProductData</RequestType>
    <Payload>
        <Products>  
            <Product>  
                <RemoteId>1</RemoteId>  
                <SourceURL>http://xxxx</SourceURL>  
                <StoreViewId>1</StoreViewId>  
                <ProductType>Default</ProductType>  
                <Title>My widget</Title>  
                <Description>This does bla bla</Description>  
                <SKU>D123</SKU>  
                <Price>11.99</Price>  
                <Quantity>10</Quantity>  
                <Category>2</Category>  
                <CategoryName>Cat123</CategoryName>  
                <Image>http://www.site.com/files/2012/12/prod.jpg</Image>  
                <Custom>  
                    <UPC>123456789012</UPC>  
                    <Size>Large</Size>  
                </Custom>  
            </Product>
        </Products>
    </Payload>
</ChannelUnity>

Output

1
2
3
<ChannelUnity>  
    <Status>OK</Status>
</ChannelUnity>

Multiple products can be given in each Products message. Aim for product message less than 1MB each. The example above is the simplest example i.e. a standalone product with no variations and just 2 custom attributes. It shows all the minimum product information:

  • RemoteId – The unique integer ID of the product in your own system. This is a value 1 or greater.
  • SourceURL – The same URL as provided to earlier API calls.
  • ProductType – Set this as “Default”.
  • Title – The title or name of the product.
  • Description – The main description body text to describe the product. HTML data is allowed (which can be placed within CDATA tags). NB marketplaces vary in the level of HTML that is allowed on listings.
  • SKU – Stock keeping unit. This is the field that ChannelUnity uses to uniquely identify a product.
  • Price – The price that the product is to be sold for. NB. custom fields can be used to specify different prices on different marketplaces. Also the currency for prices is set in ChannelUnity under Setup -> Describe Product Fields.
  • Quantity – The quantity on hand of this product.
  • Category – The category ID of this product as matching the ID value of the CategoryData call. Multiple categories are given via a comma separated list, e.g. 4,14,29.
  • CategoryName – The of the category in which this product belongs. (optional).
  • Image – URL to the main image for this product. Must be a publicly accessible URL.

The next example demonstrates a parent product with two child products. This is a shoe that comes in two sizes. The XML message for this is given below. Note that all the related products do not need to be specified in the same message. However, the child products should be supplied first, and then the parent product such that the child products can be correctly associated with the parent.

Input

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<ChannelUnity>
    <MerchantName>merch</MerchantName>
    <Authorization>TWF0dFR...==</Authorization>
    <ApiKey>123123123</ApiKey>
    <RequestType>ProductData</RequestType>
    <Payload>
        <Products>
            <Product>
                <RemoteId>11</RemoteId>
                <SourceURL>http://YOUR_URL/</SourceURL>
                <StoreViewId>0</StoreViewId>
                <ProductType>Default</ProductType>
                <Title>Nike Trainers</Title>
                <Description>Great style for the new season.</Description>
                <SKU>NTPARNT-8</SKU>
                <Price>45.99</Price>
                <Quantity>10</Quantity>
                <Category>3</Category>
                <CategoryName>Shoes</CategoryName>
                <Image>http://bit.ly/16qYx5H</Image>
                <Custom>
                    <colour>White</colour>
                    <size>8</size>
                </Custom>
            </Product>
            <Product>
                <RemoteId>12</RemoteId>
                <SourceURL>http://YOUR_URL/</SourceURL>
                <StoreViewId>0</StoreViewId>
                <ProductType>Default</ProductType>
                <Title>Nike Trainers</Title>
                <Description>Great style for the new season.</Description>
                <SKU>NTPARNT-9</SKU>
                <Price>45.99</Price>
                <Quantity>10</Quantity>
                <Category>3</Category>
                <CategoryName>Shoes</CategoryName>
                <Image>http://bit.ly/16qYx5H</Image>
                <Custom>
                    <colour>White</colour>
                    <size>9</size>
                </Custom>
            </Product>
            <Product>
                <RemoteId>10</RemoteId>
                <SourceURL>http://YOUR_URL/</SourceURL>
                <StoreViewId>0</StoreViewId>
                <ProductType>Default</ProductType>
                <Title>Nike Trainers</Title>
                <Description>Great style for the new season.</Description>
                <SKU>NTPARNT</SKU>
                <Price>45.99</Price>
                <Quantity>10</Quantity>
                <Category>3</Category>
                <CategoryName>Shoes</CategoryName>
                <Image>http://bit.ly/16qYx5H</Image>
                <RelatedSKUs>
                    <SKU>NTPARNT-8</SKU>
                    <SKU>NTPARNT-9</SKU>
                </RelatedSKUs>
                <Variations>
                    <Variation>size</Variation>
                </Variations>
                <Custom>
                    <colour>White</colour>
                </Custom>
            </Product>
            <RangeNext>0</RangeNext>
            <TotalProducts>3</TotalProducts>
        </Products>
    </Payload>
</ChannelUnity>

Sending a media gallery through the API

To upload multiple images per product you need to upload a media gallery (use a field of name media_gallery in the Custom field set). Using PHP, create a serialised array as follows.

1
2
3
4
$imagesArray = array( array('file' => 'image1url.jpg'),
   array('file' => 'image2url.jpg') );

$mediaGalleryData = serialize(array('images' => $imagesArray));

This data is then included within the Custom tag of a ProductData call.

1
2
3
4
5
6
7
8
9
<Custom>

..

<media_gallery> $mediaGalleryData </media_gallery>

..

</Custom>

ProductDataLite

Allows you to send quantity and price for a given SKU. Many products’ data can be uploaded at once. 10000 entries per upload maximum. Note that in the upload data, the given quantity applies to the standard Quantity of the product, and the given price applies to the standard Price value for the product. No other attributes can be affected by this call.

Input

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<ChannelUnity>
    <MerchantName>merch</MerchantName>
    <Authorization>TWF0dFR...==</Authorization>
    <ApiKey>123123123</ApiKey>
    <RequestType>ProductDataLite</RequestType>
    <Payload>
        <Products>
            <SourceURL>http://YOUR_URL/</SourceURL>
            <StoreViewId>0</StoreViewId>
            <Data>
                <![CDATA[ * ]]>
            </Data>
        </Products>
    </Payload>
</ChannelUnity>

The above message is a template, with the asterisk denoting where the SKUs, quantities and prices are to be provided.

An example Data message looks like the following:

XUA918,1,2.99* 
CQI924,91,13.99*
AHO382,110,160.50*

This shows three SKUs, with quantities and prices in that order. Generally each product is provided as follows:

[SKU] , [Qty] , [Price] * \n

Output

1
2
3
4
5
6
<ChannelUnity>
    <Info>SKU WGW252 HAS CHANGED</Info>
    <Info>SKU WYB352 not changed</Info>
    <Length>1298</Length>
    <Status>OK</Status>
</ChannelUnity>

ProductDataUpdate

Allows you to send information on a product or products to the ChannelUnity account.

This creates the product if the given SKU doesn’t exist or updates the product if the SKU does exist. Note that only the SKU and SourceURL elements are required here. Include further elements for the fields that you wish to update only. Unlike ProductData where unspecified fields are erased, the previous values will remain when there is an unspecified field in ProductDataUpdate. The format of the Payload is the same as with ProductData.

Input

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<ChannelUnity>
    <MerchantName>merch</MerchantName>
    <Authorization>TWF0dFR...==</Authorization>
    <ApiKey>123123123</ApiKey>
    <RequestType>ProductDataUpdate</RequestType>
    <Payload>
        <Products>
            <Product>
                <SourceURL>http://xxxx</SourceURL>
                <SKU>D123</SKU>
                <Price>11.99</Price>
                <Quantity>10</Quantity>
                <Image>http://www.site.com/files/2013/12/prodnew.jpg</Image>
            </Product>
        </Products>
    </Payload>
</ChannelUnity>

Output

1
2
3
<ChannelUnity>  
    <Status>OK</Status>
</ChannelUnity>

ProductDelete

Allows you to remove a product by SKU from the connected ChannelUnity account. This action also removes the product from all connected marketplaces if it is listed there.

Multiple SKUs can be provided in the Data element separated by an asterisk symbol.

Note: The maximum number of SKUs that can be deleted per call is 10,000.

Input

1
2
3
4
5
6
7
8
<ChannelUnity>
   <MerchantName>merch</MerchantName>
   <Authorization>TWF0dFR...==</Authorization>
   <SourceURL>http://</SourceURL>
   <ApiKey>123123123</ApiKey>
   <RequestType>ProductDelete</RequestType>
   <Data>YOUR_SKU</Data>
</ChannelUnity>

Output

1
2
3
4
5
6
<ChannelUnity>
   <Info>The SKU 'B17983' was unselected to list 1</Info>
   <Info>The SKU 'B17983' was deleted 1</Info>
   <Info>1 deleted</Info>
   <Status>OK</Status>
</ChannelUnity>

ProductDelete2

Allows you to remove product(s) from the connected ChannelUnity account. This action also removes the product from all connected marketplaces if it is listed there. To identify the products to be deleted, any attribute value may be provided. Specify the attribute code and a list of attribute values according to the example provided.

Multiple products can be deleted by simply repeating the Attributes/Value element.

Note: The maximum number of products that can be deleted per call is 10,000.

Input

1
2
3
4
5
6
7
8
9
10
11
12
<ChannelUnity>
   <MerchantName>merch</MerchantName>
   <Authorization>TWF0dFR...==</Authorization>
   <SourceURL>http://</SourceURL>
   <ApiKey>123123123</ApiKey>
   <RequestType>ProductDelete2</RequestType>
   <AttributeKey>remote_product_id</AttributeKey>
   <AttributeValues>
      <Value>2134798243</Value>
      <Value>2155789523</Value>
   </AttributeValues>
</ChannelUnity>

Output

1
2
3
4
5
6
7
8
<ChannelUnity>
   <Info>The SKU 'B11983' was unselected to list 1</Info>
   <Info>The SKU 'B11983' was deleted 1</Info>
   <Info>The SKU 'B10980' was unselected to list 1</Info>
   <Info>The SKU 'B10980' was deleted 1</Info>
   <Info>2 deleted</Info>
   <Status>OK</Status>
</ChannelUnity>
If you want to sell on marketplaces but don't yet have an online store, Synchromatic is the solution for you.
More Details