Akinon Release Notes (05/12/2025) are now live! Click here to learn what's new.
LogoLogo
API Reference
  • Home
  • Quick Start
  • Tutorials
  • Technical Guides
  • Release Notes
  • Glossary
  • Welcome to Akinon Technical Guides
  • ACC
    • ACC CLI
    • Create Application via CLI
    • Deploy Environment Variables
    • App Store for Developers
  • Omnitron
    • Product Types
    • Product Categorization
    • Splitting a Merged Order Item
  • Commerce
    • Shipping Rules Calculator
    • Data Source Shipping Options
    • Attribute Based Shipping Options
    • Filtering Products
    • Conversation & Messages
    • Sitemap Configuration
    • Weight-Based Product Sales
    • Group Attribute Sets
    • Contract Management
    • Find in Store for Whippy Ware
    • Plugins
    • Remote Price
    • E-mail Templates
    • Loyalty Accounts
    • Search Structure
    • User Segmentation & Rules
    • Promotions
  • OMS
    • Getting Started with OMS
    • Basic Setup
    • Scenarios
    • Capacity Feature
    • Package Management
      • Packages
      • Transfer
      • States
    • Commands
      • Packages
        • Package Command Parameters
        • DeAllocate Package Reservations Command
        • Channel Based Complete Packaging without Shipment Command
        • Complete Packaging with Shipment Command
        • Complete Packaging without Shipment Command
        • Package Refuse with Denial Reason Command
        • Product Not Found & Wrong Product Command
        • Product Not Found & Wrong Product Command Advanced
        • Package Packed for Refund Command
        • Block The Package For Action Command
        • Unblock the Package For Action Command
        • Update The Package’s Invoice
        • Manual Planning Command
      • Transfer
        • Transfer Order Advanced Command
        • Product for Transfer Not Found & Wrong Product Command
        • Transfer Delivered Command
        • Transfer Dispatch Command
        • Transfer Ready for Dispatch Command
        • Transfer Out Of Stock
      • Shipment
        • Shipment Order Command
        • Package Advanced Shipment Command
        • Ship The Package Command
        • Ship The Package without Shipment Integration Command
        • Update The Package’s Shipment Status Command
        • Update Shipment Info of Package Command
    • Inventory Locations & Engine
      • Properties & Domain Relation
      • Customization
      • Inventory Engine
    • Fulfillment
      • Shipments
      • Invoice Integration
    • Webhooks
      • Webhook Examples
        • Order Webhook
        • Package Webhook
        • Shipment Webhook
        • Stock Location Webhook
        • Transfer Webhook
    • Integrating OMS with Seller Center
  • Instore
    • Getting Started
    • Cash Register Integration
    • OTP (One Time Password) Process
    • Services
      • Password Reset Services
  • Marketplace Dashboard
    • N11 Marketplace Setup Configurations
    • Trendyol Marketplace Setup Configurations
    • Walmart Marketplace Setup Configurations
    • Amazon Marketplace Setup Configurations
    • Hepsiburada Marketplace Setup Configurations
  • Project Zero
    • Django
      • Basic Setup
      • Project Structure
        • Templates & Components
        • Private Dependencies
        • Omnife Project Submodule
        • Webpack
        • ESLint Rules
        • Bundles
        • Multilanguage & Translation
        • Environmental File
        • Custom Error Pages
        • Icon Font
      • Page Types
        • Static Pages & Flatpages
        • Account Page
          • Template Rendering in Account Pages
          • Forms & Validation
        • Basket Page
          • Redux Basket State
          • Basket Page - View
        • Checkout
          • Redux Checkout State
          • View & Template Rendering
          • Masking & Validation
      • Theming & Styling
      • Widgets
      • SEO Management
      • Extending Project Zero
    • Next.js
      • Basic Setup
      • Deployment
      • Static Assets
      • Plugins
      • Widgets
      • Icons
      • Localization
      • SEO Management
      • Advanced Usage
      • Data Fetching
        • Client
          • Account
          • Address
          • Basket
          • Checkout
          • Misc
          • Product
          • User
          • Wishlist
        • Server
          • Category
          • Flat Page
          • List
          • Menu
          • Product
          • SEO
          • Special Page
          • Widget
  • App Maker
    • Setup Your Environment
    • Plugin Quickstart
    • Create Project
    • Setup Existing Project
    • Deploy Project
    • Users and Roles
    • Add Public Key
    • App Maker CLI
    • Create App on Stores
      • Creating App on Apple App Store
      • Creating App on Google Play Store
    • Mobile App Framework
      • Configuration
      • Framework
      • Project Structure
        • Structure
        • Data Containers
        • Pages
      • Dependency Integration
        • Plugins
        • Akinon Plugin Adapter
  • Akifast
    • HPP
      • Getting Started
      • Authorization
      • Payment Session Creation
        • Key Points Before Creating a Payment Session
        • Creating Payment Session
        • Redirecting to the Payment Page
        • Errors Encountered During Payment Session Creation
      • Merchant Services
        • Shipping Query URL
        • Agreement Query URL
        • Other URLs
  • B2B
    • Getting Started
    • B2B Setup
  • Adds-on
    • Invoicer
      • Introduction
      • Invoice & Pay On Delivery Service
  • Channel App Template
    • Introduction
    • Installation and Usage
    • Development Steps
      • Folder Structure
      • Starting Step
      • Encoding the Sales Channel
        • Introduction
        • Setup
        • Products
        • Product Price
        • Product Stock
        • Product Image
        • Orders
        • Product Data
      • Adding a New Command to Akinon
      • Listening for External Requests
    • Architecture
      • Introduction
      • Integration
      • Services (Flows)
        • Introduction
        • Product Service
        • Price Service
        • Stock Service
        • Image Service
        • Order Service
  • Multi Regional Settings
    • Multi Regional Settings
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • 1. Update Channel Conf Schema
  • 2. Create or Update Category Tree & Nodes
  • 3. Create or Update Category Attributes
  • 4. Create or Update Attributes
  • Source Code

