All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
createCustomerGroup | POST /v2/customers/groups | CreateCustomerGroup |
deleteCustomerGroup | DELETE /v2/customers/groups/{group_id} | DeleteCustomerGroup |
listCustomerGroups | GET /v2/customers/groups | ListCustomerGroups |
retrieveCustomerGroup | GET /v2/customers/groups/{group_id} | RetrieveCustomerGroup |
updateCustomerGroup | PUT /v2/customers/groups/{group_id} | UpdateCustomerGroup |
Note: This endpoint is in beta.
\SquareConnect\Model\CreateCustomerGroupResponse createCustomerGroup($body)
CreateCustomerGroup
Creates a new customer group for a business. The request must include the name
value of the group.
<?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\CustomerGroupsApi();
$body = new \SquareConnect\Model\CreateCustomerGroupRequest(); // \SquareConnect\Model\CreateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->createCustomerGroup($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomerGroupsApi->createCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \SquareConnect\Model\CreateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\CreateCustomerGroupResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Note: This endpoint is in beta.
\SquareConnect\Model\DeleteCustomerGroupResponse deleteCustomerGroup($group_id)
DeleteCustomerGroup
Deletes a customer group as identified by the group_id
value.
<?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\CustomerGroupsApi();
$group_id = "group_id_example"; // string | The ID of the customer group to delete.
try {
$result = $apiInstance->deleteCustomerGroup($group_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomerGroupsApi->deleteCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
group_id | string | The ID of the customer group to delete. |
\SquareConnect\Model\DeleteCustomerGroupResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Note: This endpoint is in beta.
\SquareConnect\Model\ListCustomerGroupsResponse listCustomerGroups($cursor)
ListCustomerGroups
Retrieves the list of customer groups of a business.
<?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\CustomerGroupsApi();
$cursor = "cursor_example"; // string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information.
try {
$result = $apiInstance->listCustomerGroups($cursor);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomerGroupsApi->listCustomerGroups: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
cursor | string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See the Pagination guide for more information. | [optional] |
\SquareConnect\Model\ListCustomerGroupsResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Note: This endpoint is in beta.
\SquareConnect\Model\RetrieveCustomerGroupResponse retrieveCustomerGroup($group_id)
RetrieveCustomerGroup
Retrieves a specific customer group as identified by the group_id
value.
<?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\CustomerGroupsApi();
$group_id = "group_id_example"; // string | The ID of the customer group to retrieve.
try {
$result = $apiInstance->retrieveCustomerGroup($group_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomerGroupsApi->retrieveCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
group_id | string | The ID of the customer group to retrieve. |
\SquareConnect\Model\RetrieveCustomerGroupResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Note: This endpoint is in beta.
\SquareConnect\Model\UpdateCustomerGroupResponse updateCustomerGroup($group_id, $body)
UpdateCustomerGroup
Updates a customer group as identified by the group_id
value.
<?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\CustomerGroupsApi();
$group_id = "group_id_example"; // string | The ID of the customer group to update.
$body = new \SquareConnect\Model\UpdateCustomerGroupRequest(); // \SquareConnect\Model\UpdateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->updateCustomerGroup($group_id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomerGroupsApi->updateCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
group_id | string | The ID of the customer group to update. | |
body | \SquareConnect\Model\UpdateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\UpdateCustomerGroupResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]