user Query
Description
Retrieves a single buyer by reference ID. Returns the buyer with statistics including order count, order total, credit notes count, wants count, and vouchers count.
query user($userRef: ID!) {
user(userRef: $userRef) {
_id
created
updated
lastLogin
active
birthdate
firstName
lastName
email
name
path
telephone
organisation
taxNumber
lists {
_id
ref
added
lastModified
}
accountCreated
addresses {
_id
description
firstName
lastName
addressLine1
addressLine2
streetNumber
city
state
stateCode
postCode
alpha2
country
type
}
notes
verification {
status
token
code
date
hash
}
orderCount
orderTotal
creditNotesCount
wantsCount
vouchersCount
type
}
}
Variables
{
"userRef": "9dfd1936f596aecf133fcd32"
}
Response
{
"user": {
"_id": "1456c987a1fec7c10a37a46c",
"created": 1730977203486,
"updated": 1737875838781,
"lastLogin": 1765731762209,
"active": true,
"birthdate": 1731646696766,
"firstName": "example",
"lastName": "example",
"email": "email@example.com",
"name": "example",
"path": "/release/1763553751/release-artist-release-name",
"telephone": "example",
"organisation": "example",
"taxNumber": "example",
"lists": [
{
"_id": "235e8b80229bd0b299562860",
"ref": "f0c7a0ea5fdc580749cb3445",
"added": 1762290323916,
"lastModified": 1754613589391
}
],
"accountCreated": true,
"addresses": [
{
"_id": "4349fbe1deb74b9c070a8f63",
"description": "example",
"firstName": "example",
"lastName": "example",
"addressLine1": "example",
"addressLine2": "example",
"streetNumber": 42,
"city": "example",
"state": "example",
"stateCode": "example",
"postCode": "example",
"alpha2": "example",
"country": "example",
"type": "example"
}
],
"notes": "example",
"verification": {
"status": true,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ",
"code": "example",
"date": 1720943212071,
"hash": "example"
},
"orderCount": 42,
"orderTotal": 1.23,
"creditNotesCount": 42,
"wantsCount": 42,
"vouchersCount": 42,
"type": "example"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
userRef | ID! | Reference ID of the buyer to retrieve. |