Skip to content

Latest commit

 

History

History
530 lines (343 loc) · 23.2 KB

V1EmployeesApi.md

File metadata and controls

530 lines (343 loc) · 23.2 KB

{{classname}}

All URIs are relative to https://connect.squareup.com/

Method HTTP request Description
CreateEmployee Post /v1/me/employees CreateEmployee
CreateEmployeeRole Post /v1/me/roles CreateEmployeeRole
CreateTimecard Post /v1/me/timecards CreateTimecard
DeleteTimecard Delete /v1/me/timecards/{timecard_id} DeleteTimecard
ListCashDrawerShifts Get /v1/{location_id}/cash-drawer-shifts ListCashDrawerShifts
ListEmployeeRoles Get /v1/me/roles ListEmployeeRoles
ListEmployees Get /v1/me/employees ListEmployees
ListTimecardEvents Get /v1/me/timecards/{timecard_id}/events ListTimecardEvents
ListTimecards Get /v1/me/timecards ListTimecards
RetrieveCashDrawerShift Get /v1/{location_id}/cash-drawer-shifts/{shift_id} RetrieveCashDrawerShift
RetrieveEmployee Get /v1/me/employees/{employee_id} RetrieveEmployee
RetrieveEmployeeRole Get /v1/me/roles/{role_id} RetrieveEmployeeRole
RetrieveTimecard Get /v1/me/timecards/{timecard_id} RetrieveTimecard
UpdateEmployee Put /v1/me/employees/{employee_id} UpdateEmployee
UpdateEmployeeRole Put /v1/me/roles/{role_id} UpdateEmployeeRole
UpdateTimecard Put /v1/me/timecards/{timecard_id} UpdateTimecard

CreateEmployee

V1Employee CreateEmployee(ctx, body) CreateEmployee

Use the CreateEmployee endpoint to add an employee to a Square account. Employees created with the Connect API have an initial status of INACTIVE. Inactive employees cannot sign in to Square Point of Sale until they are activated from the Square Dashboard. Employee status cannot be changed with the Connect API. Employee entities cannot be deleted. To disable employee profiles, set the employee's status to INACTIVE

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body V1Employee An object containing the fields to POST for the request.

See the corresponding object definition for field details. |

Return type

V1Employee

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateEmployeeRole

V1EmployeeRole CreateEmployeeRole(ctx, body) CreateEmployeeRole

Creates an employee role you can then assign to employees. Square accounts can include any number of roles that can be assigned to employees. These roles define the actions and permissions granted to an employee with that role. For example, an employee with a "Shift Manager" role might be able to issue refunds in Square Point of Sale, whereas an employee with a "Clerk" role might not. Roles are assigned with the V1UpdateEmployee endpoint. An employee can have only one role at a time. If an employee has no role, they have none of the permissions associated with roles. All employees can accept payments with Square Point of Sale.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body V1EmployeeRole An EmployeeRole object with a name and permissions, and an optional owner flag.

Return type

V1EmployeeRole

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateTimecard

V1Timecard CreateTimecard(ctx, body) CreateTimecard

Creates a timecard for an employee and clocks them in with an API_CREATE event and a clockin_time set to the current time unless the request provides a different value. To import timecards from another system (rather than clocking someone in). Specify the clockin_time and* clockout_time in the request. Timecards correspond to exactly one shift for a given employee, bounded by the clockin_time and clockout_time fields. An employee is considered clocked in if they have a timecard that doesn't have a clockout_time set. An employee that is currently clocked in cannot be clocked in a second time.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body V1Timecard An object containing the fields to POST for the request.

See the corresponding object definition for field details. |

Return type

V1Timecard

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteTimecard

interface{} DeleteTimecard(ctx, timecardId) DeleteTimecard

Deletes a timecard. Timecards can also be deleted through the Square Dashboard. Deleted timecards are still accessible through Connect API endpoints, but cannot be modified. The deleted field of the Timecard object indicates whether the timecard has been deleted. Note: By default, deleted timecards appear alongside valid timecards in results returned by the ListTimecards endpoint. To filter deleted timecards, include the deleted query parameter in the list request. Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
timecardId string The ID of the timecard to delete.

Return type

interface{}

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListCashDrawerShifts

[]V1CashDrawerShift ListCashDrawerShifts(ctx, locationId, optional) ListCashDrawerShifts

Provides the details for all of a location's cash drawer shifts during a date range. The date range you specify cannot exceed 90 days.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
locationId string The ID of the location to list cash drawer shifts for.
optional *V1EmployeesApiListCashDrawerShiftsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a V1EmployeesApiListCashDrawerShiftsOpts struct

Name Type Description Notes

order | optional.String| The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC | beginTime | optional.String| The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days. | endTime | optional.String| The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time. |

Return type

[]V1CashDrawerShift

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListEmployeeRoles

