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 Tutorials
  • ACC
    • How to Manage Projects and Services?
    • How to Use Demo Projects with ARC?
    • How to Move Apps into ACC?
    • How To Configure Database Connection in ACC?
    • How to Configure Your ACC Application with akinon.json and Procfile?
    • How to Create, Manage, Build, and Deploy Applications in ACC?
    • How to Install Applications from the App Store in ACC?
    • How to Add and Manage Domains in ACC?
    • How to Generate and Add Public Keys in ACC?
    • How to Monitor Application Resources in ACC?
    • How to Manage Users and Roles in ACC?
    • How to Integrate a BI Tool with Your Project in ACC?
  • Omnitron
    • Products & Catalogs
      • How to Add and Bulk Update Products in Omnitron?
      • How to Create Product Attributes and Attribute Sets in Omnitron?
      • How to Manage Catalogs in Omnitron?
      • How to Create and Update Price Lists in Omnitron?
      • How to Create and Update Stock Lists in Omnitron?
      • How to Create and Manage Collections in Omnitron?
    • Orders
      • How to Manage Orders in Omnitron?
      • How to Manage Cancellation and Return Requests in Omnitron?
    • Sales Channels
      • How to Manage Products in Omnitron?
      • How to Manage Registered Users Based on Sales Channel?
      • How to Create and Update Customer Groups in Omnitron?
      • Marketing
        • How to Create and Manage Campaigns in Omnitron
        • How to Create and Manage Coupons in Omnitron?
        • How to Create and Manage Bulk Coupons in Omnitron?
        • How to Create and Manage Discount Codes in Omnitron?
        • How to Configure SEO Settings in Omnitron?
        • How to Configure URL Redirects and Settings in Omnitron?​
        • How to Manage Promotions in Omnitron?
      • Content Management
        • How to Manage Widgets in Omnitron?
        • How to Manage Widget Schema in Omnitron?
        • How to Manage Flat Pages in Omnitron?
        • How to Manage Custom/Campaign Pages in Omnitron?
        • How to Manage Navigations/Menus in Omnitron?
        • How to Manage Mailing Templates in Omnitron?
      • Store Management
        • How to Manage Stores in Omnitron?
        • How to Manage Instore Store Employees in Omnitron?
        • How to Manage Instore Store from Omnitron?
        • How to Manage Store Delivery Points in Omnitron?
        • How to Manage Slots and Retail Store Groups?
      • Payment Management
        • How to Manage POS Integrations in Omnitron?
        • How to Manage Banks in Omnitron?
        • How to Manage Card Types in Omnitron?
        • How to Manage Card Settings in Omnitron?
        • How to Manage Checkout Providers in Omnitron?
        • How to Manage Payment Options in Omnitron?
      • Category Management
        • How to Automatically Assign Category Mapping Rules in Omnitron?
      • Sales Channel Settings
        • How to Configure Marketplace Attribute Mapping in Omnitron?
        • How to Manage Marketplace Mapping in Omnitron?
        • How to Manage Marketplace Operations?
        • How to Manage Address Mapping in Omnitron?
        • How to Manage Social Accounts in Omnitron?
        • How to Manage Loyalty Integration Settings?
        • How to Manage Store Stock Settings?
        • How to Manage Product List Filter Settings?
        • How to Manage Instore Settings in Omnitron?
        • How to Manage General Sorting Settings?
        • How to Manage Shipping Options in Omnitron?
        • How to Manage Delivery Options in Omnitron?
        • How to Manage Easy Return Shipping Options in Omnitron?
    • Integration
      • How to Manage Pending Products in Omnitron?
      • How to Manage City/District Mapping Error Logs in Omnitron?
    • Reports
      • How to Create and Download Reports in Omnitron?
    • Settings
      • How to Add and Configure a New Sales Channel in Omnitron?
      • How to Add and Configure a Shipping Company in Omnitron?
      • How to Create and Manage Sorting Algorithms in Omnitron?
      • How to Create and Manage Users in Omnitron?
      • How to Manage Reasons for Cancellation and Return in Omnitron?
      • How to Manage Authority Groups in Omnitron?
      • How to Manage Advanced Permission Policies and Items?
      • How to Log in to Omnitron Using OAuth2 (SSO)?
  • OMS
    • How to Set Up and Manage Locations in OMS?
    • How to Set Up Basic Configurations in OMS?
    • How to Manage Application Settings in OMS?
    • How to Add and Edit Stock Locations in OMS?
    • How to Create or Edit Distribution Scenarios in OMS?
    • How to Create or Edit Transfer Scenarios in OMS ?
    • How to Perform a Product Search in OMS?
    • How to Add or Edit a Product Stock Integration Engine in OMS?
    • How to Add or Edit Shipping Details in OMS?
    • How to Add or Edit a Webhook in OMS?
    • How to Add or Edit a State Transition in OMS?
    • How to Add or Edit a Packaging Refusal Reason in OMS?
    • How to Pull Orders from Omnitron to OMS?
    • How to Add or Edit Translatable Models in OMS?
    • How to Manage Scheduled Operations in OMS?
    • Working Logic of Scenarios
  • Instore
    • How to Install the Instore Service on an ACC Project?
    • How to Create Customer Account?
    • How to Manage Store & Staff?
    • How to Manage Instore Settings?
    • How to Create Instore Settings Via Omnitron Panel?
    • How to Customize Instore Widgets?
    • How to Configure Payment Methods in Instore?
    • Instore User Manual
      • Selling Through Instore
      • Order Refund/Cancellation Processes
      • Click & Collect Order Management (For Brands without an OMS)
      • Package Orders
      • Transfer Orders
      • Customer Profile
      • Settings
  • Integrator
    • How to Update S3 Bucket?
    • How to Manage Users in Integrator?
    • How to Create and Manage Integration Flow?
    • How to Monitor Integration Logs in Integrator?
    • How to Use the Flow Testing Screen in Integrator?
    • How to Use Alarm Services in Integrator?
    • How to Monitor Flow Performance in Integrator?
    • How to Create a Version Service in Integrator?
    • Flows
      • Login Flow
      • Product Flow
      • Stock Flow
      • Full Stock Flow
      • Price Flow
      • Full Price Flow
      • Order Flow
      • Order Status Flow
      • Order Cancel Flow
      • OMS Stock Flow
      • Whippy Stock Flow
      • Generic Proxy Flow
      • Image S3 Flow
      • Video S3 Flow
      • JOLT Mapping
      • Scripting in Flows
  • Project Zero
    • How to Configure Mini Basket?
    • How to Optimize Menu Performance?
    • How to Implement the Quickly Add to Cart Feature?
    • How to Implement Product Image Slider?
    • How to Create and Integrate a Custom Payment Option View in Checkout?
  • Marketplace Dashboard
    • How to Monitor Integration Logs in the Marketplace Dashboard?
    • How to Monitor Integration Reports in Marketplace Dashboard?
    • How to Create Alarms and Notifications in Marketplace Dashboard?
  • Akifast
    • Akifast Admin Dashboard
    • Akifast Merchant Dashboard
  • Seller Center
    • Seller
      • Settings
        • How to Manage Users in Seller Center?
        • How to Generate and Revoke Access Tokens in Seller Center?
        • How to Manage Delivery Settings in Seller Center?
      • Products
        • How to Use Offer Actions in Seller Center?
        • How to Add Single Product in Seller Center?
        • How to Add Product Offers Using Bulk Actions in Seller Center?
        • How to Manage Offers via Marketplace Catalog?
        • How to Create Revison Requests?
        • How to Use Bulk Actions in Seller Center?
        • Inventory Management
          • How to Manage Stock List in Seller Center?
          • How to Manage Price List in Seller Center?
      • Orders
        • How to Manage Orders in Seller Center?
        • How to Manage Packages in Seller Center?
        • How to Manage Cancellation & Returns in Seller Center?
      • Finance
        • Account Management
        • How to Manage Reconciliations in Seller Center?
      • Store Management
      • Messages
      • Support
    • Marketplace Owner
      • Settings
        • How to Manage Users in Seller Center?
        • How to Manage Delivery Settings in Seller Center?
        • How to Manage Offer Reject Reasons in Seller Center?
        • How to Manage Attribute Set & Category Mapping?
      • Products
        • How to Manage Offers via Marketplace Catalog?
        • How to Use Offer Actions in Seller Center?
      • Orders
        • How to Manage Orders in Seller Center?
        • How to Manage Packages in Seller Center?
        • How to Cancel or Return an Order in Seller Center?
      • Finance
        • How to Manage Reconciliations?
        • Seller Management
      • Support
      • Messages
  • Whippy Ware
    • Whippy Ware
  • Dynamic Price
    • Dynamic Price
  • How to Use Offer Reject Reasons?
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • Order Flow Type​
  • Flow Steps​
  • Detailed Flow Designer Settings​

