Locations and calendars
A company has locations, and each location has one or more calendars.
Locations
{
"id": "0195f0a1-7c2e-7b3a-9d41-6f0a2c8e1b04",
"name": "North Store",
"timezone": "America/Chicago",
"week_starts_on": 0,
"slot_minutes": 15,
"day_starts_at": "08:00",
"day_ends_at": "18:00",
"schedule_period": "weekly",
"phone": "555-0100"
}
week_starts_on is 0 for Sunday through 6 for Saturday. schedule_period is weekly, bi_weekly, semi_monthly or monthly.
GET /api/v1/locations
Needs locations:read. The locations you can reach.
GET /api/v1/locations/{id}
Needs locations:read.
POST /api/v1/locations
Needs locations:create. Send name, timezone and an address (line_1, city, region, optional line_2 and postal_code). You are added to the new location and it starts with a calendar named Main Calendar. Optional: phone, week_starts_on, slot_minutes (15, 30 or 60), day_starts_at, day_ends_at, schedule_period.
PATCH /api/v1/locations/{id}
Needs locations:update. Send only what changes. Scheduling fields only change if you are allowed to change that location's settings.
Calendars
{
"id": "0195f0a1-7c2e-7b3a-9d41-6f0a2c8e1b07",
"location_id": "0195f0a1-7c2e-7b3a-9d41-6f0a2c8e1b04",
"name": "Deliveries",
"is_default": false,
"slot_minutes": 15,
"day_starts_at": "08:00",
"day_ends_at": "18:00",
"hidden_days": [],
"default_template_id": null
}
GET /api/v1/calendars
Needs calendars:read. Calendars at locations you can reach. Add location_id to narrow it.
GET /api/v1/calendars/{id}
Needs calendars:read.
POST /api/v1/calendars
Needs calendars:create. Send location_id and name; optionally slot_minutes, day_starts_at and day_ends_at. Everyone available at the location starts on it.
PATCH /api/v1/calendars/{id}
Needs calendars:update. Send only what changes: name, slot_minutes, day_starts_at, day_ends_at.