amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
608 stars 731 forks source link

[BUG] [SP-API] Create subscription return 403 Unauthorized - Access to requested resource is denied. #435

Closed lpongetti closed 5 months ago

lpongetti commented 1 year ago

I successfully created the destination and event bridge, but when I run the subscription creation it returns 403:

{
  "errors": [
    {
      "code": "Unauthorized",
      "message": "Access to requested resource is denied.",
      "details": ""
    }
  ]
}

I'm tring to create LISTINGS_ITEM_STATUS_CHANGE subscription. I have the "Product Listing" role.

the request: POST https://sellingpartnerapi-eu.amazon.com/notifications/v1/subscriptions/LISTINGS_ITEM_STATUS_CHANGE {"payloadVersion":"1.0","destinationId":"0b9a0dec-b8bf-4d6f-9f85-fbb0af514566"}

i tried also this request with the same error: GET https://sellingpartnerapi-eu.amazon.com/notifications/v1/subscriptions/LISTINGS_ITEM_STATUS_CHANGE

Catalog item and listings request works perfectly.

There are other issue related but no one found a reason https://github.com/amzn/selling-partner-api-models/issues/1001

kratoskat commented 1 year ago

I'm having the same issue. i have all roles to my dev profile but i am getting a 403 for createSubscription :/ Any help is appreciated

kratoskat commented 1 year ago

Hello, this is still happening and help is needed. I've also opened a support case with Amazon but getting nowhere.

Where in the docs does it say that i need a specific role for createSubscription? Also i created a Dev Profile, i am shown 4 roles instead of this long list here https://developer-docs.amazon.com/sp-api/docs/roles-in-the-selling-partner-api

Either way i have all 4 of them ticked and still no access with a blank error message

@lpongetti did you get anywhere?

lpongetti commented 11 months ago

no :cry:

nogamike76 commented 11 months ago

Hi

May God guide us and may we all, including myself find happiness, love and forgiveness. Be kind to someone, help someone with something that would help them. Make sure you tel your family you love them. May the kings be protected and may our King, Jesus Christ, always be the divine and glory, in honor of our father, the almighty one, God. Spirit Leader Michael Noga jr. Descendant of King David Nogah, son of David T8<3 $€£¥

On Tue, Dec 5, 2023 at 1:42 PM Lorenzo Pongetti @.***> wrote:

no 😢

— Reply to this email directly, view it on GitHub https://github.com/amzn/selling-partner-api-models/issues/435, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQXNDFPG645UV3OS6OU5PM3YH6BL5AVCNFSM6AAAAAAYTYVJD2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBRGU4DCMBSGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

YAssineAbGit commented 9 months ago

I am having the same issue, has this been resolved?

yatanasov commented 9 months ago

Any updates on this?

YAssineAbGit commented 9 months ago

I think you just need to make sure to use the correct operation, as createSubscription requires a refresh token. createSubscription requires selling partner authorization. Auth grantless operations

yatanasov commented 9 months ago

That is exactly what I am doing - grantless authorization (with the notifications scope) to create the destination and refresh-token based authorization to create the subscription, but I am getting the error.

yatanasov commented 9 months ago

I just discovered that I was able to create subscriptions for the following types ONLY:

But I need LISTINGS_ITEM_STATUS_CHANGE .. which is not working.

YAssineAbGit commented 9 months ago

I managed to create subscription for both LISTINGS_ITEM_ISSUES_CHANGE and LISTINGS_ITEM_STATUS_CHANGE, What error do you get?

yatanasov commented 9 months ago
{
    "errors": [
        {
            "code": "Unauthorized",
            "message": "Access to requested resource is denied.",
            "details": ""
        }
    ]
}

as mentioned before, it works okay (with same credentials and request) for: LISTINGS_ITEM_ISSUES_CHANGE PRODUCT_TYPE_DEFINITIONS_CHANGE

Thank you for checking!

YAssineAbGit commented 9 months ago

I could only think of recreating the access token for that specific Notification type. And also check the notification types you've got using getSubscriptions before you recreate them again.

yatanasov commented 9 months ago

Thanks - I think, it might be related to this: https://github.com/amzn/selling-partner-api-models/issues/3020

shreeharsh-a commented 5 months ago

Please reach out to developer support so that we can better help you with issues related to SP API.

Note: SP API or docs related issues / troubleshooting support is managed by a different team. We can help if the issue is related to the content published on this repo.