- 15 Aug 2024
- 2 Minutes to read
- Print
- DarkLight
- PDF
Amazon Selling Partner - Reports
- Updated on 15 Aug 2024
- 2 Minutes to read
- Print
- DarkLight
- PDF
Amazon Selling Partner - Reports API
Authorization and Authentication
For a walkthrough on what steps are required before starting the configuration of the Amazon Selling Partner - Reports API Flex Connector, please see the Before You Start section of the Amazon Selling Partner home page.
Any instance where an entry in the below configuration has a leading $ represents a parameter that needs to be replaced with a static value.
Parameters in this document:
- $client_id, $client_secret and $refresh_token - The Client ID, Client Secret, and Refresh Token will be used to authenticate calls to the Amazon Selling Partner API. These values are all obtained as part of the Authorization and Authentication steps of developing your Amazon application for API access. These three parameters should be available to you in the Developer Console upon completion of the steps outlined in the Before You Start section of the Amazon Selling Partner home page.
- $marketplace_ids - The Marketplace IDs represent the market(s) for which data is being pulled from the API. For a list of valid Marketplace ID's, visit here. Note that this can be a list of multiple Marketplace IDs, or just a single value, depending on the use case. When entering multiple values, they should be entered as a comma separated list (e.g.
A2EUQ1WTGCTBG2,ATVPDKIKX0DER
). - $report_type - The Report Type represents the Amazon Selling Partner report that is being ingested. Values for this parameter can be found here, with the following links going directly to each sub-section of report types:
- Analytics Reports
- Inventory Report Type Values
- Order Report Type Values
- Returns Report Type Values
- Performance Report Type Values
- Settlement Report Type Values
- Fulfillment by Amazon (FBA) Report Type Values
- Tax Report Type Values
- Invoice Data Report Type Values
- Browse Tree Report Type Values
- Easy Ship Report Type Values
- Amazon Business Report Type Values
- B2B Product Opportunities Report Type Values
- Regulatory Compliance Report Type Values
- $incremental_starting_value - The Incremental Starting Value represents the earliest date that data should be collected for, given in
yyyy-mm-DD
format. For example, if you would like your historical data to go back to the start of 2021, this value would be set to2021-01-01
.
Connector configuration
- Base url: https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/documents/{identifier}
- Method: GET
Destination table naming convention is ultimately up to you as the data owner. We recommend using a naming convention that clearly describes the report being ingested. For example, when collecting the FBA Amazon Fulfilled Inventory Report, using such a table name as amazon_fba_fulfilled_inventory_report
.
Variables
- Variables
Variable name | Variable value |
---|---|
marketplace_ids | $marketplace_ids |
- Secured Variables:
Variable name | Variable value |
---|---|
client_id | $client_id |
client_secret | $client_secret |
refresh_token | $refresh_token |
Refresh access token
- Enable:
- URL: https://api.amazon.com/auth/o2/token
- Method: POST
- POST data: {"grant_type":"refresh_token", "client_id":"{client_id}", "client_secret":"{client_secret}"}
- Headers: {"Content-Type":"application/x-www-form-urlencoded"}
- Refresh token: {refresh_token}
- Access token response key: access_token
- Access Token header key: x-amz-access-token
- Error status codes: 401; 403
Fetch list
- Enable:
- Fetch List From: API
- Fetch url: https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports
- Method: GET
- URL Parameters: reportTypes=$report_type&MarketplaceIds={marketplace_ids}&pageSize=100&createdSince=<<date_format(date_add({incval}, 'days', -1), '%Y-%m-%d')>>
- Data key: reports
- Data identifier key: reportDocumentId
- Use identifiers: As single value
Advanced Settings
- Downloadable link:
- URL key: url
- Files Encoding: Windows-1252
The Primary Key represents the unique identifier for a given report, plus the field __file_base_name
as this will ensure that each file is treated as part of the uniqueness check. For example, when ingesting the FBA Amazon Fulfilled Inventory Report, the Primary Key is {__file_base_name}-{seller-sku}
.
- Incremental Key:
Column name Column value lastTimeSucceed $incremental_starting_value
When entering a column value to the incremental key feature, you will need to use the following format: yyyy-mm-DD