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 (CreateBreakTypeRequest 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.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class CreateBreakTypeExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var body = new CreateBreakTypeRequest(); // CreateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try
{
// CreateBreakType
CreateBreakTypeResponse result = apiInstance.CreateBreakType(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.CreateBreakType: " + e.Message );
}
}
}
}
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
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateShiftResponse CreateShift (CreateShiftRequest 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
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class CreateShiftExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var body = new CreateShiftRequest(); // CreateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try
{
// CreateShift
CreateShiftResponse result = apiInstance.CreateShift(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.CreateShift: " + e.Message );
}
}
}
}
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
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteBreakTypeResponse DeleteBreakType (string id)
DeleteBreakType
Deletes an existing BreakType
. A BreakType
can be deleted even if it is referenced from a Shift
.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class DeleteBreakTypeExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | UUID for the `BreakType` being deleted.
try
{
// DeleteBreakType
DeleteBreakTypeResponse result = apiInstance.DeleteBreakType(id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.DeleteBreakType: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `BreakType` being deleted. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteShiftResponse DeleteShift (string id)
DeleteShift
Deletes a Shift
.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class DeleteShiftExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | UUID for the `Shift` being deleted.
try
{
// DeleteShift
DeleteShiftResponse result = apiInstance.DeleteShift(id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.DeleteShift: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `Shift` being deleted. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBreakTypeResponse GetBreakType (string id)
GetBreakType
Returns a single BreakType
specified by id.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class GetBreakTypeExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | UUID for the `BreakType` being retrieved.
try
{
// GetBreakType
GetBreakTypeResponse result = apiInstance.GetBreakType(id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.GetBreakType: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `BreakType` being retrieved. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetEmployeeWageResponse GetEmployeeWage (string id)
GetEmployeeWage
Returns a single EmployeeWage
specified by id.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class GetEmployeeWageExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | UUID for the `EmployeeWage` being retrieved.
try
{
// GetEmployeeWage
GetEmployeeWageResponse result = apiInstance.GetEmployeeWage(id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.GetEmployeeWage: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `EmployeeWage` being retrieved. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetShiftResponse GetShift (string id)
GetShift
Returns a single Shift
specified by id.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class GetShiftExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | UUID for the `Shift` being retrieved.
try
{
// GetShift
GetShiftResponse result = apiInstance.GetShift(id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.GetShift: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
id | string | UUID for the `Shift` being retrieved. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListBreakTypesResponse ListBreakTypes (string locationId = null, int? limit = null, string cursor = null)
ListBreakTypes
Returns a paginated list of BreakType
instances for a business.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class ListBreakTypesExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var locationId = locationId_example; // string | Filter Break Types returned to only those that are associated with the specified location. (optional)
var 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. (optional)
var cursor = cursor_example; // string | Pointer to the next page of Break Type results to fetch. (optional)
try
{
// ListBreakTypes
ListBreakTypesResponse result = apiInstance.ListBreakTypes(locationId, limit, cursor);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.ListBreakTypes: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
locationId | 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] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListEmployeeWagesResponse ListEmployeeWages (string employeeId = null, int? limit = null, string cursor = null)
ListEmployeeWages
Returns a paginated list of EmployeeWage
instances for a business.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class ListEmployeeWagesExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var employeeId = employeeId_example; // string | Filter wages returned to only those that are associated with the specified employee. (optional)
var 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. (optional)
var cursor = cursor_example; // string | Pointer to the next page of Employee Wage results to fetch. (optional)
try
{
// ListEmployeeWages
ListEmployeeWagesResponse result = apiInstance.ListEmployeeWages(employeeId, limit, cursor);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.ListEmployeeWages: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
employeeId | 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] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListWorkweekConfigsResponse ListWorkweekConfigs (int? limit = null, string cursor = null)
ListWorkweekConfigs
Returns a list of WorkweekConfig
instances for a business.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class ListWorkweekConfigsExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var limit = 56; // int? | Maximum number of Workweek Configs to return per page. (optional)
var cursor = cursor_example; // string | Pointer to the next page of Workweek Config results to fetch. (optional)
try
{
// ListWorkweekConfigs
ListWorkweekConfigsResponse result = apiInstance.ListWorkweekConfigs(limit, cursor);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.ListWorkweekConfigs: " + e.Message );
}
}
}
}
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] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SearchShiftsResponse SearchShifts (SearchShiftsRequest 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
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class SearchShiftsExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var body = new SearchShiftsRequest(); // SearchShiftsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try
{
// SearchShifts
SearchShiftsResponse result = apiInstance.SearchShifts(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.SearchShifts: " + e.Message );
}
}
}
}
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
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateBreakTypeResponse UpdateBreakType (string id, UpdateBreakTypeRequest body)
UpdateBreakType
Updates an existing BreakType
.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class UpdateBreakTypeExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | UUID for the `BreakType` being updated.
var body = new UpdateBreakTypeRequest(); // UpdateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try
{
// UpdateBreakType
UpdateBreakTypeResponse result = apiInstance.UpdateBreakType(id, body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.UpdateBreakType: " + e.Message );
}
}
}
}
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
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateShiftResponse UpdateShift (string id, UpdateShiftRequest 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
.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class UpdateShiftExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | ID of the object being updated.
var body = new UpdateShiftRequest(); // UpdateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try
{
// UpdateShift
UpdateShiftResponse result = apiInstance.UpdateShift(id, body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.UpdateShift: " + e.Message );
}
}
}
}
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
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateWorkweekConfigResponse UpdateWorkweekConfig (string id, UpdateWorkweekConfigRequest body)
UpdateWorkweekConfig
Updates a WorkweekConfig
.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class UpdateWorkweekConfigExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LaborApi();
var id = id_example; // string | UUID for the `WorkweekConfig` object being updated.
var body = new UpdateWorkweekConfigRequest(); // UpdateWorkweekConfigRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try
{
// UpdateWorkweekConfig
UpdateWorkweekConfigResponse result = apiInstance.UpdateWorkweekConfig(id, body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LaborApi.UpdateWorkweekConfig: " + e.Message );
}
}
}
}
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
[Back to top] [Back to API list] [Back to Model list] [Back to README]