LocationList Resource

Use the LocationList resource to fetch multiple locations.

See Location Resource for information about related resources.

Schema type

Use location-list to reference this resource in the template schema.

Querying

Filters nullable

  • ids string[]

    Array of Location ids to retrieve. Sorting and fulfillment type filters will not apply to an ids filter.

      {
          "filters": {
              "ids": ["LXGG1JK52W3Z8"]
          }
      }
    
  • square_online_id boolean

    Flag to identify the resource to be fetched using legacy square_online_ids

      {
          "filters": {
              "ids": ["11edb2cfc4a95e22ba3b2c600c83e955", "11edb2cfc4a95e22ba3b2c600c83e955"],
              "square_online_id": true
          }
      }
    
  • fulfillments string[]

    • Values: PICKUP DELIVERY

    Filter locations by supported fulfillment types.

      {
          "filters": {
              "fulfillments": ["PICKUP"]
          }
      }
    

List Rendering

When filters.ids is not defined, the first page (length: 200) of locations will return as a result.

{ // Fetches all pickup locations, paginated
    "filters": {
        "fulfillments": [
            "PICKUP"
        ]
    }
}

Pagination

  • pagination.page_size number
    • Default: 100

    Control the page size of the location list request. Does not apply to filters.ids requests.

      {
          "filters": {
              "status": [
                  "in_stock"
              ]
          },
          "pagination": {
              "page_size": 50
          }
      }
    
  • pagination.page number
    • Default: 1

    Control the page number of the location list request. Does not apply to filters.ids requests.

      {
          "pagination": {
              "page_size": 50,
              "page": 2
          }
      }
    
  • pagination.meta_name string nullable

    Used to set the name for this resource when loaded via a resource function for use with the paginate_meta function. Note that this field is ignored for resources loaded via a template’s schema, as the resource name itself is used for the paginate_meta function.

  • pagination.page_query_param string
    • Default: {property_name}_page

    Control the query param that loads the page number of the location list. By default, the query param used is the name of the property with _page attached as a suffix. Does not apply to filters.ids requests.

      {
          "active_locations": {
              "pagination": {
                  "page_size": 50,
                  "page_query_param": "page"
              }
          }
      }
    

    Results in mysite.com/shop?page=4 to load the fourth page of the correlating location list. By default, the pagination query parameter would be active_locations_page if no query parameter override was provided

Sorting

  • from object

    Sort locations by latitude/longitude or by place_id. The place_id can be fetched using the places API or an IdealPostcode can be provided

      {
          "filters": {
              "fulfillments": ["PICKUP"]
          },
          "sort": {
              "from": {
                  "lat": 40.7291108,
                  "lng": -73.9928264
                  // or
                  "place_id": "G:ChIJhczEaaxghYAR7_8flgRgQQ4"
              }
          }
      }
    

Output

[{
    "__SO_RESOURCE_TYPE__": "location", // internally used resource property. do not modify.
    "id": "LXGG1JK52W3Z8",
    "resource_type": "LOCATION",
    "square_online_id": "11edb2cfc4a95e22ba3b2c600c83e955",
    "description": "",
    "country": "US",
    "timezone": "America/Los_Angeles",
    "service_fee": 0,
    "address": {
        "name": "My Business",
        "country": "US",
        "locality": "New york",
        "postal_code": "10016",
        "address_line_1": "1583 Duncan Ave",
        "administrative_district_level_1": "NY",
        "phone": "+14152323232",
        "email": ""
    },
    "coordinates": {
        "latitude": 40.728951,
        "longitude": -74.081657
    },
    "dine_in": {
        "enabled": true
    },
    "PICKUP": {
        "enabled": true,
        "curbside_pickup_enabled": true,
        "instructions": "These are my pickup instructions",
        "order_subtotal_minimum": 20,
        "prep_time_duration": {
            "in_minutes": 30,
            "rfc3339_interval": "PT30M"
        },
        "schedule_pickup": {
            "enabled": true,
            "max_days": 90
        },
        "timeslot_type": "specific",
        "minimum_days_required": 0,
        "auto_assign_time": true,
        "max_orders_per_window": 8,
        "cutoff_time": "10:00:00",
        "hours": {
            "SUN": [],
            "SAT": [],
            "MON": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00"
                }
            ],
            "TUE": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00"
                }
            ],
            "WED": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00"
                }
            ],
            "THU": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00"
                }
            ],
            "FRI": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00"
                }
            ]
        }
    },
    "DELIVERY": {
        "enabled": true,
        "areas": [
            {
                "id": "11ee24b2e5f222ca9e9886f5c1e4bcd8",
                "type": "zipcode",
                "radius_center": {
                    "latitude": null,
                    "longitude": null
                },
                "radius_length": {
                    "unit": "mile",
                    "length": null
                },
                "zipcode": "10002"
            }
        ],
        "couriers": [
            {
                "id": "11ee24b2e5f2895498d786f5c1e4bcd8",
                "name": "seller",
                "is_choose_for_me_selection": false
            }
        ],
        "estimated_max_duration": {
            "in_minutes": 10,
            "rfc3339_interval": "PT10M"
        },
        "estimated_min_duration": {
            "in_minutes": 5,
            "rfc3339_interval": "PT5M"
        },
        "fee_maximum_enabled": false,
        "fee_maximum": 0,
        "fee": 0,
        "no_contact_enabled": false,
        "order_subtotal_minimum": 0,
        "prep_time_duration": {
            "in_minutes": null,
            "rfc3339_interval": null
        },
        "schedule_delivery_enabled": true,
        "hours": {
            "SUN": [],
            "MON": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00",
                    "open_formatted": "9:00 AM",
                    "close_formatted": "5:00 PM"
                }
            ],
            "TUE": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00",
                    "open_formatted": "9:00 AM",
                    "close_formatted": "5:00 PM"
                }
            ],
            "WED": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00",
                    "open_formatted": "9:00 AM",
                    "close_formatted": "5:00 PM"
                }
            ],
            "THU": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00",
                    "open_formatted": "9:00 AM",
                    "close_formatted": "5:00 PM"
                }
            ],
            "FRI": [
                {
                    "open": "09:00:00",
                    "close": "17:00:00",
                    "open_formatted": "9:00 AM",
                    "close_formatted": "5:00 PM"
                }
            ],
            "SAT": []
        }
    }
    "fulfillment": {
        "no_eta_instructions": "go to the store and say whats up for pickup.",
        "no_eta_short_instructions": "short message for manual set pickup"
    }
}]