[]V1EmployeeRole ListEmployeeRoles(ctx, optional) ListEmployeeRoles

Provides summary information for all of a business's employee roles.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *V1EmployeesApiListEmployeeRolesOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a V1EmployeesApiListEmployeeRolesOpts struct

Name Type Description Notes
order optional.String The order in which employees are listed in the response, based on their created_at field.Default value: ASC
limit optional.Int32 The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
batchToken optional.String A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Return type

[]V1EmployeeRole

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListEmployees

[]V1Employee ListEmployees(ctx, optional) ListEmployees

Provides summary information for all of a business's employees.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *V1EmployeesApiListEmployeesOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a V1EmployeesApiListEmployeesOpts struct

Name Type Description Notes
order optional.String The order in which employees are listed in the response, based on their created_at field. Default value: ASC
beginUpdatedAt optional.String If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format
endUpdatedAt optional.String If filtering results by there updated_at field, the end of the requested reporting period, in ISO 8601 format.
beginCreatedAt optional.String If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format.
endCreatedAt optional.String If filtering results by their created_at field, the end of the requested reporting period, in ISO 8601 format.
status optional.String If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE).
externalId optional.String If provided, the endpoint returns only employee entities with the specified external_id.
limit optional.Int32 The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
batchToken optional.String A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Return type

[]V1Employee

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListTimecardEvents

[]V1TimecardEvent ListTimecardEvents(ctx, timecardId) ListTimecardEvents

Provides summary information for all events associated with a particular timecard. Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
timecardId string The ID of the timecard to list events for.

Return type

[]V1TimecardEvent

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListTimecards

[]V1Timecard ListTimecards(ctx, optional) ListTimecards

Provides summary information for all of a business's employee timecards.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *V1EmployeesApiListTimecardsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a V1EmployeesApiListTimecardsOpts struct

Name Type Description Notes
order optional.String The order in which timecards are listed in the response, based on their created_at field.
employeeId optional.String If provided, the endpoint returns only timecards for the employee with the specified ID.
beginClockinTime optional.String If filtering results by their clockin_time field, the beginning of the requested reporting period, in ISO 8601 format.
endClockinTime optional.String If filtering results by their clockin_time field, the end of the requested reporting period, in ISO 8601 format.
beginClockoutTime optional.String If filtering results by their clockout_time field, the beginning of the requested reporting period, in ISO 8601 format.
endClockoutTime optional.String If filtering results by their clockout_time field, the end of the requested reporting period, in ISO 8601 format.
beginUpdatedAt optional.String If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format.
endUpdatedAt optional.String If filtering results by their updated_at field, the end of the requested reporting period, in ISO 8601 format.
deleted optional.Bool If true, only deleted timecards are returned. If false, only valid timecards are returned.If you don't provide this parameter, both valid and deleted timecards are returned.
limit optional.Int32 The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
batchToken optional.String A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Return type

[]V1Timecard

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveCashDrawerShift

V1CashDrawerShift RetrieveCashDrawerShift(ctx, locationId, shiftId) RetrieveCashDrawerShift

Provides the details for a single cash drawer shift, including all events that occurred during the shift.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
locationId string The ID of the location to list cash drawer shifts for.
shiftId string The shift's ID.

Return type

V1CashDrawerShift

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveEmployee

V1Employee RetrieveEmployee(ctx, employeeId) RetrieveEmployee

Provides the details for a single employee.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
employeeId string The employee's ID.

Return type

V1Employee

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveEmployeeRole

V1EmployeeRole RetrieveEmployeeRole(ctx, roleId) RetrieveEmployeeRole

Provides the details for a single employee role.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
roleId string The role's ID.

Return type

V1EmployeeRole

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveTimecard

V1Timecard RetrieveTimecard(ctx, timecardId) RetrieveTimecard

Provides the details for a single timecard. Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
timecardId string The timecard's ID.

Return type

V1Timecard

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateEmployee

V1Employee UpdateEmployee(ctx, body, employeeId) UpdateEmployee

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body V1Employee An object containing the fields to POST for the request.

See the corresponding object definition for field details. | employeeId | string| The ID of the role to modify. |

Return type

V1Employee

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateEmployeeRole

V1EmployeeRole UpdateEmployeeRole(ctx, body, roleId) UpdateEmployeeRole

Modifies the details of an employee role.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body V1EmployeeRole An object containing the fields to POST for the request.

See the corresponding object definition for field details. | roleId | string| The ID of the role to modify. |

Return type

V1EmployeeRole

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateTimecard

V1Timecard UpdateTimecard(ctx, body, timecardId) UpdateTimecard

Modifies the details of a timecard with an API_EDIT event for the timecard. Updating an active timecard with a clockout_time clocks the employee out.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body V1Timecard An object containing the fields to POST for the request.
See the corresponding object definition for field details.
timecardId string TThe ID of the timecard to modify.

Return type

V1Timecard

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]