selling-partner-api: 403 Forbidden - SignatureDoesNotMatch

Problem description:

Since last night, around 7:40GMT, with no code or config updates, we have started receiving a 403 error when trying to upload any feeds (inventory, shipping updates). This has been working fine for many months, and other APIs are still working fine (e.g. getOrders, getMyFeesEstimates) so I don’t believe but could easily be wrong) it to be a problem with access keys, secrets etc. We have refreshed them just in case, but no change. The error happens at $docToUpload->upload($feedContents). I have raised a case with Seller Central, but am hoping someone here may have a suggestion as I have had to turn off our “shop” till we can resolve it.

Error:

<Error>SignatureDoesNotMatch<Message>The request signature does not match the signature you provided (truncated…)

Code

$lwaClientId = $sp_conn['client_id'];
$lwaClientSecret = $sp_conn['secret'];
$lwaRefreshToken = $sp_conn['refresh_token'];
$awsAccessKeyId = $sp_conn['aws_access_key'];
$awsSecretAccessKey = $sp_conn['aws_secret'];
$config = new SellingPartnerApi\Configuration([
	'lwaClientId' => $lwaClientId,
	'lwaClientSecret' => $lwaClientSecret,
	'lwaRefreshToken' => $lwaRefreshToken,
	'awsAccessKeyId' => $awsAccessKeyId,
	'awsSecretAccessKey' => $awsSecretAccessKey,
	"endpoint" => SellingPartnerApi\Endpoint::EU
]);

$feedsApi = new SellingPartnerApi\Api\FeedsV20210630Api($config)

$fullFeedName = "/home/feeds/inv_feed.txt";
$feedType = FeedType::POST_FLAT_FILE_INVLOADER_DATA;
$marketplace_ids = array('A1F83G8C2ARO7P');

$createFeedDocSpec = new SellingPartnerApi\Model\FeedsV20210630\CreateFeedDocumentSpecification(['content_type' => 
$feedType['contentType']]);

try {
    $feedDocumentInfo = $feedsApi->createFeedDocument($createFeedDocSpec);
} catch (Exception $e) {
    echo 'Exception when calling FeedsApi->getFeedDocument: ', $e->getMessage(), PHP_EOL;
    return $e->getMessage();
}

$feedDocumentId = $feedDocumentInfo->getFeedDocumentId();
$feedContents = file_get_contents($fullFeedName);
$docToUpload = new SellingPartnerApi\Document($feedDocumentInfo, $feedType);

try {
    **$docToUpload->upload($feedContents);**
} catch (Exception $e) {
    echo 'Exception when calling FeedsApi->upload: ', $e->getMessage(), PHP_EOL;
    return $e->getMessage();
}

## Seller Central SP API config page screenshot
![SP-API](https://user-images.githubusercontent.com/25084818/220321958-028f5dbb-4958-4625-b2de-59cac8c3bdfc.png)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 24 (5 by maintainers)

Most upvoted comments

Interesting, thanks. I’ve not had any response yet from Amazon on the case raised, will update if it gets resolved there