Mix and match
Mix and match discount offer allows selling combination of items with automatic discounts. The system can have an unlimited number of mix and match offers where each offer is set up separately.Each mix anc match offer has a validation period and sets off offer lines that can be of several types, for example, item and retail groups.
The mix and match discount supports various discount scenarios:
-
A swimsuit is sold along with either a skirt or a towel and you get a 20% discount of both items.
-
Two appointment diaries and a stapler are sold and get a 5$ discount.
-
Buy any sandwich and any soda for a fixed price.
-
2 for 1
The discount/mix-and-match
endpoint in LS One API allows management of mix and match discounts.
Actions
Properties
MixAndMatch
Field | Data type | Validation | Description |
---|---|---|---|
id | string |
Required max. length = 20 |
Unique identifier of the mix and match offer |
masterID | guid |
- |
Globally unique identifier of the mix and match offer |
description | string |
Required |
Description of the mix and match offer |
enabled | boolean |
- |
Mix and match offer is active |
discountType | int |
- |
Type of the mix and match offer:
|
priority | int |
- |
Priority of the mix and match offer |
mixAndMatchDiscountTypeText | string |
- |
Translated text for mix and match discount type (for display purposes) |
dealPrice | decimal |
- |
Deal price of the mix and match offer |
discountAmount | decimal |
- |
Discount amount of the mix and match offer |
discountPercent | decimal |
- |
Discount percent of the mix and match offer |
offerType | int |
- |
Mix and match offer type of the discount offer. Possible discount offer types are:
|
validationPeriod | string |
- |
Validation period of the mix and match offer |
numberOfItemsNeeded | int |
- |
Number of items needed of the mix and match offer |
MixAndMatchLine
Field | Data type | Validation | Description |
---|---|---|---|
id | guid |
- |
Unique identifier of the mix and match offer line |
offerID | string |
- |
Mix and match offer id of the line |
offerMasterID | guid |
Required |
Mix and match offer globally unique identifier (master id) of the line |
description | string |
Required |
Description of item linked to this offer through itemRelation |
itemRelation | string |
- |
Item relation of the mix and match 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 |
type | string |
- |
Type of the mix and match offer line:
|
lineGroup | string |
- |
Line group to which the linked item belongs to |
standardPrice | decimal |
- |
Standard price of linked item |
taxItemGroupID | string |
- |
Tax item group id of the mix and match offer line |
MixAndMatchLineGroup
Field | Data type | Validation | Description |
---|---|---|---|
lineGroup | string |
Required |
Line group of the mix and match offer |
offerID | string |
Required |
Mix and match offer id of the line group |
description | string |
Required |
Description of the line group |
numberOfItemsNeeded | int |
- |
Number of items needed of the line group |
color | string |
- |
The color of mix and match line group It represents the html color code of the System.Drawing.Color structure. |
Examples
Get mix and match offer by id
Returns details of a single mix and match offer.
GET /api/discount/mix-and-match/{id}
Permissions
-
MixAndMatch:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | string |
Required |
Unique identifier of the mix and match offer |
Response
{
"id": "MM000001",
"masterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "Beach combo - 20%",
"enabled": true,
"priority": 50,
"discountType": 1,
"mixAndMatchDiscountTypeText": "Discount %",
"dealPrice": 0.000000000000,
"discountAmount": 0.000000000000,
"discountPercent": 20.000000000000,
"offerType": 1,
"validationPeriod": "",
"numberOfItemsNeeded": 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 read mix and match(s) |
404 | Not Found | The requested mix and match offer was not found |
Get all mix and match offers
Returns a list of all mix and match offers.
GET /api/discount/mix-and-match
Permissions
-
MixAndMatch:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Response
[
{
"id": "MM000001",
"masterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "Beach combo - 20%",
"enabled": true,
"priority": 50,
"discountType": 1,
"mixAndMatchDiscountTypeText": "Discount %",
"dealPrice": 0.000000000000,
"discountAmount": 0.000000000000,
"discountPercent": 20.000000000000,
"offerType": 1,
"validationPeriod": "",
"numberOfItemsNeeded": 2
},
{
"id": "MM000002",
"masterID": "e2a863dc-dcb6-4986-bc7e-b32ff8d1645c",
"description": "Diary x2 + Stapler",
"enabled": true,
"priority": 60,
"discountType": 2,
"mixAndMatchDiscountTypeText": "Discount amount",
"dealPrice": 0.000000000000,
"discountAmount": 6.000000000000,
"discountPercent": 0.000000000000,
"offerType": 1,
"validationPeriod": "",
"numberOfItemsNeeded": 3
},
...
]
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 mix and match offer(s) |
404 | Not Found | No mix and match offer found |
Create a new mix and match offer
Create a new mix and match offer.
POST /api/discount/mix-and-match
To create a new mix and match offer, the following fields are required:
-
Description
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '
{
"description": "Beach combo - 20%",
"priority": 50,
"discountType": 1,
"mixAndMatchDiscountTypeText": "1",
"dealPrice": 1,
"discountAmount": 10,
"discountPercent": 10,
"validationPeriod": "1",
"numberOfItemsNeeded": 5
}'
Response
{
"id": "0-MM000006",
"masterID": "cb9dd456-1058-4197-a077-f255873951b9",
"description": "Beach combo - 20%",
"enabled": false,
"priority": 50,
"discountType": 1,
"mixAndMatchDiscountTypeText": "Discount %",
"dealPrice": 1,
"discountAmount": 10,
"discountPercent": 10,
"offerType": 1,
"validationPeriod": "1",
"numberOfItemsNeeded": 5
}
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 mix and match offer(s) |
400 | Bad Request | New mix and match offer could not be created |
Update an mix and match offer
Updates an existing mix and match offer.
PUT /api/discount/mix-and-match
To update an existing mix and match offer, the following fields are required:
-
ID
-
Description
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "0-MM000006",
"masterID": "cb9dd456-1058-4197-a077-f255873951b9",
"description": "Beach combo - 20%",
"enabled": true,
"priority": 50,
"discountType": 1,
"mixAndMatchDiscountTypeText": "Discount %",
"dealPrice": 1,
"discountAmount": 10,
"discountPercent": 10,
"offerType": 1,
"validationPeriod": "1",
"numberOfItemsNeeded": 5
}'
Response
{
"id": "0-MM000006",
"masterID": "cb9dd456-1058-4197-a077-f255873951b9",
"description": "Beach combo - 20%",
"enabled": true,
"priority": 50,
"discountType": 1,
"mixAndMatchDiscountTypeText": "Discount %",
"dealPrice": 1,
"discountAmount": 10,
"discountPercent": 10,
"offerType": 1,
"validationPeriod": "1",
"numberOfItemsNeeded": 5
}
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 mix and match offer(s) |
400 | Bad Request | Mix and match offer could not be updated |
404 | Not Found | Mix and match offer to be updated was not found |
Delete a mix and match offer
Delete an existing mix and match offer.
DELETE /api/discount/mix-and-match/{id}
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/TG0005' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | string |
Required |
Unique identifier of the mix and match offer |
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 mix and match offer(s) |
404 | Not Found | The requested mix and match offer was not found |
Get mix and match line by id
Returns details of a single mix and match line.
GET /api/discount/mix-and-match/line/{id}
Permissions
-
MixAndMatch:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/line/f735ae50-8680-4d5e-80a8-1e555ef71bd9' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | guid |
Required |
Unique identifier of the mix and match line |
Response
{
"id": "f735ae50-8680-4d5e-80a8-1e555ef71bd9",
"offerID": "MM000001",
"offerMasterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "Skirt Linda Professional Wear",
"itemRelation": "40020",
"targetMasterID": "f42e2a55-5430-3230-ae55-e138d264184a",
"type": "Item",
"lineGroup": "0000002",
"standardPrice": 51.666666666667,
"taxItemGroupID": "TG0004"
}
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 mix and match line(s) |
404 | Not Found | The requested mix and match line was not found |
Get all lines for a mix and match
Returns a list of all mix and match lines.
GET /api/discount/mix-and-match/{id}/line
Permissions
-
MixAndMatch:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Response
[
{
"id": "f735ae50-8680-4d5e-80a8-1e555ef71bd9",
"offerID": "MM000001",
"offerMasterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "Skirt Linda Professional Wear",
"itemRelation": "40020",
"targetMasterID": "f42e2a55-5430-3230-ae55-e138d264184a",
"type": "Item",
"lineGroup": "0000002",
"standardPrice": 51.666666666667,
"taxItemGroupID": "TG0004"
},
{
"id": "d2008585-7a49-4b5b-ba3a-8dc6c5c1ec9d",
"offerID": "MM000001",
"offerMasterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "Towel Linda Beach",
"itemRelation": "40010",
"targetMasterID": "56910899-a930-3130-9e28-9b84cc434a64",
"type": "Item",
"lineGroup": "0000002",
"standardPrice": 33.333333333333,
"taxItemGroupID": "TG0004"
},
...
]
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 mix and match line(s) |
404 | Not Found | No mix and match lines found |
Create a new mix and match line
Create a new mix and match line.
POST /api/discount/mix-and-match/{id}/line
To create a new mix and match line, the following fields are required:
-
Description
-
OfferMasterID
-
TargetMasterID
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '
{
"offerMasterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "New Line",
"itemRelation": "40010",
"targetMasterID": "56910899-a930-3130-9e28-9b84cc434a64",
"type": "Item",
"lineGroup": "0000002",
"standardPrice": 33.333333333333,
"taxItemGroupID": "TG0004"
}'
Response
{
"id": "f49a98f1-c06b-47b5-9beb-b48c52021f61",
"offerID": "MM000001",
"offerMasterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "New Line",
"itemRelation": "40010",
"targetMasterID": "56910899-a930-3130-9e28-9b84cc434a64",
"type": "Item",
"lineGroup": "0000002",
"standardPrice": 33.333333333333,
"taxItemGroupID": "TG0004"
}
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 mix and match line(s) |
400 | Bad Request | New mix and match line could not be created |
Update an mix and match line
Updates an existing mix and match line.
PUT /api/discount/mix-and-match/{id}/line
To update an existing mix and match line, the following fields are required:
-
ID
-
Description
-
OfferMasterID
-
TargetMasterID
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "ee8534ad-5a01-421a-b991-7efabec5d082",
"offerID": "MM000001",
"offerMasterID": "bc98173e-952c-46ad-a979-d07e68bf88aa",
"description": "New Line",
"itemRelation": "40010",
"targetMasterID": "56910899-a930-3130-9e28-9b84cc434a64",
"type": "Item",
"lineGroup": "0000002",
"standardPrice": 25,
"taxItemGroupID": "TG0004"
}'
Response
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/multibuy/0000001' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
{
"id": "0-MM000006",
"masterID": "cb9dd456-1058-4197-a077-f255873951b9",
"description": "Beach combo - 20%",
"enabled": true,
"priority": 50,
"discountType": 1,
"mixAndMatchDiscountTypeText": "Discount %",
"dealPrice": 1,
"discountAmount": 10,
"discountPercent": 10,
"offerType": 1,
"validationPeriod": "1",
"numberOfItemsNeeded": 5
}
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 mix and match line(s) |
400 | Bad Request | Mix and match line could not be updated |
404 | Not Found | Mix and match line to be updated was not found |
Delete a mix and match line
Delete an existing mix and match line.
DELETE /api/discount/mix-and-match/line/{mixAndMatchLineId}
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/line/f49a98f1-c06b-47b5-9beb-b48c52021f61' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
mixAndMatchLineId | guid |
Required |
Unique identifier of the mix and match 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 mix and match line(s) |
404 | Not Found | The requested mix and match line was not found |
Get mix and match line group by id
Returns details of a single mix and match line group.
GET /api/discount/mix-and-match/{id}/line-group/{lineGroupId}
Permissions
-
MixAndMatch:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line-group/0000001' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | string |
Required |
Unique identifier of the mix and match offer |
lineGroupId | string |
Required |
Unique identifier of the mix and match line |
Response
{
"offerID": "MM000001",
"lineGroup": "0000001",
"description": "A1",
"numberOfItemsNeeded": 1,
"color": "ff80ff80"
}
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 mix and match line group(s) |
404 | Not Found | The requested mix and match line group was not found |
Get all line groups for a mix and match
Returns a list of all mix and match line group.
GET /api/discount/mix-and-match/{id}/line-group
Permissions
-
MixAndMatch:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line-group' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Response
[
{
"offerID": "MM000001",
"lineGroup": "0000001",
"description": "A1",
"numberOfItemsNeeded": 1,
"color": "ff80ff80"
},
{
"offerID": "MM000001",
"lineGroup": "0000002",
"description": "B1",
"numberOfItemsNeeded": 1,
"color": "ff80ff80"
},
...
]
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 mix and match line group(s) |
404 | Not Found | No mix and match line groups found |
Create a new mix and match line group
Create a new mix and match line group.
POST /api/discount/mix-and-match/{id}/line-group
To create a new mix and match line group, the following fields are required:
-
Description
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line-group' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '
{
"description": "C1"
}'
Response
{
"offerID": "MM000001",
"lineGroup": "0-0000003",
"description": "C1",
"numberOfItemsNeeded": 0,
"color": "ff80ff80"
}
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 mix and match line group(s) |
400 | Bad Request | New mix and match line group could not be created |
Update an mix and match line group
Updates an existing mix and match line group.
PUT /api/discount/mix-and-match/{id}/line-group
To update an existing mix and match line group, the following fields are required:
-
LineGroup
-
Description
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line-group' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"lineGroup": "0-0000003",
"description": "C1",
"numberOfItemsNeeded": 3
}'
Response
{
"offerID": "MM000001",
"lineGroup": "0-0000003",
"description": "C1",
"numberOfItemsNeeded": 3,
"color": "ff80ff80"
}
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 mix and match line group(s) |
400 | Bad Request | Mix and match line group could not be updated |
404 | Not Found | Mix and match line group to be updated was not found |
Delete a mix and match line group
Delete an existing mix and match line group.
DELETE /api/discount/mix-and-match/{id}/line-group/{lineGroupId}
Permissions
-
MixAndMatch:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/discount/mix-and-match/MM000001/line-group/0-0000003' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | string |
Required |
Unique identifier of the mix and match offer |
lineGroupId | string |
Required |
Unique identifier of the mix and match line group |
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 mix and match line group(s) |
404 | Not Found | The requested mix and match line group was not found |