Skip to content

Update Template Selections

Updates the specified template selection(s).

Note

A template selection cannot be moved to a different template on update; its templateId is fixed. The templateId field is still required in the request body (it must match the selection's current template), but any other value is ignored rather than rejected.

Verb PATCH
Endpoint {base-url}/template-selections/
Max Page Size N/A

Request body

{
  "body": [
    {
      "id": 11242,
      "variantId": null,
      "templateId": 2,
      "selectionNumber": 3,
      "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 updated template selections.

Response body

[
  {
    "id": 11242,
    "variantId": null,
    "templateId": 2,
    "selectionNumber": 3,
    "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
  }
]

On Error

HTTP Code Error Code Definition
403 DATA_ACCESS_VIOLATION One or more of the specified template selection id, productId, or variantId values belong to an organization you do not have access to.
404 MISSING_RECORD One or more of the specified template selection id, 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 the new selectionNumber is already used by a different selection on that template. A selection keeping its current selectionNumber is not a conflict.