Admin API / Types

Viewer

Object

Session context for the authenticated caller. Its fields are visible only to that caller.

type Viewer

Fields

FieldTypeDescription
accessViewerAccess!
What the caller can do in this marketplace. Each value uses the check of the operation that it predicts.Requires a client key with one of these scopes: admin:account:read
activeProductCountNonNegativeInt!
Number of the authenticated seller's product listings with at least one active, in-stock variant. Includes listings hidden from the storefront.Deprecated. Use Viewer.products(where: { availability: [IN_STOCK] }) { totalCount { count } }. It also counts the listings of the stores that the caller staffs.Requires a client key with one of these scopes: admin:products:read
averageTimeToShipDuration
The mean time from shipment creation to shipping, over the orders of the caller and of the stores the caller staffs, for shipments created in the last 3 months. Each order on a shipment counts once. Null when fewer than 3 orders count.Requires a client key with one of these scopes: admin:shipments:read
buyerViewerBuyer
The buyers entry of one user, or null when buyers does not list the user.Requires a client key with one of these scopes: admin:orders:readArguments:
userId: ID! — The buyer's user ID.
buyersViewerBuyerConnection!
Users who bought from the caller, or from a store where the caller is store staff, each once. Orders that orders omits do not count. A buyer with no counted order has stats.orderCount 0 and null dates. A buyer who is not a user of this marketplace is absent, although that buyer's orders stay in orders with a null Order.buyer. Reads at most the first 1,000 buyers (1,000,000 for Soho): use query to find others.Requires a client key with one of these scopes: admin:orders:readArguments:
after: String — Return buyers after this cursor.
first: Int — Maximum number of buyers to return. Defaults to 20, at most 100 (10,000 for Soho).
query: String — Matches the username, or the first and last name, case-insensitive, anywhere in the text. A blank value matches every buyer.
sort: BuyerSortInput — Default: latest order in orders first, counted or not; ties by ID.
where: BuyerWhereInput — Buyer filters.
defaultLivestreamThumbnailUrlURL
The thumbnail most recently saved for the caller's own livestreams, shared across marketplaces. Null when no thumbnail has been saved, or when the saved value is not an HTTPS URL of 255 characters or fewer, which createLivestream cannot store. Use it to prefill a new livestream's thumbnail.Requires a client key with one of these scopes: admin:livestreams:read
directConversationsViewerDirectConversationConnection!
The caller's own direct conversations. A staff member does not see the conversations of the store owner. Defaults to lastMessageAt descending; ties sort by ID. first outside 1 to 100 (1 to 10,000 for Soho), sort.direction ASC, an empty where.inbox, a where.participantIds outside its rule, or an after that this list did not issue gives a thrown VALIDATION_ERROR. Keyset cursors; no row ceiling. Reading the list does not mark a conversation read.Requires a client key with one of these scopes: admin:chat:readArguments:
after: String — Return conversations after this cursor. Omit for the first page.
first: Int — Maximum number of conversations to return. Defaults to 20, capped at 100 (10,000 for Soho).
query: String — Matches the other participant's username, or the first and last name, case-insensitive, anywhere in the text. A blank value matches every conversation.
sort: DirectConversationSortInput — Sort order. Defaults to lastMessageAt descending.
where: DirectConversationWhereInput — Filters to narrow the list.
discountCodesViewerDiscountCodeConnection!
Discount codes that the caller and the owners of the stores that the caller staffs created. Defaults to createdAt, descending. Pages stop at 1,000 rows (1,000,000 for Soho): narrow where to read more.Requires a client key with one of these scopes: admin:discounts:readArguments:
after: String — Returns items after this cursor.
first: Int — The maximum number of items. Defaults to 20. A value outside 1 to 100 (1 to 10,000 for Soho) fails with VALIDATION_ERROR.
query: String — Matches codes that contain this text, case-insensitive.
sort: DiscountCodeSortInput — The sort order. Defaults to CREATED_AT, descending.
where: DiscountCodeWhereInput — Filters that narrow the list.
earningsEstimateEarningsEstimate!
Estimates what a seller receives from a sale at price, before shipping and discounts. The processing fee assumes a card charge of price alone; buyer tax and shipping raise it at checkout. The District fee is 0 when Marketplace.paymentProcessing.processor is OWN_ACCOUNTS. price.currencyCode must be USD, and price.amount must be above 0 in whole cents.Requires a client key with one of these scopes: admin:products:readArguments:
price: MoneyInput! — The sale price of one item.
sellerId: ID — A seller in ViewerAccess.actingFor. Defaults to the caller. Another seller fails with FORBIDDEN.
facebookConnectionFacebookAccountLink
The caller's linked Facebook account, or null when none is connected or its stored token has expired or cannot be read. Connect again in that case.Requires a client key with one of these scopes: admin:social:read
generatedFilesViewerGeneratedFileConnection!
Files the caller generated in the last 7 days that this client can download, newest first; ties sort by ID. Pages have no row limit.Requires a client key with one of these scopes: admin:account:readArguments:
after: String — Returns files after this cursor.
first: Int — The maximum number of files. Defaults to 20, at most 100.
instagramConnectionInstagramAccountLink
The caller's linked Instagram account, or null when none is connected.Requires a client key with one of these scopes: admin:social:read
isOnVacationBoolean!
Whether the caller is on vacation. updateVacationMode states the effects. Belongs to the caller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:account:read
isSharedAccountBoolean!
Whether the caller's account is a legacy shared account: a member of more than one marketplace. Account data and profile changes then apply in each of them. False for an account that belongs to one marketplace.Requires a client key with one of these scopes: admin:account:read
labelPaymentMethods[LabelPaymentMethod!]!
The caller's saved cards that can pay for shipping labels: the default card first, then the newest first. At most 100. Empty when the caller has no saved card. Belongs to the caller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:invoices:read
listingExportListingExport
The newest listings export that this client started and that is PENDING or READY and has not expired. Null when there is none. Requires the ADMIN role or higher.Requires a client key with one of these scopes: admin:products:read
livestreamsViewerLivestreamConnection!
Livestreams hosted by the authenticated seller. Live and paused streams appear first by newest startAt, followed by scheduled streams by soonest startAt, then past streams by newest startAt.Requires a client key with one of these scopes: admin:livestreams:readArguments:
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.
memberMember!
The caller's membership: the stored role and status. The status is ACTIVE, or INACTIVE when open seller obligations admit the caller; a BANNED caller cannot use this API. Role gates use Viewer.access.role, not this stored role.Requires a client key with one of these scopes: admin:account:read
mostRecentLivestreamHostNoteLivestreamHostNote
The seller's most recent active host note, or null when none exists. Use it to prefill a new livestream's note.Requires a client key with one of these scopes: admin:livestreams:read
negotiationsViewerNegotiationConnection!
Offer negotiations whose seller is the caller or the owner of a store that the caller staffs. Without sort: negotiations that wait for the seller first, then the other ACTIVE ones, then the rest; each group newest last offer first. Ties sort by ID. A cursor marks a position in the sort. A negotiation whose sort key changes between pages can move across it, so a walk can repeat it or miss it. Without sort, a new offer or an expiry can move a negotiation to another group. To read every change, sort by UPDATED_AT ascending. The list has no row limit. The offers that wait for the seller are where: { status: [ACTIVE], awaitingResponseFrom: [SELLER] }.Requires a client key with one of these scopes: admin:offers:readArguments:
after: String — Returns negotiations after this cursor. A cursor continues only the sort that issued it.
first: Int — The maximum number of negotiations. Defaults to 20, at most 100 (10,000 for Soho).
query: String — Case-insensitive text in the listing title or the variant title. A blank value matches every negotiation.
sort: NegotiationSortInput — The order. Without it, see the field description.
where: NegotiationWhereInput — Filters that narrow the list.
notificationsViewerNotificationConnection!
Notifications addressed to the caller. Defaults to createdAt, descending.Requires a client key with one of these scopes: admin:account:readArguments:
after: String — Returns notifications after this cursor.
first: Int — The maximum number of notifications. Defaults to 20, at most 100.
sort: NotificationSortInput — The order. Defaults to CREATED_AT, descending.
where: NotificationWhereInput — Filters that narrow the list.
notificationsSeenAtDateTime
When the caller last marked notifications seen, or null when never. One value for the account in every marketplace and every District app.Requires a client key with one of these scopes: admin:account:read
orderExportOrderExport
The newest orders export that this client started and that is PENDING or READY and has not expired. Null when there is none. Requires the ADMIN role or higher, and the client scopes of startOrderExport.Requires a client key with one of these scopes: admin:orders:read
ordersViewerOrderConnection!
Orders that the caller sold, and orders of each store where the caller is store staff. A caller below the SELLER role who has open seller obligations gets only those orders: orders awaiting payment, awaiting shipment or in transit, and orders with an open dispute. Omits orders whose checkout did not complete: unconfirmed orders, and cancelled buy-now and cart orders (see includeCancelled). Keeps orders awaiting payment. Defaults to CREATED_AT descending; ties sort by ID. A cursor marks a position in the sort. An order whose sort key changes between pages can move across it. The list has no row limit.Requires a client key with one of these scopes: admin:orders:readArguments:
after: String — Return orders after this cursor. A cursor continues only the sort that issued it.
first: Int — Maximum number of orders to return. Defaults to 20, at most 100 (10,000 for Soho).
includeCancelled: Boolean! = false — With true, also returns the cancelled orders with checkoutType BUY_NOW or CART that the list omits by default, if the order was confirmed (awaiting payment) before the cancel. Unconfirmed orders stay out, also when they are cancelled. Some earlier orders have no record of their confirmation: they stay out when they are cancelled. A caller below SELLER gets only the orders with open obligations, as without the argument.
query: String — Case-insensitive text anywhere in the receipt code, the buyer or seller username or name, or an item title. With the admin:contactDetails:read scope, also matches the ship-to street and city. Does not match the order ID. A blank value matches every order.
sort: OrderSortInput — Sort order. Defaults to CREATED_AT descending.
where: OrderWhereInput — Filters to narrow the list.
parcelTemplatesViewerParcelTemplateConnection!
The caller's parcel templates, newest first; ties sort by ID. Each template belongs to the caller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:shipments:readArguments:
after: String — Returns templates after this cursor.
first: Int — The maximum number of templates. Defaults to 20, at most 100 (10,000 for Soho).
payoutAccountPayoutAccount
The payout account that receives the caller's wallet cash-outs. Null when the caller has no payout account of the type that District payout setup creates. createPayoutOnboardingLink makes a link where the caller sets one up. This field does not return a payout account of another type, and wallet cash-outs can still go to that account: null does not mean that the caller cannot get paid. Belongs to the caller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:payouts:read
productsViewerProductConnection!
Listings of the sellers that the caller acts for: the caller, and the owner of each store where the caller is staff. Hidden listings are included. Other sellers' listings are not in this list for any role: Query.products lists their PUBLIC listings for a MODERATOR and all of them for an ADMIN or higher. Deleted listings are listed only with includeDeleted: true. Defaults to RELEVANCE descending when query has a word, else createdAt descending. 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 a where list of more than 100 values.Requires a client key with one of these scopes: admin:products:readArguments:
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. 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 RELEVANCE descending when query has a word, else createdAt descending.
where: ProductWhereInput — Filters to narrow the list.
returnAddressPostalAddress
The caller's ship-from address, or null when none is set. Belongs to the caller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:account:read
salesByPeriod[PeriodSales!]!
Totals of the sold orders of the caller and of the owners of the live stores where the caller is active store staff, one entry per period, oldest first: from the period that contains fromDate to the period that contains toDate. A period with no sale has zero totals. Counts the orders that salesSummary counts for the same where, created from the start of fromDate to the end of toDate.Requires a client key with one of these scopes: admin:orders:readArguments:
fromDate: Date! — First day, inclusive, in timeZone. Must not be after toDate.
period: SalesPeriod! — The length of each period.
timeZone: String — IANA time zone name, such as America/Los_Angeles, of the days and periods. Defaults to UTC. An unknown zone gives a thrown VALIDATION_ERROR.
toDate: Date — Last day, inclusive, in timeZone. Defaults to today in timeZone. The range from fromDate to toDate covers at most 366 days.
where: OrderWhereInput — Order filters. A createdAt range applies together with fromDate and toDate. productIds selects orders; the totals count every item of a selected order. Use salesByProduct for the units of one listing.
salesByProduct[ProductSales!]!
Sales of each listing in the sold orders of the caller and of the owners of the live stores where the caller is active store staff: the orders that salesSummary counts for the same where. At most 100 listings, by itemSales descending; ties sort by listing ID. A deleted listing still has an entry.Requires a client key with one of these scopes: admin:orders:readArguments:
where: OrderWhereInput — Order filters. productIds also limits the entries to those listings.
salesSummarySalesSummary!
Totals of the sold orders of the caller and of the owners of the live stores where the caller is active store staff. Omit where for lifetime totals. A paymentStatus filter without PAID gives zero totals. A refundStatus filter without NONE or PARTIAL gives zero totals. Aliases with different createdAt ranges compare periods in one request.Requires a client key with one of these scopes: admin:orders:readArguments:
where: OrderWhereInput — Order filters. Omit to count every sold order in the current payment mode of the marketplace.
setupTasks[SellerSetupTask!]!
The setup steps for selling in this marketplace, done steps included: CONNECT_PAYOUTS, ADD_RETURN_ADDRESS and ADD_FIRST_PRODUCT, in that order. Empty when access.canSell is false. The steps read the caller's own products in this marketplace only.Requires a client key with one of these scopes: admin:account:read
shipmentsViewerShipmentConnection!
Shipments of the caller's orders and of the orders of each store where the caller is store staff, with at least one order that is paid, ready to ship, shipped, delivered or refunded. All orders on a shipment have one seller. A caller below the SELLER role who has open seller obligations gets only shipments with at least one of those orders; for such a caller, Shipment.subtotal, shippingFee and itemQuantity can count orders that Shipment.orders leaves out. The ADMIN and OWNER roles do not widen the list. Defaults to CREATED_AT descending; ties sort by ID. Cursors continue across changes between pages and have no row limit. For the count that needs action, read totalCount with where.status [NOT_STARTED, READY_TO_SHIP].Requires a client key with one of these scopes: admin:shipments:readArguments:
after: String — Return shipments after this cursor. A cursor continues only the sort that issued it.
first: Int — Maximum number of shipments to return. Defaults to 20, at most 100 (500 for Soho).
query: String — Case-insensitive text anywhere in an order receipt code, the buyer or seller username or name, an item title, the label tracking number or a hand-added tracking number. With the admin:contactDetails:read scope, also matches the recipient name, company, street, city and country. A blank value matches every shipment.
sort: ShipmentSortInput — Sort order. Defaults to CREATED_AT descending.
where: ShipmentWhereInput — Filters to narrow the list.
shippingLabelBatchesViewerShippingLabelBatchConnection!
Label batches the caller started in this marketplace, newest first; ties sort by ID.Requires a client key with one of these scopes: admin:shipments:readArguments:
after: String — Returns batches after this cursor.
first: Int — The maximum number of batches. Defaults to 20, at most 100.
where: ShippingLabelBatchWhereInput — Filters to narrow the list.
shippingProfilesViewerShippingProfileConnection!
Shipping profiles of the caller and of the store owners the caller staffs, newest first. Deleted profiles are left out. Each profile belongs to its seller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:products:readArguments:
after: String — Returns profiles after this cursor.
first: Int — The maximum number of profiles. Defaults to 20, at most 100 (10,000 for Soho).
where: ShippingProfileWhereInput — Filters that narrow the list.
shippingScanFormsViewerShippingScanFormConnection!
SCAN forms of the caller and of the store owners the caller staffs, newest first; ties sort by ID. Pages have no row limit.Requires a client key with one of these scopes: admin:shipments:readArguments:
after: String — Returns forms after this cursor.
first: Int — The maximum number of forms. Defaults to 20, at most 100 (10,000 for Soho).
where: ShippingScanFormWhereInput — Filters the forms.
unreadNotificationCountCount!
Unread notifications in notifications. Exact up to 1,000; above that, count is 1,000 and precision is AT_LEAST.Requires a client key with one of these scopes: admin:account:read
userUser!
The caller's public profile.Requires a client key with one of these scopes: admin:account:read
walletTransactionsViewerWalletTransactionConnection!
The caller's wallet entries, newest first by default. Belongs to the caller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:payouts:readArguments:
after: String — Returns items after this cursor.
first: Int — 1 to 100 (1 to 10,000 for Soho); defaults to 20. Other values fail with VALIDATION_ERROR.
query: String — Text to find in descriptions, case-insensitive.
sort: WalletTransactionSortInput — The sort order.
where: WalletTransactionWhereInput — Filters that narrow the list.
wallets[Wallet!]!
The caller's wallets, one per currency. Belongs to the caller's account and applies in every marketplace the account sells in.Requires a client key with one of these scopes: admin:payouts:read
youtubeConnectionYoutubeChannelLink
The caller's linked YouTube channel, or null when none is connected.Requires a client key with one of these scopes: admin:social:read

Returned by