> ## 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.

# Expensify

## 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 (Basic) | ✅      |
    | 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`  | Create a user in the account            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/expensify/actions/create-user.ts)  |
| `disable-user` | Disables a user in Expensify            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/expensify/actions/disable-user.ts) |
| `users`        | Fetches a list of users from Expensify. | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/expensify/syncs/users.ts)          |

### Others

| Function name   | Description                                                                  | Type                                         | Source code                                                                                                             |
| --------------- | ---------------------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `list-policies` | Action to fetch a list of policies with some relevant information about them | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/expensify/actions/list-policies.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/expensify.mdx)</Note>

## Useful links

* [Generate API credentials](https://www.expensify.com/tools/integrations/)
* [API docs](https://integrations.expensify.com/Integration-Server/doc)
* [Auth-related docs](https://integrations.expensify.com/Integration-Server/doc/#authentication)

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

## API gotchas

* Expensify in Nango uses `Basic` auth mode to access different endpoints. Provide your `partnerUserID` as the Username value and `partnerUserSecret` as the Password value.
* After creating a connection, you can use the Basic credentials as follows;

```js theme={null}
const connection = await nango.getConnection();
let credentials: { partnerUserID?: string; partnerUserSecret?: string } = {};
        if ('username' in connection.credentials && 'password' in connection.credentials) {
            credentials = {
                partnerUserID: connection.credentials.username,
                partnerUserSecret: connection.credentials.password,
            };
        } else {
            throw new nango.ActionError({
                message: `Basic API credentials are incomplete`
            });
        }
        const postData = 'requestJobDescription=' + encodeURIComponent(JSON.stringify({
            type: input.requestJobDescription.type,
            credentials: credentials,
            inputSettings: {
                type: input.inputSettings.type
            }
        }));

        const resp = await nango.post({
            baseUrlOverride: `https://integrations.expensify.com/Integration-Server`,
            endpoint: `/ExpensifyIntegrations`,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
            },
            data: postData,
        });
```

* You can have a look at the [pre-built integrations](#pre-built-integrations)
* Every request has to be made against the same endpoint.
* Expensify enforces a general rate limit of 50 jobs started per minute.

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

<Card title="Connect to expensify" icon="link" href="/integrations/all/expensify/connect" horizontal>
  Guide to connect to Expensify using Nango Connect.
</Card>
