Skip to main content
The Team API provides methods to manage jobs that can be assigned to team members. Jobs define titles and tip eligibility settings for your employees.

Overview

The client.Team client provides access to job management operations:
import (
    "context"
    "github.com/square/square-go-sdk/v3"
)

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

// Use the Team client
response, err := client.Team.ListJobs(context.Background(), &square.ListJobsRequest{})

Methods

ListJobs

Lists jobs in a seller account. Results are sorted by title in ascending order.
request := &square.ListJobsRequest{
    Cursor: square.String("cursor"),
}

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

for _, job := range response.Jobs {
    fmt.Printf("Job: %s (ID: %s)\n", *job.Title, *job.ID)
}
cursor
*string
The pagination cursor returned by the previous call to this endpoint. Provide this cursor to retrieve the next page of results. For more information, see Pagination.
jobs
[]*square.Job
The retrieved jobs. A single paged response contains up to 100 jobs.
cursor
*string
An opaque cursor used to retrieve the next page of results.

CreateJob

Creates a job in a seller account. A job defines a title and tip eligibility. Note that compensation is defined in a job assignment in a team member’s wage setting.
request := &square.CreateJobRequest{
    Job: &square.Job{
        Title: square.String("Cashier"),
        IsTipEligible: square.Bool(true),
    },
    IdempotencyKey: "idempotency-key-0",
}

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

fmt.Printf("Created job: %s\n", *response.Job.ID)
job
*square.Job
required
The job to create. The title field is required and is_tip_eligible defaults to true.
idempotencyKey
string
required
A unique identifier for the CreateJob request. Keys can be any valid string, but must be unique for each request. For more information, see Idempotency.
job
*square.Job
The new job.

RetrieveJob

Retrieves a specified job by ID.
request := &square.RetrieveJobRequest{
    JobID: "job_id",
}

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

fmt.Printf("Job title: %s\n", *response.Job.Title)
jobID
string
required
The ID of the job to retrieve.
job
*square.Job
The retrieved job.

UpdateJob

Updates the title or tip eligibility of a job. Changes to the title propagate to all JobAssignment, Shift, and TeamMemberWage objects that reference the job ID.
request := &square.UpdateJobRequest{
    JobID: "job_id",
    Job: &square.Job{
        Title: square.String("Cashier 1"),
        IsTipEligible: square.Bool(true),
    },
}

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

fmt.Printf("Updated job: %s\n", *response.Job.Title)
jobID
string
required
The ID of the job to update.
job
*square.Job
required
The job with the updated fields, either title, is_tip_eligible, or both. Only changed fields need to be included in the request. Optionally include version to enable optimistic concurrency control.
job
*square.Job
The updated job.

Job Object

The Job object represents a job that can be assigned to team members.
id
*string
Read only The unique Square-assigned ID of the job.
title
*string
The title of the job.
isTipEligible
*bool
Indicates whether team members can earn tips for the job.
createdAt
*string
The timestamp when the job was created, in RFC 3339 format.
updatedAt
*string
The timestamp when the job was last updated, in RFC 3339 format.
version
*int
Read only The current version of the job. Include this field in UpdateJob requests to enable optimistic concurrency control.

Build docs developers (and LLMs) love