Create a Product with Variant

OAuthScope

ZohoCommerce.items.CREATE

 

HTTP Request

POST https://commerce.zoho.com/store/api/v1/products

 

Body Parameters

ParameterDescription
name*string: Name of the product.
url*string: URL of the product.
variant_typestring: Give variant_type as "inventory" to track inventory stock for the product.
product_short_descriptionstring: Concise description of the product.
product_descriptionstring: Detailed description of the product.
show_in_storefrontboolean: When enabled, this shows the product in store.
attribute_name1,attribute_name2, attribute_name3string: Give attribute name for the product. You can add maximum of 3 attributes.
attribute_type1,attribute_type2,attribute_type3string: Give attribute type corresponding to the attribute name given. Two possible values are Text (default value) or Color.
category_idcategory_id long: Give the unique category_id to map the category.
tags array: Give the list of tags for the product.
brandstring: Give the brand name for the product.
is_returnableboolean: Enable this if product can be returned by the customers.
is_featuredboolean: Enable this if product is on sale.
seo_titlestring: Give title for SEO.
seo_keywordstring: Give SEO keywords for the product.
seo_descriptionstring: Give SEO description for the product.
specificationset_idlong: Give unique specification set ID to give specification details for the product.
specificationsarray: Give set of specification_id and specification_value_id.
specification_idlong: Give unique specification id that denotes the label.
specification_value_idlong: Give unique specification value id that denotes the value for the particular label.
variants* array: Give list of all the variants for the product
ratestring: Give selling price of the variant
initial_stockstring: 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_name3string: 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_data3string: 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_ratestring: Give retail price of the variant.
skustring: Give SKU for the variant.
custom_fieldsarray: Give set of customfield_id and value for the variant
customfield_idlong: Give unique cusomfield id to denote the label.
valuestring: Give corresponding values for the label.
reorder_levelstring: Low stock limit for the variant below which will trigger an email remainder.
package_detailsarray: Give package details such as weight, width, height and length. This is used to calcuate shipping charges at the time of checkout.
heightstring: Give the package height.
weightstring: Give the package weight.
lengthstring: Give the package length.
widthstring: Give the package width
eanstring: Give EAN for the variant
upcstring: Give UPC for the variant.
isbnstring: Give ISBN for the variant.
part_numberstring: Give MPN for the variant.
hsn_or_sacstring: 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.