Discount offer

Discount offers allows selling items that activate discounts automatically when certain criteria are met. The discount can either by given in a calculated percentage or by amount and each discount offer can be valid for anything from a single item to all of your items. The system can have an unlimited number of discount offers where each discount offer is set up separately. Each discount offer has a validation period and sets off offer lines that can be of several types, for example, item and retail groups.

Examples of discount offers:

  • 20% off all books for the weekend

  • €1 discount of all sandwiches at lunch time

  • Summer sale: 30% discount of all items

If an item is included in multiple offer then the priority decides which discount is used when calculating the price at the time of sale. The lower the priority number the higher the priority.

The discount-offer endpoint in LS One API allows discount management.

Actions

GET 

Get discount offer

GET 

Get all discount offers

POST 

Create a new discount offer

PUT 

Update a discount offer

DELETE 

Delete a discount offer

GET 

Get all discount offer lines

POST 

Create a new discount offer line

PUT 

Update a discount offer line

DELETE 

Delete a discount offer line

Properties

DiscountOffer

Field Data type Validation Description
id string

-

Discount offer unique number
description string

Required

Description of the discount offer
enabled bool

-

Active status of the discount offer
masterID guid

-

A globally unique identifier of the discount offer
offerType int

-

Type of the discount offer:

  • 0 - multibuy

  • 1 - mix and match

  • 2 - offer

  • 3 - promotion

  • 4 - all previous types

discountPercent decimal

Required

between 0 and 100

Discount percentage of the offer
priority int

Required

positive number

Offer priority

The priority of the offer controls which offer is triggered if the item exists in more than one offer of the same category.

A lower priority number gives the offer a higher priority.

validationPeriod string

-

Unique number of the discount validation period

Validation periods control when the periodic discounts and promotions are valid.

validationPeriodDescription string

-

Name of the discount validation period
accountCode int

-

Account to which the discount applies:

  • 0 - no account

  • 1 - specific customer

  • 2 - customer group

accountRelation string

-

Unique number of the selected account for the discount offer
startingDate datetime

-

Starting date of the discount offer - based on the selected validation period
endingDate string

-

Ending date of the discount offer - based on the selected validation period
priceGroup string

-

Unique number of the price group used in the discount offer
priceGroupName string

-

Name of the price group used in the discount offer
triggering int

-

Triggering mode of the discount offer:

  • 0 - automatic

  • 1 - manual

barcode string

-

Barcode of the discount offer, when discount triggering is manual

DiscountOfferLine

Field Data type Validation Description
id guid

-

Unique number of the discount offer line
offerID string

Required

Unique number of the parent discount offer
lineID int

-

Line number of the discount offer
type int

-

Type of the discount offer line:

  • 0 - item

  • 1 - retail group

  • 2 - retail department

  • 3 - all

  • 5 - special group

  • 10 - variant

itemRelation string

-

Unique number of the item for the discount offer line (Item / Retail Group/ Retail department / All)
targetMasterID guid

Required

Globally unique identifier for the type definition
description string

-

Description of the item for the discount offer line
variantName string

-

Name of the item variant for the discount offer line
standardPrice decimal

-

Standard price of the discount offer line
standardPriceWithTax decimal

-

Standard price with tax of the discount offer line
discountPercent decimal

Required

between 0 and 100

Discount percentage of the discount offer line
discountAmount decimal

-

Discount amount of the discount offer line
discountAmountWithTax decimal

-

Discount amount with tax included of the discount offer line
offerPrice decimal

-

Offer price of the discount offer line
offerPriceWithTax decimal

-

Offer price with tax of the discount offer line
taxAmount decimal

-

Tax amount of the discount offer line
discountPriceWithTax decimal

-

Discount price with tax of the discount offer line

 

Examples

Get discount offer

Returns details of a single discount offer.

GET /api/discount/discount-offer/{id}

Permissions

  • DiscountOffer:Read

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'GET' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer/D000001' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authentication_token}'		
Parameter Data type Validation Description
id string

Required

Unique number of the discount offer

Response

{
	"id": "D000001",
	"description": "Tim'n Wear for 25% off",
	"enabled": true,
	"masterID": "1093ab8b-69a0-427a-b631-923c7ed83b3d",
	"offerType": 2,
	"discountPercent": 25.000000000000,
	"priority": 160,
	"validationPeriod": "",
	"validationPeriodDescription": "",
	"accountCode": 0,
	"accountRelation": "",
	"startingDate": "1900-01-01T00:00:00",
	"endingDate": "1900-01-01T00:00:00",
	"priceGroup": "",
	"priceGroupName": "",
	"triggering": 0,
	"barCode": ""
}

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 discount offer(s)
404 Not Found The requested discount offer was not found

Get all discount offers

Returns a list of all discount offers.

GET /api/discount/discount-offer

Permissions

  • DiscountOffer:Read

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'GET' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authentication_token}'

Response

