Hello <@U04S8PLJWMT>, I have a Airbyte Amazon Sel...
# ask-ai
p
Hello @kapa.ai, I have a Airbyte Amazon Seller Partner connection and I am fetching the 'GET_SALES_AND_TRAFFIC_REPORT' stream. Here, how can I refresh last 7 days of data in daily sync as to handle attribution affecting sales values?
k
To refresh the last 7 days of data for the 'GET_SALES_AND_TRAFFIC_REPORT' stream in your Amazon Seller Partner connection, you can use Airbyte's "Report Options" feature. This allows you to configure a lookback window for your reports. Here's how you can set it up: 1. In your Amazon Seller Partner source configuration, locate the "Report Options" section. 2. For the 'GET_SALES_AND_TRAFFIC_REPORT' stream, you can set the "reportPeriod" option to "DAY" and specify a lookback period of 7 days. This configuration will ensure that each daily sync refreshes the data for the last 7 days, helping to handle attribution affecting sales values. Additionally, you can enable the "Wait between requests to avoid fatal statuses in reports" option to improve the reliability of your syncs. For more detailed information on configuring these options, you can refer to the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#amazon-seller-partner). It's worth noting that as of version 4.2.0 of the Amazon Seller Partner connector, there have been several updates and improvements to the connector. Make sure you're using the latest version to take advantage of these enhancements. If you need more specific guidance or encounter any issues, I recommend checking the Airbyte documentation or reaching out to Airbyte support for personalized assistance.
p
Hello @kapa.ai I got the option as Report Options Report Name- entered as GET_SALES_AND_TRAFFIC_REPORT Stream Name- entered as GET_SALES_AND_TRAFFIC_REPORT List of options Name Value Where to set the "reportPeriod" option to "DAY" and specify a lookback period of 7 days.
k
A message from kapa.ai
To set the "reportPeriod" option to "DAY" and specify a lookback period of 7 days for the GET_SALES_AND_TRAFFIC_REPORT stream, you need to add two options to the "List of options" in the Report Options section. Here's how you should configure it: 1. First option: - Name: reportPeriod - Value: DAY 2. Second option: - Name: dataStartTime - Value: -7 days The "reportPeriod" option sets the granularity of the report to daily, and the "dataStartTime" option tells the API to fetch data starting from 7 days ago. This configuration is based on the information provided in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#report-options). The documentation states that you can specify report options for each stream using the Report Options section, and the available options can be found in the corresponding category in Amazon's documentation. Please note that the exact field names and options might vary slightly depending on the version of the connector you're using. If you encounter any issues or if these exact option names don't work, I recommend checking the latest documentation or reaching out to Airbyte support for the most up-to-date configuration details.
p
Hi @kapa.ai, In this case what will be my Start Date and End Date
k
A message from kapa.ai
Based on the information provided in the knowledge sources and our previous conversation, I can provide guidance on setting the Start Date and End Date for your Amazon Seller Partner connection: 1. Start Date: You don't need to set a specific Start Date in this case. The "dataStartTime" option you've set to "-7 days" in the Report Options will effectively act as a rolling 7-day lookback window. This means that regardless of the Start Date you set in the main configuration, the report will always fetch data for the last 7 days. 2. End Date: You can leave the End Date blank. According to the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), if the End Date is not provided, the current date will be used by default. This configuration will ensure that each sync refreshes the data for the last 7 days, up to the current date, which aligns with your goal of handling attribution affecting sales values. However, it's important to note that if you want to have historical data beyond the 7-day window, you might want to set a Start Date that covers your desired historical range. The 7-day lookback will still apply for each sync, but you'll have data going back to your specified Start Date. If you need any further clarification or have additional questions, please feel free to ask.
p
@kapa.ai , what does Period In Days option do?
k
A message from kapa.ai
The "Period In Days" option in the Amazon Seller Partner source connector is used to specify the time range for data retrieval in incremental syncs. Here's what it does: According to the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), the "Period In Days" is an integer field that determines the number of days to look back for data during each incremental sync. This option is particularly useful for certain report streams. For example: 1. For the
GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL
stream, the maximum allowable value is 30 days. 2. For the
GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL
stream, the maximum is also 30 days. 3. For the
GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE
stream, the maximum is 60 days. If you set a "Period In Days" value that exceeds these limits for these specific streams, it will be automatically adjusted to the maximum allowed value. For other streams, if not provided or if it exceeds the limit, it will default to 365 days. It's important to note that this option helps in managing the amount of data retrieved in each sync, which can be useful for optimizing performance and avoiding potential API limitations. Remember, this is different from the "dataStartTime" option we discussed earlier, which is set in the Report Options for specific streams. The "Period In Days" is a global setting for the connector that applies to incremental syncs across all applicable streams.
p
@kapa.ai, What should that be in case of To set the "reportPeriod" option to "DAY" and specify a lookback period of 7 days for the GET_SALES_AND_TRAFFIC_REPORT stream, you need to add two options to the "List of options" in the Report Options section. Here's how you should configure it: 1. First option: - Name: reportPeriod - Value: DAY 2. Second option: - Name: dataStartTime - Value: -7 days The "reportPeriod" option sets the granularity of the report to daily, and the "dataStartTime" option tells the API to fetch data starting from 7 days ago.
k
A message from kapa.ai
Based on the configuration you've described for the GET_SALES_AND_TRAFFIC_REPORT stream, the "Period In Days" setting should be set to 7 days to align with your lookback period. Here's why: 1. You've set the "reportPeriod" option to "DAY", which means you're requesting daily granularity for your report data. 2. You've also set the "dataStartTime" to "-7 days", which indicates you want to fetch data starting from 7 days ago. To ensure consistency with these Report Options, you should set the global "Period In Days" option to 7. This will tell the connector to look back 7 days for each incremental sync, which matches your configuration for the GET_SALES_AND_TRAFFIC_REPORT stream. However, it's important to note that the "Period In Days" setting is a global configuration that applies to all streams in the connector, while the Report Options you've set are specific to the GET_SALES_AND_TRAFFIC_REPORT stream. According to the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), if the specified "Period In Days" exceeds the limit for certain streams, it will be automatically adjusted. For most streams, if not provided or if it exceeds the limit, it will default to 365 days. In your case, setting "Period In Days" to 7 should work well with your specific configuration for the GET_SALES_AND_TRAFFIC_REPORT stream, ensuring that each sync fetches the last 7 days of data as you intended. Remember, the interaction between global settings and stream-specific options can be complex. If you encounter any unexpected behavior, it may be helpful to consult the latest Airbyte documentation or reach out to Airbyte support for more detailed guidance.
p
@kapa.ai, what should be the sync type then?
k
A message from kapa.ai
Based on the configuration you've described for the GET_SALES_AND_TRAFFIC_REPORT stream and the information available in the knowledge sources, the appropriate sync type for your use case should be "Incremental". Here's why: 1. You've set up a 7-day lookback period for your data, which suggests you want to regularly update recent data. 2. The GET_SALES_AND_TRAFFIC_REPORT stream supports incremental sync mode, as indicated in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#supported-streams). The documentation lists this stream as "Incremental" under the "Sync" column. 3. Incremental sync is ideal for regularly updating data that changes over time, which aligns with your goal of refreshing the last 7 days of data to handle attribution affecting sales values. By using incremental sync: - Each sync will only fetch the data for the last 7 days, as per your configuration. - It will update existing records and add new ones within this 7-day window. - This approach is more efficient than full refresh, especially for large datasets, as it only processes the necessary data. Remember, the incremental sync behavior works in conjunction with your "Period In Days" setting and the stream-specific Report Options you've configured. This setup should ensure that you're always working with the most up-to-date data for the last 7 days, while also maintaining historical data beyond that window. If you need to make any changes or have further questions about the sync configuration, please feel free to ask.
p
@kapa.ai Should it be Full Refresh Overwrite or any other
k
A message from kapa.ai
Based on your specific use case and the configuration you've set up for the GET_SALES_AND_TRAFFIC_REPORT stream, I would not recommend using Full Refresh Overwrite. Instead, the most appropriate sync mode for your scenario is Incremental Sync - Append + Deduped. Here's why: 1. Your goal is to refresh the last 7 days of data in daily sync to handle attribution affecting sales values. This is best achieved through an incremental approach. 2. The Amazon Seller Partner source connector supports various sync modes, including Incremental Sync - Append + Deduped, as mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#supported-sync-modes). 3. Incremental Sync - Append + Deduped will allow you to: - Update the most recent 7 days of data with each sync - Append new data to your existing dataset - Deduplicate records to ensure data accuracy 4. Full Refresh Overwrite, on the other hand, would replace all existing data in your destination with the data from the current sync. This could potentially lead to data loss, especially for historical data beyond your 7-day lookback period. 5. Your configuration with "reportPeriod" set to "DAY" and "dataStartTime" set to "-7 days" is designed to work well with an incremental sync approach. By using Incremental Sync - Append + Deduped, you'll ensure that your dataset always contains the most up-to-date information for the last 7 days, while also maintaining historical data. This approach aligns with your goal of handling attribution affecting sales values and is more efficient than a full refresh for your use case. If you need to make any adjustments or have more questions about this sync mode, please feel free to ask.
p
what will be the primary key then @kapa.ai
k
A message from kapa.ai
To determine the primary key for the GET_SALES_AND_TRAFFIC_REPORT stream in the Amazon Seller Partner connector, we need to consider the structure of the data provided by this report. However, the knowledge sources provided don't contain specific information about the primary key for this particular stream. In general, for Incremental Sync - Append + Deduped mode, a primary key is required to perform deduplication. The primary key should be a field or combination of fields that uniquely identifies each record. For the GET_SALES_AND_TRAFFIC_REPORT, a logical primary key might be a combination of the date and any other unique identifier provided in the report. However, without specific documentation on the structure of this report, I can't definitively state what the primary key should be. Given this limitation, I recommend the following steps: 1. Examine the structure of the GET_SALES_AND_TRAFFIC_REPORT data to identify fields that could serve as a unique identifier for each record. 2. If you're unsure, you may need to reach out to Airbyte support or consult the Amazon Seller Partner API documentation for more detailed information about the structure of this specific report. 3. If you're using Airbyte Cloud, the UI might provide suggestions for the primary key when you're setting up the connection. As stated in the [Airbyte documentation on Incremental Sync - Append + Deduped](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#user-defined-primary-key), "Some sources cannot define the primary key without user input or the user may want to specify their own primary key on the destination that is different from the source definition. In these cases, select the field in the stream that should be used as the 'primary key'." If you're unable to determine a suitable primary key, you might need to consider using a different sync mode, such as Incremental - Append, which doesn't require a primary key for deduplication. However, this would mean you'd need to handle deduplication in your destination if required. I apologize that I can't provide a more definitive answer, but the specific structure of the GET_SALES_AND_TRAFFIC_REPORT is not detailed in the provided knowledge sources.
p
@kapa.ai, I want to have queryEndDate and parentAsin
k
A message from kapa.ai
Based on your request to have "queryEndDate" and "parentAsin" as part of your configuration for the GET_SALES_AND_TRAFFIC_REPORT stream, I can provide some guidance on how to set this up: 1. For the "queryEndDate": This parameter is already part of the stream's output, as seen in the sample data provided in one of the GitHub issues [Link](https://github.com/airbytehq/airbyte/issues/39319). You don't need to add it as a separate option in the Report Options. It will be included in the data automatically. 2. For the "parentAsin": The Amazon Seller Partner API doesn't have a specific option to filter by "parentAsin" for the GET_SALES_AND_TRAFFIC_REPORT. This field is typically part of the report's output, not an input parameter. However, if you want to ensure these fields are included in your sync, you can use Airbyte's field selection feature. Here's how you can do it: 1. In your connection settings, go to the "Mappings" section. 2. Select the GET_SALES_AND_TRAFFIC_REPORT stream. 3. In the field selection, make sure "queryEndDate" and "parentAsin" are included in the list of fields to sync. You can follow the steps outlined in the [Airbyte documentation on creating a new mapping](https://docs.airbyte.com/using-airbyte/mappings#create-a-new-mapping) to set this up. Remember, the exact field names might vary slightly depending on the API version and connector version you're using. If you don't see these exact field names, look for similar ones that represent the query end date and parent ASIN. Also, keep in mind that using these fields as a primary key (as we discussed in the previous interaction) might not be suitable, as they may not uniquely identify each record. You'll need to consider other fields or combinations of fields that can serve as a unique identifier for each record in the report. If you need further assistance or clarification, please don't hesitate to ask.
p
@kapa.ai, getting an error as Response Code: 429, Response Text: { "error": [ { "code": "QuotaExceeded", "message": "You exceeded your quota for the requested resource.", "details": ""
k
A message from kapa.ai
This error you're encountering is related to rate limiting in the Amazon Seller Partner API. Let me explain the issue and provide some potential solutions based on the information from our knowledge sources. The error message "QuotaExceeded" with a 429 response code indicates that you've exceeded the API rate limits set by Amazon for the Seller Partner API. This is a common issue when dealing with APIs that have strict usage quotas. Here are some steps you can take to address this issue: 1. Implement backoff strategy: Airbyte has a built-in feature to handle rate limiting. You can enable this in your source configuration. As mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#limitations--troubleshooting): - Go to the Set Up page of the connector. - Open the optional section. - Enable the "Wait between requests to avoid fatal statuses in reports" toggle. This will introduce a waiting period between requests to avoid hitting the rate limits. 2. Adjust sync frequency: If you're running syncs too frequently, you might be hitting the API limits. Consider reducing the frequency of your syncs to stay within the quota. 3. Use separate connections: As suggested in the documentation, you can create separate connections for streams that frequently hit rate limits. This allows you to manage the sync schedules for these streams independently. 4. Check your API quota: Review your Amazon Seller Partner API quota to ensure you haven't exceeded your daily or hourly limits. You may need to contact Amazon to increase your quota if necessary. 5. Implement error handling: If you're using a custom implementation, you can add error handling for 429 responses. This involves catching the error and implementing a backoff strategy, waiting for a period before retrying the request. Remember, these rate limits are imposed by Amazon to ensure fair usage of their API across all users. If you consistently hit these limits, you may need to optimize your data fetching strategy or consider requesting an increased quota from Amazon. For more detailed information on rate limits, you can refer to the [Amazon Seller Partner API documentation on Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api), as mentioned in one of the forum posts. If you continue to face issues after implementing these suggestions, you may want to reach out to Airbyte support for more personalized assistance with your specific setup.
p
@kapa.ai, What will happen if i use, StartDate- null EndDate- null Period In Days" = 7. - Name: reportPeriod - Value: DAY - Name: dataStartTime - Value: -7 days and sync mode as Incremental Sync - Append + Deduped
k
A message from kapa.ai
Based on your configuration and the information from our knowledge sources, here's what will happen with the settings you've described: 1. Start Date and End Date set to null: When you set both Start Date and End Date to null, the connector will use default behaviors. According to the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), if the End Date is not provided (null in this case), the current date will be used by default. For the Start Date, the connector will likely use the default behavior, which is typically to start from the earliest available data. 2. Period In Days set to 7: This setting tells the connector to look back 7 days for data during each incremental sync. It aligns with your previous configuration of setting "dataStartTime" to "-7 days" in the Report Options. 3. Sync mode as Incremental Sync - Append + Deduped: With this sync mode, here's what will happen: - The connector will fetch data for the last 7 days during each sync, as specified by your "Period In Days" setting. - New records will be appended to your destination. - The connector will deduplicate records based on the primary key you've set (which you mentioned earlier as potentially being "queryEndDate" and "parentAsin"). - Each sync will update the existing records within the 7-day window and add any new records. As described in the [Airbyte documentation on Incremental Sync - Append + Deduped](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#rules), "the delta from a sync will be appended to the existing history data in the data warehouse. In addition, it will update the associated record in the final table." This configuration should effectively refresh your data for the last 7 days with each sync, while maintaining historical data beyond that window. It will help handle attribution affecting sales values, as you initially intended. However, keep in mind two important points: 1. Ensure that "queryEndDate" and "parentAsin" truly form a unique identifier for each record. If they don't, you might need to adjust your primary key to avoid data inconsistencies. 2. Be aware of the rate limiting issues you encountered earlier. Make sure you have enabled the "Wait between requests to avoid fatal statuses in reports" option in your connector settings to help manage API quotas. If you need any further clarification or have additional questions, please feel free to ask.
A message from kapa.ai
Based on the configuration you've described, here's what will happen when you use these settings for your Amazon Seller Partner connection, specifically for the GET_SALES_AND_TRAFFIC_REPORT stream: 1. Start Date and End Date set to null: As mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), when the End Date is null, the current date will be used by default. For the Start Date, the connector will likely use the earliest available data. 2. Period In Days set to 7: This global setting tells the connector to look back 7 days for data during each incremental sync. 3. Report Options: - reportPeriod: DAY - dataStartTime: -7 days These stream-specific options align with your global "Period In Days" setting. They instruct the connector to fetch daily data for the last 7 days. 4. Sync mode as Incremental Sync - Append + Deduped: This mode will work as follows: - Each sync will fetch data for the last 7 days, as specified by both your global and stream-specific settings. - New records will be appended to your destination. - The connector will deduplicate records based on the primary key you've set. - Existing records within the 7-day window will be updated, and new records will be added. The combination of these settings means that: 1. Your sync will always fetch the most recent 7 days of data, regardless of when the sync runs. 2. The data will be at a daily granularity due to the "reportPeriod" setting. 3. Each sync will update the last 7 days of data in your destination, ensuring you have the most up-to-date information for this period. 4. Historical data beyond the 7-day window will be preserved in your destination. This configuration aligns well with your initial goal of refreshing the last 7 days of data in daily sync to handle attribution affecting sales values. However, remember to ensure that you have a proper primary key set up for the deduplication process in the Incremental Sync - Append + Deduped mode. Also, keep in mind the rate limiting issues you encountered earlier and consider enabling the "Wait between requests to avoid fatal statuses in reports" option to manage API quotas. [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference) If you need any clarification or have more questions, please feel free to ask.
p
@kapa.ai, What will happen if i use, StartDate- null EndDate- null Period In Days" = 7. - Name: reportPeriod - Value: DAY - Name: dataStartTime - Value: -7 days and sync mode as Incremental Sync - Append + Deduped
k
A message from kapa.ai
Based on the configuration you've described, here's what will happen when you use these settings for your Amazon Seller Partner connection, specifically for the GET_SALES_AND_TRAFFIC_REPORT stream: 1. Start Date and End Date set to null: As mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), when the End Date is null, the current date will be used by default. For the Start Date, the connector will likely use the earliest available data. 2. Period In Days set to 7: This global setting tells the connector to look back 7 days for data during each incremental sync. 3. Report Options: - reportPeriod: DAY - dataStartTime: -7 days These stream-specific options align with your global "Period In Days" setting. They instruct the connector to fetch daily data for the last 7 days. 4. Sync mode as Incremental Sync - Append + Deduped: This mode will work as follows: - Each sync will fetch data for the last 7 days, as specified by both your global and stream-specific settings. - New records will be appended to your destination. - The connector will deduplicate records based on the primary key you've set. - Existing records within the 7-day window will be updated, and new records will be added. The combination of these settings means that: 1. Your sync will always fetch the most recent 7 days of data, regardless of when the sync runs. 2. The data will be at a daily granularity due to the "reportPeriod" setting. 3. Each sync will update the last 7 days of data in your destination, ensuring you have the most up-to-date information for this period. 4. Historical data beyond the 7-day window will be preserved in your destination. This configuration aligns well with your initial goal of refreshing the last 7 days of data in daily sync to handle attribution affecting sales values. However, remember to ensure that you have a proper primary key set up for the deduplication process in the Incremental Sync - Append + Deduped mode. Also, keep in mind the rate limiting issues you encountered earlier and consider enabling the "Wait between requests to avoid fatal statuses in reports" option to manage API quotas. If you need any clarification or have more questions, please feel free to ask.
p
WHAT SHOULD BE THE PRIMARY KEY @kapa.ai
k
A message from kapa.ai
Based on the information provided in the knowledge sources and our previous conversation, I cannot definitively state what the primary key should be for the GET_SALES_AND_TRAFFIC_REPORT stream in the Amazon Seller Partner connector. The specific structure of this report is not detailed in the provided knowledge sources. However, I can provide some guidance on how to approach this: 1. Primary Key Requirement: As mentioned in the [Airbyte documentation on Incremental Sync - Append + Deduped](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#user-defined-primary-key), "Some sources cannot define the primary key without user input or the user may want to specify their own primary key on the destination that is different from the source definition. In these cases, select the field in the stream that should be used as the 'primary key'." 2. Potential Fields: In our previous conversation, you mentioned wanting to use "queryEndDate" and "parentAsin". These could potentially be part of your primary key, but it's important to ensure that the combination of fields you choose uniquely identifies each record. 3. Composite Primary Key: You might need to use a composite primary key. As stated in the documentation, "Multiple primary keys can also be selected to form a 'composite primary key'." 4. Examining the Data: The best approach would be to examine the structure of the GET_SALES_AND_TRAFFIC_REPORT data to identify fields that could serve as a unique identifier for each record. Look for fields that, when combined, will always be unique for each record. 5. Possible Combinations: Depending on the report structure, a combination like "queryEndDate", "parentAsin", and perhaps a specific product identifier or time granularity might form a suitable primary key. Remember, the primary key should be chosen carefully to ensure proper deduplication in the Incremental Sync - Append + Deduped mode. If you're unsure, it might be helpful to consult the Amazon Seller Partner API documentation for more details about the structure of this specific report, or reach out to Airbyte support for guidance tailored to your specific data structure. If you need further assistance in determining the primary key based on your actual data, please provide more details about the structure of the GET_SALES_AND_TRAFFIC_REPORT, and I'll be happy to help you identify suitable fields for the primary key.
p
SHOULD IT BE LIKE 1. First option: - Name: reportPeriod - Value: DAY 2. Second option: - Name: dataStartTime - Value: -7 days OR 1. First option: - Name: reportPeriod - Value: DAY 2. Second option: - Name: dataStartTime - Value: -7 @kapa.ai
k
A message from kapa.ai
Based on the information provided in the knowledge sources and our previous conversation, the correct configuration for the Report Options should be: 1. First option: - Name: reportPeriod - Value: DAY 2. Second option: - Name: dataStartTime - Value: -7 days This is the correct format because: 1. The "reportPeriod" option set to "DAY" is correct, as it specifies that you want daily granularity for your report data. 2. For the "dataStartTime" option, the value should be "-7 days" and not just "-7". This is because the API expects a specific format for time-based parameters. As mentioned in our previous discussions and supported by the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#report-options), this configuration tells the API to fetch daily data starting from 7 days ago. Using "-7" instead of "-7 days" might not be correctly interpreted by the API and could lead to unexpected results or errors. Remember, this configuration, combined with your other settings (Period In Days = 7, Sync mode as Incremental Sync - Append + Deduped), will ensure that each sync refreshes the data for the last 7 days, which aligns with your goal of handling attribution affecting sales values. If you encounter any issues with this configuration or need further clarification, please don't hesitate to ask.
p
Period In Days SHOULD BE? @kapa.ai
k
A message from kapa.ai
Based on your previous configurations and the goal you've described, the "Period In Days" should be set to 7. Here's why: 1. You've configured the Report Options to fetch data for the last 7 days: - Name: dataStartTime - Value: -7 days 2. Your goal is to refresh the last 7 days of data in daily sync to handle attribution affecting sales values. 3. Setting "Period In Days" to 7 aligns with your Report Options and ensures consistency in your data fetching strategy. As mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), the "Period In Days" is an integer field that determines the number of days to look back for data during each incremental sync. By setting "Period In Days" to 7, you're telling the connector to look back 7 days for data during each incremental sync, which matches your configuration in the Report Options and your stated goal. This configuration, combined with your Incremental Sync - Append + Deduped sync mode, will ensure that each sync refreshes the data for the last 7 days, updating existing records and adding new ones within this 7-day window. Remember, this setting works in conjunction with your other configurations to provide the data refresh strategy you're aiming for.
p
@kapa.ai, What will happen if i use, StartDate- null EndDate- null Period In Days = 15. - Name: reportPeriod - Value: DAY - Name: dataStartTime - Value: -15 days and sync mode as Full Refresh Overwrite
k
A message from kapa.ai
Based on the configuration you've described, here's what will happen when you use these settings for your Amazon Seller Partner connection, specifically for the GET_SALES_AND_TRAFFIC_REPORT stream: 1. Start Date and End Date set to null: According to the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#config-fields-reference), when the End Date is null, the current date will be used by default. For the Start Date, the connector will likely use the earliest available data. 2. Period In Days set to 15: This global setting tells the connector to look back 15 days for data during each sync. 3. Report Options: - reportPeriod: DAY - dataStartTime: -15 days These stream-specific options align with your global "Period In Days" setting. They instruct the connector to fetch daily data for the last 15 days. 4. Sync mode as Full Refresh Overwrite: This is where the behavior significantly differs from your previous configuration. According to the [Full Refresh - Overwrite documentation](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/full-refresh-overwrite), this mode will: - Retrieve all available information requested from the source. - Destroy all data in the existing destination table. - Pull the new data in. The combination of these settings means that: 1. Each sync will fetch the most recent 15 days of data, at a daily granularity. 2. All existing data in the destination table will be deleted. 3. The new 15 days of data will be written to the destination, completely replacing any previous data. It's important to note that this configuration will result in losing any historical data beyond the 15-day window in your destination. Each sync will effectively reset your destination data to only the last 15 days. This approach differs significantly from your previous Incremental Sync - Append + Deduped configuration. With Full Refresh Overwrite, you're not maintaining a historical record or updating existing data - you're completely replacing the data each time. If your goal is to always have the most recent 15 days of data and you don't need to maintain historical data beyond this window, then this configuration could work. However, if you need to maintain historical data or if you're concerned about data loss, you might want to reconsider using the Full Refresh Overwrite sync mode. Remember to be cautious when using Full Refresh Overwrite, as stated in the documentation: "We recommend provisioning a dedicated S3 resource for this sync to prevent unexpected data deletion from misconfiguration." [Full Refresh - Overwrite documentation](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/full-refresh-overwrite) If you have any more questions or need clarification, please feel free to ask.
p
@kapa.ai, what happens if i won't give reportPeriod?
k
A message from kapa.ai
If you don't provide the "reportPeriod" option in your Report Options for the GET_SALES_AND_TRAFFIC_REPORT stream, the connector will use a default value. However, the exact behavior isn't explicitly stated in the provided knowledge sources. Based on the available information, here's what we can infer: 1. Default Behavior: The Amazon Seller Partner API likely has a default report period that it uses when one isn't specified. This default could be daily, weekly, or monthly, but without specific documentation, we can't be certain. 2. Potential Issues: Not specifying the "reportPeriod" might lead to inconsistencies with your other settings. For example, you've set "dataStartTime" to "-15 days" and "Period In Days" to 15. Without a specified "reportPeriod", the data granularity might not align with your expectations. 3. Possible Data Discrepancies: If the default "reportPeriod" is different from what you intend (e.g., if it defaults to weekly or monthly instead of daily), you might not get the precise 15-day data you're expecting. 4. API Limitations: Some report types in the Amazon Seller Partner API have specific requirements or limitations for the report period. Without specifying it, you might encounter unexpected behavior or errors. 5. Consistency: For clarity and consistency in your data retrieval, it's generally better to explicitly set all relevant parameters rather than relying on default values. Given these considerations, it's recommended to always specify the "reportPeriod" to ensure you're getting the data granularity you expect. If you're aiming for daily data over the last 15 days, as your other settings suggest, you should include the "reportPeriod" option set to "DAY". If you decide not to include the "reportPeriod" option, you should carefully monitor your initial syncs to ensure the data you're receiving matches your expectations in terms of granularity and date range. For the most accurate information about default behaviors, you might want to consult the Amazon Seller Partner API documentation directly or reach out to Airbyte support for connector-specific details that might not be covered in the general documentation. [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#report-options)
p
@kapa.ai, Should it be on - reportPeriod: DAY Because I have multiple rows for the same querydate in the bq table
k
A message from kapa.ai
Based on your observation of having multiple rows for the same query date in your BigQuery table, setting the "reportPeriod" to "DAY" is indeed the correct approach. Here's why: 1. Data Granularity: Setting "reportPeriod" to "DAY" ensures that you're getting daily granularity in your data. This aligns with your goal of refreshing data daily to handle attribution affecting sales values. 2. Multiple Rows per Day: The fact that you're seeing multiple rows for the same query date is expected and doesn't necessarily indicate an issue with the "reportPeriod" setting. This is because the GET_SALES_AND_TRAFFIC_REPORT likely provides multiple data points per day, possibly for different products, ASINs, or other dimensions. 3. Deduplication: As mentioned in the [Airbyte documentation on Incremental Sync - Append + Deduped](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#inclusive-cursors), "When replicating data incrementally, Airbyte provides an at-least-once delivery guarantee. This means that it is acceptable for sources to re-send some data when ran incrementally." 4. Primary Key Importance: This underscores the importance of choosing the right primary key for deduplication. The primary key should include not just the date, but also other fields that uniquely identify each record within a day (like parentAsin, which you mentioned earlier). 5. Consistency with Other Settings: Keeping "reportPeriod" as "DAY" is consistent with your other settings, such as "dataStartTime: -15 days" and "Period In Days: 15". To address the multiple rows per query date: 1. Ensure you have a proper composite primary key that uniquely identifies each record, even within the same day. 2. If you're using Incremental Sync - Append + Deduped mode, make sure your primary key is correctly set to handle deduplication. 3. If you're using Full Refresh Overwrite mode (as mentioned in a previous interaction), be aware that this mode will replace all data each sync, so multiple rows per day are expected and deduplication is not performed. Remember, having multiple rows per day is not necessarily an issue if each row represents unique data (e.g., different products or metrics). The key is ensuring that your primary key and sync mode are set up to handle this data structure correctly. If you need further assistance in setting up the proper primary key or adjusting your sync settings to handle this data structure, please provide more details about the specific fields in your GET_SALES_AND_TRAFFIC_REPORT data. [Airbyte documentation on Incremental Sync - Append + Deduped](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#inclusive-cursors)
p
@kapa.ai what should be proper composite primary key that uniquely identifies each record?
k
A message from kapa.ai
To determine the proper composite primary key that uniquely identifies each record in the GET_SALES_AND_TRAFFIC_REPORT stream, we need to consider the structure of the data provided by this report. Based on our previous discussions and the information available, I can provide some guidance, but please note that the exact fields may vary depending on the specific structure of your report. A suitable composite primary key for the GET_SALES_AND_TRAFFIC_REPORT stream might include the following fields: 1. queryEndDate (or a similar date field) 2. parentAsin (which you mentioned earlier) 3. Additional identifying fields, which could include: - marketplaceId (if you're dealing with multiple marketplaces) - childAsin (if applicable) - productCategory (if available) The exact combination will depend on what uniquely identifies a record in your specific report. Here's an example of how you might set this up:
Copy code
["queryEndDate", "parentAsin", "marketplaceId", "childAsin"]
This combination should ensure that each record is uniquely identified, even if you have multiple entries per day for different products or marketplaces. It's important to note that, as mentioned in the [Airbyte documentation on primary keys](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/PrimaryKey), you can specify a composite key as an array of fields:
Copy code
yaml [   "code",   "type" ]
Remember, the key is to choose a combination of fields that, when combined, will always be unique for each record in your report. If you're unsure about the exact structure of your GET_SALES_AND_TRAFFIC_REPORT, I recommend examining a sample of the data to identify which combination of fields will uniquely identify each record. If you need further assistance in determining the right combination of fields for your primary key, please provide more details about the specific fields available in your GET_SALES_AND_TRAFFIC_REPORT data.
p
@kapa.ai With this setup airbyte connection is giving "code": "QuotaExceeded", "message": "You exceeded your quota for the requested resource.", "details": ""
k
A message from kapa.ai
This error message indicates that you've exceeded the API rate limits set by Amazon for the Seller Partner API. This is a common issue when dealing with APIs that have strict usage quotas. Let me provide some suggestions to address this based on the information from our knowledge sources: 1. Implement backoff strategy: Airbyte has a built-in feature to handle rate limiting. As mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#limitations--troubleshooting), you can enable this in your source configuration: - Go to the Set Up page of the connector. - Open the optional section. - Enable the "Wait between requests to avoid fatal statuses in reports" toggle. This will introduce a waiting period between requests to avoid hitting the rate limits. 2. Adjust sync frequency: If you're running syncs too frequently, you might be hitting the API limits. Consider reducing the frequency of your syncs to stay within the quota. 3. Use separate connections: As suggested in the documentation, you can create separate connections for streams that frequently hit rate limits. This allows you to manage the sync schedules for these streams independently. 4. Check your API quota: Review your Amazon Seller Partner API quota to ensure you haven't exceeded your daily or hourly limits. You may need to contact Amazon to increase your quota if necessary. 5. Optimize your data fetching: Consider adjusting your "Period In Days" and "dataStartTime" settings to fetch smaller chunks of data at a time. Instead of 15 days, you might try reducing it to 7 days or less. 6. Implement error handling: If you're using a custom implementation, you can add error handling for 429 responses. This involves catching the error and implementing a backoff strategy, waiting for a period before retrying the request. Remember, these rate limits are imposed by Amazon to ensure fair usage of their API across all users. If you consistently hit these limits, you may need to optimize your data fetching strategy or consider requesting an increased quota from Amazon. For more detailed information on rate limits, you can refer to the [Amazon Seller Partner API documentation on Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api), as mentioned in one of the forum posts. If you continue to face issues after implementing these suggestions, you may want to reach out to Airbyte support for more personalized assistance with your specific setup.
p
@kapa.ai I have loaded last years data still my connection shows { "streamDescriptor": { "name": "GET_SALES_AND_TRAFFIC_REPORT" }, "streamState": {} } ] will this cause any issue if i use - reportPeriod: DAY - dataStartTime: -10 days and Period in Days= 10
k
A message from kapa.ai
A message from kapa.ai
Based on the information you've provided and the context from our previous conversations, I can offer the following insights: 1. Empty Stream State: The empty stream state (
"streamState": {}
) for the GET_SALES_AND_TRAFFIC_REPORT stream indicates that Airbyte doesn't have any saved state for this stream. This is not necessarily an issue, but it means that the connector doesn't have a reference point for incremental syncs. 2. Configuration: Your proposed configuration is: - reportPeriod: DAY - dataStartTime: -10 days - Period in Days: 10 This configuration is consistent and should work as intended. It will fetch daily data for the last 10 days. 3. Potential Impact: Given that you've loaded last year's data and the stream state is empty, here's what you can expect: a) If you're using Incremental Sync - Append + Deduped mode: - The connector will fetch data for the last 10 days in each sync. - It will append this data to your existing data in the destination. - If there are any overlapping records (i.e., data from the last 10 days that was already in your destination), they should be deduplicated based on your primary key. - Your historical data (beyond the last 10 days) will remain untouched. b) If you're using Full Refresh Overwrite mode: - Each sync will replace all existing data in your destination with the data from the last 10 days. - This would result in losing all historical data beyond the 10-day window. 4. Potential Issues: The main concern with this setup is that the empty stream state might cause the connector to always fetch the last 10 days of data, even if some of that data has already been synced. This could lead to: - Unnecessary API calls, potentially contributing to rate limit issues. - Duplicate data if deduplication is not properly set up. 5. Recommendations: a) Ensure you're using the correct sync mode for your needs. If you want to maintain historical data, use Incremental Sync - Append + Deduped. b) Set up a proper composite primary key to ensure effective deduplication. As discussed earlier, this might include fields like ["queryEndDate", "parentAsin", "marketplaceId", "childAsin"]. c) Monitor your initial syncs closely to ensure data is being appended and deduplicated correctly. d) If you're consistently hitting rate limits, consider enabling the "Wait between requests to avoid fatal statuses in reports" option in the connector settings, as mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#limitations--troubleshooting). In conclusion, while your proposed configuration should work, the empty stream state means you should pay close attention to ensure data is being synced and deduplicated as expected. If you encounter any issues with duplicate data or unexpected data loss, you may need to adjust your sync mode or primary key configuration.
Based on the information you've provided and the context from our previous conversations, I can offer the following insights: 1. Stream State: The empty stream state
"streamState": {}
for the GET_SALES_AND_TRAFFIC_REPORT stream indicates that there's no saved state for this stream. This typically means that the connector doesn't have a record of where it left off in the last sync. 2. Your Proposed Configuration: - reportPeriod: DAY - dataStartTime: -10 days - Period in Days: 10 This configuration is consistent and should work as intended. Here's what it means: - The report will provide daily data (reportPeriod: DAY) - It will fetch data starting from 10 days ago (dataStartTime: -10 days) - The global setting for the lookback period is also 10 days (Period in Days: 10) 3. Potential Impact: Given that you've loaded last year's data and the stream state is empty, using this configuration should not cause issues in terms of data retrieval. However, there are a few things to consider: a) Data Overlap: Since the stream state is empty, the connector will fetch the last 10 days of data in each sync, regardless of what data you've already loaded. This means you might get some overlap with your existing data. b) Incremental Sync: If you're using Incremental Sync - Append + Deduped mode (which we discussed earlier), the connector will append the new data and deduplicate based on your primary key. This should handle any potential duplicates from the overlap. c) Full Refresh: If you're using Full Refresh Overwrite mode, each sync will replace the existing data with the last 10 days of data. 4. Recommendations: - Ensure you have a proper composite primary key set up to handle potential duplicates if you're using Incremental Sync mode. - Monitor your initial syncs to ensure the data is being updated as expected and there's no unexpected data loss or duplication. - Keep an eye on API rate limits. As mentioned in the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#limitations--troubleshooting), you might want to enable the "Wait between requests to avoid fatal statuses in reports" option to manage API quotas. In conclusion, your proposed configuration should work without causing issues, but you should monitor the initial syncs closely to ensure the data is being updated as expected. If you need to maintain historical data beyond the 10-day window, you might want to consider adjusting your sync strategy or using a longer lookback period.
p
@kapa.ai which stream from Amazon Seller Partner can give me discounts
k
A message from kapa.ai
Based on the information provided in the knowledge sources, there isn't a specific stream named "discounts" in the Amazon Seller Partner connector. However, there are a few streams that might contain discount-related information: 1. FBA Promotions Report: This stream might include information about promotions and discounts applied to FBA (Fulfillment by Amazon) orders. According to the [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#supported-streams), this stream is available and supports incremental sync. 2. GET_SALES_AND_TRAFFIC_REPORT: While not specifically mentioned in the provided knowledge sources, this report typically includes various sales metrics and might contain information about discounts or promotions applied to sales. 3. Financial Events: This stream might include financial information related to discounts or promotions. The [Amazon Seller Partner Source documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner#supported-streams) lists this as an available stream with incremental sync support. To get the most accurate and up-to-date information about discounts, you might want to explore these streams, particularly the FBA Promotions Report and the GET_SALES_AND_TRAFFIC_REPORT. Remember that the exact data available in each stream can vary based on your Amazon Seller account type and the specific permissions you have. If you need more detailed information about discounts, you may need to consult the Amazon Seller Partner API documentation directly or reach out to Amazon Seller Support for guidance on which reports or data streams contain the specific discount information you're looking for.