Price Discount Group
Stores and customers can be grouped into price and discount groups that is then used to set new prices or customer discounts for the specified group. These groups can be used either for a customer discount (line, multi line or total discount) or for a price group that can be attached to a customer or a store. Items can have multiple sales prices, for an example you might have different pricing based on the placement of your stores. Sales prices like that are defined by the price group the store is in.
The pricediscountgroup
endpoint in LS One API allows management of the price discount groups.
Actions
Properties
Field | Data type | Validation | Description |
---|---|---|---|
groupID | string |
Required max. length = 20 |
Unique identifier of the price discount group |
description |
string |
Not empty max. length = 60 |
Description of the price discount group |
module | int |
Required |
Group consists of:
|
type | int |
Required |
Type of discount group:
|
Examples
Get a price discount group
Returns details of a single price discount group.
GET /api/pricediscountgroup/{groupId}/{module}/{type}
Permissions
-
PriceDiscountGroup:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/pricediscountgroup/LDG000004/0/1' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
groupId | string |
Required |
Group id of the price discount group |
module | int |
Required |
Group consists of:
|
type | int |
Required |
Type of discount group:
|
Response
{
"groupID": "LDG000004",
"description": "Stationary office items",
"module": 0,
"type": 1
}
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 price discount group(s) |
404 | Not Found | The requested price discount group was not found |
Get all price discount groups
Returns a list of all price discount groups.
GET /api/pricediscountgroup/{module}/{type}
Permissions
-
PriceDiscountGroup:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/pricediscountgroup/0/1' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
module | int |
Required |
Group consists of:
|
type | int |
Required |
Type of discount group:
|
Response
[
{
"groupID": "LDG000004",
"description": "Stationary office items",
"module": 0,
"type": 1
},
{
"groupID": "LDG000005",
"description": "Dairy - milk items",
"module": 0,
"type": 1
},
...
]
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 price discount group(s) |
404 | Not Found | No price discount group found |
Create a new price discount group
Create a new price discount group.
POST /api/pricediscountgroup
To create a new price discount group, the following fields are required:
-
Description
-
Module
-
Type
Permissions
-
PriceDiscountGroup:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/pricediscountgroup' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '{
"description": "Item price discount group",
"module": 0,
"type": 1
}'
Response
{
"groupID": "0-LDG000008",
"description": "Item price discount group",
"module": 0,
"type": 1
}
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 price discount group(s) |
400 | Bad Request | New price discount group could not be created |
Update a price discount group
Updates an existing price discount group.
PUT /api/pricediscountgroup
To update an existing price discount group, the following fields are required:
-
GroupID
-
Description
-
Module
-
Type
Permissions
-
PriceDiscountGroup:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/pricediscountgroup' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"groupID": "0-LDG000008",
"description": "Item price discount group",
"module": 0,
"type": 1
}'
Response
{
"groupID": "0-LDG000008",
"description": "Item price discount group",
"module": 0,
"type": 1
}
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 price discount group(s) |
400 | Bad Request | Price discount group could not be updated |
404 | Not Found | Price discount group to be updated was not found |
Save a list of price discount groups
Save a list ofprice discount groups.
POST /api/pricediscountgroup/save-list
To save a list of price discount groups, the following fields are required:
-
GroupID
-
Description
-
Module
-
Type
Permissions
-
PriceDiscountGroup:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/pricediscountgroup/save-list' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '
[
{
"groupID": "LDG000004",
"description": "Stationary office items",
"module": 0,
"type": 1
},
{
"groupID": "LDG000005",
"description": "Dairy - milk items",
"module": 0,
"type": 1
}
]'
Response
[
{
"groupID": "LDG000004",
"description": "Stationary office items",
"module": 0,
"type": 1
},
{
"groupID": "LDG000005",
"description": "Dairy - milk items",
"module": 0,
"type": 1
}
]
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 price discount group(s) |
400 | Bad Request | Price discount groups could not be saved |
Delete a price discount group
Delete an existing price discount group.
DELETE /api/pricediscountgroup/{groupId}/{module}/{type}
Permissions
-
PriceDiscountGroup:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/pricediscountgroup/LDG000004/0/1' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
groupId | string |
Required |
Unique identifier of the price discount group |
module | int |
Required |
Group consists of:
|
type | int |
Required |
What type of discount group is this
|
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 price discount group(s) |
404 | Not Found | The requested price discount group was not found |
Delete a list of price discount groups
Delete a list of existing price discount groups.
DELETE /api/pricediscountgroup/delete-list
To delete a list of price discount groups, the following fields are required:
-
GroupID
-
Description
-
Module
-
Type
Permissions
-
PriceDiscountGroup:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/pricediscountgroup/delete-list' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
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 price discount group(s) |
404 | Not Found | Price discount group to be deleted was not found |