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

# Bill

## Overview

<CardGroup cols={3}>
  <Card title="Pre-built tooling" icon="screwdriver-wrench" href="#pre-built-tooling" />

  <Card title="Pre-built integrations" icon="square-check" href="#pre-built-integrations" />

  <Card title="Access requirements" icon="triangle-exclamation" href="#access-requirements" />

  <Card title="Setup guide" icon="rocket" href="#setup-guide" />

  <Card title="Useful links" icon="circle-info" href="#useful-links" />

  <Card title="API gotchas" icon="biohazard" href="#api-gotchas" />
</CardGroup>

## Pre-built tooling

<AccordionGroup>
  <Accordion title="✅ Authorization">
    | Tools                          | Status |
    | ------------------------------ | ------ |
    | Pre-built authorization (Bill) | ✅      |
    | Pre-built authorization UI     | ✅      |
    | Custom authorization UI        | ✅      |
    | End-user authorization guide   | 🚫     |
    | Expired credentials detection  | ✅      |
  </Accordion>

  <Accordion title="✅ Read & write data">
    | Tools                                     | Status                         |
    | ----------------------------------------- | ------------------------------ |
    | Pre-built integrations                    | ✅                              |
    | API unification                           | ✅                              |
    | 2-way sync                                | ✅                              |
    | Webhooks from Nango on data modifications | ✅                              |
    | Real-time webhooks from 3rd-party API     | 🚫 (time to contribute: \<48h) |
    | Proxy requests                            | ✅                              |
  </Accordion>

  <Accordion title="✅ Observability & data quality">
    | Tools                   | Status |
    | ----------------------- | ------ |
    | HTTP request logging    | ✅      |
    | End-to-end type safety  | ✅      |
    | Data runtime validation | ✅      |
    | OpenTelemetry export    | ✅      |
    | Slack alerts on errors  | ✅      |
    | Integration status API  | ✅      |
  </Accordion>

  <Accordion title="✅ Customization">
    | Tools                              | Status                         |
    | ---------------------------------- | ------------------------------ |
    | Create or customize use-cases      | ✅                              |
    | Pre-configured pagination          | 🚫 (time to contribute: \<48h) |
    | Pre-configured rate-limit handling | 🚫 (time to contribute: \<48h) |
    | Per-customer configurations        | ✅                              |
  </Accordion>
</AccordionGroup>

### Users

| Function name  | Description                               | Type                                           | Source code                                                                                                       |
| -------------- | ----------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `create-user`  | Creates a user in Bill.                   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/bill/actions/create-user.ts)  |
| `disable-user` | Archive an existing user in Bill          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/bill/actions/disable-user.ts) |
| `users`        | Fetches a list of users from Bill sandbox | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/bill/syncs/users.ts)          |

## Access requirements

| Pre-Requisites    | Status | Comment |
| ----------------- | ------ | ------- |
| Paid dev account  | ❓      |         |
| Paid test account | ❓      |         |
| Partnership       | ❓      |         |
| App review        | ❓      |         |
| Security audit    | ❓      |         |

## Setup guide

*No setup guide yet.*

<Tip>Need help getting started? Get help in the [community](https://nango.dev/slack).</Tip>

<Note>Contribute improvements to the setup guide by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/bill.mdx)</Note>

## Useful links

* [Bill Authentication docs](https://developer.bill.com/docs/api-sandbox-sign-in)
* [Bill API docs](https://developer.bill.com/reference)
* [API rate limiting](https://developer.bill.com/docs/api-rate-limits)

<Note>Contribute useful links by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/bill.mdx)</Note>

## API gotchas

* If you would like to set up a sandbox API environment, one can sign up [here](https://www-test.bill.com/signup?env=stage). Once you have successfully created an account, please [email](mailto:developerprogram@hq.bill.com) the team and they will send you the API credentials.
* When creating a new connection in Nango, please provide the following: Username (the email address used to sign in to your BILL developer account), Password (used to sign in to your BILL developer account), Organization ID (a unique alphanumeric value beginning with 008 that represents your organization), and Developer key (provided by the team and used to identify your developer account in API requests).
* After creating a connection, you can use the credentials as follows;

```js theme={null}
const connection = await nango.getConnection();
// Initialize credentials object
let credentials: { session_id?: string; dev_key?: string } = {};

// Check for session ID and developer key
if ('session_id' in connection.credentials && 'dev_key' in connection.credentials) {
    credentials = {
        session_id: connection.credentials.session_id,
        dev_key: connection.credentials.dev_key,
        };
    } else {
        throw new nango.ActionError({
            message: `Session ID and Developer Key are incomplete or missing`
        });
    }

    // Define the configuration for the API call
    const config: ProxyConfiguration = {
        endpoint: 'users',
        retries: 10,
        paginate: {
            type: 'cursor',
            cursor_name_in_request: 'page',
            cursor_path_in_response: 'nextPage',
            response_path: 'results',
            limit_name_in_request: 'max',
            limit: 100
        },
        headers: {
            sessionId: credentials.session_id,
            devKey: credentials.dev_key
        },
    };
```

<Note>Contribute API gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/bill.mdx)</Note>

<Card title="Connect to Bill.com" icon="link" href="/integrations/all/bill-sandbox/connect" horizontal>
  Guide to connect to Bill.com sandbox using Nango Connect.
</Card>
