Skip to main content

messages Query

Description

Retrieves a paginated list of messages with optional filtering by order reference and sender type. Results are sorted by timestamp. For marketplace orders, messages may be retrieved from the marketplace system. Page size limits are enforced by the server; 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.

query messages($orderRef: String, $page: Int, $from: FromEnum) {
messages(orderRef: $orderRef, page: $page, from: $from) {
messages {
_id
created
subject
message
fromBuyer
flagged
content
read
orderId
orderIncId
uri
via
}
pagination {
limit
count
page
pages
hasMore
}
}
}

Variables

{
"orderRef": "17eec42b08417741aa97b81f",
"page": 1,
"from": "buyer"
}

Response

{
"messages": {
"messages": [
{
"_id": "e7d54491d29f7f44c7f498a3",
"created": 1722946165061,
"subject": "example",
"message": "example",
"fromBuyer": true,
"flagged": true,
"content": "example",
"read": true,
"orderId": "example",
"orderIncId": 42,
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"via": "example"
}
],
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true
}
}
}

Arguments

NameTypeDescription
orderRefStringOrder reference ID to filter messages by a specific order.
pageIntThe requested page number. Defaults to 1 if not specified.
fromFromEnumFilter messages by sender type. Use FromEnum enum values.

Returns

MessagesConnection!