我使用来自: https ://github.com/gentor/etsy-php-laravel的 Etsy API (PHP) 。我在尝试创建包含这些自定义属性的列表时遇到问题:“颜色”、“高度”。有一个示例代码,但我不知道如何从我的自定义属性中获取“property_id”字段,我也不知道如何将这些自定义属性添加到我的列表中。我确实阅读了他们的开发人员文档,但我自己仍然无法弄清楚任何事情,已经 2 天了,他们一直从这里锁定我的帐户,这意味着我无法测试我的代码。在此先感谢,这是我尝试过的示例代码:
dd($conn->updateInventory(
[
'params' => [
'listing_id' => '710642930'
],
'data' => [
'products' => [
'json' => json_encode([
[
'sku' => 'sku-1',
'property_values' => [
[
'property_id' => 2000,
'property_name' => 'color',
'values' => 'red'
],
[
'property_name' => 'height',
'property_id' => 5000,
'value' => '57 cm'
]
],
'offerings' => [
[
'price' => 10,
'quantity' => 3
]
]
],
[
'sku' => 'sku-2',
'property_values' => [
[
'property_name' => 'color',
'property_id' => 2000,
'value' => 'red'
],
[
'property_name' => 'height',
'property_id' => 5000,
'value' => '68 cm'
]
],
'offerings' => [
[
'price' => 11,
'quantity' => 4
]
]
],
[
'sku' => 'sku-3',
'property_values' => [
[
'property_name' => 'color',
'property_id' => 2000,
'value' => 'blue'
],
[
'property_name' => 'height',
'property_id' => 5000,
'value' => '57 cm'
]
],
'offerings' => [
[
'price' => 12,
'quantity' => 5
]
]
],
[
'sku' => 'sku-4',
'property_values' => [
[
'property_name' => 'color',
'property_id' => 2000,
'value' => 'blue'
],
[
'property_name' => 'height',
'property_id' => 5000,
'value' => '68 cm'
]
],
'offerings' => [
[
'price' => 14,
'quantity' => 6
]
]
],
])
],
'price_on_property' => [2000, 5000],
'quantity_on_property' => [2000, 5000],
'sku_on_property' => [2000, 5000],
],
]));