API – lists, filtering, and pagination
Some API methods return a list of items (e.g., receipts, orders, movements on a commission account).
These methods have common behavior—the same input parameters for filtering and pagination, as well as a uniform output structure.
Output data
The response of methods that return a list always contains the following items:
- results – an array of objects with individual list items
- page – current page number
- count – number of items returned in the response
- filteredCount – number of items matching the current filters
- totalCount – total number of items without filters
Example answer
Specific items in the results are not listed here:
{ "results": [ ... ], "page": 1, "count": 10, "filteredCount": 18, "totalCount": 624, "requestId": "..." }
There are a total of 624 items (e.g., orders),
of which 18 match the current filters, and the first
10 items were returned (page 1, page size 10).
Filtering
You can add one or more filters to the request. Filters are passed as GET parameters and are used to select the items that the API returns.
- ID – returns only the item with a specific record ID
- lastID – returns only items whose ID is higher than the specified value (suitable for loading new items)
lastID is ideal if you regularly fetch new items
from the last known ID and don't want to deal with pagination backwards.
Example – orders with ID higher than 1234
https://api.wedos.as/partner/orders?lastID=1234
Pagination
Lists can be paginated, i.e., returned in batches. The API allows a maximum of 1,000 items to be returned per call.
- page – default 1
- count – default 100
- count – max 1000
If you only want a small preview (e.g., 10 items), set count=10.
When downloading larger batches, be reasonable (e.g., 100-300) so as not to unnecessarily overload the endpoint.
Example – 10 items on the second page
Returns items 11 through 20:
https://api.wedos.as/partner/orders?page=2&count=10
If you are unsure
If you are unsure about filtering or pagination in a specific method, you can use the public discussion forum or write to us directly at:
affiliate@wedos.com.