Create a product

POST /company/companies/@id/products

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 Company ID. Create a product in this company

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 product
description [Language: String] Description of the product
specialty Bool Whether this product is a specialty. Specialties are also displayed in a separate category and are highlighted with a star icon.
active Bool Inactive products are not visible in the webshop
only_order_in_store Bool Whether this product can only get ordered in the store with a separate UI for the shop employees, and not in the public webshop.
price_type PriceType A product has a price type that defines the price calculations and the way consumers can order the product.
price UInt Price of the product (cents). Please note that this value is ignored when price_type is MULTIPLE_CHOICE.
target_price Bool Is true when it's not possible to provide an exact price of this product when ordering (e.g. not exact weight possible). This option might deactive online payments for orders with this product (shop settings).
url_type String String enumarion of 'none', 'recipe', 'website'
url URL? Nullable. An URL field starting with http:// or https://
min_max company.MinMaxSummary The allowed amounts a customer is allowed to order of a product for amount / weight / persons
option_set_ids [Int] ID's of the option sets you want to assign to this product. You can alter the order by switching the position of the ID's
allergen_ids [Int]? Nullable. ID's of the allergens of this product. Set to null if you don't want to specify allergens. Only use an empty array when the product has no allergens. It is a subtle difference but it has legal consequences if you set this to the wrong value. You can find all the available allergen ID's here.
category_id Int The category ID of the product
seo company.SeoData Optional. Product page SEO metatags
price_look_up_code String? Optional. Nullable. A String value
code String? Optional. Nullable. A custom code. You can set this to your own code and use this field to map your products to Bakeronline products

Example request 1 Create a product

POST /company/companies/2926/products HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 1c1a731c967dae53ca878c4f9a84d78a27410ce3a5fe238c68ccb7f7f91be84ff24a26b32b4d7f895df42521d5d11804f04a6489b047f2871483a16e2a8f3b11cb34a835951b8ee13760ba24eb063b64ff0557102b6fba681252d2a705fd3e911df781aa
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 1530
{
    "name": {
        "nl": "Brood",
        "en": "Bread",
        "fr": "Pain"
    },
    "description": {
        "nl": "Beschrijving",
        "en": "Description",
        "fr": "Description"
    },
    "specialty": false,
    "active": true,
    "only_order_in_store": false,
    "allergen_ids": [
        1,
        2,
        4
    ],
    "price_look_up_code": "123",
    "price_type": "PER_UNIT",
    "price": 1200,
    "target_price": false,
    "url_type": "recipe",
    "url": "https://www.google.be",
    "min_max": {
        "amount": {
            "minimum": 1,
            "maximum": null,
            "maximum_day": null,
            "maximum_week": null
        },
        "weight": {
            "minimum": 100,
            "maximum": null,
            "maximum_day": null,
            "maximum_week": null,
            "suggested": 200
        },
        "persons": {
            "minimum": 1,
            "maximum": null
        }
    },
    "seo": {
        "title": {
            "nl": "testSeoTitle NL",
            "en": "testSeoTitle en",
            "fr": "testSeoTitle fr"
        },
        "description": {
            "nl": "testSeoDescr NL",
            "en": "testSeoDescr en",
            "fr": "testSeoDescr fr"
        },
        "url": {
            "nl": "product-nl",
            "en": "product-en",
            "fr": "product-fr"
        }
    },
    "code": "testproductcode",
    "category_id": 4072,
    "option_set_ids": [
        8332,
        8334,
        8336,
        8338
    ]
}

Example request 2 Create a product per person

POST /company/companies/2926/products HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 1c1a731c967dae53ca878c4f9a84d78a27410ce3a5fe238c68ccb7f7f91be84ff24a26b32b4d7f895df42521d5d11804f04a6489b047f2871483a16e2a8f3b11cb34a835951b8ee13760ba24eb063b64ff0557102b6fba681252d2a705fd3e911df781aa
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 1369
{
    "name": {
        "nl": "Taartje"
    },
    "description": {
        "nl": "Beschrijving"
    },
    "specialty": false,
    "active": true,
    "only_order_in_store": false,
    "allergen_ids": [
        1,
        2,
        4
    ],
    "price_look_up_code": "124",
    "price_type": "PER_PERSON",
    "price": 1200,
    "target_price": false,
    "url_type": "recipe",
    "url": "https://www.google.be",
    "min_max": {
        "amount": {
            "minimum": 1,
            "maximum": null,
            "maximum_day": null,
            "maximum_week": null
        },
        "weight": {
            "minimum": 100,
            "maximum": null,
            "maximum_day": null,
            "maximum_week": null,
            "suggested": 200
        },
        "persons": {
            "minimum": 1,
            "maximum": 16
        }
    },
    "option_set_ids": [],
    "seo": {
        "title": {
            "nl": "testSeoTitle NL",
            "en": "testSeoTitle en",
            "fr": "testSeoTitle fr"
        },
        "description": {
            "nl": "testSeoDescr NL",
            "en": "testSeoDescr en",
            "fr": "testSeoDescr fr"
        },
        "url": {
            "nl": "product-nl",
            "en": "product-en",
            "fr": "product-fr"
        }
    },
    "code": "testproductcode",
    "category_id": 4072
}

Response

