Amazon Restricted Data Token Incorporation
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Date | Version | Name | Applied changes |
---|---|---|---|
21.11.2023 | 1.0 | Bogomil Pavlov | First Publish |
Amazon recently announced that they are introducing Tokens API which takes care of the PII (Personally Identifiable Information). The whole idea behind it is that we will have to request additional Restricted Data Token (RDT) which works the same way as the current access token for Get Orders and Get Order Items request using the Tokens API which will allow us to get the PII info.
Get Tokens
API Call: POST https://sellingpartnerapi-eu.amazon.com/tokens/2021-03-01/restrictedDataToken
Sample Request: POST https://sellingpartnerapi-eu.amazon.com/tokens/2021-03-01/restrictedDataToken Body:
{
"restrictedResources": [
{
"method": "GET",
"path": "/orders/v0/orders",
"dataElements": ["buyerInfo", "shippingAddress", "buyerTaxInformation"]
},
{
"method": "GET",
"path": "/orders/v0/orders/204-5559961-9188354/orderItems",
"dataElements": [""]
},
{
"method": "GET",
"path": "/orders/v0/orders/204-5559961-9188355/orderItems",
"dataElements": [""]
},
{
"method": "GET",
"path": "/orders/v0/orders/204-5559961-9188356/orderItems",
"dataElements": [""]
}
]
}
In the body basically we are specifying for which request we would like to obtain the Restricted Data Token (RDT) and we have the following options:
"path": "/orders/v0/orders"
- This will generate Restricted Data Token (RDT) which will allow us to get the PII info for all orders.
"path": "/orders/v0/orders/123-1234567-1234567"
- This will generate a Restricted Data Token (RDT) which will allow us to get the PII info for 123-1234567-1234567
order.
"path": "/orders/v0/orders/204-5559961-9188354/orderItems"
- This will generate a Restricted Data Token (RDT) which will allow us to get the PII info from the order items for204-5559961-9188354
order.
We can have up to 50 different restrictedResources
which means we can specify 50 paths in each request.
We have to be careful with the paths because for each order we have to specify separate path in order to get the order items.
Sample Response: Status 200 OK
{
"expiresIn": 3600,
"restrictedDataToken": "Atz.sprdt|AYABeCKFkO+Obu6AD13a8lvWn1UAAAABAAdhd3Mta21zAEthcm46YXdzOmttczpldS13ZXN0LTE6NTM2MDA0NjQ5NjEwOmtleS9mODY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/B7HEsoDCxvkUHs2BkGrtszFF901kRwZ1xdCkAh6rRXjUL56XYydKleJfT41mTA+H0oedtgfu8epKYFgaOukAgXN9UoI5yX1+BcxPZGWMcL4twW6IR13Py81mo8YboJeuUdpQCbtLfhYz6vA5s8jrxkUqTRJsQLZk7uaTxTiEH+fNZQ90XkiO1Zffr/KBb162gOthpWDSXIIfeS3Gj72u422RlF"
}
We want to store the restrictedDataToken
in the cache as the access token with expiration time of 1 hour.
Overall for Get Orders and Get Order Items requests we want to use the Restricted Data Token (RDT) instead for the standard LWA access token.