[
	{
	"id": "D000005",
	"description": "10% off all Dairy",
	"enabled": false,
	"masterID": "3f5f3ebe-5ca6-4ccf-9848-2023fe972b8e",
	"offerType": 2,
	"discountPercent": 10.000000000000,
	"priority": 30,
	"validationPeriod": "",
	"validationPeriodDescription": "",
	"accountCode": 0,
	"accountRelation": "",
	"startingDate": "1900-01-01T00:00:00",
	"endingDate": "1900-01-01T00:00:00",
	"priceGroup": "",
	"priceGroupName": "",
	"triggering": 0,
	"barCode": ""
	},
	{
	"id": "D000003",
	"description": "Lunch Menu Yogurt Discount",
	"enabled": false,
	"masterID": "4bb2b730-efc0-41bf-8ab6-df3694a3bbf8",
	"offerType": 2,
	"discountPercent": 15.000000000000,
	"priority": 140,
	"validationPeriod": "",
	"validationPeriodDescription": "",
	"accountCode": 0,
	"accountRelation": "",
	"startingDate": "1900-01-01T00:00:00",
	"endingDate": "1900-01-01T00:00:00",
	"priceGroup": "",
	"priceGroupName": "",
	"triggering": 0,
	"barCode": ""
	},
	...
]

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 discount offer(s)
404 Not Found No discount offer found

Create a new discount offer

Create a new discount offer.

POST /api/discount/discount-offer

To create a new discount offer, the following fields are required:

  • Description

  • DiscountPercent

  • Priority

Permissions

  • DiscountOffer:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'POST' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authorization_token}' \
	-H 'Content-Type: application/json' \
	-d '{
		"description": "33% off all soda",
		"discountPercent": 10,
		"priority": 170
	}'

Response

{
	"id": "0-D000001",
	"description": "33% off all soda",
	"enabled": false,
	"masterID": "cf3511eb-c42b-41c9-a9ff-07c36468d894",
	"offerType": 2,
	"discountPercent": 10.000000000000,
	"priority": 170,
	"validationPeriod": "",
	"validationPeriodDescription": "",
	"accountCode": 0,
	"accountRelation": "",
	"startingDate": "1900-01-01T00:00:00",
	"endingDate": "1900-01-01T00:00:00",
	"priceGroup": "",
	"priceGroupName": "",
	"triggering": 0,
	"barCode": ""
}

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 discount offer(s)
400 Bad Request New discount offer could not be created

Update a discount offer

Updates an existing discount offer.

PUT /api/discount/discount-offer

To update an existing discount offer, the following fields are required:

  • ID

  • Description

  • DiscountPercent

  • Priority

Permissions

  • DiscountOffer:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'PUT' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authentication_token}' \
	-H 'Content-Type: application/json' \
	-d '{
		"id": "0-D000001",
		"description": "33% off all sodas",
		"enabled": true,
		"masterID": "cf3511eb-c42b-41c9-a9ff-07c36468d894",
		"offerType": 2,
		"discountPercent": 10.000000000000,
		"priority": 170,
		"validationPeriod": "",
		"validationPeriodDescription": "",
		"accountCode": 0,
		"accountRelation": "",
		"startingDate": "1900-01-01T00:00:00",
		"endingDate": "1900-01-01T00:00:00",
		"priceGroup": "",
		"priceGroupName": "",
		"triggering": 0,
		"barCode": ""
	}'

Response

{
	"id": "0-D000001",
	"description": "33% off all sodas",
	"enabled": true,
	"masterID": "cf3511eb-c42b-41c9-a9ff-07c36468d894",
	"offerType": 2,
	"discountPercent": 10.000000000000,
	"priority": 170,
	"validationPeriod": "",
	"validationPeriodDescription": "",
	"accountCode": 0,
	"accountRelation": "",
	"startingDate": "1900-01-01T00:00:00",
	"endingDate": "1900-01-01T00:00:00",
	"priceGroup": "",
	"priceGroupName": "",
	"triggering": 0,
	"barCode": ""
}

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 discount offer(s)
400 Bad Request Discount offer could not be updated
404 Not Found Discount offer to be updated was not found

Delete a discount offer

Delete an existing discount offer.

DELETE /api/discount/discount-offer/{id}

Permissions

  • DiscountOffer:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'DELETE' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer/D000001' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authentication_token}'
Parameter Data type Validation Description
id string

Required

Unique number of the discount 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 discount offer(s)
404 Not Found The requested discount offer was not found

Get all discount offer lines

Returns a list of all discount offer lines.

GET /api/discount/discount-offer/{discountOfferId}/line

Permissions

  • DiscountOffer:Read

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'GET' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer/D000001/line' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authentication_token}'

