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 |
CreateCustomerGroupResponse createCustomerGroup(body)
CreateCustomerGroup
Creates a new customer group for a business. The request must include the `name` value of the group.
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.CustomerGroupsApi();
var body = SquareConnect.CustomerGroupsApi.constructFromObject({}); // CreateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.createCustomerGroup(body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | CreateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
- Content-Type: application/json
- Accept: application/json
DeleteCustomerGroupResponse deleteCustomerGroup(groupId)
DeleteCustomerGroup
Deletes a customer group as identified by the `group_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.CustomerGroupsApi();
var groupId = SquareConnect.CustomerGroupsApi.constructFromObject({}); // String | The ID of the customer group to delete.
apiInstance.deleteCustomerGroup(groupId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
groupId | String | The ID of the customer group to delete. |
- Content-Type: application/json
- Accept: application/json
ListCustomerGroupsResponse listCustomerGroups(opts)
ListCustomerGroups
Retrieves the list of customer groups 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.CustomerGroupsApi();
var opts = {
'cursor': SquareConnect.CustomerGroupsApi.constructFromObject({}); // 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.
};
apiInstance.listCustomerGroups(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 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] |
- Content-Type: application/json
- Accept: application/json
RetrieveCustomerGroupResponse retrieveCustomerGroup(groupId)
RetrieveCustomerGroup
Retrieves a specific customer group as identified by the `group_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.CustomerGroupsApi();
var groupId = SquareConnect.CustomerGroupsApi.constructFromObject({}); // String | The ID of the customer group to retrieve.
apiInstance.retrieveCustomerGroup(groupId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
groupId | String | The ID of the customer group to retrieve. |
- Content-Type: application/json
- Accept: application/json
UpdateCustomerGroupResponse updateCustomerGroup(groupId, body)
UpdateCustomerGroup
Updates a customer group as identified by the `group_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.CustomerGroupsApi();
var groupId = SquareConnect.CustomerGroupsApi.constructFromObject({}); // String | The ID of the customer group to update.
var body = SquareConnect.CustomerGroupsApi.constructFromObject({}); // UpdateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.updateCustomerGroup(groupId, body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
groupId | String | The ID of the customer group to update. | |
body | UpdateCustomerGroupRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
- Content-Type: application/json
- Accept: application/json