LogoLogo
  • Welcome to Akinon Documentation
  • Products
    • ACC
    • Omnitron
    • Commerce
    • Order Management System (OMS)
    • Instore
    • Integrator
    • Marketplace Dashboard (MPD)
    • Project Zero (PZ)
    • Seller Center
    • Akifast
    • App Maker
  • API Reference
    • Welcome to Akinon API Reference
  • Omnitron
    • Getting Started
    • Integration
      • Product
        • Product
        • Pre-Product
        • Attribute
        • Attribute Value
        • Attribute Set
        • Product Image
      • Price
        • Price List
        • Product Price
        • Currency Unit Table
      • Stock
        • Stock List
        • Product Stock
      • Order
        • Get Orders
        • Search Order
        • Get Order Detail by Order Number
        • Get Order Item Detail
        • Orders ID Detail Integration
        • Orders Waiting to Send to ERP
        • Update Order and Order Item
        • Stock Reservation Release
        • Order Cancellation
        • Cancellation & Refund Pending Orders
        • Order Discount Items
        • Order Status Codes & Cancellation Statuses
      • Migration
        • Getting Started
        • User Migration
        • Address Migration
        • Old Order Migration
        • Old Order Item Migration
        • View Migration Progress
        • Currency Options
    • PIM
      • Attributes & Sets
      • Mapping
      • Localization
      • Media
    • Catalogue
      • Introduction
      • Price List
      • Stock List
      • Catalogue Item
      • Category Trees
      • Product Collection
      • Product Sorting
    • Channels
      • Introduction
      • Payments
      • Customers
    • Order
      • Getting Started
      • Fulfillment
      • Cancellations & Refunds
    • Retail Stores
      • Retail Stores
    • User Management
      • Roles & Permissions
      • Add & Remove
    • Whippy Ware
      • Introduction
      • Stock
      • Stock Lists
      • Stock List Rules
      • Stock Providers
      • Stock Locations
  • Omnitron OpenAPIs
    • Without Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Content Types
      • Mappings
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • SalesChannelRetailStore
      • IntegrationActions
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelCategoryNodes
      • SalesChannelDistricts
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelOrders
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProduct
      • SalesChannelAttributeSchemas
      • SalesChannelProductCategories
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelCountries
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
    • With Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Mappings
      • Content Types
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • IntegrationActions
      • SalesChannelRetailStore
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelDistricts
      • SalesChannelCategoryNodes
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelCountries
      • SalesChannelOrders
      • SalesChannelProduct
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProductCategories
      • SalesChannelAttributeSchemas
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
  • Commerce
    • Users
      • Getting Started
      • User Management & Authentication
      • Password & OTP Operations
      • User Profile & Segment Management
      • User Payment & Card Management
      • User Orders & Cancellations
      • Anonymous User Orders & Cancellations
      • User Support & Conversation
      • Captcha Validation
      • Currency & Akifast Operations
    • Checkout
      • Payment Related
      • Payment Strategy Related
      • Shipping Related
      • Independent Pages
    • Product
    • User Collections
    • Basket
    • Discount
    • Autocomplete
    • Breadcrumb
    • Pretty URLs
    • Menu
    • Widgets
    • Loyalty Accounts
    • Address Migration
    • Index Configuration
    • Favourite Products
    • User Address
    • Data Warehouse
    • Introduction
      • Filtering Parameters
    • Data Warehouse
    • Default
  • OMS
    • Package Services
    • Package Item Services
    • Package Denial Reason Services
    • Order Services
    • Order Item Services
    • Transfer Order Services
    • Transfer Item Services
    • Channel Services
    • Cancellation Plan Services
    • Cancellation Reason Services
    • Address Setup Services
    • City Services
    • District Services
    • Township Services
    • Stock Location Address Services
    • Webhook Setup Services
    • Webhook Event Services
    • Omnitron Order Webhooks
    • Undelivered Webhook Event Services
    • Inventory Discrepancy Services
    • OMS Setup Services
    • UI Settings Services
    • OMS Audit Events Service
    • Customer Address Services
    • Application Settings Services
    • Content Type Services
    • Customer Services
    • Channel Setup Services
    • Demo Data Service
    • Order Execution Plan Services
    • Invoice Services
    • Localization Services
    • Action Log Services
    • Order Log Services
    • Celery Metrics Service
    • Stock Location Services
    • Stock Location Address Services
    • Stock Location Sender Address Services
    • Stock Location Sender Address Setup Services
    • Cargo Company Condition Services
    • Permission Group Services
  • OMS OpenAPIs
    • Package Services
      • Default
    • Transfer Order Services
      • Default
  • Instore
    • Password Reset Services
  • Integrator
    • Projects
    • Flows
    • Logs
  • Seller Center
    • Languages
    • Categories
    • Introduction
    • Products
    • Packages
    • Orders
    • Claims
    • Shipping Methods
  • Akifast
    • Authentication
  • B2B
    • Quotation
    • Basket
    • Division
    • User
    • Staff User
    • Groups
    • Notification
    • Notification Template
  • Flows
    • Shipment Flows
    • Payment Flows
    • SMS Flows
    • Basket Offer Flows
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • Campaigns
  • Large Image
  • Small Image
  • Explanation
  • Category Tree API Methods
  • GET All Category Trees
  • POST Create Category Tree
  • PATCH - PUT Update Category Tree
  • DELETE Category Tree
  • GET Category Tree
  • GET Category Tree Detail

