Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 20 additions & 22 deletions docs/reference/endpoint-inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -837,10 +837,6 @@
"method": "GET",
"path": "/v1/employees/:employeeId/jobs"
},
{
"method": "GET",
"path": "/v1/employees/:employeeId/pay_stubs"
},
{
"method": "GET",
"path": "/v1/employees/:employeeUuid/federal_taxes"
Expand All @@ -852,18 +848,13 @@
{
"method": "DELETE",
"path": "/v1/jobs/:jobId"
},
{
"method": "GET",
"path": "/v1/payrolls/:payrollId/employees/:employeeId/pay_stub"
}
],
"variables": [
"compensationId",
"employeeId",
"employeeUuid",
"jobId",
"payrollId"
"jobId"
]
},
"Employee.HomeAddress": {
Expand Down Expand Up @@ -1982,10 +1973,6 @@
"method": "GET",
"path": "/v1/employees/:employeeId/jobs"
},
{
"method": "GET",
"path": "/v1/employees/:employeeId/pay_stubs"
},
{
"method": "GET",
"path": "/v1/employees/:employeeUuid/federal_taxes"
Expand All @@ -1997,18 +1984,13 @@
{
"method": "DELETE",
"path": "/v1/jobs/:jobId"
},
{
"method": "GET",
"path": "/v1/payrolls/:payrollId/employees/:employeeId/pay_stub"
}
],
"variables": [
"compensationId",
"employeeId",
"employeeUuid",
"jobId",
"payrollId"
"jobId"
]
},
"EmployeeManagement.HomeAddress": {
Expand Down Expand Up @@ -2075,6 +2057,22 @@
"employeeId"
]
},
"EmployeeManagement.PaystubsCard": {
"endpoints": [
{
"method": "GET",
"path": "/v1/employees/:employeeId/pay_stubs"
},
{
"method": "GET",
"path": "/v1/payrolls/:payrollId/employees/:employeeId/pay_stub"
}
],
"variables": [
"employeeId",
"payrollId"
]
},
"EmployeeManagement.TerminateEmployee": {
"endpoints": [
{
Expand Down Expand Up @@ -2612,11 +2610,11 @@
"Employee.Compensation",
"Employee.Deductions",
"Employee.HomeAddress",
"Employee.PaymentMethod",
"Employee.WorkAddress",
"EmployeeManagement.DocumentManager",
"EmployeeManagement.FederalTaxes",
"EmployeeManagement.PaymentMethod",
"EmployeeManagement.PaystubsCard",
"EmployeeManagement.Profile",
"EmployeeManagement.StateTaxes"
]
Expand Down Expand Up @@ -2668,11 +2666,11 @@
},
"EmployeeManagement.DashboardFlow": {
"blocks": [
"Employee.PaymentMethod",
"EmployeeManagement.DocumentManager",
"EmployeeManagement.FederalTaxes",
"EmployeeManagement.HomeAddress",
"EmployeeManagement.PaymentMethod",
"EmployeeManagement.PaystubsCard",
"EmployeeManagement.Profile",
"EmployeeManagement.StateTaxes",
"EmployeeManagement.WorkAddress",
Expand Down
10 changes: 4 additions & 6 deletions docs/reference/endpoint-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,9 @@ import inventory from '@gusto/embedded-react-sdk/endpoint-inventory.json'
| | GET | `/v1/employees/:employeeId` |
| | GET | `/v1/employees/:employeeId/forms` |
| | GET | `/v1/employees/:employeeId/jobs` |
| | GET | `/v1/employees/:employeeId/pay_stubs` |
| | GET | `/v1/employees/:employeeUuid/federal_taxes` |
| | GET | `/v1/employees/:employeeUuid/state_taxes` |
| | DELETE | `/v1/jobs/:jobId` |
| | GET | `/v1/payrolls/:payrollId/employees/:employeeId/pay_stub` |
| **Employee.HomeAddress** | GET | `/v1/employees/:employeeId` |
| | GET | `/v1/employees/:employeeId/home_addresses` |
| | DELETE | `/v1/home_addresses/:homeAddressUuid` |
Expand Down Expand Up @@ -374,11 +372,9 @@ import inventory from '@gusto/embedded-react-sdk/endpoint-inventory.json'
| | GET | `/v1/employees/:employeeId` |
| | GET | `/v1/employees/:employeeId/forms` |
| | GET | `/v1/employees/:employeeId/jobs` |
| | GET | `/v1/employees/:employeeId/pay_stubs` |
| | GET | `/v1/employees/:employeeUuid/federal_taxes` |
| | GET | `/v1/employees/:employeeUuid/state_taxes` |
| | DELETE | `/v1/jobs/:jobId` |
| | GET | `/v1/payrolls/:payrollId/employees/:employeeId/pay_stub` |
| **EmployeeManagement.HomeAddress** | GET | `/v1/employees/:employeeId` |
| | GET | `/v1/employees/:employeeId/home_addresses` |
| | DELETE | `/v1/home_addresses/:homeAddressUuid` |
Expand All @@ -389,6 +385,8 @@ import inventory from '@gusto/embedded-react-sdk/endpoint-inventory.json'
| | GET | `/v1/employees/:employeeId` |
| | PUT | `/v1/employees/:employeeId` |
| | PUT | `/v1/employees/:employeeId/onboarding_status` |
| **EmployeeManagement.PaystubsCard** | GET | `/v1/employees/:employeeId/pay_stubs` |
| | GET | `/v1/payrolls/:payrollId/employees/:employeeId/pay_stub` |
| **EmployeeManagement.TerminateEmployee** | GET | `/v1/companies/:companyId/pay_periods/unprocessed_termination_pay_periods` |
| | GET | `/v1/companies/:companyId/payrolls` |
| | POST | `/v1/companies/:companyId/payrolls` |
Expand Down Expand Up @@ -485,13 +483,13 @@ Flows compose multiple blocks into a single workflow. The endpoint list for a fl
| **Contractor.OnboardingFlow** | Contractor.Address, Contractor.ContractorList, Contractor.ContractorProfile, Contractor.ContractorSubmit, Contractor.NewHireReport, Contractor.PaymentMethod |
| **Contractor.PaymentFlow** | Contractor.CreatePayment, Contractor.PaymentHistory, Contractor.PaymentStatement, Contractor.PaymentSummary, Contractor.PaymentsList, InformationRequests.InformationRequestsFlow |
| **ContractorOnboarding.OnboardingFlow** | ContractorOnboarding.Address, ContractorOnboarding.ContractorList, ContractorOnboarding.ContractorProfile, ContractorOnboarding.ContractorSubmit, ContractorOnboarding.NewHireReport, ContractorOnboarding.PaymentMethod |
| **Employee.DashboardFlow** | Employee.Compensation, Employee.Deductions, Employee.HomeAddress, Employee.PaymentMethod, Employee.WorkAddress, EmployeeManagement.DocumentManager, EmployeeManagement.FederalTaxes, EmployeeManagement.PaymentMethod, EmployeeManagement.Profile, EmployeeManagement.StateTaxes |
| **Employee.DashboardFlow** | Employee.Compensation, Employee.Deductions, Employee.HomeAddress, Employee.WorkAddress, EmployeeManagement.DocumentManager, EmployeeManagement.FederalTaxes, EmployeeManagement.PaymentMethod, EmployeeManagement.PaystubsCard, EmployeeManagement.Profile, EmployeeManagement.StateTaxes |
| **Employee.EmployeeListFlow** | Employee.DashboardFlow, Employee.OnboardingExecutionFlow, Employee.TerminationFlow, EmployeeManagement.EmployeeList |
| **Employee.OnboardingExecutionFlow** | Employee.Compensation, Employee.Deductions, Employee.EmployeeDocuments, Employee.OnboardingSummary, Employee.PaymentMethod, Employee.Profile, EmployeeOnboarding.FederalTaxes, EmployeeOnboarding.StateTaxes |
| **Employee.OnboardingFlow** | Employee.EmployeeList, Employee.OnboardingExecutionFlow |
| **Employee.SelfOnboardingFlow** | Employee.DocumentSigner, Employee.Landing, Employee.OnboardingSummary, Employee.PaymentMethod, Employee.Profile, EmployeeOnboarding.FederalTaxes, EmployeeOnboarding.StateTaxes |
| **Employee.TerminationFlow** | Employee.TerminateEmployee, Employee.TerminationSummary, Payroll.DismissalFlow, Payroll.PayrollLanding |
| **EmployeeManagement.DashboardFlow** | Employee.PaymentMethod, EmployeeManagement.DocumentManager, EmployeeManagement.FederalTaxes, EmployeeManagement.HomeAddress, EmployeeManagement.PaymentMethod, EmployeeManagement.Profile, EmployeeManagement.StateTaxes, EmployeeManagement.WorkAddress, EmployeeOnboarding.Compensation, EmployeeOnboarding.Deductions |
| **EmployeeManagement.DashboardFlow** | EmployeeManagement.DocumentManager, EmployeeManagement.FederalTaxes, EmployeeManagement.HomeAddress, EmployeeManagement.PaymentMethod, EmployeeManagement.PaystubsCard, EmployeeManagement.Profile, EmployeeManagement.StateTaxes, EmployeeManagement.WorkAddress, EmployeeOnboarding.Compensation, EmployeeOnboarding.Deductions |
| **EmployeeManagement.EmployeeListFlow** | EmployeeManagement.DashboardFlow, EmployeeManagement.EmployeeList, EmployeeManagement.TerminationFlow, EmployeeOnboarding.OnboardingExecutionFlow |
| **EmployeeManagement.TerminationFlow** | EmployeeManagement.TerminateEmployee, EmployeeManagement.TerminationSummary, Payroll.DismissalFlow, Payroll.PayrollLanding |
| **EmployeeOnboarding.OnboardingExecutionFlow** | Employee.EmployeeDocuments, Employee.PaymentMethod, EmployeeOnboarding.Compensation, EmployeeOnboarding.Deductions, EmployeeOnboarding.FederalTaxes, EmployeeOnboarding.OnboardingSummary, EmployeeOnboarding.Profile, EmployeeOnboarding.StateTaxes |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Employee management components can be used to compose your own workflow, or can
- [Composing from EmployeeManagement.HomeAddressCard and EmployeeManagement.HomeAddressEditForm directly](#composing-from-employeemanagementhomeaddresscard-and-employeemanagementhomeaddresseditform-directly)
- [EmployeeManagement.WorkAddress](#employeemanagementworkaddress)
- [Composing from EmployeeManagement.WorkAddressCard and EmployeeManagement.WorkAddressEditForm directly](#composing-from-employeemanagementworkaddresscard-and-employeemanagementworkaddresseditform-directly)
- [EmployeeManagement.PaystubsCard](#employeemanagementpaystubscard)

### EmployeeManagement.DashboardFlow

Expand Down Expand Up @@ -536,3 +537,42 @@ function MyWorkAddressPanel({ employeeId }) {
| EMPLOYEE_MANAGEMENT_WORK_ADDRESS_UPDATED | Fired after a work address is updated | Updated `EmployeeWorkAddress` entity |
| EMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETED | Fired after a work address is deleted | Deleted `EmployeeWorkAddress` entity |
| EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_CANCELLED | Fired when the user clicks Back on the edit screen | None |

### EmployeeManagement.PaystubsCard

A self-contained, read-only card for viewing an employee's paystubs — the same "Paystubs" surface the dashboard renders, drop-in usable anywhere. Renders a paginated table showing each payday, check amount, gross pay, and payment method, with a per-row download button. Clicking a row's download button fetches that paystub's PDF and opens it in a new browser tab — there is no edit surface or view to swap into; the card's only action is the download side effect.

Unlike most other `EmployeeManagement.*` components, the paystubs surface is exported only as a card and not as a block: there is no edit form to orchestrate transitions with, so the card is the entire feature. Render it inline anywhere a `<div>` would go; wrap it in your own error and suspense boundaries if you want fallback UI for those scenarios.

```jsx
import { componentEvents, EmployeeManagement } from '@gusto/embedded-react-sdk'

function MyPaystubsPanel({ employeeId }) {
return (
<EmployeeManagement.PaystubsCard
employeeId={employeeId}
onEvent={(eventType, payload) => {
if (eventType === componentEvents.EMPLOYEE_MANAGEMENT_PAYSTUBS_CARD_DOWNLOADED) {
// payload is { employeeId, payrollUuid }
}
}}
/>
)
}
```

The card populates its "Payment method" column from the employee's payment method, which it fetches internally alongside the paystubs list — the per-paystub event payload does not carry the payment method itself.

#### Props

| Name | Type | Description |
| ------------------- | -------- | -------------------------------------- |
| employeeId Required | string | The associated employee identifier. |
| onEvent Required | function | See events table for available events. |

#### Events

| Event type | Description | Data |
| ---------------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------- |
| EMPLOYEE_MANAGEMENT_PAYSTUBS_CARD_DOWNLOAD_REQUESTED | Fired when the user clicks a row's download button, before the PDF is fetched | { employeeId: string, payrollUuid: string } |
| EMPLOYEE_MANAGEMENT_PAYSTUBS_CARD_DOWNLOADED | Fired after the paystub PDF is successfully fetched and opened in a new tab | { employeeId: string, payrollUuid: string } |
1 change: 1 addition & 0 deletions sdk-app/src/generated-registry-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const ENTITY_REQUIREMENTS: Record<string, string[]> = {
'EmployeeManagement.PaymentMethodBankForm': ['employeeId'],
'EmployeeManagement.PaymentMethodCard': ['employeeId'],
'EmployeeManagement.PaymentMethodSplitForm': ['employeeId'],
'EmployeeManagement.PaystubsCard': ['employeeId'],
'EmployeeManagement.Profile': ['employeeId'],
'EmployeeManagement.ProfileCard': ['employeeId'],
'EmployeeManagement.ProfileEditForm': ['employeeId'],
Expand Down
Loading
Loading