Validation period

All periodic discounts and promotions can have validation periods. The validation periods control when the periodic discounts and promotions are valid. Validation periods can also be used for when items are available for sale at the POS.

The validation periods can be set up to be valid for:

  • Specific hours of the day (happy hour);

  • Specific days of the week (weekend offer);

  • A specific time period (a month, spring, Easter);

  • A combination of these factors.

The discount/validation-period endpoint in LS One API allows management of the available validation periods for discounts.

Actions

GET 

Get a validation period

GET 

Get all validation periods

POST 

Create a new validation period

PUT 

Update a validation period

DELETE 

Delete a validation period

Properties

Field Data type Validation Description
id string

-

Unique identifier of the validation period
description string

Required

Description of the validation period
startingDate datetime

-

Starting date of the validation period
endingDate datetime

-

Ending date of the validation period
startingTime timespan

-

Default starting time of the validation period
endingTime timespan

-

Default ending time of the validation period
timeWithinBounds bool

-

Is default settings time within bounds
endingTimeAfterMidnight bool

-

Is default ending time after midnight
monStartingTime timespan

-

Monday Starting Time for weekday period settings
monEndingTime timespan

-

Monday Ending Time for weekday period settings
monTimeWithinBounds bool

-

Is Monday period time within bounds
monEndingTimeAfterMidnight bool

-

Is Monday period time after midnight
tueStartingTime timespan

-

Tuesday Starting Time for weekday period settings
tueEndingTime timespan

-

Tuesday Ending Time for weekday period settings
tueTimeWithinBounds bool

-

Is Tuesday period time within bounds
tueEndingTimeAfterMidnight bool

-

Is Tuesday period time after midnight
wedStartingTime timespan

-

Wednesday Starting Time for weekday period settings
wedEndingTime timespan

-

Wednesday Ending Time for weekday period settings
wedTimeWithinBounds bool

-

Is Wednesday period time within bounds
wedEndingTimeAfterMidnight bool

-

Is Wednesday period time after midnight
thuStartingTime TimeSpan

-

Thursday Starting Time for weekday period settings
thuEndingTime TimeSpan

-

Thursday Ending Time for weekday period settings
thuTimeWithinBounds bool

-

Is Thursday period time within bounds
thuEndingTimeAfterMidnight bool

-

Is Thursday period time after midnight
friStartingTime timespan

-

Friday Starting Time for weekday period settings
friEndingTime timespan

-

Friday Ending Time for weekday period settings
friTimeWithinBounds bool

-

Is Friday period time within bounds
friEndingTimeAfterMidnight bool

-

Is Friday period time after midnight
satStartingTime timespan

-

Saturday Starting Time for weekday period settings
satEndingTime timespan

-

Saturday Ending Time for weekday period settings
satTimeWithinBounds bool

-

Is Saturday period time within bounds
satEndingTimeAfterMidnight bool

-

Is Saturday period time after midnight
sunStartingTime timespan

-

Sunday Starting Time for weekday period settings
sunEndingTime timespan

-

Sunday Ending Time for weekday period settings
sunTimeWithinBounds bool

-

Is Sunday period time within bounds
sunEndingTimeAfterMidnight bool

-

Is Sunday period time after midnight

Examples

Get a validation period

Returns details of a single validation period.

GET /api/discount/validation-period/{id}

Permissions

  • ValidationPeriod:Read

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

Request

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

Required

Unique identifier of the validation period

Response

{
	"id": "00000001",
	"description": "Easter",
	"startingDate": "2013-03-27T00:00:00",
	"endingDate": "2013-04-01T00:00:00",
	"startingTime": {
		"ticks": 0,
		"days": 0,
		"hours": 0,
		"milliseconds": 0,
		"minutes": 0,
		"seconds": 0,
		"totalDays": 0,
		"totalHours": 0,
		"totalMilliseconds": 0,
		"totalMinutes": 0,
		"totalSeconds": 0
	},
	"endingTime": {
	},
	"timeWithinBounds": true,
	"endingTimeAfterMidnight": false,
	"monStartingTime": {
	},
	"monEndingTime": {
	},
	"monTimeWithinBounds": true,
	"monEndingTimeAfterMidnight": false,
	"tueStartingTime": {
	},
	"tueEndingTime": {
	},
	"tueTimeWithinBounds": true,
	"tueEndingTimeAfterMidnight": false,
	"wedStartingTime": {
	},
	"wedEndingTime": {
	},
	"wedTimeWithinBounds": true,
	"wedEndingTimeAfterMidnight": false,
	"thuStartingTime": {
	},
	"thuEndingTime": {
	},
	"thuTimeWithinBounds": true,
	"thuEndingTimeAfterMidnight": false,
	"friStartingTime": {
	},
	"friEndingTime": {
	},
	"friTimeWithinBounds": true,
	"friEndingTimeAfterMidnight": false,
	"satStartingTime": {
	},
	"satEndingTime": {
	},
	"satTimeWithinBounds": true,
	"satEndingTimeAfterMidnight": false,
	"sunStartingTime": {
	},
	"sunEndingTime": {
	},
	"sunTimeWithinBounds": true,
	"sunEndingTimeAfterMidnight": false
}

Error 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 validation period(s)
404 Not Found The requested validation period was not found

Get all validation periods

Returns a list of all validation periods.

GET /api/discount/validation-period

Permissions

  • ValidationPeriod:Read

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

Request

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

Response