Was this helpful?

  1. Omnitron
  2. Catalogue

Category Trees

Category Tree is the structure where categories/subcategories are created for the products to go on sale. Category tree in Omnitron is formed by the combination of two different structures: CategoryTree and CategoryNode.

Campaigns

On the Catalogs page Products and Catalogs > Catalogs, the detail page is entered through a catalog.

The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens the Category Edit form. Clicking on the Campaigns tab, and then the Add Campaign button, allows adding campaigns. After filling in the required information, the Save button at the bottom is clicked on. Campaigns added here are reflected on the page of the relevant sales category.

Large Image

On the Catalogs page Products and Catalogs > Catalogs, the detail page is entered through a catalog.

The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens the Category Edit form. The Large Image tab is clicked on for the addition of large images. After filling in the required information, the Save button at the bottom is clicked on. The Large Image added here is reflected on the page of the relevant sales category.

Small Image

On the Catalogs page (Products and Catalogs > Catalogs), the detail page is entered through a catalog.

The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens the Category Edit Form. The Small Image tab is clicked on for the addition of small images. After filling in the required information, the Save button at the bottom is clicked on. The Small Image added here is reflected on the page of the relevant sales category.

Explanation

On the Catalogs page Products and Catalogs > Catalogs, the detail page is entered through a catalog.

The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens up the Category Edit Form. The details about the relevant category are entered in the description field and the Save button at the bottom is clicked on. The description added here is reflected on the page of the relevant sales category.

Category Tree API Methods

GET All Category Trees

Sample HTTP request to get all category trees lists from the system.

‘content_type’ header represents the response type.

The ‘Authorization’ header is required for authentication. You can retrieve api_token by logging in.

Request

Path: /api/v1/category_tree/

import requests

url = "https://{customer_api_url}/api/v1/category_tree/"
api_token = "API TOKEN"

headers = {
   'content-type': 'application/json',
   'Authorization': 'Token {}'.format(api_token)
}

response = requests.get(url, headers=headers)
print(response.text)

Filters

All fields except the existing “category_root” can be used in the CategoryTree model.

Response

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 1,
"name": "test catalog",
"category_root": {
"pk": 246,
"name": "test catalog",
"order": 1,
"numchild": 0,
"depth": 1
"attributes": {},
"attributes_kwargs": {},
"sort_option": null,
"uuid": "2798d37e-7a04-487f-a693-fa0c4b174656",
"path": "0001",
"created_date": "2021-10-06T13:48:07.643569Z",
"modified_date": "2021-11-01T13:54:52.526750Z"
}
}
]
}

