Create a promo code

POST /company/shops/@id/promocode-groups

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 Shop ID

Body

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

Field Type Description
codes [String] Array of String
discount_type String String enumarion of 'PERCENT', 'FIXED'
usage_type String String enumarion of 'X_USES_TOTAL', 'X_USES_PER_PERSON'
fixed_discount Int An integer value
percent_discount Int An integer value
minimum_order_price Int An integer value
expiry_date Date? Nullable. Date in YYYY-MM-DD
max_uses Int An integer value
max_uses_per_user Int An integer value
applicable_on Dictionary A dictionary with fields

Example request 1

POST /company/shops/18/promocode-groups HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.9.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 600
{
    "codes": [
        "...",
        "...",
        "..."
    ],
    "discount_type": "PERCENT",
    "usage_type": "X_USES_TOTAL",
    "fixed_discount": 15,
    "percent_discount": 13,
    "minimum_order_price": 13,
    "expiry_date": "2019-01-31",
    "max_uses": 13,
    "max_uses_per_user": 19,
    "applicable_on": {
        "all": false,
        "products": [
            10,
            18,
            13
        ],
        "categories": [
            12,
            15,
            18
        ],
        "product_prices": [
            14,
            14,
            18
        ]
    }
}

Response

Field Type Description
codes [String] Array of String
discount_type String String enumarion of 'PERCENT', 'FIXED'
usage_type String String enumarion of 'X_USES_TOTAL', 'X_USES_PER_PERSON'
fixed_discount Int An integer value
percent_discount Int An integer value
minimum_order_price Int An integer value
expiry_date Date? Nullable. Date in YYYY-MM-DD
max_uses Int An integer value
max_uses_per_user Int An integer value
applicable_on Dictionary A dictionary with fields
id Int An integer value
shop_id Int An integer value
times_used Int An integer value

Example response 1

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

{
    "codes": [
        "...",
        "...",
        "..."
    ],
    "discount_type": "PERCENT",
    "usage_type": "X_USES_TOTAL",
    "fixed_discount": 11,
    "percent_discount": 15,
    "minimum_order_price": 11,
    "expiry_date": "2019-01-31",
    "max_uses": 19,
    "max_uses_per_user": 18,
    "applicable_on": {
        "all": false,
        "products": [
            16,
            13,
            10
        ],
        "categories": [
            16,
            13,
            16
        ],
        "product_prices": [
            13,
            13,
            13
        ]
    },
    "id": 12,
    "shop_id": 15,
    "times_used": 13
}
1.9.0 stable