Xml Bigcommerce-将产品发布到API
我正在尝试将产品发布到我的bigcommerce暂存区。到目前为止,bcapi响应有助于指出我的XML模式不兼容的原因,但现在它只返回500个错误Xml Bigcommerce-将产品发布到API,xml,api,e-commerce,bigcommerce,Xml,Api,E Commerce,Bigcommerce,我正在尝试将产品发布到我的bigcommerce暂存区。到目前为止,bcapi响应有助于指出我的XML模式不兼容的原因,但现在它只返回500个错误 <product> <name>xbox</name> <type>physical</type> <description>this is a test item</description> <price>499.99</price>
<product>
<name>xbox</name>
<type>physical</type>
<description>this is a test item</description>
<price>499.99</price>
<categories>
<categories>18</categories>
</categories>
<availability>available</availability>
<weight>0.5</weight>
</product>
}
上面的json发布得很好(在将我的标题更改为application/json之后)。就我个人而言,为什么XML没有通过?我已经通过BC发布了客户和订单,相对来说没有问题,但这让我感到困扰。我认为问题在于你如何拥有你的分类数据。尝试在类别数组中使用值而不是类别
<product>
<name>xbox</name>
<type>physical</type>
<description>this is a test item</description>
<price>499.99</price>
<categories>
<value>18</value>
</categories>
<availability>available</availability>
<weight>0.5</weight>
</product>
xbox
身体的
这是一个测试项目
499.99
18
可获得的
0.5
我在向BigCommerce发布产品时也遇到了同样的问题。我找到的解决办法非常简单。当发布只有一个类别的产品时,该类别必须包含两次。我不知道为什么,但这正是我成功的原因
<product>
<name>xbox</name>
<type>physical</type>
<description>this is a test item</description>
<price>499.99</price>
<categories>
<category>18</category>
<category>18</category>
</categories>
<availability>available</availability>
<weight>0.5</weight>
</product>
确保使用方括号。类别部分的格式不正确,它应该是一个数字数组
{
"name": "xbox",
"type": "physical",
"description": "this is a test item",
"price": "499.99",
"categories": [ 18 ],
"availability": "available",
"weight": "0.5"
}
也许文档中有输入错误。这很奇怪,我还没有看到这个问题。
"categories" : [ 18, 18],
{
"name": "xbox",
"type": "physical",
"description": "this is a test item",
"price": "499.99",
"categories": [ 18 ],
"availability": "available",
"weight": "0.5"
}