Skip to main content

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": "237c9704fc097ee96fd546a8"
}

Response​

{
"user": {
"_id": "32083a0b1a4f5ef70bd73991",
"created": 1766132570375,
"updated": 1748665402056,
"lastLogin": 1769129651633,
"active": true,
"birthdate": 1728226751518,
"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": "aca4db3e97fe08c35aa6276f",
"ref": "d898874820e3c5dfd75a90f2",
"added": 1781973095805,
"lastModified": 1772308082246
}
],
"accountCreated": true,
"addresses": [
{
"_id": "5db176f50af56cf7a2f5f656",
"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": 1779046580249,
"hash": "example"
},
"orderCount": 42,
"orderTotal": 1.23,
"creditNotesCount": 42,
"wantsCount": 42,
"vouchersCount": 42,
"checkoutCount": 42,
"type": "example"
}
}

Arguments​

NameTypeDescription
userRefID!Reference ID of the buyer to retrieve.

Returns​

Buyer