Was this helpful?

  1. Channel App Template
  2. Development Steps
  3. Encoding the Sales Channel

Setup

In the setup steps, the codes for the regularly running jobs that operate system-wide are located in the channel_app_template.app.tasks file. There are three jobs that can run regularly related to the setup steps.

1. Update Channel Conf Schema

Creates the necessary settings for the sales channel to be established in the business process. The process starts by reading the settings through the development made in the sales channel integration, and then sends them to Akinon.

The process is managed via the update_channel_conf_schema function within the Setup Service.

You can place your desired settings inside the sales channel as key-value pairs, and develop accordingly.

The class GetChannelConfSchema needs to be modified.

GetChannelConfSchema

Class GetChannelConfSchema(integration, objects=None, batch_request=None, **kwargs)

normalize_response(data, validated_data, transformed_data, response)

Tuple[dict, Any, Any]

The dynamic sales channel configuration settings for the sales channel to be opened are defined here. You can specify the information you want to enter as the sales channel settings in the format below.

To access the main URL, you can use:

>>> self.integration.channel.conf.get("main_url")

Example Code:

schema = {
    "main_url": ChannelConfSchemaField(
        required=True,
        data_type=ChannelConfSchemaDataTypes.text,
        key="main_url",
        label="Api Url"),
    "marchant_id": ChannelConfSchemaField(
        required=True,
        data_type=ChannelConfSchemaDataTypes.text,
        key="marchant_id",
        label="Satıcı Kodu"),
}

2. Create or Update Category Tree & Nodes

Creates the category tree for the sales channel on the Akinon side.

The class GetCategoryTreeAndNodes needs to be modified.

GetCategoryTreeAndNodes

class GetCategoryTreeAndNodes(integration, objects=None, batch_request=None, **kwargs)

The category tree present in the sales channel provides the necessary data for it to be created on the Akinon side as well. The command operates without any parameters.

send_request(transformed_data) → HttpResponse

A request is made to access the category tree.

>>> response  =  self.session.get("url")
>>> return  response

normalize_response(data, validated_data, transformed_data, response)

Tuple[CategoryTreeDto, ErrorReportDto, Any]

Assuming the tree structure in the sales channel is as follows:

sales channel
├── Giyim
│   ├── Kadın
│   │   └── Elbise
│   └── Erkek
│       └── Pantalon

CategoryTreeDto can be created as follow:

node_elbise  =  CategoryNodeDto(name="Elbise",  children=[],  remote_id="Elbise",  parent)
node_pantalon  =  CategoryNodeDto(name="Pantalon",  children=[],  remote_id="Pantalon",  parent)
node_kadin  =  CategoryNodeDto(name="Kadın",  children=[node_elbise],  remote_id="Kadın",  parent)
node_erkek  =  CategoryNodeDto(name="Erkek",  children=[node_pantalon],  remote_id="Erkek",  parent)
node_giyim  =  CategoryNodeDto(name="Giyim",  children=[node_kadin,  node_Erkek],  remote_id="Giyim",  parent)
node_root  =  CategoryNodeDto(name="sales  channel",  children=[node_giyim],  remote_id="sales  channel",  parent)  

report  =  self.create_report(response)
return  node_root,  report,  []

3. Create or Update Category Attributes

The class GetCategoryAttributes needs to be modified.

GetCategoryAttributes

This class is responsible for creating attributes and attribute values for the categories of the sales channel in Omnitron.

classGetCategoryAttributes(integration, objects=None, batch_request=None, **kwargs)

CategoryAttributeDto can be created as follow:

