Update a Variant
OAuthScope
ZohoCommerce.items.UPDATE
HTTP Request
PUT https://commerce.zoho.com/store/api/v1/variants/
Body Parameters
Parameter | Description |
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. |
document_ids | array: Give set of document_id of the iamges to map with variants. |
status | string: Give status of the variant. Allowed values: active, inactive. |
sku | string: Give SKU for the variant. |
custom_fields | array: Give set of custom_field values for the variant. |
customfield_id | long: Give unique custom field 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 calculate 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. |
Sample Request
Copiedcurl -i -X PUT \
-H "Authorization:Zoho-oauthtoken ***" \
-H "X-com-zoho-store-organizationid:682219181" \
-H "Content-Type:application/json" \
-d \
'{"rate": "1610","status" : "inactive"}' \
'https://commerce.zoho.com/store/api/v1/variants/1706707000000562040'
Success Response
Copied{
"code": 0,
"message": "Variant Updated successfully",
"variant": {
"product_id": "1706707000000561016",
"product_name": "A-line Pink Dress",
"variant_id": "1706707000000562040",
"name": "A-line Pink Dress-XL",
"unit": "",
"is_taxable": true,
"tax_id": "",
"documents": [
],
"description": "",
"tax_name": "",
"tax_percentage": 0,
"tax_type": "",
"product_type": "goods",
"purchase_account_id": "1706707000000034003",
"purchase_account_name": "Cost of Goods Sold",
"account_id": "1706707000000000388",
"account_name": "Sales",
"inventory_account_id": "1706707000000034001",
"inventory_account_name": "Inventory Asset",
"tags": [
],
"tax_exemption_id": "",
"tax_exemption_code": "",
"attribute_id1": "1706707000000067329",
"attribute_id2": "",
"attribute_id3": "",
"attribute_name1": "Size",
"attribute_name2": "",
"attribute_name3": "",
"attribute_type1": "Text",
"attribute_type2": "",
"attribute_type3": "",
"status": "inactive",
"source": "api",
"is_combo_product": false,
"variant_type": "inventory",
"rate": 1610,
"label_rate": 2100,
"pricebook_rate": 1610,
"purchase_rate": 0,
"reorder_level": 5,
"initial_stock": 30,
"initial_stock_rate": 1600,
"package_details": {
"length": "",
"width": "",
"height": "",
"weight": "",
"weight_unit": "lb",
"dimension_unit": "in"
},
"vendor_id": "",
"vendor_name": "",
"stock_on_hand": 30,
"asset_value": "",
"available_stock": 30,
"actual_available_stock": 30,
"available_sale_stock": 30,
"sku": "W005-51-121",
"upc": "",
"ean": "",
"isbn": "",
"part_number": "",
"attribute_option_id1": "1706707000000067343",
"attribute_option_id2": "",
"attribute_option_id3": "",
"attribute_option_name1": "XL",
"attribute_option_name2": "",
"attribute_option_name3": "",
"attribute_option_data1": "",
"attribute_option_data2": "",
"attribute_option_data3": "",
"image_name": "",
"custom_fields": [
],
"custom_field_hash": {
},
"purchase_description": "",
"image_type": "",
"sales_channels": [
]
}
}
Show full
Show less