Skip to main content

⚠️ Deprecated: Use orders(ordersFiltersInput: { itemRef }) instead.

itemSalesStatistics Query

Description​

Retrieves sales statistics for a specific item, showing all orders that include this item with pagination.

Deprecated: this returns nothing the orders query does not already provide — query `orders(ordersFiltersInput: { itemRef })` instead, which supports the same pagination and sorting.

query itemSalesStatistics(
$itemRef: ID!
$page: Int
$limit: Int
$sort: String
$order: Int
) {
itemSalesStatistics(
itemRef: $itemRef
page: $page
limit: $limit
sort: $sort
order: $order
) {
orders {
_id
id
incId
origin
created
modified
orderId
instructions
updated
status
discogsStatus
buyerWasContacted
unreadMessagesCount
path
}
pagination {
limit
count
page
pages
hasMore
}
}
}

Variables​

{
"itemRef": "20288c9a32595589c054af70",
"page": 1,
"limit": 20,
"sort": "sort",
"order": -1
}

Response​

{
"itemSalesStatistics": {
"orders": [
{
"_id": "68d1002d464ebcffc4cbdb83",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1771095709164,
"modified": 1761581617867,
"orderId": "example",
"instructions": "example",
"updated": 1741715881260,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"path": "/release/1763553751/release-artist-release-name"
}
],
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true
}
}
}

Arguments​

NameTypeDescription
itemRefID!Reference ID of the item to get sales statistics for.
pageIntThe requested page number. Defaults to 1 if not specified.
limitIntNumber of orders per page. You can request a specific page size, and it will be used if it does not exceed the server-enforced maximum. If your requested size exceeds the maximum, the server will enforce the maximum limit.
sortStringField to sort the orders by (e.g. createdDate, status, billingStatus, shippingStatus, total). Defaults to createdDate.
orderIntSort direction: 1 for ascending, -1 for descending. Defaults to -1.

Returns​

ItemSalesStatistics