When I call the “Create timecard” API endpoint without wage info it is created as $0 and “(No Job)”. I am confused because in the documentation it says:
”If the wage is not set on create, it defaults to a wage of zero. If the title is not set on create, it defaults to the name of the role the team member is assigned to, if any.”
I understand the wage is being defaulted to zero, but the users I tested this with both have one assigned job/role that is not being defaulted to.
When I set the job in the Square UI it auto-populates the wage, so I’m wondering 1) how to get the API to default the assigned role and 2) if I can get the API to assign the default role will it also auto-populate the associated wage the same way the UI does?
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
When you call the “CreateTimecard” API endpoint without specifying wage information, the timecard is indeed created with a wage of zero by default. Regarding the job title, the documentation states that if the title is not set, it should default to the name of the role the team member is assigned to, if any. However, if you are seeing “(No Job)” instead, it suggests that the API might not be automatically fetching the assigned role for the team member.
To ensure the API defaults to the assigned role, you need to explicitly provide the team_member_id and ensure that the team member has a role assigned in the Square system. If the role is not being picked up, it might be necessary to verify that the role is correctly set up in the Square Dashboard and that the API has the necessary permissions to access this information.
As for auto-populating the associated wage, the API does not automatically fetch and apply the wage settings from the assigned role when creating a timecard. You would need to manually retrieve the wage information using the ListTeamMemberWages endpoint and include it in your CreateTimecard request. The Square UI might have additional logic to auto-populate this information, which is not replicated in the API.
To achieve the desired behavior, you can:
Use the SearchTeamMembers endpoint to confirm the team member’s assigned role.
Use the ListTeamMemberWages endpoint to retrieve the wage settings for the team member and include this information in your CreateTimecard request.