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/165/optionsets HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 6a3f355ab70a1adee6bfb6f3853bd7145ab8747696f6d111a7d0c2cc72d3f3d53c26d9f67438bc2d23c8175d252103160b1ea26c23ca364c3752b3da002213390c2342f1cc14a1c8cf4d31bacee1b37bbf45c661f66ef8a67fb1a547b8723c31497ad412
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/165/optionsets HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 6a3f355ab70a1adee6bfb6f3853bd7145ab8747696f6d111a7d0c2cc72d3f3d53c26d9f67438bc2d23c8175d252103160b1ea26c23ca364c3752b3da002213390c2342f1cc14a1c8cf4d31bacee1b37bbf45c661f66ef8a67fb1a547b8723c31497ad412
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/165/optionsets HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 6a3f355ab70a1adee6bfb6f3853bd7145ab8747696f6d111a7d0c2cc72d3f3d53c26d9f67438bc2d23c8175d252103160b1ea26c23ca364c3752b3da002213390c2342f1cc14a1c8cf4d31bacee1b37bbf45c661f66ef8a67fb1a547b8723c31497ad412
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: 267

{
    "id": 452,
    "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"
    }
]
1.5.0 stable