ebay-apiinventory-management

Ebay API:Update the Value of the SKU in a Variation using ReviseItemRequest


I am trying to update the stock for variations products, here is my feed xml code:

$itemid = 123137114746;
$sku = 5052933687242;
$qty = 1; 

$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<ReviseItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$eBay_auth_token</eBayAuthToken>
</RequesterCredentials>
<Item ComplexType="ItemType">
<ItemID>$itemid</ItemID>
<Variations>
 <Variation>
        <SKU>$sku</SKU>
        <Quantity>$qty</Quantity>
 </Variation>   
</Variations>   
</Item>
<MessageID>1</MessageID>
<WarningLevel>Low</WarningLevel>
<Version>$eBay_api_version</Version>
</ReviseItemRequest>​
EOD;

Inventory quantity are updating on ebay, but it gives warning in response

 SimpleXMLElement Object
(
    [Timestamp] => 2020-01-14T04:50:42.611Z
    [Ack] => Warning
    [CorrelationID] => 1
    [Errors] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [ShortMessage] => The item specific Vintage is missing.
                    [LongMessage] => The item specific Vintage is missing. Add Vintage to this listing, enter a valid value and then try again.
                    [ErrorCode] => 21919403
                    [SeverityCode] => Warning
                    [ErrorParameters] => Array
                        (
                            [0] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 0
                                        )

                                    [Value] => The item specific Vintage is missing.
                                )

                            [1] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 1
                                        )

                                    [Value] => The item specific Vintage is missing. Add Vintage to this listing, enter a valid value and then try again.
                                )

                            [2] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 2
                                        )

                                    [Value] => Vintage
                                )

                        )

                    [ErrorClassification] => RequestError
                )

            [1] => SimpleXMLElement Object
                (
                    [ShortMessage] => The item specific Fit is missing.
                    [LongMessage] => The item specific Fit is missing. Add Fit to this listing, enter a valid value and then try again.
                    [ErrorCode] => 21919403
                    [SeverityCode] => Warning
                    [ErrorParameters] => Array
                        (
                            [0] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 0
                                        )

                                    [Value] => The item specific Fit is missing.
                                )

                            [1] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 1
                                        )

                                    [Value] => The item specific Fit is missing. Add Fit to this listing, enter a valid value and then try again.
                                )

                            [2] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 2
                                        )

                                    [Value] => Fit
                                )

                        )

                    [ErrorClassification] => RequestError
                )

            [2] => SimpleXMLElement Object
                (
                    [ShortMessage] => The item specific Closure is missing.
                    [LongMessage] => The item specific Closure is missing. Add Closure to this listing, enter a valid value and then try again.
                    [ErrorCode] => 21919403
                    [SeverityCode] => Warning
                    [ErrorParameters] => Array
                        (
                            [0] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 0
                                        )

                                    [Value] => The item specific Closure is missing.
                                )

                            [1] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 1
                                        )

                                    [Value] => The item specific Closure is missing. Add Closure to this listing, enter a valid value and then try again.
                                )

                            [2] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 2
                                        )

                                    [Value] => Closure
                                )

                        )

                    [ErrorClassification] => RequestError
                )

            [3] => SimpleXMLElement Object
                (
                    [ShortMessage] => The item specific Front Type is missing.
                    [LongMessage] => The item specific Front Type is missing. Add Front Type to this listing, enter a valid value and then try again.
                    [ErrorCode] => 21919403
                    [SeverityCode] => Warning
                    [ErrorParameters] => Array
                        (
                            [0] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 0
                                        )

                                    [Value] => The item specific Front Type is missing.
                                )

                            [1] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 1
                                        )

                                    [Value] => The item specific Front Type is missing. Add Front Type to this listing, enter a valid value and then try again.
                                )

                            [2] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [ParamID] => 2
                                        )

                                    [Value] => Front Type
                                )

                        )

                    [ErrorClassification] => RequestError
                )

            [4] => SimpleXMLElement Object
                (
                    [ShortMessage] => Funds from your sales will be unavailable and displayed as 'pending' in your PayPal account for a period of time. 
                    [LongMessage] => Funds from your sales will be unavailable and displayed as 'pending' in your PayPal account for a period of time. Learn more: http://cgi6.ebay.co.uk/ws/eBayISAPI.dll?UserPolicyMessaging
                    [ErrorCode] => 21917236
                    [SeverityCode] => Warning
                    [ErrorParameters] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [ParamID] => 0
                                )

                            [Value] => http://cgi6.ebay.co.uk/ws/eBayISAPI.dll?UserPolicyMessaging
                        )

                    [ErrorClassification] => RequestError
                )

        )

    [Version] => 1131
    [Build] => E1131_UNI_API5_19109898_R1
    [ItemID] => 123137114746
    [StartTime] => 2018-05-16T15:39:44.000Z
    [EndTime] => 2020-01-16T15:39:44.000Z
    [Fees] => SimpleXMLElement Object
        (
            [Fee] => Array
                (
                    [0] => SimpleXMLElement Object
                        (
                            [Name] => AuctionLengthFee
                            [Fee] => 0.0
                        )

                    [1] => SimpleXMLElement Object
                        (
                            [Name] => BoldFee
                            [Fee] => 0.0
                        )

                    [2] => SimpleXMLElement Object
                        (
                            [Name] => BuyItNowFee
                            [Fee] => 0.0
                        )

                    [3] => SimpleXMLElement Object
                        (
                            [Name] => CategoryFeaturedFee
                            [Fee] => 0.0
                        )

                    [4] => SimpleXMLElement Object
                        (
                            [Name] => FeaturedFee
                            [Fee] => 0.0
                        )

                    [5] => SimpleXMLElement Object
                        (
                            [Name] => GalleryPlusFee
                            [Fee] => 0.0
                        )

                    [6] => SimpleXMLElement Object
                        (
                            [Name] => FeaturedGalleryFee
                            [Fee] => 0.0
                        )

                    [7] => SimpleXMLElement Object
                        (
                            [Name] => FixedPriceDurationFee
                            [Fee] => 0.0
                        )

                    [8] => SimpleXMLElement Object
                        (
                            [Name] => GalleryFee
                            [Fee] => 0.0
                        )

                    [9] => SimpleXMLElement Object
                        (
                            [Name] => GiftIconFee
                            [Fee] => 0.0
                        )

                    [10] => SimpleXMLElement Object
                        (
                            [Name] => HighLightFee
                            [Fee] => 0.0
                        )

                    [11] => SimpleXMLElement Object
                        (
                            [Name] => InsertionFee
                            [Fee] => 0.0
                        )

                    [12] => SimpleXMLElement Object
                        (
                            [Name] => InternationalInsertionFee
                            [Fee] => 0.0
                        )

                    [13] => SimpleXMLElement Object
                        (
                            [Name] => ListingDesignerFee
                            [Fee] => 0.0
                        )

                    [14] => SimpleXMLElement Object
                        (
                            [Name] => ListingFee
                            [Fee] => 0.0
                        )

                    [15] => SimpleXMLElement Object
                        (
                            [Name] => PhotoDisplayFee
                            [Fee] => 0.0
                        )

                    [16] => SimpleXMLElement Object
                        (
                            [Name] => PhotoFee
                            [Fee] => 0.0
                        )

                    [17] => SimpleXMLElement Object
                        (
                            [Name] => ReserveFee
                            [Fee] => 0.0
                        )

                    [18] => SimpleXMLElement Object
                        (
                            [Name] => SchedulingFee
                            [Fee] => 0.0
                        )

                    [19] => SimpleXMLElement Object
                        (
                            [Name] => SubtitleFee
                            [Fee] => 0.0
                        )

                    [20] => SimpleXMLElement Object
                        (
                            [Name] => BorderFee
                            [Fee] => 0.0
                        )

                    [21] => SimpleXMLElement Object
                        (
                            [Name] => ProPackBundleFee
                            [Fee] => 0.0
                        )

                    [22] => SimpleXMLElement Object
                        (
                            [Name] => BasicUpgradePackBundleFee
                            [Fee] => 0.0
                        )

                    [23] => SimpleXMLElement Object
                        (
                            [Name] => ValuePackBundleFee
                            [Fee] => 0.0
                        )

                    [24] => SimpleXMLElement Object
                        (
                            [Name] => PrivateListingFee
                            [Fee] => 0.0
                        )

                    [25] => SimpleXMLElement Object
                        (
                            [Name] => ProPackPlusBundleFee
                            [Fee] => 0.0
                        )

                    [26] => SimpleXMLElement Object
                        (
                            [Name] => MotorsGermanySearchFee
                            [Fee] => 0.0
                        )

                )

        )

    [DiscountReason] => SpecialOffer
)

