CustomerCustomAttributes
CreateCustomerCustomAttributeDefinition
Creates a customer-related custom attribute definition for a Square seller account. Use this endpoint to define a custom attribute that can be associated with customer profiles.
A custom attribute definition specifies the key, visibility, schema, and other properties for a custom attribute. After the definition is created, you can call UpsertCustomerCustomAttribute or BulkUpsertCustomerCustomAttributes to set the custom attribute for customer profiles in the seller's Customer Directory.
Sellers can view all custom attributes in exported customer data, including those set to VISIBILITY_HIDDEN.
post/v2/customers/custom-attribute-definitions
Request body
Example request
{
"custom_attribute_definition": {
"description": "The favorite movie of the customer.",
"key": "favoritemovie",
"name": "Favorite Movie",
"schema": {
"$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"
},
"visibility": "VISIBILITY_HIDDEN"
}
}Response
Success
Example response
{
"custom_attribute_definition": {
"created_at": "2022-04-26T15:27:30Z",
"description": "The favorite movie of the customer.",
"key": "favoritemovie",
"name": "Favorite Movie",
"schema": {
"$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"
},
"updated_at": "2022-04-26T15:27:30Z",
"version": 1,
"visibility": "VISIBILITY_HIDDEN"
}
}