Helcim Logo Support & Tutorials

© Copyright 2006-2018 Helcim Inc.

All Rights Reserved.

Helcim Commerce API » Inventory »

Add or Edit a Product

This API call let's you add or edit a product. The response is an XML of adding/editing a product.

Request Fields

Field Name Type Required Description
action String Yes productEdit
accountId Integer Yes The Helcim Commerce account ID.
apiToken String Yes API token used for authentication and access control. 
name String Yes The product name.
productId Integer No If you do not enter a product ID, you will add a product.  If you do enter a product ID, you will edit an existing product
categoryId Integer No The category ID.
brandId Integer No The brand ID.
description String  No The product description.
sku Integer No The product sku.
barcode String No The product barcode.
availability Integer No 1 or 0 - Whether the product is available for sale.
availabilityOnline Integer No 1 or 0 - Whether the product is available for sale online.
featured Integer No 1 or 0 - Whether the product is featured (front page) item online.
price Decimal No The product price.
salePrice Decimal No The product sale price.
weight Decimal No The product weight - based on Helcim Commerce Unit of Measurement (UoM) account settings.
dimensionW Decimal No The product width- based on Helcim Commerce Unit of Measurement (UoM) account settings.
dimensionL Decimal No The product length - based on Helcim Commerce Unit of Measurement (UoM) account settings.
dimensionH Decimal No The product height - based on Helcim Commerce Unit of Measurement (UoM) account settings.
shippingExempt Integer No 1 or 0 - Whether the product is exempt from shipping fees.
taxExempt Integer No 1 or 0 - Whether the product is exempt from taxes.
unitOfMeasure String No The unit of measurement.
commodityCode String No The commodity code.
seoURL String No The SEO URL location.
seoDescription String No The SEO description.
seoTags String No The SEO tags.

Response Fields (XML)

Field Name Type Description
message - XML structure
response Integer 1 or 0. Whether the product was added/edited or not.
responseMessage String Confirmation of completed inventory update.
product - XML structure
id Integer The product ID.
name String The product name.
sku Integer The product sku.
stock Integer The available units of the product.
price Decimal The product price.
salePrice Decimal The product sale price.
availability Integer 1 or 0 - Whether the product is available for sale.
availabilityOnline Integer 1 or 0 - Whether the product is available for sale online.

Errors

For all API requests, there are also generic API authentication and user access restriction errors.
Response Code Error Code Message Description
0 - Invalid Product ID The product ID you provided could not be found.
0 - Product Limit Reached Cannot add a new product.
0 - Missing Field - Product Name The product name is missing.
SKU Already Used by Another Product SKU code is already being used for another product.

Code Samples

Sample Product Edit Response XML

<message>
    <response>1</response>
    <responseMessage>Product Updated</responseMessage>
    <product>
        <id>2438</id>
        <name>New Burger Two</name>
        <sku></sku>
        <stock>0</stock>
        <price>1090.00</price>
        <salePrice>150.00</salePrice>
        <availability>1</availability>
        <availabilityOnline>1</availabilityOnline>
    </product>
</message>

HTML Form Sample HTML

<input type="hidden" name="accountId" value="YOUR-ACCOUNT-ID">
<input type="hidden" name="apiToken" value="YOUR-API-TOKEN">
<input type="hidden" name="action" value="productEdit">
<input type="hidden" name="productId" value="1701232">
<input type="hidden" name="name" value="Detergent">
<input type="hidden" name="productId" value="375">
<input type="hidden" name="categoryId" value="4">
<input type="hidden" name="brandId" value="101">
<input type="hidden" name="Description" value="Cleaning Agent">
<input type="hidden" name="SKU" value="SKU123">
<input type="hidden" name="barcode" value="12356789">
<input type="hidden" name="availability" value="1">
<input type="hidden" name="availabilityOnline" value="1">
<input type="hidden" name="featured" value="0">
<input type="hidden" name="price" value="20.00">
<input type="hidden" name="salePrice" value="15.00">
<input type="hidden" name="weight" value="2.5">
<input type="hidden" name="dimensionW" value="12.5">
<input type="hidden" name="dimensionL" value="18.5">
<input type="hidden" name="dimensionH" value="15.0">
<input type="hidden" name="shippingExempt" value="0">
<input type="hidden" name="taxExempt" value="0">
<input type="hidden" name="unitOfMeasure" value="???????">
<input type="hidden" name="commodityCode" value="04031000">
<input type="hidden" name="seoURL" value="???????">
<input type="hidden" name="seoDescription" value="???????">
<input type="hidden" name="seoTags" value="???????">