Skip to main content

removeCustomer

Requires permission customers:customer:delete.

Deletes a customer. Refused while the customer has draft, confirmed, partially invoiced or invoiced orders. If the record also has the supplier role, only the customer role is removed. Needs the customers delete 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:

mutation RemoveCustomer($id: ID!) {
removeCustomer(id: $id) {
id
code
registrationNumber
name
customerTierName
displayName
addresses {
id
postalCode
contactName
type
createdAt
addressLine1
}
}
}

Variables:

{
"id": "id"
}

Response:

{
"data": {
"removeCustomer": {
"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"
}
]
}
}
}
removeCustomer(
id: ID!
): Customer!

Arguments​

removeCustomer.id ● ID! non-null scalar​

The ID of the customer.

Type​

Customer object​

A customer: a partner with the customer role.