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

# Check Embedded Payroll

> Integrate Check Payroll with Layer to sync payroll data into your customers' books.

## Linking a Business

Use the following steps to establish the connection between a Layer business and a Check company.

<Steps>
  <Step title="Call the Layer Endpoint">
    This step establishes the mapping between a Layer business and a Check company.

    **Endpoint:** `PUT /v1/businesses/{businessId}/payroll/check/configs`

    See the [Layer documentation](/api-reference/v1/create-check-payroll-config) for full details on this endpoint.

    ```json theme={null}
    {
      "check_company_id": "<CHECK_COMPANY_ID>"
    }
    ```

    Once the mapping is established, the Layer system knows to anticipate an OAuth flow.
  </Step>

  <Step title="Call the Check Endpoint">
    Proceed to authorize the integration with Check Payroll.

    **Endpoint:** `PUT /integrations/partners/{integrationPartnerId}/authorize`

    See the [Check documentation](https://docs.checkhq.com/reference/integration-partners-copy) for full details on this endpoint.

    ```json theme={null}
    {
      "company": "<CHECK_COMPANY_ID>",
      "integration_permission": "<INTEGRATION_PERMISSION_ID>",
      "tos_timestamp": "<ISO_DATE>",
      "product_purchase_timestamp": "<ISO_DATE>"
    }
    ```
  </Step>
</Steps>

## Check IDs

The `integrationPartnerId` and `integrationPermissionId` values used in Step 2 differ between sandbox and production.

<Tabs>
  <Tab title="Sandbox">
    Use these fixed values for sandbox testing:

    | Parameter                 | Value                      |
    | ------------------------- | -------------------------- |
    | Integration Partner ID    | `int_Ccn63OpX6zKfIvssRdyB` |
    | Integration Permission ID | `ipe_S2LMi4ckzax5YdN8BokZ` |
  </Tab>

  <Tab title="Production">
    Production IDs must be fetched from the Check API using your own credentials.

    **Fetch the Integration Partner ID**

    Call `GET /integrations/partners` and find the entry where `name` is `"Layer"`.

    See the [Check documentation](https://docs.checkhq.com/reference/integration-partners) for full details.

    ```bash cURL theme={null}
    curl https://api.checkhq.com/integrations/partners \
      -H "Authorization: Bearer <CHECK_ACCESS_TOKEN>"
    ```

    ```json Response theme={null}
    {
      "results": [
        {
          "id": "<INTEGRATION_PARTNER_ID>",
          "name": "Layer",
          "description": "Embedded accounting"
        }
      ]
    }
    ```

    **Fetch the Integration Permission ID**

    Call `GET /integrations/permissions` and find the entry whose `integration_partner` matches the ID returned above and whose `access_type` is `"Active"`.

    ```bash cURL theme={null}
    curl https://api.checkhq.com/integrations/permissions \
      -H "Authorization: Bearer <CHECK_ACCESS_TOKEN>"
    ```

    ```json Response theme={null}
    {
      "results": [
        {
          "id": "<INTEGRATION_PERMISSION_ID>",
          "access_type": "Active",
          "integration_partner": "<INTEGRATION_PARTNER_ID>",
          "scope": []
        }
      ]
    }
    ```
  </Tab>
</Tabs>
