advertsWhere

advertsWhere can return: published, unpublished and deleted products (adverts). It will only return a result set if you provide at least 1 filter argument.

Key Information

Use-Case

advertsWhere 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.

Availability

  • Operator API: Yes
  • Seller API: Yes

Example

query returnProductsForSeller {
  advertsWhere(
    first: 5 
    after: null 
    retailerIds:["U2VsbGVyLTY2MDExOQ=="]) 
    {
    totalCount
    nodes {
      id
      legacyId
      title
      published
      online
      displayable
      variants {
        nodes {
          id
          countOnHand
          published
          legacyId
        }
      }
    }
    pageInfo{
      hasNextPage
      endCursor
    }
  }
}

Arguments

NameTypeDescription
qStringKeywords to search for. (Currently Title and Product ID)
idTitleSkuBarcodeStringSearch in ProductID, Title, SKU and Barcode
brandIds[ID!]Collection of Brand Ids to filter on
legacyIds[Int!]Collection of Legacy Ids to filter on
retailerIds[ID!]Collection Seller Ids to filter on (when run as an Operator). If run as a Seller then the results are filtered to the Sellers API Key
statusAdvertStatusEnumDISPLAYED, NOT_DISPLAYED Or FEATURED
taxonIds[ID!]Collection of Taxon Ids to filter on
taxonIdsWithDescendants[ID!]Select adverts that have associated taxons and including the taxon descendants
titleStringFilter on the main title of the product (advert)
variantBarcodes[String!]A collection of the Barcodes that you want to filter on
variantSkus[String!]A collection of the SKUs that you want to filter on
createdSinceISO8601DateTimeFilter on products that were created since this time
createdUntilISO8601DateTimeFilter in products that were updated since this time
sort[AdvertsWhereSort!]More detail on this input can be found here
vettedBooleanFilter on products that have been vetted
rejectedViaVettingBooleanFilter on product that have been rejected via vetting
withVettingRejectedReasonBooleanFilter on products that have a vetting rejected reason
requiresVettingBooleanFilter on products that need to be vetted
stockStatusAdvertStockStatusEnumFilter in HAS_STOCK vs. OUT_OF_STOCK
failedCatalogRuleIds[ID!]Filter adverts with provided catalog rule errors
withFailedCatalogRulesBooleanFilter adverts with any catalog rule errors.
externalIdExternalIDInputFilter on a given externalId. More on this input can be found 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 AdvertsConnection


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