allAdverts
allAdverts can return: published, unpublished and deleted adverts (products). It can return adverts (products) without the provision of search filters.
2 minute read
Key Information
Use-Case
allAdverts
can return: published, unpublished and deleted products (adverts). Often used in a Connected Integration to move products en masse from Marketplacer to an upstream system in the connected domain. Can be used as an alternative to advertsWhere
, however it has a significantly reduced filter set.
Further Points of Note
allAdverts
returns an AllAdvertsConnection
, which is a collection of AllAdvert
objects, which in turn represents the following Advert types:
Advert
- An advert available for saleUnpublished
- An advert not available for sale because it is not in a sellable state- To access the fields on this advert you need to query on
details
- see example below
- To access the fields on this advert you need to query on
DeletedAdvert
- An advert that has been deleted- Aside from a limited set of fields (e.g.
id
), you cannot access further field detail for this advert type DeletedAdverts
are “soft-deleted” in that they are retained in the persistence layer for 30 days post “deletion”
- Aside from a limited set of fields (e.g.
Availability
- Operator API: Yes
- Seller API: Yes
Example
query getAllProductsUpdatedSince {
{
allAdverts(
updatedSince: "2019-11-29T03:05:38+11:00",
first: 10
after: null) {
nodes {
__typename
... on Advert {
id
title
lowestOriginalPrice
updatedAt
variants(displayableOnly: false) {
nodes {
id
}
}
}
... on UnpublishedAdvert {
id
updatedAt
details{
title
lowestOriginalPrice
}
variants {
nodes {
id
}
}
}
... on DeletedAdvert {
id
updatedAt
variants {
nodes {
id
}
}
}
}
pageInfo {
hasNextPage
startCursor
}
}
}}
Arguments
Name | Type | Description |
---|---|---|
updatedSince | ISO8601DateTime | Return adverts updated since the provided time stamp |
vetted | Boolean | Search for adverts that have been successfully vetted - more on vetting here |
requiresVetting | Boolean | Search for adverts that require vetting - more on vetting here |
after | String | Pagination cursor for moving through result set - more on pagination here |
before | String | Not in use - backwards pagination not supported |
first | Int | Pagination page size - more on pagination here |
last | Int | Not in use - backwards pagination not supported |
Response
Returns AllSellersConnection
Error Responses
HTTP Error | Error Message | Meaning |
---|---|---|
401 | Unauthorized | You don’t have access to the endpoint, likely Basic Authentication credentials are missing |
401 | API Token has expired | You don’t have access to the endpoint, likely that you are either not supplying an API Key, or the key you are supplying is invalid |