addCustomerAttributeDefinition
Define a custom attribute that can be set on customers, such as "Region" or "Account Tier".
Business Rules
- The name is unique within the company.
- A handle is derived from the name when omitted. Handles are lowercase, start with a letter, hold only letters, numbers and hyphens, and are at most 50 characters.
- A name and a handle stay reserved while the definition holding them is archived.
Use
updateCustomerAttributeDefinitionwithrestore: trueto bring that definition back, together with the values archived with it.
Error Scenarios
- **
BAD_REQUEST**: the name is blank, already used by another definition, or held by an archived one; the handle is malformed, too long, already used, or held by an archived definition; or no handle could be derived from the name.
Permissions Required
customers:add_attribute_definitionpermission.
addCustomerAttributeDefinition(
input: AddCustomerAttributeDefinitionInput!
): AddCustomerAttributeDefinitionPayload
Arguments
addCustomerAttributeDefinition.input ● AddCustomerAttributeDefinitionInput! non-null input common
Parameters for AddCustomerAttributeDefinition
Type
AddCustomerAttributeDefinitionPayload object common
Autogenerated return type of AddCustomerAttributeDefinition.