Was this helpful?

  1. Integrator
  2. Flows

Order Flow

PreviousFull Price FlowNextOrder Status Flow

Last updated 16 days ago

Was this helpful?

The Order Flow facilitates the transfer of order data from Omnitron to ERP systems. The flow retrieves a list of orders that have not yet been sent to the ERP and processes them accordingly. The flow operates only in an inbound mode.

Inbound order flow means that the flow triggers itself at specific intervals set by the user, such as once every minute, every 1 hour, every day at midnight, every 5th day of a month, etc., to fetch unsent orders from Omnitron and send them to the ERP system. If the transfer to the ERP is successful, the order is marked as "is sent" in Omnitron, ensuring clear tracking and synchronization of orders between the systems.

This process ensures reliable and efficient communication between Omnitron and ERP, maintaining accurate and up-to-date order information across the system.

Order Flow Type​

  • Inbound Flow: Indicates that the flow will read data from the Omnitron. A cron schedule is set up to ensure it runs, for example, every 5 minutes.

Flow Steps​

  • Login Step: Handles logging into Omnitron and (if configured) the ERP system. If an error occurs during this step, the details are logged.

  • Read Data From Omnitron Step: Order queries are made to the Omnitron system to find orders where Omnitron “is_send” value is false and not canceled matching the channel filter.

  • Query Check Order Step: For each order, an ERP query is made using order number to see if the order is already written to the ERP, if the execution skips to Check Response Script Step.

  • Script Step (Optional): Transformation operations on each order object is performed using Python, if required.

  • Mapping Step (Optional): Transformation operations on each order object is performed using the Jolt Transform library. Further details can be found at the website.

  • Write Data to ERP Step: The transformed order information is sent to ERP.

  • Check Response Script Step: The Write Data to ERP Step input data and ERP response for each order is given to python script one by one to check if ERP requests are successful and prepare mapping data for Write Data to Omnitron step.

  • Write Data to Omnitron Step: For each order, order is marked as “is send”, order and order item mappings are done based on Check Response Script output.

  • Post Script Step: Runs after Write Data to Omnitron Step if Check Response Script step is successful or after Write Data To ERP step if it fails and Post Script is configured to run on failure.

