Create Template Selections
Create Template Selections
Creates the specified template selection(s).
| Verb | PUT |
|---|---|
| Endpoint | {base-url}/template-selections/ |
| Max Page Size | N/A |
Request body
{
"body": [
{
"variantId": null,
"templateId": 2,
"selectionNumber": 1,
"productId": 44787,
"price": 1.75,
"invoicePrice": 1.10,
"par": 10,
"depth": 5,
"commission": null,
"tax": null,
"customData1": null,
"customData2": null,
"customData3": null,
"customData4": null,
"customData5": null
}
]
}
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 created template selection(s).
Response body
[
6
]
On Error
| HTTP Code | Error Code | Definition |
|---|---|---|
| 403 | DATA_ACCESS_VIOLATION | One or more of the specified templateId, productId, or variantId values belong to an organization you do not have access to. |
| 404 | MISSING_RECORD | One or more of the specified templateId, productId, or variantId values does not exist. |
| 422 | VALIDATION_ERROR | A required field is missing or invalid (e.g. templateId must be a positive integer, selectionNumber must be a positive integer, price and invoicePrice must be non-negative, customData fields must be 50 characters or fewer). |
| 422 | SELECTION_NUMBER_CONFLICT | Two or more selections in the request share the same selectionNumber within the same template, or a selectionNumber already exists on that template. |