List Product Categories

Payiano categories are delving a key feature of your product management system. This isn't just about listing names; Without a catalog, finding a product would be a daunting task. It's the starting point for understanding your inventory. It answers questions like, "What kinds of products do we offer?" and "How are our products organized?" This clarity is crucial not only for your team but also for customers navigating your product offerings.

Categories like having a directory of all the different types of products you sell. For example, if you sell clothes, this list might show categories like 'Men’s Clothing', 'Women’s Clothing', and 'Children’s Clothing'. It helps you see all the categories at once, making it easy to get an overview of what you offer. This is really helpful for keeping things organized and making sure you know all the different areas your products fit into.

You can sort categories based on various factors - which ones are most popular, which are new, or even which ones are seasonal. Such sorting makes this tool not just informative but also strategic. This endpoint could also integrate analytics, showing which categories are performing well, guiding your marketing and stocking decisions.

GET/product_categories
Sandbox: https://api.payiano.dev/v1/product_categories
Live: https://api.payiano.com/v1/product_categories
Security
  • Authorization header with access token is required to access this endpoint: Bearer ACCESS-TOKEN
  • Your access token should be associated to this permission product_categories_view
Request
Request body schema:
application/json
Query parameters:
page
Type: integer|null
Default: 1

The page number to be retrieved, for the list of product categories. So, a combination of page=1 and per_page=25 returns the first 25 product categories. A combination of page=2 and per_page=25 returns the next 25 product categories.

per_page
Type: integer|null
Default: 25
Possible values: [1 ... 200]

The maximum number of product categories to return in the response.

includes
Type: array_of_enums|null
Possible values:
[
"product_category.products_count", "product_category.categories_count", "product_category.parent_category", "product_category.parent_category.products_count", "product_category.parent_category.categories_count", "product_category.parent_category.metadata", "product_category.metadata" ]

A list of additional product category relations to return, if available. Feel free to send the relations you would like to return with every item. See Including Resources to better understand how this is working.

Response
200
Response schema:
application/json
Response body:
total_pages
Type: integer

The total number of pages that are available for the product categories search criteria.

current_page
Type: integer

The current pagination page.

per_page
Type: integer

The amount of product categories items return per page.

total_items
Type: integer

The total number of product categories that match the search criteria.

items
Type: array_of_objects

The list of product categories that match the search criteria.

id
Type: ulid
Length: 26

The unique ID assigned to each product category which is generated by our system using the ULID format. Each ID is precisely 26 characters long, ensuring a unique and consistent identifier for every product category. This ULID is automatically created by our system and is used to uniquely identify and track each product category in our database.

name
Type: string
Min: 1
Max: 255

The attribute is like a title that succinctly captures the essence of what the category represents. For example, if you have a category for sports shoes, the name could be something straightforward like "Sports Shoes." This attribute is crucial because it's the first thing customers and staff see. It should be clear, concise, and reflective of the contents of the category. A well-chosen name helps users quickly understand what types of products they can expect to find under this category, enhancing their browsing and shopping experience. Please notice that duplicate values are not allowed.

is_active
Type: boolean
Default: true

This value indicates whether the product category is active or not. This flag can be used to control the product category's availability in runtime environments or listings without deleting or removing the product category from records. A true value means the product category is active and functioning, while a false value implies that the product category is deactivated or not in use.

reference_id
Type: string|null
Max: 50

It's a unique identifier assigned to each product category. It's primary role is to distinguish one product category from another, ensuring that each product category can be individually tracked and managed without any confusion. Please notice that duplicate values are not allowed and it's allowed to use alpha dash only [A-Za-z0-9-_]. The reference_id value is used to Identify Resource when you consume any product category endpoint with sending identify_by query parameter with value reference_id.

slug
Type: string
Min: 1
Max: 255

This attribute is a URL-friendly version of the category name. It's used in the web address to help users and search engines find the category page easily. For instance, if you have a category named "Sports Shoes" the slug might be "sports-shoes". It's a simplified version of the name and without spaces. Slugs are important for website navigation and SEO . A well-crafted slug makes it easier for customers to remember and type the URL, and it helps improve the category's visibility in search engine results. Please notice that duplicate values are not allowed and it's allowed to use alpha dash only [A-Za-z0-9-_]. If the slug value is not provided, the Payiano system automatically generates one based on the provided name attribute. This auto-generation of the slug ensures consistency and convenience, eliminating the need for manual slug entry.

parent_category_id
Type: ulid|null

This attribute establishes a hierarchical relationship between categories. It's used to show that one category is a subcategory of another. For example, if you have a main category called "Footwear" and a subcategory called "Sports Shoes" the "Sports Shoes" category would have "Footwear" as its parent category. The parent_category_id attribute would be the unique identifier of the "Footwear" category. This attribute is crucial for organizing categories in a structured and logical manner. It helps users navigate through different levels of categories smoothly, making it easier to browse products and understand their classification.

