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
  • GET Stock List
  • POST Create Stock List
  • PATCH Update Stock List
  • POST Bulk Create Stock Lists
  • Check Status with Cache Key

Was this helpful?

  1. Omnitron
  2. Catalogue

Stock List

Stock List consists of product stocks that store the stock information for their related products. As mentioned at “Introduction”, they are used by catalogs.

However, in some cases, a catalog can also contain extra stock lists to switch between them depending on the condition. To give an example, we can consider an app that sells from retail stores by calculating the nearest retail store to the user. In this case, you have to separate stocks by retail stores for a product and you need to use extra stock lists.

GET Stock List

Sample HTTP request to get all stock lists from the system.

‘content_type’ header represents the response type.

The ‘Authorization’ header is required for authentication. Retrieve api_token by logging in.

Request

Path : /api/v1/stock_list/


import requests
url = "https://{customer_api_url}/api/v1/stock_list/"
api_token = "API TOKEN"
headers = {
'content-type': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}
response = requests.get(url, headers=headers)
print(response.text)

Response

Returns all stock lists.


{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 1,
"name":"default_stock_list",
"code":"default_stock_list",
"is_auto_sync": true,
"modified_date":"2018-01-22T12:12:24.317000Z",
"created_date":"2018-01-22T12:12:24.317000Z"
}]
}

POST Create Stock List

Records new objects in the StockList table. The StockListSerializer 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. retrieve api_token by logging in.

Request

Path: /api/v1/stock_list/

import requests

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

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

data = {
    "name": "Test List"
}

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

Response

The response status code will be 201 because a required field is specified.

{
    "pk":  2,
    "name":  "Test List",
    "code":  null,
    "is_auto_sync": true,
    "modified_date":  "2021-02-19T11:54:13.241159Z",
    "created_date":  "2021-02-19T11:54:13.241139Z"
}

PATCH Update Stock List

Update the object specified with the primary key in the StockList table.

‘content_type’ header represents the response type.

The ‘Authorization’ header is required for authentication. Retrieve api_token by logging in.

Request

Path: /api/v1/stock_list/{PK}/

import requests

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

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

data = {
    "name":  "Test List Updated"
}


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

Response

Response status code will be 200. Updated relevant fields will be returned because the mandatory field is specified.

{
    "pk":  2,
    "name":  "Test List Updated",
    "code":  null,
    "is_auto_sync": true,
    "modified_date":  "2021-02-19T11:54:13.241159Z",
    "created_date":  "2021-02-19T11:54:13.241139Z"
}

POST Bulk Create Stock Lists

Sample HTTP post request to create multiple stock lists at once. Make sure you have an acceptable dataset and file.

Request

Figure 1: Request

Path: /api/v1/stock_list/{PK}/excel_import/

csv:product__sku,product__name,price_list__name,currency_type,tax_rate,retail_price,price2015227,GANT Man Black Sock,Demo Price List,usd,8.00,,10.00

Response

This is an asynchronous operation and the status of the operation can be followed when it sends a GET request at the endpoint where it will check the status with cache_key.

{
    "cache_key":"37c7dad0-1efb-4a44-b10f-a1ac619a25b1"
}

Bad Response

If there is no valid file, this will raise the exception file_100_1(FileNotFoundException). Status codes and exceptions of Django RESTS are returned because another REST is used.

{
    "non_field_errors": "File not found please provide an appropriate file",
    "error_code": "file_100_1"
}

Check Status with Cache Key

Checking the status of the bulk creation process with the received cache key.

Service(omnitron.catalogs.service.StockListService)

create_stock_list: A development has been made to ensure that if is_auto_sync True , located in the code.

bulk_upsert: A development has been made to add multiple ProductStocks.

Channel Redirections

As mentioned above, when the relevant StockList and Channel matching is performed, all ProductStocks linked to the relevant StockList are sent to the Channels.

For instance:

When inspected, the method at `omnitron.channels.integrations.omniweb.integration. Integration.qs__product_stock will show a filter such as _stock_list=catalog channel=self.channelid . All ProductStocks in the select query will be sent by accessing the channel through the catalog linked to the StockList and matching it with the relevant channel.

Data Source

With a similar principle to Channels; Products and Stocks can be used for DataSource. DataSource is the structure that enables selling between Omnitron and creates an environment like a marketplace. It is done by direct match over the DataSource model.

PreviousPrice ListNextCatalogue Item

Last updated 27 days ago

Was this helpful?