A customer segment (also called a Smart Group) is a dynamic collection of customers who meet a set of filter criteria. While sellers can define the criteria for a segment, membership in the segment is dynamically adjusted based on the criteria. For example, a seller can create a "Visited more than 10 times" segment based on a "visits greater than 10" filter. The membership in the segment then updates dynamically as customers pass the threshold of 10 visits.
The Customer Segments API lets you view segment metadata. The following is an example customer segment:
Sellers define segments in the Seller Dashboard or Square Point of Sale. Square APIs cannot be used to create or manage customer segment definitions or view segment criteria. To learn how sellers create customer segments, see Manage Customer Groups and Filters.
The Customers API lets you search for customers based on membership in up to three customer segments. If a customer belongs to one or more customer segments, the corresponding customer profile includes a
segment_ids field that lists the IDs of the segments to which the customer belongs. This excerpt of a customer profile shows that the customer currently belongs to five segments: