Development
  • Guides
  • API Reference
  • API Explorer
  • SDKs
  • Sample apps
  • System status
Support
  • Developer forums
  • Developer blog
  • YouTube
  • X
More
  • Square Home
  • Square Developer
  • App Marketplace
  • Partner with Square
  • Solutions Partner Program
  • Pricing
  • Sales

© 2026 Square, Inc.

  • Developer terms of service
  • Developer Integration and Marketing Agreement
  • Privacy policy
  • Partnerships
  • Sign In
  • Sign In

    Customer Custom Attributes

  • List customer custom attribute definitions

  • Create customer custom attribute definition

  • Delete customer custom attribute definition

  • Retrieve customer custom attribute definition

  • Update customer custom attribute definition

  • Bulk upsert customer custom attributes

  • List customer custom attributes

  • Delete customer custom attribute

  • Retrieve customer custom attribute

  • Upsert customer custom attribute

  • Webhooks

  • customer.custom_attribute_definition.owned.created

  • customer.custom_attribute_definition.owned.deleted

  • customer.custom_attribute_definition.owned.updated

  • customer.custom_attribute_definition.visible.created

  • customer.custom_attribute_definition.visible.deleted

  • customer.custom_attribute_definition.visible.updated

  • customer.custom_attribute.owned.deleted

  • customer.custom_attribute.owned.updated

  • customer.custom_attribute.visible.deleted

  • customer.custom_attribute.visible.updated

<- Customer Custom Attributes API

Customer Custom Attributes API

All versions ->

Create customer custom attribute definition

POST

 /v2/customers/custom-attribute-definitions

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.

Permissions:CUSTOMERS_WRITE

Guide

Create customer custom attribute definition

Try in API Explorer
Link to section

Request body

Example code

Link to section

custom_attribute_definition

Required

The custom attribute definition to create. Note the following:

  • With the exception of the Selection data type, the schema is specified as a simple URL to the JSON schema definition hosted on the Square CDN. For more information, including supported values and constraints, see Specifying the schema.
  • If provided, name must be unique (case-sensitive) across all visible customer-related custom attribute definitions for the seller.
  • All custom attributes are visible in exported customer data, including those set to VISIBILITY_HIDDEN.
Link to section

idempotency_key

string

A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency.

Max Length
45
Link to section

Response fields

Link to section

custom_attribute_definition

The new custom attribute definition.

Link to section

errors

Any errors that occurred during the request.

Link to section

Examples

All versions ->

POST /v2/customers/custom-attribute-definitions
curl https://connect.squareup.com/v2/customers/custom-attribute-definitions \ -X POST \ -H 'Square-Version: 2026-11-18' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "custom_attribute_definition": { "description": "The favorite beverage of the customer.", "key": "favoritebeverage", "name": "Favorite Beverage", "schema": { "$schema": "https://developer-production-s.squarecdn.com/meta-schemas/v1/selection.json", "type": "array", "items": { "names": [ "water", "lemonade", "iced tea" ] }, "maxItems": 1, "uniqueItems": true }, "visibility": "VISIBILITY_HIDDEN" } }'

Response JSON

{ "custom_attribute_definition": { "key": "favoritebeverage", "name": "Favorite Beverage", "description": "The favorite beverage of the customer.", "version": 1, "updated_at": "2022-04-26T16:00:37Z", "schema": { "$schema": "https://developer-production-s.squarecdn.com/meta-schemas/v1/selection.json", "type": "array", "items": { "names": [ "water", "lemonade", "iced tea" ], "enum": [ "d012755e-6a3e-4fb8-8c17-d64f8483ecc9", "e21131a1-f1bc-467f-af95-4efb532bdd1a", "1c980583-2c0c-483b-af48-d6598a05320f" ] }, "maxItems": 1, "uniqueItems": true }, "created_at": "2022-04-26T16:00:37Z", "visibility": "VISIBILITY_HIDDEN" } }