SquareConnect\CustomerSegmentsApi

April 22, 2020 ยท View on GitHub

All URIs are relative to https://connect.squareup.com

MethodHTTP requestDescription
listCustomerSegmentsGET /v2/customers/segmentsListCustomerSegments
retrieveCustomerSegmentGET /v2/customers/segments/{segment_id}RetrieveCustomerSegment

listCustomerSegments

Note: This endpoint is in beta.

\SquareConnect\Model\ListCustomerSegmentsResponse listCustomerSegments($cursor)

ListCustomerSegments

Retrieves the list of customer segments of a business.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\CustomerSegmentsApi();
$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.

try {
    $result = $apiInstance->listCustomerSegments($cursor);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerSegmentsApi->listCustomerSegments: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
cursorstringA 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]

Return type

\SquareConnect\Model\ListCustomerSegmentsResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveCustomerSegment

Note: This endpoint is in beta.

\SquareConnect\Model\RetrieveCustomerSegmentResponse retrieveCustomerSegment($segment_id)

RetrieveCustomerSegment

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

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\CustomerSegmentsApi();
$segment_id = "segment_id_example"; // string | The Square-issued ID of the customer segment.

try {
    $result = $apiInstance->retrieveCustomerSegment($segment_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerSegmentsApi->retrieveCustomerSegment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
segment_idstringThe Square-issued ID of the customer segment.

Return type

\SquareConnect\Model\RetrieveCustomerSegmentResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]