Amazon Financial Events API Pagination Issue
Problem Description
I'm experiencing pagination issues with the Financial Events Amazon endpoint. When the flow runs, only a couple of pages are queried before the flow stops without any error messages.
Current Configuration
API Endpoint Details
- Relative URI:
/finances/v0/financialEvents?PostedAfter=2025-06-10T00:00:00.000Z&PostedBefore=2025-06-25T00:00:00.000Z
- Paging Method: Next page token
- Path to Next Page Token:
payload.NextToken
- URI for Subsequent Pages:
/finances/v0/financialEvents?NextToken={{{encodeURI export.http.paging.token}}}&PostedAfter=2025-06-10T00:00:00.000Z&PostedBefore=2025-06-25T00:00:00.000Z
- Path to Records:
payload.FinancialEvents.RefundEventList
Comparison with Working Flow
I have another Amazon financial events flow using identical settings that works perfectly. The only difference is:
- Working Flow: Path to Records points to
payload.FinancialEvents.ShipmentEventList
- Problematic Flow: Path to Records points to
payload.FinancialEvents.RefundEventList
The working flow gathers all pages properly without issues.
API Response Structure
The Amazon endpoint doesn't allow specifying the financial event type as a query parameter - it returns all event types in a single response.
Simplified example of the response structure below:
{
"payload": {
"FinancialEvents": {
"ShipmentEventList": [
"// Shipment event data here"
],
"RefundEventList": [
"// Refund event data here"
]
},
"NextToken": "string_or_null"
}
}
Assumption About the Root Cause
Since ShipmentEventList
events are more common than RefundEventList
events, there may be pages where RefundEventList
is empty or blank.
My hypothesis: The flow may be prematurely ending because it incorrectly assumes there are no more pages when RefundEventList
is empty, even though a NextToken
is still present in the response.
Can anyone confirm or deny this is the case? Is there a solution to this?