Customer Segments API Overview
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.
Membership in customer groups behaves differently than membership in customer segments. Customers are explicitly added to customer groups by the seller or developer. For more information, see Customer Groups API Overview.
You can use the Customer Segments API and Customers API to find or track basic information about the segments to which customers belong.
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:
API Reference: Customer Segments
API Reference: Customers API
If you need more assistance, contact Developer Support or ask for help in the Developer Forums.