An object representing an Article variant, which has it's own stock and article number.
This object is only accessible by admin.
Property | Type | Description |
---|---|---|
uid | integer | The unique identifier of the article variant. |
stock | number | The total amount of the stock. |
articleNumber | string | An optional identifier of the article modifiable by an adminstrator. |
article | integer | Article UID |
image | string | An URL to the article variant image. |
Fetches information about an article variant. You need the unique identifier of the article variant.
Parameter | Description |
---|---|
uid | The unique identifier of an article variant. |
query | Which info to return. See Query language. |
Fetches the JSON Schema which can be used for client-side validation.
The unique identifier of an article variant or null
for a new article article variant.
Fetches multiple article variants as an array of article variants objects.
Parameter | Description |
---|---|
query | Which info to return. See Query language. |
selection | Which articles to list. See List language. |
Takes a filter object and returns the number of article variants found, as an integer.
A filter object specifying which article variants to count. See Filter objects on the page List selection.
Updates an article variant.
Parameter | Description |
---|---|
uid | The unique identifier of an article variant. Null is not allowed to create new variant. |
patch | An object containing the properties and values to set for the article variant. |
query | A query specifying what to return after a successful set (optional). See Query language. |
Validates the data to be set. The performed validation is the same as in set; it validates the resulting object and includes all of the required properties. However, nothing is saved.
Parameter | Description |
---|---|
uid | The unique identifier of an existing article variant. |
patch | An object containing the properties and values to set before validating. |
Error messages are given as an array of validation-error objects, each containing the keys pointer
(a property referenced using a JSON Pointer) and message
(a readable text in the language of the context).
If there are no validation errors, then an empty array is returned.
Fetches a normalized version of the patch. Uses the same parameters as set and validate.
While set also normalizes the patch, before storing, normalize only returns the normalized patch. Any properties with numeric values represented as strings are converted to number literals. A normalization error is thrown when we are unable to convert a string to a number literal.
Parameter | Description |
---|---|
uid | The unique identifier of an article variant. |
patch | An object containing the properties and values to normalize. |