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
checkoutCount
type
}
}
Variables
{
"userRef": "d67e6d1412dfcf64ae8e9b8a"
}
Response
{
"user": {
"_id": "1afa60183ad6b2026215e346",
"created": 1728780206330,
"updated": 1743010092194,
"lastLogin": 1720363382996,
"active": true,
"birthdate": 1718762652942,
"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": "7dfe76af3010f2df0ac6b8ad",
"ref": "96f620a4884e76f0952ff412",
"added": 1749354981982,
"lastModified": 1749584255259
}
],
"accountCreated": true,
"addresses": [
{
"_id": "16e5cd73e319cc437407fa77",
"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": 1737452754103,
"hash": "example"
},
"orderCount": 42,
"orderTotal": 1.23,
"creditNotesCount": 42,
"wantsCount": 42,
"vouchersCount": 42,
"checkoutCount": 42,
"type": "example"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
userRef | ID! | Reference ID of the buyer to retrieve. |