Update Variant By SKU

Update a product variant by its SKU.

🔒

Requires write_product access scope. More access scope

The Update Variant by SKU API allows users to update the details of a specific product variant using its SKU. This endpoint is useful for managing inventory, pricing, and other variant-specific attributes by targeting the unique SKU of a variant. It provides flexibility in updating multiple fields of the variant in a single API call.This API is especially useful for:

  1. Update inventory and pricing details for a specific SKU.
  2. Modify metadata such as barcode, weight, or custom notes for better variant management.

Request Parameters

Public Request Parameters

📘

Path Parameters

ParameterTypeRequiredExampleDescription
skustringYes"ABC123"SKU of the product to retrieve variants.

Body Parameters

FieldTypeRequiredExampleDescription
variant.compare_at_pricefloatNo99.99The original price of the variant before discount.
variant.pricefloatNo9.99The current price of the variant.
variant.barcodestringNo"123456789"The barcode for the variant for inventory or sales tracking.
variant.notestringNoSeasonal saleCustom notes or remarks for the variant.
variant.inventory_quantityintNo100The current inventory level for the variant.
variant.weightfloatNo1.5The weight of the variant.
variant.weight_unitstringNokgThe unit of measurement for the weight. (e.g., kg, g, lb, oz)
variant.cost_pricefloatNo50.00The cost price of the variant.
variant.retail_pricefloatNo120.00The recommended retail price for the variant.
refuse_multi_resultboolNotruefalse: If sku matches multiple sub-items, update the matched sub-items normally.
true: Rejects the update if the sku matches more than one subitem

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring"200"HTTP status code
messagestring"Success"Operation result message
data.variantarray of objects-

Variant Object

ParameterTypeExampleDescription
idstring"var_987654321"Unique variant identifier
product_idstring"prod_123456789"Parent product ID
image_idstring"img_456789"Primary image reference
created_atstring"2025-01-15T09:00:00Z"Creation timestamp
updated_atstring"2025-06-15T14:30:00Z"Last update timestamp
titlestring"Large / Black"Variant display title
option1string"Black"First option value
option2string"Large"Second option value
option3string""Third option value
imageobject-Variant image details
image.srcstring"https://example. com/image.jpg"Image URL
image.widthint32800Image width in pixels
image.heightint32600Image height in pixels
image.altstring"Black variant"Image alt text
image.pathstring"/images/variants"Image storage path
positionstring"1"Display position
compare_at_pricefloat199.99Original/comparison price
pricefloat149.99Current selling price
skustring"SKU123-BLK-L"Stock keeping unit
barcodestring"123456789012"Product barcode
notestring"New stock"Internal notes
inventory_quantitystring"50"Current stock level
weightfloat0.75Product weight
weight_unitstring"kg"Weight measurement unit
cost_pricefloat89.99Cost/production price
whole_pricesarray of objects-Wholesale pricing tiers
whole_prices.pricefloat129.99Wholesale price
whole_prices. min_quantitystring"10"Minimum order quantity
retail_pricefloat149.99Retail price
is_discountbooleantrueDiscount status flag
origin_pricefloat179.99Original base price
extendobject-Extended properties
extend.lengthfloat25.5Product length
extend.widthfloat18.0Product width
extend.heightfloat8.5Product height
extend. dimension_unitstring"cm"Dimension unit
extend. origin_country_codestring"CN"Country of origin
extend.hs_codestring"8518.29.00"Harmonized System code

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!