labor_api = client.laborLaborApi
- List Break Types
- Create Break Type
- Delete Break Type
- Get Break Type
- Update Break Type
- List Employee Wages
- Get Employee Wage
- Create Shift
- Search Shifts
- Delete Shift
- Get Shift
- Update Shift
- List Team Member Wages
- Get Team Member Wage
- List Workweek Configs
- Update Workweek Config
Returns a paginated list of BreakType instances for a business.
def list_break_types(self,
location_id=None,
limit=None,
cursor=None)| Parameter | Type | Tags | Description |
|---|---|---|---|
location_id |
string |
Query, Optional | Filter Break Types returned to only those that are associated with the specified location. |
limit |
int |
Query, Optional | Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200. |
cursor |
string |
Query, Optional | Pointer to the next page of Break Type results to fetch. |
location_id = 'location_id4'
limit = 172
cursor = 'cursor6'
result = labor_api.list_break_types(location_id, limit, cursor)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)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_idbreak_nameexpected_durationis_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.
def create_break_type(self,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
Create Break Type Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
body = {}
body['idempotency_key'] = 'PAD3NG5KSN2GL'
body['break_type'] = {}
body['break_type']['id'] = 'id2'
body['break_type']['location_id'] = 'CGJN03P1D08GF'
body['break_type']['break_name'] = 'Lunch Break'
body['break_type']['expected_duration'] = 'PT30M'
body['break_type']['is_paid'] = True
body['break_type']['version'] = 124
body['break_type']['created_at'] = 'created_at0'
body['break_type']['updated_at'] = 'updated_at8'
result = labor_api.create_break_type(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Deletes an existing BreakType.
A BreakType can be deleted even if it is referenced from a Shift.
def delete_break_type(self,
id)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the BreakType being deleted. |
id = 'id0'
result = labor_api.delete_break_type(id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Returns a single BreakType specified by id.
def get_break_type(self,
id)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the BreakType being retrieved. |
id = 'id0'
result = labor_api.get_break_type(id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Updates an existing BreakType.
def update_break_type(self,
id,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the BreakType being updated. |
body |
Update Break Type Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
id = 'id0'
body = {}
body['break_type'] = {}
body['break_type']['id'] = 'id2'
body['break_type']['location_id'] = '26M7H24AZ9N6R'
body['break_type']['break_name'] = 'Lunch'
body['break_type']['expected_duration'] = 'PT50M'
body['break_type']['is_paid'] = True
body['break_type']['version'] = 1
body['break_type']['created_at'] = 'created_at0'
body['break_type']['updated_at'] = 'updated_at8'
result = labor_api.update_break_type(id, body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)This endpoint is deprecated.
Returns a paginated list of EmployeeWage instances for a business.
def list_employee_wages(self,
employee_id=None,
limit=None,
cursor=None)| Parameter | Type | Tags | Description |
|---|---|---|---|
employee_id |
string |
Query, Optional | Filter wages returned to only those that are associated with the specified employee. |
limit |
int |
Query, Optional | Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200. |
cursor |
string |
Query, Optional | Pointer to the next page of Employee Wage results to fetch. |
employee_id = 'employee_id0'
limit = 172
cursor = 'cursor6'
result = labor_api.list_employee_wages(employee_id, limit, cursor)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)This endpoint is deprecated.
Returns a single EmployeeWage specified by id.
def get_employee_wage(self,
id)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the EmployeeWage being retrieved. |
id = 'id0'
result = labor_api.get_employee_wage(id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)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_idemployee_idstart_at
An attempt to create a new Shift can result in a BAD_REQUEST error when:
- The
statusof the newShiftisOPENand the employee has another shift with anOPENstatus. - The
start_atdate is in the future - the
start_atorend_atoverlaps another shift for the same employee - If
Breaks are set in the request, a breakstart_atmust not be before theShift.start_at. A breakend_atmust not be after theShift.end_at
def create_shift(self,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
Create Shift Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
body = {}
body['idempotency_key'] = 'HIDSNG5KS478L'
body['shift'] = {}
body['shift']['id'] = 'id8'
body['shift']['employee_id'] = 'employee_id2'
body['shift']['location_id'] = 'PAA1RJZZKXBFG'
body['shift']['timezone'] = 'timezone2'
body['shift']['start_at'] = '2019-01-25T03:11:00-05:00'
body['shift']['end_at'] = '2019-01-25T13:11:00-05:00'
body['shift']['wage'] = {}
body['shift']['wage']['title'] = 'Barista'
body['shift']['wage']['hourly_rate'] = {}
body['shift']['wage']['hourly_rate']['amount'] = 1100
body['shift']['wage']['hourly_rate']['currency'] = 'USD'
body['shift']['breaks'] = []
body['shift']['breaks'].append({})
body['shift']['breaks'][0]['id'] = 'id4'
body['shift']['breaks'][0]['start_at'] = '2019-01-25T06:11:00-05:00'
body['shift']['breaks'][0]['end_at'] = '2019-01-25T06:16:00-05:00'
body['shift']['breaks'][0]['break_type_id'] = 'REGS1EQR1TPZ5'
body['shift']['breaks'][0]['name'] = 'Tea Break'
body['shift']['breaks'][0]['expected_duration'] = 'PT5M'
body['shift']['breaks'][0]['is_paid'] = True
body['shift']['team_member_id'] = 'ormj0jJJZ5OZIzxrZYJI'
result = labor_api.create_shift(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)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_atend_atcreated_atupdated_at
def search_shifts(self,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
Search Shifts Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
body = {}
body['query'] = {}
body['query']['filter'] = {}
body['query']['filter']['location_ids'] = ['location_ids2']
body['query']['filter']['employee_ids'] = ['employee_ids7']
body['query']['filter']['status'] = 'OPEN'
body['query']['filter']['start'] = {}
body['query']['filter']['start']['start_at'] = 'start_at8'
body['query']['filter']['start']['end_at'] = 'end_at4'
body['query']['filter']['end'] = {}
body['query']['filter']['end']['start_at'] = 'start_at2'
body['query']['filter']['end']['end_at'] = 'end_at0'
body['query']['filter']['workday'] = {}
body['query']['filter']['workday']['date_range'] = {}
body['query']['filter']['workday']['date_range']['start_date'] = 'start_date8'
body['query']['filter']['workday']['date_range']['end_date'] = 'end_date4'
body['query']['filter']['workday']['match_shifts_by'] = 'START_AT'
body['query']['filter']['workday']['default_timezone'] = 'default_timezone8'
body['query']['filter']['team_member_ids'] = ['team_member_ids9', 'team_member_ids0']
body['query']['sort'] = {}
body['query']['sort']['field'] = 'CREATED_AT'
body['query']['sort']['order'] = 'DESC'
body['limit'] = 164
body['cursor'] = 'cursor0'
result = labor_api.search_shifts(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Deletes a Shift.
def delete_shift(self,
id)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the Shift being deleted. |
id = 'id0'
result = labor_api.delete_shift(id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Returns a single Shift specified by id.
def get_shift(self,
id)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the Shift being retrieved. |
id = 'id0'
result = labor_api.get_shift(id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)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.
def update_shift(self,
id,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | ID of the object being updated. |
body |
Update Shift Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
id = 'id0'
body = {}
body['shift'] = {}
body['shift']['id'] = 'id8'
body['shift']['employee_id'] = 'employee_id2'
body['shift']['location_id'] = 'PAA1RJZZKXBFG'
body['shift']['timezone'] = 'timezone2'
body['shift']['start_at'] = '2019-01-25T03:11:00-05:00'
body['shift']['end_at'] = '2019-01-25T13:11:00-05:00'
body['shift']['wage'] = {}
body['shift']['wage']['title'] = 'Bartender'
body['shift']['wage']['hourly_rate'] = {}
body['shift']['wage']['hourly_rate']['amount'] = 1500
body['shift']['wage']['hourly_rate']['currency'] = 'USD'
body['shift']['breaks'] = []
body['shift']['breaks'].append({})
body['shift']['breaks'][0]['id'] = 'X7GAQYVVRRG6P'
body['shift']['breaks'][0]['start_at'] = '2019-01-25T06:11:00-05:00'
body['shift']['breaks'][0]['end_at'] = '2019-01-25T06:16:00-05:00'
body['shift']['breaks'][0]['break_type_id'] = 'REGS1EQR1TPZ5'
body['shift']['breaks'][0]['name'] = 'Tea Break'
body['shift']['breaks'][0]['expected_duration'] = 'PT5M'
body['shift']['breaks'][0]['is_paid'] = True
body['shift']['version'] = 1
body['shift']['team_member_id'] = 'ormj0jJJZ5OZIzxrZYJI'
result = labor_api.update_shift(id, body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Returns a paginated list of TeamMemberWage instances for a business.
def list_team_member_wages(self,
team_member_id=None,
limit=None,
cursor=None)| Parameter | Type | Tags | Description |
|---|---|---|---|
team_member_id |
string |
Query, Optional | Filter wages returned to only those that are associated with the specified team member. |
limit |
int |
Query, Optional | Maximum number of Team Member Wages to return per page. Can range between 1 and 200. The default is the maximum at 200. |
cursor |
string |
Query, Optional | Pointer to the next page of Employee Wage results to fetch. |
List Team Member Wages Response
team_member_id = 'team_member_id0'
limit = 172
cursor = 'cursor6'
result = labor_api.list_team_member_wages(team_member_id, limit, cursor)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Returns a single TeamMemberWage specified by id.
def get_team_member_wage(self,
id)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the TeamMemberWage being retrieved. |
id = 'id0'
result = labor_api.get_team_member_wage(id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Returns a list of WorkweekConfig instances for a business.
def list_workweek_configs(self,
limit=None,
cursor=None)| Parameter | Type | Tags | Description |
|---|---|---|---|
limit |
int |
Query, Optional | Maximum number of Workweek Configs to return per page. |
cursor |
string |
Query, Optional | Pointer to the next page of Workweek Config results to fetch. |
List Workweek Configs Response
limit = 172
cursor = 'cursor6'
result = labor_api.list_workweek_configs(limit, cursor)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Updates a WorkweekConfig.
def update_workweek_config(self,
id,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
id |
string |
Template, Required | UUID for the WorkweekConfig object being updated. |
body |
Update Workweek Config Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Update Workweek Config Response
id = 'id0'
body = {}
body['workweek_config'] = {}
body['workweek_config']['id'] = 'id4'
body['workweek_config']['start_of_week'] = 'MON'
body['workweek_config']['start_of_day_local_time'] = '10:00'
body['workweek_config']['version'] = 10
body['workweek_config']['created_at'] = 'created_at2'
body['workweek_config']['updated_at'] = 'updated_at0'
result = labor_api.update_workweek_config(id, body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)