Ebay API:使用ReviseItemRequest更新版本中SKU的值

问题描述 投票:0回答:1

我正在尝试更新各种产品的库存,这是我的Feed xml代码:

$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;

库存数量正在eBay上更新,但会发出警告作为响应

 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
)

作为响应,它返回Ack作为警告,并带有[ErrorCode] =>长时间错误=> 21919403 [SeverityCode] =>警告

这里缺少任何东西吗?请帮助

谢谢

ebay-api inventory-management
1个回答
0
投票

代替“ ReviseItemRequest”,我使用了“ ReviseInventoryStatusRequest”来解决我的问题;)

更改的代码:

$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;

响应:

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
                        )

                )

        )

)

希望,这将对某人有所帮助:)

© www.soinside.com 2019 - 2024. All rights reserved.