Poll transactions
This endpoint is used to regularly poll for new transactions that have been processed in Core.
You must define one of startDateTime
or pageToken
when making a request.
You may optionally define a pageSize
. The minimum pageSize
is 1, and the maximum pageSize
is 1000. The default is 100.
startDateTime
takes a string in ISO 8601 format. (ex: 2023-08-10T18:00:00Z
).
startDateTime
must be set to at least 1 minute in the past.
The results will contain transactions that occurred after this startDateTime
. Starting from the oldest to newest transactions ordered by the processedAt
field. Note, this is exclusive of the startDateTime
, a transaction occuring at exactly 2023-08-10T18:00:00Z
for instance, would not be included. In addition, there is a 15 second window where newly created transactions will not be included to account for any network latency or clock drifts within the systems to ensure you do not miss any transactions.
Each request will always return a nextPageToken
, regardless of whether there are new transactions or not.
We DO NOT recommend trying to roll your own polling strategy leveraging startDateTime
only. There are edge cases around two transactions occuring at the exact same time and being on the edge of a pagination which could cause you to miss one due to the exclusive nature of startDateTime
. We recommend using pageToken
’s instead.
When making subsequent polling requests (not initiating with startDateTime
), the pageToken
can be used to continue iterating through pages of transactions. Usage of the pageToken
guaruntees you will not miss any transactions on the stream. If at any point there are no more new transactions in the item
array, you will still receive a nextPageToken
. Continue to use this token to poll for new transactions. Once there are new transactions, they will be returned in the item
array.
pageToken
’s you have retrieved can serve as checkpoints. They do not expire, and you can always start from that point in the transaction stream again if you need to catch a system up or recover from a failure. Storing pageToken
’s as part of your polling process is encouraged.
pageToken
’s are unique per request, opaque, and should not be parsed or modified in any way. They are not guaranteed to be in any particular format, and may change in the future.
This endpoint returns details about transactions that Stedi processed after the specified startDateTime
.
Transactions are ordered from oldest to newest according to the processedAt
property. This is exclusive of the startDateTime
. For example, if the provided startDateTime
is 2023-08-10T18:00:00Z
, a transaction processed at exactly that time would not be included in the results. There is also a fifteen-second window where newly created transactions are excluded, meaning Stedi returns results up to fifteen seconds before the time of your request. This functionality accounts for any network latency or clock drift within the systems to ensure you don’t miss any transactions.
Polling with page tokens
We don’t recommend polling using startDateTime
only. Due to the exclusive nature of startDateTime
, you could potentially miss a transaction if two transactions occur at the exact same time and are on the edge of a pagination. Instead, you should use pageToken
.
After the initial request, you can poll again immediately using pageToken
to continue iterating through the pages of transactions. The endpoint always returns a nextPageToken
, regardless of whether additional transactions match the request criteria. If the items
array is empty, continue using the provided nextPageToken
to poll for new transactions. New transactions will be returned when available.
We recommend storing pageToken
values as part of your polling process. They don’t expire, allowing you to start from that point in the transaction stream again if you need to catch a system up to date or recover from a failure.
Note that pageToken
values are unique per request, opaque, and shouldn’t be parsed or modified in any way. They are not guaranteed to be in any particular format, and may change in the future.
Authorizations
A Stedi API Key for authentication.
Query Parameters
The maximum number of elements to return in a page. You can set this to a maximum of 500 elements. If not specified, the default is 100.
x >= 1
A token returned by a previous call to this operation in the nextPageToken
. If not specified, Stedi returns the first page of results.
1 - 1024
An ISO 8601 formatted string. For example 2023-08-28T00:00:00Z
. Stedi returns transactions processed after this time.