编程语言
首页 > 编程语言> > php-eBay API设置子类别无效

php-eBay API设置子类别无效

作者:互联网

我问的是这里,而不是在eBay论坛上,因为似乎没人响应或活跃于此.

基本上,我在Trading API上使用SetStoreCategories方法.
http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/SetStoreCategories.html

我的API调用数据部分如下

<Action>Add</Action>
<StoreCategories>
  <CustomCategory>
     <Name>name of a thing</Name>
     <ChildCategory>
        <Name>a child name</Name>
     </ChildCategory>
  </CustomCategory>
  <CustomCategory>
     <Name>name of another thing</Name>
     <ChildCategory>
        <Name>2nd child name</Name>
     </ChildCategory>
  </CustomCategory>

而eBay API的结果是

array(7) {
  ["Timestamp"]=>
  string(24) "2013-07-15T01:49:39.888Z"
  ["Ack"]=>
  string(7) "Success"
  ["Version"]=>
  string(3) "831"
  ["Build"]=>
  string(32) "E831_CORE_APISELLING_16205050_R1"
  ["TaskID"]=>
  string(1) "0"
  ["Status"]=>
  string(8) "Complete"
  ["CustomCategory"]=>
  array(1) {
    ["CustomCategory"]=>
    array(2) {
      [0]=>
      array(2) {
        ["CategoryID"]=>
        string(9) "660835819"
        ["Name"]=>
        string(15) "name of a thing"
      }
      [1]=>
      array(2) {
        ["CategoryID"]=>
        string(9) "660835919"
        ["Name"]=>
        string(21) "name of another thing"
      }
    }
  }
}

因此,您可以看到它不在查看我的孩子类别.我已经在ebay.com上查看了,但它们不存在.

ebay api表示CustomCategory元素与ChildCategory类型具有相同的类型.而且您只能嵌套3个孩子.但是我什至不能嵌套1个孩子.

任何帮助都将是惊人的.

谢谢!

解决方法:

原来你不能这样做.您必须一次进行1级调用,取回categoryIds,然后在后续调用中设置DestinationParentCategoryID.

标签:ebay,api,xml,php
来源: https://codeday.me/bug/20191123/2064510.html