Square Menu Category Position Retrieval via API

In Square, we have a Menu where the client has arranged the categories in a specific order in the POS.

Could you please let us know how we can retrieve the position/order of the categories within the Square Menu through the API?

I have attached a screenshot for reference. Is there any way to get the category position from Square?

Category order is exposed on each category object as category_data.parent_category.ordinal. Pull the menu categories with SearchCatalogObjects (object_types: ["CATEGORY"]), keep the ones with category_type: MENU_CATEGORY, group them by parent_category.id (top-level categories have is_top_level: true and no parent id, but they still have an ordinal), then sort each group by parent_category.ordinal ascending.

Ordinals are 64-bit integers that can be large, negative, and non-contiguous, so sort by value instead of treating them as 0, 1, 2. Item order inside a category is separate and lives on the item, in item_data.categories[].ordinal. See CatalogCategory and CatalogObjectCategory.

Hi @zacstlouis

It worked fine.

Thank you for the update.