Create Product Variants
Create the provided list of product variants.
| Verb | PUT |
|---|---|
| Endpoint | {base-url}/products/variants |
| Max Page Size | N/A |
Request Body
Request Body
{
"body": [
{
"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 IDs of the newly created product variants.
Response Body
[
98
]
On Error
| HTTP Code | Error Code | Definition |
|---|---|---|
| 403 | DATA_ACCESS_VIOLATION | One or more of the specified productId values belongs to an organization you do not have access to. |
| 404 | MISSING_RECORD | One or more of the specified productId 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. |