POST Create Category Tree

Records new objects in the CategoryTree table. The CategoryTreeSerializer class defined at omnitron.catalogs.resources.serializers is used to validate the data.

‘content_type’ header represents the response type.

The ‘Authorization’ header is required for authentication. You can retrieve api_token by logging in.

Request

Path: /api/v1/category_tree/

import requests

url = "https://{customer_api_url}/api/v1/category_tree/"
api_token = "API TOKEN"

headers = {
    'content-type': 'application/json',
    'Authorization': 'Token {}'.format(api_token)
}

data = {
    "name" : "new_tree"
}

response = requests.post(url, headers=headers, data=data)
print(response.text)

If there is another category tree with the same name, a 400 response status code is returned.

Response

Information of the created CategoryTree object is returned. The features are described above. The status code will be 201.

{
    "pk": 2,
    "name": "new_tree",
    "category_root": {
        "pk": 247,
        "name": "new_tree",
        "order": 1,
        "numchild": 0,
        "depth": 1,
        "attributes": {},
        "attributes_kwargs": {},
        "sort_option": null,
        "uuid": "06e18786-74c6-4c3c-a8dc-60e7a5dd494a",
        "path": "0002",
        "created_date": "2022-12-21T07:50:08.386058Z",
        "modified_date": "2022-12-21T07:50:08.386095Z"
    }
}

Incorrect Response Example

CategoryTree model has a name field and its property is unique=True, which means the category name field must be unique. Otherwise it will display an error as shown below.

{
    "name": [
        "category tree with this name already exists."
    ]
}

PATCH - PUT Update Category Tree

If not found, it returns a 404 response status code.

If a record with an existing “name” is being attempted, this returns a 400 response status code.

Path: /api/v1/category_tree/{pk}/

{
 "name" : "new_tree__"
}

Response


{
   "pk": 6,
   "name": "new_tree__",
   "category_root": {
       "pk": 247,
       "name": "new_tree",
       "order": 1,
       "numchild": 0,
       "depth": 1,
       "attributes": {},
       "attributes_kwargs": {},
       "sort_option": null,
       "uuid": "06e18786-74c6-4c3c-a8dc-60e7a5dd494a",
       "path": "0003",
       "created_date": "2022-12-21T07:50:08.386058Z",
       "modified_date": "2022-12-21T07:50:08.386095Z"
    }

}

Incorrect Response Example

If an existing tree name is inserted during the update, it will again throw a unique error for the name field.

{
    "name": [
         "category tree with this name already exists."
    ]
}

DELETE Category Tree

If the category tree is not found, it returns a 404 response status code.

If the category tree with provided ID is linked to a catalog or if there are products linked to the category tree, a 400 response status code will be returned.

Path: /api/v1/category_tree/{pk}/

Response

Status: 204

Incorrect Response Example

If the shop is still used by some catalog(s), the status code (406) is returned. This means Not Acceptable for deletion.

{
    "non_field_errors": "Shop is still being used by some catalog(s).",
    "error_code": "category_600_6"
}

GET Category Tree

Tree returns the relevant category tree with its sub branches. If the category tree with provided ID is not available, it returns a 404 response status code.

Path: /api/v1/category_tree/{pk}/tree/

Response

