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 |
\SquareConnect\Model\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.
<?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\LaborApi();
$body = new \SquareConnect\Model\CreateBreakTypeRequest(); // \SquareConnect\Model\CreateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->createBreakType($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->createBreakType: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \SquareConnect\Model\CreateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\CreateBreakTypeResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\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
<?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\LaborApi();
$body = new \SquareConnect\Model\CreateShiftRequest(); // \SquareConnect\Model\CreateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->createShift($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->createShift: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \SquareConnect\Model\CreateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\CreateShiftResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\DeleteBreakTypeResponse deleteBreakType($id)
DeleteBreakType
Deletes an existing BreakType
. A BreakType
can be deleted even if it is referenced from a Shift
.
<?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\LaborApi();
$id = "id_example"; // string | UUID for the `BreakType` being deleted.
try {
$result = $apiInstance->deleteBreakType($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->deleteBreakType: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `BreakType` being deleted. |
\SquareConnect\Model\DeleteBreakTypeResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\DeleteShiftResponse deleteShift($id)
DeleteShift
Deletes a Shift
.
<?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\LaborApi();
$id = "id_example"; // string | UUID for the `Shift` being deleted.
try {
$result = $apiInstance->deleteShift($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->deleteShift: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `Shift` being deleted. |
\SquareConnect\Model\DeleteShiftResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\GetBreakTypeResponse getBreakType($id)
GetBreakType
Returns a single BreakType
specified by id.
<?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\LaborApi();
$id = "id_example"; // string | UUID for the `BreakType` being retrieved.
try {
$result = $apiInstance->getBreakType($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->getBreakType: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `BreakType` being retrieved. |
\SquareConnect\Model\GetBreakTypeResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\GetEmployeeWageResponse getEmployeeWage($id)
GetEmployeeWage
Returns a single EmployeeWage
specified by id.
<?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\LaborApi();
$id = "id_example"; // string | UUID for the `EmployeeWage` being retrieved.
try {
$result = $apiInstance->getEmployeeWage($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->getEmployeeWage: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `EmployeeWage` being retrieved. |
\SquareConnect\Model\GetEmployeeWageResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\GetShiftResponse getShift($id)
GetShift
Returns a single Shift
specified by id.
<?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\LaborApi();
$id = "id_example"; // string | UUID for the `Shift` being retrieved.
try {
$result = $apiInstance->getShift($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->getShift: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `Shift` being retrieved. |
\SquareConnect\Model\GetShiftResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\ListBreakTypesResponse listBreakTypes($location_id, $limit, $cursor)
ListBreakTypes
Returns a paginated list of BreakType
instances for 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\LaborApi();
$location_id = "location_id_example"; // string | Filter Break Types returned to only those that are associated with the specified location.
$limit = 56; // int | 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.
try {
$result = $apiInstance->listBreakTypes($location_id, $limit, $cursor);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->listBreakTypes: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
location_id | string | Filter Break Types returned to only those that are associated with the specified location. | [optional] |
limit | int | 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] |
\SquareConnect\Model\ListBreakTypesResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\ListEmployeeWagesResponse listEmployeeWages($employee_id, $limit, $cursor)
ListEmployeeWages
Returns a paginated list of EmployeeWage
instances for 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\LaborApi();
$employee_id = "employee_id_example"; // string | Filter wages returned to only those that are associated with the specified employee.
$limit = 56; // int | 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.
try {
$result = $apiInstance->listEmployeeWages($employee_id, $limit, $cursor);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->listEmployeeWages: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
employee_id | string | Filter wages returned to only those that are associated with the specified employee. | [optional] |
limit | int | 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] |
\SquareConnect\Model\ListEmployeeWagesResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\ListWorkweekConfigsResponse listWorkweekConfigs($limit, $cursor)
ListWorkweekConfigs
Returns a list of WorkweekConfig
instances for 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\LaborApi();
$limit = 56; // int | Maximum number of Workweek Configs to return per page.
$cursor = "cursor_example"; // string | Pointer to the next page of Workweek Config results to fetch.
try {
$result = $apiInstance->listWorkweekConfigs($limit, $cursor);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->listWorkweekConfigs: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Maximum number of Workweek Configs to return per page. | [optional] |
cursor | string | Pointer to the next page of Workweek Config results to fetch. | [optional] |
\SquareConnect\Model\ListWorkweekConfigsResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\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
<?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\LaborApi();
$body = new \SquareConnect\Model\SearchShiftsRequest(); // \SquareConnect\Model\SearchShiftsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->searchShifts($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->searchShifts: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \SquareConnect\Model\SearchShiftsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\SearchShiftsResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\UpdateBreakTypeResponse updateBreakType($id, $body)
UpdateBreakType
Updates an existing BreakType
.
<?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\LaborApi();
$id = "id_example"; // string | UUID for the `BreakType` being updated.
$body = new \SquareConnect\Model\UpdateBreakTypeRequest(); // \SquareConnect\Model\UpdateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->updateBreakType($id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->updateBreakType: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `BreakType` being updated. | |
body | \SquareConnect\Model\UpdateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\UpdateBreakTypeResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\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
.
<?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\LaborApi();
$id = "id_example"; // string | ID of the object being updated.
$body = new \SquareConnect\Model\UpdateShiftRequest(); // \SquareConnect\Model\UpdateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->updateShift($id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->updateShift: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | ID of the object being updated. | |
body | \SquareConnect\Model\UpdateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\UpdateShiftResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\SquareConnect\Model\UpdateWorkweekConfigResponse updateWorkweekConfig($id, $body)
UpdateWorkweekConfig
Updates a WorkweekConfig
.
<?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\LaborApi();
$id = "id_example"; // string | UUID for the `WorkweekConfig` object being updated.
$body = new \SquareConnect\Model\UpdateWorkweekConfigRequest(); // \SquareConnect\Model\UpdateWorkweekConfigRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
$result = $apiInstance->updateWorkweekConfig($id, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LaborApi->updateWorkweekConfig: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `WorkweekConfig` object being updated. | |
body | \SquareConnect\Model\UpdateWorkweekConfigRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
\SquareConnect\Model\UpdateWorkweekConfigResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]