Search code examples
phpwalmart-api

Walmart Feeds API Error: The Product ID already exists in your seller catalog with a different SKU


I'm using this API "/v3/feeds?feedType=MP_MAINTENANCE" to update some Walmart items. I'm providing the SKU and UPC code along with other details. It's working fine for some products. But there is a specific product which is already existing at Walmart with a different sku but now I want to update the sku.

I provide a new SKU and it raises this error:

The Product ID already exists in your seller catalog with a different SKU. Select Yes from the drop-down in the SKU Update column to update the SKU value. For more details, review this Help article: https://sellerhelp.walmart.com/s/guide?article=000007896

I read this article https://sellerhelp.walmart.com/s/guide?article=000007896, they provide a manual way to update the SKU, and regards API they said "For details on how to update a SKU via API, refer to the steps listed under Maintain an item in the API documentation."

I checked this doc

https://developer.walmart.com/doc/us/mp/us-mp-items/?_gl=1*ewk6ta*_ga*OTA2OTE5MzY5LjE2ODM3NjYyNTc.*_ga_1LB22TM2MG*MTY4NjgzMTI2NS4xMS4xLjE2ODY4MzEyODguMC4wLjA.#1249

but found nothing about how to update the item SKU.

Then I tried the following I retire that item via DELETE "/v3/items/DEL5313221491" now one day has passed and that product is not showing in the items listing in the Walmart seller dashboard. Before deletion, it was listed there. It means it's retired successfully. I again tried to update the SKU by the initial method I discussed earlier but again I got the same issue that the item already exists with a different SKU.

Here is the payload I'm sending to feeds api:

            $object = new \stdClass();
            $object->MPItemFeedHeader = new \stdClass();
            $object->MPItemFeedHeader->sellingChannel = "mpmaintenance";
            $object->MPItemFeedHeader->processMode = "REPLACE";
            $object->MPItemFeedHeader->subset = "EXTERNAL";
            $object->MPItemFeedHeader->locale = "en";
            $object->MPItemFeedHeader->version = "1.5";
            $object->MPItemFeedHeader->mart = "WALMART_US";
            $object->MPItem = array();

            foreach ($data as $key => $value) {
                $mpItem = new \stdClass();
                $mpItem->Orderable = new \stdClass();
                $mpItem->Orderable->sku = $value['sku'];
                $mpItem->Orderable->productIdentifiers = new \stdClass();
                $mpItem->Orderable->productIdentifiers->productIdType = $value['productIdType'];
                $mpItem->Orderable->productIdentifiers->productId = $value['productId'];
                $mpItem->Orderable->productName = $value['productName'];
                $mpItem->Orderable->brand = $value['brand'];
                $mpItem->Orderable->price = $value['price'];
                if(isset($value['endDate'])) {
                    $mpItem->Orderable->endDate = $value['endDate'];
                }
                $mpItem->Orderable->pricePerUnit = new \stdClass();

                $mpItem->Visible = new \stdClass();
                $mpItem->Visible->{$value['category']} = new \stdClass();
                $mpItem->Visible->{$value['category']}->shortDescription = strip_tags($value['shortDescription']) . " "  . strip_tags($value['addInfo']);
                $mpItem->Visible->{$value['category']}->mainImageUrl = $value['mainImageUrl'];
                if(isset($value['secondaryImagesUrls'])) {
                    $mpItem->Visible->{$value['category']}->productSecondaryImageURL = $value['secondaryImagesUrls'];
                }

                $object->MPItem[] = $mpItem;

Anyone who can help me that how can I update the SKU for an existing product?


Solution

  • Select Yes from the drop-down in the SKU Update column to update the SKU value.

    Based on that error message, I guess that you need to send the equivalent Yes value using the API.

    Not sure if this is the correct API documentation link, but on this page, I can find:

    Set the SkuUpdate attribute to Yes.

    So you should try to modify your code like this:

    $mpItem = new \stdClass();
    $mpItem->Orderable = new \stdClass();
    $mpItem->Orderable->sku = $value['sku'];
    $mpItem->Orderable->SkuUpdate = 'Yes';
    // ...