Locations
Location Index Endpoint
Structure
See View Location Endpoint for the structure of the location payload inside the data array.
Example Request
GET /api/locations?per_page=2
Example Response
{
"current_page": 1,
"data": [
//...
],
"first_page_url": "http://aero.test/api/locations?page=1",
"from": 1,
"last_page": 3,
"last_page_url": "http://aero.test/api/locations?page=3",
"next_page_url": "http://aero.test/api/locations?page=2",
"path": "http://aero.test/api/locations",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 5
}
See View Location Endpoint for the structure of the location payload inside the data array.
View Location Endpoint
Structure
Location
Name
|
Type
|
Description
|
id |
int |
The id for the location |
name |
string |
The name of the location |
email |
string |
The email of the location |
phone |
string |
The phone number for the location |
line_1 |
string |
The first line for the location |
line_2 |
string |
The second line for the location |
city |
string |
The city for the location |
county |
string |
The county for the location |
zone |
string |
The zone code for the location, required for some countries (e.g., US, AU, etc) |
postcode |
string |
The postcode for the location, required for some countries (e.g., GB, US, etc) |
country |
string |
The country code for the location |
latitude |
float |
The latitude for the location |
longitude |
float |
The longitude for the location |
opening_hours |
object |
See Opening Hours |
additional_attributes |
array |
An array of Additional Attribute objects |
Opening Hours
Name
|
Type
|
Description
|
sunday.times |
array |
An array of Time objects |
monday.times |
array |
An array of Time objects |
tuesday.times |
array |
An array of Time objects |
wednesday.times |
array |
An array of Time objects |
thursday.times |
array |
An array of Time objects |
friday.times |
array |
An array of Time objects |
saturday.times |
array |
An array of Time objects |
overrides |
object |
See Overrides |
Time
Name
|
Type
|
Description
|
start |
time |
The start of the time range |
end |
time |
The end of the time range |
Overrides
Name
|
Type
|
Description
|
date |
date |
The date the override is for |
label |
string |
The label for the override |
times |
array |
An array of Time objects |
Additional Attribute
Name
|
Type
|
Description
|
key |
string |
The key of the additional attribute |
value |
string |
The value of the additional attribute |
Example Request
GET /api/locations/{id|name}
Example Response
{
"id": 1,
"name": "Aero Commerce",
"email": null,
"phone": null,
"latitude": null,
"longitude": null,
"line_1": "28-32 Albert Rd",
"line_2": null,
"city": "Middlesbrough",
"county": null,
"zone": null,
"postcode": "TS1 1QD",
"country": "GB",
"opening_hours": {
"sunday": {
"times": []
},
"monday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"tuesday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"wednesday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"thursday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"friday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"saturday": {
"times": []
},
"overrides": [
{
"date": "2025-12-25",
"label": "Christmas Day",
"times": []
},
{
"date": "2025-08-25",
"label": "Bank Holiday",
"times": []
}
]
},
"additional_attributes": []
}
Create Location Endpoint
Structure
Location
Name
|
Type
|
Description
|
Required
|
id |
int |
The id for the location |
No |
name |
string |
The name of the location |
Yes |
email |
string |
The email of the location |
No |
phone |
string |
The phone number for the location |
No |
line_1 |
string |
The first line for the location |
Yes |
line_2 |
string |
The second line for the location |
No |
city |
string |
The city for the location |
Yes |
county |
string |
The county for the location |
No |
zone |
string |
The zone code for the location, required for some countries (e.g., US, AU, etc) |
Conditional |
postcode |
string |
The postcode for the location, required for some countries (e.g., GB, US, etc) |
Conditional |
country |
string |
The country code for the location |
Yes |
latitude |
float |
The latitude for the location |
No |
longitude |
float |
The longitude for the location |
No |
opening_hours |
object |
See Opening Hours |
No |
additional_attributes |
array |
An array of Additional Attribute objects |
No |
Opening Hours
Name
|
Type
|
Description
|
Required
|
sunday.times |
array |
An array of Time objects |
No |
monday.times |
array |
An array of Time objects |
No |
tuesday.times |
array |
An array of Time objects |
No |
wednesday.times |
array |
An array of Time objects |
No |
thursday.times |
array |
An array of Time objects |
No |
friday.times |
array |
An array of Time objects |
No |
saturday.times |
array |
An array of Time objects |
No |
overrides |
object |
See Overrides |
No |
Time
Name
|
Type
|
Description
|
Required
|
start |
time |
The start of the time range |
Yes |
end |
time |
The end of the time range |
Yes |
Overrides
Name
|
Type
|
Description
|
Required
|
date |
date |
The date the override is for |
Yes |
label |
string |
The label for the override |
No |
times |
array |
An array of Time objects |
No |
Additional Attribute
Name
|
Type
|
Description
|
Required
|
key |
string |
The key of the additional attribute |
Yes |
value |
string |
The value of the additional attribute |
Yes |
Example Request
POST /api/locations/
{
"name": "Aero Commerce",
"line_1": "28-32 Albert Rd",
"city": "Middlesbrough",
"postcode": "TS1 1QD",
"country": "GB",
"opening_hours": {
"monday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"tuesday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"wednesday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"thursday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"friday": {
"times": [
{
"start": "07:00",
"end": "12:00"
},
{
"start": "12:30",
"end": "15:00"
}
]
},
"overrides": [
{
"date": "2025-12-25",
"label": "Christmas Day"
},
{
"date": "2025-08-25",
"label": "Bank Holiday"
}
]
}
}
Example Response
{
"location": {
"id": 1
}
}
Update Location Endpoint
Structure
Location
Name
|
Type
|
Description
|
Required
|
id |
int |
The id for the location |
No |
name |
string |
The name of the location |
No |
email |
string |
The email of the location |
No |
phone |
string |
The phone number for the location |
No |
line_1 |
string |
The first line for the location |
No |
line_2 |
string |
The second line for the location |
No |
city |
string |
The city for the location |
No |
county |
string |
The county for the location |
No |
zone |
string |
The zone code for the location, required for some countries (e.g., US, AU, etc) |
No |
postcode |
string |
The postcode for the location, required for some countries (e.g., GB, US, etc) |
No |
country |
string |
The country code for the location |
No |
latitude |
float |
The latitude for the location |
No |
longitude |
float |
The longitude for the location |
No |
opening_hours |
object |
See Opening Hours |
No |
additional_attributes |
array |
An array of Additional Attribute objects |
No |
Opening Hours
Name
|
Type
|
Description
|
Required
|
sunday.times |
array |
An array of Time objects |
No |
monday.times |
array |
An array of Time objects |
No |
tuesday.times |
array |
An array of Time objects |
No |
wednesday.times |
array |
An array of Time objects |
No |
thursday.times |
array |
An array of Time objects |
No |
friday.times |
array |
An array of Time objects |
No |
saturday.times |
array |
An array of Time objects |
No |
overrides |
object |
See Overrides |
No |
Time
Name
|
Type
|
Description
|
Required
|
start |
time |
The start of the time range |
Yes |
end |
time |
The end of the time range |
Yes |
Overrides
Name
|
Type
|
Description
|
Required
|
date |
date |
The date the override is for |
Yes |
label |
string |
The label for the override |
No |
times |
array |
An array of Time objects |
No |
Additional Attribute
Name
|
Type
|
Description
|
Required
|
key |
string |
The key of the additional attribute |
Yes |
value |
string |
The value of the additional attribute |
Yes |
Example Request
PUT /api/locations/{id|name}
{
"opening_hours": {
"monday": {
"times": [
{
"start": "09:00",
"end": "12:30"
},
{
"start": "13:00",
"end": "17:00"
}
]
},
"overrides": [
{
"date": "2025-12-26",
"label": "Boxing Day",
"times": []
}
]
},
}
Example Response
{
"location": {
"id": 1
}
}