Getting Started with Paychex API
Paychex API allows businesses to automate and integrate employee HR and Payroll information with Paychex's platform. This API is designed to streamline HR operations, reduce manual data entry, and ensure data consistency across your organization’s software systems.
The Paychex API uses REST architecture. Security is a combination of an authorization framework using OAuth 2.0 and Paychex client access. Request and response payloads are formatted using JSON.
OAuth 2.0 Authentication
Before interacting with Paychex's API, you need to authenticate your requests to ensure they are secure. Paychex uses OAuth 2.0 for authentication, a robust and widely adopted standard.
Steps to Authenticate:
1. Obtain API Credentials:
Client ID and Client Secret: Provided by Paychex when you register your application.
2. Request an Access Token:
Send a POST request to the authentication endpoint with your credentials to receive an access token.
curl -X POST https://api.paychex.com/auth/oauth/v2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
Replace YOUR_CLIENT_ID
and YOUR_CLIENT_SECRET
with your actual credentials.
3. Response:
{
"access_token": "YOUR_ACCESS_TOKEN",
"token_type": "Bearer",
"expires_in": 3600
}
4. Use the Access Token:
Include the token in the Authorization
header of your API requests.
Authorization: Bearer YOUR_ACCESS_TOKEN
Deep Dive into Paychex API Endpoints
The Paychex API provides a range of endpoints that allow developers to manage various employee data.
Here are the most commonly used endpoints, along with practical use cases.
1. GET /companies
- Description: Returns an array of companies that are available in your application with some level of access.
- cURL Request:
curl -X GET https://api.paychex.com/companies \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
- Use Case: Obtain a list of all the companies from Paychex into your system.
2. GET /workers/{workerId}
- Description: Array of workers (employee and contractor) for all of the companies who are associated with a specific company that your application has been granted access to.
- cURL Request:
curl -X GET "https://api.paychex.com/companies/{companyId}/workers" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
- Parameters:
companyId
: The ID assigned to the company that workers are being requested for.
- Use Case: Obtain list of all employees in any company from Paychex into your system.
3. GET /workers/{workerId}/compensation/payrates
- Description: Information about a workers compensation rates. A worker can have up to 25 different rates. It’s not required for a worker to have a rate in the system.
- cURL Request:
curl -X GET "https://api.paychex.com/workers/{workerId}/compensation/payrates?asof=YYYY-MM-DD" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
- Parameters:
workerId
: ID associated with the desired employee.asof
: Example:asof=2020-01-04T00:00:00Z
(Returns all pay rates as of the date used in the request)
- Use Case: Obtain information about an employee’s pay rate(s) in an organization from Paychex into your system.
Pagination
The pagination parameters used to perform the transitions are captured in a pagination request form which contains the following parameters:
- Parameters:
offset
: The zero-based offset of the next page of data to be presented.limit
: The maximum number of elements to be returned in a page transition.
,For example, here’s how you can implement pagination while retrieving employees:
curl -X GET "https://api.paychex.com/companies/{companyId}/workers?offset=5&limit=100" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
The following endpoints have support for pagination:
- GET companies
- GET companies/{companyId}/checks?payperiodid={payPeriodId} (Processed checks only)
- GET companies/workers
Troubleshooting Guide
Error Responses
APIs can return errors for various reasons, such as invalid requests or server issues. Paychex uses standard HTTP status codes to indicate success or failure.
Common HTTP Status Codes:
Get Started With Paychex API Using Bindbee
Integrating with Paychex shouldn’t feel like a battle. But for most teams, it ends up being a major time sink, draining valuable engineering resources.
Why put your developers through the grind when Bindbee can get you live with Paychex in just minutes?
Setting up the Paychex connector with Bindbe
- Sign up with Bindbee and navigate to the dashboard.
- Create a Connector:
- Click on Create Connector from the dashboard.
- Select HRIS as the type of integration. Enter customer details and give your connector a unique ID (e.g., Paychex_Integration).
- Generate a Magic Link:
- After setting up the connector, click Create Link to generate a magic link. This will allow the customer to authenticate the connection with Paychex.
- Open the link and enter the necessary credentials. This step establishes the connection between Paychex and Bindbee.
- Sync the Connector:
- Once the connection is made, the connector will begin syncing data from BambooHR. This may take a few minutes depending on the size of the data. You can track the sync status in the connector section.
- Access the Synced Data:
- After syncing, go to the Employee section in the Bindbee dashboard and select Get Employees to retrieve employee data from BambooHR.
- Get the API Key and Connector Token:
- Copy the API key and the x-connector-token from the Bindbee dashboard, which you will need to make authenticated API requests.
Retrieving Employee Data with Bindbee
Once the Paychex data has been synced, you can retrieve employee data on to your application via the Bindbee API.
Here’s a step-by-step process for accessing synced data from BambooHR through Bindbee’s unified API:
- Request Setup:
- Use the Bindbee API to send a request for employee data. You’ll need both your Bindbee API token and the x-connector-token.
- Example cURL Request:
curl --request GET \
--url https://api.bindbee.com/hris/v1/employees \
--header 'Authorization: Bearer YOUR_BINDBEE_API_KEY' \
--header 'x-connector-token: YOUR_CONNECTOR_TOKEN'
This request will return a list of employee objects, including details like the employee’s first name, last name, job title, department, and contact information.
- Sample Response:
{
"items": [
{
"id": "018b18ef-c487-703c-afd9-0ca478ccd9d6",
"first_name": "Kunal",
"last_name": "Tyagi",
"job_title": "Chief Technology Officer",
"department": "Engineering",
"work_email": "kunal@bindbee.dev"
}
]
}
Bulk Employee Data Retrieval
For retrieving large datasets, Bindbee simplifies the process by allowing you to fetch bulk employee data from BambooHR.
The pagination feature helps manage large responses by returning results in pages.
- Pagination Parameters:
- Use the
cursor
andpage_size
parameters to navigate through the results. By default, Bindbee returns 50 records per page. - Example of a paginated request:
- Use the
url = "https://api.bindbee.com/hris/v1/employees?cursor=MDE4YjE4ZWYtYzk5Yy03YTg2LTk5NDYtN2I3YzlkNTQzM2U1&page_size=50"
response = requests.get(url, headers=headers)
- Querying for Specific Employee Data:
- You can further refine your request by filtering based on specific fields, such as manager_id, remote_id, or company_id to get employees under a particular manager or company.
Say hello to Bindbee.
Book a demo with our experts today.