For every read command that is served over our API you can use extensive filters and sorting by sending a specific payload in the request header.
Pagination
The default and maximum value of items per page is 100. If you want to reduce the number of returned items you can set a different limit.
We use cursor-based pagination. Here is a step-by-step example workflow of how you can skip through pages:
- Request an initial page of all offers e.g. call ListOffers
- Get records back, where e.g. the last record has offer_id: 980 and at the end of the return object field
has_moreistrue - In order to get the next page use the offer_id: 980 as cursor, i.e.
ListOffers{"pagination":{"starting_after":980}} - Get other records back, where the last record has offer_id: 1204 and check if
has_morefield is stilltrue - To continue paginating forward go to step 3. but now set offer_id: 1204 as cursor value
- End if
has_moreisfalse
Use starting_after to navigate forward and ending_before to navigate backward. Never use both starting_after and ending_before together.
{
"pagination": {
"limit": 50,
"starting_after": "980"
}
}
Sorting
There are several options to sort the items in the response body. You can order them in an ascending (ASC) or descending (DESC) way and you can sort them by different arguments, like ID, creation date, or currency to name a few.
Filters
Every read command offers a variety of filter options. Within each service, different filter options are available:
- BuybackBidService
- BuybackOrderService
- BuybackProductService
- BuybackProductService
- BuybackSupplyboxService
- CurrencyService
- MarketOfferService
- MarketService
- OfferService
- OrderService
- ShippingProfileService
To give an example, you want to filter all orders that are in state NEW. Make a request to OrderService/ListOrders and use the filter option state and within the "any_of" array the order state NEW.
The request payload would look as follows:
{
"filter": {
"state": {
"any_of": [
"NEW"
]
}
}
}For most filter options you can combine or exclude more than one filter value.
- Use "all_of" to filter for those items that include all of your indicated values
- Use "any_of" to filter for those items that include at least one of your indicated values
- Use "none_of" to filter for those items that do NOT include any of your indicated values
- Use "is_set" (boolean) to filter whether battery_condition field was actively set or not
Expand for example requests with "all_of", "any_of", and "none_of" filtering for MISSING_PARCEL_TRACKING_URLS and MISSING_ITEM_IDENTIFIERS
Let’s take the example of filtering orders based on their tracking link and IMEI availability. Make a request to OrderService/ListOrders and use the filter option labels and within the "any_of", "any_of", or "none_of" arrays the arguments MISSING_PARCEL_TRACKING_URLS for orders where the tracking link is missing and MISSING_ITEM_IDENTIFIERS for orders where the item identifier, like IMEI, is missing.
"all_of" returns a list of all orders where no tracking link is set AND no item identifier
{ "filter": { "labels": { "all_of": [ "MISSING_PARCEL_TRACKING_URLS", "MISSING_ITEM_IDENTIFIERS" ] } } }"any_of" returns a list of all orders where EITHER no tracking link is set OR no item identifier
{ "filter": { "labels": { "any_of": [ "MISSING_PARCEL_TRACKING_URLS", "MISSING_ITEM_IDENTIFIERS" ] } } }"none_of" returns a list of all orders where BOTH a tracking link AND item identifier are set
{ "filter": { "labels": { "none_of": [ "MISSING_PARCEL_TRACKING_URLS", "MISSING_ITEM_IDENTIFIERS" ] } } }
Versioning
{
"offer": {
"id": "12345",
"version": "1659086671099880",
"is_current": true,
...
}
}Workflow Example
If you noticed an issue with the stock of one of your offers and you had saved the versions for all your updates you could filter on each update version to see what had been changed exactly.
Example request payload for POST OfferService/GetOffer
{
"identifier": {
"sku": "1234"
},
"version": "1659086671099870"
}Example response:
{
"offer": {
"id": "12345",
"version": "1659086671099870",
"is_current": false,
"sku": "1234",
"stock": 15,
...
}
}