class  CategoryAttributeDto:
    remote_id:  str  # "If available, the remote_id of the attribute; otherwise, the name can be used as the remote_id."
    name:  str  # "The name of the attribute, such as color, size, content, etc."
    required:  bool  # "Indicates whether the attribute is mandatory."
    variant:  bool  # "Indicates whether the attribute is used for variant breakdown."
    allow_custom_value:  bool  # "Indicates whether values other than the predefined values in the sales channel are accepted."

    # "For example, may not accept values other than defined for color."

    # "For size, it may accept values not defined in the sales channel."

    # "Descriptions cannot have defined values, so they always accept custom values."

    values:  List[CategoryAttributeValueDto]

The created attributes require mapping during product submission.

After the mapping is done, the mapped_attributes are added to the product data. For detailed information, refer to Mapping Data in the Product.

CategoryAttributeValueDto can be created as follow:

class  CategoryAttributeValueDto:
    remote_id:  str  # "The code of the attribute in the sales channel."
    name:  str  # "The value of the attribute."

send_request(transformed_data) → HttpResponse

A request is made to access the properties of the category tree.

>>> response  =  self.session.get("url")
>>> return  response

normalize_response(data, validated_data, transformed_data, response)

Tuple[CategoryDto, ErrorReportDto, Any]

4. Create or Update Attributes

This service is responsible for creating attributes and attribute value pairs for the sales channel in Omnitron and can be used in scenarios where there are no attributes associated with categories.

The class GetAttributes needs to be modified.

GetAttributes

classGetAttributes(integration, objects=None, batch_request=None, **kwargs)

This service is responsible for retrieving the attributes and their values from the sales channel and creating the AttributeDto DataClass.

The created attributes require mapping during product submission.

After the mapping is done, the mapped_attributes are added to the product data. For detailed information, refer to Mapping Data in the Product.

AttributeDto can be created as follow:

GetAttributes channel.setup.GetAttributes

class AttributeDto:
    remote_id: str # "If the attribute exists, this is the code in the sales channel; if not, the name can be used as the remote_id."
    name: str # "The name of the attribute, such as color, size, content, etc."

    values: List[AttributeValueDto]

AttributeValueDto can be created as follow:

class AttributeValueDto:
    remote_id: str # "The code of the attribute in the sales channel."
    name: str # "The value of the attribute."     

send_request(transformed_data) → HttpResponse

A request is made to access the attributes of the channel.

>>> response  =  self.session.get("url")
>>> return  response

normalize_response(data, validated_data, transformed_data, response)

Tuple[List[AttributeDto], ErrorReportDto, Any]

Source Code

Source code of the channel.commands.setup item:

from typing import Tuple, Any, List

from channel_app.channel.commands.setup import (
    GetCategoryTreeAndNodes as AppGetCategoryTreeAndNodes,
    GetCategoryAttributes as AppGetCategoryAttributes,
    GetAttributes as AppGetAttributes,
    GetChannelConfSchema as AppGetChannelConfSchema
)
from channel_app.core.data import (
    ErrorReportDto, CategoryTreeDto, CategoryDto, AttributeDto
)

class GetCategoryTreeAndNodes(AppGetCategoryTreeAndNodes):
    def transform_data(self, data) -> Any:
        raise NotImplementedError

    def send_request(self, transformed_data) -> object:
        raise NotImplementedError

    def normalize_response(self, data, validated_data, transformed_data,
                           response) -> Tuple[CategoryTreeDto, ErrorReportDto,
                                              Any]:
        raise NotImplementedError

class GetCategoryAttributes(AppGetCategoryAttributes):

    def get_data(self) -> object:
        raise NotImplementedError

    def validated_data(self, data) -> object:
        raise NotImplementedError

    def transform_data(self, data) -> object:
        raise NotImplementedError

    def send_request(self, transformed_data) -> object:
        raise NotImplementedError

    def normalize_response(self, data, validated_data, transformed_data,
                           response) -> Tuple[CategoryDto, ErrorReportDto,
                                              Any]:
        raise NotImplementedError

class GetAttributes(AppGetAttributes):

    def get_data(self) -> object:
        raise NotImplementedError

    def validated_data(self, data) -> object:
        raise NotImplementedError

    def transform_data(self, data) -> object:
        raise NotImplementedError

    def send_request(self, transformed_data) -> object:
        raise NotImplementedError

    def normalize_response(self, data, validated_data, transformed_data,
                           response) -> Tuple[
        List[AttributeDto], ErrorReportDto, Any]:
        raise NotImplementedError

class GetChannelConfSchema(AppGetChannelConfSchema):

    def normalize_response(self, data, validated_data, transformed_data,
                           response) -> Tuple[dict, Any, Any]:
        raise NotImplementedError
PreviousIntroductionNextProducts

Was this helpful?

In category trees, there is a nested structure. The object to be returned is CategoryTreeDto.

This service will generate the attributes and their values used in the category tree of the sales channel. The DataClass used for creating attributes is CategoryAttributeDto.

DataClass
DataClass