Create an option set

POST /company/companies/@id/optionsets

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 company where to create a new option set

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 set
allow_attachment Bool Allow the attachment of a picture to this option set
code String? Optional. Nullable. Your own ID or key that you can associate with an option set

Example request 1 Create an option set

POST /company/companies/2931/optionsets HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 525aa0915913137e479ee73e9370e36839fc9c1de324de3fb76ce7df4085e6dd74749ac3122404f89e69dc8687b3cc42c449315d9dc12f85ada396d363768c93b733e8883ebf0ff4534838b3a5bf36405aa6de0b15b29aef9fb3545d98fffc53378ae1ef
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 233
{
    "name": {
        "nl": "Wil je je brood gesneden hebben?",
        "en": "Do you want your bread sliced?",
        "fr": "Est ce que vous voulez votre pain coupé?"
    },
    "allow_attachment": false,
    "code": "ID15896"
}

Example request 2 Missing allow_attachment when creating an option set

POST /company/companies/2931/optionsets HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 525aa0915913137e479ee73e9370e36839fc9c1de324de3fb76ce7df4085e6dd74749ac3122404f89e69dc8687b3cc42c449315d9dc12f85ada396d363768c93b733e8883ebf0ff4534838b3a5bf36405aa6de0b15b29aef9fb3545d98fffc53378ae1ef
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 179
{
    "name": {
        "nl": "Wil je je brood gesneden hebben?",
        "en": "Do you want your bread sliced?",
        "fr": "Est ce que vous voulez votre pain coupé?"
    }
}

Example request 3 Missing name when creating an option set

POST /company/companies/2931/optionsets HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 525aa0915913137e479ee73e9370e36839fc9c1de324de3fb76ce7df4085e6dd74749ac3122404f89e69dc8687b3cc42c449315d9dc12f85ada396d363768c93b733e8883ebf0ff4534838b3a5bf36405aa6de0b15b29aef9fb3545d98fffc53378ae1ef
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 33
{
    "allow_attachment": false
}

Response

Field Type Description
name [Language: String] Name of the option set
allow_attachment Bool Allow the attachment of a picture to this option set
options [company.Option] Array of company.Option
id Int Id of the option set
code String? Nullable. Your own ID or key that you can associate with an option set

Example response 1 Create an option set

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

{
    "id": 8343,
    "name": {
        "nl": "Wil je je brood gesneden hebben?",
        "fr": "Est ce que vous voulez votre pain coupé?",
        "en": "Do you want your bread sliced?"
    },
    "allow_attachment": false,
    "code": "ID15896",
    "options": []
}

Example response 2 Missing allow_attachment when creating an option set

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 146

[
    {
        "code": "missing_field",
        "message": "Field allow_attachment is required",
        "field": "data.allow_attachment"
    }
]

Example response 3 Missing name when creating an option set

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 122

[
    {
        "code": "missing_field",
        "message": "Field name is required",
        "field": "data.name"
    }
]
Version update available Please adjust your integration to the latest stable version (1.5.2)
1.5.0 stable