Skip to content

Latest commit

 

History

History
81 lines (51 loc) · 1.85 KB

customer-segments.md

File metadata and controls

81 lines (51 loc) · 1.85 KB

Customer Segments

customer_segments_api = client.customer_segments

Class Name

CustomerSegmentsApi

Methods

List Customer Segments

Retrieves the list of customer segments of a business.

def list_customer_segments(self,
                          cursor=None)

Parameters

Parameter Type Tags Description
cursor string Query, Optional A pagination cursor returned by previous calls to ListCustomerSegments.
This cursor is used to retrieve the next set of query results.

For more information, see Pagination.

Response Type

List Customer Segments Response

Example Usage

cursor = 'cursor6'

result = customer_segments_api.list_customer_segments(cursor)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

Retrieve Customer Segment

Retrieves a specific customer segment as identified by the segment_id value.

def retrieve_customer_segment(self,
                             segment_id)

Parameters

Parameter Type Tags Description
segment_id string Template, Required The Square-issued ID of the customer segment.

Response Type

Retrieve Customer Segment Response

Example Usage

segment_id = 'segment_id4'

result = customer_segments_api.retrieve_customer_segment(segment_id)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)