updateCustomer
Update a customer. Only the provided fields change; passing null for a nullable
field clears it, so parentId: null removes the customer from its family.
Business Rules
- At least one field besides
idmust be provided. nameandcustomerTypecannot be cleared, only replaced.taxExemptandbillToSameAsShipTocannot be set to null.handle, when given, is unique within the company, archived customers included.parentIdkeeps the single-level family invariant: the parent may not itself have a parent, and a customer that already has children cannot be given one.shippingAccountsreplaces the whole set: include the id of a row to keep it, and pass an empty list to remove them all.- Default addresses change only when their argument is provided. Pass null to remove
that typed address.
billingAddressmay be provided only when the effectivebillToSameAsShipTovalue is false. - Archived customers can still be updated.
Error Scenarios
- **
BAD_REQUEST**: no updatable field was provided;nameis blank or longer than 255 characters;emailorwebsiteis malformed;customerTypeorfreightPayeris outside the accepted values;taxExemptorbillToSameAsShipTowas set to null; a contact preference is too long; a billing address is provided while bill-to mirrors ship-to; a shipping account is missing its carrier or account number, or belongs to another customer; the customer is given itself as parent; or the family would end up more than one level deep. - **
NOT_FOUND**: the customer,salesChannelId,parentIdordefaultTemplateIddoes not belong to this company. - **
CONFLICT**: another customer in the company already uses thishandle.
Permissions Required
customers:update_customerpermission.
updateCustomer(
input: UpdateCustomerInput!
): UpdateCustomerPayload
Arguments
updateCustomer.input ● UpdateCustomerInput! non-null input common
Parameters for UpdateCustomer
Type
UpdateCustomerPayload object common
Autogenerated return type of UpdateCustomer.