Category Resource

Use the Category resource to fetch a single category.

Note that the embedded items on each category are limited to 25.

Resources:

Schema type

Use category to reference this resource in the template schema.

Querying

Filters required

  • id string

    id of the Category to retrieve.

      {
          "filters": {
              "id": "II4VPMMREFDLJ27TKULXOVMS"
          }
      }
    

Filters nullable

  • location_id string
    • Default: Catalog Shipping Location ID

    id of Location 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 with filters.id or filters.ids

      {
          "filters": {
              "id": "II4VPMMREFDLJ27TKULXOVMS",
              "location_id": "location_id"
          }
      }
    
  • 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 and time 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 or deliver time, or the time that the category will be ready by.

    • availability.time array[]

      • availability.time.from string
        • Default: “now”

        If set to now, the time 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, the time object works off of the defined timestamp.

    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)
                  }
              }
          }
          ```
    

Optional

  • optional boolean
    • Default: false

    A resource marked as optional will not cause the page to render a 404 view. Optional only applies to a single resource.

      {
          "filters": {
              "id": "some_id_that_does_not_exist"
          },
          "optional": true
      }
    
    

Output

{
    "__SO_RESOURCE_TYPE__": "category", // internally used resource property. do not modify.
    "id": "II4VPMMREFDLJ27TKULXOVMS"
    "square_online_id": "II4VPMMREFDLJ27TKULXOVMS",
    "resource_type": "CATEGORY",
    "name": "Food",
    "category_type": "REGULAR_CATEGORY",
    "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",
            "resource_type": "ITEM",
            "square_online_id": "5",
            "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": []
}

Category resources

Category

Field Type Description
ancestors Category[] The parent categories, ordered nearest to furthest i.e. immediate parent first, root category last. Note that this is only included on the Category resource, but not the CategoryList
availability Availability Availability based on fulfillment method
created_at String Date at which the category was created
images Image[] Images for the category
items Item[] Items included in the category. Note that this is limited to 25 items.
name String The category’s name
open_graph OpenGraph Details for Open Graph protocol
permalink String The permalink (custom) to this category
preferred_order_square_online_item_ids String[] Order of item ids sorted by user preferred order
resource_type String The resource type identifier.
seo Seo Details for search engine optimization
site_link String The generated site link to this category
id String ID of the category
square_online_id String ID of the category in Square Online
category_type String Type of the category in Square Online (REGULAR_CATEGORY or MENU_CATEGORY)

Back to top

Availability

Information about fulfillment availablilty.

Field Type Description
PICKUP Pickup Time-based category settings
DELIVERY Delivery Time-based category settings
SHIPMENT Boolean Shipping is available

Back to top

NextAvailablePeriod

Field Type Description
{DAY OF WEEK} RelativeOpenInterval Key is the next available day in 3 letter day format (MON, TUE, WED etc.) and the value is the time interval relative to today

Back to top

OpenGraph

Details for Open Graph protocol

Field Type Description
description String OpenGraph description
title String OpenGraph title

Back to top

OpenInterval

Field Type Description
close String Closing time
open String Opening time

Back to top

TimeBasedCategorySettings

Field Type Description
hours Schedule Week Hours
next_available_period NextAvailablePeriod Next available time period for the category based on the availability filter. Empty if no availability filter is provided, or if the category is not a time-based category
root_hours Schedule Week Hours
is_custom_times [Boolean] Whether or not a category is a time-based category
should_display_now Boolean Whether or not the category should be visible on a published site given an availability filter. Non time-based categories will always be true. Time-based categories will always be false if no availability filter is provided

Back to top

RelativeOpenInterval

An available time interval.

Field Type Description
close String The closing time of the interval in HH:MM:SS format, for example: 16:59:59.
is_today Boolean Indicates whether the interval is today.
open String The opening time of the interval in HH:MM:SS format, for example: 09:00:00.

Back to top

Schedule

Field Type Description
FRI OpenInterval[] List of hours for Friday. Empty if category is not a time-based category
MON OpenInterval[] List of hours for Monday. Empty if category is not a time-based category
SAT OpenInterval[] List of hours for Saturday. Empty if category is not a time-based category
SUN OpenInterval[] List of hours for Sunday. Empty if category is not a time-based category
THU OpenInterval[] List of hours for Thursday. Empty if category is not a time-based category
TUE OpenInterval[] List of hours for Tuesday. Empty if category is not a time-based category
WED OpenInterval[] List of hours for Wednesday. Empty if category is not a time-based category

Back to top

Seo

Details for search engine optimization

Field Type Description
page_description String SEO text entered by the site owner
page_title String The page title as it should appear on search engines