Struct gusto_api::payroll::Payroll [−][src]
pub struct Payroll { /* fields omitted */ }
Implementations
Get pay periods for a company.
This function performs a GET
to the /v1/companies/{company_id_or_uuid}/pay_periods
endpoint.
Pay periods are the foundation of payroll. Compensation, time & attendance, taxes, and expense reports all rely on when they happened. To begin submitting information for a given payroll, we need to agree on the time period.
By default, this endpoint returns every current and past pay period for a company. Since companies can process payroll as often as every week, there can be up to 53 pay periods a year. If a company has been running payroll with Gusto for five years, this endpoint could return up to 265 pay periods. Use the start_date
and end_date
parameters to reduce the scope of the response.
Parameters:
start_date: &str
end_date: &str
Get pay periods for a company.
This function performs a GET
to the /v1/companies/{company_id_or_uuid}/pay_periods
endpoint.
As opposed to get_company_pay_periods
, this function returns all the pages of the request at once.
Pay periods are the foundation of payroll. Compensation, time & attendance, taxes, and expense reports all rely on when they happened. To begin submitting information for a given payroll, we need to agree on the time period.
By default, this endpoint returns every current and past pay period for a company. Since companies can process payroll as often as every week, there can be up to 53 pay periods a year. If a company has been running payroll with Gusto for five years, this endpoint could return up to 265 pay periods. Use the start_date
and end_date
parameters to reduce the scope of the response.
Get all payrolls for a company.
This function performs a GET
to the /v1/companies/{company_id_or_uuid}/payrolls
endpoint.
Returns all payrolls, current and past for a company.
Notes:
- Hour and dollar amounts are returned as string representations of numeric decimals.
- Hours are represented to the thousands place; dollar amounts are represented to the cent.
- Every eligible compensation is returned for each employee. If no data has yet be inserted for a given field, it defaults to “0.00” (for fixed amounts) or “0.000” (for hours ).
Parameters:
processed: bool
– Whether to return processed or unprocessed payrolls.include_off_cycle: bool
– Whether to include off cycle payrolls in the response.include: &[String]
– Include the requested attribute in the employee_compensations attribute in the response.start_date: &str
– Return payrolls whose pay period is after the start date.end_date: &str
– Return payrolls whose pay period is before the end date.
Get all payrolls for a company.
This function performs a GET
to the /v1/companies/{company_id_or_uuid}/payrolls
endpoint.
As opposed to get_company_payrolls
, this function returns all the pages of the request at once.
Returns all payrolls, current and past for a company.
Notes:
- Hour and dollar amounts are returned as string representations of numeric decimals.
- Hours are represented to the thousands place; dollar amounts are represented to the cent.
- Every eligible compensation is returned for each employee. If no data has yet be inserted for a given field, it defaults to “0.00” (for fixed amounts) or “0.000” (for hours ).
pub async fn post_company_payroll(
&self,
company_id_or_uuid: &str,
body: &PostCompanyPayrollRequest
) -> Result<PayrollData>
pub async fn post_company_payroll(
&self,
company_id_or_uuid: &str,
body: &PostCompanyPayrollRequest
) -> Result<PayrollData>
Create an Off-Cycle Payroll (Beta).
This function performs a POST
to the /v1/companies/{company_id_or_uuid}/payrolls
endpoint.
This endpoint is in beta and intended for Gusto Embedded Payroll customers. Please apply for early access if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto.
Creates a new, unprocessed, off-cycle payroll.
pub async fn get_company_payroll(
&self,
company_id_or_uuid: &str,
payroll_id_or_uuid: &str,
include: GetCompanyPayrollsInclude,
show_calculation: &str
) -> Result<PayrollData>
pub async fn get_company_payroll(
&self,
company_id_or_uuid: &str,
payroll_id_or_uuid: &str,
include: GetCompanyPayrollsInclude,
show_calculation: &str
) -> Result<PayrollData>
Get a single payroll.
This function performs a GET
to the /v1/companies/{company_id_or_uuid}/payrolls/{payroll_id_or_uuid}
endpoint.
Returns a payroll.
Notes:
- Hour and dollar amounts are returned as string representations of numeric decimals.
- Hours are represented to the thousands place; dollar amounts are represented to the cent.
- Every eligible compensation is returned for each employee. If no data has yet be inserted for a given field, it defaults to “0.00” (for fixed amounts) or “0.000” (for hours ).
Parameters:
include: crate::types::GetCompanyPayrollsInclude
– Include the requested attribute in the employee_compensations attribute in the response.show_calculation: &str
– withinclude
, shows the tax, and/or benefit, and/or deduction details for a calculated, unprocessed payroll.
pub async fn put_company_payrolls(
&self,
company_id_or_uuid: &str,
payroll_id_or_uuid: &str,
body: &PutCompanyPayrollsRequest
) -> Result<PayrollData>
pub async fn put_company_payrolls(
&self,
company_id_or_uuid: &str,
payroll_id_or_uuid: &str,
body: &PutCompanyPayrollsRequest
) -> Result<PayrollData>
Update a payroll by ID.
This function performs a PUT
to the /v1/companies/{company_id_or_uuid}/payrolls/{payroll_id_or_uuid}
endpoint.
This endpoint allows you to update information for one or more employees for a specific unprocessed payroll.
pub async fn put_company_payrolls_pay_period_start_date_end(
&self,
company_id_or_uuid: &str,
pay_period_start_date: &str,
pay_period_end_date: &str,
body: &PutCompanyPayrollsRequest
) -> Result<PayrollData>
pub async fn put_company_payrolls_pay_period_start_date_end(
&self,
company_id_or_uuid: &str,
pay_period_start_date: &str,
pay_period_end_date: &str,
body: &PutCompanyPayrollsRequest
) -> Result<PayrollData>
Update a payroll.
This function performs a PUT
to the /v1/companies/{company_id_or_uuid}/payrolls/{pay_period_start_date}/{pay_period_end_date}
endpoint.
This endpoint allows you to update information for one or more employees for a specific unprocessed payroll.
The payrolls are identified by their pay periods’ start_date and end_date. Both are required and must correspond with an existing, unprocessed payroll. If the dates do not match, the entire request will be rejected. This was an explicit design decision to remove any assumptions around the timespan for data sent.
Calculate a Payroll (Beta).
This function performs a PUT
to the /v1/companies/{company_id}/payrolls/{payroll_id}/calculate
endpoint.
This endpoint is in beta and intended for Gusto Embedded Payroll customers. Please apply for early access if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto.
Performs calculations for taxes, benefits, and deductions for an unprocessed payroll. The calculated payroll details provide a preview of the actual values that will be used when the payroll is run.
This endpoint is asynchronous and responds with only a 202 HTTP status. To view the details of the calculated payroll, use the GET /v1/companies/{company_id}/payrolls/{payroll_id} endpoint with the show_calculation=true and include=taxes,benefits,deductions params
Submit Payroll (Beta).
This function performs a PUT
to the /v1/companies/{company_id}/payrolls/{payroll_Id}/submit
endpoint.
This endpoint is in beta and intended for Gusto Embedded Payroll customers. Please apply for early access if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto.
Submits an unprocessed payroll to be calculated and run. Upon success, transitions the payroll to the processed
state.
pub async fn put_api_company_payrolls_cancel(
&self,
company_id: &str,
payroll_id: &str
) -> Result<PayrollData>
pub async fn put_api_company_payrolls_cancel(
&self,
company_id: &str,
payroll_id: &str
) -> Result<PayrollData>
Cancel a Payroll (Beta).
This function performs a PUT
to the /v1/companies/{company_id}/payrolls/{payroll_id}/cancel
endpoint.
This endpoint is in beta and intended for Gusto Embedded Payroll customers. Please apply for early access if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto.
Transitions a processed
payroll back to the unprocessed
state. A payroll cannot be canceled once it has entered the funded
state.
pub async fn get_company_reversals(
&self,
company_id_or_uuid: &str
) -> Result<GetCompanyReversalsResponse>
pub async fn get_company_reversals(
&self,
company_id_or_uuid: &str
) -> Result<GetCompanyReversalsResponse>
Get approved Payroll Reversals.
This function performs a GET
to the /v1/companies/{company_id_or_uuid}/payroll_reversals
endpoint.
Returns all approved Payroll Reversals for a Company.