- deleteV1CompanyBenefitsCompanyBenefitId - Delete a company benefit
- getV1Benefits - Get all benefits supported by Gusto
- getV1BenefitsBenefitId - Get a supported benefit by ID
- getV1BenefitsBenefitsIdRequirements - Get benefit fields requirements by ID
- getV1BenefitsCompanyBenefitIdSummary - Get company benefit summary by company benefit id.
- getV1CompaniesCompanyIdCompanyBenefits - Get benefits for a company
- getV1CompanyBenefitsCompanyBenefitId - Get a company benefit
- postV1CompaniesCompanyIdCompanyBenefits - Create a company benefit
- putV1CompanyBenefitsCompanyBenefitId - Update a company benefit
The following must be true in order to delete a company benefit
- There are no employee benefits associated with the company benefit
- There are no payroll items associated with the company benefit
- The benefit is not managed by a Partner or by Gusto (type must be 'External')
import { Gusto } from "@speakeasy-sdks/gusto";
import {
DeleteV1CompanyBenefitsCompanyBenefitIdRequest,
DeleteV1CompanyBenefitsCompanyBenefitIdResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const companyBenefitId: string = "itaque";
sdk.companyBenefits.deleteV1CompanyBenefitsCompanyBenefitId(companyBenefitId).then((res: DeleteV1CompanyBenefitsCompanyBenefitIdResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
companyBenefitId |
string | ✔️ | The UUID of the company benefit |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.DeleteV1CompanyBenefitsCompanyBenefitIdResponse>
Returns all benefits supported by Gusto.
The benefit object in Gusto contains high level information about a particular benefit type and its tax considerations. When companies choose to offer a benefit, they are creating a Company Benefit object associated with a particular benefit.
scope: benefits:read
import { Gusto } from "@speakeasy-sdks/gusto";
import { GetV1BenefitsResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
sdk.companyBenefits.getV1Benefits().then((res: GetV1BenefitsResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetV1BenefitsResponse>
Returns a benefit supported by Gusto.
The benefit object in Gusto contains high level information about a particular benefit type and its tax considerations. When companies choose to offer a benefit, they are creating a Company Benefit object associated with a particular benefit.
scope: benefits:read
import { Gusto } from "@speakeasy-sdks/gusto";
import { GetV1BenefitsBenefitIdRequest, GetV1BenefitsBenefitIdResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const benefitId: string = "incidunt";
sdk.companyBenefits.getV1BenefitsBenefitId(benefitId).then((res: GetV1BenefitsBenefitIdResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
benefitId |
string | ✔️ | The benefit type in Gusto. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetV1BenefitsBenefitIdResponse>
Returns field requirements for the requested benefit type.
scope: benefits:read
import { Gusto } from "@speakeasy-sdks/gusto";
import {
GetV1BenefitsBenefitsIdRequirementsRequest,
GetV1BenefitsBenefitsIdRequirementsResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const benefitId: string = "enim";
sdk.companyBenefits.getV1BenefitsBenefitsIdRequirements(benefitId).then((res: GetV1BenefitsBenefitsIdRequirementsResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
benefitId |
string | ✔️ | The benefit type in Gusto. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetV1BenefitsBenefitsIdRequirementsResponse>
Returns summary benefit data for the requested company benefit id.
scope: benefits:read
import { Gusto } from "@speakeasy-sdks/gusto";
import {
GetV1BenefitsCompanyBenefitIdSummaryRequest,
GetV1BenefitsCompanyBenefitIdSummaryResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const companyBenefitId: string = "consequatur";
const detailed: boolean = false;
const endDate: string = "2022-12-31";
const startDate: string = "2022-01-01";
sdk.companyBenefits.getV1BenefitsCompanyBenefitIdSummary(companyBenefitId, detailed, endDate, startDate).then((res: GetV1BenefitsCompanyBenefitIdSummaryResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
companyBenefitId |
string | ✔️ | The UUID of the company benefit | |
detailed |
boolean | ➖ | Display employee payroll item summary | |
endDate |
string | ➖ | The end date for which to retrieve company benefit summary | 2022-12-31 |
startDate |
string | ➖ | The start date for which to retrieve company benefit summary | 2022-01-01 |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetV1BenefitsCompanyBenefitIdSummaryResponse>
Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.
Note that company benefits can be deactivated only when no employees are enrolled.
scope: company_benefits:read
import { Gusto } from "@speakeasy-sdks/gusto";
import {
GetV1CompaniesCompanyIdCompanyBenefitsRequest,
GetV1CompaniesCompanyIdCompanyBenefitsResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const companyId: string = "est";
const enrollmentCount: boolean = false;
sdk.companyBenefits.getV1CompaniesCompanyIdCompanyBenefits(companyId, enrollmentCount).then((res: GetV1CompaniesCompanyIdCompanyBenefitsResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
companyId |
string | ✔️ | The UUID of the company |
enrollmentCount |
boolean | ➖ | Whether to return employee enrollment count |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetV1CompaniesCompanyIdCompanyBenefitsResponse>
Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.
Note that company benefits can be deactivated only when no employees are enrolled.
When with_employee_benefits parameter with true value is passed, employee_benefits:read scope is required to return employee_benefits.
scope: company_benefits:read
import { Gusto } from "@speakeasy-sdks/gusto";
import {
GetV1CompanyBenefitsCompanyBenefitIdRequest,
GetV1CompanyBenefitsCompanyBenefitIdResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const companyBenefitId: string = "quibusdam";
const withEmployeeBenefits: boolean = false;
sdk.companyBenefits.getV1CompanyBenefitsCompanyBenefitId(companyBenefitId, withEmployeeBenefits).then((res: GetV1CompanyBenefitsCompanyBenefitIdResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
companyBenefitId |
string | ✔️ | The UUID of the company benefit |
withEmployeeBenefits |
boolean | ➖ | Whether to return employee benefits associated with the benefit |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetV1CompanyBenefitsCompanyBenefitIdResponse>
Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.
Note that company benefits can be deactivated only when no employees are enrolled.
scope: company_benefits:write
import { Gusto } from "@speakeasy-sdks/gusto";
import {
PostV1CompaniesCompanyIdCompanyBenefitsRequest,
PostV1CompaniesCompanyIdCompanyBenefitsRequestBody,
PostV1CompaniesCompanyIdCompanyBenefitsResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const companyId: string = "explicabo";
const requestBody: PostV1CompaniesCompanyIdCompanyBenefitsRequestBody = {
active: false,
benefitType: 6471.74,
description: "distinctio",
responsibleForEmployeeW2: false,
responsibleForEmployerTaxes: false,
};
sdk.companyBenefits.postV1CompaniesCompanyIdCompanyBenefits(companyId, requestBody).then((res: PostV1CompaniesCompanyIdCompanyBenefitsResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
companyId |
string | ✔️ | The UUID of the company |
requestBody |
operations.PostV1CompaniesCompanyIdCompanyBenefitsRequestBody | ➖ | N/A |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.PostV1CompaniesCompanyIdCompanyBenefitsResponse>
Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.
Note that company benefits can be deactivated only when no employees are enrolled.
scope: company_benefits:write
import { Gusto } from "@speakeasy-sdks/gusto";
import {
PutV1CompanyBenefitsCompanyBenefitIdRequest,
PutV1CompanyBenefitsCompanyBenefitIdRequestBody,
PutV1CompanyBenefitsCompanyBenefitIdResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";
const sdk = new Gusto({
security: {
authorization: "",
},
});
const companyBenefitId: string = "quibusdam";
const requestBody: PutV1CompanyBenefitsCompanyBenefitIdRequestBody = {
active: false,
description: "labore",
version: "modi",
};
sdk.companyBenefits.putV1CompanyBenefitsCompanyBenefitId(companyBenefitId, requestBody).then((res: PutV1CompanyBenefitsCompanyBenefitIdResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
Parameter | Type | Required | Description |
---|---|---|---|
companyBenefitId |
string | ✔️ | The UUID of the company benefit |
requestBody |
operations.PutV1CompanyBenefitsCompanyBenefitIdRequestBody | ➖ | N/A |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.PutV1CompanyBenefitsCompanyBenefitIdResponse>