amzn / selling-partner-api-docs

This repository contains documentation for developers to use to call Selling Partner APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] [SP-API] [Cant Access "Product Pricing API v2022-05-01"]

kirislaw opened this issue · comments

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

SP-API Name and Version or Report/Feed Type

Expected Behavior

The API Should Respond with an Object with all prices

Current Behavior

Im a Public Developer and i have an Aplication that checks prices fro my client, my app is in darf Status, and my clients are arpoving "pricing" and "Product Listing" via the Web Authorisation Workflow. My Aplication gets the Access token without any problems before doing the request. When the Aplication tries to do the "Retrieve a list of featured offers for a batch of up to 20 ASINs" request it gets
"{'errors': [{'code': 'Unauthorized', 'message': 'Access to requested resource is denied.', 'details': ''}]}" Ive tried it with the Same Roles with my account and it worked.

Context/Screenshots

On The Documentation is Written, that you need only these Roles
image
https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide
Ive Followed all steps, and when i authorize my Account With my Aplication it works fine, only With Customer Accounts it doesnt works

This is my current code

url = f"{endpoint}/batches/products/pricing/2022-05-01/items/competitiveSummary"

    headers = {
        "Content-Type": "application/json",
        'x-amz-access-token': access_token
    }

    data = {"requests": []}

    for asin in product_info:
        request_data = {
            "asin": f"{asin[0]}",
            "marketplaceId": f"{marketplace_id}",
            "includedData": [
                "featuredBuyingOptions"
            ],
            "uri": "/products/pricing/2022-05-01/items/competitiveSummary",
            "method": "GET"
        }

        data["requests"].append(request_data)

    responses = requests.post(url, json=data, headers=headers)
    data = responses.json()

Your Environment

I Discorvered this Bug on My Local Windows Machine