CategoryList Resource
Use the CategoryList
resource to fetch multiple categories.
See Category Resource for information about related resources.
Note that the embedded items on each category in the list are limited to 25.
Schema type
Use category-list
to reference this resource in the template schema.
Querying
Filters nullable
-
ids string[]
Array of
Category
id
s to retrieve. Having this filter negates anysort
filter defined on the samecategory-list
resource.{ "filters": { "ids": ["II4VPMMREFDLJ27TKULXOVMS", "NIJIIMAJJX4LZ4KF2MKHTGNY"] } }
- location_id string
- Default: Catalog Shipping Location ID
id
ofLocation
to scope a category to. The category data received will be based off of the category’s configuration at the given location. Must be used in conjunction withfilters.id
orfilters.ids
5{ "filters": { "ids": ["II4VPMMREFDLJ27TKULXOVMS"], "location_id": "location_id" } }
-
search string
Returns categories that match the search term.
{ "filters": { "search": "t-shirts" } }
-
status string[]
-
status.in_stock string
Filters list of items attached to the category depending on inventory stock status. Items denoted as sold out will be removed from the items list attached to the category
{ "filters": { "status": [ "in_stock" ] } }
-
-
availability array[]
Key values
by
andtime
are required.-
availability.by string
Valid values:
ordering
,deliver
,ready
Provides the next available time period that a category will be available at for each given fulfillment method by the
ordering
ordeliver
time, or the time that the category will beready
by. -
availability.time array[]
- availability.time.from string
- Default: “now”
If set to
now
, thetime
object works off of the current timestamp at the time of the request.If set to a 24 hour (e.g.
14:30:00
) or UNIX (e.g.1699073149
) timestamp, thetime
object works off of the defined timestamp.
- availability.time.from string
Availability Example
``` { // Provides a category's next availability window "availability": { "by": "ordering", // Find categories by "ordering" time "time": { "from": "now", // use the current time "from": "14:00:00", // or 24 hour timestamp (2pm) } } } ```
-
List Rendering
When filters.ids
is not defined, the first page of categories will return as a result.
{ // Fetches first page of categories and filters for out any out of stock items within each category
"filters": {
"status": [
"in_stock"
]
}
}
Pagination
- pagination.page_size number
- Default: 100
Control the page size of the category 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 category 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 thepaginate_meta
function. - pagination.page_query_param string
- Default:
{property_name}_page
Control the query param that loads the page number of the category list. By default, the query param used is the name of the property with
_page
attached as a suffix. Does not apply tofilters.ids
requests.{ "all_categories": { "pagination": { "page_size": 50, "page_query_param": "page" } } }
Results in
mysite.com/shop?page=4
to load the fourth page of the correlating category list. By default, the pagination query parameter would beall_categories_page
if no query parameter override was provided - Default:
Sorting
-
sort.by string Sort categories in response by a given term.
{ "filters": { "ids": ["3", "5", "7", "9"] }, "sort": { "by": "name" } }
Valid terms:
- name
-
sort.order string
- Default: “asc”
Sort order of categories in response.
{ "sort": { "order": "desc" } }
Valid terms:
- asc - desc
Output
[{
"__SO_RESOURCE_TYPE__": "category", // internally used resource property. do not modify.
"id": "II4VPMMREFDLJ27TKULXOVMS"
"square_online_id": "II4VPMMREFDLJ27TKULXOVMS",
"resource_type": "CATEGORY",
"name": "Food",
"seo": {
"page_title": null,
"page_description": null
},
"open_graph": {
"title": null,
"description": null
},
"availability": {
"PICKUP": {
"hours": {
"SUN": [],
"MON": [],
"TUE": [],
"WED": [],
"THU": [],
"FRI": [
{
"open": "09:00:00",
"close": "17:00:00"
}
],
"SAT": []
},
"root_hours": {
"SUN": [],
"MON": [],
"TUE": [],
"WED": [],
"THU": [],
"FRI": [
{
"open": "09:00:00",
"close": "17:00:00"
}
],
"SAT": []
},
"should_display_now": false,
"next_available_period": {
"FRI": {
"open": "09:00:00",
"close": "16:59:59",
"is_today": false
}
}
},
"SHIPMENT": true
},
"preferred_order_square_online_item_ids": [
"9",
"6",
"5"
],
"site_link": "shop/food/4",
"permalink": null,
"items": [
{
"id": "A56GLJN57UQWINMKYA6SXNHJ",
"square_online_id": "6",
"resource_type": "ITEM",
"name": "Sun-Dried Red Shrimp Turtle Treats",
"description": "",
"description_html": null,
"visibility": "VISIBLE",
"item_type": "REGULAR",
"available": true,
"is_alcoholic": false,
"price": {
"high": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"high_with_modifiers": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"high_with_subscriptions": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"low": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"low_with_modifiers": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"low_with_subscriptions": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"regular_high": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"regular_high_with_modifiers": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"regular_high_with_subscriptions": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"regular_low": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"regular_low_with_modifiers": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"regular_low_with_subscriptions": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
},
"images": [
{
"absolute_url": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i1_w232.jpeg",
"width": 232,
"height": 232,
"format": "jpeg",
"absolute_urls": {
"80": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i1_w232.jpeg?width=80",
"160": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i1_w232.jpeg?width=160"
}
},
{
"absolute_url": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i2_w250.jpeg",
"width": 250,
"height": 600,
"format": "jpeg",
"absolute_urls": {
"80": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i2_w250.jpeg?width=80",
"160": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i2_w250.jpeg?width=160"
}
},
{
"absolute_url": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i3_w108.jpeg",
"width": 108,
"height": 108,
"format": "jpeg",
"absolute_urls": {
"80": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p6_i3_w108.jpeg?width=80"
}
}
],
"variations": [
{
"id": "DOA573FLBKABDMEEKBL6ZIFG",
"item_id": "A56GLJN57UQWINMKYA6SXNHJ",
"square_online_item_id": "6",
"square_online_id": "1",
"name": "Regular",
"ordinal": 1,
"price": {
"current": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"regular": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"sale": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
"high": {
"amount": 3600,
"currency": "USD",
"formatted": "$36.00"
},
},
"pricing_type": "FIXED_PRICING",
"sold_out": false,
"inventory": 0
}
],
"badges": {
"low_stock": false,
"out_of_stock": false,
"on_sale": false
},
"seo": {
"page_description": null,
"page_title": null
},
"open_graph": {
"title": null,
"description": null
},
"avg_rating": 5,
"avg_rating_all": 5,
"inventory": {
"total": 0,
"lowest": null,
"enabled": false,
"all_variations_sold_out": false,
"some_variations_sold_out": false
},
"measurement_units": {
"multiple_units": null,
"abbreviation": null,
"precision": null
},
"fulfillment": {
"methods": {
"SHIPMENT": true,
"PICKUP": false,
"DELIVERY": false,
"DINE_IN": false,
"MANUAL": false,
"DIGITAL": false
},
"methods_at_any_location": {
"SHIPMENT": true,
"PICKUP": false,
"DELIVERY": false,
"DINE_IN": false,
"MANUAL": false,
"DIGITAL": false
}
},
"fulfillment_availability": {
"PICKUP": [],
"SHIPMENT": []
},
"categories": [],
"discounts": [],
"preordering": {
"PICKUP": false,
"DELIVERY": false,
"SHIPMENT": false,
"DINE_IN": false,
"MANUAL": false,
"DIGITAL": false
},
"prep_time_duration": {
"in_minutes": 30,
"rfc3339_interval": "PT30M"
},
"per_order_max": 0
},
{
"id": "WUH4RMB3WUDBQJQAOMYN56WD",
"square_online_id": "5",
"resource_type": "ITEM",
"name": "Floating Sticks Turtle Food",
"description": "Fortified with calcium and vitamin CFood floats for easier pet interactionProtein-rich floating pellets fortified with vitamins for proper turtle nutritionPromotes strong shell and skeletal developmentReadily accepted by a variety of aquatic turtle species",
"description_html": "<ul><li>Fortified with calcium and vitamin C</li><li>Food floats for easier pet interaction</li><li>Protein-rich floating pellets fortified with vitamins for proper turtle nutrition</li><li>Promotes strong shell and skeletal development</li><li>Readily accepted by a variety of aquatic turtle species</li></ul><p><br /></p>",
"visibility": "VISIBLE",
"item_type": "REGULAR",
"available": true,
"is_alcoholic": false,
"price": {
"high": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"high_with_modifiers": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"high_with_subscriptions": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"low": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"low_with_modifiers": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"low_with_subscriptions": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"regular_high": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"regular_high_with_modifiers": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"regular_high_with_subscriptions": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"regular_low": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"regular_low_with_modifiers": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"regular_low_with_subscriptions": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
},
"images": [
{
"absolute_url": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i6_w679.jpeg",
"width": 679,
"height": 1382,
"format": "jpeg",
"absolute_urls": {
"80": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i6_w679.jpeg?width=80",
"160": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i6_w679.jpeg?width=160",
"320": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i6_w679.jpeg?width=320",
"640": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i6_w679.jpeg?width=640"
}
},
{
"absolute_url": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i7_w679.jpeg",
"width": 679,
"height": 1386,
"format": "jpeg",
"absolute_urls": {
"80": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i7_w679.jpeg?width=80",
"160": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i7_w679.jpeg?width=160",
"320": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i7_w679.jpeg?width=320",
"640": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i7_w679.jpeg?width=640"
}
},
{
"absolute_url": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i8_w679.jpeg",
"width": 679,
"height": 1382,
"format": "jpeg",
"absolute_urls": {
"80": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i8_w679.jpeg?width=80",
"160": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i8_w679.jpeg?width=160",
"320": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i8_w679.jpeg?width=320",
"640": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i8_w679.jpeg?width=640"
}
},
{
"absolute_url": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i9_w679.jpeg",
"width": 679,
"height": 1140,
"format": "jpeg",
"absolute_urls": {
"80": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i9_w679.jpeg?width=80",
"160": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i9_w679.jpeg?width=160",
"320": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i9_w679.jpeg?width=320",
"640": "https://769244280274161852.staging.weebly.net/uploads/1/2/1/7/121778831/s604497668748833845_p5_i9_w679.jpeg?width=640"
}
}
],
"variations": [
{
"id": "W42ZQ4XFIFBAUDI4WU33TNML",
"item_id": "WUH4RMB3WUDBQJQAOMYN56WD",
"square_online_item_id": "5",
"square_online_id": "1",
"name": "10oz jar",
"ordinal": 2,
"price": {
"current": {
"amount": 800,
"currency": "USD",
"formatted": "$8.00"
},
"regular": {
"amount": 800,
"currency": "USD",
"formatted": "18.00"
},
"sale": {
"amount": 800,
"currency": "USD",
"formatted": "18.00"
},
"high": {
"amount": 800,
"currency": "USD",
"formatted": "$8.00"
},
},
"pricing_type": "FIXED_PRICING",
"sold_out": false,
"inventory": 0
},
{
"id": "SYJWOFGPDF4AH5LU3JBV542Y",
"item_id": "WUH4RMB3WUDBQJQAOMYN56WD",
"square_online_item_id": "5",
"square_online_id": "2",
"name": "36oz jar",
"ordinal": 5,
"price": {
"current": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"regular": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"sale": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
"high": {
"amount": 5600,
"currency": "USD",
"formatted": "$56.00"
},
},
"pricing_type": "FIXED_PRICING",
"sold_out": false,
"inventory": 0
},
{
"id": "QDU2YAJLXVJG2D2S6A4PILHE",
"item_id": "WUH4RMB3WUDBQJQAOMYN56WD",
"square_online_item_id": "5",
"square_online_id": "3",
"name": "4oz jar",
"ordinal": 1,
"price": {
"current": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"regular": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"sale": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
"high": {
"amount": 400,
"currency": "USD",
"formatted": "$4.00"
},
},
"pricing_type": "FIXED_PRICING",
"sold_out": false,
"inventory": 0
},
{
"id": "7EMQU5ZMWSWKYV6HKXBF6543",
"item_id": "WUH4RMB3WUDBQJQAOMYN56WD",
"square_online_item_id": "5",
"square_online_id": "4",
"name": "16oz jar",
"ordinal": 3,
"price": {
"current": {
"amount": 1400,
"currency": "USD",
"formatted": "$14.00"
},
"regular": {
"amount": 1400,
"currency": "USD",
"formatted": "$14.00"
},
"sale": {
"amount": 1400,
"currency": "USD",
"formatted": "$14.00"
},
"high": {
"amount": 1400,
"currency": "USD",
"formatted": "$14.00"
},
},
"pricing_type": "FIXED_PRICING",
"sold_out": false,
"inventory": 0
},
{
"id": "MVJPJTWPE4BJPV3VPUH5TUFG",
"item_id": "WUH4RMB3WUDBQJQAOMYN56WD",
"square_online_item_id": "5",
"square_online_id": "5",
"name": "20oz jar",
"ordinal": 4,
"price": {
"current": {
"amount": 3200,
"currency": "USD",
"formatted": "$32.00"
},
"regular": {
"amount": 3200,
"currency": "USD",
"formatted": "$32.00"
},
"sale": {
"amount": 3200,
"currency": "USD",
"formatted": "$32.00"
},
"high": {
"amount": 3200,
"currency": "USD",
"formatted": "$32.00"
},
},
"pricing_type": "FIXED_PRICING",
"sold_out": false,
"inventory": 0
}
],
"badges": {
"low_stock": false,
"out_of_stock": false,
"on_sale": false
},
"seo": {
"page_description": null,
"page_title": null
},
"open_graph": {
"title": null,
"description": null
},
"avg_rating": null,
"avg_rating_all": null,
"inventory": {
"total": 0,
"lowest": null,
"enabled": false,
"all_variations_sold_out": false,
"some_variations_sold_out": false
},
"measurement_units": {
"multiple_units": null,
"abbreviation": null,
"precision": null
},
"fulfillment": {
"methods": {
"SHIPMENT": true,
"PICKUP": false,
"DELIVERY": false,
"DINE_IN": false,
"MANUAL": false,
"DIGITAL": false
},
"methods_at_any_location": {
"SHIPMENT": true,
"PICKUP": false,
"DELIVERY": false,
"DINE_IN": false,
"MANUAL": false,
"DIGITAL": false
}
},
"fulfillment_availability": {
"PICKUP": [],
"SHIPMENT": []
},
"categories": [],
"discounts": [],
"preordering": {
"PICKUP": false,
"DELIVERY": false,
"SHIPMENT": false,
"DINE_IN": false,
"MANUAL": false,
"DIGITAL": false
},
"prep_time_duration": {
"in_minutes": 30,
"rfc3339_interval": "PT30M"
},
"per_order_max": 0
}
],
"ancestors": []
}]