» Category POST API Documentation

Creating a New Category 

Endpoint:   POST /admin/categories

Purpose

The POST /admin/categories API is used to create a new product category in the system. This endpoint allows administrators to define key category attributes such as name, availability, parent category relationships, product associations, SEO configurations, and metadata. It supports features like scheduled availability, customer-based access restrictions, password protection, and analytics integration. By enabling structured category creation, this API helps businesses organize their product catalogs effectively and enhance customer navigation.

Path Parameters

No path parameters for this endpoint.

Query Parameters 

This endpoint does not have any query parameters.

Use Case

Administrators use POST /admin/categories to add new product categories tailored to specific marketing campaigns, customer groups, or seasonal promotions. This endpoint enables them to define category visibility, restrict access to selected customers, and apply password protection for exclusive sales. Additionally, businesses can configure SEO settings, analytics tracking, and custom metadata to enhance search engine performance and user engagement. By providing structured category management, this API supports efficient inventory organization and product discoverability.

Request Body

Parameter Type Description
name string The name of the category.
availability boolean Indicates whether the category is currently available or active.
available_for string / enum Specifies who the category is available for (e.g., customer, selected).
products array / object List of products associated with the category, including their details.
"category": {
    "name": "CATEGORY_NAME",
    "title": "CATEGORY_TITLE",
    "heading": "CATEGORY_HEADING",
    "parent_category": { "id": "PARENT_CATEGORY_ID" },
    "layout": { "id": "LAYOUT_ID" },
    "product_page": { "id": "PRODUCT_PAGE_ID" },
    "product_layout": { "id": "PRODUCT_LAYOUT_ID" },
    "available": true,
    "available_on_date_range": true,
    "available_from_date": "AVAILABLE_FROM_DATE",
    "available_to_date": "AVAILABLE_TO_DATE",
    "available_for": "AVAILABLE_FOR",
    "available_selected_categories": [
        "CATEGORY_ID_1",
        "CATEGORY_ID_2"
    ],
    "password_protected": true,
    "password": "CATEGORY_PASSWORD",
    "summary": "SUMMARY",
    "description": "DESCRIPTION",
    "products": [
        "PRODUCT_ID_1",
        "PRODUCT_ID_2",
        "PRODUCT_ID_3",
        "PRODUCT_ID_4",
        "PRODUCT_ID_5"
    ],
    "shipping_profile": { "id": "SHIPPING_PROFILE_ID" },
    "tax_profile": { "id": "TAX_PROFILE_ID" },
    "disable_tracking": true
}

Response

The API returns a newly created category object containing essential details such as category name, SKU, availability status, associated products, parent category relationships, SEO metadata, and access control settings. The response ensures administrators can verify the successful creation of a category and make further modifications if needed. Key attributes such as product sorting, tax and shipping profiles, and analytics configurations are also included, allowing for seamless integration into the broader e-commerce ecosystem.

POST
https://{your_site_domain}/api/v4/admin/categories/
Try It Out
{
    "category": {
        "id": "ID",
        "name": "NAME",
        "sku": "SKU",
        "title": "TITLE",
        "heading": "HEADING",
        "url": "URL",
        "available": "AVAILABLE",
        "visible": "VISIBLE",
        "parent_category": {},
        "layout": {
            "id": "LAYOUT_ID",
            "name": "LAYOUT_NAME"
        },
        "product_page": {
            "id": "PRODUCT_PAGE_ID",
            "name": "PRODUCT_PAGE_NAME"
        },
        "product_layout": {
            "id": "PRODUCT_LAYOUT_ID",
            "name": "PRODUCT_LAYOUT_NAME"
        },
        "available_on_date_range": "AVAILABLE_ON_DATE_RANGE",
        "available_from_date": "AVAILABLE_FROM_DATE",
        "available_to_date": "AVAILABLE_TO_DATE",
        "available_for": "AVAILABLE_FOR",
        "selected_categories": [],
        "password_protected": "PASSWORD_PROTECTED",
        "password": "PASSWORD",
        "image_url": "IMAGE_URL",
        "background_image_url": "BACKGROUND_IMAGE_URL",
        "summary": "SUMMARY",
        "description": "DESCRIPTION",
        "products": {},
        "shipping_profile": {
            "id": "SHIPPING_PROFILE_ID",
            "name": "SHIPPING_PROFILE_NAME"
        },
        "tax_profile": {
            "id": "TAX_PROFILE_ID",
            "name": "TAX_PROFILE_NAME"
        },
        "disable_tracking": "DISABLE_TRACKING",
        "seo_configs": [],
        "transaction_no": "TRANSACTION_NO",
        "is_disposable": "IS_DISPOSABLE",
        "is_in_trash": "IS_IN_TRASH",
        "is_parent_in_trash": "IS_PARENT_IN_TRASH",
        "created_by": {
            "id": "CREATED_BY_ID",
            "name": "CREATED_BY_NAME"
        },
        "created_on": "CREATED_ON",
        "updated_on": "UPDATED_ON"
    }
}