ITeamApi teamApi = client.TeamApi;
TeamApi
- Create Team Member
- Bulk Create Team Members
- Bulk Update Team Members
- Search Team Members
- Retrieve Team Member
- Update Team Member
- Retrieve Wage Setting
- Update Wage Setting
Creates a single TeamMember
object. The TeamMember
object is returned on successful creates.
You must provide the following values in your request to this endpoint:
given_name
family_name
Learn about Troubleshooting the Team API.
CreateTeamMemberAsync(
Models.CreateTeamMemberRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
CreateTeamMemberRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Task<Models.CreateTeamMemberResponse>
CreateTeamMemberRequest body = new CreateTeamMemberRequest.Builder()
.IdempotencyKey("idempotency-key-0")
.TeamMember(
new TeamMember.Builder()
.ReferenceId("reference_id_1")
.Status("ACTIVE")
.GivenName("Joe")
.FamilyName("Doe")
.EmailAddress("[email protected]")
.PhoneNumber("+14159283333")
.AssignedLocations(
new TeamMemberAssignedLocations.Builder()
.AssignmentType("EXPLICIT_LOCATIONS")
.LocationIds(
new List<string>
{
"YSGH2WBKG94QZ",
"GA2Y9HSJ8KRYT",
})
.Build())
.Build())
.Build();
try
{
CreateTeamMemberResponse result = await teamApi.CreateTeamMemberAsync(body);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}
Creates multiple TeamMember
objects. The created TeamMember
objects are returned on successful creates.
This process is non-transactional and processes as much of the request as possible. If one of the creates in
the request cannot be successfully processed, the request is not marked as failed, but the body of the response
contains explicit error information for the failed create.
Learn about Troubleshooting the Team API.
BulkCreateTeamMembersAsync(
Models.BulkCreateTeamMembersRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
BulkCreateTeamMembersRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Task<Models.BulkCreateTeamMembersResponse>
BulkCreateTeamMembersRequest body = new BulkCreateTeamMembersRequest.Builder(
new Dictionary<string, CreateTeamMemberRequest>
{
["idempotency-key-1"] = new CreateTeamMemberRequest.Builder()
.TeamMember(
new TeamMember.Builder()
.ReferenceId("reference_id_1")
.GivenName("Joe")
.FamilyName("Doe")
.EmailAddress("[email protected]")
.PhoneNumber("+14159283333")
.AssignedLocations(
new TeamMemberAssignedLocations.Builder()
.AssignmentType("EXPLICIT_LOCATIONS")
.LocationIds(
new List<string>
{
"YSGH2WBKG94QZ",
"GA2Y9HSJ8KRYT",
})
.Build())
.Build())
.Build(),
["idempotency-key-2"] = new CreateTeamMemberRequest.Builder()
.TeamMember(
new TeamMember.Builder()
.ReferenceId("reference_id_2")
.GivenName("Jane")
.FamilyName("Smith")
.EmailAddress("[email protected]")
.PhoneNumber("+14159223334")
.AssignedLocations(
new TeamMemberAssignedLocations.Builder()
.AssignmentType("ALL_CURRENT_AND_FUTURE_LOCATIONS")
.Build())
.Build())
.Build(),
}
)
.Build();
try
{
BulkCreateTeamMembersResponse result = await teamApi.BulkCreateTeamMembersAsync(body);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}
Updates multiple TeamMember
objects. The updated TeamMember
objects are returned on successful updates.
This process is non-transactional and processes as much of the request as possible. If one of the updates in
the request cannot be successfully processed, the request is not marked as failed, but the body of the response
contains explicit error information for the failed update.
Learn about Troubleshooting the Team API.
BulkUpdateTeamMembersAsync(
Models.BulkUpdateTeamMembersRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
BulkUpdateTeamMembersRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Task<Models.BulkUpdateTeamMembersResponse>
BulkUpdateTeamMembersRequest body = new BulkUpdateTeamMembersRequest.Builder(
new Dictionary<string, UpdateTeamMemberRequest>
{
["AFMwA08kR-MIF-3Vs0OE"] = new UpdateTeamMemberRequest.Builder()
.TeamMember(
new TeamMember.Builder()
.ReferenceId("reference_id_2")
.IsOwner(false)
.Status("ACTIVE")
.GivenName("Jane")
.FamilyName("Smith")
.EmailAddress("[email protected]")
.PhoneNumber("+14159223334")
.AssignedLocations(
new TeamMemberAssignedLocations.Builder()
.AssignmentType("ALL_CURRENT_AND_FUTURE_LOCATIONS")
.Build())
.Build())
.Build(),
["fpgteZNMaf0qOK-a4t6P"] = new UpdateTeamMemberRequest.Builder()
.TeamMember(
new TeamMember.Builder()
.ReferenceId("reference_id_1")
.IsOwner(false)
.Status("ACTIVE")
.GivenName("Joe")
.FamilyName("Doe")
.EmailAddress("[email protected]")
.PhoneNumber("+14159283333")
.AssignedLocations(
new TeamMemberAssignedLocations.Builder()
.AssignmentType("EXPLICIT_LOCATIONS")
.LocationIds(
new List<string>
{
"YSGH2WBKG94QZ",
"GA2Y9HSJ8KRYT",
})
.Build())
.Build())
.Build(),
}
)
.Build();
try
{
BulkUpdateTeamMembersResponse result = await teamApi.BulkUpdateTeamMembersAsync(body);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}
Returns a paginated list of TeamMember
objects for a business.
The list can be filtered by the following:
- location IDs
status
SearchTeamMembersAsync(
Models.SearchTeamMembersRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
SearchTeamMembersRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Task<Models.SearchTeamMembersResponse>
SearchTeamMembersRequest body = new SearchTeamMembersRequest.Builder()
.Query(
new SearchTeamMembersQuery.Builder()
.Filter(
new SearchTeamMembersFilter.Builder()
.LocationIds(
new List<string>
{
"0G5P3VGACMMQZ",
})
.Status("ACTIVE")
.Build())
.Build())
.Limit(10)
.Build();
try
{
SearchTeamMembersResponse result = await teamApi.SearchTeamMembersAsync(body);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}
Retrieves a TeamMember
object for the given TeamMember.id
.
Learn about Troubleshooting the Team API.
RetrieveTeamMemberAsync(
string teamMemberId)
Parameter | Type | Tags | Description |
---|---|---|---|
teamMemberId |
string |
Template, Required | The ID of the team member to retrieve. |
Task<Models.RetrieveTeamMemberResponse>
string teamMemberId = "team_member_id0";
try
{
RetrieveTeamMemberResponse result = await teamApi.RetrieveTeamMemberAsync(teamMemberId);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}
Updates a single TeamMember
object. The TeamMember
object is returned on successful updates.
Learn about Troubleshooting the Team API.
UpdateTeamMemberAsync(
string teamMemberId,
Models.UpdateTeamMemberRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
teamMemberId |
string |
Template, Required | The ID of the team member to update. |
body |
UpdateTeamMemberRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Task<Models.UpdateTeamMemberResponse>
string teamMemberId = "team_member_id0";
UpdateTeamMemberRequest body = new UpdateTeamMemberRequest.Builder()
.TeamMember(
new TeamMember.Builder()
.ReferenceId("reference_id_1")
.Status("ACTIVE")
.GivenName("Joe")
.FamilyName("Doe")
.EmailAddress("[email protected]")
.PhoneNumber("+14159283333")
.AssignedLocations(
new TeamMemberAssignedLocations.Builder()
.AssignmentType("EXPLICIT_LOCATIONS")
.LocationIds(
new List<string>
{
"YSGH2WBKG94QZ",
"GA2Y9HSJ8KRYT",
})
.Build())
.Build())
.Build();
try
{
UpdateTeamMemberResponse result = await teamApi.UpdateTeamMemberAsync(
teamMemberId,
body
);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}
Retrieves a WageSetting
object for a team member specified
by TeamMember.id
.
Learn about Troubleshooting the Team API.
RetrieveWageSettingAsync(
string teamMemberId)
Parameter | Type | Tags | Description |
---|---|---|---|
teamMemberId |
string |
Template, Required | The ID of the team member for which to retrieve the wage setting. |
Task<Models.RetrieveWageSettingResponse>
string teamMemberId = "team_member_id0";
try
{
RetrieveWageSettingResponse result = await teamApi.RetrieveWageSettingAsync(teamMemberId);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}
Creates or updates a WageSetting
object. The object is created if a
WageSetting
with the specified team_member_id
does not exist. Otherwise,
it fully replaces the WageSetting
object for the team member.
The WageSetting
is returned on a successful update.
Learn about Troubleshooting the Team API.
UpdateWageSettingAsync(
string teamMemberId,
Models.UpdateWageSettingRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
teamMemberId |
string |
Template, Required | The ID of the team member for which to update the WageSetting object. |
body |
UpdateWageSettingRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Task<Models.UpdateWageSettingResponse>
string teamMemberId = "team_member_id0";
UpdateWageSettingRequest body = new UpdateWageSettingRequest.Builder(
new WageSetting.Builder()
.JobAssignments(
new List<JobAssignment>
{
new JobAssignment.Builder(
"Manager",
"SALARY"
)
.AnnualRate(
new Money.Builder()
.Amount(3000000L)
.Currency("USD")
.Build())
.WeeklyHours(40)
.Build(),
new JobAssignment.Builder(
"Cashier",
"HOURLY"
)
.HourlyRate(
new Money.Builder()
.Amount(1200L)
.Currency("USD")
.Build())
.Build(),
})
.IsOvertimeExempt(true)
.Build()
)
.Build();
try
{
UpdateWageSettingResponse result = await teamApi.UpdateWageSettingAsync(
teamMemberId,
body
);
}
catch (ApiException e)
{
// TODO: Handle exception here
Console.WriteLine(e.Message);
}