advertSearch
advertSearch returns only adverts (products) that can be purchased, it is intended to be used by API consumers that want to generate a product search results page.
less than a minute
Key Information
Use-Case
advertSearch
was engineered to be called directly from a web application to support typical “product search” functionality, it is therefore:
- Optimized for speed
- Only returns Published adverts (it does not allow you to return unpublished or deleted adverts)
You would not usually expect to use this query in a Connected Integration.
Availability
- Operator API: Yes
- Seller API: Yes
Example
query GetPublishedProductsBySeller {
advertSearch(attributes: {
sellerIds: ["U2VsbGVyLTY2MDExOQ=="] }) {
adverts(first: 5 after: null) {
nodes {
id
title
requiresVetting
published
online
vetted
vettingRejected
seller {
businessName
}
vettingRejectedReason
itemTaxRate
lowestPriceCents
variants {
nodes {
id
countOnHand
id
label
lowestPriceCents
itemTaxRate
externalIds {
key
value
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
Arguments
Name | Type |
---|---|
attributes | AdvertSearchInput |
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 |