Detailed Flow Designer Settings​

Configuration Card​

  • Omnitron API Settings

Read Data From Omnitron​

This card requires only the Omnitron Channel parameter to be specified for filtering orders based on designated sales channels.

Omnitron Channel: The Omnitron Channel parameter is used to filter orders based on specific Omnitron channels. This input requires a comma-separated list of channel IDs. Channel IDs can be found in Omnitron by navigating to Settings > Sales Channels. The channel ID is visible in the URL for each channel on the Sales Channels page.

The Omnitron query flow retrieves order data based on the specified channel filter. This process is for informational purposes, as the actual order flow is managed by the system itself. The query operates using the following path:

/api/v1/orders_integration/?is_send=false&id__gt=<used_as_pagination>&sort=id&limit=25&status=400&status=450&status=500&status=510&status=540&status=550&modified_date__gt=<last 3 weeks>&channel__in=<channel_filter>

Steps in the Flow​

  1. Query Orders: Orders are retrieved from Omnitron that are neither canceled nor already sent to the ERP.

  2. Retrieve Order Details: For each order returned by the query, the following steps are performed:

    • An order detail request is made using: /api/v1/orders_integration/&lt;order_pk>/detailed_integration

    • Order items are queried using: /api/v1/order_items/?order_id=&lt;order_pk>&limit=99999

    • For each order item, detailed data is retrieved via: /api/v1/order_items/&lt;order_item_pk>/detailed_integration

    • Discount items are queried similarly via: /api/v1/discount_items/?order_id=&lt;order_pk>&limit=99999

    • For each discount item, detailed data is retrieved via: /api/v1/discount_items/&lt;discount_item_pk>/detailed_integration

  3. Build Detailed Order Data: Both the order items and discount items are appended to the detailed order data structure.