Field Type Description
name [Language: String] Name of the product
description [Language: String] Description of the product
specialty Bool Whether this product is a specialty. Specialties are also displayed in a separate category and are highlighted with a star icon.
active Bool Inactive products are not visible in the webshop
only_order_in_store Bool Whether this product can only get ordered in the store with a separate UI for the shop employees, and not in the public webshop.
price_type PriceType A product has a price type that defines the price calculations and the way consumers can order the product.
price UInt Price of the product (cents). Please note that this value is ignored when price_type is MULTIPLE_CHOICE.
target_price Bool Is true when it's not possible to provide an exact price of this product when ordering (e.g. not exact weight possible). This option might deactive online payments for orders with this product (shop settings).
url_type String String enumarion of 'none', 'recipe', 'website'
url URL? Nullable. An URL field starting with http:// or https://
min_max company.MinMaxSummary The allowed amounts a customer is allowed to order of a product for amount / weight / persons
images [Image] Array of Image
product_prices [company.ProductPrice] Array of company.ProductPrice
option_sets [company.OptionSet.simple] Array of company.OptionSet.simple
id Int Id of the product
allergens [Allergen]? Nullable. The allergens of this product. An empty array means no allergens. Null means no allergens specified (= can have allergens, ask in shop).
category_id Int The category ID of the product
price_look_up_code String? Nullable. A String value
code String? Nullable. A custom code. You can set this to your own code and use this field to map your products to Bakeronline products
seo company.SeoData Optional. Product page SEO metatags

Example response 1 Create a product

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

{
    "id": 7104,
    "name": {
        "nl": "Brood",
        "fr": "Pain",
        "en": "Bread"
    },
    "description": {
        "nl": "Beschrijving",
        "fr": "Description",
        "en": "Description"
    },
    "specialty": false,
    "active": true,
    "only_order_in_store": false,
    "allergens": [
        {
            "id": 1,
            "name": "1319"
        },
        {
            "id": 2,
            "name": "1320"
        },
        {
            "id": 4,
            "name": "1322"
        }
    ],
    "price_look_up_code": "123",
    "price_type": "PER_UNIT",
    "price": 1200,
    "target_price": false,
    "url_type": "recipe",
    "url": "https://www.google.be",
    "min_max": {
        "amount": {
            "minimum": 1,
            "maximum": null,
            "maximum_day": null,
            "maximum_week": null
        },
        "weight": {
            "minimum": 100,
            "maximum": null,
            "maximum_day": 0,
            "maximum_week": 0,
            "suggested": 200
        },
        "persons": {
            "minimum": 1,
            "maximum": null
        }
    },
    "seo": {
        "title": {
            "nl": "testSeoTitle NL",
            "en": "testSeoTitle en",
            "fr": "testSeoTitle fr"
        },
        "description": {
            "nl": "testSeoDescr NL",
            "en": "testSeoDescr en",
            "fr": "testSeoDescr fr"
        },
        "url": {
            "nl": "product-nl",
            "en": "product-en",
            "fr": "product-fr"
        }
    },
    "code": "testproductcode",
    "category_id": 4072,
    "images": [],
    "product_prices": [],
    "option_sets": [
        {
            "id": 8332,
            "name": {
                "en": "Do you want your bread sliced?"
            },
            "allow_attachment": false,
            "code": null
        },
        {
            "id": 8334,
            "name": {
                "en": "Do you want a picture on your cake?"
            },
            "allow_attachment": false,
            "code": null
        },
        {
            "id": 8336,
            "name": {
                "en": "Please select an option"
            },
            "allow_attachment": false,
            "code": null
        },
        {
            "id": 8338,
            "name": {
                "en": "Do you want a bag?"
            },
            "allow_attachment": false,
            "code": null
        }
    ]
}

Example response 2 Create a product per person

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

{
    "id": 7105,
    "name": {
        "nl": "Taartje",
        "en": ""
    },
    "description": {
        "nl": "Beschrijving"
    },
    "specialty": false,
    "active": true,
    "only_order_in_store": false,
    "allergens": [
        {
            "id": 1,
            "name": "1319"
        },
        {
            "id": 2,
            "name": "1320"
        },
        {
            "id": 4,
            "name": "1322"
        }
    ],
    "price_look_up_code": "124",
    "price_type": "PER_PERSON",
    "price": 1200,
    "target_price": false,
    "url_type": "recipe",
    "url": "https://www.google.be",
    "min_max": {
        "amount": {
            "minimum": 1,
            "maximum": null,
            "maximum_day": null,
            "maximum_week": null
        },
        "weight": {
            "minimum": 100,
            "maximum": null,
            "maximum_day": 0,
            "maximum_week": 0,
            "suggested": 200
        },
        "persons": {
            "minimum": 1,
            "maximum": 16
        }
    },
    "seo": {
        "title": {
            "nl": "testSeoTitle NL",
            "en": "testSeoTitle en",
            "fr": "testSeoTitle fr"
        },
        "description": {
            "nl": "testSeoDescr NL",
            "en": "testSeoDescr en",
            "fr": "testSeoDescr fr"
        },
        "url": {
            "nl": "product-nl",
            "en": "product-en",
            "fr": "product-fr"
        }
    },
    "code": "testproductcode",
    "category_id": 4072,
    "images": [],
    "product_prices": [],
    "option_sets": []
}
Version update available Please adjust your integration to the latest stable version (1.5.2)
1.5.0 stable