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
| Name | Type | Description |
|---|---|---|
orderRef | String | Order reference ID to filter messages by a specific order. |
page | Int | The requested page number. Defaults to 1 if not specified. |
from | FromEnum | Filter messages by sender type. Use FromEnum enum values. |