Gross up a payroll item

Calculates the gross earning needed for an employee to receive a target net amount, and saves it on the payroll item.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Replaces the payroll item's earnings with a single bonus, commission, or non_hourly_regular earning whose amount is the gross wage that nets to the requested net_amount after the employee's taxes. The saved gross is the smallest amount, to the cent, whose net is at least net_amount; because taxes are withheld in whole cents, the net may be a few cents above the target. The calculation is synchronous: a 200 response means the gross has been calculated and saved, and the payroll's current preview has been invalidated.

The payroll item must belong to a draft off-cycle payroll with apply_benefits and apply_post_tax_deductions both false. The request must contain exactly one earning, and any earnings already saved on the item are replaced. Reimbursements already saved on the item are kept and are paid in addition to the target net. A bonus or commission is withheld as supplemental wages; a non-hourly regular earning is withheld as regular wages unless the payroll's off_cycle_options.force_supplemental_withholding is true. Year-to-date wages and annual wage bases apply as they do in a preview.

Check does not store net_amount. After a successful call the saved earning is an ordinary fixed-gross earning, and the response is the standard payroll item object. To change the target later, call this endpoint again with the new net_amount.

The item's saved supplemental_tax_calc_method and tax_overrides are used in the calculation. Set them with Update a payroll item before calling this endpoint; the request accepts only earnings and rejects any other payroll item field.

See the Gross-up Payments guide for the full workflow.

Each earning in earnings may include only the same writable keys Update a payroll item allows on an earning for your API version, plus net_amount. Any other key returns a validation error on that earning. If you send multiple problems at once (for example, an unknown key and amount together), every problem is listed in one response.

Send an X-Idempotency-Key header and reuse it only when retrying the same request after a timeout. Within the 24-hour retention window a replay returns the original outcome rather than calculating again, and reusing the key with a different body returns 409 idempotency_key_conflict. A new key starts a new calculation from the net_amount in that request; it never treats a previously calculated gross as a new target.

Errors

Validation failures return a validation_error with field-attributed input_errors. The item is left unchanged on any error.

ConditionField path
Payroll is not an off-cycle payroll, or has apply_benefits or apply_post_tax_deductions enabledpayroll
earnings is missing, empty, or contains more than one entryearnings
Earning type is not bonus, commission, or non_hourly_regularearnings[0].type
Earning code is not of type bonus, commission, or non_hourly_regularearnings[0].earning_code
net_amount is missing, zero, or negativeearnings[0].net_amount
amount or earning_rate is includedearnings[0].amount or earnings[0].earning_rate
A key appears on the earning that Update a payroll item does not allow for your API version, besides the allowed earning fields and net_amountearnings[0].<key>
Any field other than earnings is included, such as tax_overridesThat field
A saved reimbursement has a zero amount, on API versions 2021-04-08 and laterreimbursements.non_field_errors
A commission earning is sent with hours set to 0, for providers with commission hours enabledearnings.non_field_errors

An approved payroll returns payroll_already_approved and a payroll managed by a correction lifecycle session returns payroll_managed_by_correction, as on other payroll item writes. If the calculation cannot solve the item, the response is 400 gross_up_not_supported; validation catches the known causes first, so this is rare. If the tax engine cannot produce a gross, the response is 502 symmetry_gross_up_failed; if its gross still misses net_amount after Check recalculates, the response is 500 gross_up_net_mismatch. In every case the item is unchanged; the 5xx outcomes should not happen in practice.

Path Params
string
required

ID of the payroll item to gross up

Body Params
earnings
array of objects
required

The complete intended earnings for the payroll item. Must contain exactly one earning. Any earnings currently saved on the item are replaced. This is the only field the request accepts; tax_overrides and supplemental_tax_calc_method are read from the saved payroll item. Each earning may include only the keys your API version allows on a payroll item update (writable earning fields), plus net_amount; other keys are rejected.

earnings*
Headers
string

Recommended. Reuse the same key only when retrying this exact request after a timeout; a replay within 24 hours returns the original outcome instead of calculating again.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json