All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
createBreakType | POST /v2/labor/break-types | CreateBreakType |
createShift | POST /v2/labor/shifts | CreateShift |
deleteBreakType | DELETE /v2/labor/break-types/{id} | DeleteBreakType |
deleteShift | DELETE /v2/labor/shifts/{id} | DeleteShift |
getBreakType | GET /v2/labor/break-types/{id} | GetBreakType |
getEmployeeWage | GET /v2/labor/employee-wages/{id} | GetEmployeeWage |
getShift | GET /v2/labor/shifts/{id} | GetShift |
listBreakTypes | GET /v2/labor/break-types | ListBreakTypes |
listEmployeeWages | GET /v2/labor/employee-wages | ListEmployeeWages |
listWorkweekConfigs | GET /v2/labor/workweek-configs | ListWorkweekConfigs |
searchShifts | POST /v2/labor/shifts/search | SearchShifts |
updateBreakType | PUT /v2/labor/break-types/{id} | UpdateBreakType |
updateShift | PUT /v2/labor/shifts/{id} | UpdateShift |
updateWorkweekConfig | PUT /v2/labor/workweek-configs/{id} | UpdateWorkweekConfig |
CreateBreakTypeResponse createBreakType(body)
CreateBreakType
Creates a new `BreakType`. A `BreakType` is a template for creating `Break` objects. You must provide the following values in your request to this endpoint: - `location_id` - `break_name` - `expected_duration` - `is_paid` You can only have 3 `BreakType` instances per location. If you attempt to add a 4th `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." is returned.
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.LaborApi();
var body = new SquareConnect.CreateBreakTypeRequest(); // CreateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.createBreakType(body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | CreateBreakTypeRequest | 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
CreateShiftResponse createShift(body)
CreateShift
Creates a new `Shift`. A `Shift` represents a complete work day for a single employee. You must provide the following values in your request to this endpoint: - `location_id` - `employee_id` - `start_at` An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - The `status` of the new `Shift` is `OPEN` and the employee has another shift with an `OPEN` status. - The `start_at` date is in the future - the `start_at` or `end_at` overlaps another shift for the same employee - If `Break`s are set in the request, a break `start_at` must not be before the `Shift.start_at`. A break `end_at` must not be after the `Shift.end_at`
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.LaborApi();
var body = new SquareConnect.CreateShiftRequest(); // CreateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.createShift(body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | CreateShiftRequest | 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
DeleteBreakTypeResponse deleteBreakType(id)
DeleteBreakType
Deletes an existing `BreakType`. A `BreakType` can be deleted even if it is referenced from a `Shift`.
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.LaborApi();
var id = "id_example"; // String | UUID for the `BreakType` being deleted.
apiInstance.deleteBreakType(id).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the `BreakType` being deleted. |
- Content-Type: application/json
- Accept: application/json
DeleteShiftResponse deleteShift(id)
DeleteShift
Deletes a `Shift`.
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.LaborApi();
var id = "id_example"; // String | UUID for the `Shift` being deleted.
apiInstance.deleteShift(id).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the `Shift` being deleted. |
- Content-Type: application/json
- Accept: application/json
GetBreakTypeResponse getBreakType(id)
GetBreakType
Returns a single `BreakType` specified by id.
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.LaborApi();
var id = "id_example"; // String | UUID for the `BreakType` being retrieved.
apiInstance.getBreakType(id).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the `BreakType` being retrieved. |
- Content-Type: application/json
- Accept: application/json
GetEmployeeWageResponse getEmployeeWage(id)
GetEmployeeWage
Returns a single `EmployeeWage` specified by id.
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.LaborApi();
var id = "id_example"; // String | UUID for the `EmployeeWage` being retrieved.
apiInstance.getEmployeeWage(id).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the `EmployeeWage` being retrieved. |
- Content-Type: application/json
- Accept: application/json
GetShiftResponse getShift(id)
GetShift
Returns a single `Shift` specified by id.
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.LaborApi();
var id = "id_example"; // String | UUID for the `Shift` being retrieved.
apiInstance.getShift(id).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the `Shift` being retrieved. |
- Content-Type: application/json
- Accept: application/json
ListBreakTypesResponse listBreakTypes(opts)
ListBreakTypes
Returns a paginated list of `BreakType` instances for 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.LaborApi();
var opts = {
'locationId': "locationId_example", // String | Filter Break Types returned to only those that are associated with the specified location.
'limit': 56, // Number | Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200.
'cursor': "cursor_example" // String | Pointer to the next page of Break Type results to fetch.
};
apiInstance.listBreakTypes(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
locationId | String | Filter Break Types returned to only those that are associated with the specified location. | [optional] |
limit | Number | Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200. | [optional] |
cursor | String | Pointer to the next page of Break Type results to fetch. | [optional] |
- Content-Type: application/json
- Accept: application/json
ListEmployeeWagesResponse listEmployeeWages(opts)
ListEmployeeWages
Returns a paginated list of `EmployeeWage` instances for 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.LaborApi();
var opts = {
'employeeId': "employeeId_example", // String | Filter wages returned to only those that are associated with the specified employee.
'limit': 56, // Number | Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200.
'cursor': "cursor_example" // String | Pointer to the next page of Employee Wage results to fetch.
};
apiInstance.listEmployeeWages(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
employeeId | String | Filter wages returned to only those that are associated with the specified employee. | [optional] |
limit | Number | Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200. | [optional] |
cursor | String | Pointer to the next page of Employee Wage results to fetch. | [optional] |
- Content-Type: application/json
- Accept: application/json
ListWorkweekConfigsResponse listWorkweekConfigs(opts)
ListWorkweekConfigs
Returns a list of `WorkweekConfig` instances for 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.LaborApi();
var opts = {
'limit': 56, // Number | Maximum number of Workweek Configs to return per page.
'cursor': "cursor_example" // String | Pointer to the next page of Workweek Config results to fetch.
};
apiInstance.listWorkweekConfigs(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
limit | Number | Maximum number of Workweek Configs to return per page. | [optional] |
cursor | String | Pointer to the next page of Workweek Config results to fetch. | [optional] |
- Content-Type: application/json
- Accept: application/json
SearchShiftsResponse searchShifts(body)
SearchShifts
Returns a paginated list of `Shift` records for a business. The list to be returned can be filtered by: - Location IDs and - employee IDs and - shift status (`OPEN`, `CLOSED`) and - shift start and - shift end and - work day details The list can be sorted by: - `start_at` - `end_at` - `created_at` - `updated_at`
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.LaborApi();
var body = new SquareConnect.SearchShiftsRequest(); // SearchShiftsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.searchShifts(body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | SearchShiftsRequest | 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
UpdateBreakTypeResponse updateBreakType(id, body)
UpdateBreakType
Updates an existing `BreakType`.
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.LaborApi();
var id = "id_example"; // String | UUID for the `BreakType` being updated.
var body = new SquareConnect.UpdateBreakTypeRequest(); // UpdateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.updateBreakType(id, body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the `BreakType` being updated. | |
body | UpdateBreakTypeRequest | 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
UpdateShiftResponse updateShift(id, body)
UpdateShift
Updates an existing `Shift`. When adding a `Break` to a `Shift`, any earlier `Breaks` in the `Shift` have the `end_at` property set to a valid RFC-3339 datetime string. When closing a `Shift`, all `Break` instances in the shift must be complete with `end_at` set on each `Break`.
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.LaborApi();
var id = "id_example"; // String | ID of the object being updated.
var body = new SquareConnect.UpdateShiftRequest(); // UpdateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.updateShift(id, body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | ID of the object being updated. | |
body | UpdateShiftRequest | 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
UpdateWorkweekConfigResponse updateWorkweekConfig(id, body)
UpdateWorkweekConfig
Updates a `WorkweekConfig`.
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.LaborApi();
var id = "id_example"; // String | UUID for the `WorkweekConfig` object being updated.
var body = new SquareConnect.UpdateWorkweekConfigRequest(); // UpdateWorkweekConfigRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.updateWorkweekConfig(id, body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the `WorkweekConfig` object being updated. | |
body | UpdateWorkweekConfigRequest | 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