Update variant
update_variantUpdate an existing product variant by sending only changed fields like pricing or stocks. Replaces whole media, stocks, and characteristics lists, so resend current values for those.
Instructions
Update an existing variant via JSON Merge Patch: send only the fields to change (e.g. pricing or stocks). No field of UpdateVariantRequest is nullable, so null values are rejected by validation before any call — to clear a price, use bulk_update_prices (its price/manual_discount_price accept null). media is an exception to merge-patch granularity: sending it REPLACES the whole list, so resend the existing images alongside anything you add. At most ONE video per variant, and a video is accepted only when the same list carries at least one image — sending a video alone wipes the images and fails. stocks and characteristics replace the whole list too; rebuild them from a fresh get_variant, which IS the complete current state (an empty characteristics list is genuinely empty, nothing hidden). Call get_operation_schema("UpdateVariant") for the exact request shape — but ignore its prose for stocks: upstream the spec pasted the media wording there, while the field still takes VariantStock entries (per-warehouse quantities).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Variant ID (UUID). | |
| variant | Yes | Merge-patch record matching the UpdateVariantRequest schema (see get_operation_schema("UpdateVariant")). Must not be empty. |