updateCustomer
Requires permission customers:customer:update.
Updates a customer. Needs the customers update permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation UpdateCustomer($updateCustomerInput: UpdateCustomerInput!) {
updateCustomer(updateCustomerInput: $updateCustomerInput) {
id
code
registrationNumber
name
customerTierName
displayName
addresses {
id
postalCode
contactName
type
createdAt
addressLine1
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateCustomer($updateCustomerInput: UpdateCustomerInput!) {\n updateCustomer(updateCustomerInput: $updateCustomerInput) {\n id\n code\n registrationNumber\n name\n customerTierName\n displayName\n addresses {\n id\n postalCode\n contactName\n type\n createdAt\n addressLine1\n }\n }\n}",
"variables": {
"updateCustomerInput": {
"id": "id"
}
}
}
EOF
Variables:
{
"updateCustomerInput": {
"id": "id"
}
}
Response:
{
"data": {
"updateCustomer": {
"id": "id",
"code": "string",
"registrationNumber": "string",
"name": "string",
"customerTierName": "string",
"displayName": "string",
"addresses": [
{
"id": "id",
"postalCode": "string",
"contactName": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"addressLine1": "string"
}
]
}
}
}
updateCustomer(
updateCustomerInput: UpdateCustomerInput!
): Customer!
Arguments
updateCustomer.updateCustomerInput ● UpdateCustomerInput! non-null input
The ID of the customer and the fields to change.
Type
Customer object
A customer: a partner with the customer role.