Update Customer

Update Customer Mutation

Updates an existing customer entity in the system.

Arguments

Name
Type
Description

id

ID!

The ID of the customer to update

input

UpdateCustomerInput!

Input data for updating the customer

Return Type

Customer - The updated customer object.

Input Fields

UpdateCustomerInput:

Field
Type
Description

dataTypeID

UUID

Optional data type ID

clearDataTypeID

Boolean

Clear the data type ID

dataTypeSlug

String

Optional data type slug

clearDataTypeSlug

Boolean

Clear the data type slug

data

Map

Custom data for the customer

clearData

Boolean

Clear all custom data

Usage Example

Update Strategies

Partial Updates

The mutation performs partial updates - only the fields you specify in the data object will be updated. Existing fields not mentioned remain unchanged.

Field Clearing

Use the clear* boolean fields to explicitly remove values:

  • clearDataTypeID: true - Removes the data type ID

  • clearDataTypeSlug: true - Removes the data type slug

  • clearData: true - Removes all custom data

Data Merging

When updating the data field, the new data is merged with existing data at the top level. To remove specific data fields, omit them from the update or use clearData: true to start fresh.

Common Update Scenarios

  • Contact Information: Update email, phone, address

  • Customer Status: Change customer tier, VIP status, account status

  • Financial Information: Modify credit limits, payment terms

  • Preferences: Update language, communication preferences

  • Business Information: Change company details, tax information

Notes

  • Only specify the fields you want to update

  • Use clear flags to explicitly remove optional fields

  • The data field supports nested objects for complex customer attributes

  • Consider updating related entities (orders, invoices) if customer information affects them

Last updated

Was this helpful?