userBuyerDelete Mutation
Description
Deletes a buyer by anonymizing their data. The buyer's personal information is removed, email is anonymized, and the buyer is marked as inactive. Associated sessions, checkouts, and wants are also deleted. The buyer is removed from all customer lists. Returns the anonymized buyer.
mutation userBuyerDelete($userRef: ID!) {
userBuyerDelete(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": "a8753f0a838cc61ddc3ab67e"
}
Response
{
"userBuyerDelete": {
"_id": "25cea37b11a6a01a28f8273b",
"created": 1722548489355,
"updated": 1740314080507,
"lastLogin": 1719190342995,
"active": true,
"birthdate": 1725952572527,
"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": "ad0ee5b6d57e2562c0b72b17",
"ref": "840c51f058b0f91712204661",
"added": 1719072092781,
"lastModified": 1735280703082
}
],
"accountCreated": true,
"addresses": [
{
"_id": "d6dc200d6aec34913ec95ca1",
"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": 1715498582195,
"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 delete. |