Announcing Our Connect v2 Labor API
source link: https://developer.squareup.com/blog/announcing-our-connect-v2-labor-api/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Announcing Our Connect v2 Labor API
Capture employee working hours with breaks and hourly pay rate
We’re very excited to announce the release of the Square Connect v2 Labor API. Having visibility into daily employee operations and labor costs is a critical part of managing a business. It helps business owners better understand the performance of their business, employees, and ultimately make more informed & cost-effective staffing decisions. With the Labor API, partners can build stronger, more accurate, and more comprehensive labor management integrations on behalf of our shared customers.
To highlight the changes and additional functionality recently implemented (i.e. break tracking, multiple wages, etc…), we updated the name from Timecard API to Labor API. The new name better aligns with the breadth of labor management functionalities our partners can power with the Labor API.
You can more easily manage employee’s hours, breaks, shift wages, and import/export labor data.
How to create a Shift (including break and wage information):
curl https://connect.squareup.com/v2/labor/shifts \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '{
"idempotency_key": "UUID",
"shift": {
"employee_id": "AN_EMPLOYEE_ID",
"location_id": "YOUR_LOCATION_ID",
"start_at": "2019-02-05T12:00:00Z",
"wage": {
"title": "Photographer",
"hourly_rate": {
"amount": 4500,
"currency": "USD"
}
},
"breaks": [
{
"start_at": "2018-10-16T04:00:00Z"
"break_type_id": "A_BREAK_TYPE_ID",
"name": "2nd Breakfast",
"expected_duration": "PT10M",
"is_paid": true
}
]
}
}'
How to query a set of closed shifts from a workweek:
curl https: //connect.squareup.com/v2/labor/shifts/search \
-H 'Content-Type: application/json'\ -
H 'Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN'\ -
d '{
"query": {
"filter": {
"location_id": ["YOUR_LOCATION_ID"],
"workday": {
"date_range": {
"start_date": "2018-10-01",
"end_date": "2018-10-08"
},
"match_on": "START_AT"
},
"Status": "CLOSED"
},
"sort": {
"field": "CREATED_AT",
"order": "ASC"
}
},
"limit": 20
}'
You will find below a list of functionalities we implemented with this release:
- Employee shifts: View/create shifts worked by any employee, including the business location where the shift was worked, shift start/end times, and regular, overtime, and double time hours worked during the shift.
- Employee break tracking: Track employee breaks over the course of a worked shift, including break start/end times, durations, and whether they were paid/unpaid.
- Employee job tracking: View/edit the job (and wage) worked by an employee for any given shift, including the ability for one employee to have multiple jobs (and wages).
- Search: Search shifts by employee, business location, workday, start/end time, and status (open/closed shifts).
If you want to keep up to date with the rest of our content, be sure to follow this blog & our Twitter account, and sign up for our developer newsletter! We also have a Slack community for connecting with and talking to other developers implementing Square APIs.
By Dina Spitzer
Medium
Recommend
-
9
Announcing our $6M raise and the road aheadI am incredibly excited to announce that Ionic has raised an additional $6M in funding, lead by pre Arthur Ventures, and with General Catalyst participating. This brings Ionic’s total funding to $18M...
-
2
Home iOS & Swift Tutorials Announcing our Deprecated Books Repo!
-
6
by Rust Foundation Board of Directors With a successful launch behind us and an ambitious agenda ahead, the Rust Foundation is looking to channel the energy and vision of our members with the hiring of the organization’s firs...
-
4
Announcing our Testing Laravel premium video course Link – ...
-
8
-
6
January 27th, 2015 | 1 minute readAnnouncing: Our Open Source Code of ConductOur commitment to providing a welcoming and inspiring open source community
-
7
April 28th, 2017 | 3 minute readAnnouncing new versions of our client SDKsWe are releasing a big update to our first-party SDKs, as well as a new Slack community for developers!
-
5
-
3
September 22nd, 2017 | 1 minute readAnnouncing Version 2.3.0 of our Client LibrariesIf you are familiar with How Square makes its SDKs then you know that one of the best ways to see what’s new in our latest SDK version is...
-
6
Are We Using Our Identity to Connect — or Control?What would happen if we loosened our attachment to our labels?
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK