How to filter Finances.list_financial_events by Marketplace? It returns too many pages in this function. #293
-
I would like to filter the Finances using the function list_financial_events for a specific Market Place:
Then I define the marketplace and call the Finances API, with the marketplace for Netherlands:
Then I create a loop to see how many pages I have in my API call.
When I look to the results in fin2.payload or fin1.payload the MarketPlaces are not only for Netherlands, but includes also for Germany, France, etc. It doesn't look like this filter for marketplace is working properly. Any tip is helpful. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The endpoint doesn't have a Marketplace parameter. list_financial_events I don't understand why you're using a range to loop. Also, if you want to request by NextToken, you only pass NextToken usually, nothing else. You might find the
|
Beta Was this translation helpful? Give feedback.
-
Thank you @saleweaver. This was really helpful.
There is more code after that, I extract all the data from the Finances API. The script run until certain time and I've got this error: SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': 'Token is not valid, token duration is 3 minutes.', 'details': ''}] Can you help me? |
Beta Was this translation helpful? Give feedback.
The endpoint doesn't have a Marketplace parameter. list_financial_events
I don't understand why you're using a range to loop. Also, if you want to request by NextToken, you only pass NextToken usually, nothing else. You might find the
load_all_pages
andretry
decorators useful, the do what you want: https://sp-api-docs.saleweaver.com/utils/load_all_pages/