# Update a variant by ID Updates an existing variant record. Endpoint: PUT /v1/api/variant/{id} Version: 1.2.4 Security: X-Api-Key ## Path parameters: - `id` (string, required) Variant ID ## Request fields (application/json): - `productId` (string) Product ID of the variant. Example: "o1p2q3r4s5t6u7v8w9x0y1z2" - `manageStock` (boolean) Whether the variant manages stock. Example: true - `sku` (string) SKU of the variant. Example: "1234567890" - `isOnSale` (boolean) Whether the variant is on sale. Example: true - `barcode` (string) Barcode of the variant. Example: "1234567890" - `price` (number) Regular price of the variant. Example: 100 - `salePrice` (number) Sale price of the variant. Example: 90 - `externalId` (string) External ID of the variant. Example: "1234567890" - `allowBackorder` (boolean) Whether the variant allows backorder. Example: true - `costPrice` (number) Cost price of the variant. Example: 80 - `images` (array) Images of the variant. Example: ["https://example.com/image1.jpg","https://example.com/image2.jpg"] - `metadata` (array) Metadata associated with the Variant. Example: [{"key":"key1","value":"value1"},{"key":"key2","value":"value2"}] - `metadata.key` (string, required) Key of the metadata entry. Example: "key1" - `metadata.value` (string, required) Value of the metadata entry. Example: "value1" - `metadata.externalId` (string) External ID associated with the metadata entry. Example: "ext123" - `attributes` (array) Attributes associated with the Variant. Example: [{"name":"color","value":"red"}] - `attributes.name` (string, required) Name of the attribute. Example: "color" - `attributes.values` (array) Values of the attribute. Example: ["red","blue"] - `attributes.value` (string) Value of the attribute. Example: "red" - `inventory` (array) Inventory associated with the Variant. Example: [{"stock":10,"outletId":"o1p2q3r4s5t6u7v8w9x0y1z2"}] - `inventory.stock` (number, required) Stock of the variant inventory. Example: 10 - `inventory.outletId` (string, required) Outlet ID of the variant inventory. Example: "o1p2q3r4s5t6u7v8w9x0y1z2" ## Response 200 fields (application/json): - `id` (string) Unique identifier for the Variant. Example: "o1p2q3r4s5t6u7v8w9x0y1z2" - `createdAt` (string) Timestamp when the Variant was created. Example: "2025-12-07T19:31:48.436+00:00" - `updatedAt` (string) Timestamp when the Variant was last updated. Example: "2025-12-07T19:35:48.436+00:00" - `companyId` (string) Company ID associated with the Variant. Example: "o1p2q3r4s5t6u7v8w9x0y1z2" - `productId` (string) Product ID of the variant. Example: "o1p2q3r4s5t6u7v8w9x0y1z2" - `manageStock` (boolean) Whether the variant manages stock. Example: true - `sku` (string) SKU of the variant. Example: "1234567890" - `isOnSale` (boolean) Whether the variant is on sale. Example: true - `barcode` (string) Barcode of the variant. Example: "1234567890" - `price` (number) Regular price of the variant. Example: 100 - `salePrice` (number) Sale price of the variant. Example: 90 - `externalId` (string) External ID of the variant. Example: "1234567890" - `allowBackorder` (boolean) Whether the variant allows backorder. Example: true - `costPrice` (number) Cost price of the variant. Example: 80 - `images` (array) Images of the variant. Example: ["https://example.com/image1.jpg","https://example.com/image2.jpg"] - `metadata` (array) Metadata associated with the Variant. Example: [{"key":"key1","value":"value1"},{"key":"key2","value":"value2"}] - `metadata.key` (string, required) Key of the metadata entry. Example: "key1" - `metadata.value` (string, required) Value of the metadata entry. Example: "value1" - `metadata.externalId` (string) External ID associated with the metadata entry. Example: "ext123" - `attributes` (array) Attributes associated with the Variant. Example: [{"name":"color","value":"red"}] - `attributes.name` (string, required) Name of the attribute. Example: "color" - `attributes.values` (array) Values of the attribute. Example: ["red","blue"] - `attributes.value` (string) Value of the attribute. Example: "red" - `inventory` (array) Inventory associated with the Variant. Example: [{"stock":10,"outletId":"o1p2q3r4s5t6u7v8w9x0y1z2"}] - `inventory.stock` (number, required) Stock of the variant inventory. Example: 10 - `inventory.outletId` (string, required) Outlet ID of the variant inventory. Example: "o1p2q3r4s5t6u7v8w9x0y1z2" ## Response 400 fields (application/json): - `statusCode` (number, required) HTTP status code Example: 400 - `message` (string, required) Error message describing what went wrong Example: "Validation failed: Field `schemaField` is required." - `error` (string, required) Error type/name Enum: "Bad Request", "Unauthorized", "Forbidden", "Not Found", "Conflict", "Unprocessable Entity", "Internal Server Error" ## Response 404 fields (application/json): - `statusCode` (number, required) HTTP status code Example: 404 - `message` (string, required) Error message describing what went wrong Example: "The resource was not found." - `error` (string, required) Error type/name Enum: "Bad Request", "Unauthorized", "Forbidden", "Not Found", "Conflict", "Unprocessable Entity", "Internal Server Error"