Skip to main content
The Employees API was deprecated at version 2020-08-26. Use the Team Members API instead.
The Employees API was the original API for managing employees in Square. It has been replaced by the more comprehensive Team Members API.

Overview

The client.Employees client provides access to legacy employee operations:
import (
    "context"
    "github.com/square/square-go-sdk/v3"
)

client := square.NewClient(
    square.WithAccessToken("YOUR_ACCESS_TOKEN"),
)

// Use the Employees client (deprecated)
response, err := client.Employees.List(context.Background(), &square.ListEmployeesRequest{})

Migration Guide

If you’re currently using the Employees API, you should migrate to the Team Members API:
Employees APITeam Members API
client.Employees.List()client.TeamMembers.Search()
client.Employees.Get()client.TeamMembers.Get()
Employee objectTeamMember object

Methods (Deprecated)

List

Lists all employees for a location.
request := &square.ListEmployeesRequest{
    LocationID: square.String("location_id"),
    Status: square.EmployeeStatusActive.Ptr(),
    Limit: square.Int(100),
    Cursor: square.String("cursor"),
}

response, err := client.Employees.List(context.Background(), request)
if err != nil {
    log.Fatal(err)
}

for _, employee := range response.Employees {
    fmt.Printf("Employee: %s %s\n", *employee.FirstName, *employee.LastName)
}
locationID
*string
Filter employees by location ID.
status
*square.EmployeeStatus
Specifies the EmployeeStatus to filter the employee by. Possible values: ACTIVE, INACTIVE.
limit
*int
The number of employees to be returned on each page.
cursor
*string
The token required to retrieve the specified page of results.
employees
[]*square.Employee
The list of employees.
cursor
*string
The token to be used to retrieve the next page of results.

Get

Retrieves an employee by ID.
request := &square.GetEmployeesRequest{
    ID: "employee_id",
}

response, err := client.Employees.Get(context.Background(), request)
if err != nil {
    log.Fatal(err)
}

fmt.Printf("Employee: %s %s\n", *response.Employee.FirstName, *response.Employee.LastName)
id
string
required
UUID for the employee that was requested.
employee
*square.Employee
The requested employee.

Employee Object (Deprecated)

id
*string
UUID for this object.
firstName
*string
The employee’s first name.
lastName
*string
The employee’s last name.
email
*string
The employee’s email address.
phoneNumber
*string
The employee’s phone number in E.164 format (e.g., “+12125554250”).
locationIDs
[]string
A list of location IDs where this employee has access to.
status
*square.EmployeeStatus
Specifies the status of the employee. Possible values: ACTIVE, INACTIVE.
isOwner
*bool
Whether this employee is the owner of the merchant. Each merchant has one owner employee with full authority over the account.
createdAt
*string
A read-only timestamp in RFC 3339 format.
updatedAt
*string
A read-only timestamp in RFC 3339 format.

Why Migrate to Team Members?

The Team Members API provides several advantages over the deprecated Employees API:
  • More comprehensive data model: Includes wage settings, job assignments, and location assignments
  • Better search capabilities: Search and filter team members by multiple criteria
  • Bulk operations: Create and update multiple team members at once
  • Improved status tracking: Better handling of active/inactive states
  • Integration with other APIs: Works seamlessly with the Labor API for shift management
See the Team Members API documentation for complete migration details.

Build docs developers (and LLMs) love