[
{
	"id": "00000001",
	"description": "Easter",
	"startingDate": "2013-03-27T00:00:00",
	"endingDate": "2013-04-01T00:00:00",
	"startingTime": {},
	"endingTime": {},
	"timeWithinBounds": true,
	"endingTimeAfterMidnight": false,
	"monStartingTime": {},
	"monEndingTime": {},
	"monTimeWithinBounds": true,
	"monEndingTimeAfterMidnight": false,
	"tueStartingTime": {},
	"tueEndingTime": {},
	"tueTimeWithinBounds": true,
	"tueEndingTimeAfterMidnight": false,
	"wedStartingTime": {},
	"wedEndingTime": {},
	"wedTimeWithinBounds": true,
	"wedEndingTimeAfterMidnight": false,
	"thuStartingTime": {},
	"thuEndingTime": {},
	"thuTimeWithinBounds": true,
	"thuEndingTimeAfterMidnight": false,
	"friStartingTime": {},
	"friEndingTime": {},
	"friTimeWithinBounds": true,
	"friEndingTimeAfterMidnight": false,
	"satStartingTime": {},
	"satEndingTime": {},
	"satTimeWithinBounds": true,
	"satEndingTimeAfterMidnight": false,
	"sunStartingTime": {},
	"sunEndingTime": {},
	"sunTimeWithinBounds": true,
	"sunEndingTimeAfterMidnight": false
},
...
]

Error 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 validation period(s)
404 Not Found No validation period found

Create a new validation period

Create a new validation period.

POST /api/discount/validation-period

To create a new validation period, the following fields are required:

  • description

  • startingDate

  • endingDate

Permissions

  • ValidationPeriod:Write

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

Request

curl -X 'POST' \
	'https://lsoneapi.lsretail.com/api/discount/validation-period' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '{
	"description": "Winter",
	"startingDate": "2021-11-08T00:00:00",
	"endingDate": "2022-03-08T00:00:00"
}'

Response

{
	"id": "00000001",
	"description": "Easter",
	"startingDate": "2013-03-27T00:00:00",
	"endingDate": "2013-04-01T00:00:00",
	"startingTime": {},
	"endingTime": {},
	"timeWithinBounds": true,
	"endingTimeAfterMidnight": false,
	"monStartingTime": {},
	"monEndingTime": {},
	"monTimeWithinBounds": true,
	"monEndingTimeAfterMidnight": false,
	"tueStartingTime": {},
	"tueEndingTime": {},
	"tueTimeWithinBounds": true,
	"tueEndingTimeAfterMidnight": false,
	"wedStartingTime": {},
	"wedEndingTime": {},
	"wedTimeWithinBounds": true,
	"wedEndingTimeAfterMidnight": false,
	"thuStartingTime": {},
	"thuEndingTime": {},
	"thuTimeWithinBounds": true,
	"thuEndingTimeAfterMidnight": false,
	"friStartingTime": {},
	"friEndingTime": {},
	"friTimeWithinBounds": true,
	"friEndingTimeAfterMidnight": false,
	"satStartingTime": {},
	"satEndingTime": {},
	"satTimeWithinBounds": true,
	"satEndingTimeAfterMidnight": false,
	"sunStartingTime": {},
	"sunEndingTime": {},
	"sunTimeWithinBounds": true,
	"sunEndingTimeAfterMidnight": false
}

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 validation period(s)
400 BadRequest New validation period could not be created

Update a validation period

Updates an existing validation period.

PUT /api/discount/validation-period

To update an existing validation period, the following fields are required:

  • id

  • description

  • startingDate

  • endingDate

Permissions

  • ValidationPeriod:Write

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

Request

curl -X 'PUT' \
	'https://lsoneapi.lsretail.com/api/discount/validation-period' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
	"id": "0-00000001",
	"description": "Winter",
	"startingDate": "2021-11-08T00:00:00",
	"endingDate": "2022-03-08T00:00:00",
	"timeWithinBounds": true
}'

Response

{
	"id": "00000001",
	"description": "Easter",
	"startingDate": "2013-03-27T00:00:00",
	"endingDate": "2013-04-01T00:00:00",
	"startingTime": {},
	"endingTime": {},
	"timeWithinBounds": true,
	"endingTimeAfterMidnight": false,
	"monStartingTime": {},
	"monEndingTime": {},
	"monTimeWithinBounds": true,
	"monEndingTimeAfterMidnight": false,
	"tueStartingTime": {},
	"tueEndingTime": {},
	"tueTimeWithinBounds": true,
	"tueEndingTimeAfterMidnight": false,
	"wedStartingTime": {},
	"wedEndingTime": {},
	"wedTimeWithinBounds": true,
	"wedEndingTimeAfterMidnight": false,
	"thuStartingTime": {},
	"thuEndingTime": {},
	"thuTimeWithinBounds": true,
	"thuEndingTimeAfterMidnight": false,
	"friStartingTime": {},
	"friEndingTime": {},
	"friTimeWithinBounds": true,
	"friEndingTimeAfterMidnight": false,
	"satStartingTime": {},
	"satEndingTime": {},
	"satTimeWithinBounds": true,
	"satEndingTimeAfterMidnight": false,
	"sunStartingTime": {},
	"sunEndingTime": {},
	"sunTimeWithinBounds": true,
	"sunEndingTimeAfterMidnight": false
}

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

Delete a validation period

Delete an existing validation period.

DELETE /api/discount/validation-period/{id}

Permissions

  • ValidationPeriod:Write

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

Request

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

Required

Unique identifier of the validation period

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