ArticleChoice

An object representing a choice for customers to make when ordering an article.

Properties

Property Description
uid The unique identifier of the choice.
type The type of choice: "enum" for selecting among options, "number" if the customer is expected to enter a numeric value or "string" if the customer is expected to enter text.
name An object with language codes as the properties and the name of the choice in each language as the values.
description An object with language codes as the properties and the description of the choice in each language as the values. Exists only if "type" is "number" or "string".
mandatory Whether this choice is mandatory for customers when ordering an article with this choice.

Choices of type "number" has the following additional properties:

Property Description
maximum The maximum value allowed (optional).
minimum The minimum value allowed (default is 0).
multipleOf The entered value must be a multiple of this value. Possible values are 1, 0.1, 0.01, 0.001 and 0.0001.
quantity Whether the entered value is a quantity. If true, the price of the article is multiplied with the entered value.

Choices of type "enum" have the following additional properties:

Property Description
options An array of unique identifiers representing ArticleChoiceOption objects.
quantityChoicesAffectsOptionPrices Whether the price of options should be affected by any quantity choices on the same article, i.e. numeric choices with quantity set to true.

Methods

get

Fetches an article-choice object.

Parameters

Parameter Description
uid The unique identifier of an article choice.
query Which info to return. See Query language.

Example

Request:

API Console
ArticleChoice.get(879278, true)
Response
{
  "mandatory": true,
  "name": {
    "en": "Size"
    "sv": "Storlek"
  },
  "optionPricesPerQuantity": false,
  "options": [
    57129002,
    57129003,
    57129004
  ],
  "quantityChoicesAffectsOptionPrices": false,
  "type": "enum",
  "uid": 159615
}

getSchema

Fetches the JSON Schema which can be used for client-side validation.

Parameters

The unique identifier of an article choice or null for a new article choice.