Find the answer to your question
Why am I missing some transactions even though I am making calls to GetSellerTransactions at a regular interval?
Here are a few recommendations to ensure that you get all of your transactions:
- Ensure that you are using overlapping time windows in your Mod Time filters
The ModTimeFrom should be the last time you made the call minus 2 minutes
The ModTimeTo should be the current time
This will ensure that you do not miss any time periods
- Use Pagination
You can ask for upto 200 transactions per page. If the number of transactions exceeds the number you have specified in EntriesPerPage, you have to make the calls multiple times. Increment the PageNumber and make the call till the field HasMoreEntries in the response is false.
- Make the call every 15 minutes especially if you have high volume sellers to ensure that you do not have to paginate too much.
- Ensure that you do not make any updates to your transactions while you are retrieving your transactions.
Here is a very simple scenario to illustrate how transactions can be "missed" by your application:
1. Users asks for 3 transactions per page and all of these transactions are for one item so we'll skip the ItemID illustration
2. User asks for transactions modified between 2022-09-01T23:40:00.000Z and 2022-09-01T23:50:00.000Z
This is how the tranasctions are designed to be returned:
How does a change affect transactions
While the user is in the process of retrieving page2, they make an edit to TransactionID 1008 using CompleteSale to set the shipment tracking number . The last modified time changes to current time, let's say 2022-09-01T23:51:00.000Z.
Since the last modified time for 1008 changed, it is now outside of the users time range, and hence falls off the list. The new position of the records is as below:
10071006 2022-09-01T23:47:00.000Z2022-09-01T23:46:00.000Z 10061005 2022-09-01T23:46:00.000Z2022-09-01T23:45:00.000Z 10051004 2022-09-01T23:45:00.000Z2022-09-01T23:44:00.000Z
10041003 2022-09-01T23:44:00.000Z2022-09-01T23:43:00.000Z 10031002 2022-09-01T23:43:00.000Z2022-09-01T23:42:00.000Z 1002 2022-09-01T23:42:00.000Z
Notice that 1004 does not get retrieved from page2 or page3. If there is never any change to last modified time for 1004, it will not be retrieved by the application.
Since the user had already retrieved page 2, they'll move on to page 3.
The effect is the same when you use GetOrders with the ModTime as your filter. If you modify orders while you are in the process of retrieving them, just as in the case of transactions for GetSellerTransactions.
How well did this answer your question?
Answers others found helpful
- Best Practices for GetSellerEvents and GetSellerTransactions
- Sample to determine if GetSellerTransactions response has more items in C# using .NET SDK
- Logging API Calls with .NET SDK
- ShippingServiceSelectedCost is returned as 0 in GetItemTransactions and GetSellerTransactions
- Error 340 - Invalid page number