Query Check Order​

Each order is queried on the ERP system to see if it is already sent. If the order is already sent, execution skips to the “Check Response Script” step for the related order with order data from Omnitron and ERP response.

  • Custom Response Path: This is used to point where order information (if exists) should be when a query response is successful, if the path result is not empty or equal to Custom Response Path Value the query result will be considered to be found.

  • Custom Response Path Value: Used with Custom Response Path, if the path result is equal to the input value, the query is considered to be not found and the execution will continue to next steps as usual.

  • Failure Status Codes: A list of comma separated HTTP status codes. If an ERP query gets a response with status codes written in this input execution will end with a failure without continuing. This input is useful to find if an ERP can not respond correctly at the moment and it is impossible to know if order already exists or not in the system.

  • Order Not Found Codes: A list of comma separated HTTP status codes. If an ERP query gets a response with status codes written in this input, flow will continue to the next steps normally. This is useful if an ERP system responds with success codes with a body like 201 even if the order does not exist in the system.

Script Card (Optional)​

This is a base script that can be updated to enable script functionality within the process step.

Scripts can read incoming data from the inputStream, where the variable input_text contains a JSON string. This string should be parsed using Python's json library. Any outgoing data is written using the outputStream.write() method after converting the relevant Python object back into a JSON string.

Additionally, the script allows for the use of attributes, which provide supplementary information tied to the current execution process. These attributes can be freely accessed or modified throughout the script. For example, the get_attribute() function is used to read attribute values, while the session.putAttribute() method is used to write new string attribute values. Each attribute consists of a key-value pair, where the key uniquely identifies the attribute, and the value can be referenced in subsequent steps. On Order flows, order_exists attribute can be set as “true” (string true) to set order as already exists in the script step, this is useful if order can not be queried using the Query Check Order step.

Attributes with keys starting with the prefix log.will be automatically logged at the end of the execution if a log file is generated, ensuring that important information is captured and available for later review.

Example Script:

import json
import traceback
from java.nio.charset import StandardCharsets
from org.apache.commons.io import IOUtils
from org.apache.nifi.processor.io import StreamCallback

def get_attribute(flow_file, attr_name):
   all_var = flow_file.getAttribute("allVar")
   if all_var:
       all_attributes = json.loads(all_var)
       return all_attributes.get(attr_name, None)
   return flow_file.getAttribute(attr_name)

class TransformCallback(StreamCallback):
   def __init__(self, flowFile):
       self.flowFile = flowFile
       self.omnitronToken = get_attribute(flowFile, "token.omnitron")
       self.erpToken = get_attribute(flowFile, "token.erp")

   def process(self, inputStream, outputStream):
       input_text = IOUtils.toString(inputStream, StandardCharsets.UTF_8)
       input_obj = json.loads(input_text)

       # Transform content
       output_obj = self.transform(input_obj)

       # Write output content
       outputStream.write(bytearray(json.dumps(output_obj, indent=4).encode('utf-8')))
      
   def transform(self, output_obj):
       # Transform content
       return output_obj

