Closed ahlmackie closed 1 year ago
Do your requests to other APIs works from the SP-API ?
yes, i've tried a dozen other endpoints and they are all passing authorization with 200 status codes
this is the url I aam having an issue with:
The HTTP status 403
can have various reasons. You will always get a JSON back from Amazon with a more precise differentiation of the error.
In the SP-API we have several error cases that lead to the status 403
and ultimately do not authorize you.
To identify the error more accurately, we need your canonical request. There it is usually already obvious why you get a 403
status back.
Here you go:
GET
/fba/inventory/v1/summaries
granularityId=A1F83G8C2ARO7P&granularityType=Marketplace&marketplaceIds=A1F83G8C2ARO7P&startDateTime=2020-01-01
host:sellingpartnerapi-eu.amazon.com
user-agent:amkapp/v1.0 (language=javascript)
x-amz-access-token:Atza|
host;user-agent;x-amz-access-token;x-amz-date e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Unfortunately, I have often seen that the users of the API do not specify a content-type
in their canonical request, although this must be included in the normal header. Already tried to specify it? I also get a 403 if I do not specify a content-type
. Below I describe a problem where I also get a 403.
I also see that your canonical_uri
does not end with /
. Other users had similar problems with GET requests, but it didn't help them if the URI ends with /
or they set the content-type. But maybe this helps you?
Try this one:
GET
/fba/inventory/v1/summaries/
granularityId=A1F83G8C2ARO7P&granularityType=Marketplace&marketplaceIds=A1F83G8C2ARO7P&startDateTime=2020-01-01
content-type: application/json
host:sellingpartnerapi-eu.amazon.com
user-agent:amkapp/v1.0 (language=javascript)
x-amz-access-token:Atza|
x-amz-date:20201123T114051Z
content-type;host;user-agent;x-amz-access-token;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
still no luck unfortunately (my other endpoints are working ok with the changes)
GET /fba/inventory/v1/summaries/ granularityId=A1F83G8C2ARO7P&granularityType=Marketplace&marketplaceIds=A1F83G8C2ARO7P&startDateTime=2020-01-01 content-type:application/json host:sellingpartnerapi-eu.amazon.com user-agent:amkapp/v1.0 (language=javascript) x-amz-access-token:Atza| x-amz-date:20201123T120830Z
content-type;host;user-agent;x-amz-access-token;x-amz-date e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
The e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
indicates that you hashed an empty payload. You should not have a payload for this request
thanks, the guides indicate that if there is no payload, use a blank string: https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html (point 6). If I exclude this i get a 403 response: 'x-amzn-errortype': 'InvalidSignatureException'?
@rogersv,
I would say that here the payload must be empty. There is no parameter to add to the HTTPBody
at this API endpoint.
All parameters defined here in the documentation can be found in the query string: Type: Query
. Here
Here are some useful links to see what a payload really is in the HTTP protocol: HTTP (wiki) RFC7231(IETF) payloads of http request methods (StackOverflow)
With absolute probability the payload will be empty after the documentation. Or can someone here share a different experience especially about the fba-inventory
API?
@ahlmackie, I'm sorry, in your case I don't know what to do.
If I am ready to work with the fba-inventory
API, I will share my experience with you here.
EDIT What is the exact error message? Normally you will receive any message as JSON.
thanks for you time @JacksonJeans I will let you know if I find the solution.
I've raised a case with amazon to see if they can shed some light. Unfortunately is the very generic 403 response (similar to that people were recieving when having trouble with the STS token flow in the docs). I've put the JSON response and response headers below:
response headers { date: 'Mon, 23 Nov 2020 12:08:42 GMT', 'content-type': 'application/json', connection: 'close', 'x-amzn-requestid': '772305d1-5005-4d50-b83a-0fc6620ab98e', 'x-amzn-errortype': 'AccessDeniedException', 'x-amz-apigw-id': 'WdbrpG27DoEFXNQ=' }
response body: errors: [ { message: 'Access to requested resource is denied.', code: 'Unauthorized', details: '' ] }
Yes it should be empty. What I meant was "why is the "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" included in this request?". EDIT: I was incorrect. I should have read the question once more. :)
@rogersv its just the final part of the string to be signed in the flow to calculate the signature... https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html (point 6). we were just checking the make up of the canonical request for errors
I'm having the same problem. Other endpoints mostly POST methods works fine, but this one returns "Unauthorized"
I had a message from amazon: they have identified an issue their end for this API and have notified the engineers. Hopefully resolved soon
Did they fix the problem? I'm also receiving the same message: "Access to requested resource is denied.", "code": "Unauthorized", whereas queries sent to "/orders/v0/orders" work without any issues.
had a response from amazon saying it is not available yet, no guidance on when they plan to take it live I suspect Brexit has something to do with it
jfyi, same scenario here:
HTTP 403
from the APIThat reply came after a hell of a ride through various tickets and support requests. But I guess this information is final. At least the reply state that this official API documentation may be enhanced in order to clearly point out this fact. I did not hear information about if or when this use-case could be possible for EU.
I am also having trouble with the notifications API in europe - getting a 403 status code, though I have been assure it is working..? @winterstefan are you able to access it? @seanevan are we able to get some guidance on what APIs are active in each region?
Did they fix the problem? I'm also receiving the same message: "Access to requested resource is denied.", "code": "Unauthorized", whereas queries sent to "/orders/v0/orders" work without any issues.
I have the same problem. Diy you fix?
jfyi, same scenario here:
- Trying to access SP-API (especially endpoint for fetching inventory)
- Constantly getting
HTTP 403
from the API- Support just now replied that this use-case is not possible at the moment the European marketplaces
That reply came after a hell of a ride through various tickets and support requests. But I guess this information is final. At least the reply state that this official API documentation may be enhanced in order to clearly point out this fact. I did not hear information about if or when this use-case could be possible for EU.
Can someone from the dev team confirm this? We've been developing on these APIs for a while and there's nothing at all in the documentation or any ufficial statement that confirms that the inventory APIs are not working for Europe.
If this is really the case, it's absolutely insane that there are NO WARNINGS about this, we're wasting our time building an application and we're stuck with 403 errors on getInventorySummaries calls.
edit: I've managed to find an ufficial statement in #207 , is there an ETA on when this could be solved? Are there any workarounds for now?
I'm also interested to know when this endpoint will become available in Europe.
Me too. Having the same issue.
Same Error Message; "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "details": "" } ]
Any news? any workarounds? Is it possible to get /reports/{date}/reports? -> I did try and got the same ErrorMessage
Are there any updates on this issue? We are working on an application that relies on that endpoint.
The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. Today this API is available only in the North America region. In 2021 we plan to release this API in the Europe and Far East regions.
It's for only NA region so if you are trying other than that it won't work. That unauthorized error is related to "resources not found" not with your authentication.
This is a very basic feature. I couldn't get the detail of my fba_inventory quantity. What is your plan for this feature?
Can someone from Amazon please confirm if the sandbox endpoints of the fba/inventory/v1/summaries
is working for north america marketplaces? I am receiving the same error as what a few people have described:
403 Forbidden
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": ""
}
]
}
My Sandbox Request
https://sandbox.sellingpartnerapi-na.amazon.com/fba/inventory/v1/summaries?details=true&granularityType=Marketplace&granularityId=ATVPDKIKX0DER&marketplaceIds=["ATVPDKIKX0DER"]
Authorization:
{{AccessKeyId}}
{{SecretAccessKey}}
us-east-1
execute-api
{{SessionToken}}
Headers:
Authorization
X-Amz-Date
X-Amz-Security-Token
Postman-Token
Host
User-Agent
Accept
Accept-Encoding
Connection
x-amz-access-token
Thanks in advance
I'm also getting a 403 error on this endpoint and I am in North America (US).
Same problem for NA
Japanもです...😭
Not released in Japan. 日本ではリリースされていません。
Problem still present in Europe:
{
code: 'Unauthorized',
details: '',
type: 'error'
}
I am getting the same error for UK marketplace. Is there anyone who get this endpoint working?
looks like they added the regional disclaimer back: https://github.com/amzn/selling-partner-api-docs/commit/1db11640e9414e0604c5513c16a516dd891396a7
@elrok1234 - Did you manage to get this endpoint working for the North America region?
I'm getting the 403 error even in the North America region (on Sandbox).
The same token, signing approach etc - works perfectly for the getOrders endpoint
Problem still present in Europe:
{ code: 'Unauthorized', details: '', type: 'error' } opened new case, waiting answer
@kdursun have you received an answer from amazon support??
Has Amazon given a date as to when this might be available in the EU?
Hi there, I have the same problem (eu marketplace). Do you guys have found another way to get seller's products informations ? Thanks !
I've contacted Amazon developer support on this, and they have confirmed that the endpoint is still only available in North America. They could not give an ETA of when it will be available in Europe, only that I should monitor the changelog on their new documentation site.
That's strange, because I'm able to get some data from Europe using this endpoint -- it's just not fully consistent. If I specify the UK marketplace ID, I seem to get back cumulative data for all the European marketplaces. If I specify a non-UK marketplace ID, I seem to get back cumulative data for all the European marketplaces except the UK. If someone from Amazon could confirm what's actually going on here, that would be much appreciated.
cc @parvathm @ShivikaK
Hi @jlevers @stokebob,
FBA Inventory API is available globally. Can you please test again and let us know if you are able to call the resource successfully? If the issue persists, please open a support case and let us know the case ID.
Best, Rugved Solutions Architect, SP API
Can confirm this is now working for EU.
Still not working for me (EU, Italy):
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "",
"type": "error"
}
@Xfox1 and others that are getting error "403 - Unauthorized", did you add "Product Listing" role to your application and re-authorized subject account?
Can someone here write an example of how to do the request to this endpoint in NodeJs? I've been trying to access to this endpoint but I have the following error:
CustomError: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been'GET/fba/inventory/v1/summariesDetails=true&MarketplaceIds=A1RKKUPIHCS9HS&granularityId=A1RKKUPIHCS9HS&granularityType=Marketplacehost:sellingpartnerapi-eu.amazon.comuser-agent:amazon-sp-api/0.7.9 (Language=Node.js/v12.18.3; Platform=Linux/4.4.0-19041-Microsoft)x-amz-access-token:<hashed-value>
The String-to-Sign should have been'AWS4-HMAC-SHA25620220802T192536Z20220802/eu-west-1/execute-api/aws4_request<hashed-value>'
My code is the following using amazon-sp-api on node:
let sellingPartner = new SellingPartnerAPI({
region:'eu',
refresh_token: '<my_refresh_token>',
credentials:{
SELLING_PARTNER_APP_CLIENT_ID: "<MY_SELLING_PARTNER_APP_CLIENT_ID>",
SELLING_PARTNER_APP_CLIENT_SECRET: "<MY_SELLING_PARTNER_APP_CLIENT_SECRET>",
AWS_ACCESS_KEY_ID: "<MY_AWS_ACCESS_KEY_ID>",
AWS_SECRET_ACCESS_KEY: "<MY_AWS_SECRET_ACCESS_KEY>",
AWS_SELLING_PARTNER_ROLE: "<MY_AWS_SELLING_PARTNER_ROLE>",
}
})
let loadRequest = await sellingPartner.callAPI({
operation:'getInventorySummaries',
endpoint: 'fbaInventory',
query: {
Details: true,
MarketplaceIds: ['A1RKKUPIHCS9HS'],
granularityType: "Marketplace",
granularityId: 'A1RKKUPIHCS9HS'
}
});
Please, I don't know how to solve the error
@raimundosilvac did you manage to resolve this in the end?
@nothinman yes i could!
@nothinman yes i could!
Do you happen to remember what the issue was / how did you resolve it? Been struggling for two days...
is any one else having authorization issues with this endpoint (res status code 403)? I am using the sellingpartnerapi-eu.amazon.com host I'm passing authorization on all the other end points i have used so far, so just a bit strange