All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
listCustomerSegments | GET /v2/customers/segments | ListCustomerSegments |
retrieveCustomerSegment | GET /v2/customers/segments/{segment_id} | RetrieveCustomerSegment |
Note: This endpoint is in beta.
ListCustomerSegmentsResponse listCustomerSegments(opts)
ListCustomerSegments
Retrieves the list of customer segments of a business.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SquareConnect.CustomerSegmentsApi();
var opts = {
'cursor': "cursor_example" // String | A pagination cursor returned by previous calls to __ListCustomerSegments__. Used to retrieve the next set of query results. See the [Pagination guide](https://developer.squareup.com/docs/docs/working-with-apis/pagination) for more information.
};
apiInstance.listCustomerSegments(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
cursor | String | A pagination cursor returned by previous calls to ListCustomerSegments. Used to retrieve the next set of query results. See the Pagination guide for more information. | [optional] |
- Content-Type: application/json
- Accept: application/json
Note: This endpoint is in beta.
RetrieveCustomerSegmentResponse retrieveCustomerSegment(segmentId)
RetrieveCustomerSegment
Retrieves a specific customer segment as identified by the `segment_id` value.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SquareConnect.CustomerSegmentsApi();
var segmentId = "segmentId_example"; // String | The Square-issued ID of the customer segment.
apiInstance.retrieveCustomerSegment(segmentId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
segmentId | String | The Square-issued ID of the customer segment. |
RetrieveCustomerSegmentResponse
- Content-Type: application/json
- Accept: application/json