Duration and validity

Both the /activities endpoint and /activities/{activityUuid} endpoints include the length of an activity. There are multiple properties which can describe how long an activity lasts. Depending on the activity you will choose between its duration or validity.

Format

Values for both duration and validity are presented in the ISO 8601 standard. The example below represents a length of "1 day and 12 hours":

Copy
Copied
P1DT12H

Some activity providers are very precise about the units used for describing an activity's length. Please avoid converting time periods to a different unit. For example, a value of PT24H should be displayed as "24 hours" and not "1 day".

Duration

Duration is more appropriate for tours and other activities that follow a schedule, usually with a specific start and end. When duration is set for an activity, you will see the duration_range property.

Duration may be a single period of time. In the example response below we can say the activity lasts 2 hours:

Copy
Copied
{
	[...]
	"duration_range": {
		"min": "PT2H",
		"max": "PT2H"
	},
	[...]
}

Duration can also be a time range. In the example response below, the activity lasts 1-2 hours:

Copy
Copied
{
	[...]
	"duration_range": {
		"min": "PT1H",
		"max": "PT2H"
	},
	[...]
}

The min and max properties for duration_range correspond to the duration's lower and upper bounds respectively. Both properties are optional and it's possible to find activities with only one of these properties.

In the example response below, the activity does not have a minimum duration. We can say that it lasts up to 8 hours:

Copy
Copied
{
	[...]
	"duration_range": {
		"max": "PT8H"
	},
	[...]
}

Alternatively, in the example response below, the activity does not have a maximum duration. We can say that it lasts at least 2 hours:

Copy
Copied
{
	[...]
	"duration_range": {
		"min": "PT2H"
	},
	[...]
}

Sometimes an activity's duration is dependant on other factors, such as weather or the option booked at checkout, and cannot be well-defined. When either max or min has a value of P0D, we say the duration is flexible:

Copy
Copied
{
	[...]
	"duration_range": {
		"max": "P0D"
	},
	[...]
}

When the duration_range property is absent, use the validity property to describe an activity's length instead.

Validity

Validity is more appropriate for activities without a planned schedule, such as a city pass or museum entrance.

The validity property represents the maximum period of time the activity is valid for a customer once they start.

In the example response below, the activity is valid for 24 hours:

Copy
Copied
{
	[...]
	"validity": "PT24H",
	[...]
}

When the validity property contains a value of P0D, the activity does not have a well-defined length of time. On musement.com, we define the length for these activities as "flexible".

Copyright © TUI Musement. All rights reserved.