In response it return Ack as Warning and long Error with [ErrorCode] => 21919403 [SeverityCode] => Warning

Is any thing missing here ? Please help

thanks


Solution

  • Instead of 'ReviseItemRequest' I have used 'ReviseInventoryStatusRequest' that solve my problem ;)

    Changed code:

    $itemid = 123137114746;
    $sku = 5052933687242;
    $qty = 1; 
    
    $feed = <<< EOD
    <?xml version="1.0" encoding="utf-8"?>
    <ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
    <RequesterCredentials>
    <eBayAuthToken>$eBay_auth_token</eBayAuthToken>
    </RequesterCredentials>
    <InventoryStatus> InventoryStatusType
        <ItemID>$itemid</ItemID>
        <Quantity>$qty</Quantity>
        <SKU>$sku</SKU>
      </InventoryStatus>
    <MessageID>1</MessageID>
    <WarningLevel>High</WarningLevel>
    <Version>$eBay_api_version</Version>
    </ReviseInventoryStatusRequest>​
    EOD;
    

    Response:

    SimpleXMLElement Object
    (
        [Timestamp] => 2020-01-14T06:20:32.877Z
        [Ack] => Success
        [CorrelationID] => 1
        [Version] => 1131
        [Build] => E1131_UNI_API5_19109898_R1
        [InventoryStatus] => SimpleXMLElement Object
            (
                [SKU] => 5052933687242
                [ItemID] => 123137114746
                [StartPrice] => 39.99
                [Quantity] => 1
            )
    
        [Fees] => SimpleXMLElement Object
            (
                [ItemID] => 123137114746
                [Fee] => Array
                    (
                        [0] => SimpleXMLElement Object
                            (
                                [Name] => AuctionLengthFee
                                [Fee] => 0.0
                            )
    
                        [1] => SimpleXMLElement Object
                            (
                                [Name] => BoldFee
                                [Fee] => 0.0
                            )
    
                        [2] => SimpleXMLElement Object
                            (
                                [Name] => BuyItNowFee
                                [Fee] => 0.0
                            )
    
                        [3] => SimpleXMLElement Object
                            (
                                [Name] => CategoryFeaturedFee
                                [Fee] => 0.0
                            )
    
                        [4] => SimpleXMLElement Object
                            (
                                [Name] => FeaturedFee
                                [Fee] => 0.0
                            )
    
                        [5] => SimpleXMLElement Object
                            (
                                [Name] => GalleryPlusFee
                                [Fee] => 0.0
                            )
    
                        [6] => SimpleXMLElement Object
                            (
                                [Name] => FeaturedGalleryFee
                                [Fee] => 0.0
                            )
    
                        [7] => SimpleXMLElement Object
                            (
                                [Name] => FixedPriceDurationFee
                                [Fee] => 0.0
                            )
    
                        [8] => SimpleXMLElement Object
                            (
                                [Name] => GalleryFee
                                [Fee] => 0.0
                            )
    
                        [9] => SimpleXMLElement Object
                            (
                                [Name] => GiftIconFee
                                [Fee] => 0.0
                            )
    
                        [10] => SimpleXMLElement Object
                            (
                                [Name] => HighLightFee
                                [Fee] => 0.0
                            )
    
                        [11] => SimpleXMLElement Object
                            (
                                [Name] => InsertionFee
                                [Fee] => 0.0
                            )
    
                        [12] => SimpleXMLElement Object
                            (
                                [Name] => InternationalInsertionFee
                                [Fee] => 0.0
                            )
    
                        [13] => SimpleXMLElement Object
                            (
                                [Name] => ListingDesignerFee
                                [Fee] => 0.0
                            )
    
                        [14] => SimpleXMLElement Object
                            (
                                [Name] => ListingFee
                                [Fee] => 0.0
                            )
    
                        [15] => SimpleXMLElement Object
                            (
                                [Name] => PhotoDisplayFee
                                [Fee] => 0.0
                            )
    
                        [16] => SimpleXMLElement Object
                            (
                                [Name] => PhotoFee
                                [Fee] => 0.0
                            )
    
                        [17] => SimpleXMLElement Object
                            (
                                [Name] => ReserveFee
                                [Fee] => 0.0
                            )
    
                        [18] => SimpleXMLElement Object
                            (
                                [Name] => SchedulingFee
                                [Fee] => 0.0
                            )
    
                        [19] => SimpleXMLElement Object
                            (
                                [Name] => SubtitleFee
                                [Fee] => 0.0
                            )
    
                        [20] => SimpleXMLElement Object
                            (
                                [Name] => BorderFee
                                [Fee] => 0.0
                            )
    
                        [21] => SimpleXMLElement Object
                            (
                                [Name] => ProPackBundleFee
                                [Fee] => 0.0
                            )
    
                        [22] => SimpleXMLElement Object
                            (
                                [Name] => BasicUpgradePackBundleFee
                                [Fee] => 0.0
                            )
    
                        [23] => SimpleXMLElement Object
                            (
                                [Name] => ValuePackBundleFee
                                [Fee] => 0.0
                            )
    
                        [24] => SimpleXMLElement Object
                            (
                                [Name] => PrivateListingFee
                                [Fee] => 0.0
                            )
    
                        [25] => SimpleXMLElement Object
                            (
                                [Name] => ProPackPlusBundleFee
                                [Fee] => 0.0
                            )
    
                        [26] => SimpleXMLElement Object
                            (
                                [Name] => MotorsGermanySearchFee
                                [Fee] => 0.0
                            )
    
                    )
    
            )
    
    )
    

    Hope,this will help someone :)