allAdverts

allAdverts can return: published, unpublished and deleted adverts (products). It can return adverts (products) without the provision of search filters.

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 sale
  • Unpublished - 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
  • 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”

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

NameTypeDescription
updatedSinceISO8601DateTimeReturn adverts updated since the provided time stamp
vettedBooleanSearch for adverts that have been successfully vetted - more on vetting here
requiresVettingBooleanSearch for adverts that require vetting - more on vetting here
afterStringPagination cursor for moving through result set - more on pagination here
beforeStringNot in use - backwards pagination not supported
firstIntPagination page size - more on pagination here
lastIntNot in use - backwards pagination not supported

Response

Returns AllSellersConnection


Error Responses

HTTP ErrorError MessageMeaning
401UnauthorizedYou don’t have access to the endpoint, likely Basic Authentication credentials are missing
401API Token has expiredYou 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

Further Reading