Getting Started with Gusto Embedded Payroll APIs
Making payroll deductions and issuing paychecks can be a daunting task for small business owners. Fortunately, Gusto has developed a comprehensive embedded payroll API to help businesses manage all their payroll needs. In this blog post, I will show you how to get started with the Gusto Embedded Payroll API.
I will also provide you with step-by-step instructions on the following:
- How to make your first API Call to Gusto Embedded Payroll API
- How to create your first Gusto Embedded Payroll Flow
Step 1: Sign-up for a Developer Account with Gusto
Signing up for a Developer Account will give you access to the Gusto API, which you can use to build amazing apps that make life easier for Gusto customers. In addition, it gives you access to our Developer Portal, where you can find all the resources you need to get started, including tutorials, API documentation, and support from other developers.
To sign-up, click on this link: dev.gusto.com/accounts/sign_up
Step 2: Create an Organization and generate a Developer API Token
By creating an organization, you indicate your intent to build a Gusto Embedded integration. You will need to provide some additional details about the type of integration you’re making, as well as your company’s website and other relevant information. This process is necessary in order to ensure that your integration meets our quality standards and is compatible with Gusto’s platform. Once your organization has been created, you will be able to invite other developers to join and collaborate on your project.
To create an Organization:
- Sign In to dev.gusto.com
- Click on Organization -> Create Organization
- Click on the newly created Organization
- You will now have access to the “Developer API Token”
- Copy the Developer API token
Step 3: Make an API Call to create a Demo Company
The Partner-managed company API provides a way to create a Demo Gusto company that you can manage. It also creates an Admin user of this demo company. This API returns an access token, refresh token, and company_uuid which you can make API calls to all other payroll endpoints and explore them. This is a great way to get started with the Gusto API and to see how everything works.
Note: For Demo (Sandbox) environment , the Server Base URL for making API call is api.gusto-demo.com/v1’
You can test this API call on your terminal by just copy-pasting
curl --location --request POST 'https://api.gusto-demo.com/v1/partner_managed_companies' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token [Paste the DEVELOPER API TOKEN you copied from Step 2]' \
--data-raw '{
"user": {
"first_name": "FirstName",
"last_name": "LastName",
"email": "First.Last@email.com",
"phone": "1122334455"
},
"company": {
"name": "My First Demo Company"
}
}'
Here is the response you will receive for this API request :
HTTP 200 OK
{
"company_uuid": "a04f43bb-cb40-4009-9f10-xxxxxx",
"access_token": "xxxxxxBNjYXXRVWuxQeFq6z-xxxxxx",
"refresh_token": "xxxxx2AO0pzSDR10QXHeixxxxxx"
}
Congratulations, you made your first API Call to Gusto Embedded APIs in 3 Steps !!!
Note: You can see the newly created Demo Company (My First Demo Company) on the Developer Console as well. > Sign In to dev.gusto.com -> Click on Demo Companies. You can also create demo companies via this UI.
Step 4: Create a customizable GEP UI Flow
Gusto Embedded Payroll Flows are designed to make it easy for developers to incorporate key payroll features into their applications. The flows can be used on their own or in conjunction with Gusto APIs, allowing developers to tailor the experience to their specific needs. With just a few clicks, developers can add support for employee onboarding, time tracking, payroll processing, and more. Best of all, the flows are constantly being updated with new features and enhancements, so developers can rest assured that their applications will always be up-to-date.
Here is how you can create one:
You will need the company_uuid and access_token from STEP 3. Make an API call to Flows API You can test this API call on your terminal by just copy-pasting
curl --location --request POST 'https://api.gusto-demo.com/v1/companies/[companyUUID from step 3]/flows' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: bearer [access_token from STEP 3]' \
--data-raw '{
"flow_type": "company_onboarding"
}'
Here is the response you will receive for this API request :
HTTP 201 Created
{
"url": "https://flows.gusto-demo.com/flows/XXXXXX-Q1r2IFjV4zy2UF-8MkirDq7w1Y"
}
If you copy-paste the URL on the browser, you will see the UI flow something like this
That's it, folks.
If you want to learn more about GEP APIs, visit the documentation website here: docs.gusto.com/embedded-payroll/docs
To learn more about GEP UI Flows: docs.gusto.com/embedded-payroll/docs/overview
Let me know if this was helpful in the comments below.