Response

		[
	{
		"id": "e075d13a-9c5e-4c06-9843-a74a1d2794b4",
		"offerID": "D000001",
		"lineID": 2,
		"type": 0,
		"itemRelation": "40130",
		"targetMasterID": "4073c0ec-0531-3330-6438-4b83d80259ff",
		"description": "Velvet Jacket Tim-n Tina Wear",
		"variantName": "",
		"standardPrice": 79.166666666667,
		"standardPriceWithTax": 0,
		"discountPercent": 25.000000000000,
		"discountAmount": 0,
		"discountAmountWithTax": 0,
		"offerPrice": 0,
		"offerPriceWithTax": 0,
		"taxAmount": 0,
		"discountPriceWithTax": 0
	},
	{
		"id": "50c469a9-416a-4f67-84f2-cbd552c74aa8",
		"offerID": "D000001",
		"lineID": 1,
		"type": 0,
		"itemRelation": "40120",
		"targetMasterID": "47e0db10-fd31-3230-218c-d3e54578205f",
		"description": "Floral Blouse Tim-n Tina Wear",
		"variantName": "",
		"standardPrice": 25.000000000000,
		"standardPriceWithTax": 0,
		"discountPercent": 25.000000000000,
		"discountAmount": 0,
		"discountAmountWithTax": 0,
		"offerPrice": 0,
		"offerPriceWithTax": 0,
		"taxAmount": 0,
		"discountPriceWithTax": 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 discount offer(s)
404 Not Found No discount offer line found

Create a new discount offer line

Create a new discount offer.

POST /api/discount/discount-offer/{discountOfferId}/line

To create a new discount offer line, the following fields are required:

  • OfferID

  • TargetMasterID

  • DiscountPercent

  • Type

  • ItemRelation

Permissions

  • DiscountOffer:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'POST' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer/D000001/line' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authorization_token}' \
	-H 'Content-Type: application/json' \
	-d '{
		"offerID": "000000001",
		"targetMasterID": "C199D1EE-F130-3030-FFEC-E4A1AF45178D",
		"discountPercent": 10,
		"type": 0,
		"itemRelation": "40110"
	}'

Response

{
	"id": "15ef9cd1-b2c8-4aba-994b-9008813879ae",
	"offerID": "D000001",
	"lineID": 3,
	"type": 0,
	"itemRelation": "40110",
	"targetMasterID": "c199d1ee-f130-3030-ffec-e4a1af45178d",
	"description": "Apple, Red Delicious",
	"variantName": "",
	"standardPrice": 8.571428571429,
	"standardPriceWithTax": 0,
	"discountPercent": 10.000000000000,
	"discountAmount": 0,
	"discountAmountWithTax": 0,
	"offerPrice": 0,
	"offerPriceWithTax": 0,
	"taxAmount": 0,
	"discountPriceWithTax": 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 discount offer(s)
400 Bad Request New discount offer line could not be created

Update a discount offer line

Updates an existing discount offer line.

PUT /api/discount/discount-offer/{discountOfferId}/line

To update an existing discount offer line, the following fields are required:

  • ID

  • OfferID

  • TargetMasterID

  • DiscountPercent

  • Type

  • ItemRelation

Permissions

  • DiscountOffer:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'PUT' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer/D000001/line' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authentication_token}' \
	-H 'Content-Type: application/json' \
	-d '{
		"id": "15ef9cd1-b2c8-4aba-994b-9008813879ae",
		"offerID": "D000001",
		"lineID": 3,
		"type": 0,
		"itemRelation": "40110",
		"targetMasterID": "c199d1ee-f130-3030-ffec-e4a1af45178d",
		"description": "Apple, Red Delicious",
		"variantName": "",
		"standardPrice": 8.571428571429,
		"standardPriceWithTax": 0,
		"discountPercent": 10.000000000000,
		"discountAmount": 0,
		"discountAmountWithTax": 0,
		"offerPrice": 100,
		"offerPriceWithTax": 0,
		"taxAmount": 10,
		"discountPriceWithTax": 0
	}'

Response

{
	"id": "15ef9cd1-b2c8-4aba-994b-9008813879ae",
	"offerID": "D000001",
	"lineID": 3,
	"type": 0,
	"itemRelation": "40110",
	"targetMasterID": "c199d1ee-f130-3030-ffec-e4a1af45178d",
	"description": "Apple, Red Delicious",
	"variantName": "",
	"standardPrice": 8.571428571429,
	"standardPriceWithTax": 0,
	"discountPercent": 10.000000000000,
	"discountAmount": 0,
	"discountAmountWithTax": 0,
	"offerPrice": 100,
	"offerPriceWithTax": 0,
	"taxAmount": 10,
	"discountPriceWithTax": 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 discount offer(s)
400 Bad Request Discount offer line could not be updated
404 Not Found Discount offer line to be updated was not found

Delete a discount offer line

Delete an existing discount offer line.

DELETE /api/discount/discount-offer/line/{discountOfferLineId}

Permissions

  • DiscountOffer:Write

For more information on authenticating to LS One APIs, see Authentication.

Request

curl -X 'DELETE' \
	'https://lsoneapi.lsretail.com/api/discount/discount-offer/line/e075d13a-9c5e-4c06-9843-a74a1d2794b4' \
	-H 'accept: text/plain' \
	-H 'Authorization: Bearer {authentication_token}'
Parameter Data type Validation Description
id string

Required

Unique number of the discount offer 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 write discount offer(s)
404 Not Found The requested discount offer line was not found