Multibuy
Multibuy offer allows selling items with automatic discounts when a certain quantity of the item is being sold. The quantity and discounts can have many levels, for example, one item can be sold at a normal price, three items with a 3% discount, and five items with a 10% discount, and so on. The levels and the discount are defined per multibuy offer. The discount can be given either as a percentage discount or as a new unit price. The system can have an unlimited number of multibuy offers where each multibuy offer is set up separately.
Examples of multibuy offers:
-
If you buy 3 books you get 20% discount
-
Buy 1 milk for full price, €1 each. If you buy 3 bottles you get each for €0.9 and if you buy 6 you get each bottle for €0.8.
The discount/multibuy
endpoint in LS One API allows management of multibuy discounts.
Actions
Properties
Multibuy
Field | Data type | Validation | Description |
---|---|---|---|
id | string |
Required max. length = 20 |
Unique identifier of the multibuy discount |
masterID | guid |
- |
Globally unique identifier of the multibuy discount |
description | string |
Required |
Description of the multibuy discount |
enabled | boolean |
- |
Multibuy discount is active |
discountType | int |
- |
Type of the multibuy discount:
|
priority | int |
- |
Priority of the multibuy discount |
offerType | int |
- |
Multibuy offer type of the discount offer Possible discount offer types are:
|
validationPeriod | string |
- |
Validation period of the multibuy discount |
startingDate | datetime |
- |
Starting date of the multibuy discount |
endingDate | datetime |
- |
Ending date of the multibuy discount |
MultibuyLine
Field | Data type | Validation | Description |
---|---|---|---|
id | guid |
- |
Unique identifier of the multibuy discount line |
offerID | string |
- |
Multibuy offer id for this discount line |
offerMasterID | guid |
Required |
Multibuy offer globally unique identifier of the discount line |
description | string |
Required |
Description of item linked to this offer through itemRelation |
itemRelation | string |
- |
Item relation of the multibuy offer line Can be a retail item identifier, retail group identifier, retail department identifier or special group identifier |
targetMasterID | guid |
Required |
Globally unique identifier of the item linked to this offer through itemRelation |
type | string |
- |
Type of the multibuy offer line:
|
unit | string |
- |
Unit of measure for the item linked to this offer through itemRelation |
MultibuyDiscountLine
Field | Data type | Validation | Description |
---|---|---|---|
id | string |
- |
Identifier of the multibuy discount line, in the format {offerID}-{minQuantity} |
offerID | string |
Required |
Multibuy offer unique identifier to which this line belongs to |
minQuantity | decimal |
Required |
Minimum quantity to trigger discount |
priceOrDiscountPercent | decimal |
- |
Price or discount percent |
Examples
Get multibuy discount by id
Returns details of a single multibuy discount.
GET /api/discount/multibuy/{id}
Permissions
-
Multibuy:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/0000001' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | string |
Required |
Unique identifier of the multibuy discount |
Response
{
"id": "0000001",
"masterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Multibuy 5, 10 and 15",
"enabled": true,
"discountType": 1,
"priority": 40,
"offerType": 0,
"validationPeriod": "",
"startingDate": "1900-01-01T00:00:00",
"endingDate": "1900-01-01T00:00:00"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read multibuy(s) |
404 | Not Found | The requested multibuy discount was not found |
Get all multibuy discounts
Returns a list of all multibuy discounts.
GET /api/discount/multibuy
Permissions
-
Multibuy:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/multibuy' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Response
[
{
"id": "0000001",
"masterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Multibuy 5, 10 and 15",
"enabled": true,
"discountType": 1,
"priority": 40,
"offerType": 0,
"validationPeriod": "",
"startingDate": "1900-01-01T00:00:00",
"endingDate": "1900-01-01T00:00:00"
},
{
"id": "0000002",
"masterID": "dc5f40c3-0c10-417c-bdfc-29e793c4b8d9",
"description": "Multibuy - 5 for 10%",
"enabled": true,
"discountType": 1,
"priority": 20,
"offerType": 0,
"validationPeriod": "",
"startingDate": "1900-01-01T00:00:00",
"endingDate": "1900-01-01T00:00:00"
},
...
]
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read multibuy(s) |
404 | Not Found | No multibuy discount found |
Create a new multibuy discount
Create a new multibuy discount.
POST /api/discount/multibuy
To create a new multibuy discount, the following fields are required:
-
Description
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/discount/multibuy' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '
{
"description": "Multibuy - 3 for 15%",
"enabled": true,
"discountType": 1
}'
Response
{
"id": "0-0000003",
"masterID": "54bac477-bd7e-484a-ac5c-c9c7190b2a11",
"description": "Multibuy - 3 for 15%",
"enabled": true,
"discountType": 1,
"priority": 0,
"offerType": 0,
"validationPeriod": null,
"startingDate": "0001-01-01T00:00:00",
"endingDate": "0001-01-01T00:00:00"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write multibuy(s) |
400 | Bad Request | New multibuy discount could not be created |
Update an multibuy discount
Updates an existing multibuy discount.
PUT /api/discount/multibuy
To update an existing multibuy discount, the following fields are required:
-
ID
-
Description
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/discount/multibuy' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "0-0000003",
"masterID": "54bac477-bd7e-484a-ac5c-c9c7190b2a11",
"description": "Multibuy - 3 for 15%",
"enabled": true,
"discountType": 1,
"priority": 50,
"offerType": 0,
"validationPeriod": "",
"startingDate": "1900-01-01T00:00:00",
"endingDate": "1900-01-01T00:00:00"
}'
Response
{
"id": "0-0000003",
"masterID": "54bac477-bd7e-484a-ac5c-c9c7190b2a11",
"description": "Multibuy - 3 for 15%",
"enabled": true,
"discountType": 1,
"priority": 50,
"offerType": 0,
"validationPeriod": "",
"startingDate": "1900-01-01T00:00:00",
"endingDate": "1900-01-01T00:00:00"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write multibuy(s) |
400 | Bad Request | Multibuy discount could not be updated |
404 | Not Found | Multibuy discount to be updated was not found |
Delete a multibuy discount
Delete an existing multibuy discount.
DELETE /api/discount/multibuy/{id}
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/0-0000003' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
Id | string |
Required |
Unique identifier of the multibuy discount |
Response
HTTP/1.1 204 No Content
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read multibuy(s) |
404 | Not Found | The requested multibuy discount was not found |
Get multibuy line by id
Returns details of a single multibuy line.
GET /api/discount/multibuy/line/{id}
Permissions
-
Multibuy:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/line/3b0f455f-70b0-47e8-9622-1374102508d3' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
Id | Guid |
Required |
Unique identifier of the multibuy line |
Response
{
"id": "3b0f455f-70b0-47e8-9622-1374102508d3",
"offerID": "0000001",
"offerMasterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Document File, 4 Holes",
"itemRelation": "50030",
"targetMasterID": "13b67786-a730-3330-c617-64dd05b89caa",
"type": "Item",
"unit": "PCS"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read multibuy line(s) |
404 | Not Found | The requested multibuy line was not found |
Get all lines for a multibuy
Returns a list of all multibuy lines.
GET /api/discount/multibuy/{id}/line
Permissions
-
Multibuy:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/0000001/line' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Response
[
{
"id": "3b0f455f-70b0-47e8-9622-1374102508d3",
"offerID": "0000001",
"offerMasterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Document File, 4 Holes",
"itemRelation": "50030",
"targetMasterID": "13b67786-a730-3330-c617-64dd05b89caa",
"type": "Item",
"unit": "PCS"
},
{
"id": "1a953fb0-a255-4282-82b6-358428986eb0",
"offerID": "0000001",
"offerMasterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Briefcase, Leather",
"itemRelation": "50000",
"targetMasterID": "455275d4-5430-3030-4166-f263005e89ac",
"type": "Item",
"unit": "PCS"
},
...
]
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read multibuy line(s) |
404 | Not Found | No multibuy lines found |
Create a new multibuy line
Create a new multibuy line.
POST /api/discount/multibuy/{id}/line
To create a new multibuy line, the following fields are required:
-
Description
-
OfferMasterID
-
TargetMasterID
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/0000001/line' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '
{
"offerMasterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Document File, 1 Holes",
"itemRelation": "50040",
"targetMasterID": "13b67786-a730-3330-c617-64dd05b89caa",
"type": "Item",
"unit": "PCS"
}'
Response
{
"id": "7ebee4be-fefe-4512-8d69-25f19c65fcb2",
"offerID": "0000001",
"offerMasterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Document File, 1 Holes",
"itemRelation": "50040",
"targetMasterID": "13b67786-a730-3330-c617-64dd05b89caa",
"type": "Item",
"unit": "PCS"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write multibuy line(s) |
400 | Bad Request | New multibuy line could not be created |
Update an multibuy line
Updates an existing multibuy line.
PUT /api/discount/multibuy/{id}/line
To update an existing multibuy line, the following fields are required:
-
ID
-
Description
-
OfferMasterID
-
TargetMasterID
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/0000001/line' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "7ebee4be-fefe-4512-8d69-25f19c65fcb2",
"offerID": "0000001",
"offerMasterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Document File, 7 Holes",
"itemRelation": "50040",
"targetMasterID": "13b67786-a730-3330-c617-64dd05b89caa",
"type": "Item",
"unit": "PCS"
}'
Response
{
"id": "7ebee4be-fefe-4512-8d69-25f19c65fcb2",
"offerID": "0000001",
"offerMasterID": "9b5c5554-6968-45ba-b2bf-205b00eedc8b",
"description": "Document File, 7 Holes",
"itemRelation": "50040",
"targetMasterID": "13b67786-a730-3330-c617-64dd05b89caa",
"type": "Item",
"unit": "PCS"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write multibuy line(s) |
400 | Bad Request | Multibuy line could not be updated |
404 | Not Found | Multibuy line to be updated was not found |
Delete a multibuy line
Delete an existing multibuy line.
DELETE /api/discount/multibuy/line/{id}
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/line/7ebee4be-fefe-4512-8d69-25f19c65fcb2' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
Id | Guid |
Required |
Unique identifier of the multibuy line |
Response
HTTP/1.1 204 No Content
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read multibuy line(s) |
404 | Not Found | The requested multibuy line was not found |
Get all discount lines for a multibuy
Returns a list of all multibuy discount line.
GET /api/discount/multibuy/{id}/configuration
Permissions
-
Multibuy:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/0000001/configuration' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Response
[
{
"id": "0000001",
"offerID": "0000001",
"minQuantity": 5.0000000000000,
"priceOrDiscountPercent": 5.0000000000000
},
{
"id": "0000001",
"offerID": "0000001",
"minQuantity": 10.0000000000000,
"priceOrDiscountPercent": 10.0000000000000
},
...
]
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read multibuy discount line(s) |
404 | Not Found | No multibuy discount lines found |
Create a new multibuy discount line
Create a new multibuy discount line.
POST /api/discount/multibuy/configuration
To create a new multibuy discount line, the following fields are required:
-
OfferId
-
MinQuantity
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/configuration' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '
{
"offerID": "0000001",
"minQuantity": 20
}'
Response
{
"id": "0000001",
"offerID": "0000001",
"minQuantity": 20,
"priceOrDiscountPercent": 0
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write multibuy discount line(s) |
400 | Bad Request | New multibuy discount line could not be created |
Update an multibuy discount line
Updates an existing multibuy discount line.
PUT /api/discount/multibuy/configuration
To update an existing multibuy discount line, the following fields are required:
-
OfferId
-
MinQuantity
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/MM000001/configuration' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "0000001",
"offerID": "0000001",
"minQuantity": 20,
"priceOrDiscountPercent": 10
}'
Response
{
"id": "0000001",
"offerID": "0000001",
"minQuantity": 20,
"priceOrDiscountPercent": 10
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write multibuy discount line(s) |
400 | Bad Request | Multibuy discount line could not be updated |
404 | Not Found | Multibuy discount line to be updated was not found |
Delete a multibuy discount line
Delete an existing multibuy discount line.
DELETE /api/discount/multibuy/configuration
To delete a multibuy discount line, the following fields are required:
-
OfferId
-
MinQuantity
Permissions
-
Multibuy:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/configuration' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}
-H 'Content-Type: application/json' \
-d '
{
"offerID": "0000001",
"minQuantity": 20
}'
Response
HTTP/1.1 204 No Content
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write multibuy discount line(s) |
404 | Not Found | The requested multibuy discount line was not found |