Unable to Create Product using a previous SKU - Product SKU already exists

Hi Community,

Good day!

We have encountered an issue where we are unable to create a product using an SKU that is previously associated with another product (SKU is updated via dashboard) and even if the SKU does not exist yet on the product list.

Here are the steps that we did when we encountered the issue:

1. Create a new product

Payload Request

mutation createProduct {
    product_create(
        data: {
            sku: "SANDBOX-TESTSKU-0509323"
            warehouse_products: { 
                on_hand: 0, 
                warehouse_id: "V2FyZWhvdXNlOjc1OTY5"
            }
            name: "Sandbox Test SKU 323"
            barcode: "BARCODE-SANDBOX-TESTSKU-0509323"
            vendors: {
                vendor_id: "443576",
                vendor_sku: "SANDBOX-TESTSKU-0509323"
            }
            tags: ["UID5200","Ref123"]
        }
    ) {
        complexity
        request_id
        product {
          id
          sku
          name
        }
    }
}

Payload Response

{
  "data": {
    "product_create": {
      "complexity": 10,
      "request_id": "6278c18a053e4dce0863970b",
      "product": {
        "id": "UHJvZHVjdEluZm86Mjg4Nzc4MDMz",
        "sku": "SANDBOX-TESTSKU-0509323",
        "name": "Sandbox Test SKU 323"
      }
    }
  }
}

2. Change the product SKU on the dashboard

3. Add a new product with the same SKU
At this point, the SKU is available and not owned to any of the existing products.

Payload Request

mutation createProduct {
    product_create(
        data: {
            sku: "SANDBOX-TESTSKU-0509323"
            warehouse_products: { 
                on_hand: 0, 
                warehouse_id: "V2FyZWhvdXNlOjc1OTY5"
            }
            name: "Sandbox Test SKU 323 New Product"
            barcode: "BARCODE-SANDBOX-TESTSKU-0509323-NEW"
            vendors: {
                vendor_id: "443576",
                vendor_sku: "SANDBOX-TESTSKU-0509323"
            }
            tags: ["UID5200","Ref124"]
        }
    ) {
        complexity
        request_id
        product {
          id
          sku
          name
        }
    }
}

Payload Response

{
  "data": null,
  "errors": [
    {
      "field": "product_create",
      "operation": "product_create",
      "request_id": "6278c1eec10ccb39a2b2b292",
      "code": 6,
      "message": "A product with sku SANDBOX-TESTSKU-0509323 already exists"
    }
  ]
}

We also noticed that if we create a product using a previous sku and not populate that tags, it will manage to create but the product tags are being populated based on the previous product that owns the SKU. It has the same behaviour on this particular thread: Unable to create same product using API after deleting it using Web interface

Can you help us check on this whether if it is the intended behaviour or is it an issue on the system?
Looking forward for your response.

Kind Regards,
Altair

Cc: @ddl @Edwin

Hello @Altair!

I will request an update on this and let you know as soon as I have one.

Kind regards,
TomasFD