Admin API / Types
Collection
ObjectA curated group of listings or livestreams. Readers see hidden collections too.
Requires a client key with one of these scopes:admin:collections:readThe requirement applies to every field of Collection unless that field declares its own scopes.
type Collection implements NodeFields
| Field | Type | Description |
|---|---|---|
createdAt | DateTime! | When the collection was created. |
dashboardUrl | URL | URL of the collection's editor in the store dashboard. Open it directly: the dashboard sends an unauthenticated user to sign in. Null when the caller's role is below ADMIN, because the dashboard opens collections only for ADMIN and higher. The URL changes when the store's dashboard host changes. |
defaultSort | CollectionItemSort | The order of the collection's listings when a buyer does not choose one. Null for a livestream collection. |
displayName | String! | The collection's display name. |
featured | Boolean! | True: the storefront home page shows a feed of the collection's items. |
id | ID! | A globally unique ID. Treat this value as an opaque string. |
itemSelection | CollectionItemSelection! | How items enter the collection. |
itemType | CollectionItemType! | Whether the collection holds listings or livestreams. |
listingsFilter | Boolean! | True: the storefront listings page offers the collection as a filter. False for a livestream collection. |
livestreams | CollectionLivestreamConnection! | Livestreams in the collection that the caller reads: the caller's livestreams and the livestreams it cohosts, livestreams that the storefront shows, and every livestream for a MODERATOR or higher. Empty for a listing collection. Live and paused livestreams come first by newest startAt, then scheduled livestreams by soonest startAt, then past livestreams by newest startAt. Offsets stop at 1,000 rows (1,000,000 for Soho). Fails with VALIDATION_ERROR for where.collectionIds.Arguments:after: String — Return items after this cursor.first: Int — Maximum number of items to return. Defaults to 20, capped at 100 (10,000 for Soho).query: String — Match livestreams whose title contains this text (case-insensitive).where: LivestreamWhereInput — Filters to narrow the list. |
pinned | Boolean! | True: the storefront home page shows the collection at the top. False for a livestream collection. |
products | CollectionProductConnection! | Listings in the collection that the caller reads: the listings of the sellers in Viewer.access.actingFor, PUBLIC listings of other sellers for a MODERATOR, and every listing for an ADMIN or higher. Deleted listings are listed only with includeDeleted: true. A manual collection holds the listings added to it; an automated collection holds the listings that its rules select. Empty for a livestream collection. Defaults to defaultSort, also with query; RANDOM reads as CREATED_AT descending and TRENDING as VIEW_COUNT. totalCount counts hidden and sold-out listings too, so the storefront can show fewer. A cursor marks a position in the sort. A listing whose sort key changes between pages can move across it. The list has no row limit. Fails with VALIDATION_ERROR for where.collectionIds or a where list of more than 100 values.Arguments:after: String — Return items after this cursor. A cursor continues only the sort that issued it. A RELEVANCE cursor also continues only the query that issued it.first: Int — Maximum number of items to return. Defaults to 20, capped at 100 (10,000 for Soho).includeDeleted: Boolean! = false — True: the list also returns deleted listings, each with lifecycle: DELETED. They are the deleted listings of the sellers that the caller acts for, and every deleted listing for an ADMIN or OWNER. A MODERATOR gets no deleted listing of another seller. A delete moves updatedAt, so a read of an updatedAt range finds the listings deleted in it.query: String — Matches words in the title and the description, case-insensitive. Each word matches as a prefix, and every word must match: "blu jack" matches "Blue jacket". Search operators and quotes are ignored. The whole trimmed text, quotes and operators included, also matches a custom order whose buyer's username or name contains it, case-insensitive, when the caller can read the listing's customOrder. Text with no word applies no filter.sort: ProductSortInput — Sort order. Defaults to defaultSort.where: ProductWhereInput — Filters to narrow the list. |
rules | CollectionRules | The rules that select the listings of an automated collection. Null for a manual collection. Requires the ADMIN role or higher. A lower role gets a FORBIDDEN error on this field only. When a stored rule does not parse, this field fails with an internal error and the collection holds no listings. |
sellerPolicy | CollectionSellerPolicy | Who can add items to a manual collection and remove them. Null for an automated collection. |
slug | Slug! | URL-safe identifier, stable across renames. collectionBySlug finds the collection by this value. |
thumbnail | Image | The thumbnail set on the collection. Null when none is set: the storefront then shows the image of a listing in the collection, if any. |
updatedAt | DateTime! | When the collection last changed. A position change also sets this value, so a new collection or a moveCollection call can set it on collections that the call did not name. |
viewer | CollectionViewerState! | The caller's relation to the collection. |
visibility | CollectionVisibility! | Whether the storefront shows the collection. |
Returned by
CollectionEdge.nodeCollectionNameTakenError.existingCollectionCollectionRules.sourceCollectionsCreateCollectionSuccess.collectionLivestreamCollectionEdge.nodeMoveCollectionSuccess.collectionProductCollectionEdge.nodeQuery.collectionQuery.collectionBySlugSetCollectionSettingsItemSuccess.collectionUpdateCollectionSuccess.collection