Maxim
Maxim

Reputation: 619

Restricted Data Token (RDT) for self-authorized app

I'm trying to retrieve order data from an express.js backend using the Amazon sp-api. I also need address data, customization data etc, which requires me to get a Restricted Data Token (RDT). On the app registration page I selected all types of information that the app should get access to:

enter image description here

But when I try to retrieve the token, I'm getting this error:

Amazon SP API Error: CustomError: Application does not have access to one or more requested data elements: [buyerInfo, buyerCustomizedInfo, shippingAddress]

I tried many different values, but it doesn't work. Here's how I make the call:

      const rdt = await spApi.callAPI({
        operation: 'createRestrictedDataToken',
        endpoint: 'tokens',
        body: {
            restrictedResources: [
                {
                    method: 'GET',
                    path: '/orders/v0/orders',
                    dataElements: ['shippingAddress']
                }
            ]
        }
    });

I can only retrieve basic data now, but the RDT thing doesn't work. Does anyone have experience with this?

Upvotes: 0

Views: 65

Answers (0)

Related Questions