Understanding SKU generation in Onport

Francesco de Lorenzi
Francesco de Lorenzi
  • Updated


We oftentimes see SKUs imported into Onport suffixed with extra characters:
e.g. 38956849568489
e.g. ORIGINALSKU-6894556894546

In this article, we'll explain the logic behind SKU generation in Onport in order to troubleshoot this type of issue.


In most cases, there is an existing variant with the same SKU that conflicts with it.
Deleting it first and then deleting the new variant will soon result in Onport reimporting the correct variant.

For further information on how to fix duplicate SKUs, please see this article.

Onport's SKU generation method

Onport implements a strategic method to generate or update SKUs based on several conditions during the import process from channels. Here’s a step-by-step on how the system handles SKUs:

  1. Check for Existing Link: Onport first checks if a variant from the channel (like Shopify) has already been linked to an Onport variant. If so, it simply updates the information.
  2. Verify Unique SKU: For a new imported variant, Onport searches the database to see if the SKU already exists. If the SKU is unique or linked to another product, a new variant needs to be created.
  3. Generate New SKU: The method for generating a new SKU depends on whether there are option values associated with the variant.
    * With Option Values: Onport uses the provided option values to generate a slug that will be appended to the original SKU, creating a unique identifier, for example: AM5FIG-BLUE-XS
    * Without Option Values: If no option values are available, Onport uses the external ID from the channel variant to create a new SKU by appending it to the original SKU, for example: 4568964845698
  4. Verify Uniqueness Again: Onport checks if the newly created SKU is already in use. If it is, an adjustment is made by adding the external channel ID to the new SKU to ensure uniqueness.
  5. Create Variant: If the SKU is confirmed to be unique, Onport proceeds to create a new variant with the new SKU.
  6. Handle Inventory Adjustment: If a variant is successfully created, an inventory adjustment may occur based on the variant’s inventory quantity.

Throughout this process, Onport ensures that each variant's SKU remains unique, which is essential for accurate tracking and management of products.

Below is a flowchart explaining the logic of SKU generation:


Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.