updateCustomer
Topics: Commerce
Update a customer. Only provided fields are changed. Requires customer:write permission.
Returns
UpsertCustomerPayload!Arguments
Customer ID to update
Fields to update — only provided fields are changed
Examples
Update Customer Details
mutation UpdateCustomerDetails($id: CustomerID!, $input: UpdateCustomerInput!) {
updateCustomer(id: $id, input: $input) {
customer { id email notes updatedAt }
errors { path message }
}
}Variables
{
"id": "cus_01h455vb4pex5vsknk084sn02q",
"input": {
"email": "purchasing@northstar.example",
"notes": "Call the receiving contact before delivery."
}
}Mark Customer Inactive
mutation MarkCustomerInactive($id: CustomerID!) {
updateCustomer(id: $id, input: {isActive: false}) {
customer { id name isActive }
errors { path message }
}
}Variables
{
"id": "cus_01h455vb4pex5vsknk084sn02q"
}Exact field SDL
"""
Update a customer. Only provided fields are changed. Requires customer:write permission.
"""
updateCustomer(
"""Customer ID to update"""
id: CustomerID!
"""Fields to update — only provided fields are changed"""
input: UpdateCustomerInput!
): UpsertCustomerPayload! @topic(names: ["commerce"]) @topic_example(names: ["crm.update-customer-details", "crm.mark-customer-inactive"])Declared on Mutation. Access is checked by the platform for each operation.