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

# Expense Reports

## 1. How it works

Tight's Financial Reporting API makes it easy for you to provide your users with expense reports. Take a look at our [Financial Reporting docs](/v5.0/products/financial-statements) for an overview on how to easily generate reports for your users.

## 2. Pick the most applicable expense report

Depending on your target user's profile and your app's positioning, the best expense report for your use case may vary. Tight provides the following expense reports, all of which can be [customized to match your branding](/v5.0/products/financial-statements#7-customizing-reports-to-match-your-branding):

| Title                                 | Available Formats | Name (for use in code)     |
| :------------------------------------ | :---------------- | :------------------------- |
| Business Expenses by Business         | HTML, PDF, JSON   | expensesByBusiness         |
| Business Expenses by Category         | HTML, PDF, JSON   | expensesByCategory         |
| Business Expenses by Client           | HTML, PDF, JSON   | expensesByClient           |
| Business Expenses by Vendor           | HTML, PDF, JSON   | expensesByVendor           |
| Expense Details List with Receipts    | XLS               | expenseList                |
| Personal Expenses by Category         | HTML, PDF, JSON   | personalExpensesByCategory |
| Personal Expenses by Vendor           | HTML, PDF, JSON   | personalExpensesByVendor   |
| Total Expenses from Recurring Vendors | HTML, PDF, JSON   | recurringVendors           |

## 3. Populate the desired parameters

Each report has a varying list of available parameters, e.g. to filter data to a certain date range. Where applicable, reports can be filtered to specific businesses (e.g. for users with multiple streams of income) and/or clients as well. The list of available parameters for each of the expense reports is listed below:

| Report name                | Available parameters                                             |
| :------------------------- | :--------------------------------------------------------------- |
| expensesByBusiness         | beginDate, endDate, businessIds (optional), clientIds (optional) |
| expensesByCategory         | beginDate, endDate, businessIds (optional), clientIds (optional) |
| expensesByClient           | beginDate, endDate, businessIds (optional), clientIds (optional) |
| expensesByVendor           | beginDate, endDate                                               |
| expenseList                | beginDate, endDate                                               |
| personalExpensesByCategory | beginDate, endDate                                               |
| personalExpensesByVendor   | beginDate, endDate                                               |
| recurringVendors           | beginDate, endDate                                               |

The format for each parameter is listed below:

| Parameter name | Format               | Example           |
| :------------- | :------------------- | :---------------- |
| beginDate      | `YYYY-MM-DD`         | "2020-01-01"      |
| endDate        | `YYYY-MM-DD`         | "2020-12-31"      |
| businessIds    | Array of numeric IDs | \[416080, 416077] |
| clientIds      | Array of numeric IDs | \[805609]         |

> 📘 `businessIds` and `clientIds` are optional. If neither are provided, then the generated report will contain all of the user's businesses and clients. If the user wishes to filter the report to specific businesses, then `businessIds` should be provided. If the user wishes to filter to specific clients, then `clientIds` should be provided, and `businessIds` should be omitted.

## 4. Generate your expense report

Once you've decided on the desired report, you can build a report JSON object, including the `name` of your report, as well as any desired `params`. To [generate the report](/v5.0/products/financial-statements#4-generating-a-financial-report), simply create a POST call, as shown below:

```curl theme={null}
curl \
  --request POST \
  --url https://sandbox.hurdlr.com/rest/v5/reports/report \
  --header 'Authorization: Bearer ${access_token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "expensesByClient",
    "params": {
      "beginDate": "2021-08-01",
      "endDate": "2021-08-31"
    },
    "exportType": "PDF"
  }'
```
