Skip to main content

userBuyerUpdate Mutation

Description

Updates a buyer's information. You can update email, personal details, contact information, addresses, list memberships, notes, and birthdate. Only the fields provided in the input are updated; other fields remain unchanged. Email must be unique if changed.

mutation userBuyerUpdate(
$userRef: ID!
$userBuyerUpdateInput: UserBuyerUpdateInput!
) {
userBuyerUpdate(
userRef: $userRef
userBuyerUpdateInput: $userBuyerUpdateInput
) {
_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": "5c1cab39de413b02c55913e5",
"userBuyerUpdateInput": {
"email": "email@example.com",
"firstName": "John",
"lastName": "Doe",
"telephone": "telephone",
"organisation": "organisation",
"taxNumber": "taxNumber",
"lists": [
"47d8ef1642173c2efc82ccff"
],
"addresses": [
{
"description": "A description",
"addressLine1": "addressLine1",
"addressLine2": "addressLine2",
"streetNumber": 42,
"city": "Montreal",
"state": "Quebec",
"postCode": "postCode",
"alpha2": "alpha2",
"country": "Canada",
"stateCode": "stateCode",
"type": "type",
"geoLoc": {
"type": "type",
"coordinates": [
30.7
]
}
}
],
"notes": "notes",
"birthdate": 1715207682919
}
}

Response

{
"userBuyerUpdate": {
"_id": "11d81c135064bf5343a4745f",
"created": 1712886869097,
"updated": 1712021762046,
"lastLogin": 1751584420695,
"active": true,
"birthdate": 1720076637595,
"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": "d63890d2a7c01bef614c25af",
"ref": "2fa5c5fa14d47ac22d9e9375",
"added": 1743088197494,
"lastModified": 1753055330818
}
],
"accountCreated": true,
"addresses": [
{
"_id": "8a55449181e42e313a943eeb",
"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": 1751302845066,
"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 update.
userBuyerUpdateInputUserBuyerUpdateInput!Buyer update data including email, personal details, addresses, lists, and notes.

Returns

Buyer!