Deleted product can't be created again with the same sku

Hi,

I’m experiencing something that looks like a bug to me. It looks like we can’t create a product with an sku that has been previously deleted.

  1. I have created an order with that payload :
    RequestId : 616eb23533b3cb30c90cda34
{
	"barcode": "321874127",
	"name": "My product to demonstrate a bug",
	"price": "19.00",
	"productNote": "This product is just here to demonstrate a bug",
	"shipHeroCustomerId": "{{ _.shipHeroCustomerId }}",
	"shipHeroWarehouseId": "{{ _.shipHeroWarehouseId }}",
	"sku": "a_fake_sku",
	"tags": [
		"fake-product"
	]
}
  1. I have deleted it in the dashboard (Bulk delete action in the UI)

  2. The product is still displayed with the query “products” (but is not associated to the warehouse anymore):

{
  products(sku: "a_fake_sku") {
    complexity
    data {
      edges {
        node {
          id
          barcode
          name
          legacy_id
          warehouse_products {
            id
            on_hand
            sku
          }
        }
      }
    }
  }
}

Response:

{
  "data": {
    "products": {
      "complexity": 101,
      "data": {
        "edges": [
          {
            "node": {
              "id": "UHJvZHVjdEluZm86Mjg0Mzg0MzEw",
              "barcode": "321874127",
              "name": "My product to demonstrate a bug",
              "legacy_id": 284384310,
              "warehouse_products": []
            }
          }
        ]
      }
    }
  }
}
  1. I can update it

  2. I can’t delete it :

{
  "errors": [
    {
      "message": "Not product with sku a_fake_sku exists",
      "operation": "product_delete",
      "field": "product_delete",
      "request_id": "616eb54e7599828c4dfc182f",
      "code": 5
    }
  ],
  "data": {
    "product_delete": null
  }
}
  1. I can’t create a new one:
{
  "errors": [
    {
      "message": "A product with sku a_fake_sku already exists",
      "operation": "product_create",
      "field": "product_create",
      "request_id": "616eb23533b3cb30c90cda34",
      "code": 6
    }
  ],
  "data": {
    "product_create": null
  }
}
  1. I can’t change the sku of an other product to this one in the UI:
    Screenshot from 2021-10-19 14-11-43

It looks like I can’t use that sku anymore.
Is there a way to create again a product with a sku that has existed in the past ?

Thank you

Hi @PierreM
Thank you for that detail. Could it be that it just needed to process or am I reading this incorrectly? I just ran a query for that sku on your account and it did not show up.

query{
  product(sku: "a_fake_sku"){
    request_id
    complexity
    data{
    sku
    }
  }
}

_________________response 

{
  "errors": [
    {
      "message": "Product not found",
      "operation": "product",
      "field": "data",
      "request_id": "616f2cf9fd909aad4046e300",
      "code": 5
    }
  ],
  "data": {
    "product": {
      "request_id": "616f2cf9fd909aad4046e300",
      "complexity": 1,
      "data": null
    }
  }
}

Hi, I guess this is not the correct account, the query works on my side (it’s on our sandbox account).

I have further information about that issue: the only way to retrieve the product is to use the mutation product_add_to_warehouse, I can then update the product.

It looks like “Bulk delete” on the UI don’t delete the product but rather remove it from the warehouse.

And I can’t delete a product as you can see here:

{
  products(sku: "a_fake_sku") {
    complexity
    request_id
    data {
      edges {
        node {
          id
          barcode
          name
          legacy_id
          warehouse_products {
            id
            on_hand
            sku
          }
        }
      }
    }
  }
}

returns

{
  "data": {
    "products": {
      "complexity": 101,
      "request_id": "616fc5a2c8e0fde3ffc13f67",
      "data": {
        "edges": [
          {
            "node": {
              "id": "UHJvZHVjdEluZm86Mjg0Mzg0MzEw",
              "barcode": "321874129",
              "name": "My product to demonstrate a bug",
              "legacy_id": 284384310,
              "warehouse_products": [
                {
                  "id": "UHJvZHVjdDozNjQxNDQ4MzA=",
                  "on_hand": 0,
                  "sku": "a_fake_sku"
                }
              ]
            }
          }
        ]
      }
    }
  }
}

And when I delete it:

mutation {
  product_delete(data: { sku: "a_fake_sku" }) {
    request_id
  }
}

gives

{
  "errors": [
    {
      "message": "Not product with sku a_fake_sku exists",
      "operation": "product_delete",
      "field": "product_delete",
      "request_id": "616fc581bf6f784f5f8b6625",
      "code": 5
    }
  ],
  "data": {
    "product_delete": null
  }
}

It looks like something is broken here.

Hi Pierre,
I think what may be happening is that your sandbox account is that because your account is a multi-warehouse with more than one warehouse. You may need to use the warehouse_product_update and the warehouse_product_delete. Products are warehouse-specific ( in a multi-warehouse setup) because the products carry different inventory in each of the warehouses. When you use the warehouse prefaced mutations, the warehouse is a required data field. This also applies to the bulk delete in the way that you can delete a SKU in one warehouse, but not the other. Can you give the tests another try with the new information that applies to accounts with multiple warehouses?