[
    {
        "pk": 1,
        "name": "new_tree",
        "order": 1,
        "numchild": 8,
        "depth": 1,
        "attributes": {},
        "attributes_kwargs": {},
        "sort_option": 1,
         "uuid": "cf108732-fa7c-4f0f-9bea-fb59691a9d7c",
         "path": "0001"
    },
    {
        "pk": 4,
        "name": "Test Child",
        "order": 1,
        "numchild": 12,
        "depth": 2,
        "attributes": {
            "campaigns":  [],
            "big_image": {
                 "url": "test-child",
                 "image": "cms/2021/02/08/
                 e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",
                 "title": "Test Child"
            },
            "small_image": {
                "url": "test-child",
                "image":
                "cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
                "title": "Household Linen"
            },
            "description": ""
            },
            "attributes_kwargs": {
                 "campaigns": [],
                     "big_image": {
                        "value": {
                            "image":{
                                "url": "/media/cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",
                                "value": "cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",
                        "data_type":"image"
    }

    },
    "data_type": "nested"
},
"small_image": {
     "value": {
          "image": {
              "url": "/media/cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
              "value": "cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
            "data_type": "image"                   
            }

        },
}]

GET Category Tree Detail

Retrieves detailed information about category_tree. Shows details of sort option information and sorting algorithm information, as well as the associated child information in a list.

Returns the relevant category tree with its sub branches in a more detailed manner. If the category tree is not found, it returns a 404 response status code.

Request


import requests

url = "https://{customer_api_url}/api/v1/category_tree/{PK}/tree_detailed/"
api_token = "API TOKEN"

headers = {
    'content-type': 'application/json',
    'Authorization': 'Token {}'.format(api_token)
}

response = requests.get(url, headers=headers)
print(response.text)

Path: /api/v1/category_tree/{pk}/tree_detailed/

Response


[
    {
        "pk": 1,
        "name": "Shop",
        "order": 1,
        "numchild": 8,
        "depth": 1,
         "attributes": {},
          "attributes_kwargs": {},
          "sort_option": {},
           "uuid": "cf108732-fa7c-4f0f-9bea-fb59691a9d7c",
           "path": "0001",
            "children": [
                {
                    "pk": 43,
                    "name": "Test Child",
                    "order": 1,
                    "numchild": 12,
                    "depth": 2,
                    "attributes": {
                    "campaigns": [],
                    "big_image": {
                        "url": "test-child",
                         "image": "cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",
                         "title": "Test Child"
                    },
                    "small_image": {
                         "url": "test-child",
                         "image": "cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
                         "title": "Test Child"
                    },
                    "description": ""
                },
                "attributes_kwargs": {
                     "campaigns": [],
                     "big_image": {
                         "value": {
                             "image": {
                                 "url":
                                    "/media/cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",
                                "value": "cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",

                        "data_type": "image"}
                    },
                    "data_type": "nested"
                },
                "small_image": {
                    "value":{
                        "image": {
                            "url": "/media/cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
                            "value": "cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",

                        "data_type": "image"

                }
                "data_type": "nested"
                }
            },
            "sort_option": 12,
             "uuid": "9ea60027-c3a0-4cc3-9acc-6ecc462b1589",
              "path": "00010001"
            }
        ]
    },
    {

        "pk": 43,
        "name": "Test Child",
         "order": 1,
         "numchild": 12,
         "depth": 2,
          "attributes": {
               "campaigns": [],
               "big_image": {
                   "url": "test-child",
                   "image": "cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",
                    "title": "Test Child"
                },
                "small_image": {
                      "url":"test-child",
                      "image": "cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
                       "title": "Test Child"
                },
                "description": ""
        },
        "attributes_kwargs": {
             "campaigns": [],
             "big_image": {
                      "value": {
                          "image": {
                              "url": "/media/cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",
                               "value": "cms/2021/02/08/e1f3fb64-98f2-4f8e-ad0a-4178a775c087.jpg",

                  "data_type":"image"}
            },
            "data_type": "nested"
            },
             "small_image": {
                  "value": {
                       "image": {
                           "url": "/media/cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
                           "value": "cms/2021/02/08/7bcbcec5-b468-475b-b45e-e9f567151a94.jpg",
                           "data_type": "image"}
                        },
                         "data_type":"nested"}
                },
                    "sort_option": {},
                     "uuid": "9ea60027-c3a0-4cc3-9acc-6ecc462b1589",
                    "path": "00010001",
                    "children": []
        }
]
PreviousCatalogue ItemNextProduct Collection

Last updated 27 days ago

Was this helpful?