I need your help, I tried all the mentioned suggestions (https://github.com/amzn/selling-partner-api-docs/issues/2167) but am still not able to update the inventory quantity with Amazon SP API.
I am trying to update the quantity stock without Feeds.
Below body, I am sending to update the quantity with Put Request.
The package I am using is: https://github.com/jlevers/selling-partner-api
SellingPartnerApi\Model\ListingsV20210801\ListingsItemPutRequest Object
(
[container:protected] => Array
(
[product_type] => FALSE_EYELASH
[requirements] =>
[attributes] => Array
(
[fulfillment_availability] => Array
(
[fulfillment_channel_code] => AMAZON_JP
[quantity] => 5
)
)
)
)
When I use sandbox get a response ACCEPTED but without getting an error.
........
[sku] => 2629-48KGT-2347 // TEST
[status] => INVALID
[submission_id] => 602b84b73b964e24b174a80d3a7870a3
[issues] => Array
(
[0] => SellingPartnerApi\Model\ListingsV20210801\Issue Object
(
[container:protected] => Array
(
[code] => 4000003
[message] => ������������Amazon������������������������������������������������������������������������������
[severity] => ERROR
[attribute_names] =>
)
)
)
........
=======================
To patch the request I am trying the below body.
SellingPartnerApi\Model\ListingsV20210801\ListingsItemPatchRequest Object
(
[container:protected] => Array
(
[product_type] => FALSE_EYELASH
[patches] => Array
(
[op] => replace
[operation_type] => UPDATE // Already try with or without this parameter
[path] => /attributes/fulfillment_availability
[value] => Array
(
[fulfillment_channel_code] => AMAZON_JP
[quantity] => 5
)
)
)
)
Get the below response.
Exception when calling: [400] {
"errors": [
{
"code": "InvalidInput",
"message": "Request has missing or invalid parameters and cannot be parsed.",
"details": ""
}
]
}
Is there any way to update the order status to shipped without the feeds API?
The code which I try so far is below.
$patchBody = [
'product_type' => 'BEAUTY',
'marketplaceIds' => ['A1VC38T7YXB528'], // Already try with or without
'patches' => [
[
"op" => "replace",
"operation_type" => "PARTIAL_UPDATE",
"path" => "/attributes/fulfillment_availability",
"value" => [
[
"fulfillment_channel_code" => 'DEFAULT',
"quantity" => 2
]
]
]
]
];
$putBody = [
'product_type' => 'BEAUTY',
'attributes' => [
"fulfillment_availability" => [
"fulfillment_channel_code" => "DEFAULT",
"quantity" => 2
]
]
];
$seller_id = 'MY-SELLER-ID';
$sku = '8001025974';
$marketplace_ids = array('A1VC38T7YXB528');
// Update inventory
$apiInstance = new SellingPartnerApi\Api\ListingsV20210801Api($config);
$body = new \SellingPartnerApi\Model\ListingsV20210801\ListingsItemPatchRequest($patchBody);
// $issue_locale = 'en_US';
try {
$result = $apiInstance->patchListingsItem($seller_id, $sku, $marketplace_ids, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling: ', $e->getMessage(), PHP_EOL;
}