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.
3 minute read
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
| Name | Type | Description |
|---|---|---|
| q | String | Keywords to search for. (Currently Title and Product ID) |
| idTitleSkuBarcode | String | Search 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 |
| status | AdvertStatusEnum | DISPLAYED, 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 |
| title | String | Filter 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 |
| createdSince | ISO8601DateTime | Filter on products that were created since this time |
| createdUntil | ISO8601DateTime | Filter in products that were updated since this time |
| sort | [AdvertsWhereSort!] | More detail on this input can be found here |
| vetted | Boolean | Filter on products that have been vetted |
| rejectedViaVetting | Boolean | Filter on product that have been rejected via vetting |
| withVettingRejectedReason | Boolean | Filter on products that have a vetting rejected reason |
| requiresVetting | Boolean | Filter on products that need to be vetted |
| stockStatus | AdvertStockStatusEnum | Filter in HAS_STOCK vs. OUT_OF_STOCK |
| failedCatalogRuleIds | [ID!] | Filter adverts with provided catalog rule errors |
| withFailedCatalogRules | Boolean | Filter adverts with any catalog rule errors. |
| externalId | ExternalIDInput | Filter on a given externalId. More on this input can be found 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 AdvertsConnection
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 |