Skip to content

Latest commit

 

History

History
executable file
·
325 lines (251 loc) · 16.7 KB

File metadata and controls

executable file
·
325 lines (251 loc) · 16.7 KB

externalPayrolls

Available Operations

deleteV1ExternalPayroll

Delete an external payroll. scope: payrolls:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { DeleteV1ExternalPayrollRequest, DeleteV1ExternalPayrollResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyUuid: string = "repellendus";
const externalPayrollId: string = "officia";

sdk.externalPayrolls.deleteV1ExternalPayroll(companyUuid, externalPayrollId).then((res: DeleteV1ExternalPayrollResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyUuid string ✔️ The UUID of the company
externalPayrollId string ✔️ The UUID of the external payroll
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeleteV1ExternalPayrollResponse>

getV1CompanyExternalPayrolls

Get an external payroll for a given company. scope: payrolls:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { GetV1CompanyExternalPayrollsRequest, GetV1CompanyExternalPayrollsResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyUuid: string = "maxime";

sdk.externalPayrolls.getV1CompanyExternalPayrolls(companyUuid).then((res: GetV1CompanyExternalPayrollsResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyUuid string ✔️ The UUID of the company
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1CompanyExternalPayrollsResponse>

getV1ExternalPayroll

Get an external payroll for a given company. scope: payrolls:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { GetV1ExternalPayrollRequest, GetV1ExternalPayrollResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyUuid: string = "dignissimos";
const externalPayrollId: string = "officia";

sdk.externalPayrolls.getV1ExternalPayroll(companyUuid, externalPayrollId).then((res: GetV1ExternalPayrollResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyUuid string ✔️ The UUID of the company
externalPayrollId string ✔️ The UUID of the external payroll
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1ExternalPayrollResponse>

getV1ExternalPayrollCalculateTaxes

Get tax suggestions for an external payroll. Earnings and/or benefits data must be saved prior to the calculation in order to retrieve accurate tax calculation.

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1ExternalPayrollCalculateTaxesRequest,
  GetV1ExternalPayrollCalculateTaxesResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyUuid: string = "asperiores";
const externalPayrollId: string = "nemo";

sdk.externalPayrolls.getV1ExternalPayrollCalculateTaxes(companyUuid, externalPayrollId).then((res: GetV1ExternalPayrollCalculateTaxesResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyUuid string ✔️ The UUID of the company
externalPayrollId string ✔️ The UUID of the external payroll
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1ExternalPayrollCalculateTaxesResponse>

postV1ExternalPayroll

Creates a new external payroll for the company. scope: payrolls:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  PostV1ExternalPayrollRequest,
  PostV1ExternalPayrollRequestBody,
  PostV1ExternalPayrollResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyUuid: string = "quae";
const requestBody: PostV1ExternalPayrollRequestBody = {
  checkDate: "quaerat",
  paymentPeriodEndDate: "porro",
  paymentPeriodStartDate: "quod",
};

sdk.externalPayrolls.postV1ExternalPayroll(companyUuid, requestBody).then((res: PostV1ExternalPayrollResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyUuid string ✔️ The UUID of the company
requestBody operations.PostV1ExternalPayrollRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PostV1ExternalPayrollResponse>

putV1ExternalPayroll

Update an external payroll with a list of external payroll items scope: payrolls:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  PutV1ExternalPayrollRequest,
  PutV1ExternalPayrollRequestBody,
  PutV1ExternalPayrollRequestBodyExternalPayrollItems,
  PutV1ExternalPayrollRequestBodyExternalPayrollItemsBenefits,
  PutV1ExternalPayrollRequestBodyExternalPayrollItemsEarnings,
  PutV1ExternalPayrollRequestBodyExternalPayrollItemsEarningsEarningType,
  PutV1ExternalPayrollRequestBodyExternalPayrollItemsTaxes,
  PutV1ExternalPayrollResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyUuid: string = "labore";
const externalPayrollId: string = "ab";
const requestBody: PutV1ExternalPayrollRequestBody = {
  externalPayrollItems: [
    {
      benefits: [
        {
          benefitId: 662505,
          companyContributionAmount: "suscipit",
          employeeDeductionAmount: "velit",
        },
        {
          benefitId: 633931,
          companyContributionAmount: "est",
          employeeDeductionAmount: "recusandae",
        },
        {
          benefitId: 517309,
          companyContributionAmount: "fugiat",
          employeeDeductionAmount: "vel",
        },
      ],
      earnings: [
        {
          amount: "quos",
          earningId: 427834,
          earningType: PutV1ExternalPayrollRequestBodyExternalPayrollItemsEarningsEarningType.CompanyPayType,
          hours: "possimus",
        },
        {
          amount: "facilis",
          earningId: 738227,
          earningType: PutV1ExternalPayrollRequestBodyExternalPayrollItemsEarningsEarningType.CompanyPayType,
          hours: "in",
        },
      ],
      employeeUuid: "corporis",
      taxes: [
        {
          amount: "assumenda",
          taxId: 363161,
        },
        {
          amount: "recusandae",
          taxId: 397533,
        },
        {
          amount: "aperiam",
          taxId: 738683,
        },
        {
          amount: "consectetur",
          taxId: 449083,
        },
      ],
    },
  ],
  replaceFields: false,
};

sdk.externalPayrolls.putV1ExternalPayroll(companyUuid, externalPayrollId, requestBody).then((res: PutV1ExternalPayrollResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyUuid string ✔️ The UUID of the company
externalPayrollId string ✔️ The UUID of the external payroll
requestBody operations.PutV1ExternalPayrollRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PutV1ExternalPayrollResponse>