Update an option

PATCH /company/options/@id

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 you want to update

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 Edit all data of a simple option

PATCH /company/options/1744 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 119b4ec67c0b010a07096fb417d1f31725349761daee95a91f016f88b1801c738ba1b97e3c20b85a853387e87febb4394a511f43c1675010289d2981001f5f2bb43c5f53d95e06df29aaf452d6cc45709b28de1f3be629f89a067b0d27f6143df842b235
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 172
{
    "name": {
        "nl": "Nee",
        "en": "No",
        "fr": "Non",
        "es": "Non"
    },
    "price_change": 78545,
    "order": 300,
    "code": "8591TF"
}

Example request 2 Only edit the name

PATCH /company/options/1744 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 119b4ec67c0b010a07096fb417d1f31725349761daee95a91f016f88b1801c738ba1b97e3c20b85a853387e87febb4394a511f43c1675010289d2981001f5f2bb43c5f53d95e06df29aaf452d6cc45709b28de1f3be629f89a067b0d27f6143df842b235
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 84
{
    "name": {
        "nl": "Ja",
        "en": "Yes",
        "fr": "Oui"
    }
}

Example request 3 Edit price change

PATCH /company/options/1744 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 119b4ec67c0b010a07096fb417d1f31725349761daee95a91f016f88b1801c738ba1b97e3c20b85a853387e87febb4394a511f43c1675010289d2981001f5f2bb43c5f53d95e06df29aaf452d6cc45709b28de1f3be629f89a067b0d27f6143df842b235
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 30
{
    "price_change": 999856
}

Example request 4 Edit price change

PATCH /company/options/1744 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 119b4ec67c0b010a07096fb417d1f31725349761daee95a91f016f88b1801c738ba1b97e3c20b85a853387e87febb4394a511f43c1675010289d2981001f5f2bb43c5f53d95e06df29aaf452d6cc45709b28de1f3be629f89a067b0d27f6143df842b235
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 18
{
    "order": 0
}

Example request 5 Update code

PATCH /company/options/1744 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 119b4ec67c0b010a07096fb417d1f31725349761daee95a91f016f88b1801c738ba1b97e3c20b85a853387e87febb4394a511f43c1675010289d2981001f5f2bb43c5f53d95e06df29aaf452d6cc45709b28de1f3be629f89a067b0d27f6143df842b235
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 25
{
    "code": "54332AD"
}

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 Edit all data of a simple option

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

{
    "id": 1744,
    "name": {
        "en": "No",
        "fr": "Non",
        "es": "Non",
        "nl": "Nee"
    },
    "price_change": 78545,
    "code": "8591TF",
    "order": 300
}

Example response 2 Only edit the name

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

{
    "id": 1744,
    "name": {
        "en": "Yes",
        "fr": "Oui",
        "nl": "Ja"
    },
    "price_change": 78545,
    "code": "8591TF",
    "order": 300
}

Example response 3 Edit price change

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

{
    "id": 1744,
    "name": {
        "en": "Yes",
        "fr": "Oui",
        "nl": "Ja"
    },
    "price_change": 999856,
    "code": "8591TF",
    "order": 300
}

Example response 4 Edit price change

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

{
    "id": 1744,
    "name": {
        "en": "Yes",
        "fr": "Oui",
        "nl": "Ja"
    },
    "price_change": 999856,
    "code": "8591TF",
    "order": 0
}

Example response 5 Update code

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

{
    "id": 1744,
    "name": {
        "en": "Yes",
        "fr": "Oui",
        "nl": "Ja"
    },
    "price_change": 999856,
    "code": "54332AD",
    "order": 0
}
1.5.0 stable