ScheduleDays Resource
Use the ScheduleDays
resource to fetch a schedule’s days for a location or cart.
Resources:
Schedule | AvailableTimes | Duration | EarliestTime | PickupWindow |
DeliveryWindow | FulfillmentWindow | ScheduleDate | ScheduleTime |
Schema type
Use schedule-days
to reference this resource in the template schema.
Using the schedule-days resource will make the source template render uncacheable. Refer to this guide on how to load uncacheable resources with the template API.
Querying
Filters nullable
-
location_id string
Location
id
of schedule to retrieve. If empty, it will retrieve a schedule based on the active cart (otherwise null).{ "filters": { "location_id": "LXGG1JK52W3Z8" } }
-
fulfillment string
The fulfillment type for the schedule. Only required for location based schedules.
{ "filters": { "fulfillment": "PICKUP" } }
Valid terms:
- PICKUP - DELIVERY
-
square_online_id boolean
Flag to identify the resource to be fetched using legacy
square_online_id
s{ "filters": { "location_id": "11ee258c8d63597882fa089e019fd17a", "square_online_id": true } }
-
day string
day
represents the day in the store location’s timezone. Default isnow
.If set to
now
, the day will be set based on the current time.Otherwise set
day
to an ISO date string, e.g.2024-01-25
. -
range number
The number of days following
day
to check. Default is14
, with a minimum of1
and maximum of365
.{ "filters": { "range": 14 } }
Output
{
"__SO_RESOURCE_TYPE__": "schedule", // internally used resource property. do not modify.
"resource_type": "SCHEDULE_DAYS",
"is_outside_scheduling_window": false,
"earliest_time": {
"time_formatted": "Today at 5:45 PM",
"time_unix": 1705531500,
"time": "2024-01-17T22:45:00+00:00",
"date": "2024-01-17",
"prep_time_duration": {
"in_minutes": 30,
"rfc3339_interval": "PT30M"
},
"label": "5:45 PM",
"is_adjusted_for_capacity_limits": false
},
"available_times": {
"2024-01-20": {
"label": "Sat, January 20, 2024"
},
"2024-01-21": {
"label": "Sun, January 21, 2024"
},
"2024-01-22": {
"label": "Mon, January 22, 2024"
},
"2024-01-23": {
"label": "Tue, January 23, 2024"
}
}
}
Schedule resources
Schedule
A schedule for a location or cart.
Field | Type | Description |
---|---|---|
available_times | AvailableTimes | Map of YYYY-MM-DD => schedule date-object. The field name is a date using the YYYY-MM-DD format (for example 2023-11-06 ). |
earliest_time | EarliestTime | Details about the next available window for fulfillment. |
is_outside_scheduling_window | Boolean | Whether or not earliest available time is outside of scheduling. |
resource_type | String | The resource type identifier. |
AvailableTimes
Field | Type | Description |
---|---|---|
YYYY-MM-DD | ScheduleDate | Fulfillment schedule details on a specific date. |
Duration
|Field|Type|Description| |:——|:——|:——| |in_minutes
|Number
|Duration in minutes.| |rfc3339_interval
|String
|Duration in RFC3339 format.|
EarliestTime
The next available window for a fulfillment. This is always included in any response.
Field | Type | Description |
---|---|---|
is_adjusted_for_capacity_limits | Boolean | Whether or not earliest available time was bumped because of at-capacity periods (i.e. Order Staggering) |
label | String | Prescribed localized time-only label for use in buyer-facing time selectors. |
prep_time_duration | Duration | Details about Prep time duration. |
time_formatted | String | Human-readable label for time. Dependent on fulfillment type. |
time_unix | Number | UNIX timestamp of pickup/delivery time. |
time | String | RFC3339 formatted date-time. |
date | String | RFC3339 date based on the store location’s timezone. |
pickup_window | PickupWindow | Included if using a window for pickup hours. |
delivery_window | DeliveryWindow | Included if the fulfillment is delivery. |
PickupWindow
Window for pickup hours
Field | Type | Description |
---|---|---|
start | FulfillmentWindow | Start of the window for the pickup hours. |
end | FulfillmentWindow | End of the window for the pickup hours. |
DeliveryWindow
Window for delivery hours
Field | Type | Description |
---|---|---|
start | FulfillmentWindow | Start of the window for the delivery hours. |
end | FulfillmentWindow | End of the window for the delivery hours. |
FulfillmentWindow
Window for fulfillment hours
Field | Type | Description |
---|---|---|
time_formatted | String | Human-readable label for time. |
time_unix | Number | UNIX timestamp of pickup/delivery time. |
time | String | RFC3339 formatted date-time. |
ScheduleDate
Schedule date details.
Field | Type | Description |
---|---|---|
label | String | Prescribed localized date-only label for use in buyer-facing date selectors |