> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argyle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Employments

> Match payroll records to the same employment.

## Definition

An employment represents a job associated with a connected payroll account. One account can contain data from more than one employment.

A [user](https://docs.argyle.com/overview/data-structure/users.md) represents the person sharing information. An [account](https://docs.argyle.com/overview/data-structure/accounts.md) represents their connection to an income source. Employments identify the jobs associated with that connection.

For example, a user may have worked for two employers that use the same payroll provider. After an account is connected, paystubs may be available from both employers, even when the identity information only describes one job.

## Matching records

The `employment` field is available on [Identities](https://docs.argyle.com/api-reference/identities.md), [Paystubs](https://docs.argyle.com/api-reference/paystubs.md), [Payroll Documents](https://docs.argyle.com/api-reference/payroll-documents.md), and [Gigs](https://docs.argyle.com/api-reference/gigs.md). Records with the same employment ID belong to the same employment.

Employer names can differ between records for the same job. Use the employment ID to match them:

| Record | Employer | `employment` |
| - | - | - |
| Identity | Bob's Donuts | `0183d52a-d3b2-331d-c753-3662a20e352b` |
| Paystub | Bob's Donuts Associates, LLC | `0183d52a-d3b2-331d-c753-3662a20e352b` |
| Paystub | Suzy's Cupcakes | `null` |

In this example, the identity's employment status applies to Bob's Donuts. It should not be applied to the unmatched Suzy's Cupcakes paystub.

> [!NOTE]
>
> Paystubs and payroll documents can have a `null` employment when they cannot be matched to an employment. These records can still contain useful information. A shared `null` value does not mean that records belong to the same employment.

Employment IDs are also used when an account contains only one employment. Gigs and Shifts do not support filtering by employment.

## Retrieve all records, then match

Use this approach when you need all available records, including paystubs that are not matched to an employment.

1. Retrieve identities, paystubs, payroll documents, and gigs using the `user` or `account` filter. Follow pagination to retrieve all available records.
2. Store the `employment` value with each record.
3. Match records with the same non-null employment ID. Keep unmatched records available for separate review or processing.

You do not need to call the Employments endpoint for this approach.

## Retrieve records for an employment

Use this approach when you only need records associated with a specific employment.

1. [List employments](https://docs.argyle.com/api-reference/employments/list-all-employments.md) for the user or account.
2. Use the returned employment `id` as the `employment` filter when listing identities, paystubs, or payroll documents.

```text theme={}
GET /v2/employments?account=0187c66e-e7e5-811c-b006-2232f00f426a
GET /v2/identities?employment=0183d52a-d3b2-331d-c753-3662a20e352b
GET /v2/paystubs?employment=0183d52a-d3b2-331d-c753-3662a20e352b
GET /v2/payroll-documents?employment=0183d52a-d3b2-331d-c753-3662a20e352b
```

> [!NOTE]
>
> Filtering by employment excludes unmatched records. If your application needs the applicant's full available income history, retrieve all records and match them afterward.

Both approaches use the same [data delivery webhooks](https://docs.argyle.com/overview/data-delivery.md). An account connection alone does not mean its identities, paystubs, payroll documents, or gigs are ready.

See the [Employments API Reference](https://docs.argyle.com/api-reference/employments.md) for the complete object and its fields.

## Testing

A payroll account may contain paystubs from multiple jobs. Use the custom test user below to test this mixed-employment scenario in Sandbox and retrieve the paystubs for the job associated with the connected account.

1. Open a Flow in Console with Sandbox mode enabled, or initialize embedded Link with `sandbox: true`. See [Sandbox Testing](https://docs.argyle.com/overview/sandbox-testing.md#connect-sample-users).
2. In Link, select an Item that supports mixed employments testing, such as **ADP**.
3. Enter username `test_1` and the password below. If prompted for a verification code, enter `8081`.

```text Password theme={}
eyJzdGF0aWNfZGF0YV9zZXRfaWQiOiAiNGY4NjY3YjEtMGYyNS00Mzg2LTkzYTUtYWIyOGY3MTM5OGE1IiwgImluaXRpYWxfc2Nhbl9kZWxheV9pbl9zZWNvbmRzIjogMCwgInNraXBfZnVsbHlfc3luY2VkIjogZmFsc2V9
```

After [data delivery](https://docs.argyle.com/overview/data-delivery.md) completes, use your Sandbox API credentials to:

1. Retrieve the account's [identity information](https://docs.argyle.com/api-reference/identities.md) to identify the job and read its `employment` ID.
2. Use that ID as the `employment` filter when [listing paystubs](https://docs.argyle.com/api-reference/paystubs/list-all-paystubs.md). The returned paystubs will have the same employment ID as the identity.

```text theme={}
GET https://api-sandbox.argyle.com/v2/identities?account=ACCOUNT_ID
GET https://api-sandbox.argyle.com/v2/paystubs?employment=EMPLOYMENT_ID
```

Paystubs from other jobs will have `employment: null` and are excluded by this filter. To retrieve all of the account's paystubs, including those from other jobs, query by account instead:

```text theme={}
GET https://api-sandbox.argyle.com/v2/paystubs?account=ACCOUNT_ID
```

Follow pagination and confirm that your application:

* Matches paystubs with the same non-null employment ID as the identity.
* Retains paystubs with `employment: null` without applying the identity's employment status to them.
* Excludes unmatched paystubs only when you intentionally use the `employment` filter.