description
Type: string|null
Min: 1
Max: 10000

This attribute provides more detailed information about the product category. It's like a brief paragraph that explains what the category is about and what it includes. This attribute is important because it gives context and depth to the category name, offering users a clearer understanding of what's included and potentially the types of customers the category is aimed at. A good description can also help in search optimization, making it easier for customers to find what they're looking for through search engines.

is_deleted
Type: boolean
Default: false

This value indicates whether the product category is deleted or not. This flag can be used to control the product category's availability in runtime without actual deleting or removing the product category from records. A true value means the product category is deleted, while a false value implies that the product category is not deleted and functioning.

products_count
Type: integer

This attribute represents the total number of products that directly fall under a specific product category. This is a numerical value that provides immediate insight into the size and scope of each category.

categories_count
Type: integer

This attribute is a numerical value that represents the total number of direct child categories contained within a specific parent product category. Essentially, it acts as a counter for the subcategories under a given category.

parent_category
Type: object

The attribute is a reference to the category that a given category falls under in the hierarchy of product categorization. It's essentially a link to the 'parent' category of which the current category is a subcategory.

id
Type: ulid
Length: 26

The unique ID assigned to each product category which is generated by our system using the ULID format. Each ID is precisely 26 characters long, ensuring a unique and consistent identifier for every product category. This ULID is automatically created by our system and is used to uniquely identify and track each product category in our database.

name
Type: string
Min: 1
Max: 255

The attribute is like a title that succinctly captures the essence of what the category represents. For example, if you have a category for sports shoes, the name could be something straightforward like "Sports Shoes." This attribute is crucial because it's the first thing customers and staff see. It should be clear, concise, and reflective of the contents of the category. A well-chosen name helps users quickly understand what types of products they can expect to find under this category, enhancing their browsing and shopping experience. Please notice that duplicate values are not allowed.

is_active
Type: boolean
Default: true

This value indicates whether the product category is active or not. This flag can be used to control the product category's availability in runtime environments or listings without deleting or removing the product category from records. A true value means the product category is active and functioning, while a false value implies that the product category is deactivated or not in use.

reference_id
Type: string|null
Max: 50

It's a unique identifier assigned to each product category. It's primary role is to distinguish one product category from another, ensuring that each product category can be individually tracked and managed without any confusion. Please notice that duplicate values are not allowed and it's allowed to use alpha dash only [A-Za-z0-9-_]. The reference_id value is used to Identify Resource when you consume any product category endpoint with sending identify_by query parameter with value reference_id.

slug
Type: string
Min: 1
Max: 255

This attribute is a URL-friendly version of the category name. It's used in the web address to help users and search engines find the category page easily. For instance, if you have a category named "Sports Shoes" the slug might be "sports-shoes". It's a simplified version of the name and without spaces. Slugs are important for website navigation and SEO . A well-crafted slug makes it easier for customers to remember and type the URL, and it helps improve the category's visibility in search engine results. Please notice that duplicate values are not allowed and it's allowed to use alpha dash only [A-Za-z0-9-_]. If the slug value is not provided, the Payiano system automatically generates one based on the provided name attribute. This auto-generation of the slug ensures consistency and convenience, eliminating the need for manual slug entry.

parent_category_id
Type: ulid|null

This attribute establishes a hierarchical relationship between categories. It's used to show that one category is a subcategory of another. For example, if you have a main category called "Footwear" and a subcategory called "Sports Shoes" the "Sports Shoes" category would have "Footwear" as its parent category. The parent_category_id attribute would be the unique identifier of the "Footwear" category. This attribute is crucial for organizing categories in a structured and logical manner. It helps users navigate through different levels of categories smoothly, making it easier to browse products and understand their classification.

description
Type: string|null
Min: 1
Max: 10000

This attribute provides more detailed information about the product category. It's like a brief paragraph that explains what the category is about and what it includes. This attribute is important because it gives context and depth to the category name, offering users a clearer understanding of what's included and potentially the types of customers the category is aimed at. A good description can also help in search optimization, making it easier for customers to find what they're looking for through search engines.

is_deleted
Type: boolean
Default: false

This value indicates whether the product category is deleted or not. This flag can be used to control the product category's availability in runtime without actual deleting or removing the product category from records. A true value means the product category is deleted, while a false value implies that the product category is not deleted and functioning.

products_count
Type: integer

This attribute represents the total number of products that directly fall under a specific product category. This is a numerical value that provides immediate insight into the size and scope of each category.

categories_count
Type: integer

This attribute is a numerical value that represents the total number of direct child categories contained within a specific parent product category. Essentially, it acts as a counter for the subcategories under a given category.

metadata
Type: object|null

