Update Product Variants
Updates the specified product variants.
Note
A variant cannot be moved to a different product on update; the productId of an existing variant is fixed. The productId field is still required in the request body (it must match the variant's current product), but any other value is ignored rather than rejected.
| Verb | PATCH |
|---|---|
| Endpoint | {base-url}/products/variants |
| Max Page Size | N/A |
Request Body
Request Body
{
"body": [
{
"id": 1,
"productId": 132856,
"description": "12oz Can",
"customField1": "1",
"customField2": "2",
"customField3": "3",
"CustomField4": "4",
"customField5": "5",
"customField6": "6",
"customField7": "7",
"customField8": "8",
"customField9": "9",
"customField10": "10",
"customField11": "11",
"customField12": "12",
"customField13": "13",
"customField14": "14",
"customField15": "15"
}
]
}
Note
All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.
Returns
On Success
The requested set of product variants.
Response Body
[
{
"id": 1,
"productId": 132856,
"description": "12oz Can",
"customField1": "1",
"customField2": "2",
"customField3": "3",
"customField4": "4",
"customField5": "5",
"customField6": "6",
"customField7": "7",
"customField8": "8",
"customField9": "9",
"customField10": "10",
"customField11": "11",
"customField12": "12",
"customField13": "13",
"customField14": "14",
"customField15": "15"
}
]
On Error
| HTTP Code | Error Code | Definition |
|---|---|---|
| 403 | DATA_ACCESS_VIOLATION | One or more of the specified variant IDs belong to an organization you do not have access to. |
| 404 | MISSING_RECORD | One or more of the specified variant id values does not exist. |
| 422 | VALIDATION_ERROR | A required field (productId, description) is missing or invalid. |
| 422 | VALIDATION_ERROR | description exceeds 50 characters, or a customField value exceeds 50 characters. |
| 422 | description_conflict | Two or more variants in the request share the same description within the same product, or a description already exists in the database for that product. |