Create operations locations
The Operations Location API supports creating an Operations Location along with its related Time Windows and Operations Location Group in a single API request, rather than creating them sequentially and linking them by IDs.
This significantly simplifies the setup process for new locations.
How it works
Instead of providing the group ID or creating time_windows separately, you can embed the full definition of the group and the list of time windows directly in the POST request body for the location.
Example Request
Below is an example of a single request that creates:
- A new Operations Location ("Location name").
- A new Operations Location Group (code "E9119").
- A Time Window ("Thursday Day 1") for the location.
{
"address": "Location address",
"code": "QHCode",
"name": "Location name",
"postal_code": "520710",
"point": {
"coordinates": [
101.917644661626,
12.15892431398393
],
"type": "Point"
},
"group": {
"code": "E9119",
"project": "/api/v2/project/888"
},
"project": "/api/v2/project/888",
"time_windows": [
{
"time_window": {
"name": "Thursday Day 1",
"open_time_ts": "1900-01-01T08:30:00+00:00",
"close_time_ts": "1900-01-01T13:00:00+00:00",
"recurrences": "DTSTART:20240905T184432Z\nRRULE:FREQ=DAILY;BYDAY=TH",
"strict": true,
"public_holiday": false,
"project": "/api/v2/project/888"
}
}
]
}
By using this structure, the server handles the creation and linking of all entities in a single transaction.