# Expensify

> Automate expense reports and policy management in Expensify.

App · Accounting & Finance · 4 actions. Web page: https://docs.lodol.com/docs/integrations/expensify

## Actions

### Create Expensify policy

Create a new Expensify workspace/policy.

**Inputs**

- Policy name (`policy_name`, text, required): Name for the new workspace/policy.

**Outputs**

- `policyID` (text): ID of the created policy. Use as policy_id in export_reports.

**Example output**

```json
{
  "policyID": "NEW123POLICY"
}
```

### Export expense reports

Export expense reports from Expensify with flexible filters. Each report includes its expenses, with amounts in dollars (not cents).

**Inputs**

- Start date (`start_date`, text): Start date for the export range (YYYY-MM-DD). Required unless you provide a list of report IDs.
- End date (`end_date`, text): End date for the export range (YYYY-MM-DD). Date range cannot exceed one year.
- Report ID list (`report_id_list`, text): Report IDs to export, separated by commas. Required unless you provide a start date. You can find report IDs in the results of an earlier 'Export expense reports' action.
- Report status (`report_state`, text): Optional. Only include reports with this status. One of: `OPEN` (Open (draft)), `SUBMITTED` (Submitted (awaiting approval)), `APPROVED`, `REIMBURSED`, `ARCHIVED` (Archived / closed).
- Policy ID (`policy_id`, text): Only include reports from this policy (workspace). You can get the ID from the 'List Expensify policies' or 'Create Expensify policy' actions.
- Limit (`limit`, number): Maximum number of reports to export.

**Outputs**: Array of exported report objects with nested expenses.

**Example output**

```json
[
  {
    "currency": "USD",
    "expenses": [
      {
        "amount": 350.0,
        "category": "Travel",
        "date": "2024-03-15",
        "merchant": "Delta Airlines",
        "transactionID": "T001"
      }
    ],
    "policyName": "Default Policy",
    "reportID": "R00abc123",
    "reportName": "March Travel",
    "status": "Approved",
    "submitter": "user@example.com",
    "total": 450.75
  }
]
```

### List Expensify policies

List all policies (workspaces) your Expensify account has access to.

**Inputs**

- Admin only (`admin_only`, true/false): Set to true to only include policies where you are an admin. Default: `false`.

**Outputs**: Array of policy summary objects.

**Example output**

```json
[
  {
    "id": "ABC123DEF456",
    "name": "Engineering Team",
    "role": "admin",
    "type": "corporate"
  }
]
```

### Mark reports as reimbursed

Mark reports as reimbursed. Only Approved reports will be updated; others are skipped. You can get report IDs from the 'Export expense reports' action.

**Inputs**

- Report ID list (`report_id_list`, text): Report IDs to mark as reimbursed, separated by commas. Required unless you provide a start date. You can get report IDs from the 'Export expense reports' action.
- Start date (`start_date`, text): Start date filter (YYYY-MM-DD). Required unless you provide a list of report IDs.
- End date (`end_date`, text): End date filter (YYYY-MM-DD).
- Payment source (`payment_source`, text): Optional description of the payment source (1-100 characters).

**Outputs**

- `reportIDsUpdated` (list): List of report IDs that were successfully marked as reimbursed.

**Example output**

```json
{
  "reportIDsUpdated": [
    "R00abc123",
    "R00def456"
  ]
}
```
