double-break / spapi-php

Amazon Selling Partner API PHP Client
MIT License
56 stars 48 forks source link

Pricing Operation - The request signature we calculated does not match the signature you provided. #13

Closed cesarelasorella closed 3 years ago

cesarelasorella commented 3 years ago

Hi @lyubo-slavilov, sorry for delay. I tried to add this change (#6 ) but nothing new. The same error occurs. The code used for the call is the following:

//Create SP API ProductPricing client and execute one ot its REST methds.
  $pricingClient = new DoubleBreak\Spapi\Api\ProductPricing($cred, $config);
  $result = $pricingClient->getPricing([
    'MarketplaceIds' => "APJ6JRA9NG5V4",
    'ItemType' => "Sku",
    'Skus' => ["5901721606210"]
  ])['payload'];

I'm trying to get price for SKU 5901721606210 on Italy Marketplace.

Thank you

lyubo-slavilov commented 3 years ago

Your Skus parameter should be coma separated string instead of an array, I think.

On Tue, Jan 19, 2021, 15:49 Cesare Lasorella notifications@github.com wrote:

Hi @lyubo-slavilov https://github.com/lyubo-slavilov, sorry for delay. I tried to add this change (#6 https://github.com/double-break/spapi-php/issues/6 ) but nothing new. The same error occurs. The code used for the call is the following:

//Create SP API ProductPricing client and execute one ot its REST methds. $pricingClient = new DoubleBreak\Spapi\Api\ProductPricing($cred, $config); $result = $pricingClient->getPricing([ 'MarketplaceIds' => "APJ6JRA9NG5V4", 'ItemType' => "Sku", 'Skus' => ["5901721606210"] ])['payload'];

I'm trying to get price for SKU 5901721606210 on Italy Marketplace.

Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/double-break/spapi-php/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGJUPWKCIPVMI2J36ILVDS2WEWLANCNFSM4WIZS5JQ .

lyubo-slavilov commented 3 years ago

May be something like: Something like:

$pricingClient = new DoubleBreak\Spapi\Api\ProductPricing($cred, $config);
  $result = $pricingClient->getPricing([
    'MarketplaceIds' => "APJ6JRA9NG5V4",
    'ItemType' => "Sku",
    'Skus' => "5901721606210"
  ])['payload'];

If you need more than one Sku:

 $pricingClient = new DoubleBreak\Spapi\Api\ProductPricing($cred, $config);
  $result = $pricingClient->getPricing([
    'MarketplaceIds' => "APJ6JRA9NG5V4",
    'ItemType' => "Sku",
    'Skus' => "5901721606210,0126061271059,.."
  ])['payload'];
cesarelasorella commented 3 years ago

Thank you @lyubo-slavilov, changing Skus as you suggest seems something change because the error is now different:

403 Forbidden response: { "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "det (truncated...)

About credentials and configurations I followed the official guide I have a doubt; do you know if selling-partner api works fine on Italy MP? I think to read somewhere that at moment this service works only in the US MP.

lyubo-slavilov commented 3 years ago

@cesarelasorella Hello,

I have a doubt; do you know if selling-partner api works fine on Italy MP? I think to read somewhere that at moment this service works only in the US MP

Unfortunately I am far from being Amazon SP API expert. I just was able to figure out how to stratify their request signing routine. So, I cant really tell. I am personally having access troubles with some other endpoints for DE market... So, we are all waiting for AMZ support to reply, I guess.

I am going to close the issue since it is not related to the code itself 😔