Create a Product with Variant
OAuthScope
ZohoCommerce.items.CREATE
HTTP Request
POST https://commerce.zoho.com/store/api/v1/products
Body Parameters
Parameter | Description |
name* | string: Name of the product. |
url* | string: URL of the product. |
variant_type | string: Give variant_type as "inventory" to track inventory stock for the product. |
product_short_description | string: Concise description of the product. |
product_description | string: Detailed description of the product. |
show_in_storefront | boolean: When enabled, this shows the product in store. |
attribute_name1,attribute_name2, attribute_name3 | string: Give attribute name for the product. You can add maximum of 3 attributes. |
attribute_type1,attribute_type2,attribute_type3 | string: Give attribute type corresponding to the attribute name given. Two possible values are Text (default value) or Color. |
category_id | category_id long: Give the unique category_id to map the category. |
tags | array: Give the list of tags for the product. |
brand | string: Give the brand name for the product. |
is_returnable | boolean: Enable this if product can be returned by the customers. |
is_featured | boolean: Enable this if product is on sale. |
seo_title | string: Give title for SEO. |
seo_keyword | string: Give SEO keywords for the product. |
seo_description | string: Give SEO description for the product. |
specificationset_id | long: Give unique specification set ID to give specification details for the product. |
specifications | array: Give set of specification_id and specification_value_id. |
specification_id | long: Give unique specification id that denotes the label. |
specification_value_id | long: Give unique specification value id that denotes the value for the particular label. |
variants* | array: Give list of all the variants for the product |
rate | string: Give selling price of the variant |
initial_stock | string: Give stock count for the variant. This field is MANDATORY if you pass variant_type as "inventory". |
attribute_option_name1, attribute_option_name2, attribute_option_name3 | string: Give attribute values for the corresponding attributes. For Eg: If attribute_name1 is SIZE then give attribute_option_name1 (eg: large,medium,..etc) with the corresponding values. |
attribute_option_data1, attribute_option_data2, attribute_option_data3 | string: Give color code for the correspoding attributes. This field is only needed when you give attribute_type as colour.For Eg: If attribute_type2 is Colour then give corresponding color code value in attribute_option_data2. |
label_rate | string: Give retail price of the variant. |
sku | string: Give SKU for the variant. |
custom_fields | array: Give set of customfield_id and value for the variant |
customfield_id | long: Give unique cusomfield id to denote the label. |
value | string: Give corresponding values for the label. |
reorder_level | string: Low stock limit for the variant below which will trigger an email remainder. |
package_details | array: Give package details such as weight, width, height and length. This is used to calcuate shipping charges at the time of checkout. |
height | string: Give the package height. |
weight | string: Give the package weight. |
length | string: Give the package length. |
width | string: Give the package width |
ean | string: Give EAN for the variant |
upc | string: Give UPC for the variant. |
isbn | string: Give ISBN for the variant. |
part_number | string: Give MPN for the variant. |
hsn_or_sac | string: Give HSN or SAC for the variant. For India Only |
avatax_tax_code | string:: Give Avalara tax code for the variant. For US Only |
Request Example
Copiedcurl -i -X POST
-H "Authorization:Zoho-oauthtoken ***"
-H "X-com-zoho-store-organizationid:682219181"
-H "Content-Type:application/json"
-d
'{
"name": "A-line Pink Dress",
"category_id": "1706707000000068762",
"is_returnable": true,
"seo_title": "A-line Pink dress",
"seo_keyword": "Pink-dress, A-line",
"attribute_name1": "size",
"attribute_type1": "text",
"variants": [
{
"attribute_option_name1": "L",
"rate": "1539",
"reorder_level": "5",
"initial_stock": "25",
"status": "",
"label_rate": "2199",
"sku": "W005-51-120",
"isbn": "",
"upc": "",
"ean": "",
"part_number": "",
"package_details": {
"weight": "",
"height": "",
"length": "",
"width": "",
},
"custom_fields": [
{
"customfield_id": "76437000000276004",
"value": "Test comment"
},
{
"customfield_id": "76437000000276036",
"value": ""
}
]
}
],
"tags": [
"Pink",
"A-line"
],
"brand": "Remy",
"url": "a-line-pink-dress1",
"variant_type": "inventory",
"show_in_storefront": true
}'
'https://commerce.zoho.com/store/api/v1/products'
Success Response
Copied{
"code": 0,
"message": "Product Created Successfully",
"product": {
"product_id": "1706707000000561016",
"account_id": "1706707000000000388",
"ancestor_categories": [
{
"parent_category_id": "null",
"category_id": "1706707000000068762",
"name": "Partywear",
"url": "partywear"
}
],
"attribute1": {
"name": "Size",
"options": [
{
"option_id": "1706707000000067341",
"option_name": "L"
}
],
"id": "1706707000000067329",
"type": "Text"
},
"attribute2": {
},
"attribute3": {
},
"show_in_storefront": true,
"show_in_pos": false,
"show_in_both": false,
"attribute_id1": "1706707000000067329",
"attribute_id2": "",
"attribute_id3": "",
"attribute_name1": "Size",
"attribute_name2": "",
"attribute_name3": "",
"attribute_type1": "Text",
"attribute_type2": "",
"attribute_type3": "",
"attributes": [
{
"id": "1706707000000067329",
"name": "Size",
"type": "text",
"options": [
{
"id": "1706707000000067341",
"name": "L",
"data": ""
}
]
}
],
"brand": "Remy",
"category_id": "1706707000000068762",
"category": {
"category_id": "1706707000000068762",
"category_name": "Partywear"
},
"description": "",
"product_description": "",
"product_short_description": "",
"documents": [
],
"has_variant": false,
"image_name": "",
"image_type": "",
"inventory_account_id": "1706707000000034001",
"is_taxable": true,
"is_returnable": true,
"manufacturer": "",
"name": "A-line Pink Dress",
"purchase_account_id": "1706707000000034003",
"seo_description": "",
"seo_keyword": "Pink-dress, A-line",
"seo_title": "A-line Pink dress",
"specifications": [
],
"specificationset_id": "",
"specificationset_name": "",
"tags": [
{
"tag_name": "Pink",
"tag_id": "1706707000000557078"
},
{
"tag_name": "A-line",
"tag_id": "1706707000000557080"
}
],
"product_tags": [
{
"tag_name": "Pink",
"tag_id": "1706707000000557078"
},
{
"tag_name": "A-line",
"tag_id": "1706707000000557080"
}
],
"page_layout_id": "",
"url": "a-line-pink-dress",
"variant_type": "inventory",
"variants": [
{
"variant_id": "1706707000000561018",
"attribute_id1": "1706707000000067329",
"attribute_id2": "",
"attribute_id3": "",
"attribute_name1": "Size",
"attribute_name2": "",
"attribute_name3": "",
"attribute_type1": "Text",
"attribute_type2": "",
"attribute_type3": "",
"attribute_option_id1": "1706707000000067341",
"attribute_option_id2": "",
"attribute_option_id3": "",
"attribute_option_name1": "L",
"attribute_option_name2": "",
"attribute_option_name3": "",
"attribute_option_data1": "",
"attribute_option_data2": "",
"attribute_option_data3": "",
"collect_variant_level_data": "",
"created_time": "2019-12-20T00:46:02-0700",
"description": "",
"ean": "",
"image_name": "",
"image_type": "",
"documents": [
],
"isbn": "",
"is_combo_product": false,
"is_linked_with_zohocrm": false,
"is_taxable": true,
"last_modified_time": "2019-12-20T00:46:02-0700",
"package_details": {
"length": "",
"width": "",
"height": "",
"weight": "",
"weight_unit": "lb",
"dimension_unit": "in"
},
"name": "A-line Pink Dress-L",
"part_number": "",
"product_type": "goods",
"purchase_description": "",
"purchase_rate": 0,
"rate": 1539,
"label_rate": 2199,
"reorder_level": 5,
"initial_stock": 25,
"initial_stock_rate": 1539,
"sku": "W005-51-120",
"source": "",
"status": "active",
"stock_on_hand": 25,
"actual_available_stock": 25,
"available_stock": 25,
"available_sale_stock": 25,
"custom_fields": [
{
"field_id": "76437000000276004",
"customfield_id": "76437000000276004",
"show_in_store": true,
"show_in_portal": false,
"is_active": true,
"index": 1,
"label": "comment field cf",
"show_on_pdf": false,
"edit_on_portal": false,
"edit_on_store": false,
"api_name": "cf_comment_field_cf",
"show_in_all_pdf": false,
"value_formatted": "Test comment",
"search_entity": "item",
"data_type": "string",
"placeholder": "cf_comment_field_cf",
"value": "Test comment",
"is_dependent_field": false
},
{
"field_id": "76437000000276036",
"customfield_id": "76437000000276036",
"show_in_store": true,
"show_in_portal": false,
"is_active": true,
"index": 2,
"label": "item field",
"show_on_pdf": false,
"edit_on_portal": false,
"edit_on_store": false,
"api_name": "cf_item_field",
"show_in_all_pdf": false,
"value_formatted": "",
"search_entity": "item",
"data_type": "string",
"placeholder": "cf_item_field",
"value": "",
"is_dependent_field": false
}
],
"tax_exemption_id": "",
"upc": "",
"variant_type": "inventory"
}
],
"sales_channels": [
],
"source": "user",
"status": "active",
"tax_exemption_code": "",
"tax_exemption_id": "",
"is_featured": false,
"unit": ""
}
}
Use this API to create a product with n number of variants.