PATCH /company/offers/@id
Update an offer for a company
This endpoint requires authentication.
Header | Value |
---|---|
Authorization | Set the value to Bearer + + access_token |
Pass the following properties via application/json or form encoding in the body of the request.
A special discount for one or multiple products of the shop
Field | Type | Description |
---|---|---|
shops | [Int] | Offers are valid for certain shop ids |
name | String | A String value |
from_date | Date | Date in YYYY-MM-DD |
until_date | Date | Date in YYYY-MM-DD |
valid_for | String | Offers are valid on either order date or acquire date. |
recurring | Bool | Offers can be recurring within from_date and until_date |
recurring_on | String | Optional. Offers can be recurring on a day of the week. |
PATCH /company/offers/@id HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.10.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 221
{
"shops": [
12,
10,
17
],
"name": "...",
"from_date": "2019-01-31",
"until_date": "2019-01-31",
"valid_for": "order",
"recurring": false,
"recurring_on": "monday"
}
A special discount for one or multiple products of the shop
Field | Type | Description |
---|---|---|
id | Int | An integer value |
shops | [Int] | Offers are valid for certain shop ids |
name | String | A String value |
from_date | Date | Date in YYYY-MM-DD |
until_date | Date | Date in YYYY-MM-DD |
valid_for | String | Offers are valid on either order date or acquire date. |
recurring | Bool | Offers can be recurring within from_date and until_date |
recurring_on | String | Optional. Offers can be recurring on a day of the week. |
items | [OfferItem] | Optional. Offers are applicable to categories, products or product prices |
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 964
{
"id": 19,
"shops": [
17,
17,
16
],
"name": "...",
"from_date": "2019-01-31",
"until_date": "2019-01-31",
"valid_for": "order",
"recurring": false,
"recurring_on": "monday",
"items": [
{
"applies_to": "category",
"item_id": 11,
"type": "percentage",
"id": 10,
"percentage": 19,
"minimum_amount": 10,
"free_amount": 17
},
{
"applies_to": "category",
"item_id": 17,
"type": "percentage",
"id": 18,
"percentage": 10,
"minimum_amount": 16,
"free_amount": 16
},
{
"applies_to": "category",
"item_id": 10,
"type": "percentage",
"id": 13,
"percentage": 14,
"minimum_amount": 12,
"free_amount": 18
}
]
}