The product category metadata model details. Metadata serves as a tool for keeping extra, organized details about a resource. For example, you can use it to store a user's preferences like prefered color, notes or any other data that aids in personalizing services, improving customer relations, or optimizing internal workflows. This information isn't utilized by Payiano – meaning it's not involved in authorizing or declining transactions and remains invisible to your users. Its value is entirely private for your internal use, and we ensure it remains confidential, not shared with any external parties.

info
Type: array_of_objects
Max: 50

This array consists of objects, each containing a key and a value. These pairs of key-value are structured in a way that's more suitable for programmatic access. You can add up to 50 objects.

key
Type: string
Min: 1
Max: 50

It's a unique identifier to avoid confusion or data overlap. The keys serve as identifiers for the corresponding values, making it easier to retrieve specific pieces of information as needed.

value
Type: string
Min: 1
Max: 255

The value is the actual data associated with that key. It could be a simple string, a number, a URL, or any other data format that conveys the necessary information.

list
Type: array_of_strings
Max: 50

The list attribute is particularly useful for scenarios where the data needs to be presented in a straightforward, unstructured format. It's ideal for quick overviews, simple data logging, or when the information does not require the more complex organization that nested JSON objects provide. Please notice that duplicate values are not allowed, you can add up to 50 item and the max list item length is 255 characters.

created_at
Type: datetime

The created datetime of the product category. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

updated_at
Type: datetime

The updated datetime of the product category. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

deleted_at
Type: datetime|null

The deleted datetime of the product category. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

metadata
Type: object|null

The product category metadata model details. Metadata serves as a tool for keeping extra, organized details about a resource. For example, you can use it to store a user's preferences like prefered color, notes or any other data that aids in personalizing services, improving customer relations, or optimizing internal workflows. This information isn't utilized by Payiano – meaning it's not involved in authorizing or declining transactions and remains invisible to your users. Its value is entirely private for your internal use, and we ensure it remains confidential, not shared with any external parties.

info
Type: array_of_objects
Max: 50

This array consists of objects, each containing a key and a value. These pairs of key-value are structured in a way that's more suitable for programmatic access. You can add up to 50 objects.

key
Type: string
Min: 1
Max: 50

It's a unique identifier to avoid confusion or data overlap. The keys serve as identifiers for the corresponding values, making it easier to retrieve specific pieces of information as needed.

value
Type: string
Min: 1
Max: 255

The value is the actual data associated with that key. It could be a simple string, a number, a URL, or any other data format that conveys the necessary information.

list
Type: array_of_strings
Max: 50

The list attribute is particularly useful for scenarios where the data needs to be presented in a straightforward, unstructured format. It's ideal for quick overviews, simple data logging, or when the information does not require the more complex organization that nested JSON objects provide. Please notice that duplicate values are not allowed, you can add up to 50 item and the max list item length is 255 characters.

created_at
Type: datetime

The created datetime of the product category. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

updated_at
Type: datetime

The updated datetime of the product category. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

deleted_at
Type: datetime|null

The deleted datetime of the product category. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

Response sample:
1
{
2 "per_page": 25, 3 "total_pages": 1, 4 "total_items": 1, 5 "current_page": 1, 6
"items": [
7
{
8 "id": "01hqjp622m9rykncnmtsyey5d8", 9 "name": "Sports Shoes", 10 "is_active": true, 11 "reference_id": "7193edd2-7574-3b76-9103-e0e37580129b", 12 "slug": "sports-shoes", 13 "parent_category_id": null, 14 "description": "Featuring top brands and the latest technology for comfort and performance.", 15 "is_deleted": false, 16 "products_count": 0, 17 "categories_count": 0, 18
"parent_category": {
19 "id": "01hqjp6ftspfxgk2ews9y7wfc2", 20 "name": "Footwear", 21 "is_active": true, 22 "reference_id": "f58bc0b0-7d1a-395b-88c5-a17a380b3885", 23 "slug": "footwear", 24 "parent_category_id": null, 25 "description": "A wide range of athletic footwear suitable for various sports activities.", 26 "is_deleted": false, 27 "products_count": 0, 28 "categories_count": 1, 29
"metadata": {
30
"info": [
31
{
32 "key": "Company name", 33 "value": "Pyngy" 34 } 35 ], 36
"list": [
37 "Cairo, Nasr City, 7th District, Building 12 floor 5" 38 ] 39 }, 40 "created_at": "1722572118554", 41 "updated_at": "1722572118554", 42 "deleted_at": null 43 }, 44
"metadata": {
45
"info": [
46
{
47 "key": "Company name", 48 "value": "Pyngy" 49 } 50 ], 51
"list": [
52 "Cairo, Nasr City, 7th District, Building 12 floor 5" 53 ] 54 }, 55 "created_at": "1722572118554", 56 "updated_at": "1722572118554", 57 "deleted_at": null 58 } 59 ] 60}