Create an option

POST /company/optionsets/@id/options

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

URL parameters

Replace the @ keywords in the URL with their corresponding value.

A dictionary with fields

Field Type Description
id Int ID of the option set where to create a new option

Body

Pass the following properties via application/json or form encoding in the body of the request.

Field Type Description
name [Language: String] Name of the option
price_change Int Price change in cents. Positive for price increase, negative for discounts.
order Int The options of a option set are sorted on the order property (descending). If you specify the same order for multiple option sets, the id of the option set is used. Setting the same order for all option sets is discouraged.
code String? Optional. Nullable. Your own ID or key that you can associate with an option

Example request 1 Create a simple option

POST /company/optionsets/457/options HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer a2e51f9f9d55302fec20956cf3615e7136728a6b63706f2e30c56523147337ff601cbc0461245cdd0bde4768ce0c1d15456da199cf10676da84a3cc89cb6017b6bf8e27b4cb068034d7a0470e0d5c1af97135123adf2b65a38af18d80a5b915270031cff
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 153
{
    "name": {
        "nl": "Ja",
        "en": "Yes",
        "fr": "Oui"
    },
    "price_change": -10,
    "order": 200,
    "code": "OPTION_859"
}

Response

Field Type Description
name [Language: String] Name of the option
price_change Int Price change in cents. Positive for price increase, negative for discounts.
id Int ID of this option
code String? Nullable. Your own ID or key that you can associate with an option
order Int The options of a option set are sorted on the order property (descending). If you specify the same order for multiple option sets, the id of the option set is used. Setting the same order for all option sets is discouraged.

Example response 1 Create a simple option

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 169

{
    "id": 1605,
    "name": {
        "nl": "Ja",
        "en": "Yes",
        "fr": "Oui"
    },
    "price_change": -10,
    "code": "OPTION_859",
    "order": 200
}
1.5.0 stable