flowFile = session.get()
if flowFile != None:
   try:
       flowFile = session.write(flowFile, TransformCallback(flowFile))
       # Finish by transferring the FlowFile to an output relationship
       session.transfer(flowFile, REL_SUCCESS)
   except:
       var = traceback.format_exc()
       session.putAttribute(flowFile, 'log.script.error', str(var))
       session.transfer(flowFile, REL_FAILURE)
   session.commit()

Script Testing: The ERP response is placed in the input field, and the script's result along with the written attributes can be viewed in the result field. When the test script is run, attributes like log.script.error will appear under the "attributes" section in the result panel and should be referenced if any exceptions occur during execution. The script's output content will be found under the result_data value.

The + Add Attributes button can be used to simulate incoming, readable, attributes for the script. This feature is useful when an attribute value is read and used in the script. Note that attributes added through the button are only for testing purposes and will not be saved in the flow information—they will be removed when the page is refreshed.

Example Input: Example input can be constructed using the endpoints written in Read Data From Omnitron or a data similar to that can be retrieved from Omnitron using /api/v1/orders_integration/detailed/?limit=1&number=&lt;order_number> endpoint. The input of the script step will be an order object of the retrieved order array, script step is expected to run with only one order each time.

Mapping Card (Optional)​

Mapping Testing:

The response from the script or the response of the Omnitron request for order data, if the script step is not used, is placed in the input field and the result of the mapping is viewed in the result field.

Write Data to ERP​

The finalized data from Script and/or Mapping steps is sent to ERP using configuration entered in this step. A successful request must respond with 2xx HTTP status codes.

  • ERP Order Create API URL: ERP URL for writing the orders to.

  • ERP Order Create API Method: The HTTP method used while creating the order on ERP.

Check Response Script​

The response from the Write Data to ERP Step is merged with the request body and passed to the Check Response Script Step. This step is very similar to the Script Card (Optional) which can be used to learn about the details of scripting in Integrator.

Check Response Script comes with a default script where the mapping values are gathered from request data assuming request data has a similar structure to Omnitron data. In the case that request data changed from Omnitron data and can not be used the same way, request and response data should be used to fill out the following structure same way the default script does:

{
  "is_send" : "1",
  "data" : {
    "response_data" : "request data here",
    "request_data" : "responnse data here"
  },
  "order_mapping_value" : "<order number according to erp>",
  "external_status" : null,
  "orderitems" : [ {
    "update_stock" : true,
    "external_status" : null,
    "order_item_id" : "<omnitron order item id>",
    "extra_field" : { },
    "item_mapping_code" : "< order item code according to erp>"
  } ],
  "extra_field" : { }
}

Post Script (Optional)​

This script runs with the “request_data” and “response_data” from the ERP write request after the "Write Data to Omnitron" step, if the "Write Data to ERP" step is successful. If the step fails and “Run On Failed Order” is set to true, the script will run directly after the "Write Data to ERP" step.

This script is optional, and its output is not used. It can be used for additional actions after the order is updated in Omnitron, such as updating CRM services or performing other tasks.

Domain URL: Omnitron's domain URL, Example: .

Query URL: The ERP URL to query order from, order number is provided to this input using ${_order.number} variable, Integrator will not modify the URL before query a valid query should be provided in the input for querying the order using order number. Ex:

Details can be found at the website. The flow expects the following output to be an order request object for each order, as the input will also be the data of one order. Entegrator uses the output of this mapping step as the body of the ERP request, therefore there is no expected data structure; the output structure of the mapping step is fully dependent on ERP requirements.

Jolt Transform
https://demo.omnitron.akinon.net/
https://example.com/order/query?number=${_order.number}
Jolt Transform